/* ============================================================
   快消报单 · B 端后台设计系统
   依据 design-taste-frontend/app-screens + impeccable craft-floor
   Operate 模式：颜色给数据、KPI 是文字、表格靠对齐、导航退到背景
   ============================================================ */
:root {
  /* 三层表面：地面 / 卡片 / 抬升 */
  --ground: #f7f8f9;
  --surface: #ffffff;
  --raised: #f3f5f6;
  --active: #eceeef;

  /* 三级线条 */
  --border: #e6e8ea;
  --rule: #f0f1f2;
  --control: #cfd4d8;

  /* 三级文字：每一级都达到 4.5:1 */
  --ink: #14181b;
  --ink-2: #545c63;
  --ink-3: #626a71;
  --faint: #626a71;

  /* 一个强调色，只给数据与唯一主操作 */
  --brand: #1f6f5c;
  --brand-ink: #175647;
  --brand-wash: #e7f1ee;
  --primary: #1d2024;          /* 主按钮近黑，不用品牌色 */
  --accent: #1f6f5c;
  --gold: #1f6f5c;
  --gold-wash: #e7f1ee;

  --red: #b3261e;
  --red-wash: #fcecea;
  --green: #1d6b4a;
  --green-wash: #e4f2ea;
  --amber: #8a5a06;
  --amber-wash: #fbf2df;
  --blue: #24578f;
  --blue-wash: #e8eff7;
  --violet: #5b5b7a;
  --violet-wash: #eeeff4;

  --r-xs: 3px;
  --r-sm: 5px;
  --r: 7px;
  --r-lg: 10px;
  --shadow-1: none;
  --shadow-2: 0 10px 30px rgba(20, 24, 27, .10);

  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --serif: var(--sans);
  --display: var(--sans);

  /* 字号阶梯：12 / 14 / 16 / 24，四个尺寸 */
  --fs-title: 24px;
  --fs-section: 16px;
  --fs-kpi: 24px;
  --fs-body: 14px;
  --fs-small: 12px;

  --side: 232px;
  --rail: 56px;
  --top: 52px;
  --bar: 52px;
  --tab: 60px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-wash); color: var(--ink); }
.mono, .num, .money { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-small); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- 启动 ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--ink-3); }
.boot-mark { width: 44px; height: 44px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 600; }

/* ---------- 骨架：地面上的侧栏 + 一条顶栏 ---------- */
.shell.with-sidebar { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.fg-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ground); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px 10px;
}
.fg-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.fg-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 16px; }
.fg-brand b { display: block; font-size: 14px; font-weight: 600; }
.fg-brand small { font-size: 11px; color: var(--ink-3); }
.fg-org { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 9px; }
.fg-org-av { width: 28px; height: 28px; border-radius: 6px; background: var(--active); color: var(--ink-2); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: 0 0 auto; }
.fg-org b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-org small { font-size: 11px; color: var(--ink-3); }
.fg-nav { margin-top: 16px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.fg-group h3 { margin: 0 10px 6px; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.fg-link {
  display: flex; align-items: center; gap: 10px; min-height: 34px;
  padding: 0 10px; border-radius: 5px; font-size: 13.5px; color: var(--ink-2);
}
.fg-link svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--ink-3); }
.fg-link:hover { background: var(--raised); color: var(--ink); }
.fg-link.on { background: var(--active); color: var(--ink); font-weight: 600; }
.fg-link.on svg { color: var(--ink-2); }
.fg-link-dot { display: none; }
.fg-foot { border-top: 1px solid var(--rule); padding-top: 10px; display: flex; gap: 8px; align-items: center; }
.fg-foot b { display: block; font-size: 11.5px; font-weight: 600; }
.fg-foot small { font-size: 11px; color: var(--ink-3); }
.fg-foot a { color: var(--ink-3); font-size: 14px; padding: 4px; }

.fg-main { min-width: 0; display: flex; flex-direction: column; }
.fg-top {
  height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.fg-menu { display: none; }
.fg-crumb { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.fg-crumb i { font-style: normal; margin: 0 6px; color: var(--ink-3); }
.fg-crumb b { color: var(--ink); font-weight: 600; }
.fg-chips { display: flex; gap: 8px; margin-left: auto; }
.fg-chip { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.fg-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fg-date { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.fg-search { display: flex; align-items: center; gap: 6px; background: var(--raised); border: 1px solid var(--border); border-radius: 5px; padding: 0 8px; height: 30px; width: 200px; }
.fg-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 12px; }
.fg-search kbd { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.fg-backdrop { display: none; }

.page { padding: 20px 24px 48px; flex: 1; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { font-size: var(--fs-title); font-weight: 600; line-height: 1.25; }
.page-sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--control); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #2c3137; border-color: #2c3137; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--raised); }
.btn-danger { color: var(--red); border-color: #e8c7c3; background: var(--surface); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-lg { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn.disabled { opacity: .4; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field-label em { color: var(--red); font-style: normal; }
.input, .select, .textarea {
  width: 100%; min-height: 36px; padding: 7px 10px; background: var(--surface);
  border: 1px solid var(--control); border-radius: var(--r-sm); font-size: 13.5px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 2px var(--brand-wash); }
.textarea { min-height: 76px; resize: vertical; }
.hint { font-size: 12px; color: var(--ink-3); }
.form-error { background: var(--red-wash); color: var(--red); border-radius: var(--r-sm); padding: 8px 10px; font-size: 12.5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* ---------- 卡片 / 网格（无阴影、1px 边） ---------- */
.card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.card-h, .panel-head { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--rule); }
.card-h h2, .card-h h3, .panel-head h2 { font-size: var(--fs-section); font-weight: 600; margin: 0; }
.card-h .n, .panel-head .n { font-size: 11.5px; color: var(--ink-2); background: var(--active); padding: 0 6px; border-radius: 3px; }
.card-h .sub, .panel-head .sub { font-size: 12px; color: var(--ink-3); }
.card-h a, .card-h .link, .panel-head a { margin-left: auto; font-size: 12.5px; color: var(--brand-ink); white-space: nowrap; }
.card-b, .panel-body { padding: 16px; }
.card-f, .panel-foot { padding: 10px 16px; border-top: 1px solid var(--rule); display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 16px; align-items: start; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 16px; align-items: start; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }

/* KPI：一个容器被 1px 线分成等列，不是四个瓷砖 */
.mgrid, .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 16px; }
.metric, .kpis > div { padding: 14px 18px; }
.metric + .metric, .kpis > div + div { border-left: 1px solid var(--rule); }
.metric .lab { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }
.metric .lab em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.metric .val, .kpis .val { font-size: var(--fs-kpi); font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.metric .val.accent { color: var(--brand-ink); }
.metric .sub, .kpis .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 表格：规则与对齐 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 400; color: var(--ink-3);
  padding: 9px 12px; height: 38px; border-bottom: 1px solid var(--border); background: transparent;
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); height: 46px; white-space: nowrap; }
.table td.wrap { white-space: normal; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--raised); }
.table .num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { font-weight: 600; }
.table.dense th { font-size: 11.5px; padding: 8px 12px; height: 36px; }
.table.dense td { padding: 8px 12px; height: 44px; font-size: 12.5px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.cell-main { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--brand-ink); font-weight: 500; font-variant-numeric: tabular-nums; font-size: 12.5px; cursor: pointer; }
.money { font-variant-numeric: tabular-nums; }
.order-selection { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-3); }
.order-selection input[type=checkbox], .table input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); }

/* ---------- 印章状态：淡底深字 ---------- */
.stamp { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.stamp::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.s-pending { background: var(--amber-wash); color: #7a4e05; }
.s-stocked, .s-settled, .s-delivered { background: var(--green-wash); color: #17563c; }
.s-cancelled { background: var(--active); color: var(--ink-2); }
.s-draft { background: var(--amber-wash); color: #7a4e05; }
.s-confirmed { background: var(--blue-wash); color: #1d4a7a; }
.s-soft { background: var(--active); color: var(--ink-2); }
.s-danger { background: var(--red-wash); color: #8f1d17; }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.list-item:last-child { border-bottom: 0; }
.list-main { min-width: 0; flex: 1; }
.list-main b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main small { color: var(--ink-3); font-size: 12px; }
.list-meta { text-align: right; white-space: nowrap; }
.list-meta b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.list-meta small { color: var(--ink-3); font-size: 12px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); flex: 0 0 auto; }
.dot.green { background: var(--green); }
.timeline-item { display: flex; gap: 10px; padding: 8px 0; }
.timeline-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: 0 0 auto; }
.timeline-item .t { font-size: 12px; color: var(--ink-3); }
.timeline-item .c { font-size: 13px; }

/* ---------- 工具条 / 标签 / 空态 ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--control); border-radius: var(--r-sm); padding: 0 10px; height: 32px; min-width: 240px; }
.toolbar .search input { border: 0; outline: 0; background: transparent; flex: 1; height: 100%; font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 8px 12px; font-size: 13px; color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.empty { padding: 36px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--raised); display: grid; place-items: center; margin: 0 auto 10px; }

/* ---------- 抽屉 / 弹窗 / 提示 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 24, 27, .34); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 100%); background: var(--surface); z-index: 61; box-shadow: var(--shadow-2); display: flex; flex-direction: column; }
.drawer-h { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.drawer-h h3 { font-size: 15px; }
.drawer-b { padding: 16px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 11px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 61; padding: 16px; }
.modal-card { background: var(--surface); border-radius: var(--r-lg); width: min(440px, 100%); box-shadow: var(--shadow-2); }
.modal-h { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-b { padding: 16px; }
.modal-f { padding: 11px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.toast-wrap { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 7px; }
.toast { background: var(--ink); color: #fff; padding: 8px 13px; border-radius: var(--r-sm); font-size: 12.5px; }
.toast.err { background: var(--red); }

/* ---------- 登录 ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-side { background: var(--brand); color: #fff; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand .mark { width: 34px; height: 34px; border-radius: 8px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 600; font-size: 18px; }
.auth-brand b { font-size: 15px; }
.auth-brand small { display: block; font-size: 12px; color: rgba(255,255,255,.85); }
.auth-side h1 { font-size: 34px; font-weight: 600; line-height: 1.3; margin-top: 40px; }
.auth-side .lede { color: rgba(255,255,255,.9); margin-top: 14px; max-width: 360px; font-size: 13.5px; }
.auth-flow { margin-top: 36px; display: flex; flex-direction: column; gap: 16px; }
.auth-flow div { display: flex; gap: 12px; align-items: flex-start; }
.auth-flow .n { font-family: var(--mono); font-size: 12px; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 3px; padding: 1px 5px; }
.auth-flow b { display: block; font-size: 13px; }
.auth-flow small { color: rgba(255,255,255,.9); font-size: 12px; }
.auth-foot { font-size: 12px; color: rgba(255,255,255,.9); }
.auth-main { display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(380px, 100%); }
.auth-card .eyebrow { display: none; }
.auth-card h2 { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.auth-card .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 22px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 12px; font-size: 12.5px; }
.auth-links a { padding: 4px 2px; white-space: nowrap; }
.auth-demo { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 12px; font-size: 12px; color: var(--ink-3); line-height: 1.9; }
.auth-demo code { font-family: var(--mono); background: var(--raised); padding: 0 4px; border-radius: 3px; color: var(--ink-2); }

/* ---------- 其它复用组件 ---------- */
.receipt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 16px 22px; position: relative; }
.receipt .rh { text-align: center; border-bottom: 1px dashed var(--border); padding-bottom: 9px; }
.receipt .rh b { font-size: 15px; font-weight: 600; letter-spacing: .08em; }
.receipt .rh small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
.receipt .line { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px dotted var(--border); font-size: 12.5px; }
.receipt .line span { color: var(--ink-3); flex: 0 0 auto; }
.receipt .line b { font-variant-numeric: tabular-nums; text-align: right; }
.receipt .items { margin-top: 7px; }
.receipt .item { display: flex; justify-content: space-between; gap: 20px; font-size: 12.5px; padding: 4px 0; }
.receipt .item b { font-variant-numeric: tabular-nums; }
.receipt .total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--border); margin-top: 9px; padding-top: 9px; }
.receipt .total span { font-size: 12.5px; color: var(--ink-3); }
.receipt .total b { font-size: 24px; color: var(--brand-ink); }
.seal { position: absolute; right: 14px; top: 12px; width: 62px; height: 62px; border: 2px solid var(--red); border-radius: 50%; color: var(--red); display: grid; place-items: center; font-size: 12px; font-weight: 600; transform: rotate(-12deg); text-align: center; line-height: 1.3; pointer-events: none; }
.tabbar { display: none; }
.quick { display: flex; gap: 16px; }
.quick .q { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px 0; text-align: center; }
.quick .q .ic { font-size: 32px; }
.quick .q .t { font-size: 13px; font-weight: 600; margin-top: 8px; }
.quick .q .s { font-size: 12px; color: var(--ink-3); }
.notice { display: flex; gap: 16px; padding: 16px; background: var(--amber-wash); border: 1px solid #e8d6ac; border-radius: var(--r); }
.notice .t { font-size: 13px; font-weight: 600; color: #7a4e05; }
.notice .s { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.scan-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.scan-box input { width: 100%; height: 52px; font-size: 20px; letter-spacing: .04em; text-align: center; border: 1px solid var(--control); border-radius: var(--r-sm); background: var(--surface); }
.scan-box input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 2px var(--brand-wash); }
.scan-hint { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 8px; }
.scan-result { margin-top: 14px; padding: 12px 14px; border-radius: var(--r); display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.scan-result.ok { background: var(--green-wash); border: 1px solid #cfe4d7; }
.scan-result.warn { background: var(--amber-wash); border: 1px solid #e8d6ac; }
.scan-result.bad { background: var(--red-wash); border: 1px solid #e8c7c3; }
.scan-result b { font-weight: 600; }
.scan-result .mono { margin-left: auto; }
.scan-log { max-height: 400px; overflow-y: auto; }
.log-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--rule); font-size: 12px; }
.log-row .tk { width: 150px; color: var(--ink-3); }
.log-row .p { flex: 1; min-width: 0; }
.log-row .t { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.log-row.bad .p { color: var(--red); }
.parcel-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.parcel-row .tk { font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.trace-box { padding: 0; }
.trace-box[data-loaded="1"] { padding: 10px 0 4px; }
.trace-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.trace-list { border-left: 2px solid var(--border); padding-left: 12px; display: flex; flex-direction: column; gap: 8px; }
.trace { display: flex; gap: 10px; font-size: 12px; }
.trace .t { color: var(--ink-3); font-variant-numeric: tabular-nums; flex: 0 0 auto; width: 118px; }
.trace .c { flex: 1; min-width: 0; color: var(--ink-2); line-height: 1.6; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.group-h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--rule); background: var(--raised); }
.group-h b { font-size: 13px; }
.group-h .meta { font-size: 12px; color: var(--ink-3); }
.group-h input[type=checkbox], .order-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); flex: 0 0 auto; }
.order-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--rule); }
.order-row:last-child { border-bottom: 0; }
.order-row .tk { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-3); width: 150px; flex: 0 0 auto; }
.order-row .p { flex: 1; min-width: 0; font-size: 12.5px; }
.order-row .amt { font-variant-numeric: tabular-nums; font-size: 12.5px; width: 76px; text-align: right; flex: 0 0 auto; }
.order-row .acts { display: flex; gap: 6px; flex: 0 0 auto; }
.bulk-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 999px; padding: 8px 8px 8px 18px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-2); z-index: 50; font-size: 13px; }
.bulk-bar .btn { border: 0; }
.bulk-bar .btn-primary { background: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .shell.with-sidebar { grid-template-columns: minmax(0, 1fr); }
  .fg-side { position: fixed; left: 0; top: 0; width: 252px; z-index: 70; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-2); }
  .shell.with-sidebar.nav-open .fg-side { transform: translateX(0); }
  .fg-backdrop { display: block; position: fixed; inset: 0; background: rgba(20,24,27,.3); z-index: 69; opacity: 0; pointer-events: none; }
  .shell.with-sidebar.nav-open .fg-backdrop { opacity: 1; pointer-events: auto; }
  .fg-menu { display: inline-flex; }
  .fg-chips { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .page { padding: 14px 16px 88px; }
  .fg-top { padding: 0 12px; gap: 8px; }
  .fg-date, .fg-search, .fg-crumb span, .fg-crumb i { display: none; }
  .page-title { font-size: 20px; }
  .actions { width: 100%; margin-left: 0; }
  .mgrid, .kpis, .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric:nth-child(3), .kpis > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule); }
  .form-row { grid-template-columns: minmax(0,1fr); }
  .auth { grid-template-columns: minmax(0,1fr); }
  .auth-side { display: none; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--rule); padding: 6px 0; }
  .table td { border: 0; padding: 4px 14px; display: flex; justify-content: space-between; gap: 12px; text-align: right; white-space: normal; height: auto; }
  .table td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; text-align: left; flex: 0 0 auto; }
  .table td.num { text-align: right; }
  .row-actions { justify-content: flex-start; }
  .drawer { width: 100%; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--tab); background: var(--surface); border-top: 1px solid var(--border); z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); font-size: 11px; }
  .tabbar a.on { color: var(--brand-ink); font-weight: 600; }
  .tabbar svg { width: 20px; height: 20px; }
  .bulk-bar { left: 12px; right: 12px; bottom: 74px; transform: none; justify-content: space-between; }
  .order-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 5px 8px; padding: 11px 12px; }
  .order-row input[type=checkbox] { grid-column: 1; grid-row: 1; }
  .order-row .tk { grid-column: 2; grid-row: 1; width: auto; font-size: 11.5px; }
  .order-row .amt { grid-column: 3; grid-row: 1; width: auto; }
  .order-row .p { grid-column: 1 / -1; grid-row: 2; font-size: 13px; }
  .order-row .acts { grid-column: 1 / -1; grid-row: 3; justify-content: flex-end; }
  .group-h { flex-wrap: wrap; }
  .fg-search { display: none; }
  .log-row .tk { width: 110px; }
  .trace .t { width: 100%; }
  .trace { flex-direction: column; gap: 2px; }
  .parcel-row { flex-wrap: wrap; }
  .parcel-row .tk { flex: 1 1 100%; }
}
