:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --text: #16181d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2f6bff;
  --accent-soft: #eaf0ff;
  --ok: #12855b;
  --ok-soft: #e6f6ef;
  --warn: #a86200;
  --warn-soft: #fff5e6;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --panel: #161b22;
    --panel-2: #1b2129;
    --text: #e6e9ef;
    --muted: #8b949e;
    --line: #262d36;
    --accent: #6f9bff;
    --accent-soft: #1b2740;
    --ok: #3fce8f;
    --ok-soft: #10241c;
    --warn: #f0b45e;
    --warn-soft: #2a2113;
    --danger: #ff7b6f;
    --danger-soft: #2c1715;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .5px; }
.brand .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); }
.topnav { display: flex; gap: 4px; font-size: 13px; }
.topnav a { padding: 6px 10px; border-radius: 999px; color: var(--muted); }
.topnav a.on { background: var(--accent-soft); color: var(--accent); }

.topbar-end { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topexit {
  flex: 0 0 auto; padding: 6px 10px; min-height: 28px;
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 12.5px; line-height: 1; cursor: pointer;
}
.topexit:hover { color: var(--text); border-color: var(--muted); }
.topexit:disabled { opacity: .5; }

main { max-width: 760px; margin: 0 auto; padding: 14px 14px calc(84px + var(--safe-bottom)); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tabbar a {
  padding: 10px 0 12px; text-align: center; font-size: 11px;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tabbar a.on { color: var(--accent); }
.tabbar .ico { font-size: 18px; line-height: 1; }

.strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.stat {
  flex: 0 0 auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px; min-width: 96px; box-shadow: var(--shadow);
  position: relative;
}
.stat b { display: block; font-size: 20px; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.warn b { color: var(--warn); }
.stat.ok b { color: var(--ok); }

/* 能点的统计格：点「批缺件」直接去缺件清单，点「批可报销」去可报销清单。
   右下角一个小 ›，鼠标划过边框变色 —— 不然谁也想不到这块是按钮。 */
a.stat {
  display: block; text-decoration: none; color: inherit;
  transition: border-color .15s ease, background .15s ease, transform .06s ease;
}
a.stat::after {
  content: '›'; position: absolute; right: 8px; bottom: 5px;
  font-size: 14px; line-height: 1; color: var(--muted); opacity: .5;
}
a.stat:hover { border-color: var(--accent); background: var(--panel-2); }
a.stat:hover::after { color: var(--accent); opacity: .9; }
a.stat:active { transform: scale(.985); }
/* 正在按这一格筛选：边框常亮，知道自己在看什么 */
a.stat.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
a.stat.on::after { content: '›'; color: var(--accent); opacity: 1; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 12px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.card-body { padding: 12px 14px; }
.card-foot { padding: 10px 14px; border-top: 1px solid var(--line); background: var(--panel-2); }

.row { display: flex; gap: 12px; align-items: flex-start; }
.thumb {
  width: 76px; height: 76px; flex: 0 0 76px; border-radius: 10px;
  background: var(--panel-2); object-fit: cover; border: 1px solid var(--line);
}
.thumb.pdf { display: grid; place-items: center; color: var(--muted); font-size: 26px; }

/* 缩略图整块可点：点开看原文件。以前 img 直接放在行里，点了没反应，
   支付截图上的订单号、发票上的小字都没法核对。 */
.thumbbtn {
  flex: 0 0 auto; padding: 0; border: 0; background: none;
  border-radius: 10px; cursor: zoom-in; -webkit-tap-highlight-color: transparent;
}
.thumbbtn:active .thumb { opacity: .75; }

/* 原文件预览：铺满屏幕。图片默认适应屏幕，点一下切到 2 倍宽看细节；
   PDF 交给浏览器自带的阅读器，底部留一个「新窗口打开」的出口。 */
.lb {
  position: fixed; inset: 0; z-index: 80;
  background: #0b0b0d;
  display: flex; align-items: center; justify-content: center;
  overscroll-behavior: contain;
}
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.lb.zoomed { display: block; overflow: auto; }
.lb.zoomed .lb-img { max-width: none; width: 200%; height: auto; display: block; cursor: zoom-out; }

/* PDF：一张渲染好的页面图 + 底部翻页条。手机浏览器不内嵌 PDF，
   所以这里显示的是服务端画的图，滚动手感跟看照片一样。 */
.lb-stage {
  position: absolute; inset: 0; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  padding: calc(46px + env(safe-area-inset-top)) 8px calc(66px + env(safe-area-inset-bottom));
}
.lb-page {
  max-width: 100%; max-height: 100%; background: #fff; cursor: zoom-in;
  box-shadow: 0 6px 30px rgba(0, 0, 0, .5);
}
.lb.zoomed .lb-stage { display: block; }
.lb.zoomed .lb-page { max-width: none; max-height: none; width: 200%; cursor: zoom-out; }
.lb-doc.lb-loading .lb-stage::after {
  content: "正在渲染这一页…"; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); color: rgba(255, 255, 255, .7); font-size: 13px;
}
.lb-bar {
  position: fixed; z-index: 1; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 4px;
  padding: 4px 6px; border-radius: 999px;
  background: rgba(0, 0, 0, .62); color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
.lb-bar.one { display: none; }
/* 渲染不出来（坏文件/加密 PDF）时的说明，别留一块破图 */
.lb-fail {
  color: #fff; text-align: center; font-size: 14px; line-height: 1.9; padding: 24px;
}
.lb-fail a { color: #9cc0ff; }
.lb-nav {
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 19px; line-height: 1; cursor: pointer;
}
.lb-nav:disabled { opacity: .28; cursor: default; }
.lb-n {
  min-width: 52px; text-align: center; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
/* PDF 的「下载原件」挪到右下角：居中会正好压在发票抬头上 */
.lb-doc .lb-open {
  left: auto; right: 12px; transform: none;
  bottom: calc(16px + env(safe-area-inset-bottom));
}
/* 关闭和出口都用深色药丸：图片常常是白底的手机截图，半透明白底会整块消失 */
.lb-x {
  position: fixed; z-index: 1;
  top: calc(8px + env(safe-area-inset-top)); right: 10px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
.lb-open {
  position: fixed; z-index: 1;
  bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 13px; text-decoration: none; white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
body.lb-on { overflow: hidden; }

.title { font-weight: 650; }
.sub { color: var(--muted); font-size: 13px; }
.tiny { color: var(--muted); font-size: 12px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  /* 「等验收单」这种四字状态在窄屏别被挤成两行 */
  flex: 0 0 auto; white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* 批次列表：手机按状态分组（标题 + 卡片），桌面上标题藏掉、卡片流式折行，
   几张卡都能把一行填满，不会出现「左边一张、右边空半屏」。
   .bstate 是桌面才显示的状态 chip —— 分组标题没了，状态得回到卡片上。
   注意这两条必须写在桌面媒体查询之前，否则会反过来盖掉 display:none。 */
.bgroup { display: flex; align-items: baseline; gap: 8px; margin: 18px 2px 8px; }
.bstate { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; font-size: 14px; font-weight: 550;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.cand { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cand button {
  text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); cursor: pointer;
}
.cand button:active { background: var(--accent-soft); }
.cand .why { color: var(--muted); font-size: 12px; margin-top: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 收件箱顶上那个常驻「新建批次」：按钮和说明并排，手机上说明换行到下面 */
.inbox-new { align-items: center; margin: 4px 0 12px; }
.inbox-new .tiny { flex: 1 1 auto; min-width: 120px; }
.actions form { margin: 0; }

.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

table.items { width: 100%; border-collapse: collapse; font-size: 13px; }
table.items th, table.items td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.items th { color: var(--muted); font-weight: 500; font-size: 12px; }
table.items input { width: 100%; padding: 4px 6px; border: 1px solid transparent; background: transparent; border-radius: 6px; }
table.items input:focus { border-color: var(--accent); background: var(--panel-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.slots { display: grid; gap: 8px; }
.slot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
  /* grid item 默认 min-width:auto，会被右侧的 ⇄ ✕ ＋ 撑破手机屏；这里放开收缩，
     实在放不下就让按钮换行，而不是把卡片顶到屏幕外 */
  min-width: 0; flex-wrap: wrap;
}
.slot.empty { border-style: dashed; }
.slot .n { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; width: 20px; }
.slot .fnames { flex: 1; min-width: 0; }
.slot .fnames a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.muted { color: var(--muted); }


.empty-state { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty-state .big { font-size: 34px; margin-bottom: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(78px + var(--safe-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 999px; font-size: 13px;
  transition: .2s ease; z-index: 60; max-width: 90vw;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: transparent; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; }

.modal {
  position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .45);
  display: none; align-items: flex-end; justify-content: center;
}
.modal.show { display: flex; }
.sheet {
  background: var(--panel); width: 100%; max-width: 520px;
  border-radius: 16px 16px 0 0; padding: 16px 16px calc(20px + var(--safe-bottom));
  max-height: 80vh; overflow: auto;
}
.sheet h3 { margin: 0 0 10px; font-size: 16px; }
.sheet .opt { display: block; width: 100%; text-align: left; padding: 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 8px; cursor: pointer; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 340px; }
.login h1 { font-size: 22px; margin: 0 0 4px; }
.login .hint { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.err { color: var(--danger); font-size: 13px; min-height: 20px; }

.upload-zone {
  border: 2px dashed var(--line); border-radius: 16px; padding: 26px 16px;
  text-align: center; background: var(--panel);
}
.upload-zone .big { font-size: 40px; }
/* 进度条平时收起来，真在上传时才撑开 —— 否则空条像渲染错误 */
.progress {
  height: 0; opacity: 0; margin: 0;
  border-radius: 3px; background: var(--line); overflow: hidden;
  transition: height .16s ease, opacity .16s ease, margin .16s ease;
}
.progress.on { height: 6px; opacity: 1; margin-top: 14px; }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.kv { display: grid; grid-template-columns: 88px 1fr; gap: 4px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }



hr.sep { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* ---- 窄屏（手机竖屏）：数字摊开成网格，表格拆成两行，别再互相挤 ---- */

/* 窄屏（<720px）：底部 tabbar 已经在管导航，顶栏别再摆一套。
   原来两套并存，4 个导航项压到 12px 再挂一个「退出」胶囊，又挤又碎，
   而且「退出」夹在导航后面像第 5 个入口。现在顶栏只留标识 + 退出。 */
@media (max-width: 719px) {
  .topbar { padding: 12px 12px 11px; gap: 8px; }
  .topnav { display: none; }
  /* 退出是动作、不是导航：去掉描边胶囊，改成右侧一段淡字，
     靠 min-height 撑点击区（不缩小可点范围）。 */
  .topexit {
    border: 0; background: none; border-radius: 10px;
    padding: 8px 6px 8px 12px; min-height: 36px;
    font-size: 13px; letter-spacing: .5px;
  }
  .topexit:hover, .topexit:active { color: var(--text); background: var(--panel-2); }
}

/* 统计条默认是横滑条，手机上改成铺满。
   4 项走 2×2；只有 3 项的页面用 .cols3 排一行，别让最后一项跨满整行、右边留一片空。 */
@media (max-width: 560px) {
  .strip {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; overflow: visible; padding-bottom: 10px;
  }
  .stat { min-width: 0; padding: 10px 12px; }
  .stat b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
  .strip.cols3 { grid-template-columns: repeat(3, 1fr); }
  .strip.cols3 .stat { padding: 10px 9px; }
  .strip.cols3 .stat b { font-size: 16px; }
}

/* 加 class="stack" 的表格在手机上换成分组块：
   第一行 账号 + 角色徽章 + 状态徽章，第二行 显示名 + 操作按钮。
   原来 5 列硬塞 304px 会把「管理员」挤成竖排。 */
@media (max-width: 560px) {
  table.stack, table.stack tbody { display: block; }
  table.stack thead { display: none; }
  table.stack tr {
    display: grid; grid-template-columns: 1fr auto auto;
    gap: 6px 8px; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--line);
  }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { display: block; border: 0; padding: 0; }
  table.stack td:nth-child(1) { grid-area: 1 / 1; font-weight: 650; }
  table.stack td:nth-child(2) { grid-area: 2 / 1; color: var(--muted); font-size: 13px; }
  table.stack td:nth-child(3) { grid-area: 1 / 2; }
  table.stack td:nth-child(4) { grid-area: 1 / 3; }
  table.stack td:nth-child(5) { grid-area: 2 / 2 / 3 / 4; justify-self: end; }
}

/* 三列表单：账号 / 显示名 并排，密码独占一行 */
@media (max-width: 560px) {
  .grid3.form-grid { grid-template-columns: 1fr 1fr; }
  .grid3.form-grid > :last-child { grid-column: 1 / -1; }
}

/* 折叠说明：想弄清楚的时候才展开，平时只占一行 */
.guide {
  margin: 0 0 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.guide > summary {
  list-style: none; cursor: pointer; padding: 10px 14px;
  font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::before {
  content: '?'; flex: 0 0 auto;
  width: 16px; height: 16px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1;
  background: var(--panel-2); border: 1px solid var(--line);
}
.guide[open] > summary { color: var(--text); border-bottom: 1px solid var(--line); }
.guide > div { padding: 10px 14px 13px; line-height: 1.85; }
.guide .rule {
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line);
}
.guide code, .tiny code {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 4px; font-size: 12px;
}

/* 收件箱：勾选 + 底部「一起归位」条 */
.pick { flex: 0 0 auto; display: flex; align-items: flex-start; padding: 3px 2px 0 0; }
.pick input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.bulkbar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(78px + var(--safe-bottom));
  display: none; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  padding: 8px 10px; z-index: 55; max-width: 560px; margin: 0 auto;
}
.bulkbar.show { display: flex; }
/* 条一出现就把页面垫高，别压住最后一个按钮 */
body.bulk-on main { padding-bottom: calc(150px + var(--safe-bottom)); }
.bulk-n { flex: 0 0 auto; font-size: 13px; color: var(--muted); }
.bulk-n b { color: var(--text); }
.bulkbar select {
  flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2);
}
.bulkbar .btn { flex: 0 0 auto; }

@media (min-width: 720px) {
  main { padding-bottom: 32px; }
  .tabbar { display: none; }
  .topnav { display: flex; }
}

/* ==========================================================================
   桌面：把「手机一列到底」放开
   760px 的窄栏在 1440 屏上两边各空 340px，卡片、槽位、明细全挤在中间一条。
   这里在 ≥1000px 时换成宽栏 + 分栏：
   - 顶栏内容与主栏左右对齐（原来品牌贴最左、导航贴最右）
   - 统计格均分整行
   - 批次列表 / 收件箱队列 两列
   - 批次详情、上传 左右两栏
   手机上这些容器都是普通 div，不生效。
   ========================================================================== */
@media (min-width: 1000px) {
  main { max-width: 1160px; padding: 22px 24px 48px; }
  /* 主栏内容区 = 1160 - 48 = 1112，顶栏按这个宽度对齐 */
  .topbar { padding-inline: max(24px, calc((100vw - 1112px) / 2)); }

  .strip, .strip.cols3 {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px; overflow: visible; padding-bottom: 14px;
  }
  /* 只有 3 格时别让它们各占 1/3 屏宽 —— 一个数字配 360px 的空卡太散，封在 240 */
  .strip.cols3 { grid-template-columns: repeat(3, minmax(0, 240px)); justify-content: start; }
  .stat { flex: initial; min-width: 0; padding: 13px 16px; border-radius: 14px; }
  .stat b { font-size: 24px; }
  .stat span { font-size: 12.5px; }

  /* 收件箱队列：两列 */
  .icards {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px; align-items: start;
  }
  .icards > .card { margin-bottom: 0; }
  a.card { transition: border-color .15s ease, box-shadow .15s ease; }
  a.card:hover { border-color: var(--accent); box-shadow: 0 2px 4px rgba(16,24,40,.05), 0 12px 28px rgba(16,24,40,.09); }

  /* 批次列表：状态标题让位给卡片上的 chip，卡片按 380px 起折行。
     末尾的 ::after 占一个同宽格子，最后一行只有 1–2 张时不会被拉成整行。 */
  .bgroup { display: none; }
  .bstate { display: inline-flex; }
  .bgrid { display: flex; flex-wrap: wrap; gap: 12px; }
  .bgrid > .card { flex: 1 1 400px; max-width: 100%; margin-bottom: 0; }
  .bgrid::after { content: ''; flex: 1 1 400px; }

  /* 批次详情 / 上传：左右两栏 */
  .detail-grid {
    display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: 14px; align-items: start;
  }
  .detail-grid.upload-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dcol { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
  .dcol > .card, .dcol > details.card { margin-bottom: 0; }

  /* 宽栏里一段中文能拉到 1100px，读起来要来回甩头。正文类给个上限。 */
  .guide > div { max-width: 86ch; }
  main > p.tiny { max-width: 96ch; }
}

/* 大屏再宽一点：主栏更宽，详情页两栏比例再放开一点。
   批次卡片把基准宽度提到 500，1292 的容器装不下三张（3×500+24 > 1292），
   于是稳定成两列、每张 640 —— 批次少的时候不会只剩左边一张、右边空一列。 */
@media (min-width: 1500px) {
  main { max-width: 1340px; }
  .topbar { padding-inline: max(24px, calc((100vw - 1292px) / 2)); }
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; }
  .bgrid > .card, .bgrid::after { flex-basis: 500px; }
}

/* ---------------------------------------------------------------- 投凭证 */
/* 一页只有一个投递口：窄屏通栏，宽屏收在 620 —— 不然三个按钮会在
   1292 的主栏里拉成一排巨块，反而更难点。 */
.up-wrap { max-width: 620px; margin: 0 auto; }
.up-note { margin: 10px 4px 0; line-height: 1.75; }

/* 投完要去哪：有没分拣的就给一条，没有就不占地方 */
.up-pending {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding: 11px 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 13px; color: var(--text);
}
.up-pending b { font-variant-numeric: tabular-nums; }
.up-pending i { font-style: normal; font-weight: 600; color: var(--accent); white-space: nowrap; }
.up-pending:hover { border-color: var(--accent); }

/* 「也可以拖进来」只在有指针的桌面端出现；手机上没有拖放，写了只是废话 */
.up-drop-hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  .up-drop-hint { display: block; margin-top: 10px; text-align: center; }
}

/* 没传出去的那几个必须留痕：拖一整个文件夹最容易混进 .heic、Thumbs.db、
   零字节的截图，静默跳过会让人以为全传完了。 */
.up-skip { margin-top: 10px; font-size: 13px; line-height: 1.7; color: var(--warn); }

/* 拖放浮层：文件进窗口就铺满一屏。pointer-events 必须是 none，
   否则浮层压在指针底下，drop 事件落在浮层上反而到不了页面。 */
.up-veil {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 24px;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.up-veil[hidden] { display: none; }
.up-veil-in {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; max-width: 420px; padding: 30px 20px; text-align: center;
  border: 2px dashed var(--accent); border-radius: 20px;
  background: var(--panel); box-shadow: var(--shadow);
}
.up-veil-ico { font-size: 30px; line-height: 1; color: var(--accent); }
.up-veil-in b { font-size: 17px; }

/* 桌面没有底部 tabbar，批量条贴底就行 */
@media (min-width: 720px) {
  .bulkbar { bottom: 16px; max-width: 640px; }
}

/* ================================================================ 待归 / 口袋
   一堆一行。左边四张缩略图说明「这一堆是什么」，右边是张数。
   不做网格卡片墙：口袋的要点是「按时间排」，网格表达不出先后。 */

.pl-head {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 16px 2px 10px;
}
.pl-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.pl-head h1 { font-size: 19px; font-weight: 680; margin: 0 0 3px; letter-spacing: .3px; }
.pl-head .btn { margin-left: auto; flex: 0 0 auto; }

.pl-note {
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6;
  margin-bottom: 12px;
}
.pl-note b { font-weight: 650; }

.pl-list { display: flex; flex-direction: column; gap: 8px; }

.pl-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; color: inherit;
  transition: border-color .12s, transform .08s;
}
.pl-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.pl-card:active { transform: scale(.995); }
.pl-card.stale { border-left: 3px solid var(--warn); }

.pl-thumbs { display: flex; gap: 3px; flex: 0 0 auto; }
.pl-th {
  width: 42px; height: 42px; border-radius: 7px; object-fit: cover;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--muted);
}
.pl-main { flex: 1 1 auto; min-width: 0; }
.pl-when {
  font-weight: 620; font-size: 14.5px; font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
}
.pl-kinds { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 2px; }
.pl-kinds .chip { font-size: 11.5px; padding: 1px 7px; }
.pl-age { color: var(--warn); }

.pl-go {
  flex: 0 0 auto; text-align: right; min-width: 56px;
  display: flex; flex-direction: column; align-items: flex-end;
}
.pl-go b { font-size: 19px; font-variant-numeric: tabular-nums; color: var(--accent); }
.pl-go span { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------- 工作台 */
.pk { max-width: 1440px; margin: 0 auto; }

.pk-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px 10px; position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.pk-back {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  display: grid; place-items: center; font-size: 16px;
}
/* 删整堆是低频破坏性操作：收成一个方块，别和「逐张过」抢位置 */
.pk-delbtn { padding: 6px 9px; line-height: 1.1; flex: 0 0 auto; }
.pk-id { flex: 1 1 auto; min-width: 0; }
.pk-id .title { font-size: 17px; font-variant-numeric: tabular-nums; }

.pk-note {
  border-radius: 10px; padding: 8px 11px; font-size: 12.5px; line-height: 1.55;
  margin-bottom: 10px;
}
.pk-note.warn {
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
}

.pk-body {
  display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 12px; align-items: start;
}

.pk-cap {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12px; font-weight: 650; color: var(--muted);
  letter-spacing: .4px; margin-bottom: 8px;
}

.pk-left, .pk-right {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 10px 12px;
  position: sticky; top: 56px;
}
.pk-right { display: flex; flex-direction: column; gap: 12px; }
.pk-block + .pk-block { border-top: 1px dashed var(--line); padding-top: 12px; }

.pk-files { display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow: auto; }
.pk-file {
  display: flex; gap: 8px; align-items: flex-start; padding: 7px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); cursor: pointer; position: relative;
  transition: border-color .1s, background .1s;
}
.pk-file:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.pk-file.on { border-color: var(--accent); background: var(--accent-soft); }
.pk-file.bad { border-style: dashed; }
.pk-file.dragging { opacity: .5; }

.pk-x {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 24px; height: 24px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: var(--panel); color: var(--muted);
  font-size: 12px; line-height: 1; cursor: pointer;
}
.pk-x:hover { background: var(--danger-soft); color: var(--danger); }

.pk-pick { position: absolute; top: 4px; left: 4px; z-index: 2; }
.pk-pick input { width: 16px; height: 16px; }

.pk-thumb {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 7px;
  overflow: hidden; background: var(--panel); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 10px; color: var(--muted);
}
.pk-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pk-meta { flex: 1 1 auto; min-width: 0; }
.pk-kind { font-size: 13px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pk-kind .chip { font-size: 10.5px; padding: 1px 6px; font-weight: 500; }
.pk-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-why { color: var(--danger); line-height: 1.4; }

.pk-mid {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; min-height: 420px;
}
.pk-stage {
  flex: 1 1 auto; display: grid; place-items: center; padding: 12px;
  background: var(--panel-2); min-height: 360px; overflow: auto;
}
.pk-shot { max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: 6px; }
.pk-hint { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.9; }
.pk-hint .big { font-size: 30px; opacity: .5; }

.pk-midbar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-top: 1px solid var(--line); background: var(--panel);
}
.pk-midbar .grow { flex: 1 1 auto; }
.pk-midbar .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; }
.pk-slotpick { display: inline-flex; align-items: center; gap: 6px; }
.pk-slotpick select {
  font: inherit; font-size: 12.5px; padding: 4px 6px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}

/* 建批窗口里「这几张还没认出是哪种票」—— 就地挑一格，或先留在待归 */
.tb-where { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.tb-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px;
  background: var(--panel-2);
}
.tb-th {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 6px; object-fit: cover;
  background: var(--panel); border: 1px solid var(--line);
}
.tb-th.pdf {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .5px;
}
.tb-nm {
  flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-row select {
  flex: 0 0 auto; font: inherit; font-size: 12.5px; padding: 4px 6px;
  border-radius: 7px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text);
}

.pk-cands { display: flex; flex-direction: column; gap: 6px; }
.pk-cand {
  text-align: left; font: inherit; color: var(--text); cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 10px; padding: 8px 10px;
}
.pk-cand b { font-size: 13px; font-weight: 620; display: block; }
.pk-cand .why { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.pk-cand:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.pk-cand.on { border-color: var(--accent); background: var(--accent-soft); }
.pk-cand.over { border-color: var(--accent); border-style: dashed; background: var(--accent-soft); }

.pk-slotmap { display: flex; flex-direction: column; gap: 2px; }
.pk-slotrow {
  display: flex; align-items: baseline; gap: 8px; font-size: 12.5px;
  padding: 3px 0;
}
.pk-slotrow .k { font-variant-numeric: tabular-nums; color: var(--muted); width: 18px; }
.pk-slotrow .v { flex: 1 1 auto; }
.pk-slotrow .n { font-variant-numeric: tabular-nums; font-weight: 620; }
.pk-slotrow.off { color: var(--muted); opacity: .55; }

/* 勾选后的底部条（复用批量条的观感，但只在有选中时出现） */
.pk-bar {
  position: fixed; left: 50%; transform: translate(-50%, 130%);
  bottom: calc(76px + var(--safe-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 20px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 10px 8px 16px;
  box-shadow: var(--shadow); transition: transform .18s;
}
/* 底条上那行字不折行：折了会把圆角条顶成两截，还压到 tabbar 上 */
.pk-bar .btn, .pk-bar .tiny { white-space: nowrap; }
.pk-bar.show { transform: translate(-50%, 0); }

@media (min-width: 1100px) {
  .pk-bar { bottom: 24px; }
}

/* ---------------------------------------------------------------- 手机：单列 */
@media (max-width: 1099px) {
  .pk-body { grid-template-columns: minmax(0, 1fr); }
  .pk-left, .pk-right { position: static; }
  .pk-files {
    flex-direction: row; overflow-x: auto; max-height: none;
    padding-bottom: 4px; scroll-snap-type: x mandatory;
  }
  /* 卡片宽度跟不上内容：以前写死 flex-basis:148px，但 flex 项的 min-width 默认
     是 min-content —— 一张 PDF 的摘要里带着二十位订单号，撑到 300 多，
     卡片就顶破左边那栏，缩略图跟着拉成一条。这里给宽封顶、允许内容换行。 */
  .pk-file {
    flex: 0 0 auto;
    width: min(46vw, 168px);
    min-width: 0;
    flex-direction: column; scroll-snap-align: start;
    /* 横排时 align-items:flex-start 会让竖排的子项缩到内容宽 ——
       标题那行只剩 100px，被 chip 挤成两行。竖排要撑满卡片。 */
    align-items: stretch;
    overflow: hidden;
  }
  /* 只有一张时铺满，别在右边留一段空 */
  .pk-file:only-child { flex: 1 1 auto; width: auto; }

  /* 缩略图跟着卡片走：宽 100%，高度按比例，不再写死 86px。
     高度上限留在 150 —— 一张只有「PDF」三个字的空图，铺满 200 多的高度太占屏。 */
  .pk-thumb {
    width: 100%; height: auto; aspect-ratio: 4 / 3;
    max-height: 150px; flex: 0 0 auto;
    background: var(--panel-2); border-style: solid;
  }
  .pk-thumb span { font-size: 11px; letter-spacing: 1px; opacity: .75; }
  /* 勾选框压在图上：给一层浅底，不然白框落在白底上看不见 */
  .pk-pick {
    background: color-mix(in srgb, var(--panel) 86%, transparent);
    border-radius: 5px; padding: 1px 2px; line-height: 0;
  }
  .pk-sum {
    white-space: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .pk-x { width: 22px; height: 22px; font-size: 11px; }

  /* 320 这类窄屏：标题被两个按钮挤成两行、按钮自己也折行。
     按钮不折，左右内边距收紧一点，把宽度让给日期。 */
  .pk-head { gap: 8px; }
  .pk-head .btn { white-space: nowrap; }
  /* 副标题（这一堆 N 张 · 发票 N）只占一行，窄屏上折成两截比省略号更乱 */
  .pk-id .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* 手机上大图不占版面：点一张图，全屏盖上看，再点一下关掉 */
  .pk-mid { display: none; }
  body.pk-preview .pk-mid {
    display: flex; position: fixed; inset: 0; z-index: 60;
    border-radius: 0; border: 0; background: #000;
  }
  body.pk-preview .pk-stage { min-height: 0; padding: 0; background: #000; }
  body.pk-preview .pk-shot { max-height: 100vh; }
  body.pk-preview .pk-midbar {
    background: rgba(0,0,0,.72); border: 0; color: #fff;
  }
  body.pk-preview .pk-midbar .tiny { color: #ddd; }
  body.pk-preview .pk-slotpick select { background: #222; color: #eee; border-color: #444; }
}

/* 320 这类小屏：标题让位给两个按钮，字号收一档 */
@media (max-width: 400px) {
  .pk-id .title { font-size: 15px; }
  .pk-head .btn.sm { padding: 6px 8px; }
}

/* 口袋页不留底部大面积空白：tabbar 已经占了一截 */
.page-pool main { padding-bottom: 84px; }
@media (min-width: 720px) {
  .page-pool main { padding-bottom: 40px; }
}

/* ---------------------------------------------------------------- 补验收单 */
.ac-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px 10px;
}
.ac-list { display: flex; flex-direction: column; gap: 6px; }

.ac-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; cursor: pointer;
}
.ac-row:has(.ac-pick:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ac-pick { width: 18px; height: 18px; flex: 0 0 auto; }
.ac-main { flex: 1 1 auto; min-width: 0; }
.ac-code { font-size: 13.5px; font-weight: 620; }
.ac-main .tiny { margin-top: 2px; line-height: 1.5; }
.ac-one { flex: 0 0 auto; }

.ac-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(76px + var(--safe-bottom)); z-index: 40;
  width: min(680px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow);
}
.ac-bar-info { flex: 1 1 auto; min-width: 0; font-size: 13px; }
.ac-bar-info .tiny { display: block; margin-top: 1px; }
@media (min-width: 720px) {
  .ac-bar { bottom: 20px; }
}

/* ---------------------------------------------------------------- 逐张过（口袋的单张模式） */
.po { max-width: 680px; margin: 0 auto; }

.po-rail { display: flex; align-items: center; gap: 10px; margin: 0 2px 8px; }
.po-n {
  flex: 0 0 auto; font-size: 13px; font-weight: 620; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.po-strip {
  flex: 1 1 auto; min-width: 0; display: flex; gap: 6px;
  overflow-x: auto; padding-bottom: 2px;
}
.po-th {
  flex: 0 0 auto; width: 42px; height: 42px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--panel-2); color: var(--muted); font-size: 10px;
  overflow: hidden;
}
.po-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.po-th.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.po-th.skip { opacity: .45; }

.po-stage {
  display: flex; align-items: center; justify-content: center;
  height: min(40vh, 340px); overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
}
.po-shot { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.po-meta { margin: 10px 2px 0; }
.po-kinds {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px;
}
.po-kcap { color: var(--muted); margin: 0 0 6px; display: block; }
.po-kind {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 2px; font-size: 11.5px; line-height: 1.25;
  color: var(--muted); cursor: pointer; text-align: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
}
.po-kind b { font-weight: 620; font-variant-numeric: tabular-nums; }
.po-kind.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.po-kind.on b { color: var(--accent); }
.po-kind.loose { opacity: .72; }
.po-meta .tiny { display: block; margin-top: 8px; line-height: 1.5; }

.po-cands { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.po-ccap { font-size: 12.5px; font-weight: 620; color: var(--muted); margin-bottom: 2px; }
.po-cand {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 11px 12px; color: inherit; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.po-cand.on { border-color: var(--accent); background: var(--accent-soft); }
.po-k {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted); background: var(--panel-2);
}
.po-cmain { flex: 1 1 auto; min-width: 0; }
.po-cmain b { display: block; font-size: 13.5px; font-weight: 620; }
.po-cmain i {
  display: block; font-style: normal; font-size: 12px;
  color: var(--muted); margin-top: 2px;
}
.po-tag {
  flex: 0 0 auto; font-size: 11px; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 2px 6px;
}
.po-hint { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 2px 0; }

.po-more { display: flex; gap: 8px; margin-top: 10px; }
.po-more select { flex: 1 1 auto; min-width: 0; }
/* display:flex 会盖掉 [hidden] 的 display:none —— 不写这条，下拉一直是展开的 */
.po-more[hidden], .po-done[hidden], #po-body[hidden] { display: none; }

.po-foot { display: flex; gap: 8px; margin-top: 14px; }
.po-foot .btn { flex: 1 1 0; justify-content: center; color: inherit; }

.po-done { text-align: center; padding: 44px 0; color: var(--muted); }
.po-done .big { font-size: 34px; color: var(--accent); margin-bottom: 6px; }

/* ---------------------------------------------------------------- 连拍（04 实物图） */
/* 连拍页的抬头要把批次名写全：一行放不下就折两行，不要「3D打印机喷头 陶…」 */
.sh .pk-id .tiny {
  white-space: normal; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.sh-count {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 2px 2px 16px;
}
.sh-n { display: flex; align-items: baseline; gap: 4px; }
.sh-count b {
  font-size: 40px; line-height: 1; font-weight: 620;
  font-variant-numeric: tabular-nums; color: var(--accent);
}
.sh-count .u { font-size: 14px; color: var(--muted); }
.sh-count .tiny { line-height: 1.4; }

.sh-shot {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 30px 16px;
  background: var(--panel); color: inherit;
  border: 1.5px dashed var(--line-strong, var(--line));
  border-radius: 18px; cursor: pointer;
}
.sh-shot:active { background: var(--panel-2); }
.sh-ico {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--accent);
  background: var(--accent-soft);
}
.sh-t { font-size: 16px; font-weight: 620; }
.sh-shot .tiny { color: var(--muted); }

.sh-picks {
  display: flex; gap: 8px; overflow-x: auto;
  margin-top: 14px; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.sh-picks:empty { display: none; }
.sh-pick-th {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 10px;
  overflow: hidden; border: 1px solid var(--line); background: var(--panel-2);
}
.sh-pick-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-pick-th.bad { border-color: #d9534f; opacity: .55; }

.sh-note { margin: 12px 2px 0; line-height: 1.5; color: var(--muted); }
.sh-note.err { color: #c0392b; }
.sh-foot { display: flex; gap: 8px; margin-top: 16px; }
.sh-foot .btn { flex: 1 1 0; justify-content: center; color: inherit; }

/* ---------------------------------------------------------------- 待收尾 */
.tw {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 14px; overflow: hidden;
}
.tw-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.tw-title { font-size: 13.5px; font-weight: 650; }

/* 「其他批次 / 全部批次」这一行：跟上面「待收尾」的标题同一个调子 */
.bcap {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 2px 2px 8px; font-size: 13px; font-weight: 650; color: var(--muted);
  letter-spacing: .3px;
}

.tw-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; color: inherit; border-top: 1px solid var(--line);
}
.tw-row:first-of-type { border-top: 0; }
.tw-row:hover { background: var(--panel-2); }

.tw-cells { display: flex; gap: 3px; flex: 0 0 auto; }
.tw-cell {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 10.5px; font-variant-numeric: tabular-nums;
  /* 默认灰：还没到的格子不能默认红，更不能默认绿（绿 = 这一格不用管了） */
  background: var(--panel-2); color: var(--muted);
}
.tw-cell.ok { background: var(--ok-soft); color: var(--ok); }
.tw-cell.missing { background: var(--danger-soft); color: var(--danger); }
.tw-cell.derived { background: var(--ok-soft); color: var(--ok); }
.tw-cell.optional { background: transparent; color: var(--muted); }

.tw-main { flex: 1 1 auto; min-width: 0; }
.tw-code {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tw-main .tiny { margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tw-act {
  flex: 0 0 auto; font-size: 12.5px; font-weight: 600; color: var(--accent);
  white-space: nowrap;
}
.tw-act.warn { color: var(--warn); }

@media (max-width: 560px) {
  .tw-cell { width: 19px; height: 19px; font-size: 10px; }
  .tw-row { gap: 8px; padding: 9px 10px; }
  .tw-act { font-size: 12px; }
  /* 下面那摞卡片不再重复这些批，行里就得看得全：标题两行、说明允许换行，
     否则 320 上「还缺 验收单 · ￥432.16」会被截成「￥…」。 */
  .tw-code {
    white-space: normal; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .tw-main .tiny { white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
}

/* 琥珀色按钮：用于「仍然打包（缺 N 项）」这类需要人明确认下的动作 */
.btn.warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
  color: var(--warn);
}
.btn.warn[disabled] { opacity: .45; }

/* ================================================================ 批次内页：门厅
   只有一套：门厅 + 一层一层的抽屉（.bd + .ly）。手机与桌面同一份 ——
   以前桌面还有一套「一笔一张卡」的卡片墙，同一件事写两遍，改一处忘一处。
   main 本身 760px 封顶，门厅在那个宽度里正好；层在宽屏上加宽、抬离底边。 */
.bd { display: block; margin: 2px 0 12px; }

/* 门厅顶条：返回 + 标题 + 状态。App 里没有刷新键，返回手势要能回去。 */
.bm-bar { display: flex; align-items: center; gap: 8px; padding: 0 0 10px; }
.bm-back {
  width: 36px; height: 36px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 11px; background: var(--panel);
  color: var(--text); font-size: 22px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.bm-back:active { background: var(--panel-2); }
.bm-t { flex: 1 1 auto; min-width: 0; }

/* 名字。点一下就能改 —— PC 用鼠标、手机用指头，走的是同一段脚本。
   两行截断留给里面的 span：外层要放铅笔和输入框，自己不能被 -webkit-box 管住。
   宽度收到文字上（fit-content），铅笔才贴着名字尾巴；撑满整行的话，短名字会让
   铅笔孤零零飘在右边，谁也不知道它跟名字是一伙的。 */
.bm-title {
  position: relative; padding-right: 16px; cursor: pointer; border-radius: 4px;
  width: -webkit-fit-content; width: fit-content; max-width: 100%;
}
.bm-title-t {
  font-size: 15px; font-weight: 680; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.bm-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* display:-webkit-box 的优先级压过 [hidden] 自带的那条 display:none，
   编辑时原文字必须显式藏起来，否则会跟输入框上下各来一遍。 */
.bm-title-t[hidden] { display: none; }
/* 铅笔常显（淡），手机上没 hover 也看得出这里能点；桌面上指过去会加深。
   用线性图标而不是 ✎ 这个字符：系统字体给它的形状、粗细、基线都不靠谱。 */
.bm-pen {
  position: absolute; right: 0; bottom: 2px;
  width: 12px; height: 12px;
  color: var(--muted); opacity: .6; pointer-events: none;
}
.bm-title:hover .bm-pen, .bm-title:focus-visible .bm-pen { opacity: 1; }
.bm-title.editing { padding-right: 0; cursor: default; width: auto; }
.bm-title.editing .bm-pen { display: none; }
.bm-title-in {
  display: block; width: 100%; box-sizing: border-box;
  font: inherit; font-size: 15px; font-weight: 680; line-height: 1.3;
  color: var(--text); background: var(--bg);
  padding: 3px 7px; margin: 0;
  border: 1px solid var(--accent); border-radius: 8px;
  resize: none; overflow: hidden;   /* 高度由脚本按内容给，长名字自己换行 */
}
.bm-title-in:focus { outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
.bm-title-in:disabled { color: var(--muted); }
/* iOS 上输入框字号小于 16px 会连页面一起放大，手机上编辑态大 1px 换不跳。 */
@media (max-width: 640px) { .bm-title-in { font-size: 16px; } }

/* 标题下面那行：编号 · 归属人。管理员这一处是下拉（原生控件，手机上弹系统
   选择器，比自造浮层稳）；平时看着仍是一行小字，虚线下划线说明它可点。 */
.bm-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; }
.bd-owner { position: relative; display: inline-flex; align-items: center; max-width: 60%; }
.bd-owner select {
  -webkit-appearance: none; appearance: none;
  max-width: 100%; padding: 1px 12px 1px 2px; margin: 0;
  font: inherit; font-size: 12px; line-height: 1.4;
  color: var(--text); background: transparent;
  border: 0; border-bottom: 1px dashed var(--line); border-radius: 0;
  text-overflow: ellipsis; cursor: pointer;
}
.bd-owner select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.bd-owner select:disabled { color: var(--muted); }
.bd-owner::after {
  content: ''; position: absolute; right: 3px; top: 50%; margin-top: -3px;
  border-left: 3px solid transparent; border-right: 3px solid transparent;
  border-top: 4px solid var(--muted);
  pointer-events: none;
}

.bd-sum {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.bd-sum .s { padding: 10px 8px; text-align: center; border-left: 1px solid var(--line); }
.bd-sum .s:first-child { border-left: 0; }
.bd-sum b {
  display: block; font-size: 16px; font-weight: 680;
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.bd-sum i { font-style: normal; font-size: 11px; color: var(--muted); }
.bd-sum .warn b { color: var(--warn); }

.bd-sec {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-top: 8px; overflow: hidden;
}
.bd-cap {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 9px 12px; font-size: 12.5px; font-weight: 650; color: var(--muted);
  background: var(--panel-2); border-bottom: 1px solid var(--line);
}

/* 每一件东西都是一扇门：点开它所属的那一笔 */
.bd-item {
  display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: center;
  width: 100%; padding: 10px 12px; text-align: left; font: inherit; color: var(--text);
  background: transparent; border: 0; border-top: 1px solid var(--line); cursor: pointer;
}
.bd-item:first-of-type { border-top: 0; }
.bd-item:active { background: var(--panel-2); }
.bd-n { grid-column: 1; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.bd-n.muted { color: var(--muted); font-weight: 500; }
.bd-item .tiny { grid-column: 1; margin-top: 2px; line-height: 1.45; }
/* 名字下面那一行：这一件花了多少，后面跟着规格 / 几件 */
.bd-sub {
  grid-column: 1; display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 2px 8px; margin-top: 3px; min-width: 0;
}
.bd-sub b {
  font-size: 13px; font-weight: 680; line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.bd-sub b.none { color: var(--muted); font-weight: 500; font-size: 12px; }
.bd-sub .tiny { margin-top: 0; min-width: 0; }
.bd-item > i {
  grid-column: 2; grid-row: 1 / span 2;
  font-style: normal; color: var(--muted); font-size: 15px;
}

.bd-slot {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  background: transparent; border: 0; border-top: 1px solid var(--line);
  padding: 11px 12px;
}
.bd-slot:first-of-type { border-top: 0; }
.bd-slot:active { background: var(--panel-2); }
.bd-slot .k {
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 7px;
  display: grid; place-items: center;
  font-size: 11px; font-variant-numeric: tabular-nums;
  /* 默认不是绿的：还没到的格子涂绿，就是在替这一格说「齐了」。
     绿给 ok（含 01 的「整理」，都不挡打包），红给 missing，灰给 optional。 */
  background: var(--panel-2); color: var(--muted);
}
.bd-slot.ok .k { background: var(--ok-soft); color: var(--ok); }
.bd-slot .v { flex: 1 1 auto; font-size: 13.5px; }
.bd-slot .v i { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 6px; }
.bd-slot .n { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bd-slot.missing .k { background: var(--danger-soft); color: var(--danger); }
.bd-slot.missing .n { color: var(--danger); font-weight: 650; }
/* 01 整理出来的：算「有着落」（不挡打包），所以颜色跟 ok 一样用绿，
   只在右边写「整理」，别让「2 / 5」跟绿色格数对不上 */
.bd-slot.derived .k { background: var(--ok-soft); color: var(--ok); }
.bd-slot.derived .n { color: var(--ok); font-weight: 600; }
.bd-slot.optional .k { background: transparent; color: var(--muted); }
.bd-slot.optional .v,
.bd-slot.optional .n { color: var(--muted); }
.bd-slot::after { content: "›"; color: var(--muted); margin-left: 4px; font-size: 15px; }

/* 三扇门：交易 / 资料 / 收尾 */
.bd-nav {
  margin-top: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.bd-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px; font: inherit; color: var(--text); text-align: left;
  background: transparent; border: 0; border-top: 1px solid var(--line); cursor: pointer;
}
.bd-row:first-child { border-top: 0; }
.bd-row:active { background: var(--panel-2); }
.bd-row .k { flex: 0 0 auto; font-size: 13.5px; font-weight: 650; }
.bd-row .v {
  flex: 1 1 auto; min-width: 0; text-align: right; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bd-row.warn .v { color: var(--danger); }
.bd-row > i { flex: 0 0 auto; font-style: normal; color: var(--muted); }


/* ================================================================ 层
   一整页高的抽屉：顶部返回条固定，中间滚动，底部动作固定。
   高度用 dvh —— 手机上地址栏收起/展开时 92vh 会把底部的按钮顶出去。 */
body.ly-open { overflow: hidden; }

.ly {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
}
/* 模板里静态写着、平时 hidden 的层：得压住上面那条 .ly{display:flex} */
.ly[hidden] { display: none; }
.ly-veil {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity .2s ease;
}
.ly.in .ly-veil { opacity: 1; }

.ly-panel {
  position: relative; width: 100%; max-width: 560px;
  height: 92dvh; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--panel); border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow); overflow: hidden;
  transform: translateY(100%);
  transition: transform .22s cubic-bezier(.22, .9, .3, 1), opacity .18s;
}
.ly.in .ly-panel { transform: translateY(0); }
/* 下面还有一层时，上面这层退后半步 —— 一眼看出「返回」是回到哪 */
.ly.under .ly-panel { transform: translateY(-10px) scale(.985); opacity: .72; }

/* 短表单用的层：内容多高就多高，别为五个字段撑满一整屏 */
.ly-panel.nb { height: auto; max-height: 88dvh; }
.ly-panel.nb .ly-body { padding-bottom: 8px; }

.ly-top {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.ly-back {
  width: 36px; height: 36px; flex: 0 0 auto; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); font-size: 24px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.ly-back:active { background: var(--panel-2); }
.ly-tt { flex: 1 1 auto; min-width: 0; padding-right: 6px; }
.ly-tt b {
  display: block; font-size: 15.5px; font-weight: 680; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ly-tt .tiny {
  display: block; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ly-body {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; padding: 0 12px 20px;
}
.ly-foot {
  flex: 0 0 auto; padding: 10px 12px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line); background: var(--panel);
}
.ly-foot .btn.block { text-align: center; }
.ly-foot .btn.block + .btn.block { margin-top: 8px; }

.ly-sec { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.ly-sec:last-child { border-bottom: 0; }
/* 这一批不需要的格子（对公转账的 03）：整段淡下去，别看着像还欠着东西 */
.ly-sec.ly-off .ly-cap { color: var(--muted); font-weight: 600; }
.ly-cap {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; font-size: 12px; font-weight: 650; color: var(--muted);
}

/* 一份文件：缩略图、名字、票号金额，右边是「⋯」 */
.ly-f { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.ly-th {
  width: 46px; height: 46px; flex: 0 0 auto; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2);
  color: var(--muted); font-size: 10px; cursor: zoom-in;
  display: grid; place-items: center;
}
.ly-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ly-fn {
  flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: transparent;
  color: var(--text); text-align: left; font-size: 13px; font-weight: 600; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: zoom-in;
}
.ly-fm {
  flex: 0 0 auto; max-width: 38%; text-align: right;
  font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ly-dots {
  flex: 0 0 auto; width: 30px; height: 30px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel-2); color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer;
}

/* 物品行：名字一整行，规格/数量/单价/金额四格并排 */
.ly-items { display: flex; flex-direction: column; gap: 10px; }
.ly-item { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.li-top { display: flex; align-items: center; gap: 8px; }
.li-name {
  flex: 1 1 auto; min-width: 0; padding: 3px 0;
  border: 0; border-bottom: 1px dashed var(--line); background: transparent;
  font-size: 14px; font-weight: 600;
}
.li-name:focus { outline: none; border-bottom-color: var(--accent); }
.li-del {
  flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 13px; cursor: pointer;
}
.li-del:active { background: var(--panel); color: var(--danger); }
.li-grid { display: grid; grid-template-columns: 1.2fr .8fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.li-grid label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.li-grid i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.li-grid input {
  width: 100%; min-width: 0; padding: 5px 6px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel);
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.li-grid input:focus { outline: none; border-color: var(--accent); }

.ly-add { margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.ly-add .na-name {
  width: 100%; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
}
.ly-add .na-name:focus { outline: none; border-color: var(--accent); }
.ly-add .btn { margin-top: 8px; }

/* 订单号：号码能整段选中复制 */
.ly-ono { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.ly-ono i { flex: 0 0 auto; font-style: normal; color: var(--muted); }
.ly-ono b, .ly-ono em {
  font-style: normal; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere; user-select: all; -webkit-user-select: all;
}
.ly-ono em { font-size: 12px; color: var(--muted); }

/* 交易列表的一行 */
.ly-t {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 2px; font: inherit; color: var(--text); text-align: left;
  background: transparent; border: 0; border-top: 1px solid var(--line); cursor: pointer;
}
.ly-t:first-of-type { border-top: 0; }
.ly-t:active { background: var(--panel-2); }
.ly-tno {
  flex: 0 0 auto; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; color: var(--accent); background: var(--accent-soft);
}
.ly-tmain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ly-tmain b {
  font-size: 13.5px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ly-t > i { flex: 0 0 auto; font-style: normal; color: var(--muted); }

/* 说明卡 / 空态 / 输入 */
.ly-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.ly-card b { font-size: 13px; }
.ly-card p { margin: 6px 0 0; }
.ly-fw { padding: 2px 0 6px; }
.ly-fw + .ly-fw { border-top: 1px dashed var(--line); padding-top: 8px; }
.ly-forders { margin: 0 0 2px 56px; }
.ly-hint { margin: 6px 0 2px; color: var(--muted); line-height: 1.6; }
.li-src {
  margin-top: 6px; font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ly-empty { margin: 0; padding: 16px 0; text-align: center; color: var(--muted); font-size: 12.5px; }
.ly-inline { display: flex; align-items: center; gap: 8px; }
.ly-inline span { color: var(--muted); }
.ly-inp {
  flex: 1 1 auto; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  font-variant-numeric: tabular-nums;
}
.ly-inp:focus { outline: none; border-color: var(--accent); }

.ly-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ly-chip {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text); font-size: 12.5px; cursor: pointer;
}
.ly-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ly-chip.danger {
  border-color: transparent; background: var(--danger-soft); color: var(--danger); font-weight: 650;
  cursor: default;
}

.ly-danger {
  width: 100%; padding: 11px; border-radius: 10px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  background: var(--danger-soft); color: var(--danger);
  font-size: 13.5px; font-weight: 650;
}

/* 收尾的动作：一行一个，拇指从上往下点 */
.ly-act {
  display: block; width: 100%; margin-top: 8px; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
}
.ly-act:first-child { margin-top: 0; }
.ly-act.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ly-act.warn {
  background: var(--warn-soft); color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
}
.ly-act.danger {
  background: var(--danger-soft); color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}
.ly-act[disabled] { opacity: .45; cursor: default; }
.ly-check {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 2px 4px; font-size: 13px; color: var(--muted);
}
.ly-check input { width: 18px; height: 18px; accent-color: var(--warn); }
.ly-ok { margin: 0; color: var(--ok); font-size: 13.5px; font-weight: 650; }

/* 表单 */
.ly-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ly-field i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.ly-field input, .ly-field select, .ly-field textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--panel); font-size: 14px;
}
.ly-field input:focus, .ly-field select:focus, .ly-field textarea:focus {
  outline: none; border-color: var(--accent);
}
.ly-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ly-ta {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--panel); font-size: 13px; line-height: 1.7;
}
.ly-ta:focus { outline: none; border-color: var(--accent); }
.ly-up { margin-top: 8px; }

/* 宽屏：层不再贴着手机那样通栏，加宽一点、抬离底边；门厅也有 hover 反馈 */
@media (min-width: 720px) {
  .ly { align-items: center; }
  /* 宽屏上内容多长就多高：硬撑 86vh 会把两行交易晾在一大片空白里 */
  .ly-panel {
    max-width: 680px; height: auto; max-height: 86vh;
    border-radius: 16px;
  }
  .ly-body { min-height: 120px; }
  .bm-back:hover, .bd-item:hover, .bd-slot:hover, .bd-row:hover { background: var(--panel-2); }
  .bd-item > i, .bd-row > i, .bd-slot::after { transition: transform .12s ease; }
  .bd-item:hover > i, .bd-row:hover > i, .bd-slot:hover::after { transform: translateX(2px); }
}

/* ================================================================ 管理区：台账
   概览页只放数字，点进去才是清单。三个清单（批次 / 文件 / 收件箱）共用这一套：
   一个页签条、一行筛选（搜索 + 状态 chip）、一张只读表。
   管理页不做删除 —— 删文件、删口袋都在业务页面里做，这里只负责查得到。 */
.adm-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px;
  scrollbar-width: none;
}
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs a {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.adm-tabs a:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--text); }
.adm-tabs a.on {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}

.adm-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.adm-search { display: flex; gap: 6px; flex: 1 1 240px; }
.adm-search input {
  flex: 1 1 auto; min-width: 0; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); font-size: 13px; color: var(--text);
}
.adm-search input:focus { outline: none; border-color: var(--accent); }

.adm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.adm-chips a.chip { text-decoration: none; }
.adm-chips a.chip.on { box-shadow: inset 0 0 0 1px currentColor; font-weight: 600; }

/* 表格自己横向滚，别把卡片顶破；手机上给个下限宽度，几列不至于挤成竖排 */
.adm-tbl { overflow-x: auto; }
table.adm { width: 100%; border-collapse: collapse; font-size: 13px; }
table.adm th, table.adm td {
  padding: 8px; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top;
}
table.adm th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
table.adm tr:last-child td { border-bottom: 0; }
table.adm td.num, table.adm th.num {
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.adm td a { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--line); }
table.adm td a:hover { color: var(--accent); border-bottom-color: var(--accent); }
table.adm td .tiny { margin-top: 2px; }
table.adm td .chip { margin-left: 4px; }

@media (max-width: 719px) {
  table.adm { min-width: 600px; }
  /* 横向滚的时候第一列钉住：滑到右边看金额，也知道自己在看哪一条 */
  table.adm th:first-child, table.adm td:first-child {
    position: sticky; left: 0; z-index: 1;
    background: var(--panel); box-shadow: 1px 0 0 var(--line);
  }
}

/* 「管理员」「小杨」这种两三个字的单元格别被挤成竖排 */
table.adm td.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- 核对请购单 */
/* 一页把原件和认出来的结果摆在一起：宽屏左右两栏，窄屏原件在上、表单在下。
   这一页比别的页要宽 —— 一张 A4 的请购单挤在 760 里，右边的字就看不清了。 */
body.page-confirm main { max-width: 1040px; padding-bottom: calc(118px + var(--safe-bottom)); }

.cf-grid {
  display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
  gap: 14px; align-items: start;
}
.cf-doc, .cf-form {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px 14px;
}
.cf-doc { position: sticky; top: 58px; }
.cf-cap {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 8px;
}
.cf-cap .tiny { font-weight: 400; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cf-shot {
  display: block; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--panel-2);
}
.cf-shot img { display: block; width: 100%; max-height: 64vh; object-fit: contain; }
.cf-empty {
  padding: 14px 12px; border: 1px dashed var(--line); border-radius: 10px;
  font-size: 12.5px; line-height: 1.6; color: var(--muted); background: var(--panel-2);
}

.cf-who {
  margin: -2px 0 10px; padding: 7px 10px; border-radius: 9px;
  background: var(--accent-soft); color: var(--muted); line-height: 1.5;
}

/* 明细行：品名宽一点，规格其次，删掉那颗钉在右边 */
.cf-list { margin: 4px 0 12px; }
.cf-lcap {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.cf-rows { display: flex; flex-direction: column; gap: 6px; }
.cf-row {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 6px; align-items: center;
}
.cf-row input {
  width: 100%; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel-2); outline: none;
  font-size: 13.5px;
}
.cf-row input:focus { border-color: var(--accent); background: var(--panel); }
.cf-del {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 12px; line-height: 1; cursor: pointer;
}
.cf-del:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.cf-add {
  margin-top: 8px; padding: 7px 10px; border-radius: 9px;
  border: 1px dashed var(--line); background: transparent;
  color: var(--accent); font-size: 12.5px; cursor: pointer; width: 100%;
}
.cf-add:hover { background: var(--accent-soft); }
.cf-hint { margin: 6px 0 0; line-height: 1.55; }

/* 底条常驻：改到哪一行都不用滚回去找按钮。手机上要抬过 tabbar。 */
.cf-foot {
  position: sticky; bottom: 10px; z-index: 6;
  display: flex; gap: 8px; margin-top: 12px; padding: 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px;
}
.cf-foot .btn.primary { flex: 1 1 auto; }

@media (max-width: 719px) {
  .cf-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cf-doc { position: static; }
  .cf-shot img { max-height: 34vh; }
  .cf-foot { bottom: calc(64px + var(--safe-bottom)); }
  .cf-row { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 28px; }
  .cf-del { width: 28px; height: 28px; }
}

/* 门厅顶上那条草稿提示：只在没领编号时出现，点整条去核对页 */
.bd-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 12px; background: var(--accent-soft);
  color: var(--text);
}
.bd-tip b { display: block; font-size: 13.5px; font-weight: 650; }
.bd-tip .tiny { display: block; margin-top: 1px; line-height: 1.45; }
.bd-tip > span { min-width: 0; }
.bd-tip > i {
  flex: 0 0 auto; font-style: normal; font-size: 12.5px; font-weight: 600;
  color: var(--accent); white-space: nowrap;
}
.bd-tip:active { transform: scale(.995); }
