/* 发票智能解析 —— 列表视图（无任何外部依赖、无外部字体）
   视觉 token 沿用原 style.css；表格与浮层样式来自 docs/01-设计/05-列表视图原型/列表视图原型.html

   主题（1.33.0）：默认深色（与 1.32.0 逐像素一致），`html[data-theme="light"]` 切亮白。
   所有颜色一律走变量，新增色值不要再写字面量——两套主题只维护这一张表。
   切换逻辑在 theme.js：localStorage 存 light|dark|system，system 由 matchMedia 解析成前两者。 */
:root {
  --bg: #0f1216;
  --bg-soft: #161b22;
  --bg-soft2: #1c232c;
  --line: #2a323d;
  --line-soft: #222a34;
  --text: #e6edf3;
  --muted: #8b98a8;
  --accent: #3b82f6;
  --ok: #3fb950;
  --warn: #d29922;
  --warn-bg: rgba(210, 153, 34, 0.12);
  --err: #f85149;
  --err-bg: rgba(248, 81, 73, 0.12);
  --edit: #7c9cf5;
  --edit-bg: rgba(124, 156, 245, 0.14);
  --radius: 10px;
  --sticky-op-bg: #161b22;

  /* ---- 文字层级（数字越大越弱） ---- */
  --text-strong: #ffffff;
  --text-2: #c3cedb;
  --text-3: #9aa7b5;
  --text-4: #6f7d8d;
  --text-5: #5f6b78;
  /* ---- 链接 / 强调文字 ---- */
  --link: #9dc0ff;
  --link-strong: #cfe0ff;
  --link-hover: #7fb0ff;
  /* ---- 状态文字（不是底色；底色用 --*-bg） ---- */
  --ok-text: #7ddc8f;
  --warn-text: #e8c982;
  --warn-text-strong: #e3b341;
  --err-text: #ff9d97;
  --err-strong: #991b1b;
  --accent-strong: #1d4ed8;
  /* ---- 表面层级 ---- */
  --hover: #202833;
  --hover-2: #232c37;
  --bg-menu: #1a212b;
  --bg-thead: #0f151c;
  --bg-inset: #10151b;
  --paper: #cfdaea;
  /* ---- 线与阴影 ---- */
  --line-strong: #3d4b5c;
  --line-hover: #4b5765;
  --overlay: rgba(6, 9, 13, .72);
  --shadow-strong: rgba(0, 0, 0, .6);
  --shadow-mid: rgba(0, 0, 0, .55);
  --shadow-soft: rgba(0, 0, 0, .45);
  /* 极淡覆盖：暗色下是「提亮」（白），亮色下是「压暗」（黑），不能直接沿用同一个值 */
  --tint-1: rgba(255, 255, 255, .012);
  --tint-2: rgba(255, 255, 255, .03);
  --tint-3: rgba(255, 255, 255, .05);
}

/* 亮白主题：只重定义变量，不改任何选择器。
   取值原则：正文 #12171e 对白底 ≈ 16:1；次级 #33404d ≈ 9.6:1；最弱 #8a949e ≈ 3.6:1（仅用于禁用/占位）。
   状态色统一压暗一档，保证在 #ffffff 卡片上仍有 4.5:1 以上。 */
html[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-soft: #ffffff;
  --bg-soft2: #eef2f6;
  --line: #d8e0e8;
  --line-soft: #e6ecf2;
  --text: #12171e;
  --muted: #5c6874;
  --accent: #2563eb;
  --ok: #1a7f37;
  --warn: #b45309;
  --warn-bg: rgba(180, 83, 9, .10);
  --err: #cf222e;
  --err-bg: rgba(207, 34, 46, .08);
  --edit: #6f42c1;
  --edit-bg: rgba(111, 66, 193, .09);
  --sticky-op-bg: #ffffff;

  --text-strong: #0b0e12;
  --text-2: #33404d;
  --text-3: #55616d;
  --text-4: #6b7784;
  --text-5: #8a949e;

  --link: #1d4ed8;
  --link-strong: #1e40af;
  --link-hover: #1e3a8a;

  --ok-text: #15803d;
  --warn-text: #8a5a00;
  --warn-text-strong: #a16207;
  --err-text: #b91c1c;
  --err-strong: #dc2626;
  --accent-strong: #1d4ed8;

  --hover: #eef2f7;
  --hover-2: #e5ebf2;
  --bg-menu: #ffffff;
  --bg-thead: #f2f5f9;
  --bg-inset: #eef3f8;
  --paper: #ffffff;

  --line-strong: #b9c4cf;
  --line-hover: #9aa6b2;
  --overlay: rgba(15, 23, 32, .38);
  --shadow-strong: rgba(16, 24, 40, .18);
  --shadow-mid: rgba(16, 24, 40, .14);
  --shadow-soft: rgba(16, 24, 40, .10);

  --tint-1: rgba(15, 23, 32, .022);
  --tint-2: rgba(15, 23, 32, .04);
  --tint-3: rgba(15, 23, 32, .06);

  /* 词库页的三种标签色：深色下是浅亮色，亮色下要压暗才看得清 */
  --pack-custom: #7c3aed;
  --pack-seq: #0f766e;
  --wl-orange: #c2410c;

  color-scheme: light;
}

html[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}
body { display: flex; flex-direction: column; }
button { font: inherit; color: inherit; }
b { font-weight: 600; }
.spacer { margin-left: auto; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  flex: none;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 700;
}
.topbar h1 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
/* 副标题里放的是「本次 N 份文件 / N 行」：数字要比说明文字更醒目，用 var(--text) 提亮 */
.sub b { color: var(--text); font-variant-numeric: tabular-nums; }
.sub .slow-hint { margin-left: 10px; }
.top-right { display: flex; align-items: center; gap: 10px; }
/* 状态胶囊现在是按钮（「关于」入口）：必须清掉原生按钮的底色与内边距默认值，
   否则会在深色顶栏里出现一块浅灰。hover / focus-visible 与其它 .btn 同色阶。 */
.health {
  display: flex; align-items: center; gap: 8px;
  font: inherit; font-size: 12px; color: var(--muted);
  background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.health:hover { border-color: var(--line-strong); background: var(--hover); color: var(--text); }
.health:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(63, 185, 80, .16); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); }

/* ---------- 隐私条（常驻，不随解析状态变化） ---------- */
.privacy-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 7px 20px;
  font-size: 12px; color: var(--muted);
  background: var(--bg-soft2);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.privacy-bar svg { flex: none; opacity: .8; }

/* ---------- 按钮 ---------- */
/* .btn 自带 display，会盖掉 UA 的 [hidden]{display:none}；
   CSV 预览「分类统计」页要按 hidden 收起全选/复制，必须显式兜一条 */
.btn[hidden] { display: none; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg-soft2); padding: 5px 10px; font-size: 12px;
  cursor: pointer; transition: border-color .15s, opacity .15s, background .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: #1d4ed8; border-color: var(--accent-strong); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #2563eb; color: #fff; }
.btn.danger { background: var(--err-strong); border-color: var(--err-strong); color: #fff; }
.btn.danger:hover:not(:disabled) { background: var(--err-strong); color: #fff; }
.btn svg { flex: none; }
.link {
  background: none; border: 0; padding: 0;
  color: var(--accent); cursor: pointer; text-decoration: underline;
}

/* ---------- 主体 ---------- */
main {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  /* 上传条搬到页面底部之后，main 里只剩表格：下边距压到 10px，与底栏的上沿留一口气即可 */
  padding: 12px 16px 10px;
}

/* ---------- 底部操作条（与手机版底栏同构：左上传、右功能，各占一半） ---------- */
.bottombar {
  flex: none;
  /* 用 grid 而不是 flex：flex-basis:0 在 border-box 下仍会各自加上 padding，
     于是 padding 大的那个会宽出 8px（实测 703 vs 695）。grid 的 1fr 是严格等分。 */
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; gap: 10px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.dz-mini {
  min-width: 0;
  display: flex; align-items: center; gap: 10px;
  border: 1.5px dashed #33404f; border-radius: 9px;
  padding: 10px 14px; background: var(--bg-soft2); cursor: pointer;
  font-size: 12.5px; color: var(--text-2);
  transition: border-color .15s, background .15s;
}
.dz-mini:hover, .dz-mini.hover { border-color: var(--accent); background: rgba(59, 130, 246, .08); }
.dz-plus { font-size: 16px; color: var(--muted); line-height: 1; flex: none; }
/* 两行文案竖排：第一行「拖拽 / 点选」，第二行格式限制。原来两者同行靠 margin-left:auto 顶到右边，
   现在宽度只有一半，必须换行，否则右边那行会被压成省略号。 */
.dz-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dz-mini .hint { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 底栏里的「功能」：与左侧上传区等高、等宽，文字居中。 */
.bottombar .more-btn { min-width: 0; justify-content: center; font-size: 14px; font-weight: 500; }
/* 解析超过 3 秒后追加的提示（TC-089 / G21）：常驻占位，避免出现时整行跳动 */
.slow-hint { font-size: 12px; color: var(--warn); min-width: 0; }

/* ---------- 表格外框 ---------- */
.table-card {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
}
.table-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  background: var(--bg-soft2); flex: none;
}
.sort-summary { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.sort-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid rgba(59, 130, 246, .45); background: rgba(59, 130, 246, .12);
  color: var(--link); border-radius: 999px; padding: 1px 4px 1px 8px; font-size: 11.5px;
}
.sort-chip .pri {
  width: 14px; height: 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700;
  background: rgba(59, 130, 246, .85); color: #fff;
}
.sort-chip .rm {
  border: 0; background: none; color: inherit; opacity: .6; cursor: pointer;
  padding: 0 3px; line-height: 1; font-size: 12px;
}
.sort-chip .rm:hover { opacity: 1; }
.sort-chip.default-chip { border-color: var(--line); background: var(--bg-soft); color: var(--muted); }
.legend { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg i { width: 9px; height: 9px; border-radius: 2px; display: block; }

/* ---------- 待核对警示条（TC-082：文案 + N + 点击定位） ---------- */
.warn-bar {
  display: flex; align-items: center; gap: 7px; flex: none;
  padding: 7px 12px; font-size: 12.5px; cursor: pointer;
  color: var(--warn-text); background: var(--warn-bg);
  border-bottom: 1px solid rgba(210, 153, 34, .35);
  border-left: 3px solid var(--warn);
}
.warn-bar:hover { background: rgba(210, 153, 34, .2); }
/* 类选择器的 display 优先级高于 UA 的 [hidden]{display:none}，必须自己兜一条，
   否则 hidden=true 但元素照样占 33px（首屏挂一条空警示条）。同 .overlay 等组件。 */
.warn-bar[hidden] { display: none; }
.warn-bar:focus-visible { outline: 2px solid var(--warn); outline-offset: -2px; }
.warn-bar svg { flex: none; }
.wb-text { font-weight: 600; }
.wb-hint { color: var(--muted); font-size: 11.5px; margin-left: 2px; text-decoration: underline; text-underline-offset: 2px; }
/* 只剩「重复舍弃 / 替换」这类去重统计时，条子上没有行可定位：去掉「点此定位第一条」
   与 hover 高亮，让它看起来就是一条提示。特异性要压过 .warn-bar:hover，所以带 id。 */
#warnBar[data-plain] { cursor: default; }
#warnBar[data-plain]:hover { background: var(--warn-bg); }
#warnBar[data-plain] .wb-hint { display: none; }
/* 点警示条定位：目标行闪一下，1.5 秒后自动褪去 */
table.gt tr.flash > td { background: rgba(210, 153, 34, .3); transition: background .35s ease; }

/* ---------- 表格 ---------- */
.table-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; }
/* table-layout:fixed + 首行单元格宽度 = 固定列宽，长文本一律靠内层 span 省略号截断
   1998 = 各列宽之和（154+254+110+116+116+104+136+214+190+214+190+200）；
   JS 的 renderHead 还会用 COLS 求和再写一次内联宽度，两边必须一致，改列宽记得同步这里。 */
table.gt {
  border-collapse: separate; border-spacing: 0; table-layout: fixed;
  width: 1998px; min-width: 100%; font-size: 12.5px;
}
table.gt th, table.gt td {
  padding: 0 10px; height: 40px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left; vertical-align: middle;
  white-space: nowrap; overflow: hidden;
}
table.gt thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg-soft2);
  font-size: 12px; font-weight: 500; color: var(--text-2);
  border-bottom: 1px solid var(--line);
  user-select: none;
}
table.gt thead th.sortable { cursor: pointer; }
table.gt thead th.sortable:hover { background: var(--hover-2); color: var(--text); }
table.gt thead th.sorted { color: var(--link-strong); background: var(--bg-inset); }
.th-in { display: flex; align-items: center; gap: 5px; }
.th-label { overflow: hidden; text-overflow: ellipsis; }
.th-pri {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; line-height: 1;
  background: rgba(59, 130, 246, .9); color: #fff;
}
.arw { display: block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; flex: none; }
.arw.up { border-bottom: 6px solid #7fb0ff; }
.arw.down { border-top: 6px solid #7fb0ff; }

/* 操作列：横向滚动时钉在右侧 */
table.gt .c-op { position: sticky; right: 0; z-index: 1; background: var(--sticky-op-bg); }
table.gt thead .c-op { z-index: 3; background: var(--bg-soft2); }
table.gt .c-op::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
  background: var(--line);
}
tbody tr:hover td { background: var(--bg-menu); }
tbody tr:hover .c-op { background: var(--bg-menu); }
tbody tr.is-deleting { opacity: 0; transform: translateX(-8px); transition: opacity .18s, transform .18s; }

/* 状态左色条 */
tbody tr.row-review td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tbody tr.row-failed td:first-child { box-shadow: inset 3px 0 0 var(--err); }
tbody tr.row-edited td:first-child { box-shadow: inset 3px 0 0 var(--edit); }
tbody tr.row-done td:first-child { box-shadow: inset 3px 0 0 transparent; }

/* 状态徽标：类名一律 s-* 前缀，禁止 running / error 裸名 */
.st {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.s-review { color: var(--warn-text); border-color: rgba(210, 153, 34, .55); background: var(--warn-bg); }
.st.s-done { color: var(--ok-text); border-color: rgba(63, 185, 80, .5); background: rgba(63, 185, 80, .1); }
.st.s-failed { color: var(--err-text); border-color: rgba(248, 81, 73, .5); background: var(--err-bg); }
.st.s-edited { color: var(--edit); border-color: rgba(124, 156, 245, .55); background: var(--edit-bg); }
.st-flag {
  font-size: 10px; padding: 0 4px; border-radius: 3px; margin-left: 4px;
  border: 1px dashed rgba(124, 156, 245, .6); color: var(--edit); vertical-align: 1px;
}
/* 状态列只读：不进入编辑、不显示手型光标（状态由解析结果派生，人工不可改） */
td.c-readonly { cursor: default; }

/* 单元格内容 */
.cell-txt { display: block; overflow: hidden; text-overflow: ellipsis; }
td.c-no .cell-txt { letter-spacing: -0.2px; font-variant-numeric: tabular-nums; }
.cell-money { display: block; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
td.c-money { text-align: right; }
/* 开票日期：定宽 110（YYYY-MM-DD 10 位，等宽数字正好放得下），居中；
   等宽数字让上下行的年月日逐位对齐，扫一眼就能看出日期没有错行。 */
.c-date { width: 110px; text-align: center; }
td.c-date .cell-txt { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.nil { color: var(--text-5); }
td { position: relative; }
td.editable { cursor: text; }
td.editable:hover { background: rgba(59, 130, 246, .09); box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .35); }
/* 正在编辑的格子：只描边，内容不动（输入在浮层编辑条里） */
td.c-editing { background: rgba(59, 130, 246, .1); box-shadow: inset 0 0 0 2px var(--accent); }

/* 人工核对过的字段（改过 或 只确认没改值）：淡蓝底 + 左侧 2px 蓝边，
   与「机器不确定」的淡黄底区分。两种来源视觉完全一致（用户 2026-11-06 裁决）。 */
td.cell-edited { background: rgba(59, 130, 246, .14); box-shadow: inset 2px 0 0 var(--accent); }
tbody tr:hover td.cell-edited { background: rgba(59, 130, 246, .2); }
td.cell-edited.low { background: rgba(59, 130, 246, .14); }

/* 合计行：钉在表尾（数据行怎么排序它都不动），不参与排序、不进 CSV。
   类选择器的 display 同样会盖掉 UA 的 [hidden]{display:none}，这里显式兜一条。 */
table.gt tfoot td {
  position: sticky; bottom: 0; z-index: 2;
  background: var(--bg-soft2); color: var(--text);
  border-top: 1px solid var(--line); border-bottom: none;
  font-weight: 600; font-variant-numeric: tabular-nums;
}
table.gt tfoot[hidden] { display: none; }
table.gt tfoot .c-op { z-index: 3; background: var(--bg-soft2); }
table.gt tfoot .foot-status { color: var(--text-2); font-weight: 500; white-space: normal; overflow: visible; }
table.gt tfoot .foot-count { color: var(--text-2); font-weight: 500; }
table.gt tfoot .foot-sum { text-align: right; color: var(--link-strong); }
/* 脏金额提示（合计行操作列）：这格本来是空的，宽度够，也不会污染状态/张数/金额三格 */
table.gt tfoot td.foot-warn {
  color: var(--err-text); font-size: 11px; line-height: 1.35;
  white-space: normal; overflow: visible; text-align: left;
}
/* 状态计数小徽标：颜色与行上状态徽标同一套（§3.2 权重色），窄了就折行，不截断 */
.fst {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; line-height: 15px; padding: 0 6px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); vertical-align: middle;
}
.fst::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.fst.s-review { color: var(--warn-text); border-color: rgba(210, 153, 34, .55); background: var(--warn-bg); }
.fst.s-done { color: var(--ok-text); border-color: rgba(63, 185, 80, .5); background: rgba(63, 185, 80, .1); }
.fst.s-failed { color: var(--err-text); border-color: rgba(248, 81, 73, .5); background: var(--err-bg); }
.fst.s-edited { color: var(--edit); border-color: rgba(124, 156, 245, .55); background: var(--edit-bg); }

/* 勾稽不平（meta.checks）：金额格红色左边框 2px + 淡红底。
   原先用右下角几像素的红色小三角，正常视距基本看不见，几百块的票少 10 块钱没人发现，
   改成与「低置信黄底」同一套视觉语法（底色 + 左边框）、颜色换危险色。
   真加 border-left 会不会把该列推歪？实测 table-layout:fixed + border-collapse:separate 下
   列位置不变（表头与数据格 left 完全一致），只是本格内容右移 2px，所以补 padding-left: 8px
   （原 10px - 边框 2px）把文字拉回与表头对齐。
   红优先于黄：同时 low（黄底/黄边）或 cell-edited（蓝底/蓝边）的格子按红渲染，title 两段都保留。 */
td.chk-mark {
  border-left: 2px solid var(--err);
  background: rgba(248, 81, 73, .1);
  box-shadow: inset 0 0 0 1px rgba(248, 81, 73, .38);
}
/* padding-left 用 table.gt 前缀：`table.gt th, table.gt td { padding: 0 10px }` 的优先级(0,1,2)
   高于单类 `td.chk-mark`(0,1,1)，不加上前缀这条会被压掉。8px = 原 10px - 边框 2px。 */
table.gt td.chk-mark { padding-left: 8px; }
td.chk-mark.low,
td.chk-mark.cell-edited,
td.chk-mark.cell-edited.low {
  background: rgba(248, 81, 73, .1);
  box-shadow: inset 0 0 0 1px rgba(248, 81, 73, .45);
}
td.chk-mark .cell-txt, td.chk-mark .cell-money {
  text-decoration-color: rgba(248, 81, 73, .85);
}

/* 低置信字段标黄 / <0.70 标红 */
td.low { background: var(--warn-bg); box-shadow: inset 0 0 0 1px rgba(210, 153, 34, .42); }
td.low .cell-txt, td.low .cell-money { text-decoration: underline dotted rgba(210, 153, 34, .75); text-underline-offset: 3px; }
td.low.vlow { background: var(--err-bg); box-shadow: inset 0 0 0 1px rgba(248, 81, 73, .45); }
td.low.vlow .cell-txt, td.low.vlow .cell-money { text-decoration-color: rgba(248, 81, 73, .8); }
.low-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn); margin: 0; position: absolute; top: 5px; right: 6px;
}
td.low.vlow .low-dot { background: var(--err); }
/* 发票代码为空（铁路票常见）：右上角小黄点，不插占位符 */
.miss-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--warn); margin: 0; position: absolute; top: 6px; right: 7px; opacity: .9;
}

/* 操作列按钮 */
.op-cell { display: flex; align-items: center; gap: 4px; }
.mini {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-soft2);
  padding: 2px 7px; font-size: 11.5px; cursor: pointer; color: var(--text-2);
  transition: border-color .15s, color .15s, background .15s;
}
.mini:hover { border-color: var(--line-strong); background: var(--hover); color: var(--text); }
.mini.danger:hover { border-color: rgba(248, 81, 73, .6); color: var(--err-text); background: var(--err-bg); }
.mini.retry { border-color: rgba(59, 130, 246, .45); color: var(--link); }
.mini.retry:hover { border-color: rgba(59, 130, 246, .8); background: rgba(59, 130, 246, .14); }
/* OFD 转出来的 PDF：用绿色跟其它操作区分开；转换中/失败时置灰但仍占位，
   避免按钮忽隐忽现让列宽跳动 */
.mini.pdf { border-color: rgba(63, 185, 80, .45); color: var(--ok-text); }
.mini.pdf:hover { border-color: rgba(63, 185, 80, .85); background: rgba(63, 185, 80, .14); color: var(--ok-text); }
/* 整张确认：用主色（蓝）与「删除」的危险红、PDF 的绿区分开；仅待核对行出现 */
.mini.confirm { border-color: rgba(59, 130, 246, .55); color: var(--link); }
.mini.confirm:hover { border-color: rgba(59, 130, 246, .9); background: rgba(59, 130, 246, .16); color: var(--link-strong); }
/* 图片兜底版：内容完整，但没有文字层（不可搜索）。用虚线边框跟矢量版区分，
   不另起色系——它仍然是可用的产物，不是错误状态。 */
.mini.pdf.is-img { border-style: dashed; }
.mini.pdf.is-off,
.mini.pdf.is-off:hover {
  border-color: var(--line); background: var(--bg-soft2); color: var(--text-5); cursor: not-allowed;
}
.mini svg { flex: none; }

/* -------- 空态 -------- */
.empty-state {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); font-size: 13px; pointer-events: none;
  text-align: center; padding: 20px;
}
.empty-state[hidden] { display: none; }
.empty-state .big { font-size: 15px; color: var(--text-2); }

/* -------- 右键菜单 -------- */
.ctx-menu {
  position: fixed; z-index: 90; min-width: 236px;
  background: var(--bg-menu); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 12px 32px var(--shadow-mid); padding: 6px;
  font-size: 12.5px;
}
.ctx-menu[hidden] { display: none; }
.ctx-title { font-size: 10.5px; color: var(--muted); padding: 4px 8px 2px; letter-spacing: .04em; }
.ctx-stack { padding: 2px 8px 6px; display: flex; flex-direction: column; gap: 3px; }
.ctx-stack .si { display: flex; align-items: center; gap: 6px; color: var(--link); font-size: 11.5px; }
.ctx-stack .si .idx {
  width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center;
  font-size: 9px; font-weight: 700; background: rgba(59, 130, 246, .85); color: #fff;
}
.ctx-stack .empty-stack { color: var(--muted); font-size: 11.5px; }
.ctx-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; text-align: left; color: var(--text);
  padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px;
}
.ctx-item:hover { background: rgba(59, 130, 246, .16); }
.ctx-item:disabled { opacity: .4; cursor: not-allowed; }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* -------- 「⋯」下拉菜单（全站唯一，锚点在顶栏最右上角） -------- */
/* 层级 92：高于排序右键菜单(90)、编辑浮层(88)、JSON 抽屉(85)，低于 toast(95)。
   不挂遮罩，position: fixed，位置由 app.js 按锚点 getBoundingClientRect() 算出后夹进视口。
   与 .ctx-menu 是两套节点：那份只服务表头排序，只支持鼠标、无键盘可达。 */
.popmenu {
  position: fixed; z-index: 92; min-width: 156px;
  max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--bg-menu); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 12px 32px var(--shadow-mid); padding: 6px;
  font-size: 12.5px;
}
.popmenu[hidden] { display: none; }
.popmenu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  width: 100%; min-height: 28px;
  border: 0; background: none; text-align: left; color: var(--text);
  padding: 5px 10px; border-radius: 6px; cursor: pointer;
  font-size: 12.5px; white-space: nowrap;
}
.popmenu-item:hover:not(:disabled), .popmenu-item:focus-visible { background: rgba(59, 130, 246, .16); }
.popmenu-item:focus { outline: none; }
.popmenu-item:disabled { opacity: .45; cursor: not-allowed; }
.popmenu-item .sub { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.popmenu-item.danger { color: var(--err); }
.popmenu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
/* 锚点打开时的激活态（与 .btn:hover 同色阶，不引入新颜色） */
.btn.more-btn[aria-expanded="true"] { border-color: var(--line-strong); background: var(--hover); }

/* ---------- 全页拖拽接收遮罩（window 捕获阶段接管，见 app.js） ---------- */
/* pointer-events:none 是关键：它只是视觉层，不参与事件命中，否则会挡住
   底下的元素、让 dragenter/dragleave 反复交替（遮罩闪烁）。 */
.dropveil {
  position: fixed; inset: 0; z-index: 70;
  display: none; align-items: center; justify-content: center;
  background: var(--overlay);
  pointer-events: none;
}
.dropveil.on { display: flex; }
.dropveil-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 38px 56px; border: 2px dashed rgba(59, 130, 246, .78); border-radius: 16px;
  background: rgba(59, 130, 246, .07);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, .12) inset, 0 20px 60px var(--shadow-soft);
}
.dropveil-icon { color: var(--link-hover); }
.dropveil-t { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
.dropveil-s { font-size: 12.5px; color: var(--muted); }

/* -------- 遮罩 / 弹层 -------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.overlay[hidden] { display: none; }
.dialog {
  width: min(420px, 100%);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 24px 64px var(--shadow-strong);
  padding: 18px 20px;
}
.dialog h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.dialog p { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.dialog .warn-line { color: var(--warn-text); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* -------- 上传 / 识别进度框 -------- */
.prog-overlay { z-index: 90; cursor: progress; }
.prog-card {
  width: min(430px, 100%);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 24px 64px var(--shadow-strong);
  padding: 16px 18px 14px;
}
.prog-head { display: flex; align-items: center; gap: 9px; }
.prog-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; }
.prog-phase {
  margin-left: auto; flex: none;
  font-size: 11px; color: var(--link);
  border: 1px solid rgba(59, 130, 246, .4); background: rgba(59, 130, 246, .16);
  border-radius: 999px; padding: 1px 8px;
}
/* 旋转圆环：识别阶段持续转，本身就是「还在动」的信号 */
.prog-spin {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, .25); border-top-color: var(--accent);
  animation: progSpin .8s linear infinite;
}
.prog-overlay.p-done .prog-spin {
  border-color: rgba(63, 185, 80, .3); border-top-color: var(--ok);
  animation: none;
}
@keyframes progSpin { to { transform: rotate(360deg); } }

.prog-file {
  margin: 10px 0 0; font-size: 12.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prog-track {
  position: relative; height: 8px; margin-top: 10px;
  border-radius: 999px; background: var(--bg-menu); overflow: hidden;
  box-shadow: inset 0 0 0 1px #2f3a48;
}
.prog-fill {
  position: relative; height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width .18s linear;
}
/* 渐变条纹流动：即便百分比停顿，也看得出来没卡死 */
.prog-fill::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(115deg,
    rgba(255, 255, 255, .22) 25%, transparent 25%,
    transparent 50%, rgba(255, 255, 255, .22) 50%,
    rgba(255, 255, 255, .22) 75%, transparent 75%);
  background-size: 22px 22px;
  animation: progFlow .7s linear infinite;
  opacity: .5;
}
@keyframes progFlow { to { background-position: 22px 0; } }
.prog-overlay.p-done .prog-fill { background: linear-gradient(90deg, #2ea043, #3fb950); }
.prog-overlay.p-done .prog-fill::after { animation: none; opacity: 0; }
.prog-overlay.p-fail .prog-fill { background: linear-gradient(90deg, #b62324, #f85149); }

.prog-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.prog-pct { color: var(--text); font-weight: 600; }
.prog-sep { opacity: .5; }
.prog-foot { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
.prog-hint { flex: 1; font-size: 11px; color: var(--text-4); line-height: 1.5; }
.prog-hint.slow { color: var(--warn-text); }
.prog-min {
  flex: none; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-soft2); color: var(--muted);
  padding: 2px 8px; font-size: 11px; cursor: pointer;
}
.prog-min:hover { border-color: var(--line-strong); color: var(--text); }

/* 收起态：遮罩让出页面，卡片缩到右下角继续显示进度（后台仍在处理） */
.prog-overlay.min {
  background: transparent; pointer-events: none;
  align-items: flex-end; justify-content: flex-end; padding: 16px;
}
.prog-overlay.min .prog-card {
  pointer-events: auto; width: 296px; padding: 11px 13px 9px;
  box-shadow: 0 12px 32px var(--shadow-mid);
}
.prog-overlay.min .prog-head h2 { font-size: 12.5px; }
.prog-overlay.min .prog-file { display: none; }
.prog-overlay.min .prog-track { height: 6px; margin-top: 8px; }
.prog-overlay.min .prog-hint { display: none; }
.prog-overlay.min .prog-foot { margin-top: 7px; justify-content: flex-end; }

/* -------- 原件预览 / 失败详情 -------- */
.preview-box {
  width: min(920px, 100%); max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 24px 64px var(--shadow-strong); overflow: hidden;
}
.preview-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft2);
}
.preview-head .fn { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-head .fm { font-size: 11px; color: var(--muted); white-space: nowrap; }
.preview-body {
  flex: 1; min-height: 0; overflow: auto; padding: 20px;
  background: var(--bg-inset);
  display: flex; align-items: flex-start; justify-content: center;
}
.preview-body.mode-error { display: block; padding: 16px; }
.preview-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-top: 1px solid var(--line); background: var(--bg-soft2);
  font-size: 11.5px; color: var(--muted); flex-wrap: wrap;
}
.zoom-val { font-variant-numeric: tabular-nums; min-width: 42px; text-align: center; color: var(--text-2); }
.icon-btn {
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-soft);
  cursor: pointer; color: var(--text-2); flex: none;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--text); }
.pv-holder { margin: 0 auto; }
/* 图片按容器宽度铺满：缩放只改 .pv-holder 的宽度百分比，滚动区随之变大变小 */
.pv-holder img { display: block; width: 100%; height: auto; max-width: none; border-radius: 3px; box-shadow: 0 10px 30px var(--shadow-mid); }
.pv-holder iframe { width: 100%; height: 72vh; border: 0; background: #fff; border-radius: 3px; }
.pv-note { color: var(--muted); font-size: 12.5px; line-height: 1.7; max-width: 620px; }
.pv-note code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
.pv-note a { color: var(--link-hover); }

/* -------- 失败错误卡片（TC-083 / TC-084） -------- */
.errcard { border: 1px solid rgba(248, 81, 73, .45); background: var(--err-bg);
  border-radius: 11px; padding: 14px 16px; }
.errcard-title { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: var(--err-text); }
.errcard-row { margin: 0 0 6px; font-size: 13px; color: var(--err-text); line-height: 1.55; }
.errcard-row b { color: var(--text-strong); font-weight: 600; }
.errcard .actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 4px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.errcard-detail { margin-top: 12px; border-top: 1px dashed rgba(248, 81, 73, .3); padding-top: 10px; }
.errcard-detail summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.errcard-detail[open] summary { margin-bottom: 8px; }
.errcard-detail .kv { margin-top: 6px; }

/* -------- 编辑浮层（显式保存） -------- */
.edit-bar {
  position: fixed; z-index: 88; width: 352px;
  background: var(--bg-menu); border: 1px solid #33404f; border-radius: 10px;
  box-shadow: 0 18px 44px var(--shadow-strong); padding: 10px 12px 11px;
}
.edit-bar[hidden] { display: none; }
.eb-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.eb-title { font-size: 12.5px; font-weight: 600; color: var(--link-strong); }
.eb-sub { font-size: 10.5px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.eb-field input, .eb-field select {
  width: 100%; background: var(--bg-inset); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; font: inherit; outline: none;
}
.eb-field input:focus, .eb-field select:focus { border-color: var(--accent); }
.eb-field input.invalid { border-color: var(--err); background: var(--err-bg); }
.eb-field input.money { text-align: right; font-variant-numeric: tabular-nums; }
/* 日期输入：等宽 + 居中，placeholder 的 YYYY-MM-DD 与真实值同宽，输入时不跳 */
.eb-field input.date { text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.eb-field .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eb-field .two label { font-size: 10px; color: var(--muted); display: block; margin-bottom: 3px; }
.eb-cmp {
  margin-top: 9px; border-top: 1px dashed var(--line); padding-top: 7px;
  display: flex; flex-direction: column; gap: 3px;
}
.eb-line { font-size: 11.5px; display: flex; gap: 6px; }
.eb-line .k { color: var(--muted); flex: none; width: 62px; }
.eb-line .v { color: var(--text-2); word-break: break-all; }
.eb-line .v.nil { color: var(--text-5); }
.eb-line.diff .v { color: var(--warn-text); }
.eb-line[hidden] { display: none; }
.eb-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.eb-msg { font-size: 11px; color: var(--err-text); margin-right: auto; }
.eb-actions .btn.primary { padding: 4px 12px; }

/* -------- CSV 预览弹框（Excel 风格） -------- */
.csv-box {
  /* 明细表 15 列（含来源文件名/置信度）需要更宽：1180 会差 48px，把置信度挤出可视区 */
  width: min(1280px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 24px 64px var(--shadow-strong); overflow: hidden;
}
.csv-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft2);
}
.csv-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.csv-head .meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---- CSV 字段显隐：顶部两个按钮 + 固定定位气泡 ----
   气泡用 fixed 而不是 absolute：.csv-box 是 overflow:hidden，
   表格只有三行时盒子里没空间，absolute 气泡会被直接裁掉。 */
.colpick { display: inline-flex; }
.colpick .btn { height: 26px; padding: 0 9px; font-size: 12px; }
.colpick .btn b { margin-left: 5px; font-weight: 600; color: var(--link-strong); font-variant-numeric: tabular-nums; }
.colpick .btn[aria-expanded="true"] { border-color: #3b82f6; background: var(--bg-inset); }
.colpop {
  /* z-index 必须高于 .overlay(80)：气泡挂在 body 上，低了会被弹层盖住点不到；低于 toast(95) */
  position: fixed; z-index: 90; width: 272px; max-height: min(60vh, 380px); overflow: auto;
  padding: 8px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 18px 44px var(--shadow-strong);
  overscroll-behavior: contain;
}
.colpop[hidden] { display: none; }
.colpop .cp-h {
  /* 列多时列表要滚，标题行跟着滚掉就看不到「已选 x/y」了，粘住 */
  position: sticky; top: -8px; z-index: 1; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 4px 7px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}
.colpop .cp-all {
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--link-strong);
  border-radius: 6px; padding: 2px 7px; font-size: 11px; cursor: pointer;
}
.colpop .cp-all:hover { background: var(--hover); }
.colpop .cp-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px;
  border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--text);
}
.colpop .cp-item:hover { background: rgba(59, 130, 246, .1); }
.colpop .cp-item input { accent-color: #3b82f6; cursor: pointer; flex: none; }
.colpop .cp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colpop .cp-tip { padding: 5px 6px 2px; font-size: 11.5px; color: var(--err-text); }
.csv-tabs { display: flex; gap: 6px; padding: 8px 14px 0; background: var(--bg-soft2); }
.csv-tab {
  padding: 5px 12px; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0;
  background: var(--bg-soft); color: var(--muted);
}
.csv-tab.on { background: var(--bg-thead); color: var(--text); border-color: var(--line-hover); }
.csv-tab .n { font-size: 10.5px; opacity: .75; margin-left: 4px; }
.csv-body { flex: 1; min-height: 0; overflow: auto; background: var(--bg-thead); border-top: 1px solid var(--line); }
/* 预览表的值一律完整展示，不截断（2026-11-21 用户裁决）：超宽就换行，行高自己长。
   限宽必须落在内层 span 上——table 是 auto 布局，td 的 max-width 不生效，
   单元格宽度由内容撑（这正是之前非要用内层元素做省略号的原因）。
   260px ≈ 12 位税号 / 20 字文件名的单行宽度；再长就折行，不再出现省略号。
   只用 word-break: break-word，**不要**再加 overflow-wrap: anywhere ——
   anywhere 会参与表格的 min-content 计算，列被压到几十像素，13 位发票代码都会被拦腰折断；
   break-word 只在整词放不下时才断，连续数字/税号保持一行。 */
.csv-body table.xl td { vertical-align: top; }
.csv-body table.xl td .cw {
  display: inline-block; max-width: 260px;
  white-space: normal; word-break: break-word;
  vertical-align: top;
}
/* 分类统计是聚合行，不参与勾选：鼠标别显示成可点 */
.csv-body table.xl tbody.noSel tr { cursor: default; }
table.xl { border-collapse: separate; border-spacing: 0; font-size: 11.5px; width: max-content; min-width: 100%; }
table.xl th, table.xl td {
  border-right: 1px solid #2a323d; border-bottom: 1px solid #2a323d;
  padding: 4px 8px; white-space: nowrap; text-align: left;
}
table.xl thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--hover-2); color: var(--text-2); font-weight: 500;
  border-bottom: 1px solid #3a4756;
}
/* 表头可点即复制该列：光标 + 悬浮高亮 + 复制成功后的短暂反馈 */
table.xl thead th.colth { cursor: pointer; }
table.xl thead th.colth:hover { background: var(--bg-inset); color: var(--text-strong); }
table.xl thead th.colth.copied { background: rgba(59, 130, 246, .55); color: #fff; }
table.xl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.xl tbody tr { cursor: pointer; }
table.xl tbody tr:hover td { background: rgba(59, 130, 246, .1); }
table.xl tbody tr.sel td { background: rgba(59, 130, 246, .2); }
table.xl tbody tr.sel:hover td { background: rgba(59, 130, 246, .26); }
.csv-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 14px; border-top: 1px solid var(--line); background: var(--bg-soft2);
  font-size: 11.5px; color: var(--muted);
}

/* -------- 原始 JSON 抽屉 -------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 85;
  width: min(720px, 92vw);
  background: var(--bg-soft); border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px var(--shadow-mid);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease-out;
}
.drawer.open { transform: translateX(0); }
.drawer[hidden] { display: none; }
.drawer-head {
  display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: nowrap;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft2);
}
.drawer-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.drawer-head .meta {
  font-size: 11.5px; color: var(--muted); margin-left: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.drawer-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px 24px; }
.drawer-foot {
  flex: none; padding: 8px 14px; border-top: 1px solid var(--line);
  background: var(--bg-soft2); font-size: 11.5px; color: var(--muted);
}
.drawer-foot code, .jroot code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--text-2); }
.jfile { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-inset); }
.jfile > summary {
  padding: 7px 10px; font-size: 12px; cursor: pointer; color: var(--link);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jfile .jpre {
  margin: 0; padding: 0 10px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; word-break: break-all;
}
.jfile .jpre.flush { padding-top: 10px; }

/* -------- toast -------- */
.toast-host {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-inset); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 14px; font-size: 12.5px; color: var(--text);
  box-shadow: 0 12px 32px var(--shadow-mid); pointer-events: auto;
  animation: toastIn .18s ease-out;
}
.toast .act { border: 0; background: none; color: var(--link-hover); cursor: pointer; font-size: 12.5px; text-decoration: underline; }
.toast .act:hover { color: var(--link-strong); }
.toast .close { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .legend { margin-left: 0; }
  /* 底栏两个块本来就并排，窄屏也不竖排（竖排后上传区会吃掉半屏高度） */
  .table-card { min-height: 50vh; }
  .dz-mini .hint { display: none; }
  .bottombar { padding: 8px 12px 10px; gap: 8px; }
  .edit-bar { width: min(352px, calc(100vw - 24px)); }
}

/* -------- 打印版式：查看框双栏（左原件 / 右纸张配置 + 落位小预览） -------- */
/* 固定高度：纸面按可用空间等比缩放，不能靠内容把弹框撑开（否则先有鸡还是先有蛋，纸面永远最小） */
.preview-box.pv2 { width: min(1180px, 96vw); height: min(88vh, 900px); }
.pv2-body {
  padding: 0; overflow: hidden;
  display: flex; flex-direction: row; align-items: stretch; justify-content: flex-start;
  background: var(--bg);
}
.pv2-body.is-error .pv-panel { display: none; }
/* 没有可预览的原件时，底部缩放条整条不出现（footer 与 body 是兄弟节点，不用改 JS） */
.pv2-body.is-error ~ .preview-foot { display: none; }
.pv-stage {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  padding: 10px 14px 4px; background: var(--bg-inset);
}
/* 落位小预览：替代原「整页版式」页签与大画布，只示意票面落在纸上的位置 */
.pv-mini {
  border: 1px solid var(--line-soft); border-radius: 7px;
  background: var(--bg); padding: 7px 8px 8px; flex: none;
}
.pv-mini-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 11px; color: var(--muted);
}
.pv-mini-head b { font-weight: 500; color: var(--text-2); }
.pv-mini-box {
  height: 132px; display: flex; align-items: center; justify-content: center;
  margin-top: 3px; overflow: hidden;
}
.pv-page-mini { box-shadow: 0 3px 10px var(--shadow-soft); }
/* 滚动容器必须是普通块级流：flex 居中在内容高于容器时，溢出部分会落到滚动原点之外，
   scrollTop 无法为负 → 顶部一段永远滚不出来（长票常见）。居中改用子元素 margin:auto。 */
.pv-canvas {
  flex: 1; min-height: 0; display: block;
  overflow: auto; padding: 4px 10px 12px;
}
.pv-caption { font-size: 11px; color: var(--muted); text-align: center; padding: 8px 0 4px; flex: none; }

/* 纸面：白纸 + 虚线槽位 + 本行票面落位 */
.pv-page {
  position: relative; background: #fff; border-radius: 2px; flex: none;
  box-shadow: 0 10px 28px var(--shadow-mid);
  transform-origin: top center; transition: transform .15s ease-out;
}
.pv-slot { position: absolute; border: 1px dashed #c2ccd8; pointer-events: none; }
.pv-slot.on { border-color: #6b9bd2; background: rgba(107, 155, 210, .05); }
.pv-ticket {
  position: absolute; background: var(--paper); border: 1px solid #8fa3bd; overflow: hidden;
}
.pv-ticket .tt { position: absolute; left: 6%; top: 7%; width: 54%; height: 10%; background: var(--paper); }
.pv-ticket .l1 { position: absolute; left: 6%; top: 26%; width: 84%; height: 4%; background: var(--paper); }
.pv-ticket .l2 { position: absolute; left: 6%; top: 36%; width: 70%; height: 4%; background: var(--paper); }
.pv-ticket .l3 { position: absolute; left: 6%; top: 46%; width: 78%; height: 4%; background: var(--paper); }
.pv-ticket .l4 { position: absolute; left: 6%; top: 56%; width: 62%; height: 4%; background: var(--paper); }
.pv-ticket .qr {
  position: absolute; right: 6%; bottom: 7%; width: 17%; aspect-ratio: 1 / 1;
  background: #fff; border: 1px solid #8fa3bd;
}

/* 右侧配置面板 */
.pv-panel {
  width: 266px; flex: none; border-left: 1px solid var(--line); background: var(--bg-soft);
  padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow: auto;
}
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pv-label { font-size: 12.5px; color: var(--text); }
.pv-switch { position: relative; display: inline-flex; width: 40px; height: 22px; flex: none; cursor: pointer; }
.pv-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pv-switch i { position: absolute; inset: 0; border-radius: 11px; background: var(--hover-2); border: 1px solid var(--line); transition: background .15s; }
.pv-switch i::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #8b98a8; transition: transform .15s, background .15s;
}
.pv-switch input:checked + i { background: rgba(63, 185, 80, .32); border-color: rgba(63, 185, 80, .6); }
.pv-switch input:checked + i::after { transform: translateX(18px); background: #3fb950; }
.pv-switch input:focus-visible + i { outline: 2px solid #3d5a86; outline-offset: 2px; }

.pv-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.pv-seg button { border: 0; background: var(--bg); color: var(--muted); font-size: 11.5px; padding: 4px 10px; cursor: pointer; }
.pv-seg button:hover { color: var(--text); }
.pv-seg button.on { background: rgba(59, 130, 246, .2); color: var(--link-strong); }

.pv-step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.pv-step button { width: 24px; height: 24px; border: 0; background: var(--bg); color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; }
.pv-step button:hover { background: var(--bg-soft2); color: var(--text); }
.pv-step input {
  width: 42px; height: 24px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  background: var(--bg-soft2); color: var(--text); text-align: center; font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.pv-step input:focus { outline: none; background: var(--bg); }

.pv-echo {
  font-size: 11.5px; color: var(--muted); line-height: 1.7;
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; padding: 7px 9px;
}
.pv-warn { font-size: 11.5px; color: var(--warn); line-height: 1.6; }
.pv-tip { font-size: 11px; color: var(--muted); line-height: 1.7; opacity: .85; }

/* 解析失败但原件仍可打印：画布上方一条提示条，点「查看详情」展开完整报错卡。
   卡片走文档流（PDF 原件是内嵌 iframe，浮层会被 iframe 盖住） */
.pv-failwrap { flex: none; margin-bottom: 8px; }
.pv-failbar {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(248, 81, 73, .45); background: rgba(248, 81, 73, .08);
  border-radius: 7px; padding: 5px 9px; font-size: 11.5px;
}
.pv-failbar .dot { width: 7px; height: 7px; border-radius: 50%; background: #f85149; flex: none; }
.pv-failbar b { font-weight: 500; color: var(--err-text); }
.pv-failbar .t {
  color: var(--err-text); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-failbtn { font-size: 11px; padding: 2px 9px; }
.pv-failpop { margin-top: 8px; max-width: 560px; }
.pv-print { margin-top: auto; }
.pv-rot { font-size: 11.5px; padding: 3px 9px; }

@media (max-width: 980px) {
  .pv2-body { flex-direction: column; }
  .pv-stage { min-height: 320px; }
  .pv-panel {
    width: auto; border-left: 0; border-top: 1px solid var(--line);
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  }
  .pv-echo { flex: 1 0 100%; }
  .pv-print { margin-top: 0; margin-left: auto; }
}

/* ================================================================== */
/* 打包下载（pack.js）                                                */
/* ================================================================== */
.pack-box {
  --pack-custom: #c39cf5;   /* 自定义内容 */
  --pack-seq: #56c8c0;      /* 自增序号 */
  width: min(1180px, 100%); max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 24px 64px var(--shadow-strong); overflow: hidden;
}
.pack-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft2);
  flex: none;
}
.pack-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; }
.pack-head-meta { font-size: 11.5px; color: var(--muted); }
.pack-body { flex: 1; min-height: 0; display: flex; }
.pack-left {
  width: 404px; flex: none; overflow: auto;
  padding: 14px 16px 16px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 16px;
}
.pack-sec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.pack-sec-h h3 { margin: 0; font-size: 13px; font-weight: 600; }
.pack-n {
  width: 17px; height: 17px; flex: none; border-radius: 4px;
  display: grid; place-items: center;
  background: rgba(59, 130, 246, .2); color: var(--link); font-size: 10.5px; font-weight: 700;
}
.pack-tip { margin-left: auto; font-size: 11px; color: var(--muted); }

.pack-parts { display: flex; flex-direction: column; gap: 6px; }
.pack-empty {
  font-size: 11.5px; color: var(--muted); padding: 12px 6px; text-align: center;
  border: 1px dashed var(--line); border-radius: 8px;
}
.pack-part {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 7px; border-radius: 7px;
  background: var(--bg-soft2); border: 1px solid var(--line);
  font-size: 12.5px;
}
.pack-part.custom { background: rgba(195, 156, 245, .07); border-color: rgba(195, 156, 245, .28); }
.pack-part.seq { background: rgba(86, 200, 192, .07); border-color: rgba(86, 200, 192, .26); }
.pack-part.dragging {
  opacity: .72; border-style: dashed; border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .4); position: relative; z-index: 3;
  pointer-events: none;   /* 拖动中的行不接指针，elementFromPoint 才能命中下面的行 */
}
.pack-drag {
  width: 15px; height: 22px; flex: none; display: grid; place-items: center;
  color: var(--text-5); cursor: grab; border-radius: 4px; touch-action: none;
}
.pack-drag:hover { color: var(--muted); background: var(--bg-soft); }
body.pack-row-dragging { cursor: grabbing; user-select: none; }
body.pack-row-dragging .pack-drag { cursor: grabbing; }

.pack-part select,
.pack-part input {
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text);
  font: inherit; font-size: 12.5px; padding: 3px 6px; min-width: 0;
}
.pack-part select { flex: 1; }
.pack-part select:focus,
.pack-part input:focus { outline: none; border-color: var(--accent); }
.pack-part .pack-text {
  flex: 1; font-family: ui-monospace, Consolas, monospace;
  color: var(--pack-custom); border-color: rgba(195, 156, 245, .38);
}
.pack-part .pack-digits { flex: 0 0 66px; }
.pack-part .pack-sample {
  width: 152px; flex: none; font-size: 11px; color: var(--muted);
  font-family: ui-monospace, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.pack-part.custom .pack-sample { color: var(--pack-custom); }
.pack-part.seq .pack-sample { color: var(--pack-seq); }
.pack-part .pack-del {
  width: 20px; height: 20px; flex: none; border-radius: 4px;
  display: grid; place-items: center; color: var(--muted);
  border: 1px solid transparent; background: none; cursor: pointer;
}
.pack-part .pack-del:hover { background: var(--err-bg); color: var(--err); }

.pack-add {
  width: 100%; margin-top: 8px; padding: 6px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed var(--line); border-radius: 7px;
  background: none; color: var(--muted); font-size: 12px; cursor: pointer;
}
.pack-add:hover { border-color: rgba(59, 130, 246, .6); color: var(--link); background: var(--accent-bg, rgba(59,130,246,.12)); }

.pack-rule {
  display: flex; align-items: center; gap: 6px; margin: 9px 2px 0;
  font-size: 11px; color: var(--muted); line-height: 1.5;
}
.pack-rule svg { flex: none; opacity: .7; }
.pack-rule b { color: var(--text-2); font-weight: 600; }

.pack-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.pack-preset {
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-soft2); color: var(--muted); cursor: pointer;
}
.pack-preset:hover { border-color: rgba(59, 130, 246, .5); color: var(--link); }
.pack-preset.on { border-color: var(--accent); color: var(--link); background: rgba(59, 130, 246, .14); }

.pack-check {
  display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 7px;
  font-size: 12px; cursor: pointer; border: 1px solid transparent;
}
.pack-check:hover { background: var(--bg-soft2); }
.pack-check input { accent-color: var(--accent); width: 13px; height: 13px; margin-top: 2px; flex: none; cursor: pointer; }
.pack-check span { display: flex; flex-direction: column; gap: 1px; }
.pack-check em { font-style: normal; font-size: 10.5px; color: var(--muted); }

.pack-field { display: flex; flex-direction: column; gap: 5px; padding: 8px 8px 0; }
.pack-field-k { font-size: 11.5px; color: var(--muted); }
.pack-field select {
  border: 1px solid var(--line); border-radius: 7px; background: var(--bg);
  color: var(--text); font: inherit; font-size: 12.5px; padding: 5px 7px;
}
.pack-field select:focus { outline: none; border-color: var(--accent); }

.pack-right { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-inset); }
.pack-right-h {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--bg-soft2); font-size: 12.5px; flex: none;
}
.pack-live {
  font-size: 10.5px; color: var(--ok); border: 1px solid rgba(63, 185, 80, .35);
  background: rgba(63, 185, 80, .1); border-radius: 999px; padding: 0 7px;
}
#packStat { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pack-pv { flex: 1; min-height: 0; overflow: auto; padding: 10px 14px 14px; }

.pack-pv-row {
  display: grid; grid-template-columns: 200px 1fr auto;
  gap: 4px 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.pack-pv-row:last-child { border-bottom: none; }
.pack-pv-row.skip { opacity: .8; }
.pack-pv-src {
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pack-pv-new {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pack-pv-new.muted { color: var(--text-5); font-style: italic; }
.pack-pv-new .pack-dir { color: var(--muted); }
.pack-pv-new .pack-ext { color: var(--muted); }
.pack-pv-badges { display: flex; gap: 5px; }
.pack-badge {
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.pack-badge.ok { color: var(--ok-text); background: rgba(63, 185, 80, .14); border: 1px solid rgba(63, 185, 80, .3); }
.pack-badge.warn { color: var(--warn-text-strong); background: var(--warn-bg); border: 1px solid rgba(210, 153, 34, .32); }
.pack-badge.err { color: var(--err-text); background: var(--err-bg); border: 1px solid rgba(248, 81, 73, .32); }
.pack-pv-notes { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; padding-left: 2px; }
.pack-note {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; line-height: 1.5;
}
.pack-note.ok { color: var(--ok-text); }
.pack-note.warn { color: var(--warn-text-strong); }
.pack-note.err { color: var(--err-text); }
.pack-note svg { flex: none; }

.pack-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-top: 1px solid var(--line); background: var(--bg-soft2);
  flex: none;
}
.pack-foot-hint { font-size: 11.5px; color: var(--muted); }

/* -------- 打包完成 -------- */
.pack-done {
  width: min(620px, 100%); max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 24px 64px var(--shadow-strong); overflow: hidden;
}
.pack-done-head {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft2);
  flex: none;
}
.pack-done-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.pack-done-ico {
  width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(63, 185, 80, .16); color: var(--ok); border: 1px solid rgba(63, 185, 80, .4);
}
.pack-done-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }

.pack-zip {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: 9px;
  background: var(--bg-soft2); border: 1px solid var(--line);
}
.pack-zip-ico {
  width: 34px; height: 34px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: rgba(59, 130, 246, .16); color: var(--link-hover); border: 1px solid rgba(59, 130, 246, .3);
}
.pack-zip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pack-zip-main b {
  font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pack-zip-meta { font-size: 11px; color: var(--muted); }

.pack-done-sub { margin: 14px 0 7px; font-size: 11.5px; color: var(--muted); }
.pack-done-list, .pack-done-skips {
  display: flex; flex-direction: column; gap: 1px;
  border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden;
}
.pack-done-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: var(--bg-soft2); font-size: 12px;
}
.pack-done-row.skip { background: rgba(248, 81, 73, .06); }
.pack-done-tick { flex: none; display: grid; place-items: center; color: var(--ok); }
.pack-done-name {
  flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pack-done-tag {
  flex: none; font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px;
}
.pack-done-why { flex: none; font-size: 11px; color: var(--err-text); }
.pack-done-multi {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 16px 12px; padding: 9px 11px; border-radius: 8px;
  background: var(--warn-bg); border: 1px solid rgba(210, 153, 34, .3);
  color: var(--warn-text-strong); font-size: 11.5px; line-height: 1.5;
}
/* 作者样式里的 display:flex 会盖掉 UA 的 [hidden]{display:none}，必须显式补一条，
   否则没有多票文件时这里会留一条空横条 */
.pack-done-multi[hidden] { display: none; }
.pack-done-multi svg { flex: none; margin-top: 2px; }
.pack-done-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-top: 1px solid var(--line); background: var(--bg-soft2);
  font-size: 11px; color: var(--muted); flex: none;
}

@media (max-width: 1080px) {
  .pack-body { flex-direction: column; overflow: auto; }
  .pack-left { width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .pack-right { min-height: 300px; }
}

/* ================================================================== */
/* 弹层共用头部（原「报销汇总」浮层，汇总已并入 CSV 预览的「分类统计」；  */
/* 这里的 .sum-head 仍被「关于」浮层复用，勿删）                        */
/* ================================================================== */
.sum-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft2);
}
.sum-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.sum-head .meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }


.sum-empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ================================================================== */
/* 开发者信息浮层（与手机版「开发者信息」同口径）                      */
/* 表格行样式挂在 .dev-body 下，避免与其它同名类互相污染               */
/* ================================================================== */
.dev-box {
  width: min(720px, 94vw); max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 24px 64px var(--shadow-strong); overflow: hidden;
}
.dev-body { flex: 1; min-height: 0; overflow: auto; background: var(--bg-thead); }
.dev-body .devk-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 9px 16px; border-bottom: 1px solid var(--tint-3);
  font-size: 12.5px; line-height: 1.6;
}
.dev-body .devk-row:last-child { border-bottom: 0; }
.dev-body .devk-k { flex: none; width: 96px; color: var(--muted); }
.dev-body .devk-v {
  flex: 1; min-width: 0; color: var(--text-2);
  word-break: break-all; font-variant-numeric: tabular-nums;
}

/* 亮白主题的局部变量覆盖：.pack-box 在元素上重定义了打包色，
   根节点的 html[data-theme] 覆盖不到它，只能就近再写一次。 */
html[data-theme="light"] .pack-box {
  --pack-custom: #7c3aed;
  --pack-seq: #0f766e;
}

/* ---------- 主题切换（「关于」弹窗内，1.33.0） ---------- */
.theme-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.theme-label { font-size: 12.5px; color: var(--muted); flex: none; }
.theme-seg {
  display: flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--bg-inset);
}
.theme-seg button {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 12px; line-height: 1;
  padding: 6px 11px; border: 0; background: none;
  color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s;
}
.theme-seg button + button { border-left: 1px solid var(--line); }
.theme-seg button:hover { background: var(--hover); color: var(--text); }
.theme-seg button.on,
.theme-seg button.on:hover { background: var(--accent); color: #fff; }
.theme-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.theme-seg svg { flex: none; }
