/* 财务对账结算工作台 — 本地静态 UI 样式（无外部依赖 / 无字体 CDN） */

:root {
  color-scheme: light;

  /* 表面：带冷调的近黑，不用纯黑 #000 */
  --bg: #070a0f;
  --bg-elev: #0c121a;
  --bg-soft: #111a25;
  --bg-glass: rgba(255, 255, 255, .028);
  --bg-glass-hi: rgba(255, 255, 255, .055);

  /* 文字 */
  --ink: #e8eef7;
  --ink-soft: #a7b6c9;
  --ink-muted: #74849a;

  /* 分隔线：用白色低透明，而非实色 */
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .14);

  /* 强调色：青（避开 AI 紫蓝渐变指纹），与状态绿拉开色相 */
  --accent: #22d3ee;
  --accent-deep: #0891b2;
  --accent-ink: #041519;
  --accent-soft: rgba(34, 211, 238, .10);
  --accent-glow: rgba(34, 211, 238, .32);

  /* 状态色 */
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, .10);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .10);
  --bad: #fb7185;
  --bad-soft: rgba(251, 113, 133, .10);

  /* 形状：分级圆角，不一刀切 */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  /* 阴影：内高光 + 深投影，模拟统一顶部光源 */
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 18px 40px -26px rgba(0, 0, 0, .95);
  --shadow-lift: inset 0 1px 0 rgba(255, 255, 255, .07), 0 24px 48px -28px rgba(0, 0, 0, 1);

  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --sans: "Segoe UI Variable Display", "Segoe UI Variable Text", -apple-system, BlinkMacSystemFont,
          "Segoe UI", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 220ms;
}

* { box-sizing: border-box; }

/* 关键：.alert / .results 用了 display: flex，会盖掉浏览器对 [hidden] 的默认
   display: none；没有这条，未开始的空结果区和空提示条会一直显示。 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  white-space: nowrap;
  z-index: 10;
}
/* 聚焦时落在顶部中间：左上角是 390 抽屉的汉堡按钮，盖住它鼠标就点不到了 */
.skip-link:focus {
  left: 50%;
  transform: translateX(-50%);
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 16px; line-height: 1.3; }
.brand-text small { color: var(--ink-muted); font-size: 12.5px; }

.topbar-meta { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  white-space: nowrap;
}

.badge-quiet {
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-color: var(--line);
  font-weight: 500;
}

/* ---------- 布局 ---------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0 4px;
}

.hero h1 {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.32;
  max-width: 30ch;
}

.hero-sub {
  color: var(--ink-soft);
  max-width: 62ch;
}

.steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  counter-reset: step;
}

.step {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.step-index {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}

.step-body h2 { font-size: 15px; margin-bottom: 2px; }
.step-body p { color: var(--ink-muted); font-size: 13px; line-height: 1.5; }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card-head h2 { font-size: 17px; }

.muted { color: var(--ink-muted); font-size: 13px; }

/* ---------- 提示条 ---------- */

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.alert-warn {
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  background: var(--warn-soft);
  color: var(--warn);
}

/* v0.33.1（实测 UI-07）：说明默认折起来，点开再看。 */
.wb-context { border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); padding: 8px 12px; }
.wb-context-summary { cursor: pointer; font-size: 12.5px; color: var(--ink-soft); }
.wb-context-summary:hover { color: var(--accent); }
.wb-context[open] .wb-context-summary { color: var(--accent); margin-bottom: 8px; }
.wb-context .file-hint { margin: 0 0 8px; }
.wb-context .file-hint:last-child { margin-bottom: 0; }

/* ---------- 上传表单 ---------- */

.file-grid {
  display: grid;
  /* v0.33.1（实测 UI-07）：原来三等分，第三格常常是空的——桌面版两张上传卡
     挤在左边、右边一大片留白。改成两张必填卡并排，可选规则整行铺开。 */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.file-grid .rules-panel { grid-column: 1 / -1; }

.file-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.file-field:hover { border-color: var(--accent); }
.file-field:focus-within { border-color: var(--accent); outline: 2px solid var(--accent-soft); }

.file-field.has-file {
  border-style: solid;
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  background: color-mix(in srgb, var(--ok-soft) 60%, var(--bg-elev));
}

.file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.req, .opt {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.req { color: var(--accent); background: var(--accent-soft); }
.opt { color: var(--ink-muted); background: var(--bg-elev); border: 1px solid var(--line); }

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-button {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.file-field:hover .file-button { border-color: var(--accent); color: var(--accent); }
.file-field:focus-within .file-button { border-color: var(--accent); color: var(--accent); }

.file-meta {
  font-size: 12.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.file-field.has-file .file-meta { color: var(--ok); font-weight: 600; }

.file-hint { font-size: 12.5px; color: var(--ink-muted); line-height: 1.5; }
.file-hint b { color: var(--ink-soft); font-weight: 600; }

/* ---------- 行业包（v0.8） ---------- */

.industry-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.industry-select {
  width: 100%;
  max-width: 420px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.industry-select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }

.industry-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.industry-desc { font-size: 13px; color: var(--ink); line-height: 1.55; }
.industry-rules { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.industry-custom-title { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }

.industry-custom ul { margin: 6px 0 0; padding-left: 20px; }
.industry-custom li { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.industry-custom li strong { color: var(--ink); }

.industry-disclaimer {
  font-size: 11.5px;
  color: var(--warn);
  line-height: 1.5;
}

/* v0.30 导入体检：跑对账之前先让人核对「读对了没有」 */
.preflight {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-soft, #f8fafc);
}

/* v0.33.0 多工作表选择：必须先选一张才继续，所以做成独立区块而不是弹窗——
   弹窗容易被当成提示点掉，这里是要用户回答的问题。 */
.sheet-choice {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn, #d97706);
  border-radius: var(--radius-sm);
  background: var(--surface-soft, #f8fafc);
}

.sheet-choice-head h3 { margin: 0 0 4px; font-size: 14px; color: var(--ink); }
.sheet-choice-file { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.sheet-choice-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sheet-choice-list li { margin: 0; }
.sheet-choice-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.sheet-choice-option:hover { border-color: var(--accent); }
.sheet-choice-option input { margin-top: 3px; }
.sheet-choice-name { font-weight: 600; color: var(--ink); }
.sheet-choice-meta { display: block; font-size: 12px; color: var(--ink-soft); }
.sheet-choice-hint { margin: 10px 0 0; font-size: 12px; color: var(--ink-soft); }

.preflight-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.preflight-head h3 { margin: 0; font-size: 14px; color: var(--ink); }
.preflight-summary { margin: 0; font-size: 12.5px; color: var(--ink-soft); }

.preflight-warnings {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preflight-warning {
  font-size: 12.5px;
  line-height: 1.55;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.preflight-warning.is-warning { background: #fff7ed; color: #9a3412; border-left: 3px solid #f97316; }
.preflight-warning.is-info { background: #f1f5f9; color: var(--ink-soft); border-left: 3px solid #94a3b8; }

.preflight-files { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

.preflight-file {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.preflight-file.is-bad { border-color: #fecaca; background: #fef2f2; }
.preflight-file-head { font-size: 13px; font-weight: 600; color: var(--ink); }

.preflight-cols {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.preflight-hint { margin: 6px 0 0; font-size: 12px; color: var(--ink-soft); }
.preflight-error { margin: 6px 0 0; font-size: 12.5px; color: #b91c1c; line-height: 1.55; }

.preflight-samples {
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.preflight-samples th,
.preflight-samples td {
  padding: 3px 10px 3px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.preflight-samples th { color: var(--ink-soft); font-weight: 600; }

.preflight-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* v0.31 金额口径：切换即重新体检，方向分布跟着对调 */
.preflight-sign {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.preflight-sign-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.preflight-sign-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.preflight-sign-note { font-size: 12px; color: var(--ink-soft); }

.preflight-sign-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.preflight-sign-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  cursor: pointer;
}

.preflight-sign-option input { margin-top: 2px; flex: 0 0 auto; }
.preflight-sign-option b { color: var(--ink); font-weight: 600; }

.preflight-sign-evidence {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft, #f8fafc);
}

.preflight-sign-evidence.is-suspect {
  background: #fff7ed;
  color: #9a3412;
  border-left: 3px solid #f97316;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}

.btn:disabled { cursor: progress; opacity: .62; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, #000); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line-strong);
}
.btn-ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--accent); }

.btn-small { padding: 6px 12px; font-size: 13px; }

.btn-approve {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}
.btn-approve:hover:not(:disabled) { background: var(--ok); color: var(--bg-elev); }

.btn-reject {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}
.btn-reject:hover:not(:disabled) { background: var(--bad); color: var(--bg-elev); }

.status { font-size: 13px; color: var(--ink-muted); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- 结果区 ---------- */

.results { display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 86px; }

.run-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 18px;
}

.run-field { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.run-label { font-size: 11.5px; color: var(--ink-muted); }
.run-field code { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.run-field span { font-size: 13px; color: var(--ink-soft); }
.run-field-files { flex: 1 1 220px; min-width: 0; }
.run-field-files span { word-break: break-all; }
.run-field-rules { flex: 1 1 260px; min-width: 0; }
.run-field-rules span { word-break: break-word; }
.run-bar .btn-small { margin-left: auto; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-label { font-size: 12.5px; color: var(--ink-muted); }
.summary-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.summary-sub { font-size: 11.5px; color: var(--ink-muted); }

.summary-card.is-ok .summary-value { color: var(--ok); }
.summary-card.is-bad .summary-value { color: var(--bad); }
.summary-card.is-accent .summary-value { color: var(--accent); }

/* ---------- 表格 ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }

td.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
td.code { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
td.actions { min-width: 258px; }
td.reason { color: var(--ink-soft); min-width: 220px; }

.row-index { color: var(--ink-muted); font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-pending { color: var(--warn); background: var(--warn-soft); }
.pill-approved { color: var(--ok); background: var(--ok-soft); }
.pill-rejected { color: var(--bad); background: var(--bad-soft); }

.review-box { display: flex; flex-direction: column; gap: 6px; }
.review-note {
  width: 100%;
  min-height: 34px;
  resize: vertical;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
}
.review-note:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.review-buttons { display: flex; gap: 6px; }
.review-buttons .btn { padding: 5px 12px; font-size: 12.5px; }
.review-meta { font-size: 11.5px; color: var(--ink-muted); word-break: break-word; }

.empty { color: var(--ink-muted); font-size: 13px; padding: 14px 2px 2px; }

/* ---------- 审计 ---------- */

details summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  padding: 2px 0;
}
details summary::marker { color: var(--ink-muted); }

.audit-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}

.audit-item {
  display: grid;
  grid-template-columns: 168px 96px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 12.5px;
}
.audit-time { font-family: var(--mono); color: var(--ink-muted); }
.audit-kind { font-weight: 600; }
.audit-detail { color: var(--ink-soft); word-break: break-word; }

/* ---------- 页脚 ---------- */

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------- 响应式 ---------- */

@media (max-width: 980px) {
  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .file-field-optional { grid-column: 1 / -1; }
}

/* v0.33.2：有银行收付数据时统计卡是 7 张，按 5 列排会剩「5+2」——第二行
   右边空三格，看着像页面没渲染完。让最后两张按 3+2 分掉整行。
   没有银行数据时只有 5 张，刚好排满一行，不受影响（靠 :has 判断第 7 张是否存在；
   不支持 :has 的浏览器忽略这两条，退化成原来的 5+2，不影响功能）。 */
@media (min-width: 981px) {
  .summary-grid:has(> :nth-child(7)) > :nth-child(6) { grid-column: span 2; }
  .summary-grid:has(> :nth-child(7)) > :nth-child(7) { grid-column: span 3; }
}

@media (max-width: 760px) {
  main { padding: 22px 16px 40px; gap: 18px; }
  .topbar-inner { padding: 10px 16px; }
  .brand-text small { display: none; }
  /* v0.33.1（实测 UI-07）：375px 首屏要留给上传和「开始对账」。
     三步说明压成一行标题（说明文字在桌面版仍完整），没结果的导出按钮收起，
     开始对账贴底常驻——不用滚到 y=960 才找得到。 */
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .step { padding: 8px 10px; gap: 8px; }
  .step-body h2 { font-size: .84rem; }
  .step-body p { display: none; }
  #export-btn:disabled { display: none; }
  #upload-form .form-actions {
    position: sticky; bottom: 0; z-index: 4;
    background: var(--bg); border-top: 1px solid var(--line);
    padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  }
  .file-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; }
  .run-bar { gap: 12px; }
  .run-bar .btn-small { margin-left: 0; width: 100%; }
  .status { margin-left: 0; width: 100%; }
  .audit-item { grid-template-columns: 1fr; gap: 2px; }
  .summary-value { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* 老浏览器（不支持 color-mix）回退：保留可读的纯色，不依赖混色函数 */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .topbar { background: var(--bg-elev); }
  .brand-mark { border-color: var(--line); }
  .badge { border-color: var(--line); }
  .step-index { border-color: var(--line); }
  .alert { border-color: var(--bad); }
  .alert-warn { border-color: var(--warn); }
  .file-field.has-file { border-color: var(--ok); }
  .btn-primary:hover:not(:disabled) { background: var(--accent); }
  .btn-approve { border-color: var(--ok); }
  .btn-reject { border-color: var(--bad); }
}

/* ---------- v0.9：登录 / 首次设置 / 设置页 ---------- */

/* 空提示条不占位：页面用 {{ERROR}} / {{NOTICE}} 占位，没有内容时整条隐藏。 */
.alert:empty { display: none; }

.auth-shell {
  max-width: 720px;
  margin: 40px auto 56px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-shell-wide { max-width: 920px; }

.auth-card { padding-bottom: 8px; }

.auth-lead {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 18px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 4px 0 18px;
}

.auth-field { display: flex; flex-direction: column; gap: 6px; }

.auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.auth-input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.auth-foot {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.75;
}

.auth-foot code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
}

.auth-foot a { color: var(--accent); }

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 4px 0 12px;
}

.info-row {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.info-row:last-child { border-bottom: 0; }

.info-row dt {
  flex: 0 0 120px;
  color: var(--ink-muted);
}

.info-row dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

.logout-form { display: inline; }

.topbar-user {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .auth-shell { margin-top: 20px; padding: 0 14px; }
  .info-row { flex-direction: column; gap: 2px; }
  .info-row dt { flex-basis: auto; }
  .topbar-user { display: none; }
}

/* ============================================================
   v2 企业级视觉升级
   原则：不改结构、不改类名、不改 JS，只提升视觉与质感
   ============================================================ */

/* ---------- 1. 背景：环境光晕 + 细噪点 ---------- */
body {
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(34, 211, 238, .10), transparent 62%),
    radial-gradient(820px 460px at 88% -4%, rgba(56, 189, 248, .055), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  font-feature-settings: "kern" 1, "liga" 1;
  letter-spacing: -.004em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar, main, .site-footer { position: relative; z-index: 1; }

/* ---------- 2. 排版 ---------- */
h1, h2, h3 { letter-spacing: -.018em; }

.hero h1 {
  font-size: clamp(28px, 3.1vw, 40px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -.03em;
  max-width: 15em;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 0%, #a5bdd2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* 小屏取消强断行，让文字自然回流 */
@media (max-width: 720px) {
  .hero-br { display: none; }
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 { color: var(--ink); -webkit-text-fill-color: currentColor; }
}

.hero-sub {
  max-width: 62ch;
  line-height: 1.72;
  color: var(--ink-soft);
}

/* 数据类数字统一等宽，避免跳动 */
.summary-value,
.run-field code,
td,
.audit-time,
.badge,
.status { font-variant-numeric: tabular-nums; }

/* ---------- 3. 顶栏 ---------- */
.topbar {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .035);
}

.brand-mark {
  border-radius: var(--radius-sm);
  color: #06181d;
  background: linear-gradient(160deg, #5eead4 0%, #22d3ee 55%, #0891b2 100%);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45),
    0 6px 18px -8px var(--accent-glow);
}

.brand-text strong { font-weight: 650; letter-spacing: -.015em; }

.badge {
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-glass);
  font-weight: 550;
  letter-spacing: .01em;
}

/* ---------- 4. 流程条：三段一体化 ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.step {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 0;
  border-radius: calc(var(--radius) - 5px);
  background: transparent;
  transition: background var(--dur) var(--ease);
}
.step:hover { background: rgba(255, 255, 255, .025); }

.step + .step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  width: 1px;
  height: 56%;
  background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
}

.step-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .045);
}

.step-body h2 { font-size: 14.5px; font-weight: 650; }
.step-body p { margin-top: 4px; font-size: 12.8px; line-height: 1.6; color: var(--ink-muted); }

/* ---------- 5. 卡片：玻璃 + 内高光 ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045) 0%, rgba(255, 255, 255, .015) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { border-color: var(--line-strong); }

.card-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.card-head h2 { font-size: 16px; font-weight: 650; }

/* ---------- 6. 按钮：渐变主按钮 + 物理反馈 ---------- */
.btn {
  border-radius: var(--radius-xs);
  font-weight: 600;
  letter-spacing: -.005em;
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform 120ms var(--ease),
    box-shadow var(--dur) var(--ease);
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  color: #041519;
  background: linear-gradient(180deg, #4ce7f2 0%, #1cc4dd 52%, #0b9db8 100%);
  border: 1px solid rgba(94, 234, 212, .55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    0 8px 22px -12px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 14px 30px -12px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0) scale(.988); }
.btn-primary:disabled {
  background: var(--bg-soft);
  color: var(--ink-muted);
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.btn-ghost {
  background: var(--bg-glass);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}
.btn-ghost:hover {
  background: var(--bg-glass-hi);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong));
}
.btn-ghost:active { transform: translateY(1px); }

/* ---------- 7. 文件选择区 ---------- */
.file-field {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .014);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.file-field:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  background: rgba(34, 211, 238, .028);
}
.file-button {
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong);
  background: var(--bg-glass-hi);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.file-button:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft);
}

/* ---------- 8. 指标卡 ---------- */
.summary-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .016));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.summary-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }

.summary-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--line-strong);
  opacity: .7;
}
.summary-card.is-ok::before { background: var(--ok); }
.summary-card.is-bad::before { background: var(--bad); }
.summary-card.is-accent::before { background: var(--accent); }

.summary-label {
  font-size: 12px;
  font-weight: 550;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.summary-value {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--ink);
}
.summary-card.is-ok .summary-value { color: var(--ok); }
.summary-card.is-bad .summary-value { color: var(--bad); }
.summary-card.is-accent .summary-value { color: var(--accent); }

.summary-sub { font-size: 12.3px; color: var(--ink-muted); }

/* ---------- 9. 表格 ---------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  /* 保留圆角裁切的同时允许窄屏横向滚动；不能用 overflow:hidden，否则列会被裁掉 */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

table thead th {
  background: rgba(255, 255, 255, .035);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line-strong);
}

tbody tr {
  transition: background 140ms var(--ease);
}
tbody tr:hover { background: rgba(34, 211, 238, .035); }
tbody td { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }

/* 状态胶囊（app.js 实际用 .pill + .pill-<status>，勿用 .status，
   .status 是「正在处理…」提示条） */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: .005em;
  border: 1px solid transparent;
}
.pill-pending {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}
.pill-approved {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
.pill-rejected {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 30%, transparent);
}

/* ---------- 10. 空状态 ---------- */
.empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .012);
}

/* ---------- 11. 结果区入场 ---------- */
@keyframes wb-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.results:not([hidden]) .card,
.results:not([hidden]) .summary-card {
  animation: wb-rise 320ms var(--ease) both;
}
.results:not([hidden]) .summary-card:nth-child(2) { animation-delay: 40ms; }
.results:not([hidden]) .summary-card:nth-child(3) { animation-delay: 80ms; }
.results:not([hidden]) .summary-card:nth-child(4) { animation-delay: 120ms; }
.results:not([hidden]) .summary-card:nth-child(5) { animation-delay: 160ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 12. 响应式收口 ---------- */
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; }
  .step + .step::before {
    left: 28px;
    top: 0;
    width: calc(100% - 56px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  }
  .summary-value { font-size: 22px; }
}

/* 小屏顶栏：防止品牌文字被挤成竖排（flex 子项默认 min-width:auto 会被压到极限） */
@media (max-width: 820px) {
  .topbar-inner { gap: 10px; }
  .brand { min-width: 0; flex: 0 1 auto; }
  .brand-text { min-width: 0; }
  .brand-text small { display: none; }          /* 副标题先让位 */
  .brand-text strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
  }
  .topbar-meta { gap: 6px; flex: 0 0 auto; }
  .topbar-meta .badge-quiet { display: none; }  /* "仅本机运行" 徽标在小屏让位 */
}

@media (max-width: 560px) {
  .brand-text { display: none; }                /* 极窄屏只留 logo */
  .topbar-meta { gap: 5px; }
  .btn-small { padding: 5px 9px; font-size: 12.5px; }
}



/* ============================================================
   规则可视化面板（替代"上传 JSON"，财务不用写代码）
   ============================================================ */
.rules-panel {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .018);
  padding: 0;
  overflow: hidden;
}
.rules-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
  list-style: none;
  user-select: none;
  transition: background var(--dur) var(--ease);
}
.rules-summary::-webkit-details-marker { display: none; }
.rules-summary::before {
  content: "▸";
  color: var(--accent);
  font-size: 12px;
  transition: transform var(--dur) var(--ease);
}
.rules-panel[open] > .rules-summary::before { transform: rotate(90deg); }
.rules-summary:hover { background: rgba(34, 211, 238, .04); }
.rules-title { letter-spacing: -.01em; }
.rules-summary .opt {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 4px 18px 16px;
}
.rule-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--sans);
}
.rule-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 550;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rule-label b { color: var(--accent); font-variant-numeric: tabular-nums; }
.rule-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rule-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.rule-input:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
.rule-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(34, 211, 238, .06);
}
.rule-unit {
  font-size: 12.5px;
  color: var(--ink-muted);
  min-width: 16px;
}
.rule-range {
  width: 100%;
  accent-color: var(--accent);
  height: 22px;
  cursor: pointer;
}
.rules-hint {
  margin: 0 18px 14px;
  font-size: 12.3px;
  line-height: 1.65;
  color: var(--ink-muted);
  font-family: var(--sans);
}
/* v0.13.6（P3-5）：规则「默认 / 自定义」开关 + 当前生效规则 */
.rule-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin: 0 18px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .022);
}
.rule-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}
.rule-switch-wrap {
  position: relative;
  display: block;
  flex: none;
  width: 34px;
  height: 19px;
}
.rule-checkbox {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.rule-switch {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .08);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.rule-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ink-muted);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.rule-checkbox:checked + .rule-switch {
  background: rgba(34, 211, 238, .26);
  border-color: var(--accent);
}
.rule-checkbox:checked + .rule-switch::after {
  transform: translateX(15px);
  background: var(--accent);
}
.rule-checkbox:focus-visible + .rule-switch {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.rule-toggle:hover .rule-switch {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
}
.rule-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.rule-toggle-text b {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.rule-toggle-text span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.rules-effective {
  margin: 0;
  font-size: 12.3px;
  line-height: 1.6;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.rule-input:disabled,
.rule-range:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.rule-input:disabled:hover { border-color: var(--line-strong); }
.rule-range:disabled { accent-color: var(--ink-muted); }
.rules-advanced {
  border-top: 1px solid var(--line);
  padding: 0 18px;
}
.rules-advanced > summary {
  padding: 12px 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  cursor: pointer;
  list-style: none;
  font-family: var(--sans);
}
.rules-advanced > summary::-webkit-details-marker { display: none; }
.rules-advanced > summary::before { content: "﹢ "; color: var(--accent); }
.rules-advanced[open] > summary::before { content: "− "; }
.rules-advanced .file-field { margin-bottom: 14px; }

/* ============================================================
   批量审核（勾选 + 批量通过/拒绝）
   ============================================================ */
.col-check {
  width: 40px;
  text-align: center;
  padding-left: 14px !important;
  padding-right: 6px !important;
}
.col-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 18px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13px;
}
.batch-info {
  color: var(--ink-soft);
  font-weight: 550;
}
.batch-info b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.batch-bar .btn-sm {
  padding: 6px 14px;
  font-size: 12.5px;
  border-radius: var(--radius-xs);
}
.btn.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #04131a;
  border-color: transparent;
  font-weight: 650;
}
.btn.btn-primary:hover { filter: brightness(1.08); }

/* 运行信息栏右侧的操作按钮组（导出 / 再对一次） */
.run-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ============================================================
   历史记录（v0.11.x）
   关掉浏览器再回来还能找回上个月的对账结果。
   复用既有令牌 --bg / --ink / --accent / --line，不另起配色。
   ============================================================ */
.history-card { padding: 16px 18px 18px; }
.history-head { align-items: center; margin-bottom: 12px; }
.history-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.history-card .empty { margin: 0; }

.history-list {
  list-style: none;
  margin: 0;
  padding: 0 2px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* 记录多了也不能把上传区挤出首屏：列表自己滚动 */
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.history-list::-webkit-scrollbar { width: 8px; }
.history-list::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
}

.history-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.history-open {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns:
    minmax(0, 1.05fr)
    minmax(0, 1.35fr)
    minmax(0, .95fr)
    minmax(0, .72fr)
    minmax(0, 1.25fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.history-open:hover {
  background: var(--bg-glass-hi);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line-strong));
}
.history-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.history-item.is-active .history-open {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line-strong));
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.history-when { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.history-time {
  font-size: 13.2px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-files {
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* v0.33.0：演示数据标记。合成案例和客户自己的账在同一个列表里，
   没有这个标签就只能靠文件名猜。 */
.history-demo {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--warn, #d97706);
  border-radius: 999px;
  font-size: 11px;
  line-height: 16px;
  color: var(--warn, #d97706);
  white-space: nowrap;
}

/* v0.33.1（实测 UI-09）：同名文件跑过多次时，历史行要说明这次读的是哪张工作表。 */
.history-sheets {
  flex: none;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11px;
  line-height: 16px;
  color: var(--ink-muted);
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-stat {
  min-width: 0;
  font-size: 12.3px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-stat b { color: var(--ink); font-weight: 650; }
.history-stat b.history-rate { color: var(--accent); }

.history-review { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.history-review-text {
  font-size: 11.8px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}
.history-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width var(--dur) var(--ease);
}

.history-delete {
  flex: 0 0 auto;
  align-self: center;
  color: var(--ink-muted);
}
.history-delete:hover:not(:disabled) {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 45%, var(--line-strong));
}
.history-delete:focus-visible {
  outline: 2px solid var(--bad);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .history-open {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    row-gap: 8px;
  }
  .history-review { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .history-card { padding: 14px; }
  .history-item { flex-wrap: wrap; }
  .history-open { flex-basis: 100%; grid-template-columns: 1fr; row-gap: 6px; padding: 11px 12px; }
  .history-review { grid-column: auto; }
  .history-delete { margin-left: auto; }
}

/* ============================================================
   异常处理闭环（v0.12）
   勾选 + 批量标记「已核实 / 已忽略 / 待处理」+ 逐条备注。
   颜色只走既有令牌：黄=待处理、绿=已核实、灰=已忽略。
   ============================================================ */
.card-hint {
  margin: -2px 0 12px;
  font-size: 12.4px;
  line-height: 1.6;
}

.pill-exc-pending {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}
.pill-exc-verified {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
.pill-exc-ignored {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .06);
  border-color: var(--line-strong);
}

/* 已处理的差异不再抢注意力：原因列降到次要文字层级 */
tbody tr[data-handle-status="verified"] td.reason,
tbody tr[data-handle-status="ignored"] td.reason {
  color: var(--ink-muted);
}

.exc-note-cell {
  width: 22%;
  min-width: 170px;
}
.exc-note {
  width: 100%;
  min-width: 130px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, .02);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  transition:
    border-color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.exc-note::placeholder { color: var(--ink-muted); }
.exc-note:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .04);
}
.exc-note:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
  background: rgba(255, 255, 255, .05);
}

/* 窄屏：7 列的异常表如果按 100% 挤压，中文会被压成「竖排单字」。
   给表格一个可读的最小宽度，横向滚动交给 .table-wrap（不是页面）。 */
@media (max-width: 860px) {
  #exception-table { min-width: 760px; }
  /* v0.13.5：匹配表加了「发票金额 / 方向」两列，同理给最小宽度，
     否则 390 宽下「收款」会被挤成上下两个单字。 */
  #match-table { min-width: 980px; }
}

@media (max-width: 560px) {
  .exc-note-cell { min-width: 140px; }
  .card-hint { font-size: 12px; }
}

/* ==========================================================================
   v0.13 多角色与用户管理
   --------------------------------------------------------------------------
   用户管理页复用主站的卡片 / 表格 / 胶囊体系；这里只补它自己的骨架：
   页头、角色选择器、角色徽章、原生 <dialog> 弹窗与表单错误提示。
   ========================================================================== */

.users-shell {
  max-width: 1080px;
  margin: 28px auto 0;
  padding: 0 20px 48px;
}

.users-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.users-head h1 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.users-head .muted {
  margin-top: 6px;
  font-size: 13px;
  max-width: 62ch;
}

.alert-ok {
  border-color: color-mix(in srgb, var(--ok) 32%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, transparent);
  color: color-mix(in srgb, var(--ok) 78%, var(--ink));
}

/* 账号表：六列，窄屏横滚留在卡片里 */
#user-table { min-width: 640px; }
.user-name strong { font-weight: 650; }
.user-self {
  margin-left: 6px;
  font-size: 11.5px;
  color: var(--ink-muted);
}
.user-created {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.user-actions { min-width: 200px; }
.user-action-box {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.role-select {
  appearance: none;
  padding: 4px 26px 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background-color: rgba(255, 255, 255, .03);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
                    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}
.role-select:hover {
  border-color: var(--accent);
  background-color: rgba(255, 255, 255, .06);
}
.role-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.role-select:disabled { opacity: .55; cursor: progress; }

.pill-active { color: var(--ok); background: var(--ok-soft); }
.pill-disabled {
  color: var(--ink-muted);
  background: rgba(255, 255, 255, .06);
}

.btn-danger-ghost:hover {
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
  color: var(--bad);
}

/* 角色说明：行式，不做三等宽卡片 */
.role-grid { margin: 0; display: grid; gap: 10px; }
.role-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
}
.role-row dt { margin: 0; }
.role-row dd { margin: 0; color: var(--ink-soft); font-size: 13px; }

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.role-admin { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.role-accountant { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.role-supervisor { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

/* 原生弹窗：深色玻璃 + 顶部内高光，与卡片同一套光源 */
.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev), var(--bg));
  color: var(--ink);
  box-shadow: var(--shadow-lift);
}
.modal::backdrop {
  background: rgba(2, 5, 9, .72);
  backdrop-filter: blur(2px);
}
.modal-form {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 22px;
}
.modal-form h2 { font-size: 18px; }
.modal-form .muted { font-size: 12.5px; }
.modal-form .auth-field { margin: 0; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.form-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  border-radius: var(--radius-xs);
  background: var(--bad-soft);
  color: color-mix(in srgb, var(--bad) 80%, var(--ink));
  font-size: 12.5px;
}
.form-error:empty { display: none; }

@media (max-width: 760px) {
  .users-shell { margin-top: 20px; padding: 0 14px 40px; }
  .users-head { align-items: flex-start; }
  .users-head h1 { font-size: 22px; }
  .role-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .user-action-box { gap: 6px; }
}

/* v0.13.2：窄屏（≤760px）直接把账号表改成卡片式。
   为什么不在表格上钉操作列：钉住的列会盖住旁边那列（600px 时「角色」下拉被切一半），
   而 390px 首屏只看得到用户名 + 按钮、必须横滑才能看到角色和状态——对「禁用离职账号」
   这种操作，手机上最要紧的就是按钮别藏起来（sh-bot 复审 P3-6）。
   卡片一账号一张：用户名 + 状态、显示名、角色 + 操作全在首屏，不横向滚动。
   创建时间属于桌面信息，手机上不占位置（桌面宽度照常显示）。 */
@media (max-width: 760px) {
  /* 卡片本身自带边框，外层容器不再重复画框；横滚能力保留（内容不超宽就不会出现滚动条） */
  #user-table-wrap { border: 0; }
  #user-table { display: block; min-width: 0; }
  #user-table thead { display: none; }
  #user-table tbody { display: block; }
  #user-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name    status"
      "display display"
      "role    actions";
    gap: 6px 10px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
  }
  #user-table tbody tr:last-child { margin-bottom: 0; }
  #user-table tbody td {
    display: block;
    border: 0;
    padding: 0;
    min-width: 0;
  }
  #user-table td:nth-child(1) { grid-area: name; align-self: center; }
  #user-table td:nth-child(2) {
    grid-area: display;
    color: var(--ink-soft);
    font-size: 12.5px;
    white-space: normal;
  }
  #user-table td:nth-child(3) { grid-area: role; }
  #user-table td:nth-child(4) { display: none; }
  #user-table td:nth-child(5) { grid-area: status; justify-self: end; align-self: center; }
  #user-table td:last-child { grid-area: actions; justify-self: end; }
  #user-table .user-actions { min-width: 0; }
  #user-table .user-action-box { justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  .role-select { transition: none; }
}

/* ==========================================================================
   v3 工作台壳（重构版式）
   --------------------------------------------------------------------------
   版式：左侧固定/可折叠板块导航 → 右侧顶部模块操作栏（标题 + 场景/行业 +
   筛选 + 主/次操作）→ 右侧主体业务界面。
   只做布局与视觉：不改 DOM id、不改任何请求路径、不改后端。
   颜色/圆角/阴影全部复用文件顶部 :root 令牌，本段不新增任何硬编码色值。
   ========================================================================== */

:root {
  --wb-sidebar-w: 264px;
  --wb-sidebar-w-rail: 76px;
  --wb-topbar-h: 76px;
}

body.wb {
  min-height: 100vh;
  min-height: 100dvh;
}

.wb-shell {
  display: grid;
  grid-template-columns: var(--wb-sidebar-w) minmax(0, 1fr);
  align-items: start;
  min-height: 100vh;
  min-height: 100dvh;
}

body.wb-collapsed .wb-shell {
  grid-template-columns: var(--wb-sidebar-w-rail) minmax(0, 1fr);
}

/* ---------- 左侧：板块导航 ---------- */

.wb-sidebar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .006) 46%),
    var(--bg-elev);
  border-right: 1px solid var(--line);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .022);
}

.wb-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 10px;
  min-width: 0;
}

.wb-brand-mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}

.wb-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.wb-brand-text strong {
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-brand-text small {
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.wb-version {
  align-self: flex-start;
  margin: 0 14px 4px;
  font-size: 11px;
}

.wb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--bg-glass);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.wb-icon-btn:hover {
  background: var(--bg-glass-hi);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong));
}

.wb-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wb-collapse svg { transition: transform var(--dur) var(--ease); }
body.wb-collapsed .wb-collapse svg { transform: rotate(180deg); }

.wb-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 12px 18px;
}

.wb-nav-group {
  margin: 16px 0 6px;
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .12em;
  color: var(--ink-muted);
}

.wb-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wb-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.wb-nav-item:hover {
  background: var(--bg-glass-hi);
  color: var(--ink);
}

.wb-nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.wb-nav-item[aria-current="page"] {
  color: var(--ink);
  background: linear-gradient(90deg, var(--accent-soft), transparent 88%);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  box-shadow: inset 2px 0 0 var(--accent);
}

.wb-nav-icon {
  flex: 0 0 18px;
  opacity: .92;
}

.wb-nav-item[aria-current="page"] .wb-nav-icon { color: var(--accent); }

.wb-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-nav-tag {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-glass);
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* 规划中模块：不是按钮也不是链接，点了不会有任何跳转（避免空页面/假数据）。
   两列紧凑排布 + 组标题写明「规划中·不可用」，不占满整列、也不伪装成可用入口。 */
.wb-nav-planned {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2px 4px;
}

.wb-nav-item.is-planned {
  min-height: 28px;
  padding: 4px 10px;
  color: var(--ink-muted);
  font-size: 12.5px;
  opacity: .7;
  cursor: default;
}

.wb-nav-item.is-planned:hover {
  background: transparent;
  color: var(--ink-muted);
}

.wb-nav-planned .wb-nav-label { flex: 1 1 auto; }
/* v0.14 审核 P3：小标签保留（组标题之外，每项自己也能看出「规划中」） */

.wb-sidebar-foot {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 16px;
  border-top: 1px solid var(--line);
}

.wb-sidebar-foot #user-chip {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-sidebar-foot .logout-form {
  display: flex;
  justify-self: end;
  margin: 0;
}

.wb-sidebar-foot > .badge { justify-self: start; }

.wb-sidebar-foot .logout-form .btn { width: 100%; }

/* 折叠成图标栏 */
body.wb-collapsed .wb-brand-row {
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  padding: 16px 6px 10px;
}
body.wb-collapsed .wb-brand-text,
body.wb-collapsed .wb-nav-label,
body.wb-collapsed .wb-nav-tag,
body.wb-collapsed .wb-nav-group,
body.wb-collapsed .wb-version,
body.wb-collapsed .wb-sidebar-foot .badge,
body.wb-collapsed .wb-sidebar-foot #user-chip { display: none; }
body.wb-collapsed .wb-nav-item { justify-content: center; padding: 8px 0; }
body.wb-collapsed .wb-nav-planned { display: none; }
body.wb-collapsed .wb-sidebar-foot { grid-template-columns: 1fr; padding: 12px 6px 16px; }
body.wb-collapsed .wb-sidebar-foot .btn-small { padding: 5px 8px; font-size: 12px; }

/* ---------- 右侧：模块操作栏 ---------- */

.wb-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.wb-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-height: var(--wb-topbar-h);
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03);
}

.wb-nav-toggle { display: none; }

.wb-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 220px;
  min-width: 0;
}

.wb-title h1 {
  font-size: 19px;
  font-weight: 680;
  line-height: 1.25;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-sub {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-filters {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 1 auto;
}

.wb-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.wb-field-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-muted);
}

.industry-select.wb-select {
  width: auto;
  min-width: 168px;
  max-width: 230px;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: var(--radius-xs);
  background: var(--bg-soft);
}

.wb-select:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line-strong));
}

.wb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

/* 提示条住在顶栏里：任何视图下的错误/健康/状态都看得见，不遮内容 */
.wb-alerts {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-alerts .alert { margin-bottom: 0; }

.wb-alerts .status {
  margin-left: 0;
  align-self: flex-start;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--bg-glass);
}

.wb-alerts .status:empty { display: none; }

/* ---------- 主体：视图切换 ---------- */

#main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px 56px;
  gap: 18px;
}

.wb-pane {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

body[data-view="recon"] .wb-pane:not([data-view="recon"]),
body[data-view="review"] .wb-pane:not([data-view="review"]),
body[data-view="exceptions"] .wb-pane:not([data-view="exceptions"]),
body[data-view="audit"] .wb-pane:not([data-view="audit"]),
body[data-view="history"] .wb-pane:not([data-view="history"]),
/* v0.33.2：月结/银行/规则/设置/用户加入同一套面板切换 */
body[data-view="monthend"] .wb-pane:not([data-view="monthend"]),
body[data-view="bank"] .wb-pane:not([data-view="bank"]),
body[data-view="rules"] .wb-pane:not([data-view="rules"]),
body[data-view="settings"] .wb-pane:not([data-view="settings"]),
body[data-view="users"] .wb-pane:not([data-view="users"]) {
  display: none;
}

/* v0.33.2：嵌入面板撑满右侧工作区（顶栏 sticky 76px + 1px 分隔线），
   iframe 内部自己滚动——面板切换时不拖动整页。 */
.wb-pane.wb-embed {
  flex: 1 0 auto;
  height: calc(100vh - 77px);
  height: calc(100dvh - 77px);
  min-height: 480px;
  padding: 0 20px 18px;
}
.wb-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}
@media (max-width: 760px) {
  .wb-pane.wb-embed { padding: 0 12px 12px; }
}

/* v0.33.3：修嵌入视图双纵向滚动条。
   之前面板定高 calc(100dvh - 77px)，但 .wb-main 里还有顶栏、#main 的
   上下 padding 和页脚——整页实际高度超出视口约 150px，窗口滚动条与
   iframe 内部滚动条并存（月结总览首当其冲）。
   改法：五个嵌入视图下整页锁定视口高度、禁止页面滚动；#main 吃满
   顶栏之外的剩余空间，面板 flex 撑满。滚动只发生在 iframe 内部，
   右侧永远只有一条滚动条。有免登录横幅时用 --dev-banner-h 让位。 */
body[data-view="monthend"],
body[data-view="bank"],
body[data-view="rules"],
body[data-view="settings"],
body[data-view="users"] {
  overflow: hidden;
}
body[data-view="monthend"] .wb-shell,
body[data-view="bank"] .wb-shell,
body[data-view="rules"] .wb-shell,
body[data-view="settings"] .wb-shell,
body[data-view="users"] .wb-shell {
  min-height: calc(100vh - var(--dev-banner-h, 0px));
  min-height: calc(100dvh - var(--dev-banner-h, 0px));
}
body[data-view="monthend"] .wb-main,
body[data-view="bank"] .wb-main,
body[data-view="rules"] .wb-main,
body[data-view="settings"] .wb-main,
body[data-view="users"] .wb-main {
  min-height: 0;
  height: calc(100vh - var(--dev-banner-h, 0px));
  height: calc(100dvh - var(--dev-banner-h, 0px));
}
body[data-view="monthend"] #main,
body[data-view="bank"] #main,
body[data-view="rules"] #main,
body[data-view="settings"] #main,
body[data-view="users"] #main {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 18px;
  overflow: hidden;
}
body[data-view="monthend"] .wb-pane.wb-embed,
body[data-view="bank"] .wb-pane.wb-embed,
body[data-view="rules"] .wb-pane.wb-embed,
body[data-view="settings"] .wb-pane.wb-embed,
body[data-view="users"] .wb-pane.wb-embed {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}
.wb-pane.wb-embed .wb-frame {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}
/* 嵌入视图里页脚会挤压 iframe 且无法滚动到，藏掉；独立页不受影响。 */
body[data-view="monthend"] .site-footer,
body[data-view="bank"] .site-footer,
body[data-view="rules"] .site-footer,
body[data-view="settings"] .site-footer,
body[data-view="users"] .site-footer {
  display: none;
}

.wb-empty { max-width: 70ch; }

/* Phase 1：流水发票对账工作流子标签栏（把上传/审核/差异/审计/历史收拢进同一工作区） */
.wb-subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 12px;
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
}
.wb-subnav[hidden] { display: none !important; }
.wb-subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.wb-subtab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.wb-subtab.is-active,
.wb-subtab[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.16);
}
.wb-subtab-right {
  margin-left: auto;
}
.wb-subtab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.wb-subtab-badge.is-warn {
  background: color-mix(in srgb, var(--danger, #ef4444) 18%, transparent);
  color: var(--danger, #f87171);
}
@media (max-width: 680px) {
  .wb-subtab-right { margin-left: 0; }
}

/* 企业级通栏对账工作台：左数据导入 + 右常驻策略与规则引擎，零废话堆砌 */
.recon-desk {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
  align-items: start;
}
.recon-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.recon-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.recon-tpl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.recon-tpl-select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  color: var(--text);
  font-size: 12.5px;
}
.recon-strategy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2, rgba(255, 255, 255, 0.025));
}
.recon-strategy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.recon-strategy-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}
.recon-fee-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.recon-fee-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.recon-fee-cap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.recon-fee-cap input {
  width: 78px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  text-align: right;
}
.recon-assets-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.recon-asset-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease;
}
.recon-asset-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.recon-asset-btn strong {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.recon-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.recon-actions-left,
.recon-actions-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.wb-dialog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.wb-dialog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
  font-size: 13px;
}
.wb-dialog-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wb-dialog-item-sub {
  font-size: 12px;
  color: var(--muted);
}
.wb-dialog-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.site-footer {
  max-width: none !important;
  width: 100%;
  margin: 0;
  padding: 12px 28px 20px;
}
@media (max-width: 1060px) {
  .recon-desk { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .recon-upload-grid,
  .recon-assets-bar,
  .wb-dialog-row { grid-template-columns: 1fr; }
}

.wb-context {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .014);
}

#upload-form .form-actions { margin-top: 16px; }

/* 主按钮禁用态：老样式里 .btn.btn-primary 的渐变比 :disabled 更靠后，
   会把禁用按钮画成可用（导出按钮在没跑过对账时看起来可点）。这里显式压回去。 */
.btn.btn-primary:disabled,
#export-btn:disabled {
  background: var(--bg-soft);
  background-image: none;
  color: var(--ink-muted);
  border-color: var(--line);
  box-shadow: none;
  transform: none;
  filter: none;
  cursor: not-allowed;
}

/* 结果表在窄屏「宁可横滚，也不把列挤成竖排」：
   列多（10 列）时 table-layout 会把中文压成一行两个字，看起来像破版。
   v0.14.0 审核 P2-2：这里曾写 860px，比旧 @media 的 980px 更小且更靠后，
   反而把 1024/768/390 的「方向」「发票号」压成两行——统一回 980。 */
#match-table { min-width: 980px; }
#exception-table { min-width: 760px; }

/* 匹配表：这两列不允许断行（13.5px 中文两字 = 27px，列宽一落到 50px 就变竖排；
   发票号带连字符，word-break: break-all 会在「-」处断成两行）。 */
#match-table td:nth-child(5),
#match-table td:nth-child(7) { white-space: nowrap; }

/* 异常表：类型与参考是最先被挤扁的两列（「银行流水未匹配」压成四行、
   「B003」被 break-all 拆成「B00 / 3」）。给它们地板宽度，横向滚动兜住。 */
#exception-table td:nth-child(2) { min-width: 122px; }
#exception-table td:nth-child(4) { white-space: nowrap; }

/* 结果区在粘性顶栏下方，滚动定位时留出顶栏高度 */
.results { scroll-margin-top: 120px; }

.site-footer { padding: 0 28px 40px; }

/* 遮罩：只在窄屏抽屉打开时出现 */
.wb-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 15;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .54);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1180px) {
  .industry-select.wb-select { min-width: 140px; max-width: 190px; }
  .wb-sub { max-width: 46ch; }
}

@media (max-width: 980px) {
  .wb-filters { flex: 1 1 100%; order: 3; }
  .wb-actions { order: 2; }
  .wb-sub { display: none; }
}

@media (max-width: 860px) {
  .wb-shell,
  body.wb-collapsed .wb-shell { grid-template-columns: minmax(0, 1fr); }

  .wb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 302px);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform var(--dur) var(--ease), visibility var(--dur) var(--ease);
    /* 收起时同时移出无障碍树与 Tab 顺序：否则键盘用户会 Tab 到看不见的导航项 */
    visibility: hidden;
    border-right: 1px solid var(--line-strong);
    box-shadow: 28px 0 70px -34px rgba(0, 0, 0, 1);
    z-index: 20;
  }

  body.wb-nav-open .wb-sidebar {
    transform: none;
    visibility: visible;
    /* 打开时不要过渡 visibility：过渡期间计算值仍是 hidden，Chrome 会直接忽略 focus()，
       焦点就留在汉堡按钮上（v0.14.0 审核 P2-1）。关闭时仍由上面的规则过渡。 */
    transition: transform var(--dur) var(--ease);
  }

  .wb-scrim { display: block; }
  .wb-nav-toggle { display: inline-flex; }
  .wb-collapse { display: none; }
  body.wb-collapsed .wb-brand-row {
    flex-direction: row;
    justify-content: flex-start;
    padding: 18px 14px 10px;
  }
  body.wb-collapsed .wb-brand-text,
  body.wb-collapsed .wb-nav-label,
  body.wb-collapsed .wb-nav-tag,
  body.wb-collapsed .wb-nav-group,
  body.wb-collapsed .wb-version,
  body.wb-collapsed .wb-sidebar-foot .badge,
  body.wb-collapsed .wb-sidebar-foot #user-chip { display: revert; }
  body.wb-collapsed .wb-nav-item { justify-content: flex-start; padding: 8px 10px; }
  body.wb-collapsed .wb-nav-planned { display: grid; }

  .wb-topbar { padding: 10px 16px; gap: 8px 10px; min-height: 0; }
  .wb-title { flex: 1 1 auto; }
  .wb-title h1 { font-size: 16.5px; }
  .wb-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .wb-field { flex: 1 1 140px; }
  .industry-select.wb-select { min-width: 0; width: 100%; max-width: none; }
  .wb-actions { margin-left: auto; }
  .wb-actions .btn-small { padding: 6px 10px; }
  #main { padding: 16px 16px 40px; gap: 16px; }
  .site-footer { padding: 0 16px 32px; }
}

@media (max-width: 560px) {
  .wb-brand-text strong { font-size: 13px; }
  .wb-filters { gap: 8px; }
  .wb-field-label { font-size: 10px; }
  .wb-actions { flex: 1 1 100%; }
  .wb-actions .btn { flex: 1 1 0; text-align: center; justify-content: center; }
  .wb-alerts .status { align-self: stretch; }
  /* 手机上先把表单露出来：三步流程说明在窄屏只是噪音，桌面保留 */
  .steps { display: none; }
  /* 历史列表在手机上不再套一层内滚动（触摸时内外滚动会打架）：整页滚动 */
  .history-list { max-height: none; overflow-y: visible; }
  /* 两列下拉在 390 会把「不使用行业包（内置默认规则）」截成省略号，
     窄屏改成上下两行，每个控件都占满宽度（不丢文案、不横向挤压） */
  .wb-filters { flex-direction: column; align-items: stretch; overflow-x: visible; }
  .wb-field { flex: 1 1 auto; width: 100%; }
  .industry-select.wb-select { width: 100%; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wb-sidebar, .wb-collapse svg, .wb-nav-item { transition: none; }
}

/* ==========================================================================
   应收与回款核销（v0.17）
   沿用工作台既有版式：左侧导航 + 顶部操作栏 + 卡片；只增加模块内部布局。
   ========================================================================== */

body[data-view="ar"] .wb-pane:not([data-view="ar"]) {
  display: none;
}

/* 应付与付款核销（v0.18）：复用应收模块的表格/卡片/对话框样式，只加视图显隐。 */
body[data-view="ap"] .wb-pane:not([data-view="ap"]) {
  display: none;
}

.badge-warn {
  border-color: color-mix(in srgb, var(--warn) 46%, var(--line));
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-ok {
  border-color: color-mix(in srgb, var(--ok) 46%, var(--line));
  background: var(--ok-soft);
  color: var(--ok);
}

.ar-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(34, 211, 238, .07), transparent 55%),
    var(--bg-glass);
}

.ar-status-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-width: 0;
}

.ar-status-note {
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.ar-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ar-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.ar-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  box-shadow: var(--shadow);
  min-width: 0;
}

.ar-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-muted);
}

.ar-kpi-value {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-kpi-note {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.ar-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  overflow-x: auto;
  scrollbar-width: thin;
}

.ar-tab {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

.ar-tab:hover { color: var(--ink); background: var(--bg-glass-hi); }
.ar-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ar-tab.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--accent-soft);
}

.ar-tab-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.ar-card { padding: 18px; }

.ar-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 13px;
}

.ar-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.ar-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.ar-table tbody tr:hover { background: rgba(255, 255, 255, .015); }
.ar-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ar-table td.strong, .ar-table td .strong { font-weight: 650; }
.ar-table .ar-doc-no { font-family: var(--mono); font-size: 12.5px; }
.ar-total-row td { border-top: 1px solid var(--line-strong); background: var(--bg-glass); }
.ar-note-cell { min-width: 260px; white-space: normal; line-height: 1.5; color: var(--ink-soft); }
.ar-table td .btn { white-space: nowrap; }
#ar-cases-table th:nth-child(1), #ar-cases-table td:nth-child(1),
#ar-cases-table th:nth-child(2), #ar-cases-table td:nth-child(2),
#ar-cases-table th:nth-child(3), #ar-cases-table td:nth-child(3),
#ar-cases-table th:nth-child(5), #ar-cases-table td:nth-child(5) { white-space: nowrap; }
#ar-allocation-table th:last-child, #ar-allocation-table td:last-child { white-space: nowrap; }
#ar-party-table th:last-child, #ar-party-table td:last-child { white-space: nowrap; }

.ar-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin: 14px 0;
}

.ar-workbench-col {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .012);
}

.ar-workbench-col h3 {
  font-size: 13.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ar-workbench-col h3 .muted { font-size: 11.5px; font-weight: 400; }

.ar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.ar-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--bg-glass);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.ar-pick:hover { border-color: var(--line-strong); background: var(--bg-glass-hi); }
.ar-pick:has(input[type="checkbox"]:checked) {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--accent-soft);
}

.ar-pick input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ar-pick-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ar-pick-main strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-pick-sub {
  font-size: 11.5px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ar-pick-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.ar-pick-balance {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.ar-amount-input {
  width: 96px;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ar-amount-input:disabled { opacity: .45; }
.ar-amount-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.ar-alloc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.ar-alloc-hint {
  font-size: 12.5px;
  color: var(--ink-soft);
  min-width: 0;
}

.ar-alloc-hint.is-error { color: var(--bad); }

.ar-alloc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ar-note-input {
  width: 190px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
}

.ar-preview-table { min-width: 520px; }

/* 账龄分桶只有三列：窄屏不要被其它宽表的 900px 地板拖着横滚。 */
#ar-aging-table { min-width: 0; }

.ar-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 8px;
}

.ar-subhead h3 { font-size: 14px; }
.ar-subhead .muted { font-size: 12px; }

.ar-suggestions {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, .035);
}

.ar-suggestion {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.ar-suggestion:first-child { border-top: 0; }

.ar-suggestion-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 13px;
}

.ar-suggestion-head .muted { font-size: 12px; }

.ar-suggestion-amount {
  margin-left: auto;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.ar-suggestion-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 7px 0 7px 12px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
}

.ar-suggestion-row .muted { font-size: 12px; }
.ar-suggestion-row .btn { margin-left: auto; }

.ar-aging-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 10px 0 14px;
}

.ar-inline-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-muted);
}

.ar-inline-field select,
.ar-inline-field input {
  min-width: 150px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  letter-spacing: normal;
  font-weight: 400;
}

.ar-inline-wide { flex: 1 1 220px; }
.ar-inline-wide input { width: 100%; }

.ar-party-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .012);
}

.ar-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95);
}

.ar-dialog::backdrop {
  background: rgba(3, 6, 10, .68);
  backdrop-filter: blur(3px);
}

.ar-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 20px;
  overflow-y: auto;
  max-height: calc(100vh - 42px);
}

.ar-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ar-dialog-head h2 { font-size: 17px; }

.ar-dialog-hint {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.ar-dialog .wb-icon-btn {
  font-size: 18px;
  line-height: 1;
}

.ar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.ar-field input,
.ar-field select,
.ar-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  background: var(--bg-soft);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
}

.ar-field textarea { resize: vertical; font-family: var(--mono); font-size: 12px; }

.ar-field input:focus-visible,
.ar-field select:focus-visible,
.ar-field textarea:focus-visible,
.ar-inline-field input:focus-visible,
.ar-inline-field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ar-import-advanced summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.ar-import-advanced textarea { margin-top: 8px; }
.ar-import-advanced .muted { font-size: 11.5px; margin-top: 4px; }

.ar-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ar-import-summary p { font-size: 13px; }
.ar-import-summary p.muted { color: var(--ink-muted); font-size: 12px; }

.ar-error-list {
  margin: 6px 0 0;
  padding-left: 18px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--bad);
}

.ar-error-list li { margin: 3px 0; line-height: 1.45; }

@media (max-width: 860px) {
  .ar-workbench { grid-template-columns: 1fr; }
  .ar-list { max-height: 260px; }
}

@media (max-width: 560px) {
  .ar-card { padding: 14px; }
  .ar-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-kpi-value { font-size: 19px; }
  .ar-statusbar { align-items: flex-start; }
  .ar-status-actions { width: 100%; }
  .ar-status-actions .btn { flex: 1 1 0; }
  .ar-tabs { padding: 3px; }
  .ar-tab { padding: 7px 10px; font-size: 12.5px; }
  .ar-alloc-actions { width: 100%; }
  .ar-note-input { flex: 1 1 100%; width: 100%; }
  .ar-alloc-actions .btn { flex: 1 1 100%; }
  .ar-inline-field,
  .ar-inline-wide { flex: 1 1 100%; }
  .ar-inline-field select,
  .ar-inline-field input { width: 100%; min-width: 0; }
  .ar-party-form .btn { flex: 1 1 0; }
  .ar-dialog-form { padding: 16px; }
  body[data-view="ar"] .wb-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
    width: 100%;
  }
  body[data-view="ar"] .wb-field[data-filter="ar-party"] { grid-column: 1 / -1; }
  body[data-view="ar"] .wb-field { flex: none; width: auto; }
  body[data-view="ar"] .wb-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    flex: 1 1 100%;
  }
  body[data-view="ar"] .wb-actions .btn {
    flex: none;
    width: 100%;
    padding-left: 4px;
    padding-right: 4px;
    white-space: nowrap;
  }
}


/* ==========================================================================
   v0.15.0 测试直通模式横幅（--dev-skip-login，仅本机调试）
   只有服务端检测到直通模式时才会在 GET / 的 HTML 里注入 .dev-skip-banner；
   正常启动的页面没有这个元素，下面所有规则都不生效。颜色只用 :root 令牌。
   ========================================================================== */

body:has(> .dev-skip-banner) { --dev-banner-h: 46px; }

.dev-skip-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--dev-banner-h, 46px);
  padding: 8px 18px;
  background: var(--warn);
  color: var(--bg);
  border-bottom: 1px solid rgba(0, 0, 0, .28);
  box-shadow: 0 14px 28px -22px rgba(0, 0, 0, .95);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: .01em;
  text-align: center;
}

.dev-skip-banner svg { flex: none; }
.dev-skip-banner span { min-width: 0; }

/* 让出横幅高度：body 顶部内边距 + 所有粘性/固定元素的 top 一起挪，
   否则 1440 会被盖住品牌行、390 抽屉会从横幅下面钻出来。
   注意：只挪 sticky 的 .wb-topbar；用户管理/设置页的 .topbar 是 relative，
   再设 top 会把它推下去压住正文（实测 /users 标题会被盖住）。 */
body:has(> .dev-skip-banner) { padding-top: var(--dev-banner-h); }
body:has(> .dev-skip-banner) .wb-shell,
body:has(> .dev-skip-banner) .wb-main {
  min-height: calc(100dvh - var(--dev-banner-h));
}
body:has(> .dev-skip-banner) .wb-sidebar {
  top: var(--dev-banner-h);
  height: calc(100dvh - var(--dev-banner-h));
}
body:has(> .dev-skip-banner) .wb-topbar { top: var(--dev-banner-h); }

@media (max-width: 640px) {
  body:has(> .dev-skip-banner) { --dev-banner-h: 64px; }
  .dev-skip-banner { font-size: 12.5px; padding: 8px 12px; }
}

/* 应付模块窄屏（与应收同一套版式；只覆盖顶部筛选/操作栏的栅格）。 */
@media (max-width: 560px) {
  body[data-view="ap"] .wb-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
    width: 100%;
  }
  body[data-view="ap"] .wb-field[data-filter="ap-party"] { grid-column: 1 / -1; }
  body[data-view="ap"] .wb-field { flex: none; width: auto; }
  body[data-view="ap"] .wb-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    flex: 1 1 100%;
  }
  body[data-view="ap"] .wb-actions .btn {
    flex: none;
    width: 100%;
    padding-left: 4px;
    padding-right: 4px;
    white-space: nowrap;
  }
}

/* 应付核销卡片：付款/红字方向徽标不要被 flex 列拉满整行。 */
.ar-pick-main .badge { align-self: flex-start; }

/* ---------- v0.21.0 一键演示 · 一页结论 ---------- */

/* 目的：买家第一次打开时，先看到「这东西替我做完了什么」，而不是一堆技术口径。
   刻意做成一张窄卡、字号偏大、句子偏短——它是给人念的，不是给人查的。 */
.demo-conclusion {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 62%),
    var(--bg-elev);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 4px 0 16px;
}

.demo-conclusion-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.demo-conclusion-head h2 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: .01em;
}

.demo-conclusion-tag {
  font-size: .74rem;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.demo-conclusion-lead {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.72;
  color: var(--ink);
}

.demo-conclusion-lead b {
  color: var(--accent);
  font-weight: 700;
}

.demo-conclusion-list {
  margin: 12px 0 0;
  padding-left: 1.15em;
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.6;
}

.demo-conclusion-list b { color: var(--ink); }

.demo-conclusion-foot {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--ink-muted);
  font-size: .86rem;
  line-height: 1.65;
}

/* ==================================================================
   银行存款余额调节表（/bank-recon）
   这一页的主角是「表」，不是卡片。所以克制装饰：给表格留足行高和
   数字对齐，让财务能像看纸质底稿一样扫行；颜色只用来区分「平」与「不平」。
   ================================================================== */

.br { margin: 0; background: var(--bg); color: var(--ink); }

.br-shell { max-width: 1080px; margin: 0 auto; padding: 28px 20px 72px; }

/* ---------- 嵌入工作台面板（v0.33.2） ----------
   ?embed=1 时 embed.js 给 <html> 挂 wb-embed：子页自己的标题栏、
   「返回工作台」按钮、跳转链接全部藏掉——工作台顶栏已有同一标题，
   面板里的「返回」只会造成 iframe 套娃。内容边距收紧贴合面板。 */
html.wb-embed .br-head,
html.wb-embed .topbar,
html.wb-embed .skip-link { display: none !important; }
html.wb-embed .br-shell { max-width: none; padding: 16px 4px 48px; }
html.wb-embed .auth-shell,
html.wb-embed .rl-shell,
html.wb-embed .users-shell { padding-top: 16px; }

.br-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.br-head-title h1 { margin: 0; font-size: 1.5rem; letter-spacing: .01em; }
.br-sub { margin: 6px 0 0; color: var(--ink-muted); font-size: .9rem; line-height: 1.6; }

/* ---------- 上传面板 ---------- */

.br-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-elev); padding: 20px 22px;
  box-shadow: var(--shadow);
}
.br-panel.is-collapsed { display: none; }
.br-panel-title { margin: 0 0 16px; font-size: 1rem; }

.br-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 640px) { .br-grid { grid-template-columns: 1fr; } }

.br-field { display: flex; flex-direction: column; gap: 6px; }
.br-label { font-size: .82rem; color: var(--ink-soft); }
.br-req { color: var(--bad); margin-left: 2px; }
.br-input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong); background: var(--bg-soft);
  color: var(--ink); font: inherit; font-size: .92rem;
}
.br-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.br-files { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 720px) { .br-files { grid-template-columns: 1fr; } }

.br-drop {
  position: relative;
  display: flex; flex-direction: column; gap: 5px; cursor: pointer;
  padding: 16px; border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong); background: var(--bg-glass);
  transition: border-color .18s ease, background .18s ease;
}
.br-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
/* v0.33.1（实测 UI-11）：input 原来 display:none，键盘根本进不去这块。
   改成视觉隐藏但可聚焦，整个框靠 :focus-within 给出焦点环。 */
.br-drop input[type="file"] {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.br-drop:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}
.br-drop-button {
  align-self: flex-start; margin-top: 4px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-elev);
  font-size: .8rem; color: var(--ink-soft);
  transition: border-color .15s ease, color .15s ease;
}
.br-drop:hover .br-drop-button,
.br-drop:focus-within .br-drop-button {
  border-color: var(--accent); color: var(--accent);
}
.br-drop-title { font-size: .92rem; font-weight: 600; }
.br-drop-hint { font-size: .78rem; color: var(--ink-muted); line-height: 1.5; }
.br-drop-picked { font-size: .78rem; color: var(--ink-muted); word-break: break-all; }
.br-drop-picked.has-files { color: var(--accent); }

.br-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.br-status { font-size: .85rem; color: var(--ink-soft); }
.br-status.is-bad { color: var(--bad); }
.br-status.is-busy { color: var(--accent); }

.br-note { margin: 14px 0 0; font-size: .78rem; color: var(--ink-muted); line-height: 1.7; }
.br-note strong { color: var(--ink-soft); }

/* ---------- 结论条 ---------- */

.br-summary {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--accent-soft), transparent 68%), var(--bg-elev);
  padding: 18px 22px; margin: 22px 0 20px;
}
.br-summary-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.br-summary h2 { margin: 0; font-size: 1.1rem; }
.br-summary-sub { margin: 6px 0 0; font-size: .86rem; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.br-summary-actions { display: flex; gap: 8px; }

.br-stats { display: flex; gap: 28px; margin: 16px 0 0; padding: 14px 0 0; list-style: none; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.br-stats li { display: flex; flex-direction: column; gap: 2px; }
.br-stats b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.br-stats span { font-size: .76rem; color: var(--ink-muted); }
.br-stats li.is-warn b { color: var(--warn); }

/* ---------- 调节表本体 ---------- */

.br-sheet {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-elev); padding: 20px 22px; margin-bottom: 20px;
}
.br-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.br-sheet-title h2 { margin: 0; font-size: 1.02rem; letter-spacing: .04em; }
.br-sheet-meta { margin: 5px 0 0; font-size: .8rem; color: var(--ink-muted); }

.br-verdict {
  font-size: .8rem; padding: 3px 12px; border-radius: 999px; white-space: nowrap;
  border: 1px solid currentColor;
}
.br-verdict.is-ok { color: var(--ok); background: var(--ok-soft); }
.br-verdict.is-bad { color: var(--bad); background: var(--bad-soft); }

.br-recon { width: 100%; border-collapse: collapse; font-size: .9rem; }
.br-recon th {
  text-align: left; font-weight: 600; font-size: .8rem; color: var(--ink-muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line-strong);
}
.br-recon td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.br-recon tr.is-base td { font-weight: 600; }
.br-recon tr.is-subtotal td {
  font-weight: 700; background: var(--bg-soft);
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.br-recon tr.is-total td { font-weight: 700; font-size: .95rem; border-bottom: none; }
.br-recon tr.is-ok td { color: var(--ok); }
.br-recon tr.is-bad td { color: var(--bad); }
.br-recon tr.br-gap td { border: none; height: 10px; padding: 0; }

.br-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.br-sheet-foot { margin: 14px 0 0; font-size: .78rem; color: var(--ink-muted); line-height: 1.8; }

/* ---------- 明细 ---------- */

.br-details { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
.br-details summary { cursor: pointer; font-size: .85rem; color: var(--ink-soft); padding: 4px 0; }
.br-details summary:hover { color: var(--accent); }
.br-detail { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 8px; }
.br-detail th { text-align: left; font-weight: 600; color: var(--ink-muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.br-detail td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.br-detail tr:last-child td { border-bottom: none; }

.br-chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: .74rem; background: var(--bg-soft); border: 1px solid var(--line-strong);
  white-space: nowrap;
}
.br-empty { font-size: .84rem; color: var(--ink-muted); margin: 10px 0 0; }
.br-warn-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-right: 7px; }

/* ---------- v0.23 跨期结转 ---------- */

.br-carry-note {
  margin: 8px 0 0;
  font-size: .84rem;
  line-height: 1.65;
  color: var(--ink-soft);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.br-stats li.is-ok b { color: var(--ok); }

/* v0.33.1 底稿只读提示：从月结点「查看底稿」进来时，先说清这张表是什么。
   已关账用中性偏冷色（不是警告），未关账的底稿用提示色，别让人误以为能签。 */
.br-locked-note {
  margin: 8px 0 0;
  font-size: .86rem;
  line-height: 1.65;
  color: var(--ink-soft);
  border-left: 3px solid var(--line-strong);
  padding-left: 10px;
}

.br-locked-note.is-open {
  border-left-color: var(--warn);
  color: var(--warn);
}

.br-chip.is-stale {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: var(--warn);
}

.br-stale-note { color: var(--warn); }

.br-details.is-cleared summary { color: var(--ok); }
.br-details.is-cleared summary:hover { color: var(--ok); }

/* ==========================================================================
   银行对账 · 人工改配对（v0.25）
   这一块的核心是「让财务敢动」：每一笔旁边都有明确的做法，动完立刻告诉他
   结果（已拆开 / 没生效 + 原因），而不是改完悄悄重算、让人自己发现数字变了。
   ========================================================================== */

.br-toast {
  margin: 14px 0 0;
  padding: 10px 14px;
  font-size: .85rem;
  line-height: 1.6;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--ink-soft);
}

.br-toast.is-ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 42%, transparent);
  background: color-mix(in srgb, var(--ok) 9%, transparent);
}

.br-toast.is-warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 42%, transparent);
  background: color-mix(in srgb, var(--warn) 9%, transparent);
}

.br-toast.is-bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 42%, transparent);
  background: color-mix(in srgb, var(--bad) 9%, transparent);
}

.br-toast.is-busy { color: var(--ink-muted); }

/* 表格里的次级信息（对方户名）：不能和摘要抢，但也不能丢 */
.br-sub-cell {
  display: block;
  font-size: .74rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.br-act { text-align: right; white-space: nowrap; }

.btn-tiny {
  padding: 3px 9px;
  font-size: .76rem;
  line-height: 1.5;
}

.br-detail tr.is-manual td { background: color-mix(in srgb, var(--accent) 7%, transparent); }

.br-chip.is-manual {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.br-manual-note { color: var(--accent); }

/* 人工调整汇总条：改动是要被看见的，不能藏在明细里 */
.br-manual-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 14px;
  font-size: .82rem;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 8px;
}

.br-issues { margin-top: 12px; display: grid; gap: 8px; }

.br-issue {
  margin: 0;
  padding: 9px 12px;
  font-size: .82rem;
  line-height: 1.6;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
}

.br-issue.is-error {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 40%, transparent);
}

.br-issue.is-warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}

/* ------------------------------------------------------------------ 弹窗 */

.br-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 6, 10, .74);
}

.br-dialog-panel {
  width: min(720px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 22px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.br-dialog-panel h3 { font-size: 1.02rem; margin: 0 0 8px; }

.br-dialog-sub {
  margin: 0 0 14px;
  font-size: .84rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

/* 候选列表：金额相等的一眼可辨，靠左边框颜色而不是背景块，避免整屏发亮 */
.br-cand-list {
  display: grid;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  margin-bottom: 14px;
}

.br-cand {
  display: grid;
  grid-template-columns: auto 96px 108px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  font-size: .82rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-soft);
}

.br-cand.is-match { border-left-color: var(--ok); }
.br-cand:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-soft));
}

.br-cand input { accent-color: var(--accent); }
.br-cand-date { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.br-cand-amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.br-cand-desc { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-cand-meta { font-size: .74rem; color: var(--ink-muted); white-space: nowrap; }
.br-cand-meta .is-ok { color: var(--ok); }
.br-cand-meta .is-warn { color: var(--warn); }

.br-dialog-reason { display: grid; gap: 5px; margin-bottom: 16px; }
.br-dialog-reason span { font-size: .76rem; color: var(--ink-muted); }

.br-dialog-reason input {
  padding: 9px 11px;
  font-size: .86rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.br-dialog-reason input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.br-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 720px) {
  .br-cand { grid-template-columns: auto 1fr; row-gap: 4px; }
  .br-cand-amount, .br-cand-desc, .br-cand-meta { grid-column: 2; }
  .br-cand-amount { text-align: left; }
}

/* ==========================================================================
   银行对账 · 期间关账（v0.26）
   关账是这一个月最后一道门：签完字本期只读。所以这一条必须一眼看清——
   状态用颜色区分，谁签的写给具体人，不让「已锁/未锁」这种词单独待着。
   ========================================================================== */

.br-close {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
}

.br-close-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.br-close-label { font-size: .76rem; letter-spacing: .08em; color: var(--ink-muted); text-transform: uppercase; }
.br-close-ym { font-family: var(--mono); font-size: .95rem; color: var(--ink); }
.br-close-note { font-size: .8rem; color: var(--ink-soft); }
.br-close-right { display: flex; gap: 8px; }

.br-close-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .76rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink-soft);
  white-space: nowrap;
}
.br-close-badge.is-open { color: var(--ink-muted); }
.br-close-badge.is-working { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.br-close-badge.is-review { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.br-close-badge.is-locked { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }

/* 关账后整页转只读：按钮变灰但仍可见——突然消失会让人以为界面坏了 */
.br-sheet.is-locked .br-act button,
.br-close-panel .br-dialog-actions button[disabled] {
  opacity: .45;
  cursor: not-allowed;
}
.br-close-panel .br-dialog-actions button[disabled]:hover { color: inherit; border-color: var(--line-strong); }

.br-close-panel { width: min(760px, 94vw); max-height: 86vh; overflow: auto; }
.br-close-panel h3 { display: flex; align-items: center; gap: 10px; }

.br-check-list { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 8px; }
.br-check {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-glass);
}
.br-check.is-error { border-color: color-mix(in srgb, var(--bad) 42%, transparent); background: var(--bad-soft); }
.br-check.is-warn { border-color: color-mix(in srgb, var(--warn) 38%, transparent); background: var(--warn-soft); }
.br-check.is-ok { border-color: color-mix(in srgb, var(--ok) 34%, transparent); background: var(--ok-soft); }

.br-check-head { display: flex; align-items: center; gap: 8px; }
.br-check-tag {
  font-size: .72rem; padding: 1px 7px; border-radius: 999px;
  border: 1px solid currentColor; opacity: .9;
}
.br-check.is-error .br-check-tag { color: var(--bad); }
.br-check.is-warn .br-check-tag { color: var(--warn); }
.br-check.is-ok .br-check-tag { color: var(--ok); }
.br-check-label { font-size: .85rem; font-weight: 600; color: var(--ink); }
.br-check-msg { margin: 6px 0 0; font-size: .83rem; line-height: 1.6; color: var(--ink-soft); }
.br-check-hint { margin: 4px 0 0; font-size: .79rem; line-height: 1.55; color: var(--ink-muted); }

.br-close-table { margin-bottom: 16px; }
.br-close-table tr.is-bad td { color: var(--bad); }
.br-chip.is-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.br-chip.is-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

@media (max-width: 720px) {
  .br-close { align-items: flex-start; flex-direction: column; }
  .br-close-right { width: 100%; }
  .br-close-right .btn { flex: 1; }
}

/* ==========================================================================
   银行对账 · 多工作表选择（v0.27）
   一个工作簿里放「封面 + 10 月 + 11 月」是常态。这里让人明确挑一张，
   而不是替他猜——猜错的结果是导进来的表少了一个月，还看不出来。
   ========================================================================== */

.br-drop-formats {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: .72rem;
  font-style: normal;
  color: var(--ink-muted);
  white-space: nowrap;
}

.br-sheet-panel { width: min(520px, 92vw); }

.br-sheet-list {
  display: grid;
  gap: 6px;
  margin: 6px 0 16px;
  max-height: 46vh;
  overflow: auto;
}

.br-sheet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-glass);
  font-size: .88rem;
  color: var(--ink);
  cursor: pointer;
}
.br-sheet-item:hover { border-color: var(--line-strong); }
.br-sheet-item input { accent-color: var(--accent); }
.br-sheet-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   银行对账 · 多对一与部分核销（v0.28）
   合并入账是实务常态，不是高级功能。所以勾选框直接放在未达账项表里，
   选中后底部一条操作条实时告诉「两侧各几笔、合计多少、差多少」——
   让用户在点之前就知道会发生什么。
   ========================================================================== */

.br-pick-cell { width: 34px; text-align: center; padding-right: 0; }
.br-pick { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.br-pick-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: var(--bg-glass);
}
.br-pick-hint { font-size: .78rem; line-height: 1.55; color: var(--ink-muted); flex: 1 1 260px; }
.br-pick-sum {
  font-size: .82rem;
  font-family: var(--mono);
  color: var(--ink-soft);
  white-space: nowrap;
}
.br-pick-sum.is-ok { color: var(--ok); }
.br-pick-sum.is-warn { color: var(--warn); }

.br-chip.is-group {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  margin-left: 6px;
}
.br-chip.is-partial {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: var(--warn-soft);
  margin-left: 4px;
}

.br-suggest-list { display: grid; gap: 6px; margin-top: 8px; }
.br-suggest {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-glass);
}
.br-suggest-label { font-size: .85rem; color: var(--ink); flex: 1 1 auto; }
.br-suggest-meta { font-size: .76rem; color: var(--ink-muted); font-family: var(--mono); white-space: nowrap; }

.br-dialog-tip {
  margin: 8px 0 0;
  font-size: .79rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

@media (max-width: 720px) {
  .br-pick-bar { align-items: flex-start; }
  .br-pick-bar .btn { flex: 1; }
  .br-suggest { flex-wrap: wrap; }
  .br-suggest-label { flex: 1 1 100%; }
}

/* ==========================================================================
   月结总览（v0.32）—— /month-end
   三道门并排，是为了让「哪一块拖了后腿」一眼看出来；
   每条门卡都写清「这一块的数字是什么口径」，避免三个时间点混成一个数。
   ========================================================================== */

.me-verdict {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--accent-soft), transparent 66%), var(--bg-elev);
  padding: 20px 22px 18px; margin-bottom: 18px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; box-shadow: var(--shadow);
}
.me-verdict-main { flex: 1 1 420px; min-width: 0; }
.me-verdict-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me-verdict-headline { margin: 10px 0 0; font-size: 1.32rem; letter-spacing: .01em; }
.me-verdict-actions { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }

.me-period { display: flex; align-items: flex-end; gap: 6px; }
.me-period-field { display: flex; flex-direction: column; gap: 4px; }
.me-period-label { font-size: .74rem; color: var(--ink-muted); letter-spacing: .06em; }
.me-period-input { width: 148px; padding: 7px 10px; font-family: var(--mono); font-size: .88rem; }

.me-status { margin: 0 0 14px; font-size: .85rem; color: var(--ink-soft); min-height: 1.2em; }
.me-status.is-error { color: var(--bad); }
.me-status.is-ok { color: var(--ok); }
.me-status.is-busy { color: var(--accent); }

/* ---------- 三道门 ---------- */

.me-gates {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; margin-bottom: 18px;
}
@media (max-width: 900px) { .me-gates { grid-template-columns: 1fr; } }

.me-gate {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-elev); padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow);
}
.me-gate.is-blocked { border-color: color-mix(in srgb, var(--bad) 42%, var(--line)); }
.me-gate.is-warn { border-color: color-mix(in srgb, var(--warn) 34%, var(--line)); }
.me-gate.is-ok { border-color: color-mix(in srgb, var(--ok) 28%, var(--line)); }

.me-gate-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me-gate-title { margin: 0; font-size: .98rem; }
.me-gate-badge {
  font-size: .72rem; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-muted); white-space: nowrap;
}
.me-gate-badge.is-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.me-gate-badge.is-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.me-gate-badge.is-blocked { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); }

.me-gate-headline { margin: 2px 0 0; font-size: .95rem; font-weight: 600; line-height: 1.5; }
.me-gate-detail { margin: 0; font-size: .8rem; color: var(--ink-muted); line-height: 1.65; }

.me-metrics { margin: 6px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 6px; }
.me-metric { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.me-metric-label { font-size: .78rem; color: var(--ink-muted); }
.me-metric-value { margin: 0; text-align: right; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* v0.33.2：日期区间（2026-10-01 ~ 2026-10-31）原来会断在「2026-」后面，
   变成两行残句。数字与日期整体不折行，宽度不够时整块换到下一行。 */
.me-metric-num { font-family: var(--mono); font-size: .9rem; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.me-metric-note { font-size: .72rem; color: var(--ink-muted); white-space: nowrap; }

.me-gate-link {
  margin-top: auto; font-size: .8rem; color: var(--accent);
  text-decoration: none; padding-top: 10px;
}
.me-gate-link:hover { text-decoration: underline; }

/* ---------- 检查清单 ---------- */

.me-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.me-check {
  border: 1px solid var(--line); border-left-width: 3px;
  border-radius: var(--radius-sm); background: var(--bg-glass);
  padding: 12px 14px;
}
.me-check.is-error { border-left-color: var(--bad); }
.me-check.is-warn { border-left-color: var(--warn); }
.me-check.is-ok { border-left-color: var(--ok); }
.me-check-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.me-check-badge {
  font-size: .71rem; padding: 1px 8px; border-radius: 999px;
  border: 1px solid currentColor;
}
.me-check-badge.is-error { color: var(--bad); background: var(--bad-soft); }
.me-check-badge.is-warn { color: var(--warn); background: var(--warn-soft); }
.me-check-badge.is-ok { color: var(--ok); background: var(--ok-soft); }
.me-check-label { font-size: .9rem; }
.me-check-message { margin: 6px 0 0; font-size: .84rem; color: var(--ink-soft); line-height: 1.65; }
.me-check-hint { margin: 4px 0 0; font-size: .78rem; color: var(--ink-muted); line-height: 1.65; }

/* ---------- 关账动作 ---------- */

.me-action { margin-bottom: 18px; }
.me-action-note { margin: 0 0 14px; font-size: .84rem; color: var(--ink-soft); line-height: 1.7; }
.me-action-field { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }

/* ---------- 口径说明 ---------- */

.me-note {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 14px 18px; margin: 18px 0 0; background: var(--bg-glass);
}
.me-note-title { margin: 0 0 8px; font-size: .86rem; color: var(--ink-soft); }
.me-note-list { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.me-note-list li { font-size: .78rem; color: var(--ink-muted); line-height: 1.7; }
.me-note-list strong { color: var(--ink-soft); }
.me-note-text { margin: 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.7; }

/* ---------- 期间快跳 ---------- */

.me-periods {
  flex: 1 1 100%; display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.me-periods-label { font-size: .75rem; color: var(--ink-muted); }
.me-chip {
  font: inherit; font-size: .75rem; cursor: pointer;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-soft);
  color: var(--ink-soft); font-family: var(--mono);
}
.me-chip:hover { border-color: var(--accent); color: var(--accent); }
.me-chip.is-current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.me-dot { color: var(--ink-muted); }
.me-hint { color: var(--ink-muted); font-size: .8rem; }

@media (max-width: 720px) {
  /* v0.33.1（实测 UI-06）：`.me-verdict-main { flex: 1 1 420px }` 在 column 方向
     上 flex-basis 作用的是高度——手机上结论区和月份控件之间凭空空了 420px，
     阻断原因被挤到首屏之外。这里把 basis 收回到内容高度。 */
  .me-verdict {
    flex-direction: column; align-items: stretch; gap: 12px;
    padding: 14px 16px 16px;
  }
  .me-verdict-main { flex: 0 0 auto; }
  .me-verdict-headline { font-size: 1.14rem; margin-top: 6px; }
  .me-verdict-actions { width: 100%; align-items: center; gap: 8px; }
  .me-verdict-actions .btn-primary { flex: 1; }
  .me-period { flex: 1 1 100%; align-items: center; }
  .me-period-input { width: 100%; }
  .me-gates { gap: 10px; }
}

/* ============================================================
   v0.34 视觉升级：质感、层级与精致度
   原则：不动 DOM、不改布局尺寸、不破坏既有断言——只追加覆盖。
   上一版（v2 企业级）解决了「统一」，这一版解决「廉价感」：
   卡片有光、侧栏有态度、数字有分量、空态有设计。
   ============================================================ */

/* ---------- 0. 全局细节 ---------- */

::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: #fff;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .22); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

body {
  font-size: 14.5px;
  background:
    radial-gradient(1300px 700px at 18% -12%, rgba(34, 211, 238, .13), transparent 60%),
    radial-gradient(900px 520px at 92% -6%, rgba(56, 189, 248, .07), transparent 55%),
    radial-gradient(1000px 800px at 50% 118%, rgba(8, 145, 178, .06), transparent 58%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- 1. 侧栏：从「列表」到「导航」 ---------- */

.wb-sidebar {
  background:
    radial-gradient(420px 240px at 0% 0%, rgba(34, 211, 238, .10), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .008) 46%),
    var(--bg-elev);
  border-right: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
}

.wb-brand-text strong { font-size: 14px; letter-spacing: .01em; }

.wb-version {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .06em;
  color: var(--ink-muted);
  background: var(--bg-glass);
  border: 1px solid var(--line);
}

.wb-nav-group {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink-muted) 78%, transparent);
}

.wb-nav-item {
  position: relative;
  border-radius: var(--radius-sm);
  font-weight: 550;
  color: var(--ink-soft);
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.wb-nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .05);
}

.wb-nav-item .wb-nav-icon { color: var(--ink-muted); transition: color var(--dur) var(--ease); }
.wb-nav-item:hover .wb-nav-icon { color: var(--ink-soft); }

/* 当前页：左侧光条 + 渐变玻璃底 + 图标点亮 */
.wb-nav-item[aria-current="page"] {
  color: var(--accent);
  background:
    linear-gradient(90deg, rgba(34, 211, 238, .13), rgba(34, 211, 238, .05) 60%, transparent),
    rgba(255, 255, 255, .03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    inset 2px 0 0 var(--accent),
    0 6px 18px -12px var(--accent-glow);
}
.wb-nav-item[aria-current="page"] .wb-nav-icon { color: var(--accent); }

/* 规划中的模块：更安静，别抢戏 */
.wb-nav-item.is-planned {
  color: color-mix(in srgb, var(--ink-muted) 72%, transparent);
  opacity: .85;
}
.wb-nav-item.is-planned .wb-nav-tag {
  font-size: 10px;
  padding: 1px 7px;
  color: var(--ink-muted);
  background: transparent;
  border: 1px dashed var(--line-strong);
}

.wb-sidebar-foot { border-top: 1px solid var(--line); }

/* ---------- 2. 右侧顶栏：玻璃 + 渐变发丝线 ---------- */

.wb-topbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01)),
    color-mix(in srgb, var(--bg-elev) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .05),
    0 1px 0 color-mix(in srgb, var(--accent) 16%, transparent),
    0 18px 36px -30px rgba(0, 0, 0, .9);
}

.wb-title h1 {
  font-size: clamp(19px, 1.6vw, 23px);
  font-weight: 700;
  letter-spacing: -.02em;
  background: linear-gradient(180deg, #f4f9ff, #c9d8ea);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wb-sub { color: var(--ink-muted); }

.wb-topbar .industry-select.wb-select,
.wb-topbar .wb-field select {
  background: rgba(255, 255, 255, .04);
  border-color: var(--line-strong);
}

/* ---------- 3. 卡片：有光的表面 ---------- */

.card {
  position: relative;
  background:
    radial-gradient(560px 180px at 18% 0%, rgba(255, 255, 255, .05), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .042) 0%, rgba(255, 255, 255, .012) 100%),
    var(--bg-elev);
  border-color: color-mix(in srgb, var(--accent) 7%, var(--line));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 24px 48px -32px rgba(0, 0, 0, 1);
}
.card:hover { border-color: var(--line-strong); }

.card-head h2,
.card-head h3 { font-size: 16px; letter-spacing: -.014em; }

/* ---------- 4. 流程条：编号点亮 ---------- */

.step-index {
  color: #04131a;
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .10), 0 6px 14px -6px var(--accent-glow);
}
.step:hover .step-index { filter: brightness(1.06); }

.step-body h2 { font-size: 15.5px; }

/* ---------- 5. 按钮：主按钮有光，次按钮有边 ---------- */

.btn.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    0 10px 26px -12px var(--accent-glow);
}
.btn.btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 14px 30px -12px var(--accent-glow);
}
.btn.btn-primary:active:not(:disabled) { transform: translateY(0); filter: brightness(.98); }

.btn-ghost {
  background: rgba(255, 255, 255, .045);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, .085);
  border-color: rgba(255, 255, 255, .22);
}

/* ---------- 6. 徽章：有底色不飘 ---------- */

.badge {
  font-weight: 650;
  letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.badge-quiet {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .04);
  border-color: var(--line-strong);
}

/* ---------- 7. 统计卡：数字要有分量 ---------- */

.summary-grid { gap: 14px; }

.summary-card {
  position: relative;
  padding: 16px 18px 14px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 8%, var(--line));
  background:
    radial-gradient(420px 130px at 14% 0%, rgba(255, 255, 255, .05), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012)),
    var(--bg-elev);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 18px 36px -30px rgba(0, 0, 0, 1);
  overflow: hidden;
}
.summary-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 55%, transparent), transparent);
  opacity: .55;
}
.summary-card.is-ok::after { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ok) 55%, transparent), transparent); }
.summary-card.is-bad::after { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bad) 60%, transparent), transparent); }

.summary-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--ink-muted);
}

.summary-value {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.015em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.summary-card.is-ok .summary-value { color: var(--ok); }
.summary-card.is-bad .summary-value { color: var(--bad); }

.summary-sub {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 8. 文件选择：像拖放区，不像表单 ---------- */

.file-field {
  border-radius: var(--radius-sm);
  border: 1px dashed transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.file-field:hover {
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  background: rgba(34, 211, 238, .025);
}

.file-picker {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .035);
  transition: border-color var(--dur) var(--ease);
}
.file-field:hover .file-picker { border-color: color-mix(in srgb, var(--accent) 34%, transparent); }

.file-button {
  font-weight: 650;
  color: var(--accent);
}

.file-meta { font-variant-numeric: tabular-nums; }

/* ---------- 9. 表格：表头像表头，行有呼吸 ---------- */

.match-table thead th,
.ar-table thead th,
table thead th {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--line-strong);
}

.match-table tbody tr,
.ar-table tbody tr,
table tbody tr { transition: background var(--dur) var(--ease); }

.match-table tbody tr:hover,
.ar-table tbody tr:hover,
table tbody tr:hover { background: rgba(255, 255, 255, .035); }

.match-table td,
.ar-table td { font-variant-numeric: tabular-nums; }

/* ---------- 10. 空态：有设计感的留白 ---------- */

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(500px 160px at 50% 0%, rgba(34, 211, 238, .045), transparent 70%),
    rgba(255, 255, 255, .014);
  color: var(--ink-soft);
  text-align: center;
  padding: 44px 28px;
  max-width: none;
}
.empty::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background:
    radial-gradient(10px 10px at 50% 42%, color-mix(in srgb, var(--accent) 70%, transparent) 42%, transparent 46%),
    radial-gradient(circle at 50% 50%, transparent 12px, color-mix(in srgb, var(--accent) 42%, transparent) 13px, transparent 15px);
}

/* ---------- 11. 月结总览：结论要压得住场 ---------- */

.me-verdict-headline {
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 750;
  letter-spacing: -.02em;
}

.me-gate {
  border-radius: var(--radius);
  background:
    radial-gradient(420px 130px at 16% 0%, rgba(255, 255, 255, .045), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .038), rgba(255, 255, 255, .01)),
    var(--bg-elev);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 20px 40px -32px rgba(0, 0, 0, 1);
  position: relative;
  overflow: hidden;
}
.me-gate::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  opacity: .75;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.me-gate.is-blocked::before { background: linear-gradient(90deg, transparent, var(--bad), transparent); }
.me-gate.is-warn::before { background: linear-gradient(90deg, transparent, var(--warn), transparent); }
.me-gate.is-ok::before { background: linear-gradient(90deg, transparent, var(--ok), transparent); }

.me-gate-headline { font-weight: 600; color: var(--ink); }

.me-metric-num {
  font-weight: 650;
  font-size: 14.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.me-gate-link { font-weight: 650; }

/* ---------- 12. 输入与选择：聚焦有光 ---------- */

input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
select, textarea {
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .14);
  outline: none;
}

/* ---------- 13. 页脚与杂项 ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
  color: color-mix(in srgb, var(--ink-muted) 82%, transparent);
}

.pill { font-variant-numeric: tabular-nums; }

.wb-context {
  background: rgba(255, 255, 255, .022);
  border-color: var(--line);
}

.muted { color: var(--ink-muted); }

/* ---------- 14. 全站右侧通栏（去掉 1080/1180px 窄条限制） ---------- */
#main,
.site-footer,
.br-shell,
html.wb-embed .br-shell,
html.wb-embed .rl-shell,
html.wb-embed .auth-shell,
html.wb-embed .auth-shell-wide,
html.wb-embed .users-shell {
  max-width: none !important;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
#main { padding: 18px 28px 40px; }
.br-shell { padding: 18px 28px 48px; }
html.wb-embed .br-shell { padding: 12px 6px 36px; }


/* 数字等宽是财务工具的底线 */
.num, td.num, .run-field code, code {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   15. 商业级浅色企业财务风 · 高密度财务表格 · 右侧核对抽屉（v0.35）
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #F5F7FA;
  --bg-elev: #FFFFFF;
  --bg-soft: #F8FAFC;
  --bg-glass: #FFFFFF;
  --bg-glass-hi: #F1F5F9;

  --ink: #111827;
  --ink-soft: #374151;
  --ink-muted: #6B7280;
  --muted: #6B7280;

  --line: #E5E7EB;
  --line-strong: #D1D5DB;

  --accent: #2563EB;
  --accent-deep: #1D4ED8;
  --accent-ink: #FFFFFF;
  --accent-soft: #EFF6FF;
  --accent-glow: rgba(37, 99, 235, .18);

  --ok: #059669;
  --ok-soft: #ECFDF5;
  --warn: #D97706;
  --warn-soft: #FFFBEB;
  --bad: #DC2626;
  --bad-soft: #FEF2F2;

  --radius: 10px;
  --radius-sm: 7px;
  --radius-xs: 5px;

  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-lift: 0 12px 30px -10px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .06);
}

html, body {
  background: #F5F7FA !important;
  color: #111827 !important;
  font-size: 14px;
  line-height: 1.5;
}

/* 左侧导航栏：深石板蓝 #0F172A，与右侧白底形成清晰企业级主次层级 */
.wb-sidebar {
  background: #0F172A !important;
  border-right: 1px solid #1E293B !important;
  color: #E2E8F0 !important;
}
.wb-sidebar .wb-brand-text strong { color: #F8FAFC !important; font-size: 14.5px; }
.wb-sidebar .wb-brand-text small { color: #94A3B8 !important; font-size: 11.5px; }
.wb-sidebar .wb-brand-mark {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .4) !important;
}
.wb-sidebar .wb-nav-group {
  color: #64748B !important;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.wb-sidebar .wb-nav-item {
  color: #CBD5E1 !important;
  border-radius: 7px;
  font-size: 13.5px;
}
.wb-sidebar .wb-nav-item:hover {
  background: rgba(255, 255, 255, .07) !important;
  color: #FFFFFF !important;
}
.wb-sidebar .wb-nav-item[aria-current="page"],
.wb-sidebar .wb-nav-item.is-active {
  background: #2563EB !important;
  color: #FFFFFF !important;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, .35) !important;
}
.wb-sidebar .wb-nav-item[aria-current="page"] .wb-nav-icon,
.wb-sidebar .wb-nav-item.is-active .wb-nav-icon {
  color: #FFFFFF !important;
}
.wb-sidebar .wb-icon-btn {
  color: #94A3B8 !important;
  background: transparent !important;
  border-color: rgba(255, 255, 255, .12) !important;
}
.wb-sidebar .wb-icon-btn:hover {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, .10) !important;
}
.wb-sidebar .wb-foot {
  border-top: 1px solid #1E293B !important;
  background: rgba(15, 23, 42, .6) !important;
}
.wb-sidebar .wb-user-name,
.wb-sidebar .wb-user-meta,
.wb-sidebar .wb-foot a,
.wb-sidebar .wb-foot button {
  color: #CBD5E1 !important;
}
.wb-sidebar .wb-user-meta { color: #94A3B8 !important; }

/* 顶部栏与二级子导航 */
.wb-topbar,
.topbar {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E5E7EB !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03) !important;
  backdrop-filter: none !important;
}
.wb-topbar h1,
.wb-topbar #view-title {
  color: #111827 !important;
  font-size: 17px;
  font-weight: 650;
}
.wb-context {
  background: #F8FAFC !important;
  border: 1px solid #E5E7EB !important;
  color: #374151 !important;
}
.wb-subnav {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 8px;
  padding: 4px 6px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.wb-subtab {
  color: #4B5563 !important;
  background: transparent !important;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
}
.wb-subtab:hover {
  background: #F3F4F6 !important;
  color: #111827 !important;
}
.wb-subtab.is-active,
.wb-subtab[aria-current="page"] {
  background: #EFF6FF !important;
  color: #1D4ED8 !important;
  font-weight: 600;
}
.wb-subtab-badge {
  background: #E5E7EB !important;
  color: #374151 !important;
}
.wb-subtab.is-active .wb-subtab-badge {
  background: #DBEAFE !important;
  color: #1D4ED8 !important;
}

/* 卡片、面板、输入框、按钮统一浅色企业质感 */
.card,
.run-bar,
.br-card,
.br-summary-card,
.br-close,
.me-verdict,
.me-card,
.me-gate,
.preflight,
.sheet-choice,
.recon-strategy,
.file-field,
.ar-dialog,
.wb-dialog-item {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  color: #111827 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
}
.card-head h2, .card-head h3,
.br-head h1, .br-card h2, .me-verdict h2,
.preflight h3, .recon-strategy h3 {
  color: #111827 !important;
}
.muted, .card-hint, .br-sub, .br-summary-sub, .run-label, .file-meta, .wb-dialog-item-sub {
  color: #6B7280 !important;
}

/* 按钮体系 */
.btn {
  background: #FFFFFF !important;
  color: #374151 !important;
  border: 1px solid #D1D5DB !important;
  border-radius: 6px;
  font-weight: 500;
  box-shadow: 0 1px 1px rgba(15, 23, 42, .03) !important;
}
.btn:hover:not(:disabled) {
  background: #F9FAFB !important;
  border-color: #9CA3AF !important;
  color: #111827 !important;
}
.btn-primary {
  background: #2563EB !important;
  color: #FFFFFF !important;
  border-color: #2563EB !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25) !important;
}
.btn-primary:hover:not(:disabled) {
  background: #1D4ED8 !important;
  border-color: #1D4ED8 !important;
  color: #FFFFFF !important;
}
.btn-ghost {
  background: #FFFFFF !important;
  color: #374151 !important;
  border-color: #E5E7EB !important;
}
.btn-ghost:hover:not(:disabled) {
  background: #F3F4F6 !important;
  color: #111827 !important;
}
.btn-danger, .btn-bad {
  background: #FEF2F2 !important;
  color: #DC2626 !important;
  border-color: #FECACA !important;
}
.btn-danger:hover:not(:disabled), .btn-bad:hover:not(:disabled) {
  background: #FEE2E2 !important;
}
.btn-ok {
  background: #ECFDF5 !important;
  color: #059669 !important;
  border-color: #A7F3D0 !important;
}
.btn-ok:hover:not(:disabled) {
  background: #D1FAE5 !important;
}

/* 表单输入控件 */
input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
select, textarea {
  background: #FFFFFF !important;
  color: #111827 !important;
  border: 1px solid #D1D5DB !important;
  border-radius: 6px;
}
input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):disabled,
select:disabled {
  background: #F3F4F6 !important;
  color: #6B7280 !important;
}
input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus {
  border-color: #2563EB !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14) !important;
}

/* 导入区拖拽高亮 + 样例模板下载条 */
.file-field {
  transition: border-color 150ms ease, background-color 150ms ease;
}
.file-field.is-dragover {
  border-color: #2563EB !important;
  background: #EFF6FF !important;
  border-style: dashed !important;
}
.file-picker {
  background: #F8FAFC !important;
  border: 1px dashed #CBD5E1 !important;
  color: #374151 !important;
}
.file-button {
  background: #EFF6FF !important;
  color: #1D4ED8 !important;
  border: 1px solid #BFDBFE !important;
}
.sample-tpl-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 12.5px;
  color: #4B5563;
}
.sample-tpl-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 5px;
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  color: #1D4ED8;
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
}
.sample-tpl-link:hover {
  background: #EFF6FF;
  border-color: #93C5FD;
}

/* 导入体检卡片（浅色高对比） */
.preflight {
  background: #FFFFFF !important;
  border: 1px solid #BFDBFE !important;
  border-left: 4px solid #2563EB !important;
}
.preflight-warnings li {
  background: #FFFBEB !important;
  border: 1px solid #FDE68A !important;
  color: #92400E !important;
}
.preflight-file {
  background: #F8FAFC !important;
  border: 1px solid #E5E7EB !important;
}
.preflight-sign {
  background: #F8FAFC !important;
  border: 1px solid #E5E7EB !important;
}

/* 演示模式细横幅（彻底砍掉大段 AI 说教） */
.demo-conclusion {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px !important;
  margin-bottom: 12px !important;
  background: #EFF6FF !important;
  border: 1px solid #BFDBFE !important;
  border-radius: 8px !important;
  color: #1E3A8A !important;
  font-size: 13px;
}
.demo-slim-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.demo-slim-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563EB;
  flex: 0 0 8px;
}
.demo-slim-text {
  color: #1E3A8A;
  font-weight: 500;
}
.demo-slim-sub {
  color: #4B5563;
  font-size: 12.5px;
}

/* 顶部运行信息条更紧凑 */
.run-bar {
  padding: 8px 14px !important;
  margin-bottom: 10px !important;
  gap: 10px 20px !important;
  font-size: 12.5px;
}

/* 顶部 KPI 卡片：紧凑排列，大金额严禁折行 */
.summary-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}
.summary-card {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03) !important;
  min-width: 0;
}
.summary-card .summary-label {
  color: #6B7280 !important;
  font-size: 12px !important;
  font-weight: 500;
  margin-bottom: 4px;
}
.summary-card .summary-value {
  color: #111827 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.summary-card.is-ok .summary-value { color: #059669 !important; }
.summary-card.is-warn .summary-value { color: #D97706 !important; }
.summary-card.is-bad .summary-value { color: #DC2626 !important; }
.summary-card .summary-sub {
  color: #6B7280 !important;
  font-size: 11.5px !important;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   第 2 刀：高密度财务表格（行高 40-44px，1440×900 一屏 ≥14 行）
   ========================================================================== */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.filter-pill {
  padding: 4px 11px;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
  background: #F9FAFB;
  color: #4B5563;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
}
.filter-pill:hover {
  background: #F3F4F6;
  color: #111827;
}
.filter-pill.is-active {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #1D4ED8;
  font-weight: 600;
}
.table-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-search-input {
  width: 240px;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid #D1D5DB !important;
  border-radius: 6px;
  background: #FFFFFF !important;
  color: #111827 !important;
}

.table-wrap {
  border: 1px solid #E5E7EB !important;
  border-radius: 8px !important;
  background: #FFFFFF !important;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #FFFFFF !important;
  color: #111827 !important;
  font-size: 13px;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #F8FAFC !important;
  color: #4B5563 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 8px 10px !important;
  border-bottom: 1px solid #E5E7EB !important;
  white-space: nowrap;
  text-align: left;
}
thead th.num { text-align: right !important; }
tbody td {
  padding: 7px 10px !important;
  height: 40px;
  border-bottom: 1px solid #F3F4F6 !important;
  color: #111827 !important;
  vertical-align: middle;
  white-space: nowrap;
}
tbody td.reason {
  white-space: normal;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tbody td.num {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
  font-family: var(--mono);
  font-weight: 500;
}
tbody td.code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: #374151 !important;
}
#match-table tbody tr,
#exception-table tbody tr {
  cursor: pointer;
  transition: background-color 120ms ease;
}
#match-table tbody tr:hover,
#exception-table tbody tr:hover {
  background: #F8FAFC !important;
}
#match-table tbody tr.is-selected,
#exception-table tbody tr.is-selected {
  background: #EFF6FF !important;
}

/* 紧凑状态标签 */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
}
.pill-pending, .pill-warn {
  background: #FFFBEB !important;
  color: #B45309 !important;
  border-color: #FDE68A !important;
}
.pill-approved, .pill-verified, .pill-ok {
  background: #ECFDF5 !important;
  color: #047857 !important;
  border-color: #A7F3D0 !important;
}
.pill-rejected, .pill-bad {
  background: #FEF2F2 !important;
  color: #B91C1C !important;
  border-color: #FECACA !important;
}
.pill-ignored, .pill-muted {
  background: #F3F4F6 !important;
  color: #4B5563 !important;
  border-color: #E5E7EB !important;
}

/* 行末轻量操作按钮（✓ / ✕ / 详情） */
.row-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.row-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid #E5E7EB;
  background: #FFFFFF;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms ease;
}
.row-act-btn:hover { background: #F3F4F6; border-color: #D1D5DB; }
.row-act-btn.is-approve:hover,
.row-act-btn.is-approve.is-active {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #059669;
}
.row-act-btn.is-reject:hover,
.row-act-btn.is-reject.is-active {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}
.row-act-btn.is-detail {
  color: #1D4ED8;
  border-color: #DBEAFE;
  background: #EFF6FF;
}
.row-act-btn.is-detail:hover {
  background: #DBEAFE;
}

/* 批量操作条 */
.batch-bar {
  background: #EFF6FF !important;
  border: 1px solid #BFDBFE !important;
  color: #1E3A8A !important;
  border-radius: 7px;
  padding: 6px 12px;
  margin-bottom: 8px;
}

/* ==========================================================================
   右侧滑出核对抽屉（Match 详情 & Exception Top 3 智能候选配对）
   ========================================================================== */
.review-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .22);
  z-index: 90;
}
.review-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 94vw);
  background: #FFFFFF;
  border-left: 1px solid #E5E7EB;
  box-shadow: -8px 0 32px rgba(15, 23, 42, .14);
  z-index: 95;
  display: flex;
  flex-direction: column;
  color: #111827;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #E5E7EB;
  background: #F8FAFC;
}
.drawer-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.drawer-head h2 {
  font-size: 15.5px;
  font-weight: 650;
  color: #111827;
  margin: 0;
}
.drawer-kbd-hint {
  font-size: 11.5px;
  color: #6B7280;
  padding: 2px 7px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 5px;
}
.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer-foot {
  padding: 12px 18px;
  border-top: 1px solid #E5E7EB;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.drawer-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.drawer-side-card {
  background: #F8FAFC;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drawer-side-title {
  font-size: 12px;
  font-weight: 650;
  color: #4B5563;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.drawer-item-box {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.drawer-item-amt {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
  font-weight: 700;
  color: #111827;
}
.drawer-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: #F8FAFC;
  border: 1px solid #E5E7EB;
  border-radius: 7px;
  font-size: 12.5px;
  color: #374151;
}
.drawer-section-title {
  font-size: 13px;
  font-weight: 650;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Top 3 智能候选推荐卡片 */
.cand-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cand-card {
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 11px 13px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.cand-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .08);
}
.cand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cand-rank {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
  font-size: 13px;
  color: #111827;
}
.cand-rank-badge {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
}
.cand-amt {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.cand-meta {
  font-size: 12px;
  color: #4B5563;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.cand-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.cand-tag {
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 4px;
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  font-weight: 500;
}
.cand-tag.is-exact {
  background: #ECFDF5;
  color: #047857;
  border-color: #A7F3D0;
}
.cand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.drawer-note-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #D1D5DB !important;
  border-radius: 6px;
  resize: vertical;
  min-height: 54px;
}
.drawer-btn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.drawer-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 银行余额调节表 & 月结总览浅色强化 */
.br-summary-value,
.me-card-value {
  color: #111827 !important;
  font-variant-numeric: tabular-nums;
}
.br-close-badge,
.me-gate-status {
  font-weight: 600;
}
.br-table th, .me-table th, .ar-table th {
  background: #F8FAFC !important;
  color: #4B5563 !important;
}
.br-table td, .me-table td, .ar-table td {
  color: #111827 !important;
}
.br-hero-ok, .me-verdict.is-ok {
  border-left: 4px solid #059669 !important;
}
.br-hero-warn, .me-verdict.is-warn {
  border-left: 4px solid #D97706 !important;
}
.br-hero-bad, .me-verdict.is-bad {
  border-left: 4px solid #DC2626 !important;
}

/* 对账页紧凑内边距，让首屏装下更多数据行 */
#main { padding: 14px 22px 28px !important; }
#view-review .card,
#view-exceptions .card {
  padding: 12px 16px !important;
}
#view-review .card-head,
#view-exceptions .card-head {
  margin-bottom: 8px !important;
}

/* 15.1 视觉细节修补：标题高对比、表格 1440px 零横向裁切、KPI 防截断 */
.wb-topbar h1,
.wb-topbar #view-title,
.wb-head h1,
h1 {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  background: none !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
}
#match-table th,
#match-table td {
  padding: 6px 8px !important;
  font-size: 12.5px !important;
}
#match-table td.code {
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-act-btn {
  padding: 0 7px !important;
  height: 24px !important;
  font-size: 12px !important;
}
.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
}
.summary-card .summary-sub {
  white-space: normal !important;
  line-height: 1.35;
}
