/* ==========================================================================
   盘点差异报表工具 · 手机优先样式
   页面结构：顶部标题条 + 4 个主页面（导入 / 核对 / 异常 / 报表） + 底部导航
   复盘时临时多出「核验」页（整页琥珀色，见文件末尾「核验（复盘）独立页面」）
   ========================================================================== */

/* hidden 属性必须永远赢过类里的 display 声明（例如 .cam 的 display:flex
   会盖掉 UA 样式表里的 [hidden]{display:none}，导致浮层一开页面就显示） */
[hidden] { display: none !important; }

:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-strong: #cfd8e6;
  --txt: #1c2536;
  --txt-2: #5a6880;
  --txt-3: #8c99ad;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --green: #16a34a;
  --green-soft: #e7f7ed;
  --red: #dc2626;
  --red-soft: #fdeaea;
  --amber: #d97706;
  --amber-soft: #fff5e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 34, 56, .05), 0 6px 20px rgba(22, 34, 56, .06);
  --tap: 46px;
  --tab-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------- 顶部标题条 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 2px 12px rgba(37, 99, 235, .22);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, .18);
  font-weight: 700; font-size: 18px;
}
.brand-text { min-width: 0; }
.brand-text h1 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: .3px; }
.brand-text p { margin: 1px 0 0; font-size: 11.5px; opacity: .82; white-space: nowrap;
                overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 6px; flex: 0 0 auto; }

/* ---------------------------------------------- 主区域与分页 */
main { padding: 12px 12px calc(var(--tab-h) + var(--safe-b) + 22px); max-width: 1180px; margin: 0 auto; }
.page { display: none; animation: fade .16s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------- 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 15.5px; font-weight: 650; }
.step {
  width: 24px; height: 24px; flex: 0 0 24px;
  display: grid; place-items: center;
  border-radius: 8px; background: var(--blue-soft); color: var(--blue);
  font-size: 12.5px; font-weight: 700;
}
.hint { margin-left: auto; font-size: 11.5px; color: var(--txt-3); text-align: right; }

/* ---------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--txt);
  font-size: 14px; font-family: inherit; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: transform .06s, background .15s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.ghost { background: #fff; }
.btn.danger { color: var(--red); border-color: #f2c9c9; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn.xs { min-height: 28px; padding: 0 9px; font-size: 12px; border-radius: 8px; }
.btn.big { min-height: var(--tap); font-size: 16px; flex: 0 0 auto; padding: 0 18px; }
.topbar .btn.ghost { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: #fff; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: none; border-radius: 10px; background: #f1f4fa; color: var(--txt-2);
  font-size: 16px; cursor: pointer;
}
.icon-btn.light { background: rgba(255, 255, 255, .2); color: #fff; }

.muted { color: var(--txt-3); }
.sm { font-size: 12.5px; }
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--txt-2); }
.inline input[type=number] { width: 62px; min-height: 32px; padding: 0 8px; border: 1px solid var(--line-strong);
                            border-radius: 8px; font-family: inherit; font-size: 14px; }
.inline-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
            margin: 4px 0 8px; font-weight: 600; font-size: 14px; flex-wrap: wrap; }
.row-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.generate-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tip { margin: 8px 0 0; font-size: 12px; color: var(--txt-3); line-height: 1.6; }
.foot { text-align: center; font-size: 12px; color: var(--txt-3); padding: 6px 0 4px; }
.foot code { background: #eef2f9; padding: 1px 5px; border-radius: 5px; }

/* ---------------------------------------------- 手机扫码卡片 */
.net-body { display: flex; flex-direction: column; gap: 12px; }
.qr-wrap { text-align: center; }
.qr-wrap img {
  width: min(58vw, 200px); height: auto; aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px;
}
.qr-switch { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.net-url { display: flex; align-items: center; gap: 8px; background: #f6f8fc;
           border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.net-url code { flex: 1; font-size: 12.5px; word-break: break-all; color: var(--blue); }
.net-steps { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--txt-2); line-height: 1.75; }
.net-alt { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------- 导入：拖拽区 / 表格 */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 22px 14px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: 12px;
  background: #fafcff; cursor: pointer; transition: background .15s, border-color .15s;
}
.dropzone:active, .dropzone.hover { background: var(--blue-soft); border-color: var(--blue); }
.dz-icon { font-size: 22px; color: var(--blue); }
.dropzone strong { font-size: 14.5px; }
.dropzone .muted { font-size: 12px; }
.split { display: flex; flex-direction: column; gap: 10px; }
.meta-box { background: #f6f8fc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
            font-size: 13px; line-height: 1.9; }
.meta-box b { color: var(--blue); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 6px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 460px; }
table.grid th, table.grid td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.grid th { background: #f6f8fc; color: var(--txt-2); font-weight: 600; font-size: 12px; white-space: nowrap; }
table.grid input[type=number] { width: 68px; min-height: 32px; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: 8px; font-family: inherit; font-size: 14px; }
table.grid .mv { display: inline-flex; gap: 4px; }
.field { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; }
.field input { min-height: var(--tap); padding: 0 12px; border: 1px solid var(--line-strong);
               border-radius: 10px; font-size: 15px; font-family: inherit; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.stat { background: #f6f8fc; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.stat b { display: block; font-size: 17px; color: var(--blue); letter-spacing: -.2px; }
.stat span { font-size: 11.5px; color: var(--txt-3); }
.stat.ok b { color: var(--green); }
.stat.warn b { color: var(--amber); }

/* ---------------------------------------------- 扫码核对区 */
.scan-card { border-color: #cddffb; background: linear-gradient(180deg, #f7faff, #fff); }
.scan-top { display: flex; flex-direction: column; gap: 9px; }
.scan-input { display: flex; gap: 7px; }
.scan-input input {
  flex: 1; min-width: 0; min-height: var(--tap);
  padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 16px; font-family: inherit; letter-spacing: .3px;
}
.scan-input input:focus { outline: 2px solid #bfd6ff; border-color: var(--blue); }
.scan-hint { margin-top: 7px; }
.scan-result { margin-top: 10px; border-radius: 11px; padding: 10px 12px; font-size: 13.5px;
               border: 1px solid var(--line); background: #fff; }
.scan-result.ok { background: var(--green-soft); border-color: #bfe6cd; }
.scan-result.warn { background: var(--amber-soft); border-color: #f4dcb4; }
.scan-result.err { background: var(--red-soft); border-color: #f3c8c8; }
.scan-result b { font-size: 15px; }
.scan-result .line2 { color: var(--txt-2); font-size: 12.5px; margin-top: 2px; }
.avatar-row { margin-top: 10px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
#recentList { display: flex; gap: 5px; flex-wrap: wrap; }
#recentList .chip { font-size: 11.5px; padding: 0 8px; min-height: 26px; }

/* ---------------------------------------------- 进度 */
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.progress-text b { font-size: 20px; color: var(--blue); letter-spacing: -.5px; }
.progress-bar { height: 8px; border-radius: 6px; background: #e8edf6; overflow: hidden; margin: 9px 0 12px; }
.progress-bar i { display: block; height: 100%; border-radius: 6px;
                  background: linear-gradient(90deg, #22c55e, #16a34a); transition: width .25s; }

/* ---------------------------------------------- 货架条 / 筛选 */
.shelf-bar { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 8px;
             -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.shelf-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: #fff; color: var(--txt-2); font-size: 13.5px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.chip .cnt { font-size: 11px; opacity: .75; }

/* 货架很多时：货架条收成一个「选货架」按钮，点开面板（带搜索框）再选。
   少的时候这段样式完全不参与（.many / .open 都不存在）。 */
.shelf-toggle { display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 40px; padding: 0 13px; margin-bottom: 8px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: #fff; color: var(--txt); font-size: 13.5px; font-family: inherit; cursor: pointer; }
.shelf-toggle .st-cnt { font-size: 12px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.shelf-toggle .st-arrow { margin-left: auto; font-style: normal; color: var(--txt-3); }
.shelf-drop { padding: 0 0 8px; }
.shelf-drop input[type=search] { width: 100%; box-sizing: border-box; min-height: 38px;
  padding: 0 12px; margin: 0 0 8px; border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; }
.shelf-wrap.many > .shelf-bar { display: none; }
.shelf-wrap.many.open > .shelf-bar { display: flex; flex-wrap: wrap; max-height: 38vh; overflow: auto; }
.check-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.check-tools input[type=search] {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; font-size: 14px; font-family: inherit;
}
.check-tools select { min-height: 40px; padding: 0 8px; border: 1px solid var(--line-strong);
                      border-radius: 10px; font-size: 13.5px; font-family: inherit; background: #fff; }
.list-head { font-size: 12.5px; color: var(--txt-3); padding: 0 2px 7px; }

/* ---------------------------------------------- 核对列表 */
.clist { display: flex; flex-direction: column; }
.shelf-group { margin: 12px 0 5px; display: flex; align-items: center; gap: 8px; }
.shelf-group:first-child { margin-top: 0; }
.shelf-group .gt { font-weight: 650; font-size: 13.5px; }
.shelf-group .gl { flex: 1; height: 1px; background: var(--line); }
.shelf-group .gc { font-size: 11.5px; color: var(--txt-3); }
.shelf-group.done .gt { color: var(--green); }

.row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid #eef1f7;
}
.row:last-child { border-bottom: none; }
.row.flash { background: #fff8dc; border-radius: 10px; }
.row .ck {
  flex: 0 0 30px; width: 30px; height: 30px; margin-top: 1px;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  background: #fff; color: transparent; font-size: 15px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.row.done .ck { background: var(--green); border-color: var(--green); color: #fff; }
.row .mid { flex: 1; min-width: 0; }
.row .nm { font-size: 14.5px; font-weight: 550; word-break: break-all; }
.row.done .nm { color: var(--txt-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.row .cd { font-size: 11.5px; color: var(--txt-3); margin-top: 1px; letter-spacing: .2px; word-break: break-all; }
.row .nt { margin-top: 4px; font-size: 12.5px; color: var(--amber);
           background: var(--amber-soft); border-radius: 7px; padding: 3px 8px; display: inline-block; }
.row .right { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column;
              align-items: flex-end; gap: 6px; }
.row .qty { font-size: 16px; font-weight: 700; color: var(--blue); letter-spacing: -.3px; }
.row .qty small { font-size: 11px; font-weight: 400; color: var(--txt-3); margin-left: 2px; }
.row .mini { border: 1px solid var(--line-strong); background: #fff; border-radius: 8px;
             padding: 3px 9px; font-size: 12px; color: var(--txt-2); cursor: pointer; font-family: inherit; }
.row .mini.hasnote { color: var(--amber); border-color: #f0d5a8; background: var(--amber-soft); }
.more-btn { width: 100%; margin-top: 10px; }
.empty-preview { text-align: center; color: var(--txt-3); font-size: 13px; padding: 26px 10px; }

/* ---------------------------------------------- 备注页 */
.note-tools { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.note-tools input[type=search] { flex: 1; min-width: 150px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; font-size: 14px; font-family: inherit; }
.nlist { display: flex; flex-direction: column; gap: 9px; }
.ncard { border: 1px solid #f0dcb8; background: #fffdf7; border-radius: 12px; padding: 11px 12px; }
.ncard .n1 { display: flex; align-items: baseline; gap: 8px; }
.ncard .n1 .shelf-tag { flex: 0 0 auto; background: var(--blue-soft); color: var(--blue);
                        border-radius: 6px; padding: 1px 7px; font-size: 11.5px; font-weight: 600; }
.ncard .n1 .nm { font-weight: 600; font-size: 14.5px; flex: 1; min-width: 0; word-break: break-all; }
.ncard .n1 .qty { font-size: 13px; color: var(--txt-2); }
.ncard .n2 { font-size: 11.5px; color: var(--txt-3); margin-top: 3px; word-break: break-all; }
.ncard .n3 { margin-top: 6px; font-size: 14px; color: #8a5a00; white-space: pre-wrap; word-break: break-word; }
.ncard .n4 { margin-top: 8px; display: flex; gap: 7px; }

/* ---------------------------------------------- 报表预览 */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; padding-bottom: 2px;
        -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .chip.active { background: #0f172a; border-color: #0f172a; }
.preview { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 11px;
           -webkit-overflow-scrolling: touch; }
.preview table { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.preview th, .preview td { padding: 5px 9px; border-bottom: 1px solid #eef1f7; text-align: left; }
.preview th { position: sticky; top: 0; background: #f2f5fb; font-weight: 600; color: var(--txt-2); }
/* 「盘点找差」的辅助列：前端预览默认隐藏，与导出的 Excel 保持一致
   （点「显示全部列」展开；口径由后端 hidden_cols 给出，不写死列号） */
.preview th.col-hide, .preview td.col-hide { display: none; }
.preview table.show-all th.col-hide, .preview table.show-all td.col-hide { display: table-cell; }
.banner { margin-top: 10px; background: var(--amber-soft); border: 1px solid #f4dcb4; color: #94560a;
          border-radius: 10px; padding: 9px 12px; font-size: 13px; }

/* ---------------------------------------------- 底部导航 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; border: none; background: none; cursor: pointer; padding: 0;
  font-family: inherit; color: var(--txt-3); font-size: 11.5px;
}
.tab i { font-style: normal; font-size: 18px; line-height: 1.15; }
.tab.active { color: var(--blue); font-weight: 600; }
.tab .badge {
  position: absolute; top: 6px; left: 50%; margin-left: 4px;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10.5px; font-style: normal;
  display: grid; place-items: center; font-weight: 600;
}

/* ---------------------------------------------- 摄像头 */
.cam { position: fixed; inset: 0; z-index: 90; background: #000; display: flex;
       flex-direction: column; }
.cam video { flex: 1; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cam-frame { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
             width: 84vw; max-width: 520px; height: 42vh; max-height: 300px;
             border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); pointer-events: none; }
.cam-frame span { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; margin-top: -1px;
                  background: linear-gradient(90deg, transparent, #ff3b30, transparent); }
.cam-top { position: absolute; top: 0; left: 0; right: 0; padding: 14px 14px 10px;
           display: flex; align-items: center; gap: 10px;
           background: linear-gradient(180deg, rgba(0,0,0,.6), transparent); }
.cam-title { flex: 1; color: #fff; font-size: 15px; text-align: center; }
.cam-bottom { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px 16px calc(20px + var(--safe-b));
              background: linear-gradient(0deg, rgba(0,0,0,.72), transparent); }
.cam-msg { color: #fff; font-size: 14px; text-align: center; }
.cam-last { color: #9fe6b4; font-size: 13px; text-align: center; margin-top: 5px; min-height: 18px; }

/* ---------------------------------------------- 抽屉 / 提示 */
.sheet-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 70; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71;
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 8px 14px calc(16px + var(--safe-b));
  box-shadow: 0 -8px 30px rgba(15, 23, 42, .18);
  max-height: 88vh; overflow-y: auto;
}
.sheet-grab { width: 38px; height: 4px; border-radius: 3px; background: #d6ddea; margin: 2px auto 10px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet-title { font-size: 15.5px; font-weight: 650; }
.sheet-sub { font-size: 12px; margin-top: 2px; }
.sheet textarea {
  width: 100%; margin-top: 10px; padding: 10px 12px; font-family: inherit; font-size: 15px;
  border: 1px solid var(--line-strong); border-radius: 11px; resize: vertical; line-height: 1.5;
}
.sheet-actions { display: flex; gap: 9px; margin-top: 12px; }
.sheet-actions .btn { flex: 1; }
.quick-notes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.quick-notes .chip { min-height: 30px; font-size: 12.5px; padding: 0 11px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 22px);
  transform: translateX(-50%); z-index: 95;
  max-width: 88vw; padding: 10px 16px; border-radius: 11px;
  background: rgba(24, 33, 50, .94); color: #fff; font-size: 13.5px; text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .3); animation: pop .18s ease;
}
.toast.ok { background: rgba(21, 128, 61, .95); }
.toast.err { background: rgba(185, 28, 28, .95); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; } }

/* ---------------------------------------------- 宽屏 */
@media (min-width: 760px) {
  .net-body { flex-direction: row; align-items: flex-start; }
  .qr-wrap { flex: 0 0 210px; }
  .net-info { flex: 1; }
  .split { flex-direction: row; align-items: stretch; }
  .split .dropzone { flex: 1; }
  .split .meta-box { flex: 1; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .scan-top { flex-direction: row; align-items: center; }
  .scan-input { flex: 1; }
  .nlist { display: grid; grid-template-columns: repeat(2, 1fr); }
  .clist { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 16px; }
  .shelf-group { grid-column: 1 / -1; }
  .preview { max-height: 560px; }
}
@media (min-width: 1100px) {
  .nlist { grid-template-columns: repeat(3, 1fr); }
  .clist { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   电脑端（body.is-pc）：现场扫码是手机上的活，电脑只负责导入 / 看清单 / 出报表。
   所以电脑端把「扫码区」和「二维码卡」都收成一行标题，点一下才展开，
   打开页面就直接看到清单本身；摄像头按钮在电脑上直接不显示。
   ========================================================================== */
.pc-only { display: none; }
.pc-toggle { cursor: pointer; user-select: none; }
.pc-toggle .hint { color: var(--blue); font-weight: 600; }
.scan-head { display: none; }          /* 手机端不显示这行标题，扫码区直接展开 */
.scan-body { display: block; }

body.is-pc .pc-only { display: inline; }

/* 二维码卡：二维码是给手机扫的，电脑上折叠成标题 */
body.is-pc .net-card .card-head { margin-bottom: 0; }
body.is-pc .net-card.open .card-head { margin-bottom: 10px; }
body.is-pc .net-body { display: none; }
body.is-pc .net-card.open .net-body { display: flex; }

/* 扫码区：折叠成一行；电脑没有摄像头，隐藏「扫码核对」按钮，保留扫码枪 / 手动输入 */
body.is-pc .scan-card { border-color: var(--line); background: var(--card); }
body.is-pc .scan-card .card-head { margin-bottom: 0; }
body.is-pc .scan-card.open .card-head { margin-bottom: 10px; }
body.is-pc .scan-head { display: flex; }
body.is-pc .scan-body { display: none; }
body.is-pc .scan-card.open .scan-body { display: block; }
body.is-pc #btnScan { display: none; }

/* ==========================================================================
   实时同步指示灯（顶栏）：绿=已连上，黄=重连中，红=同步失败
   ========================================================================== */
.sync { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; height: 26px;
        border-radius: 13px; background: var(--blue-soft); color: var(--txt-2);
        font-size: 11.5px; white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; display: block; }
.sync.wait { background: #fff7e6; color: #92500e; }
.sync.wait i { background: #f59e0b; animation: pulse 1s ease-in-out infinite; }
.sync.off { background: #fdecec; color: #b3261e; }
.sync.off i { background: #dc2626; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* 扫码区两个大按钮并排；窄屏自动换行 */
.scan-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-btns .btn { flex: 1 1 46%; }
.btn.on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.qr-switch .btn.on { border-color: var(--blue); color: var(--blue); }

/* 「拍照识别」在 http 下是主角，给它一点视觉重量 */
#btnPhoto { background: #fff; border: 1px solid var(--line-strong); }
#btnPhoto:active { background: var(--blue-soft); }

/* 二维码卡里的注意行 */
.net-steps .warn-li { color: #b45309; }
.scan-btns .btn:only-of-type { flex: 1 1 100%; }   /* 只剩「拍照识别」时占满整行 */

/* ==========================================================================
   核对数 / 异常率 / 核验（复盘）
   ========================================================================== */

/* ---- 核对率 / 异常率 / 阈值 ---- */
.rate-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 2px 0 10px; }
.rate { display: flex; align-items: baseline; gap: 6px; }
.rate .rl { font-size: 12px; color: var(--txt-2); }
.rate b { font-size: 17px; font-variant-numeric: tabular-nums; }
.rate .rt { font-size: 11px; color: var(--txt-3); }
.rate.abn b { color: #d9480f; }
.rate-set { margin-left: auto; display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--txt-2); white-space: nowrap; }
.rate-set input { width: 58px; padding: 4px 6px; font-size: 13px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--txt); }

/* ---- 核验（复盘）横幅 ---- */
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 10px 12px; border-radius: 11px;
  background: var(--amber-soft); border: 1px solid #f0d5a8; color: #8a5a00; font-size: 13px; }
.verify-banner.done { background: var(--green-soft); border-color: #b7e4c7; color: #1b7f3b; }
.verify-banner b { font-variant-numeric: tabular-nums; }
.verify-banner .vb-list { width: 100%; font-size: 12px; opacity: .9; word-break: break-all; }
.verify-banner .vb-hint { font-size: 11px; opacity: .85; }
.verify-banner .btn { margin-left: auto; }

/* ---- 异常区 ---- */
.abn-block { margin-top: 16px; }
.abn-head { display: flex; align-items: center; gap: 7px; font-size: 13.5px;
  font-weight: 550; margin-bottom: 9px; }
.abn-dot { width: 8px; height: 8px; border-radius: 50%; background: #e8590c; flex: 0 0 auto; }
.abn-dot.note { background: #1c7ed6; }
.abn-cnt { font-size: 11px; color: var(--txt-2); background: var(--bg); border-radius: 9px; padding: 1px 7px; }
.alist { display: flex; flex-direction: column; gap: 8px; }
.acard { border: 1px solid var(--line); border-left: 3px solid #e8590c; border-radius: 11px;
  padding: 10px 12px; background: var(--card); }
.acard .a1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.acard .a1 .shelf-tag { flex: 0 0 auto; background: var(--blue-soft); color: var(--blue);
  border-radius: 6px; padding: 1px 6px; font-size: 11px; }
.acard .a1 .nm { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; word-break: break-all; }
.acard .a2 { font-size: 11.5px; color: var(--txt-3); margin-top: 3px; word-break: break-all; }
.acard .anums { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 7px; font-size: 12.5px; }
.acard .anums span { color: var(--txt-2); }
.acard .anums b { color: var(--txt); font-variant-numeric: tabular-nums; }
.acard .a4 { margin-top: 9px; display: flex; gap: 7px; }

/* 差异数配色：多出来红、少了绿（中式记账习惯）。这里要写足层数，
   否则会被上面 `.acard .anums b { color: var(--txt) }` 按优先级压回去。 */
.diff-up { color: #c92a2a; }
.diff-dn { color: #2b8a3e; }
.acard .anums b.diff-up { color: #c92a2a; }
.acard .anums b.diff-dn { color: #2b8a3e; }
.row .qty .ck-diff.diff-up { color: #c92a2a; }
.row .qty .ck-diff.diff-dn { color: #2b8a3e; }

/* ---- 列表行里的「核对数」 ---- */
.row .qty .ck-qty { color: #1c7ed6; }
.row .qty .ck-diff { display: inline-block; margin-left: 5px; font-size: 11.5px; font-weight: 500; }
.row .qty .base { display: block; font-size: 11px; font-weight: 400; color: var(--txt-3); }
.row.warn-row { background: #fff8f2; }

/* ---- 输入核对数 / 核验数面板 ---- */
.qty-base { font-size: 13px; color: var(--txt-2); margin: 6px 0 10px; }
.qty-base b { color: var(--txt); font-variant-numeric: tabular-nums; }
#qtyInput { width: 100%; font-size: 27px; padding: 11px 14px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 11px; background: var(--bg);
  color: var(--txt); font-variant-numeric: tabular-nums; }
#qtyInput:focus { outline: 2px solid var(--blue); border-color: var(--blue); background: #fff; }
.qty-diff { margin-top: 9px; font-size: 13.5px; text-align: center; font-weight: 550; }
.qty-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; justify-content: center; }
.qty-quick .chip { min-width: 52px; justify-content: center; }

/* ---- 现场新增商品 ---- */
.cus-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 9px 0 2px; }
.cus-bar .muted { font-size: 11.5px; }
.new-tag { flex: 0 0 auto; background: var(--red-soft); color: var(--red);
  border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 600; }
.acard.cus { border-left-color: var(--red); }
.acard .a3 { margin-top: 7px; font-size: 12.5px; color: var(--txt-2);
  background: var(--bg); border-radius: 8px; padding: 6px 9px; word-break: break-all; }
.abn-dot.new { background: var(--red); }
.row.cus-row { background: #fff5f5; }
.row.cus-row .nm .new-tag { margin-right: 2px; }

/* 现场新增商品的表单 */
.cus-form { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.cus-form .cf-row { display: flex; align-items: center; gap: 10px; }
.cus-form .cf-row > span { flex: 0 0 68px; font-size: 13px; color: var(--txt-2); }
.cus-form .cf-row input, .cus-form .cf-row select {
  flex: 1; min-height: 42px; padding: 8px 11px; font-size: 15px; color: var(--txt);
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg);
  font-family: inherit; }
.cus-form .cf-row input:focus, .cus-form .cf-row select:focus {
  outline: 2px solid var(--blue); border-color: var(--blue); background: #fff; }
.cus-tip { margin-top: 11px; line-height: 1.55; }

/* 商品单号 + 扫码按钮 */
.cf-code { display: flex; gap: 8px; flex: 1; align-items: stretch; }
.cf-code input { flex: 1; min-width: 0; }
.cf-code .btn { flex: 0 0 auto; white-space: nowrap; }
/* 电脑端不摆扫码（约定同核对页）：扫码枪直接往单号框里打即可 */
body.is-pc #btnCusScan { display: none; }

/* ==========================================================================
   核验（复盘）独立页面
   点「开始核验」后整页进琥珀色：顶栏变色 + 底部第二个标签从「核对」变「核验」，
   日常核对和复盘一眼分得开 —— 免得把「核验数」当成「核对数」录进去。
   ========================================================================== */

/* 全站氛围色：进核验模式就把底色和顶栏都换成琥珀 */
body.in-verify { background: linear-gradient(180deg, #fff8ec 0%, var(--bg) 340px); }
body.in-verify .topbar {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 2px 12px rgba(217, 119, 6, .26);
}
body.in-verify .sync { background: var(--amber-soft); color: #92500e; }

/* 底部导航第二个入口：核对 ↔ 核验 */
.tab.verify-tab, .tab.verify-tab i { color: var(--amber); }
.tab.verify-tab.active { color: #b45309; font-weight: 650; }

/* ---- 核对页：「已核对」右边的总核对率 ---- */
.progress-text { display: flex; align-items: baseline; gap: 3px; flex-wrap: wrap; }
.prog-rate { margin-left: 9px; font-size: 12.5px; color: var(--txt-2); white-space: nowrap; }
.prog-rate b { font-size: 15px; color: var(--amber); font-variant-numeric: tabular-nums; }

/* ---- 核验页顶部：核验率 / 还剩几个 / 未核验名单 ---- */
.vhead { border-color: #f3dfc0; background: linear-gradient(180deg, #fffdf8, #fff); }
.vhead.done { border-color: #b7e4c7; background: linear-gradient(180deg, #f5fdf8, #fff); }
.vh-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.vh-top h2 { margin: 0; font-size: 16px; font-weight: 650; }
.vh-top h2 b { color: #b45309; font-variant-numeric: tabular-nums; }
.vhead.done .vh-top h2 b { color: var(--green); }
.vh-badge { flex: 0 0 auto; background: var(--amber); color: #fff; border-radius: 7px;
  padding: 2px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .5px; }
.vhead.done .vh-badge { background: var(--green); }
.vh-top .btn { margin-left: auto; }

.vh-rate { display: flex; align-items: center; gap: 15px; margin: 12px 0 2px; }
.vh-num { flex: 0 0 auto; min-width: 94px; display: flex; flex-direction: column;
  align-items: center; padding: 8px 10px; border-radius: 12px;
  background: var(--amber-soft); border: 1px solid #f0d5a8; }
.vh-num b { font-size: 27px; line-height: 1.15; color: #b45309; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; }
.vh-num span { font-size: 11px; color: #8a5a00; }
.vhead.done .vh-num { background: var(--green-soft); border-color: #b7e4c7; }
.vhead.done .vh-num b, .vhead.done .vh-num span { color: #1b7f3b; }
.vh-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vh-info .vh-left { font-size: 14px; }
.vh-info .vh-left b { font-size: 17px; color: #b45309; font-variant-numeric: tabular-nums; }
.vhead.done .vh-info .vh-left b { color: var(--green); }

.vbar { margin: 11px 0 12px; }
.vbar i { background: linear-gradient(90deg, #f59e0b, #d97706); }
.vhead.done .vbar i { background: linear-gradient(90deg, #34d399, #16a34a); }

.vh-left-box { margin-top: 11px; border-top: 1px dashed #f0d5a8; padding-top: 10px; }
.vh-left-title { font-size: 12.5px; color: var(--txt-2); margin-bottom: 7px; }
.vh-left-title .muted { margin-left: 6px; }
.vh-left-list { display: flex; flex-wrap: wrap; gap: 6px; }
.vh-left-list .chip { min-height: 30px; padding: 0 10px; font-size: 12px;
  border-color: #f0d5a8; background: var(--amber-soft); color: #8a5a00; }

/* ---- 核验页整体配色：卡片的方块标识与扫码卡也换琥珀 ---- */
.page-verify .step { background: var(--amber-soft); color: #b45309; }
.page-verify .scan-card { border-color: #f0d5a8; background: linear-gradient(180deg, #fffbf3, #fff); }
.page-verify #vScanInput:focus { outline: 2px solid #f7dcb0; border-color: var(--amber); }
.page-verify .row.done .ck { background: var(--amber); border-color: var(--amber); }
.page-verify .row.done .nm { color: var(--txt-2); }
/* 电脑端不摆摄像头扫码（约定同核对页）：扫码枪直接往输入框里打 */
body.is-pc #btnVScan { display: none; }

/* 「显示已核验」开关 */
.v-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--txt-2); white-space: nowrap; }
.v-toggle input { width: 16px; height: 16px; accent-color: var(--amber); margin: 0; }
