:root {
  --brand: #1a73e8;
  --brand-dark: #1557b0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e3e8ef;
  --text: #1f2430;
  --muted: #6b7280;
  --ok: #0f9d58;
  --warn: #f4b400;
  --danger: #d93025;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button, input, select, textarea { font-family: inherit; font-size: 15px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(160deg, #eaf1fd 0%, #f4f6f9 60%);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card); border-radius: 16px;
  box-shadow: 0 8px 30px rgba(16, 24, 40, .1); padding: 28px 24px;
}
.login-card h1 { margin: 0 0 4px; font-size: 21px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.tabs { display: flex; gap: 6px; background: #eef1f6; padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.tabs button {
  flex: 1; border: 0; background: transparent; padding: 8px 0; border-radius: 8px;
  color: var(--muted); cursor: pointer; font-size: 14px;
}
.tabs button.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: var(--shadow); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.field .row { display: flex; gap: 8px; }
.field .row input { flex: 1; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 6px; }

/* 分组 + 锁定：常驻在扫码卡片里（不在识别结果卡内，自动登记时也一直可见） */
.field.remark-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 0 0; padding: 8px 10px;
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px;
}
.field.remark-row .remark-label { margin-bottom: 0; flex: none; white-space: nowrap; }
.field.remark-row select { flex: 1 1 100px; min-width: 90px; width: auto; }
.field.remark-row .remark-lock {
  display: flex; align-items: center; gap: 6px; margin-bottom: 0;
  white-space: nowrap; font-size: 12.5px; color: var(--muted);
}
.field.remark-row .remark-lock input { width: auto; }

/* 后台「分组选项设置」：一行一个选项，可增删 */
.remark-opt-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.remark-opt-row input { flex: 1; }
.remark-opt-row .btn { flex: none; padding: 8px 12px; }
/* ---------- API 密钥卡片 ---------- */
.ak-key-text { font-size: 14px; font-weight: 700; background: #fff; border: 1px dashed var(--line);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; word-break: break-all; user-select: all; }
.ak-key-prefix { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ak-scroll-hint { font-size: 12px; text-align: center; padding: 2px 0; }
.ak-tbl { min-width: 680px; }
.ak-tbl td, .ak-tbl th { vertical-align: middle; }
.ak-tbl .ak-acts { white-space: nowrap; }
.ak-tbl .ak-acts .btn { padding: 7px 10px; font-size: 13px; }
.ak-tbl .ak-calls { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ak-logs-title { font-weight: 600; margin-bottom: 4px; }
.ak-log-row { font-size: 12.5px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.ak-doc { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.ak-doc summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--accent, #1557b0); }
.ak-doc-body { margin-top: 10px; font-size: 13px; line-height: 1.65; }
.ak-doc-body p { margin: 8px 0 4px; }
.ak-doc-body pre { background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; white-space: pre; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 15px;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.btn.subtle { background: #eef1f6; color: var(--text); }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f5c6c2; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
/* 闪光灯开关：悬浮在扫描框右上角 */
.scanner .torchtoggle {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  padding: 8px 12px; font-size: 14px; border-radius: 10px;
  background: rgba(0, 0, 0, .5); color: #fff; border: 1px solid rgba(255, 255, 255, .35);
}
.scanner .torchtoggle:active { transform: scale(.96); }
.scanner .torchtoggle svg { flex: none; }
.scanner .torchtoggle.on { background: #ffb300; color: #3a2a00; border-color: #ffb300; box-shadow: 0 0 0 3px rgba(255,179,0,.25); }

/* 重扫浮层按钮：浮在取景框上层，右上角（闪光灯下方），摄像头开启时才出现 */
.scanner .rescanfloat {
  position: absolute; top: 54px; right: 10px; z-index: 8;
  padding: 8px 12px; font-size: 14px; border-radius: 10px;
  background: rgba(0, 0, 0, .5); color: #fff; border: 1px solid rgba(255, 255, 255, .35);
}
.scanner .rescanfloat:active { transform: scale(.96); }
.scanner .rescanfloat svg { flex: none; }

/* 旋转浮层按钮：浮在取景框右下角（点一下转 90°，再点还原） */
.scanner .rotatefloat {
  position: absolute; bottom: 10px; right: 10px; z-index: 8;
  padding: 8px 12px; font-size: 14px; border-radius: 10px;
  background: rgba(0, 0, 0, .5); color: #fff; border: 1px solid rgba(255, 255, 255, .35);
}
.scanner .rotatefloat:active { transform: scale(.96); }
.scanner .rotatefloat svg { flex: none; }

/* ---------- 主框架 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 16px; display: flex; align-items: center; gap: 12px;
}
.app-header .title { font-size: 17px; font-weight: 700; }
.app-header .spacer { flex: 1; }
.app-header .who { font-size: 12px; color: var(--muted); text-align: right; }

.nav {
  position: sticky; top: 53px; z-index: 29; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; padding: 0 8px;
}
.nav button {
  flex: 1; border: 0; background: transparent; padding: 11px 4px; color: var(--muted);
  font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent;
}
.nav button.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }

main { padding: 14px; max-width: 1180px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }

/* ---------- 扫码 ---------- */
.scanner {
  position: relative; width: 100%; background: #000; border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 3 / 4; max-height: 46vh; max-height: 46svh;
}
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .mask {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.scanner .frame {
  width: 78%; aspect-ratio: 3 / 1.2; border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 10px; position: relative; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35);
}
.scanner .frame::after {
  content: ''; position: absolute; left: 6%; right: 6%; height: 2px; top: 0;
  background: linear-gradient(90deg, transparent, #4ade80, transparent);
  opacity: 0;
}
/* 扫描线动画只在摄像头开启（.live）时跑；停止/未开启时冻结，避免静止画面上来回乱扫 */
.scanner.live .frame::after { opacity: 1; animation: scanline 2.2s linear infinite; }
@keyframes scanline { 0% { top: 4%; } 100% { top: 96%; } }
.scanner .hint {
  position: absolute; bottom: 10px; left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, .85); font-size: 12px;
}
.scanner.flash .frame { border-color: #4ade80; }
/* 识别框旋转：点「旋转」循环 0→90→180→270，方便横/竖放置的条码对齐 */
.scanner[data-rot="90"] .frame { transform: rotate(90deg); }
.scanner[data-rot="180"] .frame { transform: rotate(180deg); }
.scanner[data-rot="270"] .frame { transform: rotate(270deg); }
.scanner[data-rot] .frame { transition: transform .25s ease; }

/* 摄像头停止时铺在黑画面上的「点这里开启」提示：不拦截点击，整块画面都能点 */
.scanner:not(.live) { cursor: pointer; }
.scan-idle {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  color: #9aa6b8; font-size: 13px; letter-spacing: .5px;
  pointer-events: none; user-select: none;
}
.scan-idle svg { width: 44px; height: 44px; opacity: .9; }
.scan-idle:active { color: #cfd8e5; }

/* 自动登记后的短暂反馈：大号快递公司名 */
.scan-flash {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  background: rgba(6, 110, 58, .84); color: #fff;
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
.scan-flash.show { opacity: 1; }
.scan-flash .sf-ok { font-size: 13px; letter-spacing: 3px; opacity: .85; }
.scan-flash .sf-carrier { font-size: 34px; font-weight: 800; letter-spacing: 1px; }
.scan-flash .sf-no {
  font-size: 13px; opacity: .95; word-break: break-all;
  padding: 0 18px; text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* ---------- 诊断 ---------- */
.diag {
  max-height: 190px; overflow-y: auto; background: #0f1420; color: #c8d3e6;
  border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all; -webkit-overflow-scrolling: touch;
}
.diag div { border-bottom: 1px solid rgba(255, 255, 255, .06); padding: 1px 0; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.result {
  border-radius: var(--radius); padding: 14px; border: 1px solid var(--line);
  background: #fff; margin-top: 12px;
}
.result .track {
  font-size: 26px; font-weight: 700; letter-spacing: 1px; word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.result .meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.badge.dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: #eef1f6; color: var(--muted); }
.tag.ok { background: #e6f4ea; color: var(--ok); }
.tag.warn { background: #fef7e0; color: #a56b00; }
.tag.fail { background: #fce8e6; color: var(--danger); }
.tag.err { background: #fce8e6; color: var(--danger); font-weight: 700; }
/* 「未处理」标签本身是按钮：点一下直接把这条标记为已处理 */
.tag-btn {
  appearance: none; -webkit-appearance: none;
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.35;
  border: 1px solid #e8b64c; cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 2px rgba(165, 107, 0, .12);
  touch-action: manipulation;
}
.tag-btn::after { content: ' ✓'; opacity: .65; font-weight: 700; }
.tag-btn:active { transform: scale(.93); background: #fbe6ae; }
.tag-btn:disabled { opacity: .5; }
.msgs { margin: 10px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.msgs li { margin-bottom: 3px; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

/* ---------- 列表 ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin-bottom: 0; flex: 1; min-width: 130px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.stat .n { font-size: 22px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--muted); }

.tablewrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f8fafc; font-weight: 600; color: var(--muted); font-size: 12.5px; }
tbody tr:hover { background: #fafbfd; }
td .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tbl-scroll { overflow-x: auto; }

.record { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; margin-bottom: 10px; }
.record .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.record .no { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; font-size: 15px; word-break: break-all; }
.record .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.record .acts { display: flex; gap: 6px; margin-top: 10px; }

/* ---------- 批量选择 / 批量处理（记录查询） ---------- */
.bulkbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px 12px; margin-bottom: 12px;
}
.bulk-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.bulk-all input { width: 17px; height: 17px; margin: 0; }
.bulk-count { font-size: 12.5px; color: var(--muted); }
.bulk-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
/* 卡片左侧留出勾选框的位置，不挤压原有排版 */
.record.pickable { position: relative; padding-left: 42px; }
.row-pick { position: absolute; left: 12px; top: 12px; display: flex; cursor: pointer; }
.row-pick input { width: 19px; height: 19px; margin: 0; }
.record.sel { background: #f0f6ff; box-shadow: 0 0 0 2px var(--brand) inset, var(--shadow); }
tbody tr.sel td { background: #f0f6ff; }
td.col-sel, th.col-sel { width: 38px; text-align: center; padding-right: 0; }
td.col-sel input { width: 17px; height: 17px; margin: 0; vertical-align: middle; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 100;
  background: rgba(31, 36, 48, .94); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; max-width: 90vw; text-align: center; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.toast.err { background: #b3261e; }
.toast.ok { background: #0f7b43; }
.toast.warn { background: #a56b00; }

.banner { background: #fff8e1; border: 1px solid #ffe082; color: #7a5b00; padding: 10px 12px;
  border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.banner.info { background: #e8f0fe; border-color: #c5d9fb; color: #1557b0; }
/* 扫码不合规则提示：第一行亮出扫描到的原文，第二行说明原因 */
.banner .reject-content { font-weight: 700; font-size: 14px; word-break: break-all; }
.banner .reject-content::before { content: '⚠ '; }
.banner .reject-reason { font-size: 12.5px; opacity: .85; margin-top: 3px; }

/* ---------- 号段重叠时的候选快递公司 ---------- */
.alts-wrap { margin-top: 10px; }
.alts-label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.alts { display: flex; flex-wrap: wrap; gap: 8px; }
.alts .alt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 7px 11px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text); font-family: inherit;
}
.alts .alt span { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.alts .alt.on { border-color: var(--brand); background: #e8f0fe; color: var(--brand-dark); }
.alts .alt.on span { color: #4b7fc4; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80; background: rgba(16, 24, 40, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, .2);
}
.modal-card h3 { margin: 0 0 14px; font-size: 17px; }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 扫码模式切换（手机扫描 / PDA 键盘楔子） ---------- */
.scan-mode-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.scan-mode-label { font-size: 14px; color: var(--muted); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button {
  border: 0; background: #fff; padding: 9px 18px; font-size: 14px; cursor: pointer;
  color: var(--text); transition: background .15s, color .15s; white-space: nowrap;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--brand); color: #fff; font-weight: 600; }
.seg button:not(.active):active { background: #eef1f6; }

/* 模式互斥：PDA 模式隐藏摄像头相关，手机模式隐藏 PDA 捕获框 */
body.mode-pda .cam-only { display: none !important; }
body:not(.mode-pda) .pda-only { display: none !important; }

.pda-box {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcfe;
  padding: 16px; margin-top: 4px; box-shadow: var(--shadow);
}
.pda-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.pda-input {
  width: 100%; padding: 16px 14px; font-size: 19px; letter-spacing: 1px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text);
}
.pda-input::placeholder { font-size: 14px; letter-spacing: 0; color: var(--muted); }
.pda-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
.pda-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pda-row label { font-size: 13px; color: var(--muted); }
.pda-row select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pda-last { font-size: 13px; color: var(--ok); margin-left: auto; }

/* 工业 PDA 设备首次进入时的模式切换提示 */
.pda-prompt {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #e8f0fe; border: 1px solid #c6dafc; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px; font-size: 13px; color: #1746a2;
}
.pda-prompt-txt { flex: 1 1 auto; min-width: 160px; }
.pda-prompt-actions { display: flex; gap: 8px; }
.pda-prompt .btn.sm { padding: 6px 12px; }

/* 「缺尾号 N」：顺丰/中通没拿到手机号后四位的条数 */
.rapid-notail { font-size: 12px; color: #b26a00; white-space: nowrap; }
.rapid-notail b { font-size: 14px; color: #b26a00; }

/* ---------- 手机号尾号（所有快递都识别；识别不到直接跳过，不弹面板） ---------- */
.phone-row { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 旧版本提醒条（顶部固定；后台可一键关闭） ---------- */
.update-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: #fff8e1; border-bottom: 1px solid #ffe082; color: #7a5b00;
  font-size: 13.5px; box-shadow: 0 2px 8px rgba(16, 24, 40, .10);
}
.update-banner.hidden { display: none; }
.update-banner-text { flex: 1 1 auto; min-width: 160px; }
.update-banner .btn.sm { padding: 6px 12px; }

/* ---------- 极速连续扫描（PDA 批量入库） ---------- */
.rapid-row { margin-top: 10px; }
.rapid-switch { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.rapid-box {
  border: 1px solid var(--line); border-radius: var(--radius); background: #f2f8f0;
  padding: 14px 16px; margin-top: 12px; box-shadow: var(--shadow);
}
.rapid-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rapid-title { font-size: 14px; font-weight: 700; color: #1b5e20; }
.rapid-counts { font-size: 13px; color: var(--text); }
.rapid-counts b { font-size: 16px; color: #1b5e20; }
.rapid-cd { font-size: 12px; color: var(--muted); margin-left: auto; }
/* 「暂停入库」按钮：跟在倒计时旁；暂停中变黄色高亮，文字变「恢复自动入库」 */
.rapid-pause { padding: 4px 10px; font-size: 12px; border-radius: 8px; flex: none; }
.rapid-pause.on { background: #ffb300; color: #3a2a00; border-color: #ffb300; }
.rapid-note { font-size: 12px; color: #b26a00; margin-top: 6px; min-height: 16px; word-break: break-all; }
/* 最近一条异常的具体错误信息（与手机扫码结果卡等效的文字提示） */
.rapid-err {
  font-size: 13px; color: var(--danger); margin-top: 6px; min-height: 18px;
  word-break: break-all; line-height: 1.5;
  background: #fdecec; border: 1px solid #f6cfcb; border-radius: 8px; padding: 6px 10px;
}
/* 「异常 N」数字按钮：可点击，点击后明细只显示异常单号 */
.rapid-bad-btn {
  appearance: none; border: none; background: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--danger); font-weight: 700;
  border-bottom: 1px dashed var(--danger);
}
.rapid-bad-btn b { font-size: 16px; }
.rapid-bad-btn:hover { opacity: .8; }
.rapid-bad-btn:disabled { color: var(--muted); border-bottom-color: transparent; cursor: default; }
.rapid-bad-btn.active { color: #fff; background: var(--danger); border-bottom-color: transparent; border-radius: 4px; padding: 0 6px; }
.ri-filter-tip { font-size: 12px; color: var(--muted); padding: 4px 0 6px; }
.rapid-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rapid-list {
  margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px;
  max-height: 260px; overflow-y: auto;
}
.rapid-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 0;
  font-size: 13px; border-bottom: 1px solid #eef1f6;
  cursor: pointer;
}
.rapid-item:hover { background: #f2f7ff; }
.rapid-item.bad { background: #fff4f3; border-radius: 6px; padding: 5px 6px; border-bottom: 1px solid #f6d6d2; }
.rapid-item.bad:hover { background: #ffe9e6; }
/* 极速条目详情弹窗内的字段列表（单号 / 识别结果 / 说明 / 分组 / 扫入时间） */
.ri-fields { font-size: 13px; line-height: 1.7; }
.ri-fields .ri-d-row { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid #eef1f6; }
.ri-fields .ri-d-row:last-child { border-bottom: none; }
.ri-d-k { flex: none; width: 56px; color: var(--muted); }
.ri-d-v { word-break: break-all; }
/* PDA 异常单号核对弹窗：标题用警示色，明示「必须先处理才能继续扫」 */
#modal-pda-illegal .modal-card { max-width: 480px; }
#modal-pda-illegal h3 { color: var(--danger); }
#pi-msgs { color: #b3261e; }
.rapid-item .ri-no { font-weight: 600; word-break: break-all; }
.rapid-item .ri-carrier { color: var(--muted); white-space: nowrap; }
.rapid-item .ri-remark { color: var(--muted); font-size: 12px; }
/* 重复扫入标记：同一单号（同分组）在本批扫了 N 次，行尾红色 ×N 徽标 */
.rapid-item .ri-dup {
  flex: none; font-size: 11px; font-weight: 700; line-height: 1;
  color: #fff; background: #d93025; border-radius: 999px; padding: 3px 8px; cursor: default;
}
.rapid-item .ri-del {
  margin-left: auto; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 14px; padding: 2px 8px; border-radius: 6px; flex: 0 0 auto;
}
.rapid-item .ri-del:hover { background: #fdecec; color: #c62828; }

/* WPS 云文档备份：最近 7 天备份日志行（时间 / 成功失败 / 明细 / 操作人） */
.wps-log-row {
  display: flex; gap: 8px; align-items: baseline;
  padding: 5px 0; border-bottom: 1px solid #eef1f6; font-size: 12.5px;
}
.wps-log-row:last-child { border-bottom: none; }
.wps-log-row.bad { color: #b3261e; }
.wps-log-time { flex: none; color: var(--muted); }
.wps-log-tag {
  flex: none; font-size: 11px; font-weight: 700; line-height: 1;
  color: #fff; background: #137333; border-radius: 999px; padding: 3px 8px;
}
.wps-log-row.bad .wps-log-tag { background: #b3261e; }
.wps-log-detail { flex: 1 1 auto; word-break: break-all; }
.wps-log-who { flex: none; color: var(--muted); font-size: 11.5px; }
/* 备份日志分页条：首页 / 上一页 / 下一页 / 末页 */
.wps-pager {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid #eef1f6;
}
.wps-pg-btn {
  font-size: 12px; line-height: 1; padding: 5px 10px; cursor: pointer;
  color: var(--text, #1f2329); background: #fff;
  border: 1px solid #d6dbe3; border-radius: 6px;
}
.wps-pg-btn:hover:not(:disabled) { background: #f2f5fa; border-color: #b9c2cf; }
.wps-pg-btn:disabled { color: #b0b6c0; background: #f7f8fa; cursor: not-allowed; }
.wps-pg-info { flex: 1 1 auto; text-align: center; font-size: 12px; color: var(--muted); }


/* ============ 面单照片（灯箱大图 + 详情缩略） ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(12,16,22,.94);
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
}
.lightbox.hidden { display: none; }
/* 相框卡片：大小紧贴图片（flex 子项不被拉伸），关闭按钮就在图片角上 */
.lightbox-stage {
  display: flex; flex-direction: column;
  max-width: 100%; max-height: 100%; min-width: 0;
  border-radius: 10px; overflow: hidden;
  background: #0b0e13;
  box-shadow: 0 14px 50px rgba(0,0,0,.55);
}
.lightbox-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: rgba(0,0,0,.55);
  border-bottom: 1px solid rgba(255,255,255,.14);
  color: #fff; flex: 0 0 auto;
}
.lightbox-cap {
  flex: 1; min-width: 0; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 灯箱里的按钮改成深底浅字，否则白底白字看不清 */
.lightbox-bar .btn.ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.lightbox-bar .btn.subtle { background: rgba(255,255,255,.16); color: #fff; }
.lightbox-body {
  flex: 1 1 auto; min-height: 0; overflow: auto; display: flex;
}
/* 默认自适应：整张面单完整显示在屏幕内（只限显示尺寸，画质仍是原图，不重新编码）。
   用 margin:auto 居中而不是 align-items——放大后图片超出容器时不会被裁掉、可完整滚动 */
.lightbox-body img {
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 116px);
  width: auto; height: auto; object-fit: contain;
  margin: auto; display: block;
  image-rendering: auto; background: #fff; border-radius: 6px;
  cursor: zoom-in;
}
/* 点击放大：解除显示尺寸约束，按原始像素显示（大图可滚动查看） */
.lightbox-body img.zoomed {
  max-width: none; max-height: none;
  cursor: zoom-out;
}

/* 详情页里的照片缩略入口 */
.photo-thumb {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; font-size: 13px; cursor: pointer;
  color: var(--brand); background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
}
.photo-thumb:hover { background: #f0f6ff; }
/* 列表页的小图 */
.record-photo {
  display: block; width: 100%; max-width: 120px; border-radius: 6px;
  margin-top: 6px; border: 1px solid var(--line); cursor: pointer;
}
.photo-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
