/* ============================================================
   Quayside — design system (impeccable.style "Operate" mode)
   令牌：近单色纸感画布 + 唯一强调色；发丝线为唯一装饰；
   表格优先；静态状态点；动效预算 120/200/320ms。
   ============================================================ */

/* ---------- Tokens ---------- */
@supports (color: oklch(62% 0.19 41)) {
  :root {
    --accent: oklch(62% 0.19 41);
    --accent-hover: oklch(55% 0.19 41);
  }
}
:root {
  /* 画布与表面 */
  --canvas: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #efefec;
  --ink: #16181a;
  --ink-2: #565b60;
  --ink-3: #6f757b;
  --hairline: rgba(22, 24, 26, .14);
  --hairline-strong: rgba(22, 24, 26, .26);

  /* 唯一强调色（带 @supports 升级为 oklch，见文件顶部） */
  --accent: #d1520a;
  --accent-hover: #b74708;
  --accent-subtle: rgba(209, 82, 10, .10);
  --on-accent: #ffffff;

  /* 状态（去饱和，永远伴随文字） */
  --ok: #1f7a43;
  --warn: #9a6a00;
  --bad: #bb3a2e;
  --info: #2a6395;
  --ok-subtle: rgba(31, 122, 67, .09);
  --warn-subtle: rgba(154, 106, 0, .10);
  --bad-subtle: rgba(187, 58, 46, .09);
  --info-subtle: rgba(42, 99, 149, .09);

  /* 字体 */
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-data: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;

  /* 字阶（6 档 + 微标签） */
  --text-display: 2.25rem;  /* 36 */
  --text-h2: 1.5rem;        /* 24 */
  --text-h3: 1.125rem;      /* 18 */
  --text-body: 1rem;        /* 16 */
  --text-ui: .875rem;       /* 14 */
  --text-data: .8125rem;    /* 13 */
  --text-label: .6875rem;   /* 11 */

  /* 间距 4px 基 */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2.5rem; --sp-7: 4rem;

  /* 半径与阴影（边线或阴影，绝不同时） */
  --radius-s: 4px; --radius-m: 8px;
  --shadow-1: 0 1px 2px rgba(22,24,26,.06), 0 2px 8px rgba(22,24,26,.08);
  --shadow-2: 0 4px 12px rgba(22,24,26,.10), 0 12px 32px rgba(22,24,26,.12);

  /* 动效 */
  --dur-feedback: 120ms; --dur-state: 200ms; --dur-overlay: 320ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);

  /* 密度 */
  --row-h: 2.75rem;
  --control-h: 2.5rem;
  --shell-pad: var(--sp-6);
}
[data-density="compact"] {
  --row-h: 2.3125rem;   /* 37 */
  --control-h: 2.25rem; /* 36 */
}

/* ---------- Reset + craft floor ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent);
}
::selection { background: var(--accent-subtle); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(22,24,26,.22); border-radius: 5px; border: 2px solid var(--canvas); }
::-webkit-scrollbar-track { background: transparent; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 15rem 1fr; min-height: 100dvh; }
.side {
  border-right: 1px solid var(--hairline);
  padding: var(--sp-6) var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-5);
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  background: var(--canvas);
}
.brand { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-2); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-top .brand-name { font-size: var(--text-ui); }
.logo-mark { display: inline-flex; flex: none; border-radius: 6px; overflow: hidden; }
.brand-name { font-size: var(--text-h3); font-weight: 650; letter-spacing: -0.02em; }
.brand-sub { font-size: var(--text-label); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-3); height: 2.25rem; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none; font-size: var(--text-ui); font-weight: 500;
  transition: background var(--dur-feedback) var(--ease-out), color var(--dur-feedback) var(--ease-out);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }
.nav a .ic { width: 18px; height: 18px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-3); font-size: var(--text-data); color: var(--ink-3); padding: 0 var(--sp-2); }
.quota-hud { display: flex; flex-direction: column; gap: var(--sp-1); }
.quota-row { display: flex; align-items: center; gap: var(--sp-2); justify-content: space-between; }
.meter { height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--ink-3); border-radius: 2px; transition: width var(--dur-state) var(--ease-out); }
.meter > i.low { background: var(--warn); }
.meter > i.empty { background: var(--bad); }

.main { min-width: 0; }
.topbar {
  display: none; position: sticky; top: 0; z-index: 30;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  padding: var(--sp-3) var(--sp-4);
  align-items: center; justify-content: space-between; gap: var(--sp-3);
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .topbar { background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(8px); }
}
.topbar .brand-name { font-size: var(--text-ui); }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-s);
  box-shadow: var(--shadow-1);
}
.skip-link:focus { left: var(--sp-4); top: var(--sp-4); }
.offline-banner {
  display: none; align-items: center; gap: var(--sp-2);
  background: var(--warn-subtle); color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  padding: var(--sp-2) var(--sp-4); font-size: var(--text-ui);
}
body.is-offline .offline-banner { display: flex; }
.update-banner { display: none; }
.update-banner.show { display: flex; }

/* ---------- 版心 ---------- */
.page { max-width: 66rem; margin: 0 auto; padding: var(--sp-7) var(--shell-pad) var(--sp-7); }
.page-head { margin-bottom: var(--sp-6); }
.page-title { font-size: var(--text-display); font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.page-desc { color: var(--ink-2); margin-top: var(--sp-2); max-width: 60ch; }
.section { margin-top: var(--sp-6); }
.section-title { font-size: var(--text-h3); font-weight: 600; margin-bottom: var(--sp-4); padding-top: var(--sp-5); border-top: 1px solid var(--hairline); }
.section:first-of-type .section-title, .page-head + .section .section-title { border-top: 0; padding-top: 0; }
.microlabel { font-size: var(--text-label); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.mono { font-family: var(--font-data); }
.muted { color: var(--ink-3); }
.small { font-size: var(--text-data); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 图标（统一线宽，统一尺寸基线） ---------- */
.ic { display: inline-flex; flex: none; width: 18px; height: 18px; }
.ic svg { width: 100%; height: 100%; }
.empty-ic { width: 28px; height: 28px; color: var(--ink-3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--control-h); padding: 0 var(--sp-4);
  border-radius: var(--radius-m); border: 1px solid var(--hairline-strong);
  background: transparent; color: var(--ink); cursor: pointer;
  font-size: var(--text-ui); font-weight: 550;
  transition: background var(--dur-feedback) var(--ease-out), border-color var(--dur-feedback) var(--ease-out), transform var(--dur-feedback) var(--ease-out);
}
.btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad-subtle); }
.btn-quiet { border-color: transparent; }
.btn .ic { width: 16px; height: 16px; }
.btn-sm { height: 2rem; padding: 0 var(--sp-3); font-size: var(--text-data); }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--accent); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-1); }
.field label { font-size: var(--text-ui); font-weight: 550; }
.field .hint { font-size: var(--text-data); color: var(--ink-3); }
.input, select.input, textarea.input {
  height: var(--control-h); padding: 0 var(--sp-3);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-s);
  background: var(--surface); width: 100%;
  transition: border-color var(--dur-feedback) var(--ease-out);
}
textarea.input { height: auto; min-height: 5.5rem; padding: var(--sp-3); resize: vertical; font-family: var(--font-data); font-size: var(--text-data); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.field-error { font-size: var(--text-data); color: var(--bad); }
.form-grid { display: grid; gap: var(--sp-4); }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-actions { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; margin-top: var(--sp-2); }
fieldset { border: 0; padding: 0; margin: 0; }
.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 2rem; padding: 0 var(--sp-3);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius-full, 999px);
  background: var(--surface); font-size: var(--text-data); cursor: pointer;
  transition: background var(--dur-feedback) var(--ease-out);
}
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"]:hover { background: var(--ink); }

/* ---------- 表格 ---------- */
.table-wrap { border: 1px solid var(--hairline); border-radius: var(--radius-m); overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-data); }
th { text-align: left; font-size: var(--text-label); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--hairline); white-space: nowrap; }
td { padding: 0 var(--sp-4); height: var(--row-h); border-bottom: 1px solid var(--hairline); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--dur-feedback) var(--ease-out); }
tbody tr:hover { background: var(--surface-2); }
tbody tr.selectable { cursor: pointer; }
.table-empty { color: var(--ink-3); padding: var(--sp-5) 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }

/* ---------- 徽标（静态点 + 文字） ---------- */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-data); font-weight: 550; white-space: nowrap; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-ok { color: var(--ok); } .badge-warn { color: var(--warn); }
.badge-bad { color: var(--bad); } .badge-info { color: var(--info); }
.badge-neutral { color: var(--ink-2); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--text-label); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pill-ocean { background: var(--ok-subtle); color: var(--ok); }
.pill-surcharge { background: var(--surface-2); color: var(--ink-2); }
.pill-percent { background: var(--info-subtle); color: var(--info); }
.pill-info { background: var(--info-subtle); color: var(--info); }

/* ---------- 卡片（hairline 或阴影，绝不同时；不嵌套） ---------- */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-m); }
.card-pad { padding: var(--sp-5); }
.card + .card { margin-top: var(--sp-4); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5) 0; }
.card-body { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.rowline { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) 0; }
.rowline + .rowline { border-top: 1px solid var(--hairline); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); font-size: var(--text-data); }
.kv dt { color: var(--ink-3); }
.kv dd { text-align: right; font-family: var(--font-data); }

/* ---------- 时间线（签名组件） ---------- */
.timeline { position: relative; padding-left: 1.25rem; display: flex; flex-direction: column; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--hairline); }
.tl-event { position: relative; padding: var(--sp-2) 0 var(--sp-2) var(--sp-3); }
.tl-event::before { content: ""; position: absolute; left: -1.25rem; top: 1.05rem; width: 11px; height: 11px; border-radius: 50%; background: var(--canvas); border: 2px solid var(--ink-3); }
.tl-act::before { background: var(--ink); border-color: var(--ink); }
.tl-est::before { background: var(--surface); border-style: solid; border-color: var(--ink-3); }
.tl-pln::before { background: var(--canvas); border-style: dashed; border-color: var(--ink-3); }
.tl-current::before { border-color: var(--accent); background: var(--accent-subtle); box-shadow: 0 0 0 3px var(--accent-subtle); }
.tl-title { font-size: var(--text-data); font-weight: 550; display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: baseline; }
.tl-when { color: var(--ink-2); font-family: var(--font-data); font-size: var(--text-data); }
.tl-meta { color: var(--ink-3); font-size: var(--text-label); text-transform: uppercase; letter-spacing: .05em; }
.leg-group { margin-top: var(--sp-5); }
.leg-group:first-child { margin-top: 0; }
.leg-head { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-ui); font-weight: 600; margin-bottom: var(--sp-1); }
.leg-head .muted { font-weight: 400; }
.mode-tag { font-size: var(--text-label); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.mode-rail, .mode-truck, .mode-barge { background: var(--info-subtle); color: var(--info); }

/* ---------- 异常面板 ---------- */
.exc { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--hairline); border-radius: var(--radius-m); background: var(--surface); }
.exc-high { border-color: var(--bad); background: var(--bad-subtle); }
.exc-medium { border-color: var(--warn); background: var(--warn-subtle); }
.exc-low { background: var(--info-subtle); border-color: transparent; }
.exc-info { background: var(--surface-2); border-color: transparent; }
.exc .ic { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.exc-high .ic { color: var(--bad); } .exc-medium .ic { color: var(--warn); }
.exc-low .ic { color: var(--info); } .exc-info .ic { color: var(--ink-3); }
.exc strong { font-size: var(--text-ui); display: block; }
.exc p { font-size: var(--text-data); color: var(--ink-2); margin-top: 2px; }

/* ---------- 空态 / 骨架 / 错误 ---------- */
.empty { text-align: center; padding: var(--sp-7) var(--sp-5); border: 1px dashed var(--hairline-strong); border-radius: var(--radius-m); }
.empty h3 { font-size: var(--text-h3); font-weight: 600; }
.empty p { color: var(--ink-2); font-size: var(--text-ui); max-width: 46ch; margin: var(--sp-2) auto var(--sp-4); }
.skeletons { display: flex; flex-direction: column; gap: var(--sp-2); }
.skel { height: var(--row-h); border-radius: var(--radius-s); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.error-panel { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border: 1px solid var(--hairline); border-radius: var(--radius-m); background: var(--surface); }
.error-panel .ic { color: var(--bad); width: 18px; height: 18px; flex: none; margin-top: 3px; }
.error-panel p { font-size: var(--text-data); color: var(--ink-2); }

/* ---------- Toast / Dialog ---------- */
.toasts { position: fixed; bottom: var(--sp-5); right: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); z-index: 200; }
.toast { display: flex; align-items: center; gap: var(--sp-2); background: var(--ink); color: var(--canvas); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-m); box-shadow: var(--shadow-2); font-size: var(--text-ui); opacity: 0; transform: translateY(6px); transition: opacity var(--dur-overlay) var(--ease-out), transform var(--dur-overlay) var(--ease-out); }
.toast.in { opacity: 1; transform: none; }
.toast .ic { width: 15px; height: 15px; }
.toast-warn .ic, .toast-err .ic { color: #ffb4a8; }
.overlay { position: fixed; inset: 0; background: rgba(22, 24, 26, .38); display: grid; place-items: center; padding: var(--sp-5); z-index: 150; animation: fade var(--dur-overlay) var(--ease-out); }
.dialog { background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow-2); max-width: 34rem; width: 100%; padding: var(--sp-5); animation: pop var(--dur-overlay) var(--ease-out); }
.dialog-title { font-size: var(--text-h3); font-weight: 600; }
.dialog-body { color: var(--ink-2); font-size: var(--text-ui); margin: var(--sp-3) 0 var(--sp-5); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--sp-3); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ---------- 地名自动补全（locode combobox） ---------- */
.locode-field { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.locode-field > label { font-size: var(--text-ui); font-weight: 550; }
.locode-box { position: relative; }
.locode-box .input { width: 100%; padding-right: 5.5rem; }
.locode-badge {
  position: absolute; right: var(--sp-2); top: 50%; transform: translateY(-50%);
  font-family: var(--font-data); font-size: var(--text-data); font-weight: 600;
  color: var(--info); background: var(--info-subtle); border-radius: var(--radius-s);
  padding: 1px 7px; pointer-events: none;
}
.locode-list {
  position: absolute; z-index: 90; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-m);
  box-shadow: var(--shadow-1); list-style: none; margin: 0; padding: 4px;
  max-height: 19rem; overflow-y: auto;
}
.locode-opt {
  display: flex; align-items: baseline; gap: var(--sp-2);
  padding: 0 var(--sp-3); height: 2.5rem; border-radius: var(--radius-s);
  cursor: pointer; font-size: var(--text-data);
}
.locode-opt:hover, .locode-opt.active { background: var(--surface-2); }
.locode-opt.active { box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.locode-opt-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.locode-opt-meta { color: var(--ink-3); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.locode-opt-code { color: var(--ink-2); }
.locode-opt .pill { font-size: 9px; padding: 0 6px; flex: none; }

/* ---------- 本地报价单（模仿 Hapag 官方报价函格式；配色取自真实样本 PDF） ---------- */
.qs-sheet { max-width: 54rem; --hl-orange: #E65F05; --hl-blue: #111565; --hl-head: #F0F2F5; --hl-ink: #14171a; --hl-sub: #33424f; }
.qs-head { display: flex; justify-content: space-between; gap: var(--sp-5); padding-bottom: var(--sp-3); }
.qs-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; color: var(--hl-ink); }
.qs-customer-name { font-size: var(--text-ui); font-weight: 700; color: var(--hl-ink); }
.qs-head-meta { display: flex; gap: var(--sp-3); }
.qs-box { background: var(--hl-head); border-radius: 3px; padding: 6px 10px; display: flex; flex-direction: column; gap: 1px; }
.qs-box-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--hl-sub); }
.qs-box-value { font-size: var(--text-data); font-weight: 650; color: var(--hl-ink); }
.qs-blue { color: var(--hl-blue); }
.qs-intro { font-size: var(--text-data); color: var(--hl-ink); margin: var(--sp-3) 0 var(--sp-3); }
.qs-validity { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.qs-route { display: flex; gap: var(--sp-5); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.qs-route-col { display: flex; flex-direction: column; gap: 2px; }
.qs-loc { font-size: var(--text-data); font-weight: 700; color: var(--hl-blue); }
.qs-voyage { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.qs-body { display: grid; grid-template-columns: 1fr 12rem; gap: var(--sp-5); }
.qs-included { font-size: var(--text-data); color: var(--hl-sub); margin-bottom: var(--sp-3); }
.qs-rates { width: 100%; border-collapse: collapse; font-size: var(--text-data); margin-bottom: var(--sp-4); }
.qs-rates th { background: var(--hl-head); text-align: right; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--hl-sub); padding: 5px 8px; border-bottom: 1px solid var(--hl-head); }
.qs-rates th:first-child { text-align: left; }
.qs-rates td { padding: 5px 8px; border-bottom: 1px solid rgba(20,23,26,.08); color: var(--hl-ink); }
.qs-th-charge { font-weight: 700 !important; color: var(--hl-ink) !important; }
.qs-th-curr { font-weight: 400; color: var(--hl-sub); }
.qs-td-charge { font-weight: 550; }
.qs-td-code { color: var(--hl-sub); font-size: 10px; font-family: var(--font-data); }
.qs-curr { color: var(--hl-sub); }
.qs-notes-block { margin-top: var(--sp-3); font-size: var(--text-data); }
.qs-notes-block ul { margin: var(--sp-2) 0 0; padding-left: 1.2rem; color: var(--hl-sub); }
.qs-side .qs-box-label { margin-bottom: var(--sp-1); }
.qs-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.qs-links a { color: var(--hl-orange); font-weight: 650; font-size: var(--text-data); text-decoration: none; }
.qs-links a:hover { text-decoration: underline; }
.qs-footer { display: flex; justify-content: space-between; gap: var(--sp-4); border-top: 1px solid rgba(20,23,26,.2); padding-top: var(--sp-3); margin-top: var(--sp-5); flex-wrap: wrap; }
@media (max-width: 640px) { .qs-body { grid-template-columns: 1fr; } .qs-head { flex-direction: column; } .qs-head-meta { flex-wrap: wrap; } }

/* 打印：只输出报价单覆盖层本身 */
@media print {
  body.qs-printing > *:not(.overlay) { display: none !important; }
  body.qs-printing .overlay { position: static; background: none; padding: 0; display: block; }
  body.qs-printing .overlay .dialog { box-shadow: none; border: 0; max-width: none; width: 100%; padding: 0; animation: none; }
  body.qs-printing .sheet-actions { display: none !important; }
  .qs-sheet { max-width: none; font-size: 11px; }
}

/* ---------- 追踪卡 ---------- */
.track-card .ref-line { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.track-card .ref { font-family: var(--font-data); font-size: var(--text-ui); font-weight: 600; letter-spacing: .02em; }
.summary-line { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-3); font-size: var(--text-data); color: var(--ink-2); }
.summary-line .k { color: var(--ink-3); font-size: var(--text-label); text-transform: uppercase; letter-spacing: .05em; display: block; }
.card-tools { display: flex; gap: var(--sp-1); flex: none; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: var(--radius-s); border: 0; background: transparent; color: var(--ink-3); cursor: pointer; transition: background var(--dur-feedback) var(--ease-out), color var(--dur-feedback) var(--ease-out); }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn .ic { width: 16px; height: 16px; }

/* ---------- 进度（扫描） ---------- */
.sweep-bar { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--text-data); color: var(--ink-2); }
.sweep-bar .meter { flex: 1; height: 4px; }

/* ---------- 引用粘贴列表 ---------- */
.reflist { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--hairline); border-radius: var(--radius-m); overflow: hidden; background: var(--surface); }
.refline { display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-4); height: var(--row-h); border-bottom: 1px solid var(--hairline); font-size: var(--text-data); }
.refline:last-child { border-bottom: 0; }
.refline .mono { min-width: 14ch; }
.refline select { height: 1.9rem; font-size: var(--text-data); }
.refline .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 报价 ---------- */
.offer-total { font-family: var(--font-data); font-size: var(--text-h3); font-weight: 650; }
.countdown { font-family: var(--font-data); font-size: var(--text-data); }
.countdown.urgent { color: var(--bad); font-weight: 600; }
.rate-lines { font-size: var(--text-data); }

/* ---------- 设置 ---------- */
.kv-list { display: flex; flex-direction: column; }
.log-list { font-family: var(--font-data); font-size: 12px; color: var(--ink-2); max-height: 18rem; overflow-y: auto; }
.log-list li { display: flex; gap: var(--sp-3); padding: 3px 0; border-bottom: 1px solid var(--hairline); list-style: none; }
.log-list .t { color: var(--ink-3); flex: none; width: 5.5ch; }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; }
  .page { padding: var(--sp-5) var(--sp-4) var(--sp-7); }
  .page-title { font-size: var(--text-h2); }
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  :root { --shell-pad: var(--sp-4); }
  .toasts { left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); }
  .kv dd { text-align: left; }
}

/* ---------- 打印（货代打给司机/留档） ---------- */
@media print {
  body { background: #fff; }
  .side, .topbar, .offline-banner, .toasts, .card-tools, .btn, .form-actions, .skip-link { display: none !important; }
  .shell { display: block; }
  .page { max-width: none; padding: 0; }
  .card, .table-wrap, .exc { border-color: #000; box-shadow: none; }
  .page-title { font-size: 18pt; }
}
