/* =====================================================================
   外贸单证助手 · 高保真原型 v2 · 设计系统
   视觉方向：深海军蓝 + 冷白卡片 + 少量高亮蓝；强调层级、留白与可读性
   尺寸固定 1440×900（与结构稿一致，便于比对）
   ===================================================================== */
:root {
  --navy-950: #081426;
  --navy-900: #0C1B31;
  --navy-800: #112542;
  --navy-700: #183356;
  --line: #E4EAF3;
  --line-soft: #EEF2F8;
  --bg: #F4F7FB;
  --bg-soft: #F8FAFD;
  --surface: #FFFFFF;
  --text: #0E1A2B;
  --text-2: #4B5B71;
  --muted: #5A6B80;
  --faint: #8295B2;
  --accent: #3568F0;
  --accent-2: #5B8CFF;
  --accent-ink: #1D4ED8;
  --accent-soft: #EEF4FF;
  --accent-line: #D8E5FF;
  --ok: #097F59;
  --ok-soft: #E9F9F2;
  --ok-line: #B8EAD7;
  --warn: #A56300;
  --warn-soft: #FFF8E8;
  --warn-line: #F7E2AE;
  --danger: #CF3327;
  --danger-soft: #FEF2F1;
  --danger-line: #F8D3CF;
  --purple: #6747E8;
  --purple-soft: #F2EEFF;
  --purple-line: #DED4FF;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .10);
  --shadow-lg: 0 24px 60px rgba(8, 20, 37, .22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font-family: inherit; }
.info-strip {
  flex: none; background: #F3F7FF; border: 1px solid var(--accent-line); border-radius: 10px;
  padding: 9px 14px; font-size: 12px; color: #4B6487; line-height: 1.7;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px;
}
.info-strip b {
  display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center;
  border: 1px solid #B9CCEA; border-radius: 50%; font-size: var(--ds-font-2xs); font-weight: 600; color: #3E5C86;
  margin-right: 5px; flex: none;
}
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; align-content: start; }
.settings-form:not(.settings-grid) { display: flex; flex-direction: column; gap: 12px; }
.settings-side .card-h { font-size: 13px; }
.settings-side .kv .k { width: 62px; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 2px; flex: none; align-items: center; }
.subtabs .st {
  padding: 9px 13px; font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; cursor: pointer;
}
.subtabs .st:hover { color: var(--text); }
.subtabs .st.on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }
.subtabs .st.off { opacity: .45; cursor: default; }
.settings-view { gap: 12px; }
.settings-foot {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.settings-foot .right { margin-left: auto; display: flex; gap: 8px; }
/* v1.2.86 设置页未保存提示：琥珀圆点 + 保存按钮轻微呼吸（可被「关启动画」与系统减弱动效关掉） */
.st-dirty-hint { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-weight: 600; }
.st-dirty-hint::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--warn);
  box-shadow: 0 0 0 3px rgba(183, 110, 0, .14);
}
.btn.is-dirty { animation: tdaDirtyBreathe 2.4s ease-in-out infinite; }
@keyframes tdaDirtyBreathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
  50% { box-shadow: 0 0 0 4px rgba(37, 99, 235, .16); }
}
body.ui-no-anim .btn.is-dirty { animation: none; }
@media (prefers-reduced-motion: reduce) { .btn.is-dirty { animation: none; } }
.settings-grid > .settings-foot { grid-column: 1 / -1; }
.settings-cols { display: flex; gap: 12px; align-items: flex-start; }
.settings-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.customs-layout { display: flex; gap: 14px; align-items: flex-start; }
.customs-list { width: 300px; flex: none; display: flex; flex-direction: column; gap: 12px; }
.customs-form { flex: 1; min-width: 0; }
.data-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 12px; align-items: start; }
@media (max-width: 1180px) { .data-grid { grid-template-columns: 1fr; } }
.cust-prof { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; background: var(--surface); }
.cust-prof:hover { border-color: #C9D6EA; }
.cust-prof.on { border-color: var(--accent-line); background: var(--accent-soft); }
.cp-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.cp-sub { font-size: 11px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1180px) {
  .settings-grid { grid-template-columns: 1fr; }
}
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  font: 13px/1.55 "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.app { display: flex; width: 100%; height: 100%; }

/* ---------- 左侧导航 ---------- */
.sidebar {
  width: 164px; flex: none; position: relative;
  background:
    radial-gradient(220px 160px at 110% -10%, rgba(91, 140, 255, .18), transparent 60%),
    linear-gradient(180deg, var(--navy-800) 0%, var(--navy-950) 100%);
  color: #B9C8DC; display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.brand { height: 66px; display: flex; align-items: center; gap: 8px; padding: 0 10px; overflow: hidden; }
.brand .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #5B8CFF 0%, #3568F0 55%, #4B4FE0 100%);
  box-shadow: 0 6px 14px rgba(53, 104, 240, .38);
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.brand .name { color: #F2F7FF; font-weight: 600; font-size: 14px; line-height: 1.25; letter-spacing: .01em; }
.brand .ver { font-size: var(--ds-font-2xs); color: #7E93AE; margin-top: 2px; }
.nav { padding: 8px 8px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 8px; height: 38px;
  padding: 0 8px; border-radius: 8px; color: #B6C6DB; text-decoration: none; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .15s ease, color .15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, .05); color: #E8F0FF; }
.nav a .ic {
  width: 22px; height: 22px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .07); color: #AFC2DA; font-size: 12px;
}
.nav a .ic svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.nav a.on {
  background: linear-gradient(90deg, rgba(91, 140, 255, .24), rgba(91, 140, 255, .07));
  color: #FFFFFF; font-weight: 500;
}
.nav a.on::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #7FA6FF, #3568F0);
}
.nav a.on .ic { background: rgba(91, 140, 255, .30); color: #DCE8FF; }
.nav a.on .ic svg { stroke: #DCE8FF; }
.nav a.off { opacity: .35; }
.nav .badge {
  margin-left: auto; background: rgba(91, 140, 255, .18); color: #C9DAFF;
  border: 1px solid rgba(91, 140, 255, .32);
  border-radius: 999px; font-size: var(--ds-font-2xs); padding: 0 7px; line-height: 16px;
}
.nav .soon { margin-left: auto; font-size: var(--ds-font-2xs); color: #7790AD; border: 1px solid #2A4160; border-radius: 4px; padding: 0 4px; }
.side-foot { padding: 12px 14px 14px; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 11px; color: #8CA0BA; }
/* v1.3.0 侧栏「当前业务员」入口（＝账号入口，替代原来"当前业务员：xxx"的纯文本行） */
.side-user {
  display: flex; align-items: center; gap: 8px; margin: 0 0 9px; padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, .09); border-radius: 10px;
  background: rgba(255, 255, 255, .04); color: #C9D8E8; text-decoration: none;
  transition: background-color var(--mo-1) var(--mo-ease), border-color var(--mo-1) var(--mo-ease);
}
.side-user:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .18); color: #E6EEF8; }
.side-user.on { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .26); }
.side-user.off { border-style: dashed; }
.side-user-txt { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.side-user-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-code {
  flex: none; font-size: var(--ds-font-2xs); line-height: 1.4; padding: 1px 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); color: #DCE7F5; letter-spacing: .04em;
}
.side-user-code.off { background: rgba(245, 196, 81, .18); color: #F3C77A; }
.side-user-go { flex: none; color: rgba(201, 216, 232, .55); font-size: 14px; line-height: 1; }
.side-user:hover .side-user-go { color: #E6EEF8; }
/* 当前业务员页（v1.3.0） */
.me-view { gap: 12px; }
.me-head {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--ds-card-radius);
  box-shadow: var(--shadow-sm);
}
.me-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.me-avatar {
  width: 42px; height: 42px; flex: none; border-radius: 12px; color: #fff; font-size: var(--ds-font-lg); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.me-txt { min-width: 0; }
.me-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; font-weight: 600; color: var(--text); }
.me-sub { margin-top: 3px; font-size: 11px; color: var(--muted); }
.me-actions { display: flex; gap: 8px; flex: none; }
.kv-line { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 12px; }
.kv-line:last-of-type { border-bottom: 0; }
.kv-line > span { width: 76px; flex: none; color: var(--muted); }
.kv-line > b { font-weight: 500; color: var(--text); }
.sp-list { display: flex; flex-direction: column; gap: 8px; }
.sp-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  transition: border-color var(--mo-1) var(--mo-ease), background-color var(--mo-1) var(--mo-ease), box-shadow var(--mo-1) var(--mo-ease);
}
.sp-card:hover { border-color: var(--accent-line); background: var(--bg-soft); }
.sp-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ds-focus-ring); }
.sp-card.off { opacity: .62; }
.sp-radio { width: 14px; height: 14px; flex: none; position: relative; border: 1px solid var(--faint); border-radius: 50%; }
.sp-card.on .sp-radio { border-color: var(--accent); }
.sp-card.on .sp-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.sp-main { flex: 1; min-width: 0; }
.sp-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.sp-acts { display: flex; gap: 6px; flex: none; }
.sp-pointer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ord-no-demo { display: flex; gap: 4px; flex-wrap: wrap; }
.ord-no-demo .seg { font-size: 11px; padding: 3px 6px; letter-spacing: .02em; }
@media (max-width: 1180px) { .me-head { flex-wrap: wrap; } .me-actions { width: 100%; } }

.side-foot .row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #5B8CFF, #7C5CFF);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: var(--ds-font-2xs); font-weight: 600;
}

/* ---------- 主区域 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  height: 60px; flex: none; background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
}
.crumb { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.crumb b { color: var(--text); font-weight: 600; }
.crumb .sep { color: var(--faint); }
.search {
  margin-left: auto; width: 300px; height: 32px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-soft); color: var(--muted); font-size: 12px;
  display: flex; align-items: center; padding: 0 10px; gap: 8px;
}
.search svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; flex: none; }
.search:hover { border-color: #C9D6EA; background: var(--surface); }
.search kbd {
  margin-left: auto; font: 10px/1 "Segoe UI", sans-serif; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface); border-radius: 4px; padding: 3px 5px;
}
.proto-tag {
  height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink);
  font-size: 11px; display: flex; align-items: center; white-space: nowrap; font-weight: 500;
}
.content { flex: 1; min-height: 0; padding: 18px 22px 14px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }

/* ---------- 卡片 / 通用 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-height: 0;
}
.card-h {
  height: 46px; flex: none; display: flex; align-items: center; gap: 8px;
  padding: 0 16px; border-bottom: 1px solid var(--line-soft);
  font-weight: 600; font-size: 14px; color: var(--text);
}
.card-h .sub { font-weight: 400; color: var(--muted); font-size: 11px; }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 14px 16px; min-height: 0; }
.card-b.p0 { padding: 0; }
.grow { flex: 1; min-height: 0; }

/* 按钮尺寸统一（2026-10-27 用户要求：适当放大、重点按钮醒目） */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
  cursor: default; transition: all .15s ease;
}
/* 统一尺寸：重点按钮与同组按钮同高，只靠颜色/字重区分（2026-10-27 用户要求） */
.btn.lg {
  height: 38px; padding: 0 18px; font-size: 14px; font-weight: 600; border-radius: 8px;
  letter-spacing: .01em;
}
.btn.lg.pri { box-shadow: 0 6px 16px rgba(53, 104, 240, .30), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn.lg.pri:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(53, 104, 240, .36), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn:hover { border-color: #C7D3E6; background: var(--bg-soft); color: var(--text); }
.btn.pri {
  background: linear-gradient(180deg, #4C7CF7, #2F63F2); border-color: #2A58D8; color: #fff;
  box-shadow: 0 2px 6px rgba(47, 95, 224, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn.pri:disabled { opacity: .5; box-shadow: none; }
.btn.pri:hover { filter: brightness(1.05); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent-ink); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn.warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.btn.warn:hover { border-color: #EFCB85; background: #FFF3D6; }
/* 2026-10-26：醒目动作按钮（解锁/归档） */
.btn.pri.btn-strong { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger { border-color: #D93A4E; background: linear-gradient(180deg, #F2545B, #E0455A); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(224, 69, 90, .28); }
.btn.danger:hover { filter: brightness(1.05); border-color: #C93A4D; }
.btn.danger:disabled { opacity: .45; }
.btn .badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: var(--ds-font-2xs); padding: 1px 5px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 9px;
  border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill.green { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.pill.amber { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.pill.blue { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-line); }
.pill.gray { background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--line); }
.pill.red { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.pill.purple { background: var(--purple-soft); color: var(--purple); border: 1px solid var(--purple-line); }
.tag {
  display: inline-block; font-size: var(--ds-font-2xs); line-height: 17px; padding: 0 6px;
  border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid var(--accent-line); white-space: nowrap;
}
.tag.from { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-line); }
.tag.gray { background: var(--bg-soft); color: var(--text-2); border-color: var(--line); }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.mono { font-family: "Cascadia Mono", Consolas, "Courier New", monospace; font-variant-numeric: tabular-nums; }
.num {
  display: inline-flex; width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: var(--ds-font-2xs); align-items: center; justify-content: center; font-weight: 700; flex: none;
}

/* ---------- 表格 ---------- */
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.t th {
  background: transparent; color: var(--muted); font-weight: 600; text-align: left;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  font-size: 11px; letter-spacing: .04em;
}
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.t tbody tr { transition: background .12s ease; }
.t tbody tr:hover { background: #FAFCFF; }
.t tr:last-child td { border-bottom: 0; }
.t .r { text-align: right; font-variant-numeric: tabular-nums; }
.t .c { text-align: center; }
td .sub2 { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

/* ---------- 表单 ---------- */
.frm { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 14px; }
.form-section-title { font-size: 11px; color: var(--text-2); margin-bottom: 8px; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld label { font-size: 11px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.inp {
  height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  padding: 0 10px; font-size: 13px; color: var(--text); display: flex; align-items: center;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.inp:hover { border-color: #C7D3E6; }
select.inp {
  appearance: none; -webkit-appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A98AC' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.inp.area { height: 60px; align-items: flex-start; padding-top: 7px; line-height: 1.6; }
.inp.sel::after { content: "▾"; margin-left: auto; color: var(--muted); font-size: var(--ds-font-2xs); }
.inp .ph { color: var(--faint); }
.inp.ro { background: var(--bg-soft); color: var(--text-2); border-color: var(--line-soft); }

/* ---------- 说明条 ---------- */
.proto-note {
  height: 34px; flex: none; background: #F3F7FF; border-top: 1px solid var(--accent-line);
  display: flex; align-items: center; gap: 20px; padding: 0 22px; font-size: 11px; color: #5A7398;
}
.proto-note b {
  display: inline-flex; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); color: #fff; align-items: center; justify-content: center;
  font-size: var(--ds-font-2xs); font-weight: 700; margin-right: 3px;
}

/* ---------- 订单信息 ---------- */
.order-head { display: flex; align-items: center; gap: 10px; }
.order-head h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.order-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.info-grid { display: grid; grid-template-columns: 1.25fr .85fr .8fr .9fr 1.1fr 1.15fr 1.1fr 1fr; }
.info-grid .cell { padding: 10px 16px; border-right: 1px solid var(--line-soft); min-width: 0; }
.info-grid .cell:last-child { border-right: 0; }
.info-grid .k { font-size: var(--ds-font-2xs); color: var(--muted); margin-bottom: 3px; }
.info-grid .v { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-grid .v.big { font-size: 16px; font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.info-grid .v .lbl { font-size: var(--ds-font-2xs); color: var(--muted); font-weight: 400; }

/* ---------- 明细 ---------- */
.items-tool {
  display: flex; align-items: center; gap: 6px; padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft); background: #FBFCFE;
}
.items-tool .note { margin-left: auto; font-size: var(--ds-font-2xs); color: var(--muted); }
.cartonline { display: flex; gap: 12px; font-size: var(--ds-font-2xs); color: var(--text-2); padding: 4px 10px 6px 40px; background: #FBFCFE; border-bottom: 1px solid var(--line-soft); }
.cartonline .w { color: var(--warn); }
.totals {
  display: flex; align-items: center; gap: 18px; padding: 11px 16px;
  border-top: 1px solid var(--line-soft); background: var(--bg-soft);
}
.totals .t-item { font-size: 11px; color: var(--muted); }
.totals .t-item b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.totals .amount { margin-left: auto; font-size: 11px; color: var(--muted); }
.totals .amount b { color: var(--accent-ink); font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ---------- 收款台账（v1.2.71，FR-93/94） ---------- */
.pay-card { margin-bottom: 12px; }
.pay-sum { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 12px 16px 14px; border-bottom: 1px solid var(--line-soft); }
.pay-box { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.pay-box .k { font-size: 11px; color: var(--muted); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-box .v { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pay-box.ok .v { color: var(--ok, #16a34a); }
.pay-box.warn { background: #fff7ed; border-color: #fed7aa; }
.pay-box.warn .v { color: #c2410c; }
.pay-table { border-top: 0; }
.pay-table th { font-size: 11px; }
.pay-table td { font-size: 12px; }
.pay-empty { padding: 18px 16px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.pay-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-receipt-box { display: flex; gap: 12px; align-items: flex-start; }
.pay-receipt-preview { width: 132px; height: 96px; border: 1px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; background: var(--bg-soft); overflow: hidden; flex: none; }
.pay-receipt-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pay-receipt-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.receipt-view { min-height: 120px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.receipt-view img { max-width: 100%; max-height: 64vh; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- Excel / CSV 导入弹窗（v1.2.72，FR-96/97） ---------- */
.imp-empty { padding: 16px; color: var(--muted); font-size: 13px; line-height: 2; background: var(--bg-soft); border-radius: 8px; }
.imp-file { display: flex; align-items: center; gap: 10px; padding: 8px 2px 4px; font-size: 13px; }
.imp-stat { padding: 4px 2px 10px; color: var(--muted); font-size: 13px; }
.imp-stat b { font-variant-numeric: tabular-nums; }
.imp-stat b.ok { color: var(--ok, #16a34a); }
.imp-stat b.bad { color: #dc2626; }
.imp-stat b.warn { color: #b45309; }
.imp-sec { margin: 14px 0 8px; font-weight: 600; font-size: 13px; color: var(--text); }
.imp-maps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 12px; }
.imp-map { display: flex; flex-direction: column; gap: 3px; }
.imp-map label { font-size: 12px; color: var(--muted); }
.imp-map label.req { color: #b45309; }
.imp-map select { width: 100%; font-size: 13px; }
.imp-preview { font-size: 12px; }
.imp-preview th { font-size: 11px; white-space: nowrap; }
.imp-preview td { white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.imp-errors { margin-top: 8px; padding: 10px 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; color: #991b1b; font-size: 12px; line-height: 1.9; }
.imp-modes { display: flex; gap: 20px; flex-wrap: wrap; }
.imp-mode { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; }

/* ---------- 销售报表（v1.2.73，FR-99） ---------- */
.rep-filter { padding: 10px 14px; margin-bottom: 12px; }
.rep-filter-row { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center; }
.rep-fl { display: flex; align-items: center; gap: 8px; }
.rep-fl .k { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rep-seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 8px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.rep-seg-btn { border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; font-size: 12px; color: var(--text-2, #4b5563); cursor: pointer; white-space: nowrap; }
.rep-seg-btn:hover { background: rgba(53, 104, 240, .06); }
.rep-seg-btn.on { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); font-weight: 600; }
.rep-table td { font-size: 12px; }
.rep-table td.ok { color: var(--ok, #16a34a); }
.rep-table td.warn { color: #c2410c; }
.rep-bar { height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; margin-bottom: 2px; }
.rep-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #5B8CFF, #7C5CFF); border-radius: 999px; }
.rep-curbar { margin-bottom: 12px; }
.rep-cur-chip { display: inline-block; margin-right: 16px; font-size: 12px; }
.rep-cur-chip b { color: var(--accent-ink); }
.stat .of { font-size: 13px; color: var(--muted); font-weight: 400; }

/* ---------- 发货台账（v1.2.76，FR-104） ---------- */
.ship-imgs { display: flex; gap: 8px; flex-wrap: wrap; min-height: 72px; padding: 8px; background: var(--bg-soft); border: 1px dashed var(--line); border-radius: 8px; align-items: flex-start; }
.ship-img { position: relative; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.ship-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ship-img .x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(17, 24, 39, .72); color: #fff; font-size: 14px; line-height: 20px; text-align: center; cursor: pointer; }
.ship-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ship-gal-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.ship-gal-item img { width: 100%; height: 180px; object-fit: contain; display: block; }

/* ---------- 单据中心 ---------- */
.tabs { display: flex; gap: 2px; padding: 7px 12px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.tabs .tab {
  font-size: 11px; padding: 4px 9px; border-radius: 6px; color: var(--text-2);
  white-space: nowrap; cursor: default; transition: all .12s ease;
}
.tabs .tab:hover { background: var(--bg-soft); }
.tabs .tab.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.syncbar {
  display: flex; align-items: center; gap: 8px; margin: 10px 14px 0; padding: 8px 11px;
  border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 8px;
  font-size: 11px; color: #8A5A00;
}
.syncbar .right { margin-left: auto; display: flex; gap: 6px; }
.doc-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.doc-row {
  display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px 9px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.doc-row:hover { border-color: #CBD9EE; }
.doc-row.sel { border-color: #9DBCFF; background: #F8FBFF; box-shadow: 0 0 0 3px rgba(53, 104, 240, .08); }
.doc-row .tname { font-weight: 600; font-size: 11px; }
.doc-row .no { font-size: 11px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row .st { font-size: var(--ds-font-2xs); }
.doc-row .act { text-align: right; }
.order-right .doc-row { grid-template-columns: 50px 1fr 64px 52px; gap: 6px; }
.doc-row.cust-doc { grid-template-columns: 1fr 100px 72px; gap: 8px; }
.preview {
  margin: 8px 12px 12px; border: 1px dashed #CBD7E8; border-radius: 10px; background: #F1F5FA;
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative;
}
.preview .sheet {
  width: 210px; height: 297px; background: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .16);
  padding: 14px 12px; font-size: 5px; color: #3B4A5F;
}
.preview .zoom { position: absolute; right: 9px; bottom: 9px; font-size: var(--ds-font-2xs); color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.preview .hint { position: absolute; left: 9px; bottom: 9px; font-size: var(--ds-font-2xs); color: var(--muted); }

/* ---------- 单据编辑器 ---------- */
.doc-head { display: flex; align-items: center; gap: 10px; }
.doc-head h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.doc-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.readstrip { display: flex; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); }
.readstrip .cell { padding: 8px 14px; border-right: 1px solid var(--line-soft); font-size: 11px; min-width: 0; }
.readstrip .cell:last-child { border-right: 0; }
.readstrip .k { font-size: var(--ds-font-2xs); color: var(--muted); display: flex; align-items: center; gap: 4px; }
.readstrip .v { color: var(--text); white-space: nowrap; }
.editor { display: flex; gap: 14px; flex: 1; min-height: 0; }
.formcol { width: 430px; flex: none; display: flex; flex-direction: column; gap: 11px; overflow: hidden; }
.sec { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); }
.sec-h { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 13px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line-soft); }
.sec-h .right { margin-left: auto; font-size: var(--ds-font-2xs); color: var(--muted); font-weight: 400; }
.sec-b { padding: 11px 13px; }
.previewcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.pv-tool { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.pv-tool .right { margin-left: auto; display: flex; gap: 6px; }
.paper-wrap {
  flex: 1; min-height: 0; background: #E9EEF5; border: 1px solid #DEE5EF; border-radius: 12px;
  display: flex; align-items: flex-start; justify-content: center; padding: 12px; overflow: hidden;
}
.paper {
  background: #fff; box-shadow: 0 18px 44px rgba(15, 23, 42, .18), 0 1px 2px rgba(15, 23, 42, .1);
  padding: 18px 22px; font-size: 6px; color: #0E1A2B; position: relative;
}
.paper .inv-h { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid #C9D3E0; padding-bottom: 8px; }
.paper .co { font-size: var(--ds-font-2xs); font-weight: 700; letter-spacing: .02em; }
.paper .co small { display: block; font-size: 5px; font-weight: 400; color: var(--text-2); line-height: 1.5; }
.paper .title { text-align: right; }
.paper .title b { font-size: 12px; letter-spacing: .6px; }
.paper .title small { display: block; font-size: 5px; color: var(--text-2); }
.paper .meta { display: flex; justify-content: space-between; margin: 8px 0; font-size: 5.5px; color: var(--text-2); }
.paper .meta b { font-size: 6px; }
.paper table { width: 100%; border-collapse: collapse; font-size: 5.5px; }
.paper th, .paper td { border: 1px solid #9AA8BA; padding: 2px 3px; }
.paper th { background: #E9EFF8; font-weight: 600; }
.paper .tt { text-align: right; margin-top: 4px; font-size: 6px; }
.paper .bank { margin-top: 8px; font-size: 5px; line-height: 1.6; color: var(--text-2); border-top: 1px solid #C9D3E0; padding-top: 5px; }
.paper .sign { position: absolute; right: 22px; bottom: 36px; text-align: center; font-size: 5px; color: var(--text-2); }
.paper .sign .line { width: 110px; border-bottom: 1px solid #9AA8BA; height: 26px; margin-bottom: 3px; }

/* ---------- 弹窗 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 20, 36, .46); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: var(--ds-z-overlay); }
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255, 255, 255, .6);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(6px) scale(.995); opacity: .7; } to { transform: none; opacity: 1; } }
.modal-h { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); }
.modal-h h2 { font-size: 16px; letter-spacing: -.01em; }
.modal-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.modal-b { flex: 1; min-height: 0; padding: 16px 20px; overflow: hidden; }
.modal-f { height: 56px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 20px; border-top: 1px solid var(--line-soft); background: var(--bg-soft); }
.modal-f .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- 设置 ---------- */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 2px; flex: none; }
.subtabs .st { padding: 9px 13px; font-size: 13px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: default; }
.subtabs .st:hover { color: var(--text); }
.subtabs .st.on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }
.subtabs .st.off { opacity: .45; }
.settings-body { display: flex; gap: 14px; flex: 1; min-height: 0; }
.settings-form { flex: 1; min-width: 0; }
.settings-form > .card { flex: none; }
.settings-side { width: 336px; flex: none; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.upload { border: 1px dashed #C6D3E5; border-radius: 8px; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.list-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; font-size: 12px; margin-bottom: 7px; background: var(--surface); }
.list-row .grow2 { flex: 1; min-width: 0; }
.chip { font-size: var(--ds-font-2xs); padding: 1px 7px; border-radius: 999px; background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--line); }
.hr { height: 1px; background: var(--line-soft); margin: 11px 0; }

/* ---------- 产品选择器 ---------- */
.picker-list { width: 620px; flex: none; border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; }
.plist { flex: 1; overflow: hidden; }
.plist .row { display: grid; grid-template-columns: 22px 50px minmax(0, 1fr) 92px 84px 52px; gap: 6px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.plist .row > div { min-width: 0; }
.plist .row:hover { background: #FAFCFF; }
.plist .row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.plist .thumb { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; background: var(--bg-soft); }
.plist .m { font-weight: 600; font-size: 12px; }
.plist .d { font-size: var(--ds-font-2xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist .price { text-align: right; font-variant-numeric: tabular-nums; }
.plist .price b { font-size: 12px; }
.plist .price .usd { font-size: var(--ds-font-2xs); color: var(--text-2); }
.picker-detail { flex: 1; min-width: 0; padding: 16px; display: flex; flex-direction: column; gap: 11px; overflow: hidden; }
.pd-head { display: flex; gap: 12px; }
.pd-img { width: 76px; height: 76px; border: 1px solid var(--line); border-radius: 8px; object-fit: cover; background: var(--bg-soft); }
.pd-head .t { font-size: 16px; font-weight: 700; }
.pd-head .s { font-size: 11px; color: var(--text-2); margin-top: 4px; line-height: 1.55; }
.tier { display: flex; gap: 5px; flex-wrap: wrap; }
.tier .t-ch { font-size: var(--ds-font-2xs); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--text-2); background: var(--bg-soft); }
.tier .t-ch.on { border-color: #9DBCFF; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

/* ---------- 单据号示意 ---------- */
.seg { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.seg.a { background: #E6F3FF; color: #0B6BA8; }
.seg.b { background: #EFEBFF; color: #5B3FD6; }
.seg.c { background: #E7F9F0; color: #0A7A55; }
.seg.d { background: #FFF1E2; color: #B45A00; }
.seg.e { background: #FFE9F3; color: #B01962; }
.seg.f { background: #EAF0FF; color: #2743B8; }
.seg.g { background: #FFF7DB; color: #8A6100; }
.seg.h { background: #EFF3F9; color: #334155; }

/* ---------- 工作台 / 列表 / 装箱 ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; right: -20px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(53,104,240,.07), transparent 65%); }
.stat .k { font-size: 11px; color: var(--muted); }
.stat .v { font-size: 25px; font-weight: 700; color: var(--text); margin-top: 2px; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 11px; color: var(--muted); margin-top: 3px; }
.stat.warn .v { color: var(--warn); }
.stat.blue .v { color: var(--accent-ink); }
.segctl { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segctl span { padding: 5px 11px; font-size: 11px; color: var(--text-2); background: transparent; cursor: default; }
.segctl span.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.chip2 { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 4px 9px; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.chip2 b { color: var(--text); }
.chip2 .inp-inline { width: 40px; height: 22px; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; font-size: 11px; background: var(--surface); color: var(--text); }
.toolbar-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); background: #FBFCFE; }
.toolbar-line .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.filter-row { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.filter-row .sp { margin-left: auto; }
.danger:not(.btn) { border-color: var(--danger-line) !important; background: #FFF8F7 !important; }
.danger .card-h { color: var(--danger); }
.kv { display: flex; gap: 8px; font-size: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); align-items: center; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); width: 96px; flex: none; }
.kv .v { color: var(--text); }

/* ---------- 紧凑模式 ---------- */
.compact .inp { height: 29px; }
.compact .inp.area { height: 46px; }
.compact .frm { gap: 9px 12px; }
.compact .sec-b { padding: 10px 13px; }
.compact .t td { padding: 7px 10px; }
.compact .t th { padding: 7px 10px; }

/* 单据编辑器左栏：在 1440×900 内完整展示 */
.formcol.compact { gap: 8px; }
.formcol.compact .sec-h { height: 34px; }
.formcol.compact .sec-b { padding: 8px 12px; }
.formcol.compact .frm { gap: 7px 12px; }
.formcol.compact .inp.area { height: 38px; }

/* ---------- 交互小件（hf.js 注入） ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 54px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: var(--ds-z-toast); }
.toast {
  background: rgba(14, 26, 43, .94); color: #fff; font-size: 12px; padding: 9px 14px; border-radius: 8px;
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px; animation: toastIn .18s ease;
}
.toast .dot { width: 6px; height: 6px; border-radius: 50%; background: #34D399; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 响应演示（点击反馈） ---------- */
a, .btn, .tab, .st, .doc-row { cursor: pointer; }
.btn:active { transform: translateY(.5px); }


/* ---------- v2 App 布局 ---------- */
.view { display: none; flex: 1; min-height: 0; overflow: auto; padding: 18px 22px 14px; flex-direction: column; gap: 14px; }
.view.active { display: flex; }
.page-head { display: flex; align-items: center; gap: 10px; }
.page-head h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.page-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.err { color: var(--danger); font-size: 12px; }
.tag-btn { cursor: pointer; }
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: var(--ds-z-toast); }
.toast { background: rgba(14,26,43,.95); color: #fff; font-size: 12px; padding: 9px 14px; border-radius: 8px; box-shadow: var(--shadow-md); }
.a4preview { background: #E9EEF5; border: 1px solid #DEE5EF; border-radius: 12px; padding: 0; display: flex; justify-content: center; overflow: auto; flex: 1; min-height: 0; }
.a4preview { align-items: flex-start; }
.a4preview iframe { border: 0; background: #fff; margin: 12px; flex: none; }
.a4 { background: #fff; width: 520px; min-height: 700px; padding: 26px 30px; box-shadow: 0 18px 44px rgba(15,23,42,.18); font-size: var(--ds-font-2xs); color: #1f2937; }
.a4 h2 { font-size: 16px; text-align: center; margin-bottom: 8px; }
.a4 table { width: 100%; border-collapse: collapse; font-size: var(--ds-font-2xs); margin-top: 8px; }
.a4 th, .a4 td { border: 1px solid #9AA8BA; padding: 3px 4px; }
.a4 th { background: #E9EFF8; }
.a4 .money { text-align: right; }
.doc-grid { display: flex; gap: 14px; flex: 1; min-height: 0; }
.doc-side { width: 380px; flex: none; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.doc-side > .card { flex: none; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; gap: 8px; font-size: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); align-items: center; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); width: 92px; flex: none; }
.kv .v { color: var(--text); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.qty-input, .price-input { width: 76px; height: 27px; border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; font-size: 12px; text-align: right; }
.item-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--bg-soft); }
/* 产品编辑页（二级页面）大图预览 */
#pe-image-prev .item-thumb { width: 168px; height: 168px; border-radius: 12px; }
#npe-image-prev .item-thumb { width: 104px; height: 104px; border-radius: 10px; }
.pd-img { width: 110px; height: 110px; }
.product-pick-list { max-height: 420px; overflow: auto; }
.modal-wide { width: 900px; max-height: 86vh; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.pick-row:hover { background: var(--accent-soft); }
.pick-row.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.pick-left { width: 58%; flex: none; border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; }
.pick-right { flex: 1; min-width: 0; padding: 14px 16px; overflow: auto; display: flex; flex-direction: column; gap: 7px; }
.pick-right .pd-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 6px; }
.pick-right .pd-img { width: 76px; height: 76px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.pick-right .pd-head .t { font-weight: 700; font-size: 14px; }
.pick-right .pd-head .s { font-size: 11px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.pick-row .m { font-weight: 600; font-size: 12px; }
.pick-row .d { font-size: var(--ds-font-2xs); color: var(--muted); }
.pick-row .price { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.syncbar { margin: 0; }
.plan-table { font-size: 11px; }
.plan-table th, .plan-table td { padding: 6px 8px; }
.plan-side { width: 286px; flex: none; border-left: 1px solid var(--line-soft); padding: 14px 16px; overflow: auto; }

/* ---------- P1：外壳 / 工作台 / 订单列表 ---------- */
.nav a.off { opacity: .45; pointer-events: none; }
.side-foot .dot { font-size: var(--ds-font-2xs); }
.side-foot .dot.ok { color: var(--ok); }
.side-foot .row > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 侧栏「自动备份」两行排版（v1.2.73 用户反馈：原先文字被挤成「自动备 份：」且日期被省略号截断） */
.side-foot .backup-row { align-items: flex-start; }
.side-foot .row > .bk-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: visible; white-space: normal; text-overflow: clip; }
.side-foot .bk-k { font-size: 11px; line-height: 1.25; color: #8CA0BA; }
.side-foot .bk-v { font-size: var(--ds-font-2xs); line-height: 1.35; color: #B9C8DA; white-space: normal; word-break: break-all; }
body.ui-ios .side-foot .bk-k { color: var(--ios-text-3); }
body.ui-ios .side-foot .bk-v { color: var(--ios-text-2, #A9B8CC); }
.search { cursor: text; }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--text); padding: 0;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--accent-line); background: var(--surface); box-shadow: 0 0 0 3px rgba(53, 104, 240, .08); }
.search:focus-within kbd { opacity: 0; }

.greet { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 34px; }
.greet h1 { font-size: 20px; letter-spacing: -.01em; }
.greet .right { margin-left: auto; display: flex; gap: 8px; }
.stat .v .of { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.todo .kv { padding: 7px 0; }
.todo .kv .k { width: 56px; font-size: 11px; }

.doc-tags { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.doc-tags .tag { font-size: var(--ds-font-2xs); padding: 1px 6px; line-height: 15px; }
.chip2 select { border: 0; outline: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; max-width: 132px; }
.chip2.sel { padding-right: 6px; }

.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }
.pager .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pager select { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); height: 24px; font-size: 11px; color: var(--text-2); }

.mini-muted { font-size: 11px; color: var(--muted); }
.t .sub2 { font-size: var(--ds-font-2xs); color: var(--muted); margin-top: 1px; }
.t .mono { white-space: nowrap; }
.sel-row { background: var(--accent-soft) !important; }
.card .pager { margin-top: auto; }
.wb-cols .t td { white-space: nowrap; }
.wb-cols .t td:nth-child(3) { overflow: hidden; text-overflow: ellipsis; }

.wb-cols { display: flex; gap: 12px; flex: 1; min-height: 0; align-items: flex-start; }
.wb-side { width: 330px; flex: none; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
/* 2026-11-07 v1.2.74：待办多了「交期 / 逾期未收」两行后卡片被压缩、最后一行被下一张卡盖住 →
   侧栏卡片一律不收缩，超出时由 .wb-side 自身滚动 */
.wb-side > .card { flex: none; }
.wb-cols > .card { min-height: 0; }
.wb-cols .t { table-layout: fixed; }
.wb-cols .t.wb-recent { width: 100%; }
.wb-cols .t.wb-recent th, .wb-cols .t.wb-recent td { padding-left: 8px; padding-right: 8px; }
.wb-cols .t.wb-recent td:nth-child(1), .wb-cols .t.wb-recent th:nth-child(1) { white-space: normal; word-break: break-all; line-height: 1.3; }
.wb-cols .t.wb-recent td:nth-child(2) { white-space: normal; word-break: break-word; line-height: 1.3; }

/* ---------- P2：订单工作区 ---------- */
/* 2026-10-26：单据中心移到明细下方（整列布局） */
.order-cols { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; overflow: auto; }
.order-left { width: 100%; flex: none; min-width: 0; }
.order-right { width: 100%; flex: none; min-width: 0; }
.order-left .t { table-layout: fixed; }
.order-left .t td, .order-left .t th { padding-left: 8px; padding-right: 8px; }
.order-left .qty-input { width: 52px; }
.order-left .price-input { width: 52px; }
.order-left .item-thumb { width: 56px; height: 56px; border-radius: 8px; }
/* 订单明细：规格可编辑 + 自动行高（2026-10-27） */
.spec-cell { vertical-align: top !important; }
.spec-input { width: 100%; min-height: 34px; box-sizing: border-box; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 5px 7px; font-size: 12px; line-height: 1.45; color: var(--text); font-family: inherit; resize: vertical; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.spec-input:hover { border-color: var(--line); background: var(--surface); }
.spec-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(53, 104, 240, .10); }
.spec-text { white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.45; padding: 5px 7px; color: var(--text-2); }

.items-tool { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line-soft); }
.order-notes { display: flex; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line-soft); align-items: flex-start; }
.order-ops { display: flex; align-items: center; gap: 14px; padding: 7px 14px; border-top: 1px solid var(--line-soft); font-size: var(--ds-font-2xs); color: var(--muted); }
.order-right .doc-list { max-height: 220px; overflow: auto; flex: none; }
.order-right .preview { margin: 6px 12px 12px; height: 520px; flex: none; }
.preview iframe { border: 0; background: #fff; flex: none; }
.paper-wrap iframe { border: 0; background: #fff; flex: none; box-shadow: 0 18px 44px rgba(15,23,42,.18), 0 1px 2px rgba(15,23,42,.1); }
.paper-wrap { align-items: flex-start; justify-content: center; overflow: auto; }
#doc-preview { margin: 0 auto; }
.order-right .preview .hint { pointer-events: none; }
.order-cols .totals { flex-wrap: wrap; }

@media (max-width: 1280px) {
  .order-left { width: 58%; }
}
@media (max-width: 1180px) {
  .order-cols { flex-direction: column; overflow: auto; }
  .order-left, .order-right { width: auto; flex: none; min-width: 0; }
  .order-right { min-height: 420px; }
}

@media (max-width: 1180px) {
  .wb-cols { flex-direction: column; overflow: auto; }
  .wb-side { width: auto; flex: none; flex-direction: row; flex-wrap: wrap; }
  .wb-side .card { flex: 1; min-width: 220px; }
}

@media (max-width: 1360px) {
  .search { width: 250px; }
  .view { padding: 14px 16px 12px; gap: 12px; }
}
@media (max-width: 1180px) {
  .sidebar { width: 198px; }
  .brand { padding: 0 14px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 14px; gap: 8px; }
  .proto-tag { display: none; }
}
@media (max-height: 760px) {
  .topbar { height: 52px; }
  .view { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* 订单详情独立窗口：隐藏左侧主菜单，只留订单内容 */
.popup-win .sidebar { display: none; }
.popup-win .app { height: 100vh; }
.popup-settings .view { padding: 12px 14px 10px; }

/* ---------- 订单二级菜单（2026-10-26） ---------- */
.orders-view { display: flex; flex-direction: row; gap: 14px; align-items: flex-start; }
.orders-view .orders-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.subnav {
  width: 148px; flex: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 7px; display: flex; flex-direction: column; gap: 1px;
}
.subnav .sn-h { font-size: 11px; color: var(--text-3); padding: 3px 8px 6px; letter-spacing: .04em; }
.subnav a {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 8px;
  color: var(--text-2); font-size: 13px; line-height: 1.35; white-space: normal;
  text-decoration: none; cursor: pointer;
}
.subnav a .lb { min-width: 0; word-break: break-word; }
.subnav a .n { margin-left: auto; font-size: 11px; color: var(--text-3); flex: none; }
.subnav a:hover { background: var(--bg-soft); color: var(--text); }
.subnav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.subnav a.on .n { color: var(--accent-ink); }
.subnav .sep { height: 1px; background: var(--line-soft); margin: 5px 4px; }

/* 单据中心 tab 滑块（仅 iOS 风格显示） */
.tab-slider { display: none; }

/* 单据中心主体：列表 + A4 预览两栏（v1.4.16 收口；原左栏 232px 的生成按钮/分类已并入顶部页签）
   .doc-wide 为「放大预览」：列表固定 300px（再窄四个按钮就挤没了），纸张拿剩下的全部宽度。 */
.doc-split { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(340px, 1.15fr); gap: 14px; height: 620px; min-height: 0; padding: 10px 14px 14px; }
.doc-split.doc-wide { grid-template-columns: 300px minmax(0, 1fr); }
/* 窄栏时卡片改成「信息在上、按钮在下」，否则四个按钮会在 300px 里挤成一团 */
.doc-split.doc-wide .doc-mid .doc-row { grid-template-columns: minmax(0, 1fr); gap: 5px; }
.doc-split.doc-wide .doc-mid .doc-row .tname { text-align: left; }
.doc-split.doc-wide .doc-mid .doc-row > div:first-child { display: flex; align-items: center; gap: 6px; }
.doc-split.doc-wide .doc-mid .doc-row .act { justify-content: flex-start; flex-wrap: wrap; }
.doc-mid { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border-right: 1px solid var(--line-soft); padding-right: 14px; }
.doc-mid .doc-list { flex: 1; overflow: auto; max-height: none; padding: 0 2px 2px 0; }
.doc-mid .doc-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; padding: 6px 9px; align-items: center; }
/* 单据行：类型 / 单号+创建时间 / 操作按钮（2026-10-27） */
.doc-mid .doc-row .st { display: block; font-size: var(--ds-font-2xs); color: var(--muted); }
.doc-mid .doc-row .tname { font-size: var(--ds-font-2xs); text-align: center; font-weight: 600; }
.doc-mid .doc-row .no { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v1.4.21：单号同时是一个按钮（Tab 可达、Enter 切换预览），外观保持纯文本 */
.doc-pick {
  display: block; max-width: 100%; margin: 0; padding: 0; border: 0; background: none;
  font: inherit; font-size: 11px; color: var(--text); text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px;
}
.doc-pick:hover { color: var(--accent-ink); text-decoration: underline; }
.doc-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 「更多」按钮：固定 32×28，避免因文字长短抖动 */
.btn.icon { width: 30px; padding: 0; font-size: 14px; line-height: 1; }
.doc-mid .doc-row .act { display: flex; gap: 4px; justify-content: flex-end; }
.doc-mid .doc-row .act .btn { height: 24px; padding: 0 8px; font-size: 11px; }
.doc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.doc-main .preview { flex: 1; min-height: 0; height: auto; margin: 0; overflow: auto; }

/* 订单列表：可配置列 / 表头排序 / 右键菜单（2026-10-26） */
.orders-table-wrap { overflow-x: auto; }
.orders-table-wrap .orders-t { min-width: 640px; }
.ord-th { position: relative; cursor: pointer; user-select: none; white-space: nowrap; padding-right: 14px; }
.ord-th .ord-sort { margin-left: 4px; font-size: var(--ds-font-2xs); color: var(--accent); }
.ord-resizer { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: col-resize; }
.ord-resizer:hover { background: rgba(10, 132, 255, .22); }
.ord-row { cursor: pointer; }
.ord-row:hover { background: rgba(10, 132, 255, .045); }
.ord-col-list { display: flex; flex-direction: column; gap: 6px; }
.ord-col-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.ctx-menu { position: fixed; z-index: var(--ds-z-tooltip); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); padding: 5px; min-width: 200px; }
.ctx-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.ctx-menu button:hover { background: var(--bg-soft); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button:disabled { opacity: .45; cursor: default; }

/* 国家搜索选择器（2026-10-27） */
.country-picker { position: relative; }
.country-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 240px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 26px rgba(15, 23, 42, .16); z-index: var(--ds-z-dropdown); display: none; }
.cty-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; cursor: pointer; }
.cty-item:hover { background: var(--accent-soft); }
.cty-item .cty-en { color: var(--text-2); font-size: 12px; }
.cty-item .cty-code { margin-left: auto; color: var(--muted); font-size: 11px; }
.cty-empty { padding: 10px; font-size: 12px; color: var(--muted); }

/* 设置列表拖动排序（2026-10-27） */
.drag-handle { cursor: grab; color: var(--muted); text-align: center; user-select: none; font-size: 12px; letter-spacing: -1px; }
.drag-handle:hover { color: var(--accent); }
tr[draggable] { cursor: default; }
tr[draggable]:active .drag-handle { cursor: grabbing; }

/* 产品图片裁剪（2026-10-26） */
.crop-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.crop-stage { position: relative; width: 720px; height: 460px; max-width: 100%; background: #0b1220; border-radius: 10px; overflow: hidden; touch-action: none; }
.crop-stage canvas { display: block; width: 100%; height: 100%; }
.crop-sel { position: absolute; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35) inset; cursor: move; }
.crop-sel .ch { position: absolute; width: 11px; height: 11px; background: #fff; border: 1px solid #3568F0; border-radius: 4px; }
.crop-sel .ch[data-h="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.crop-sel .ch[data-h="n"] { left: 50%; margin-left: -6px; top: -6px; cursor: ns-resize; }
.crop-sel .ch[data-h="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.crop-sel .ch[data-h="w"] { left: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.crop-sel .ch[data-h="e"] { right: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.crop-sel .ch[data-h="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.crop-sel .ch[data-h="s"] { left: 50%; margin-left: -6px; bottom: -6px; cursor: ns-resize; }
.crop-sel .ch[data-h="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }

/* 界面风格选择卡片（2026-10-26） */
.ui-style-list { display: flex; flex-direction: column; gap: 10px; }
.ui-style-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .12s ease; }
.ui-style-card:hover { background: var(--bg-soft); }
.ui-style-card:active { transform: scale(.995); }
.ui-style-card.on { border-color: var(--accent); background: var(--accent-soft); }
.ui-style-swatch { width: 64px; height: 44px; border-radius: 8px; flex: none; border: 1px solid var(--line); }
.ui-style-swatch.sw-classic { background: linear-gradient(135deg, #0f2038 0%, #0f2038 34%, #eef2f8 34%, #eef2f8 100%); }
.ui-style-swatch.sw-ios { background: linear-gradient(135deg, #F2F2F7 0%, #F2F2F7 30%, #0A84FF 30%, #0A84FF 62%, #fff 62%, #fff 100%); }
.ui-style-txt { flex: 1; min-width: 0; }
.ui-anim-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* 订单页右侧「订单设置」面板（2026-10-26） */
.orders-settings-card { min-height: 0; display: flex; flex-direction: column; }
.orders-settings { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; overflow: auto; }
.orders-settings .settings-body { min-height: 0; }
.orders-settings .settings-form { overflow: visible; }

/* 订单号等长文本自动换行（不再被截断） */
.t td .mono.wrap { display: inline-block; max-width: 100%; white-space: normal; word-break: break-all; line-height: 1.35; }
/* 页面标题栏按钮统一高度（2026-10-27 用户要求：同组按钮大小一致，只靠颜色区分主次） */
.page-head .btn, .page-head .btn.sm,
.doc-head .btn, .doc-head .btn.sm {
  height: 38px; padding: 0 16px; font-size: 13px; border-radius: 8px;
}

/* 客户标签多选（2026-10-29） */
.tag-pick { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.tag-chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; cursor: pointer; background: var(--surface); color: var(--text-2); transition: all .15s ease; }
.tag-chip:hover { border-color: var(--tc, var(--accent)); color: var(--tc, var(--accent)); }
.tag-chip.on { background: var(--tc, var(--accent)); border-color: var(--tc, var(--accent)); color: #fff; font-weight: 500; }

/* 客户编辑：左右两栏 + 联系人块（2026-10-29） */
.cust-two { display: grid; grid-template-columns: minmax(380px, 0.95fr) minmax(560px, 1.25fr); gap: 14px; flex: 1; min-height: 0; }
.cust-two > .card { overflow: auto; }
.ct-block { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--bg-soft); }
.ct-block .ct-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.ct-block .frm { gap: 10px 14px; }

/* 联系人多行（电话/社交平台，2026-10-29） */
.multi-row { display: grid; align-items: center; gap: 8px; margin-bottom: 8px; }
.multi-row > .inp { width: 100%; min-width: 0; }
.multi-row.phone-row { grid-template-columns: 92px minmax(0, 1fr) 30px; }
.multi-row.social-row { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) 30px; }
.cc-pick, .social-pick { width: 100%; min-width: 0; }
.country-picker > .inp { width: 100%; box-sizing: border-box; }
.wa-inp { width: 300px; max-width: 100%; }
.wa-row { display: flex; gap: 8px; align-items: center; }
.wa-inp { max-width: 300px; }
.mini-plus, .mini-x { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mini-plus:hover { border-color: var(--accent); color: var(--accent); }
.mini-x { color: var(--danger); border-color: var(--danger-line); }

/* PI 收款方式账户管理（2026-10-29） */
.settings-body { display: block !important; }
.pay-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: var(--bg-soft); }
.pay-group-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.pay-acc { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; background: var(--surface); }
.pay-acc-h { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.pay-acc-h .inp { flex: 1; }
.pay-field { display: grid; grid-template-columns: 22px minmax(0,0.8fr) minmax(0,1.2fr) 28px; gap: 6px; align-items: center; margin-bottom: 6px; }

/* 阿里店铺行（2026-10-29） */
.store-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.store-row .inp { width: 100%; min-width: 0; }

/* ---------- 订单详情页签（v1.2.77）：基本信息 / 产品明细 / 收款台账 / 发货记录 / 单据中心 ---------- */
.order-view { overflow: hidden; }
.order-top { flex: none; display: flex; flex-direction: column; gap: 10px; }
.order-tabs { padding: 0; }
.order-tabs .st { padding: 8px 12px; }
.order-tabs .otab-n {
  display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-2); font-size: var(--ds-font-2xs); font-weight: 500;
  vertical-align: 1px;
}
.order-tabs .st.on .otab-n { background: var(--accent-soft); color: var(--accent-ink); }
.order-pane { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 4px; }
.order-pane > .card { margin-bottom: 0; }

/* ---------- 订单「基本信息」内联表单（v1.2.78） ---------- */
.order-info-form .card-b { padding-top: 12px; }
.order-info-form .frm { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.order-info-form .ofs-sec { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.order-info-form .ofs-sec .form-section-title { margin-bottom: 0; }
.order-info-form .ofs-sec .btn { margin-left: auto; }
.order-info-form .ofs-sec .small { margin-left: auto; }
.ofs-dirty {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500;
  color: #B45309; background: #FEF3C7; border: 1px solid #FDE68A; border-radius: 999px; padding: 2px 9px;
}
.ofs-dirty[hidden] { display: none; }
.order-tabs .st.ofs-dot::after {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #F59E0B; margin-left: 5px; vertical-align: 1px;
}
@media (max-width: 1180px) {
  .order-info-form .frm { grid-template-columns: 1fr 1fr; }
}

/* ---------- 订单列表：可点直达页签的单元格（v1.2.79） ---------- */
.cell-go { display: block; color: inherit; text-decoration: none; cursor: pointer; border-radius: 6px; }
.cell-go:hover { background: var(--bg-soft); box-shadow: 0 0 0 4px var(--bg-soft); }
.cell-go:hover .sub2 { color: var(--text); }
/* 页签角标：未收（橙）/ 已收清（绿） */
.order-tabs .otab-n.warn { background: #FEF3C7; color: #B45309; }
.order-tabs .otab-n.ok { background: #DCFCE7; color: #15803D; }

/* 页签角标：逾期（红）——与收款角标的 warn/ok 配套（v1.2.80） */
.order-tabs .otab-n.bad { background: #FEE2E2; color: #B91C1C; }

/* 运费计算卡片（v1.2.81，在「产品明细」页签里） */
.freight-card .card-b { padding-top: 12px; }
.freight-card .frm { gap: 10px 14px; }
@media (max-width: 1280px) { .freight-card .frm { grid-template-columns: 1fr 1fr !important; } }

/* 订单号只读分段展示（v1.2.84） */
.ord-no-wrap { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.ord-no { font-size: 16px; letter-spacing: .06em; line-height: 1.2; display: flex; flex-wrap: wrap; gap: 3px; }
.ord-seg { padding: 2px 5px; border-radius: 6px; font-weight: 700; }
.ord-seg-country { background: #EEF4FF; color: #1D4ED8; }
.ord-seg-cus { background: #ECFDF5; color: #047857; }
.ord-seg-sp { background: #FEF3C7; color: #B45309; }
.ord-seg-pt { background: #F5F3FF; color: #6D28D9; }
.ord-seg-date { background: #F1F5F9; color: #334155; }
.ord-seg-seq { background: #FEF2F2; color: #B91C1C; }
.ord-seg-ck { background: #F0FDF4; color: #15803D; }
.ord-no-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 11px; color: var(--text-2); }
.ord-seg-k { display: inline-flex; align-items: center; gap: 5px; }
.ord-seg-k b { font-weight: 700; color: var(--text); }
.ord-seg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ord-seg-dot-country { background: #1D4ED8; }
.ord-seg-dot-cus { background: #047857; }
.ord-seg-dot-sp { background: #B45309; }
.ord-seg-dot-pt { background: #6D28D9; }
.ord-seg-dot-date { background: #334155; }
.ord-seg-dot-seq { background: #B91C1C; }
.ord-seg-dot-ck { background: #15803D; }

/* 运费阶梯价（v1.2.85） */
.freight-card .ofs-sec .small { margin-left: auto; }
.ftier-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 12px; color: var(--text-2); }
.ftier { padding: 3px 9px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line-soft); }
.ftier.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); font-weight: 600; }

/* ---------------- 汇率表（v1.4.0，FR-121） ----------------
   只消费令牌：字号走 --ds-font-*，圆角走 --ds-radius-*，颜色走语义变量（暗色皮肤自动跟随）。 */
.rates-view { gap: 12px; }
.fx-table-wrap { max-height: calc(100vh - 430px); overflow: auto; }
.fx-table td { padding: 3px 8px; vertical-align: middle; }
.fx-table .fx-inp {
  width: 100%; max-width: 132px; height: 30px; text-align: right;
  font-family: var(--ds-font-family-mono); font-size: var(--ds-font-sm);
  font-variant-numeric: tabular-nums;
}
.fx-inp.fx-miss { border-color: var(--warn-line); background: var(--warn-soft); }
.fx-inp.fx-bad { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.fx-table tr.fx-row-miss td { background: var(--warn-soft); }
.fx-table tr.fx-row-miss td:first-child { box-shadow: inset 3px 0 0 var(--warn-line); }
.fx-state { font-size: var(--ds-font-xs); color: var(--muted); }
.rep-fxbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-fx-tag {
  font-size: var(--ds-font-2xs); padding: 1px 7px; border-radius: var(--ds-radius-pill);
  background: var(--accent-soft); color: var(--accent-ink);
}
.rep-fxbar .sep { color: var(--faint); }
.rep-fx-link { margin-left: auto; font-size: var(--ds-font-xs); color: var(--accent-ink); text-decoration: none; }
.rep-fx-link:hover { text-decoration: underline; }

/* 订单页「金额与汇率」小字块 */
.fx-mini { flex: none; }
.fx-mini-b { padding: 8px 12px 10px; }
.fx-mini .card-h { padding-bottom: 6px; }
.fx-grid, .fx-line {
  display: grid; grid-template-columns: 1fr 120px 130px; gap: 8px; align-items: center;
}
.fx-h { font-size: var(--ds-font-2xs); color: var(--muted); padding-bottom: 3px; }
.fx-h.r { text-align: right; }
.fx-line { font-size: var(--ds-font-xs); padding: 3px 0; border-bottom: 1px dashed var(--line-soft); }
.fx-line:last-of-type { border-bottom: 0; }
.fx-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-orig { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.fx-cny { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.fx-sum .fx-name, .fx-total .fx-name { color: var(--text); font-weight: var(--ds-font-semibold); }
.fx-total { border-top: 1px solid var(--line); padding-top: 5px; }
.fx-total .fx-cny { color: var(--accent-ink); font-weight: var(--ds-font-semibold); }
.fx-note { margin-top: 6px; font-size: var(--ds-font-2xs); color: var(--muted); line-height: 1.7; }

/* ---------------- 金额/汇率/运费并入一行（v1.4.5 起，v1.4.8 补运费） ----------------
   之前「金额与汇率」是一张独立卡片（逐行列表 + 小计 + 说明），和明细表重复。
   现在：人民币小字挂在每行金额下；合计行给「订单金额 / 运费」各自的人民币；
   表格下方一行同时承载 汇率 + 合计（含运费）+ 同步按钮，三者同字号、不重复。 */
.t .fx-sub { font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals .fx-sub { font-size: var(--ds-font-2xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-inline {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 4px;
  padding: 7px 16px 8px; border-top: 1px dashed var(--line-soft);
  font-size: var(--ds-font-xs); color: var(--muted);
}
.fx-inline .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.fx-grand { font-size: var(--ds-font-xs); color: var(--muted); white-space: nowrap; }
.fx-grand b { color: var(--text); font-weight: var(--ds-font-semibold); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* ---------------- 登录页（v1.4.1，FR-122） ----------------
   两端共用：网页端由服务端会话鉴权，桌面端由主进程校验本机账号。
   布局：≥900px 左品牌右表单；≤900px 单列；≤720px 表单控件放大到 16px 防 iOS 缩放。 */
body.login-mode .sidebar,
body.login-mode .topbar { display: none; }
body.login-mode .main { width: 100%; }
.login-wrap {
  flex: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 28px 20px;
  background:
    radial-gradient(1100px 520px at 12% -10%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}
.login-card {
  width: 100%; max-width: 880px; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--ds-radius-2xl);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.login-brand {
  padding: 38px 34px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: var(--ds-color-text-inverse);
}
.login-logo {
  width: 46px; height: 46px; border-radius: var(--ds-radius-lg); display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .28);
  font-size: var(--ds-font-xl); font-weight: var(--ds-font-bold);
}
.login-title { font-size: var(--ds-font-2xl); font-weight: var(--ds-font-bold); letter-spacing: .5px; }
.login-sub { font-size: var(--ds-font-sm); opacity: .88; line-height: 1.7; }
.login-points { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.login-points li { display: flex; flex-direction: column; gap: 2px; font-size: var(--ds-font-sm); }
.login-points b { font-weight: var(--ds-font-semibold); }
.login-points span { opacity: .82; line-height: 1.6; }
.login-badge {
  margin-top: auto; align-self: flex-start; font-size: var(--ds-font-2xs);
  padding: 3px 10px; border-radius: var(--ds-radius-pill);
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .24);
}
.login-form { padding: 38px 34px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.login-h { font-size: var(--ds-font-xl); font-weight: var(--ds-font-semibold); color: var(--text); }
.login-sub2 { font-size: var(--ds-font-sm); color: var(--muted); margin-top: -6px; }
.login-fld { display: flex; flex-direction: column; gap: 6px; font-size: var(--ds-font-xs); color: var(--text-2); }
.login-fld .inp { height: 44px; font-size: var(--ds-font-md); }
.login-btn { height: 44px; font-size: var(--ds-font-md); margin-top: 4px; }
.login-err {
  font-size: var(--ds-font-xs); color: var(--danger); background: var(--danger-soft);
  border: 1px solid var(--danger-line); border-radius: var(--ds-radius-sm); padding: 8px 10px;
}
.login-hint { font-size: var(--ds-font-xs); color: var(--muted); line-height: 1.8; }
.login-hint b { color: var(--text-2); }
.login-foot { font-size: var(--ds-font-2xs); color: var(--faint); }
@media (max-width: 900px) {
  .login-card { grid-template-columns: 1fr; max-width: 460px; }
  .login-brand { padding: 26px 24px; gap: 8px; }
  .login-points { display: none; }
  .login-form { padding: 24px; }
}
@media (max-width: 720px) {
  .login-wrap { padding: 16px 12px; align-items: flex-start; }
  .login-card { margin-top: 18px; }
  .login-fld .inp, .login-btn { height: 46px; font-size: var(--ds-font-lg); }
}

/* ---------------- 手机浏览器（v1.4.1，FR-122）：网页端在手机上也要能用 ----------------
   桌面端窗口最小 1024，不受影响；这里只处理 ≤820px 的窄屏：
   侧栏变顶部横向导航、表单变单列、统计卡两列、表格允许横向滚动（不挤压内容）。 */
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex-direction: row; align-items: center; height: auto;
    padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto; overflow-y: hidden;
  }
  .sidebar .brand, .sidebar .side-foot { display: none; }
  .sidebar .nav { display: flex; flex-direction: row; gap: 2px; overflow-x: auto; overflow-y: hidden; width: 100%; }
  .sidebar .nav a { flex: none; white-space: nowrap; padding: 7px 10px; font-size: var(--ds-font-xs); border-radius: var(--ds-radius-sm); }
  .sidebar .nav a .badge { margin-left: 4px; }
  .topbar { padding: 6px 10px; gap: 8px; }
  .topbar .search { display: none; }
  .main { min-height: 0; }
  .view { padding: 12px 10px 10px; gap: 10px; }
  .page-head { flex-wrap: wrap; }
  .page-head .right { margin-left: 0; width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .v { font-size: var(--ds-font-xl); }
  .frm { grid-template-columns: 1fr; }
  .settings-cols, .order-cols { flex-direction: column; }
  .card-b, .card-h { padding-left: 10px; padding-right: 10px; }
  .t { min-width: 560px; }
  .order-left .t { min-width: 720px; }
  .orders-body { overflow-x: auto; }
  /* 卡片头在窄屏换行，标题不再被挤成竖排 */
  .card-h { flex-wrap: wrap; row-gap: 6px; }
  .card-h > .sub { display: none; }
  .fx-mini .card-h > .pill { order: 3; }
  .doc-head, .order-head, .ord-head { flex-wrap: wrap; row-gap: 4px; }
  .items-tool { display: none; }
  .fx-grid, .fx-line { grid-template-columns: 1fr 92px 104px; gap: 4px; }
  .rep-filter-row { flex-direction: column; align-items: stretch; }
  .rep-seg { flex-wrap: wrap; }
  .info-strip { display: none; }
}

/* ---------------- 单据生成向导（v1.4.9） ----------------
   两步：选类型 → 确认参数。左侧参数、右侧体检；全部走令牌，不写裸值。 */
.dg-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dg-kind {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); cursor: pointer; transition: all .15s ease;
}
.dg-kind:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.dg-kind b { font-size: 13px; font-weight: 600; color: var(--text); }
.dg-kind span { font-size: 11px; color: var(--muted); }
.modal-b.dg-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; overflow: auto; }
.dg-frm { grid-template-columns: 1fr 1fr; }
.dg-sec { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 2px 0 8px; }
.dg-check { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-soft); margin-bottom: 12px; }
.dg-check-h { font-size: 12px; color: var(--text); margin-bottom: 6px; }
.dg-chk { display: flex; gap: 6px; align-items: flex-start; font-size: 11px; line-height: 1.7; padding: 2px 0; color: var(--text-2); }
.dg-chk .dg-ico { flex: none; width: 14px; text-align: center; font-weight: 600; }
.dg-chk.bad { color: var(--danger); }
.dg-chk.warn { color: var(--warn); }
.dg-chk.ok { color: var(--ok); }
.dg-chk.info { color: var(--muted); }
.dg-will { display: flex; flex-wrap: wrap; gap: 6px; }

/* 明细行内的次要文本输入（客户型号 / 原产地，v1.4.10）
   虚线边框只在 hover/focus 出现，平时读起来像一行说明文字，不抢主字段的视觉重量。 */
.sub-input {
  width: 100%; margin-top: 3px; padding: 2px 5px; font-size: 11px; line-height: 1.4;
  color: var(--muted); background: transparent; border: 1px dashed transparent;
  border-radius: 4px; font-family: inherit; box-sizing: border-box;
}
.sub-input::placeholder { color: var(--muted); opacity: .72; }
.sub-input:hover { border-color: var(--line); background: var(--surface); }
.sub-input:focus { outline: none; border-color: var(--accent-line); background: var(--surface); color: var(--text); }

/* 产品库：被多选的行（v1.4.11）
   整行淡蓝底 + 左侧一道主色，和「当前打开的产品」区分开（后者用 .sel 描边）。 */
.t tr.row-sel > td { background: var(--accent-soft); }
.t tr.row-sel > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* 明细行级体检点（v1.4.11）：绿=齐全 / 黄=一个小问题 / 红=多个问题；悬停看具体原因 */
.row-dot {
  display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 999px;
  background: var(--warn); vertical-align: middle;
}
.row-dot.bad { background: var(--danger); }
.row-dot.ok { background: var(--ok); opacity: .45; }

/* 单据页「下一步」流程条（v1.4.11）：四步引导，已完成的打勾；只跳转/导出，不改状态 */
.flowbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: none;
  padding: 8px 12px; border-top: 1px solid var(--line-soft); background: var(--bg-soft);
}
.flowbar .flow-h { font-size: 11px; color: var(--muted); margin-right: 4px; }
.flow-step {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; font-size: 11px; line-height: 1;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.flow-step:hover { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }
.flow-step b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 999px; font-size: var(--ds-font-2xs);
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line);
}
.flow-step.on { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.flow-step.on b { background: var(--ok); color: var(--surface); border-color: var(--ok); }

/* 明细行级体检点（v1.4.11）：绿=齐全 / 黄=一个小问题 / 红=多个问题；悬停看具体原因 */
.row-dot {
  display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 999px;
  background: var(--warn); vertical-align: middle;
}
.row-dot.bad { background: var(--danger); }
.row-dot.ok { background: var(--ok); opacity: .45; }

/* 单据页「下一步」流程条（v1.4.11）：四步引导，已完成的打勾；只跳转/导出，不改状态 */
.flowbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: none;
  padding: 8px 12px; border-top: 1px solid var(--line-soft); background: var(--bg-soft);
}
.flowbar .flow-h { font-size: 11px; color: var(--muted); margin-right: 4px; }
.flow-step {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; font-size: 11px; line-height: 1;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.flow-step:hover { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }
.flow-step b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 999px; font-size: var(--ds-font-2xs);
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line);
}
.flow-step.on { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.flow-step.on b { background: var(--ok); color: var(--surface); border-color: var(--ok); }

/* 订单状态联动建议条（v1.4.12）：一条数据驱动的"下一步"，点按钮才改状态 */
.nextbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none;
  padding: 8px 14px; margin: 0 0 8px;
  border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft);
}
.nextbar .nb-ico { color: var(--accent-ink); font-weight: 600; }
.nextbar .nb-msg { font-size: 12px; color: var(--accent-ink); }
.nextbar .nb-note { margin-left: auto; font-size: 11px; color: var(--muted); }

/* 明细表头分组行（v1.4.12）：产品 / 价格 / 包装与物流 / 操作 */
.t tr.grp-row th.grp {
  font-size: var(--ds-font-2xs); font-weight: 600; letter-spacing: .04em; text-transform: none;
  color: var(--muted); background: var(--bg-soft);
  border-bottom: 1px solid var(--line-soft); padding: 4px 8px;
}
.t tr.grp-row th.grp.r { text-align: right; }
.t tr.grp-row th.grp.c { text-align: center; }
.t.items-tbl thead tr:last-child th { border-top: 0; }

/* 日期快捷项（v1.4.13）：今天 / +N 天 / 月底 / ETD+N，一点即填
   只放在日期字段下面，宽度自适应；10px 与表内小字同档，不与主字段抢视线。 */
.dpick { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.dpick-b {
  font-size: var(--ds-font-2xs); line-height: 1; padding: 6px 8px; min-height: 24px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  cursor: pointer; font-family: inherit; transition: all .12s ease;
}
.dpick-b:hover { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }

/* ---------------- 窄屏浮动标签（v1.4.13） ----------------
   为什么只在 ≤820px 做：桌面是 3 列栅格，标签浮不浮都占同一行高，收益≈0；
   窄屏 .frm 变单列后每字段独立成行，标签上浮能省下约 16px/字段，一屏多显示 2–3 个字段。
   实现：标签绝对定位覆盖在输入框上，靠 :has() 判断"聚焦中 / 已有值"再上浮。
   文本框依赖 placeholder=" "（由 augmentNarrowForms() 补），否则 :placeholder-shown 永远不匹配；
   select / 日期 / 多行框本身总显示内容，标签直接常驻上方。 */
@media (max-width: 820px) {
  .fld { position: relative; }
  .fld > label {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    margin: 0; padding: 0; font-size: var(--ds-font-xs); color: var(--muted);
    pointer-events: none; transition: top .12s ease, font-size .12s ease, color .12s ease;
  }
  .fld > input.inp, .fld > select.inp { height: 46px; padding-top: 17px; padding-bottom: 3px; }
  .fld > textarea.inp.area { padding-top: 22px; }

  .fld:has(> input.inp:focus) > label,
  .fld:has(> input.inp:not(:placeholder-shown)) > label,
  .fld:has(> select.inp) > label,
  .fld:has(> input[type="date"]) > label,
  .fld:has(> textarea) > label {
    top: 6px; transform: none; font-size: var(--ds-font-2xs); color: var(--accent-ink);
  }

  /* 日期快捷项在窄屏贴到输入框下方，不额外占列宽 */
  .dpick { margin-top: 6px; }
  .dpick-b { padding: 5px 8px; font-size: 11px; }
}

/* 窄屏浮动标签 · 修两个必然冲突（v1.4.13）：
   ① 字段自带 placeholder（如"如 Shenzhen, China"）会和居中的标签叠字 ——
      未聚焦时把原生 placeholder 变透明，聚焦后再显出来（标签此时已上浮，正是标准行为）；
   ② 标签文字比字段宽时会折行压住值 —— 单行省略。 */
@media (max-width: 820px) {
  .fld > label {
    white-space: nowrap; max-width: calc(100% - 20px);
    overflow: hidden; text-overflow: ellipsis;
  }
  .fld > input.inp::placeholder { color: transparent; }
  .fld > input.inp:focus::placeholder { color: var(--muted); }
  .fld > textarea.inp::placeholder { color: transparent; }
  .fld > textarea.inp:focus::placeholder { color: var(--muted); }
}

/* 窄屏浮动标签 · 修两个必然冲突（v1.4.13）：
   ① 字段自带 placeholder（如"如 Shenzhen, China"）会和居中的标签叠字 ——
      未聚焦时把原生 placeholder 变透明，聚焦后再显出来（标签此时已上浮，正是标准行为）；
   ② 标签文字比字段宽时会折行压住值 —— 单行省略。 */
@media (max-width: 820px) {
  .fld > label {
    white-space: nowrap; max-width: calc(100% - 20px);
    overflow: hidden; text-overflow: ellipsis;
  }
  .fld > input.inp::placeholder { color: transparent; }
  .fld > input.inp:focus::placeholder { color: var(--muted); }
  .fld > textarea.inp::placeholder { color: transparent; }
  .fld > textarea.inp:focus::placeholder { color: var(--muted); }
}

/* ---------------- 单据页签（v1.4.17） ----------------
   取消"单据中心"集合：PI / 报价 / CI / 装箱单 / 报关单 是五个一级页签，与「基本信息」同级。
   页签从 5 个变成 9 个，所以这条页签条允许横向滚动（不换行、不挤压字），
   并在单据组前留一条竖线：视觉上分成"订单 / 单据"两组，但层级相同。 */
.order-tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; scrollbar-width: none; }
/* v1.4.21：窄窗下右侧还有页签时给一条渐隐，否则滚动条被隐藏后完全看不出（评审 D1） */
.order-tabs.can-more {
  -webkit-mask-image: linear-gradient(to right, rgb(0 0 0) calc(100% - 32px), rgba(0 0 0 / 0));
  mask-image: linear-gradient(to right, rgb(0 0 0) calc(100% - 32px), rgba(0 0 0 / 0));
}
.order-tabs::-webkit-scrollbar { height: 0; }
.order-tabs .st { flex: none; }
.otab-sep { flex: none; width: 1px; height: 16px; margin: 0 6px; background: var(--line); }
/* v1.4.19：双区页签把「数据区 / 单据区」各包成一层 span；不设 flex 会让 .st 变成普通行内元素。
   这里只给最小布局，选中态（下划线）在本文件内完成。 */
.subtabs .otab-zone { display: flex; align-items: center; gap: 4px; flex: none; }
.otab-dot { display: none; }

/* 空单据页签的引导：不只说"还没有"，直接给下一步按钮 */
.doc-empty-cta { margin-top: 10px; }

@media (max-width: 820px) {
  /* 窄屏：列表与预览上下排，页签本身已可横向滚动 */
  .doc-split { grid-template-columns: 1fr; height: auto; }
}


/* ---------------- ≤1100px 适配（v1.4.21） ----------------
   原来只在 ≤820 才换行/变单列，导致 900–1024 这段"半宽"区间：订单头溢出 88px（把「+ 生成单据」挤出屏幕）、
   单据两栏各剩 300 多 px、A4 只能看到半页。这里补一档中间断点。 */
@media (max-width: 1100px) {
  .doc-head { flex-wrap: wrap; row-gap: 6px; }
  .doc-head .right { flex-wrap: wrap; margin-left: auto; row-gap: 6px; }
  .doc-split { grid-template-columns: 1fr; height: auto; }
  .doc-split .doc-mid { border-right: 0; padding-right: 0; }
  .doc-split .doc-main .preview { min-height: 420px; }
}
