:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e5e9f0;
  --line-strong: #cbd5e1;
  --text: #1f2733;
  --muted: #6b7a8f;
  --faint: #94a3b8;
  --brand: #1f4e79;
  --brand-soft: #e8f0f8;
  --accent: #ff6a00;
  --accent-dark: #e55d00;
  --accent-soft: #fff1e6;
  --topbar: #1b2331;
  --green: #15803d;
  --green-soft: #e7f6ec;
  --amber: #b45309;
  --amber-soft: #fdf3e4;
  --red: #b91c1c;
  --red-soft: #fdeaea;
  --blue: #1d4ed8;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -16px rgba(15, 23, 42, .28);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 13px/1.55 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: #eef2f7; }
.login-card { width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--brand); }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.login-card input { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius); margin-bottom: 14px; background: #fff; }
.login-card input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.login-hint { color: var(--red); font-size: 12px; min-height: 18px; }

/* ---------- 布局（韩擎风格：深色顶栏 + 白色分组侧栏） ---------- */
.topbar { height: 48px; background: var(--topbar); color: #e6ecf4; display: flex;
  align-items: center; justify-content: space-between; padding: 0 16px; position: sticky; top: 0; z-index: 30; }
.tb-brand { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.tb-logo { width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.tb-brand small { font-weight: 400; font-size: 11px; color: #8494ab; margin-left: 2px; }
.tb-right { display: flex; align-items: center; gap: 14px; }
.tb-clock { font-size: 12px; color: #8494ab; }
.tb-user { display: flex; align-items: center; gap: 8px; }
.tb-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.tb-who { line-height: 1.25; }
.tb-who b { display: block; font-size: 12px; font-weight: 600; color: #fff; }
.tb-who i { font-style: normal; font-size: 10.5px; color: #8494ab; }

.shell { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - 48px); }
.side { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.side nav { padding: 4px 0 12px; }
.nav-cap { padding: 14px 18px 4px; font-size: 11px; color: var(--faint); letter-spacing: .5px; }
.side nav a { margin: 1px 8px; padding: 8px 12px; border-radius: 6px; color: #45516b; font-size: 13px;
  display: flex; align-items: center; gap: 9px; }
.side nav a:hover { background: #f4f6fa; color: var(--text); }
.side nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent); }
.nv-ico { width: 16px; text-align: center; opacity: .75; }
.side-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12px; }
.side-foot .who { color: var(--text); font-weight: 500; }
.side-foot .role { color: var(--faint); margin-top: 1px; }
.side-foot button { margin-top: 8px; background: transparent; border: 1px solid var(--line-strong);
  color: var(--muted); padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.side-foot button:hover { border-color: var(--red); color: var(--red); }

.main { padding: 18px 24px 48px; max-width: 1500px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.eyebrow { color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; }
.page-head h2 { margin: 2px 0 0; font-size: 20px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search], .toolbar input[type=text], .toolbar select {
  padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; min-width: 160px;
}
.toolbar input:focus, .toolbar select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }

.btn { padding: 7px 13px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.danger { color: var(--red); border-color: #e6b4b4; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 卡片与统计 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 20px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel + .panel { margin-top: 14px; }
.panel-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.panel-body { padding: 14px; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; z-index: 1; background: #f7f9fc; text-align: left;
  font-size: 12px; font-weight: 500; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
tbody tr:hover { background: #fafcff; }
tbody tr.clickable { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.name-cell { display: flex; align-items: center; gap: 9px; min-width: 260px; }
.thumb { width: 34px; height: 34px; border-radius: 5px; object-fit: cover; background: #eef2f7; flex: 0 0 auto; border: 1px solid var(--line); }
.name-cell .t { display: grid; gap: 1px; min-width: 0; }
.name-cell .t strong { font-weight: 500; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; }
.name-cell .t em { font-style: normal; color: var(--faint); font-size: 11px; }
/* 悬停放大：缩略图旁边弹出的产品大图 */
img.thumb { cursor: zoom-in; }
#img-zoom { position: fixed; z-index: 9999; pointer-events: none; padding: 5px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
#img-zoom img { display: block; width: 340px; height: 340px; max-width: 340px; object-fit: contain;
  border-radius: 6px; background: #f6f8fb; }
/* 待拣池的店铺列 */
.order-table .store-cell { font-size: 11.5px; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; color: var(--muted); }

.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; border: 1px solid transparent; white-space: nowrap; }
.tag.A { background: var(--green-soft); color: var(--green); border-color: #c6e8d2; }
.tag.B { background: var(--brand-soft); color: var(--brand); border-color: #cfe0f0; }
.tag.C { background: #f1f5f9; color: var(--muted); border-color: #e2e8f0; }
.tag.out { background: var(--red-soft); color: var(--red); border-color: #f0c4c4; }
.tag.low { background: var(--amber-soft); color: var(--amber); border-color: #f3dcb8; }
.tag.ok { background: var(--green-soft); color: var(--green); border-color: #c6e8d2; }
.tag.muted { background: #f1f5f9; color: var(--muted); border-color: #e2e8f0; }

.empty { padding: 36px 16px; text-align: center; color: var(--faint); font-size: 13px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

/* ---------- 抽屉 ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); display: flex; justify-content: flex-end; z-index: 40; }
.drawer { width: min(1080px, 94vw); height: 100%; background: var(--panel); display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(15,23,42,.18); }
.drawer-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.drawer-head .meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.drawer-head .close { margin-left: auto; }
.drawer-body { padding: 14px 18px 28px; overflow: auto; }

/* ---------- 扫码台 ---------- */
.scan-box { background: #fff; color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; margin-bottom: 14px; }
.scan-box label { font-size: 12px; color: var(--muted); }
.scan-input { width: 100%; padding: 14px 16px; font-size: 20px; letter-spacing: 1px; border-radius: 8px;
  border: 2px solid var(--line-strong); background: #fff; color: var(--text);
  font-family: ui-monospace, Consolas, monospace; }
.scan-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 0, .12); }
.scan-input::placeholder { color: var(--faint); }
.scan-flash { padding: 10px 14px; border-radius: 8px; font-size: 13px; display: none; }
.scan-flash.ok { display: block; background: var(--accent-soft); border: 1px solid #ffd4b0; color: var(--accent-dark); font-weight: 500; }
.scan-flash.err { display: block; background: var(--red-soft); border: 1px solid #f3c6c6; color: var(--red); font-weight: 500; }

/* ---------- 打印 ---------- */
.print-root { display: none; }
.label-sheet { display: grid; grid-template-columns: repeat(3, 63.5mm); grid-auto-rows: 29.6mm; gap: 0; }
.label-cell { width: 63.5mm; height: 29.6mm; padding: 1.5mm 2mm; display: flex; flex-direction: column; justify-content: center; gap: .7mm; overflow: hidden; }
.label-cell .lb-name { font-size: 8pt; font-weight: 700; letter-spacing: .3px; line-height: 1.2; color: #111; overflow: hidden; max-height: 1.4em; }
.label-cell .lb-code { display: flex; justify-content: center; align-items: center; overflow: hidden; }
.label-cell .lb-code img { width: 56mm; height: 8.6mm; object-fit: fill; }
.label-cell .lb-text { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 6.2pt; line-height: 1.25; text-align: center; color: #000; white-space: nowrap; overflow: hidden; }
.label-cell .lb-opt { font-size: 7.5pt; font-weight: 600; color: #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sheet-preview { display: grid; gap: 16px; overflow: auto; justify-items: center; }
.sheet-preview .label-sheet { background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,.14); }
.label-cell { background: #fff; }

@media screen {
  .label-sheet .label-cell { outline: 1px dashed #dbe3ec; }
}

@media print {
  body { background: #fff; }
  .topbar, .side, .page-head, .toolbar, .toast, .pager, .panel-head { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .panel { border: 0; border-radius: 0; }
  .panel-body { padding: 0 !important; background: #fff !important; }
  .sheet-preview { display: block; overflow: visible; }
  .sheet-preview .label-sheet { box-shadow: none; margin: 0; }
  .label-sheet { page-break-after: always; }
  .label-sheet:last-child { page-break-after: auto; }
  .label-sheet .label-cell { outline: none; }
  @page { size: A4; margin: 8mm 8.75mm; }
}

/* ---------- 其他 ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #1b2331; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; transition: .2s; pointer-events: none; z-index: 90; font-size: 13px; max-width: 70vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #991b1b; }
.hint { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select { padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 6px; width: 100%; }
.field input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.chk { width: 15px; height: 15px; }

/* ---------- v2 补充 ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--accent-dark); }
.tabs a.on { color: var(--accent-dark); border-bottom-color: var(--accent); font-weight: 500; }
.selbar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; margin-bottom: 12px;
  background: var(--brand-soft); border: 1px solid #cfe0f0; border-radius: var(--radius); }
.selbar b { color: var(--brand); font-size: 12.5px; margin-right: 4px; }
.table-wrap { overflow-x: auto; }

/* ---------- 产品详情浮层（覆盖在当前页之上） ---------- */
.drawer-mask { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end;
  background: rgba(15, 23, 42, .34); opacity: 0; visibility: hidden;
  transition: opacity .16s ease, visibility .16s ease; }
.drawer-mask.open { opacity: 1; visibility: visible; }
.drawer { width: min(1180px, 94vw); height: 100%; background: #fff; display: flex; flex-direction: column;
  box-shadow: -10px 0 30px rgba(15, 23, 42, .18); transform: translateX(28px);
  transition: transform .18s ease; }
.drawer-mask.open .drawer { transform: none; }
.drawer-head { position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 15px 18px; border-bottom: 1px solid var(--line); }
.drawer-title { display: flex; gap: 12px; align-items: flex-start; min-width: 0; padding-right: 28px; }
.drawer-title img, .drawer-title .drawer-img { width: 62px; height: 62px; flex: none;
  object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; background: #f1f5f9; }
.drawer-title .t { min-width: 0; }
.drawer-title .t strong { display: block; font-size: 13.5px; line-height: 1.45; margin-bottom: 4px; }
.drawer-title .hint { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.drawer-x { position: absolute; right: 10px; top: 8px; border: 0; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: #94a3b8; padding: 4px 8px; border-radius: 6px; }
.drawer-x:hover { background: #f1f5f9; color: #334155; }
.drawer-body { flex: 1; overflow: auto; padding: 14px 18px 20px; background: #f6f8fb; }
.drawer-body .panel { background: #fff; }
.drawer-body .panel-head .row { gap: 10px; }
.drawer-table thead th { position: sticky; top: 0; z-index: 1; background: #f8fafc; }
.drawer-table input.po-qty { width: 86px; text-align: right; padding: 5px 8px;
  border: 1px solid #cbd5e1; border-radius: 6px; font-variant-numeric: tabular-nums; }
.drawer-table input.po-qty:focus { border-color: var(--brand); outline: none;
  box-shadow: 0 0 0 2px rgba(31, 78, 121, .12); }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 10px 18px;
  border-top: 1px solid var(--line); background: #fff; }
.drawer-foot .spacer { flex: 1; }
body.drawer-open { overflow: hidden; }
@media (max-width: 720px) { .drawer { width: 100%; } }

/* 采购量列固定在右侧：横向滚动时输入框始终可见 */
.drawer-table .qty-col { position: sticky; right: 0; background: #fff;
  box-shadow: -8px 0 10px -8px rgba(15, 23, 42, .22); }
.drawer-table thead .qty-col { background: #f8fafc; z-index: 2; }
.drawer-table tbody tr:hover .qty-col { background: #f8fafc; }

/* 色号说明单行截断，颜色多的产品不挤占表头 */
.drawer-body .panel-head h3 { white-space: nowrap; }
.color-legend { display: inline-block; max-width: 460px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* 少货浮层比详情窄一些 */
.drawer.narrow { width: min(760px, 94vw); }
.drawer-foot .btn { flex: none; }

/* 组合 SKU 下方的拆解说明 */
.combo-hint { margin-top: 2px; font-size: 10.5px; color: #94a3b8; }
/* 颜色中文参考：韩语名后面的小字括号，不参与交互，只给人核对 */
.color-zh { font-style: normal; font-weight: 400; color: var(--faint); font-size: 11px; margin-left: 2px; }
.color-zh::before { content: "（"; }
.color-zh::after { content: "）"; }

/* 采购单收货：本次入库输入框统一尺寸与对齐 */
#po-table input.recv-qty {
  width: 88px;
  height: 30px;
  padding: 4px 8px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#po-table input.recv-qty:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 78, 121, .12);
}
#po-table input.recv-qty:disabled {
  background: #f3f6fa;
  border-color: #e2e8f0;
  color: #b6c0cc;
}
#po-table th:last-child,
#po-table td:last-child { width: 112px; }
#po-table td:last-child .recv-qty { display: block; margin: 0 auto; }

/* 单件单价：批量输入与行内输入 */
.bulk-cost {
  width: 96px;
  height: 28px;
  padding: 3px 8px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bulk-cost:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 78, 121, .12);
}
.drawer-table input.cost-input {
  width: 72px;
  height: 26px;
  padding: 3px 6px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.drawer-table input.cost-input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 78, 121, .12);
}
.drawer-table input.cost-input.cost-saved {
  border-color: #15803d;
  box-shadow: 0 0 0 2px rgba(21, 128, 61, .15);
}

/* ---------- 出库拣货 ---------- */
.banner { padding: 9px 13px; border-radius: var(--radius); margin-bottom: 12px;
  font-size: 12.5px; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: #fafbfc; color: var(--text); }
.banner b { color: var(--accent-dark); }
.banner.ok { background: var(--accent-soft); border-color: #ffd4b0; border-left-color: var(--accent); color: var(--accent-dark); }
.banner.warn { background: #fafbfc; border-color: var(--line); border-left-color: var(--amber); }
.banner.warn b { color: var(--amber); }

.bar { display: inline-block; width: 62px; height: 6px; background: #eef2f7;
  border-radius: 999px; overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .15s ease; }
.bar.done i { background: var(--green); }

.wave-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(380px, .88fr);
  gap: 14px; align-items: start; }
.wave-grid > .panel { margin-top: 0; }
@media (max-width: 1180px) { .wave-grid { grid-template-columns: 1fr; } }

/* 待拣订单列表：订单号和箱号挤在一列，行高要压住，否则 40 行只能看一半 */
.order-table td { padding: 6px 10px; }
.order-table .ob-id { color: var(--text); font-size: 12px; }
.order-table .ob-meta { white-space: nowrap; font-size: 10.5px; }
.order-table .name-cell .t em { max-width: 460px; }

.scan-box.compact { padding: 12px; gap: 8px; margin-bottom: 10px; }
.scan-box.compact .scan-input { padding: 10px 12px; font-size: 17px; }

.wave-units { max-height: calc(100vh - 340px); min-height: 180px; }
.pick-table td { padding: 6px 9px; font-size: 12px; }
.pick-table thead th { font-size: 11.5px; padding: 7px 9px; }
.pick-table tr.done td { background: #f5fbf7; }
.pick-table tr.done .picked { color: var(--green); }
.pick-table .req { color: var(--muted); }

.order-list { max-height: 300px; overflow: auto; padding: 8px; display: grid; gap: 6px;
  border-bottom: 1px solid var(--line); background: #fbfcfe; align-content: start; }.order-item { display: block; width: 100%; text-align: left; cursor: pointer; background: #fff;
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font: inherit; }
.order-item:hover { border-color: var(--line-strong); }
.order-item.on { border-color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 0 0 2px rgba(31, 78, 121, .08); }
.order-item .oi-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.order-item .oi-top .mono { color: var(--text); font-size: 11.5px; }
.order-item .oi-sub { display: block; color: var(--muted); font-size: 11px; margin: 2px 0 6px; }
.order-item .bar { width: 100%; height: 4px; }

.pack-work { padding: 10px 12px 14px; }
.pack-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pack-lines { display: grid; gap: 3px; margin-bottom: 10px; }
.pack-line { font-size: 11.5px; color: var(--text); }
.pack-line b { color: var(--brand); }
.pack-line em { display: block; font-style: normal; color: var(--faint); font-size: 10.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-units { display: grid; gap: 4px; }
.pack-unit { display: flex; align-items: center; justify-content: space-between;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; background: #fff; }
.pack-unit.done { background: var(--green-soft); border-color: #c6e8d2; color: var(--green); }

/* 拣货单打印：屏幕上隐藏，打印时只留这一块 */
.print-only { display: none; }
.pick-sheet { font-size: 10px; color: #111; }
.pick-sheet .ps-head { display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid #111; padding-bottom: 2.5mm; margin-bottom: 3mm; }
.pick-sheet h1 { margin: 0; font-size: 16px; line-height: 1.25; letter-spacing: .5px; }
.pick-sheet .ps-sub { font-size: 9.5px; color: #555; margin-top: 1.5mm; }
.pick-sheet .ps-meta { text-align: right; font-size: 9.5px; line-height: 1.7; }
.pick-sheet table { width: 100%; border-collapse: collapse; }
.pick-sheet th, .pick-sheet td { border: 1px solid #999; padding: 1.6mm 1.5mm; }
.pick-sheet th { background: #eee; font-size: 9.5px; font-weight: 600; text-align: left; }
.pick-sheet td.c { text-align: center; }
.pick-sheet td.big { font-size: 12px; font-weight: 700; text-align: center; }
.pick-sheet td.box { background: #fafafa; }
.pick-sheet .ps-foot { display: flex; justify-content: space-between; margin-top: 5mm; font-size: 10px; }

@media print {
  body.print-pick .shell { display: none !important; }
  body.print-pick .topbar { display: none !important; }
  body.print-pick .print-only { display: block !important; }
  body.print-pick .toast { display: none !important; }
  body.print-pick { background: #fff; }
  .pick-sheet { font-size: 9.5px; }
  .pick-sheet tr { page-break-inside: avoid; }
  @page { size: A4 portrait; margin: 10mm; }
}

/* ---------- 产品维度库存 ---------- */
.stock-table td { padding: 7px 10px; }
.stock-table .name-cell { min-width: 320px; }

/* ---------- 条码打印：产品折叠 ---------- */
#lp-list { max-height: 480px; overflow: auto; padding-right: 4px; }
.lp-group { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; overflow: hidden; background: #fff; }
.lp-prod { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  background: #fff; border: 0; cursor: pointer; text-align: left; font: inherit; }
.lp-prod:hover { background: #f8fafc; }
.lp-prod.open { background: var(--brand-soft); }
.lp-caret { width: 10px; color: var(--brand); font-size: 9px; flex: none; }
.lp-t { display: grid; gap: 1px; min-width: 0; flex: 1; }
.lp-t strong { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-t em { font-style: normal; color: var(--faint); font-size: 11px; }
.lp-count { color: var(--brand); font-size: 11.5px; white-space: nowrap; }
.lp-units { border-top: 1px solid var(--line); background: #fbfcfe; }
.lp-units td, .lp-units th { padding: 6px 10px; }
.lp-units .lp-qty { width: 76px; text-align: right; padding: 4px 6px;
  border: 1px solid #dbe3ec; border-radius: 5px; }

/* ---------- 库位 ---------- */
.loc-table td { padding: 7px 10px; }
.loc-table th:last-child, .loc-table td:last-child { text-align: right; }
.drawer-table input.loc-input {
  width: 96px; height: 26px; padding: 3px 6px; box-sizing: border-box;
  border: 1px solid #cbd5e1; border-radius: 5px;
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px;
  text-transform: uppercase;
}
.drawer-table input.loc-input:focus {
  border-color: var(--brand); outline: none; box-shadow: 0 0 0 2px rgba(31, 78, 121, .12);
}
.drawer-table input.loc-input.cost-saved {
  border-color: #15803d; box-shadow: 0 0 0 2px rgba(21, 128, 61, .15);
}

/* 货位标签：和商品标签同一张 A4 规格，3 列 */
.loc-sheet { display: grid; grid-template-columns: repeat(3, 63.5mm); grid-auto-rows: 29.6mm; }
.loc-label { width: 63.5mm; height: 29.6mm; padding: 2mm 2mm 1.5mm;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1mm; }
.loc-label .ll-code { font-size: 15pt; font-weight: 700; letter-spacing: .6px; color: #000; line-height: 1.1; }
.loc-label img { width: 52mm; height: 8mm; object-fit: fill; }
.loc-label .ll-note { font-size: 7pt; color: #444; }

/* 库存浮层里的库位输入/下拉（表格不是 .drawer-table） */
.loc-input.stock-loc {
  width: 100%; height: 26px; padding: 3px 6px; box-sizing: border-box;
  border: 1px solid #cbd5e1; border-radius: 5px; background: #fff;
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; text-transform: uppercase;
}
.loc-input.stock-loc:focus {
  border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(255, 106, 0, .12);
}
.loc-input.stock-loc.cost-saved {
  border-color: #15803d; box-shadow: 0 0 0 2px rgba(21, 128, 61, .15);
}

/* ---------- 输入弹窗（采购单命名） ---------- */
.prompt-mask { position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, .42);
  display: grid; place-items: center; padding: 20px; }
.prompt-card { width: min(430px, 94vw); background: #fff; border-radius: 10px;
  box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .55); padding: 18px 20px 16px;
  display: grid; gap: 8px; }
.prompt-card h3 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.prompt-card label { font-size: 12px; color: var(--muted); }
.prompt-card input { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: #fff; }
.prompt-card input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.prompt-hint { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.prompt-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* ---------- 库位图 ---------- */
.map-legend { gap: 4px 12px; font-size: 11.5px; color: var(--muted); align-items: center; }
.map-legend .lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 3px; }
.map-legend .lg.hot { background: #fdf1f1; border: 1px solid #e6b4b4; }
.map-legend .lg.mid { background: #eef4fb; border: 1px solid #b9cde4; }
.map-legend .lg.cold { background: #eef8f0; border: 1px solid #b3d8bf; }
.map-legend .lg.aisle { background: repeating-linear-gradient(135deg, #f3f6fa, #f3f6fa 2px, #e4eaf1 2px, #e4eaf1 4px);
  border: 1px dashed #d7e0ea; }
.map-legend .lg.off { background: #fafbfd; border: 1px dashed #cbd5e1; }
.map-wrap { padding: 14px 16px 4px; background: #fbfcfe; overflow-x: auto; }
.wh-map { display: grid; gap: 6px; min-width: 760px; }
.map-area { display: flex; align-items: center; justify-content: center; border-radius: 6px;
  font-size: 11.5px; letter-spacing: .3px; color: var(--muted); }
.map-area.in { background: #eef4fb; border: 1px dashed #b9cde4; color: #1f4e79; }
.map-area.out { background: #eef8f0; border: 1px dashed #b3d8bf; color: #15803d; }
.map-area.aisle { background: repeating-linear-gradient(135deg, #f3f6fa, #f3f6fa 6px, #eef2f7 6px, #eef2f7 12px);
  border: 1px dashed #d7e0ea; font-size: 11px; }
/* 收货区是竖条：文字竖排，省得挤成好几行 */
.vertical-label { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 4px; font-size: 12px; }
.map-gap { background: repeating-linear-gradient(135deg, #f3f6fa, #f3f6fa 5px, #edf1f6 5px, #edf1f6 10px);
  border-radius: 4px; }
.map-rack { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: pointer;
  padding: 2px; font: inherit; transition: .12s; }
.map-rack:hover { border-color: var(--brand); box-shadow: 0 3px 10px -5px rgba(15, 23, 42, .5); transform: translateY(-1px); }
.map-rack .mr-code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 600; color: #1f4e79; }
.map-rack .mr-role { font-size: 10px; color: var(--muted); line-height: 1.2; }
.map-rack.off { background: #fafbfd; border-style: dashed; }
.map-rack.off .mr-code { color: var(--faint); font-weight: 500; }
.map-rack.hot.on { background: #fdf1f1; border-color: #e6b4b4; }
.map-rack.mid.on { background: #eef4fb; border-color: #b9cde4; }
.map-rack.cold.on { background: #eef8f0; border-color: #b3d8bf; }
.map-notes { padding: 6px 16px 14px; font-size: 11.5px; color: var(--muted); display: grid; gap: 8px; }
.map-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 10px; }
.map-plan .mp { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 8px; line-height: 1.45; }
.map-plan .mp b { display: block; color: var(--text); font-size: 11.5px; font-weight: 600; }
.map-plan .mp span { color: var(--muted); font-size: 11px; }
.map-plan .mp.hot { border-color: #e08a8a; }
.map-plan .mp.mid { border-color: #8fb0d6; }
.map-plan .mp.cold { border-color: #8dc3a0; }
.map-note-list { display: grid; gap: 2px; }
.map-outside { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 20px;
  padding: 2px 9px; font-size: 11.5px; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 工作日志 ---------- */
.wl-chart { display: grid; grid-template-columns: repeat(24, 1fr); gap: 5px; align-items: end; }
.wl-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wl-pair { height: 112px; display: flex; align-items: flex-end; gap: 2px; }
.wl-bar { flex: 1; min-height: 0; border-radius: 2px 2px 0 0; }
.wl-bar.in { background: #3b82f6; }
.wl-bar.out { background: #f59e0b; }
.wl-x { font-size: 10px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.wl-col:hover .wl-bar { filter: brightness(1.08); }
.wl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.wl-dot.in { background: #3b82f6; }
.wl-dot.out { background: #f59e0b; }
.wl-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.wl-metric { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 10px; }
.wl-metric .k { font-size: 11.5px; color: var(--muted); }
.wl-metric .v { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0 1px; }
.wl-metric .v small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.wl-mini { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.wl-mini i { display: block; height: 5px; border-radius: 2px; background: #3b82f6; min-width: 1px; }
.wl-mini b { display: block; height: 5px; border-radius: 2px; background: #f59e0b; min-width: 1px; }
#toolbar input[type=date] { padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
tr.on td { background: #f3f7fd; }

/* ---------- 上架库位 & 上架任务单 ---------- */
.pa-table td { padding: 6px 9px; }
.pa-code { font-size: 12px; font-weight: 600; letter-spacing: .3px; }
#po-putaway .panel-head { padding: 9px 12px; }
#po-putaway .banner.warn { padding: 7px 10px; font-size: 11.5px; }
.put-sheet .put-block { margin-bottom: 3.5mm; page-break-inside: avoid; }
.put-sheet .put-head { display: flex; align-items: baseline; gap: 2.5mm;
  border-left: 3px solid #111; padding: 0 0 0 2mm; margin-bottom: 1.2mm; }
.put-sheet .put-no { display: inline-block; min-width: 5mm; font-size: 9px; color: #666; }
.put-sheet .put-code { font-family: Consolas, monospace; font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.put-sheet .put-role { font-size: 9px; color: #555; }
.put-sheet .put-sum { margin-left: auto; font-size: 10px; font-weight: 600; }
.put-sheet .put-pc { color: #777; font-size: 8.5px; }

/* ---------- 订单列表（韩擎订单中心风格：状态页签 + 筛选条） ---------- */
.status-tabs { display: flex; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; }
.status-tabs button { border: 0; background: transparent; padding: 7px 12px; border-radius: 6px;
  cursor: pointer; color: var(--muted); font-size: 12.5px; font: inherit; font-size: 12.5px; }
.status-tabs button:hover { background: #f4f6fa; color: var(--text); }
.status-tabs button.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.status-tabs .cnt { margin-left: 4px; font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }
.filter-bar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; align-items: center; }
.filter-bar input[type=search], .filter-bar input[type=date] {
  padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.filter-bar input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.ol-table td { padding: 7px 10px; font-size: 12px; }
.ol-table .name-cell { min-width: 260px; }

/* ---------- 包装验货（韩擎风格：左扫码台 + 右验货详情） ---------- */
.pack-grid { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 14px; align-items: start; }
.pack-left { display: grid; gap: 14px; }
.pack-right { min-height: 430px; display: flex; flex-direction: column; }
.pack-right .panel-head { position: sticky; top: 48px; background: #fff; z-index: 2; }
.pack-right .panel-body { flex: 1; }
@media (max-width: 1080px) { .pack-grid { grid-template-columns: 1fr; } }
.pk-scanbody { display: grid; gap: 8px; }
.pk-scanrow { display: flex; gap: 8px; }
.pk-input { flex: 1; padding: 11px 13px; font-size: 15px; letter-spacing: .5px;
  border: 2px solid var(--line-strong); border-radius: 8px; background: #fff;
  color: var(--text);
  font-family: ui-monospace, Consolas, monospace; }
.pk-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 0, .12); }
.pk-input::placeholder { color: var(--faint); }
.pk-checklist { list-style: none; margin: 0; padding: 12px 16px; display: grid; gap: 8px;
  color: var(--muted); font-size: 12px; }
.pk-checklist li { padding-left: 18px; position: relative; }
.pk-checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.pk-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.pk-empty .ico { font-size: 46px; color: var(--faint); opacity: .4; line-height: 1; }
.pk-empty .t1 { font-size: 15px; font-weight: 600; color: var(--muted); margin-top: 10px; }
.pk-empty .t2 { font-size: 12px; color: var(--faint); margin-top: 8px; line-height: 1.8; }
#pk-queue table td { padding: 7px 12px; font-size: 12px; }
.pk-opt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
  cursor: pointer; user-select: none; }
.pk-opt input { accent-color: var(--accent); }
.pk-picker { display: grid; gap: 8px; max-height: calc(100vh - 260px); overflow: auto; }
.pk-cand { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  cursor: pointer; font: inherit; }
.pk-cand:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 0, .1); }
.pk-cand .c { flex: 1; min-width: 0; }
.pk-cand .c .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.pk-cand .r { text-align: right; white-space: nowrap; }
