:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e5e7eb;
  --line-2: #d5d8dd;
  --text: #1b1f24;
  --muted: #6b7280;
  --faint: #9aa1ab;
  --brand: #3b3e9e;
  --brand-bg: #eef0fb;
  --ok: #0f6e56;
  --ok-bg: #e4f5ef;
  --warn: #8a5a12;
  --warn-bg: #fdf3e3;
  --danger: #a32d2d;
  --danger-bg: #fbeaea;
  --radius: 10px;
  --radius-lg: 14px;
  /* 品牌字体：楷体（Windows KaiTi / macOS Kaiti SC / 无楷体回退衬线） */
  --font-brand: 'KaiTi', 'Kaiti SC', 'STKaiti', 'SimKai', 'Noto Serif SC', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 500; }
h1 { font-size: 19px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 208px; flex: 0 0 208px; background: var(--card);
  border-right: 1px solid var(--line); padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { padding: 4px 10px 16px; display: flex; align-items: center; gap: 9px; }
.brand img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.brand .brand-txt { min-width: 0; }
.brand b { font-family: var(--font-brand); font-size: 17px; font-weight: 600; letter-spacing: 3px; display: block; line-height: 1.3; }
.brand span { display: block; font-family: var(--font-brand); font-size: 11.5px; color: var(--faint); margin-top: 2px; letter-spacing: .4px; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border-radius: 8px; color: var(--text); font-size: 13.5px; cursor: pointer;
}
.nav-item:hover { background: #f2f4f7; }
.nav-item.active { background: var(--brand-bg); color: var(--brand); font-weight: 500; }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.nav-item.active .dot { background: var(--brand); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.side-user { font-size: 12px; color: var(--muted); padding: 0 10px 8px; }
.side-user b { color: var(--text); font-weight: 500; display: block; }

.main { flex: 1; min-width: 0; padding: 20px 24px 60px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 14.5px; }
.grid { display: grid; gap: 12px; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.metric:hover { border-color: var(--line-2); }
.metric .k { font-size: 12px; color: var(--muted); }
.metric .v { font-size: 24px; font-weight: 500; line-height: 1.25; margin-top: 2px; }
.metric .v small { font-size: 12px; color: var(--faint); font-weight: 400; margin-left: 4px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--card); color: var(--text); cursor: pointer; white-space: nowrap;
  font-size: 13.5px; transition: background .12s, border-color .12s;
}
.btn:hover { background: #f6f7f9; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #2f3283; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--danger); border-color: #e8c4c4; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f2f4f7; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], select, textarea {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2);
  border-radius: 8px; background: #fff; color: var(--text); outline: none;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,62,158,.12); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl th {
  text-align: left; font-weight: 400; font-size: 12px; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc;
}
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fbfcfd; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 500; }
.tbl .muted { color: var(--muted); font-size: 12.5px; }

/* ---------- 徽标 / 进度 ---------- */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  background: #f1f2f4; color: var(--muted); white-space: nowrap;
}
.badge.blue { background: var(--brand-bg); color: var(--brand); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }

.bar { height: 6px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .2s; }
.bar.ok > i { background: var(--ok); }
.bar.warn > i { background: #d08a2c; }

.steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.steps .st { font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.steps .st i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-2); display: inline-block; position: relative; }
.steps .st.done { color: var(--ok); }
.steps .st.done i { background: var(--ok); border-color: var(--ok); }
.steps .st.done i::after { content: "✓"; color: #fff; font-size: 10px; position: absolute; left: 2.5px; top: -2px; }
.steps .st.cur { color: var(--brand); font-weight: 500; }
.steps .st.cur i { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,62,158,.15); }
.steps .ln { flex: 1; min-width: 12px; height: 1px; background: var(--line); }

/* ---------- 扫码页 ---------- */
.scan-box input {
  height: 62px; font-size: 22px; letter-spacing: .5px; text-align: center;
  border: 2px solid var(--brand); border-radius: 12px; background: #fbfdff;
}
.scan-box input::placeholder { font-size: 15px; letter-spacing: 0; color: var(--faint); }
.scan-hint { text-align: center; font-size: 12px; color: var(--faint); margin-top: 6px; }
.scan-log { max-height: 240px; overflow-y: auto; }
.scan-row { display: flex; justify-content: space-between; gap: 8px; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.scan-row:last-child { border-bottom: none; }
.scan-row .t { color: var(--faint); font-size: 11.5px; }

.big-num { font-size: 34px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.big-num small { font-size: 14px; color: var(--faint); font-weight: 400; }

/* ---------- 箱卡 ---------- */
.carton {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--card);
}
.carton.open { border-color: #b9d3ee; background: #fbfdff; }
.carton.shipped { opacity: .75; }
.carton-no { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kv { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.kv b { color: var(--text); font-weight: 500; }

/* ---------- 标签 / 上传 ---------- */
.drop {
  border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 22px 14px;
  text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; background: #fcfcfd;
}
.drop:hover { border-color: var(--brand); color: var(--brand); background: #fbfdff; }
.file-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.file-item:last-child { border-bottom: none; }
.file-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.thumbs a { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.thumbs img { display: block; width: 100%; height: 92px; object-fit: cover; }

/* ---------- 弹层 ---------- */
.mask { position: fixed; inset: 0; background: rgba(18,22,28,.42); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60; }
.modal { background: var(--card); border-radius: var(--radius-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; padding: 18px; }
.modal.wide { max-width: 720px; }
.modal h3 { font-size: 15px; margin-bottom: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#toast-host { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #23282e; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; max-width: 86vw; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- 空态 ---------- */
.empty { text-align: center; color: var(--faint); font-size: 13px; padding: 36px 12px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.hint { font-size: 12px; color: var(--faint); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .shell { display: block; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; z-index: 70;
    transform: translateX(-100%); transition: transform .18s ease; width: 232px;
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }
  .side.open { transform: none; }
  .main { padding: 14px 12px 80px; }
  .topbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--card); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
  }
  .topbar b { font-size: 14px; font-weight: 500; }
  .topbar .spacer { flex: 1; }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g3 { grid-template-columns: 1fr; }
  .grid.g2 { grid-template-columns: 1fr; }
  .page-head { margin-bottom: 12px; }
  h1 { font-size: 17px; }
  .card { padding: 13px; border-radius: 12px; }
  .metric .v { font-size: 21px; }
  .steps { font-size: 11px; gap: 4px; }
  .steps .st span { display: none; }
  .steps .st.cur span, .steps .st.done span { display: inline; }
  .hide-sm { display: none !important; }
  /* 移动端表格转卡片 */
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 2px; }
  .tbl.cards td { display: flex; justify-content: space-between; gap: 10px; border: none; padding: 3px 0; }
  .tbl.cards td::before { content: attr(data-l); color: var(--muted); font-size: 12px; flex: 0 0 76px; }
  .tbl.cards td .v { text-align: right; }
}

@media print {
  .side, .topbar, .no-print, #toast-host { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
  .card { border: none; padding: 0; }
}

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- 产品图片 ---------- */
.thumb {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; object-fit: cover; background: #eef2f7;
  border: 1px solid var(--line); flex: none; vertical-align: middle;
}
img.thumb { cursor: zoom-in; }
.thumb.blank { border-style: dashed; background: #f7f9fc; }
.thumb.blank::after { content: '无图'; font-size: 10px; color: #aab3c0; }
.thumb-btn { border: 0; background: none; padding: 0; line-height: 0; cursor: pointer; }
.sku-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sku-cell .txt { min-width: 0; }
.sku-img-box { display: flex; gap: 14px; align-items: flex-start; }
.sku-img-box .preview {
  width: 132px; height: 132px; border-radius: 10px; border: 1px dashed var(--line);
  background: #f7f9fc; display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none; color: var(--faint); font-size: 12px;
}
.sku-img-box .preview img { width: 100%; height: 100%; object-fit: cover; }
.sku-img-box .ops { flex: 1; min-width: 0; font-size: 12px; color: var(--faint); line-height: 1.7; }
.sku-img-box .ops .btn-row { margin-bottom: 10px; }
tr.img-drop { background: #eff6ff; outline: 1px dashed var(--brand); outline-offset: -2px; }
.lightbox { background: rgba(10, 14, 20, .84); cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.ci { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
@media (max-width: 860px) {
  .tbl.cards td .sku-cell { justify-content: flex-end; }
  .sku-img-box { gap: 10px; }
  .sku-img-box .preview { width: 104px; height: 104px; }
}

/* ---------- 装箱单打印页 ---------- */
.print-sheet { padding: 22px 24px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.sheet-title { font-size: 20px; font-weight: 500; letter-spacing: 2px; }
.sheet-meta { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.8; }
.sheet-meta b { color: var(--text); font-weight: 500; }
.sheet-kv { display: flex; gap: 24px; font-size: 12px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.sheet-kv b { color: var(--text); font-weight: 500; font-size: 13px; }
.sheet-tbl th { background: #f7f9fc; }
.sheet-sign { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.sheet-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--faint); letter-spacing: 1px; }
.sheet-foot b { font-weight: 600; color: var(--brand); letter-spacing: .5px; }
/* 品牌 wordmark：所有「跨境云」字样统一楷体 */
.brand-word { font-family: var(--font-brand); font-weight: 600; letter-spacing: 3px; }
/* 品牌副标：与 wordmark 同一字体，字距收一点保证小字清晰 */
.brand-sub { font-family: var(--font-brand); letter-spacing: 1.6px; }
.sheet-foot .brand-sub { font-size: 12px; letter-spacing: 1.2px; }
.topbar .brand-word { font-size: 16px; letter-spacing: 2px; }
.sheet-foot .brand-word { font-size: 12.5px; letter-spacing: 2px; color: var(--brand); }
.auth-card h1.brand-word { font-size: 24px; letter-spacing: 4px; }
@media print {
  .print-sheet { padding: 0; }
  .sheet-tbl th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-sign { margin-top: 36px; }
  .print-sheet .thumb { border: 1px solid #ddd; }
}

/* ---------- 装箱批次：标签页 / 手机作业页 ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; text-decoration: none; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.v-sm { font-size: 17px; font-weight: 500; margin-top: 2px; }
.ell { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.pda { max-width: 520px; margin: 0 auto; }
.pda-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 8px; }
.pda-back { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #f2f4f7; color: var(--text); text-decoration: none; font-size: 18px; flex: none; }
.pda-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pda-title b { font-size: 15px; font-weight: 500; }
.pda-title span { font-size: 12px; color: var(--faint); }
.pda-count { font-size: 13px; color: var(--muted); flex: none; }
.pda-count b { font-size: 20px; font-weight: 500; color: var(--text); }
.pda-progress { height: 6px; border-radius: 3px; background: #e8ebef; overflow: hidden; margin-bottom: 12px; }
.pda-progress i { display: block; height: 6px; background: var(--ok); border-radius: 3px; transition: width .2s; }
.pda-body { display: flex; flex-direction: column; gap: 10px; }
.scan-input { height: 56px; font-size: 16px; border-radius: 12px; border: 2px solid var(--brand); background: #fff; padding: 0 14px; width: 100%; color: var(--text); }
.scan-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(59,62,158,.12); }
.pda-msg { min-height: 18px; font-size: 13px; color: var(--muted); }
.pda-msg.ok { color: var(--ok); }
.pda-msg.err { color: var(--danger); }
.pda-msg.warn { color: var(--warn); }
.pda-sub { font-size: 12px; color: var(--faint); margin-top: 6px; }
.pda-empty { background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius-lg); padding: 26px 16px; text-align: center; font-size: 14px; color: var(--muted); line-height: 1.8; }
.pda-empty.warn { border-color: #f0d9b5; background: var(--warn-bg); color: var(--warn); }
.pda-empty b { display: block; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.pda-empty .btn { margin-top: 12px; }

/* PDA 底部固定操作条 */
.pda-foot {
  position: sticky; bottom: 0; z-index: 40;
  display: flex; gap: 8px; align-items: stretch;
  padding: 10px 0 6px; margin-top: 4px;
  background: linear-gradient(transparent, var(--bg) 26%);
}
.pda-foot .btn { padding: 12px 16px; font-size: 15px; }
.pda-foot .btn.primary { flex: 1; }

/* 收货 PDA：数量步进 + 折叠进度 */
.qty-line { display: flex; align-items: center; gap: 8px; }
.qty-line input[type=number] {
  width: 76px; text-align: center; font-size: 17px; font-weight: 500;
  padding: 8px 6px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card);
}
.qty-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--card); font-size: 18px; color: var(--text); cursor: pointer; flex: none;
}
.qty-btn:active { background: #eef1f5; }
.recv-detail { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); padding: 10px 14px; }
.recv-detail summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 500; }
.recv-detail .remain-row { margin-top: 8px; flex-wrap: wrap; }
.recv-detail .remain-row .nowrap { display: inline-flex; gap: 4px; }

/* 点件：明细行直接填数量（PDA） */
.qty-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--faint); padding: 0 2px; }
.qty-head b { color: var(--text); font-weight: 500; }
.qty-list { display: flex; flex-direction: column; gap: 6px; }
.qty-row { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px 7px 10px; }
.qty-row.done { background: #f6fbf8; border-color: #d7ebdf; }
.qr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.qr-top { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.qr-top b { font-size: 13px; flex: none; }
.qr-top span { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-meta { font-size: 11px; color: var(--warn); }
.qr-meta:empty { display: none; }
.qr-qty { display: flex; align-items: baseline; gap: 2px; flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
input.qr-in { width: 58px; flex: none; height: 38px; text-align: center; font-size: 16px; font-weight: 500; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--text); font-variant-numeric: tabular-nums; padding: 0 2px; }
input.qr-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,62,158,.12); }
input.qr-in.warn { border-color: #e8c08a; background: var(--warn-bg); color: var(--warn); }
.qr-more { flex: none; width: 30px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; }

/* 实收直接填写（PC 明细表） */
input.qty-in { width: 64px; height: 30px; text-align: center; padding: 2px 4px; font-size: 13px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; color: var(--text); font-variant-numeric: tabular-nums; display: inline-block; vertical-align: middle; }
input.qty-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,62,158,.12); }
input.qty-in.warn { border-color: #e8c08a; background: var(--warn-bg); color: var(--warn); }
.qty-over { font-size: 11px; color: var(--warn); margin-left: 4px; font-style: normal; }
input.qr-in::-webkit-outer-spin-button, input.qr-in::-webkit-inner-spin-button,
input.qty-in::-webkit-outer-spin-button, input.qty-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 扫码出库 PDA：待发清单行 */
.ship-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 13px;
}
.ship-row + .ship-row { margin-top: 6px; }
.ship-row .ell { color: var(--muted); }
.pda-big { height: 56px; border-radius: 12px; border: 0; background: var(--ok); color: #fff; font-size: 16px; font-weight: 500; width: 100%; cursor: pointer; }
.pda-big:disabled { background: #c9d2dc; cursor: default; }

/* 收货 PDA：扫运单 / 点件 两个页签 */
.pda-tabs { display: flex; gap: 4px; padding: 4px; background: #edf0f4; border-radius: 12px; margin-bottom: 10px; }
.pda-tab { flex: 1; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.pda-tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.track-stat { display: flex; align-items: center; justify-content: space-between; background: var(--brand-bg); color: var(--brand); border-radius: 12px; padding: 9px 14px; font-size: 13px; }
.track-stat b { font-size: 19px; font-weight: 500; }
.track-stat.done { background: var(--ok-bg); color: var(--ok); }
.track-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; max-height: 330px; overflow-y: auto; }
.track-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--line); }
.track-row:last-child { border-bottom: 0; }
.track-row .tr-car { flex: none; font-size: 11px; color: var(--muted); background: #f2f4f7; border-radius: 5px; padding: 2px 6px; }
.track-row .tr-no { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-row .tr-st { flex: none; font-size: 12px; color: var(--faint); }
.track-row .tr-st.ok { color: var(--ok); }
.track-row.on { background: #f8fbfa; }


.label-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.label-img { width: 100%; height: min(44vh, 300px); background: #f7f9fc; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.label-img img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.no-img { font-size: 13px; color: var(--faint); text-align: center; line-height: 1.8; }
.label-info .nm { font-size: 16px; font-weight: 500; }
.label-info .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.label-info .cnt { font-size: 22px; font-weight: 500; margin-top: 6px; font-variant-numeric: tabular-nums; }
.label-info .cnt small { font-size: 12px; color: var(--faint); font-weight: 400; margin-left: 8px; }
.label-tip { text-align: center; font-size: 12px; color: var(--faint); }

.pda-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.sku-chip { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; flex: none; cursor: pointer; }
.sku-chip .nm { display: flex; flex-direction: column; align-items: flex-start; }
.sku-chip .nm b { font-size: 12px; }
.sku-chip .nm i { font-size: 11px; color: var(--faint); font-style: normal; }

.box-card { background: var(--card); border: 2px solid var(--brand); border-radius: var(--radius-lg); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.box-head { display: flex; justify-content: space-between; align-items: center; }
.box-head .mono { font-size: 15px; }
.box-pcs { font-size: 13px; color: var(--muted); }
.box-items { display: flex; flex-direction: column; gap: 6px; }
.box-item { display: flex; align-items: center; gap: 8px; font-size: 13px; background: #f7f9fc; border-radius: 8px; padding: 7px 10px; }
.mini-del { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; color: var(--danger); font-size: 14px; line-height: 1; cursor: pointer; flex: none; }
.remain { display: flex; flex-direction: column; gap: 6px; }
.remain-row { display: flex; align-items: center; gap: 8px; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.remain-row.done { opacity: .55; }
.remain-row .num { font-variant-numeric: tabular-nums; flex: none; }
.remain-row .left { font-size: 12px; color: var(--warn); flex: none; }
.remain-row.done .left { color: var(--ok); }
.closed-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.closed-row .mono { color: var(--text); }
.calc { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 12px; font-size: 13px; text-align: center; }
.calc b { font-size: 20px; font-weight: 500; }
.calc .sep { margin: 0 8px; opacity: .5; }

.scan-card { border-radius: var(--radius-lg); padding: 16px; text-align: center; }
.scan-card.good { background: var(--ok-bg); border: 1px solid #b7e3d3; }
.scan-card.bad { background: var(--danger-bg); border: 1px solid #f1c2c2; }
.scan-label { font-size: 12px; color: var(--muted); }
.scan-no { font-size: 20px; font-weight: 500; margin: 4px 0; }
.scan-meta { font-size: 12px; color: var(--muted); }
.scan-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; margin-top: 10px; }

/* ---------- 费用：按出货批次分组 ---------- */
.fee-pack {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
}
.fee-pack:last-child { margin-bottom: 0; }
.fee-pack > summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; cursor: pointer; list-style: none; user-select: none;
}
.fee-pack > summary::-webkit-details-marker { display: none; }
.fee-pack > summary::before { content: '▸'; color: var(--faint); font-size: 12px; }
.fee-pack[open] > summary::before { content: '▾'; }
.fee-pack[open] > summary { background: #fafbfc; border-bottom: 1px solid var(--line); }
.fee-pack > summary:hover { background: #f7f9fb; }
.fee-pack .pk-no { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.fee-pack .pk-sum { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.fee-pack .pk-body { padding: 0; }
.fee-pack .tbl th { background: transparent; }
.fee-pack .tbl td:first-child, .fee-pack .tbl th:first-child { padding-left: 20px; }
.pk-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 20px; border-top: 1px dashed var(--line); font-size: 13px;
}
.tbl + .pk-foot { border-top: 1px solid var(--line); }
.pk-note {
  padding: 8px 20px 11px; font-size: 12.5px; color: var(--muted);
  background: #fcfcfd; border-top: 1px dashed var(--line);
}
.fee-pack > summary .btn { padding: 2px 8px; font-size: 12px; }

@media (max-width: 1100px) {
  .grid.g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid.g6, .grid.g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pda-body { gap: 8px; }
  .label-img { height: min(40vh, 260px); }
}

/* ---------- 登录页（左右分栏） ---------- */
.login-stage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 28px; background: var(--bg);
}
.login-card {
  width: 100%; max-width: 920px; display: flex; min-height: 556px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; box-shadow: 0 18px 48px rgba(27, 31, 36, .09);
}
.login-brand {
  flex: 0 0 46%; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #3b3e9e 0%, #262863 100%);
  color: #fff; padding: 46px 40px; display: flex; flex-direction: column; justify-content: center;
}
.login-brand .hex-mark { position: absolute; right: -46px; bottom: -54px; width: 260px; height: 260px; opacity: .09; }
.login-brand .wm { display: flex; align-items: center; gap: 13px; }
.login-brand .wm img { width: 54px; height: 54px; object-fit: contain; filter: brightness(0) invert(1); }
.login-brand .wm h1 { font-family: var(--font-brand); font-size: 34px; font-weight: 600; letter-spacing: 7px; line-height: 1.2; }
.login-brand .slogan {
  font-family: var(--font-brand); font-size: 13px; letter-spacing: 3.5px;
  opacity: .8; margin-top: 12px; padding-left: 2px;
}
.login-points { list-style: none; margin: 34px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.login-points li { font-size: 12.5px; color: rgba(255,255,255,.76); display: flex; align-items: center; gap: 9px; letter-spacing: .3px; }
.login-points li::before {
  content: ''; width: 5px; height: 5px; border-radius: 999px; flex: none;
  background: rgba(255,255,255,.55); box-shadow: 0 0 0 3px rgba(255,255,255,.13);
}
.login-side { flex: 1; min-width: 0; padding: 52px 46px; display: flex; flex-direction: column; justify-content: center; }
.login-side h2 { font-size: 20px; font-weight: 600; letter-spacing: .5px; margin: 0 0 26px; }

/* 标签浮在框内 */
.float-field { position: relative; margin-bottom: 14px; }
.float-field input {
  width: 100%; height: 46px; padding: 17px 13px 5px; font-size: 14px;
  border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--text);
}
.float-field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,62,158,.12); }
.float-field label {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--faint); pointer-events: none;
  transition: top .14s ease, font-size .14s ease, color .14s ease;
  background: #fff; padding: 0 3px; line-height: 1.2;
}
.float-field input:focus + label,
.float-field input:not(:placeholder-shown) + label { top: 9px; transform: none; font-size: 10.5px; color: var(--brand); }
.float-field.err input { border-color: #d98b8b; }
.login-err { display: none; font-size: 12px; color: var(--danger); margin: -6px 0 12px; }
.login-err.show { display: flex; align-items: center; gap: 5px; }
.login-forgot { text-align: right; font-size: 11.5px; color: var(--faint); margin: -4px 0 18px; }
.login-btn { height: 48px; font-size: 15px; letter-spacing: 4px; }
.login-foot { margin-top: 20px; font-size: 11.5px; color: var(--faint); line-height: 1.9; text-align: center; }

@media (max-width: 860px) {
  .login-stage { padding: 0; align-items: stretch; }
  .login-card { flex-direction: column; max-width: none; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .login-brand { flex: 0 0 auto; padding: 36px 24px 30px; align-items: center; text-align: center; }
  .login-brand .wm { justify-content: center; }
  .login-brand .wm img { width: 42px; height: 42px; }
  .login-brand .wm h1 { font-size: 26px; letter-spacing: 5px; }
  .login-brand .slogan { margin-top: 9px; font-size: 12px; letter-spacing: 2.5px; }
  .login-points { display: none; }
  .login-brand .hex-mark { width: 180px; height: 180px; right: -50px; bottom: -60px; }
  .login-side { padding: 28px 22px 44px; justify-content: flex-start; }
}
