:root {
  --primary: #0f766e;
  --primary-2: #14b8a6;
  --text: #172725;
  --muted: #667b78;
  --line: #d8e4e2;
  --bg: #f3f7f6;
  --card: #ffffff;
  --danger: #b7352b;
  --warn: #9a6500;
  --success: #0c7a49;
  --shadow: 0 12px 34px rgba(25, 65, 61, .08);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
button, input, textarea { font: inherit; }
button:disabled { opacity: .45; cursor: not-allowed; }
.hidden { display: none !important; }
.app-header {
  background: linear-gradient(135deg, #0f766e, #12a99c);
  color: #fff;
  padding: 24px max(24px, calc((100vw - 1400px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.eyebrow { font-size: 12px; letter-spacing: .08em; opacity: .78; }
h1 { margin: 7px 0 5px; font-size: clamp(28px, 4vw, 44px); }
.app-header p { margin: 0; opacity: .9; line-height: 1.6; }
.version-tag {
  display: inline-block;
  vertical-align: middle;
  font-size: 12px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 999px;
  padding: 4px 9px;
}
.privacy-badge {
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.11);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
}
main { max-width: 1460px; margin: 0 auto; padding: 24px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.upload-panel { max-width: 900px; margin: 24px auto; padding: 26px; }
.section-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.section-title h2, .sidebar-head h2 { margin: 0 0 4px; }
.section-title p, .sidebar-head p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 13px; }
.step-number {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #dff5f1;
  color: var(--primary);
  font-weight: 800;
  flex: none;
}
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.file-box {
  min-height: 170px;
  border: 2px dashed #9fc9c4;
  border-radius: 16px;
  padding: 20px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  text-align: center;
  cursor: pointer;
  background: #fbfdfd;
  transition: .16s ease;
}
.file-box:hover, .file-box.dragover { border-color: var(--primary); background: #f0faf8; transform: translateY(-1px); }
.file-box.ready { border-style: solid; border-color: #55b8ae; background: #eefaf8; }
.file-box input { display: none; }
.file-icon { font-size: 30px; }
.drop-hint, .file-box small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.paste-panel {
  margin: 16px 0;
  padding: 15px;
  border: 1px solid #bdd8d4;
  background: linear-gradient(180deg, #f6fbfa, #eff8f6);
  border-radius: 16px;
}
.paste-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.paste-head > div { display: grid; gap: 3px; }
.paste-head span { color: var(--muted); font-size: 12px; }
kbd {
  border: 1px solid #b8c7c5;
  border-bottom-width: 2px;
  border-radius: 7px;
  padding: 4px 7px;
  background: #fff;
  color: #36514e;
  font-weight: 700;
}
#pasteCatcher {
  width: 100%;
  min-height: 76px;
  resize: none;
  border: 2px dashed #8abfb8;
  border-radius: 12px;
  padding: 14px;
  outline: none;
  color: transparent;
  caret-color: transparent;
  background: rgba(255,255,255,.92);
}
#pasteCatcher::placeholder { color: #486b67; opacity: 1; }
#pasteCatcher:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15,118,110,.1); }
.paste-note { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.btn {
  border: 0;
  border-radius: 11px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 700;
  transition: .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #dff3f0; color: #135e57; }
.btn-ghost { background: #edf2f1; color: #455e5b; }
.btn-large { width: 100%; min-height: 50px; font-size: 16px; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.message { margin-top: 14px; border: 1px solid; border-radius: 12px; padding: 12px 14px; line-height: 1.6; }
.message-error { color: var(--danger); background: #fff1ef; border-color: #efc0ba; }
.message-success { color: var(--success); background: #edf9f3; border-color: #b9e2ca; }
.message-warn { color: var(--warn); background: #fff8e9; border-color: #ecd098; }
.workspace { display: grid; gap: 16px; }
.topbar {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar > div:first-child { display: grid; gap: 4px; }
.topbar span { color: var(--muted); font-size: 12px; }
.diagnostics { display: grid; gap: 10px; }
.diag { border-radius: 12px; padding: 12px 14px; border: 1px solid; line-height: 1.55; }
.diag-ok { color: #075f39; background: #edf9f3; border-color: #b9e2ca; }
.diag-warn { color: #845000; background: #fff8eb; border-color: #f1d39e; }
.diag-error { color: #9f241b; background: #fff0ee; border-color: #efc0ba; }
.workspace-grid { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 16px; align-items: start; }
.buyer-sidebar { padding: 15px; position: sticky; top: 86px; max-height: calc(100vh - 105px); overflow: auto; }
.sidebar-head { padding: 3px 2px 13px; border-bottom: 1px solid var(--line); }
.buyer-list { display: grid; gap: 10px; margin-top: 12px; }
.buyer-nav {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 13px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 5px;
}
.buyer-nav.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,.1); background: #f5fbfa; }
.buyer-nav.sent { border-left: 5px solid #16a060; }
.buyer-nav strong { overflow-wrap: anywhere; }
.buyer-nav small { color: var(--muted); }
.buyer-workspace { overflow: hidden; min-height: 760px; }
.buyer-banner {
  padding: 20px 22px;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #25beb1);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.buyer-banner h2 { margin: 4px 0; font-size: clamp(25px, 4vw, 38px); overflow-wrap: anywhere; }
.buyer-banner p { margin: 0; opacity: .88; }
.buyer-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stat-pill {
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 10px 13px;
  font-weight: 800;
  white-space: nowrap;
}
.buyer-body { padding: 18px; display: grid; gap: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.info-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.info-box.wide { grid-column: span 2; }
.info-box.full { grid-column: 1 / -1; }
.info-label { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.info-value { font-weight: 750; line-height: 1.5; overflow-wrap: anywhere; }
.message-builder { border: 1px solid var(--line); border-radius: 16px; padding: 15px; background: #f9fcfb; }
.message-builder-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.message-builder-head h3 { margin: 0 0 3px; }
.message-builder-head p { margin: 0; color: var(--muted); font-size: 12px; }
.lang-switch { display: flex; gap: 7px; flex-wrap: wrap; }
.lang-btn {
  border: 1px solid #bfd6d2;
  background: #fff;
  color: #355d58;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}
.lang-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.message-textarea {
  width: 100%;
  min-height: 190px;
  border: 1px solid #cbdedb;
  border-radius: 13px;
  padding: 15px;
  resize: vertical;
  outline: none;
  background: #fff;
  line-height: 1.65;
  color: var(--text);
}
.message-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15,118,110,.08); }
.builder-actions { margin-top: 11px; display: flex; gap: 10px; flex-wrap: wrap; }
.package-section { display: grid; gap: 12px; }
.section-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-row h3 { margin: 0; }
.section-row p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.package-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.package-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: grid;
  grid-template-rows: auto auto 360px;
}
.package-head { padding: 11px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.package-head strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.package-head small { color: var(--muted); display: block; margin-top: 4px; }
.package-meta { padding: 10px 12px; background: #f8fbfb; color: #47605d; font-size: 12px; line-height: 1.55; border-bottom: 1px solid var(--line); }
.package-viewer { width: 100%; height: 100%; border: 0; background: #f0f3f2; }
.missing-label { display: grid; place-items: center; text-align: center; color: var(--danger); padding: 20px; background: #fff3f1; }
.send-panel {
  border: 1px solid #b9ddd7;
  background: linear-gradient(180deg, #f1fbf9, #eaf7f5);
  border-radius: 16px;
  padding: 15px;
}
.send-panel h3 { margin: 0 0 5px; }
.send-panel p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.send-status { margin-top: 10px; color: var(--muted); font-size: 12px; }
.send-status.ok { color: var(--success); font-weight: 800; }
.empty-workspace { min-height: 620px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(8, 23, 21, .76); padding: 18px; display: grid; place-items: center; }
.modal-shell { width: min(1100px, 100%); height: min(94vh, 1050px); background: #fff; border-radius: 16px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.modal-head { padding: 12px 15px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.modal-head > div { display: grid; gap: 3px; }
.modal-head small { color: var(--muted); }
.icon-btn { width: 38px; height: 38px; border: 0; border-radius: 10px; cursor: pointer; font-size: 18px; }
.screenshot-shell { grid-template-rows: auto auto 1fr; }
.screenshot-toolbar { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pdf-counter { min-width: 80px; text-align: center; font-weight: 800; }
#pdfModalViewer { width: 100%; height: 100%; border: 0; background: #242424; }
.history-shell { grid-template-rows: auto auto 1fr; }
.history-toolbar { padding: 12px 15px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.history-toolbar input { flex: 1; min-width: 260px; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; outline: none; }
.history-list { padding: 15px; overflow: auto; display: grid; gap: 11px; align-content: start; }
.history-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 6px; }
.history-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.history-row span { font-size: 12px; border-radius: 999px; padding: 4px 10px; background: #edf9f3; color: #075f39; }
.history-sub { color: #4c6461; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.history-message { background: #f7faf9; border: 1px dashed #d4e3e0; border-radius: 10px; padding: 10px; white-space: pre-wrap; font-size: 12px; line-height: 1.6; }
.toast { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; background: #153d39; color: #fff; padding: 12px 17px; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.22); max-width: 90vw; text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@media (max-width: 1050px) {
  .workspace-grid { grid-template-columns: 250px minmax(0,1fr); }
  .info-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .package-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-header { padding: 19px 16px; align-items: flex-start; }
  .privacy-badge { display: none; }
  main { padding: 12px; }
  .upload-panel { margin: 12px auto; padding: 17px; }
  .upload-grid { grid-template-columns: 1fr; }
  .file-box { min-height: 135px; }
  .paste-shortcut { display: none; }
  .topbar { position: static; display: grid; }
  .workspace-grid { grid-template-columns: 1fr; }
  .buyer-sidebar { position: static; max-height: none; }
  .buyer-banner { display: grid; align-items: start; }
  .buyer-stats { justify-content: flex-start; }
  .buyer-body { padding: 12px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .info-box.wide, .info-box.full { grid-column: 1 / -1; }
  .message-builder-head { display: grid; }
  .package-card { grid-template-rows: auto auto 480px; }
  .section-row { display: grid; }
  .modal { padding: 8px; }
  .modal-shell { height: 98vh; }
}
