﻿/* ========== 东宏通发货管理系统 v2 样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --sidebar-w: 190px;
  --sidebar-bg: #1c2333;
  --sidebar-hover: #2a3450;
  --accent: #2f6bff;
  --accent-dark: #1f52cc;
  --warn: #e8590c;
  --ok: #2b8a3e;
  --bg: #f4f6fa;
  --card: #fff;
  --border: #e3e8f0;
  --text: #232a35;
  --text-sub: #7a8499;
  --radius: 10px;
}
html, body { height: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  -webkit-text-size-adjust: 100%;
}
#app { display: flex; min-height: 100vh; width: 100%; max-width: 100vw; }
img, svg { max-width: 100%; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--sidebar-bg); color: #c8d0e0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 22px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-name { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.brand-sub { font-size: 12px; color: #8b96ab; margin-top: 3px; }
.side-nav { flex: 1; padding: 12px 10px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; margin-bottom: 4px; border: none; border-radius: 8px;
  background: transparent; color: #c8d0e0; font-size: 14px; cursor: pointer; text-align: left;
  font-family: inherit;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-ico { font-size: 15px; width: 20px; text-align: center; }
.side-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #8b96ab; }
.side-time { margin-bottom: 4px; }

/* ---------- 主区域 ---------- */
.main { flex: 1; padding: 24px 28px 60px; max-width: 1800px; min-width: 0; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 20px; font-weight: 700; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }
.page-sub { color: var(--text-sub); margin: -8px 0 14px; font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px;
  cursor: pointer; font-family: inherit; transition: background .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary {
  background: linear-gradient(135deg, #4d84ff 0%, #2f6bff 55%, #1f52cc 100%);
  color: #fff; border-radius: 9px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(47, 107, 255, .22);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #5b90ff 0%, #3a76ff 55%, #2a5ede 100%);
  box-shadow: 0 4px 14px rgba(47, 107, 255, .32);
  transform: translateY(-1px);
  filter: brightness(1.03);
}
.btn-primary:active { transform: translateY(0); filter: brightness(.97); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f0f3f9; }
.btn-big { padding: 14px 20px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 新建发货单按钮（渐变圆角 + 图标底座） */
.btn-new-order {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #4d84ff 0%, #2f6bff 55%, #1f52cc 100%);
  color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px 10px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; letter-spacing: .5px;
  box-shadow: 0 3px 10px rgba(47, 107, 255, .25);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  white-space: nowrap;
}
.btn-new-order:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(47, 107, 255, .35);
  filter: brightness(1.05);
}
.btn-new-order:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(47, 107, 255, .25);
  filter: brightness(.97);
}
.btn-new-order .no-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  font-size: 14px; font-weight: 700; line-height: 1;
  flex: none;
}
.btn-close { background: none; border: none; font-size: 16px; color: var(--text-sub); cursor: pointer; padding: 4px 8px; }
.mini-btn {
  border: 1px solid var(--border); background: #fff; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text); margin-right: 4px;
}
.mini-btn:hover { background: #f0f3f9; }
.mini-btn.danger { color: #d9480f; border-color: #ffc9b0; }
.mini-btn.danger:hover { background: #fff0e6; }
.mini-btn.primary { color: var(--accent); border-color: #a5c0ff; }

/* ---------- 输入框 ---------- */
.search-input {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
  font-size: 14px; min-width: 220px; background: #fff; font-family: inherit; color: var(--text);
}
.search-input:focus { outline: none; border-color: var(--accent); }
.f-label { display: block; font-size: 13px; color: #5a6474; margin: 14px 0 7px; font-weight: 600; }
.f-label .req { color: #e03131; }
select.search-input { min-width: 220px; }

/* ---------- 统计卡片 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; min-width: 0;
}
.stat-card.warn { border-left: 4px solid var(--warn); }
.stat-card.clickable { cursor: pointer; transition: box-shadow .15s, transform .1s, border-color .15s; }
.stat-card.clickable:hover { box-shadow: 0 6px 18px rgba(47,107,255,.12); transform: translateY(-2px); border-color: var(--accent); }
.stat-card.clickable:active { transform: translateY(0); }
.stat-num { font-size: 30px; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--text); font-size: 14px; margin-top: 4px; font-weight: 600; }
.stat-cap { color: var(--text-sub); font-size: 12px; margin-top: 2px; word-break: break-all; }

/* 面板标题 + 跳转链接 */
.panel-title-flex { display: flex; justify-content: space-between; align-items: center; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 12.5px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: #eaf1ff; }

/* ---------- 面板 ---------- */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; min-width: 0; }
.panel-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
#rpByProductWrap { max-height: 480px; overflow-y: auto; }
.grid-2col > * { min-width: 0; }
.panel-chart { display: flex; flex-direction: column; }
.panel-chart .bar-chart { flex: 1; align-items: center; }

/* ---------- 表格 ---------- */
.tbl-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.tbl th {
  text-align: left; padding: 11px 14px; background: #f8fafd; color: var(--text-sub);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafbfe; }
.dai-diff { color: #d32f2f !important; font-weight: 600; }
.own-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 9px; font-size: 11px; font-weight: 600; color: #fff; background: #e67e22; vertical-align: 1px; }
.tbl td .cell-sub { word-break: break-all; }

/* ---------- 手机端卡片列表（替代宽表格，点击展开详情） ---------- */
.prod-cards { display: none; }
.pc-list { display: none; }
.pc-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px; overflow: hidden;
}
.pc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; cursor: pointer; user-select: none; min-width: 0;
}
.pc-head:active { background: #f5f8ff; }
.pc-head-main { min-width: 0; flex: 1; }
.pc-head-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.pc-arrow { color: var(--text-sub); font-size: 14px; flex-shrink: 0; }
.pc-detail { display: none; padding: 4px 15px 15px; border-top: 1px dashed var(--border); }
.pc-card.open .pc-detail { display: block; }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.pc-item {
  background: #f8fafd; border-radius: 8px; padding: 9px 11px; min-width: 0;
}
.pc-item.pc-bc { grid-column: 1 / -1; }
.pc-k { display: block; font-size: 11.5px; color: var(--text-sub); margin-bottom: 3px; }
.pc-v { font-size: 14px; font-weight: 600; word-break: break-all; }
.pc-v.mono { font-family: Consolas, monospace; font-size: 13px; }
.pc-v.stock-num.zero { color: #e03131; }
.pc-v.stock-num.low { color: var(--warn); }
.pc-item .mini-bc { max-width: 100%; height: 26px; margin-top: 5px; }
.pc-actions { display: flex; gap: 8px; margin-top: 12px; }
.pc-actions .mini-btn { flex: 1; text-align: center; margin-right: 0; padding: 9px 4px; }
.pc-empty { padding: 20px 4px; text-align: center; }
.pc-line { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid #eef1f6; gap: 10px; min-width: 0; }
.pc-line:last-child { border-bottom: none; }
.pc-line .pc-k { margin-bottom: 0; flex-shrink: 0; }
.pc-line .pc-v { text-align: right; }
.pc-detail-list { margin-top: 10px; }
.pc-bar { height: 8px; background: #eef1f6; border-radius: 4px; overflow: hidden; margin: 6px 0 2px; }
.pc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5b8cff, var(--accent)); border-radius: 4px; }
.cell-name { font-weight: 600; }
.cell-sub { color: var(--text-sub); font-size: 12px; margin-top: 2px; }
.cell-barcode { font-family: Consolas, monospace; font-size: 12px; color: var(--text-sub); }
.mini-bc { display: block; max-width: 120px; height: 26px; margin-top: 3px; }
.stock-num { font-weight: 700; font-size: 15px; }
.stock-num.zero { color: #e03131; }
.stock-num.low { color: var(--warn); }
.stock-sub { color: var(--text-sub); font-weight: 400; margin: 0 1px; }
.stock-cap { font-size: 12px; color: var(--text-sub); }
/* 主仓视图: 代发仓有货时标红提醒 */
.dai-warn { color: #e11d48; font-weight: 700; }
/* 仓库切换标签 */
.wh-tabs { display: flex; gap: 8px; margin: 2px 0 10px; }
.wh-tab {
  padding: 7px 18px; border-radius: 20px; border: 1px solid var(--line, #e2e5ea);
  background: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--text-sub, #667);
}
.wh-tab.active { background: var(--accent, #2563eb); color: #fff; border-color: var(--accent, #2563eb); }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.status-pill.ok { background: #e6f4ea; color: var(--ok); }
.status-pill.warn { background: #fff1e6; color: var(--warn); }
.mono { font-family: Consolas, monospace; }

/* ---------- 柱状图(纯CSS) ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding: 10px 6px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-val { font-size: 12px; color: var(--text-sub); margin-bottom: 5px; }
.bar-box { width: 100%; max-width: 46px; background: linear-gradient(180deg, #5b8cff, #2f6bff); border-radius: 6px 6px 0 0; min-height: 3px; }
.bar-col.today .bar-box { background: linear-gradient(180deg, #ff922b, #e8590c); }
.bar-date { font-size: 11.5px; color: var(--text-sub); margin-top: 6px; }
.bar-chart.empty .bar-col .bar-box { background: #e3e8f0; }

/* ---------- 预警列表 ---------- */
.alert-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid #eef1f6; gap: 8px; min-width: 0;
}
.alert-item > div:first-child { min-width: 0; flex: 1; }
.alert-item:last-child { border-bottom: none; }
.alert-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-sub { color: var(--text-sub); font-size: 12px; margin-top: 2px; }
.alert-badge { background: #fff1e6; color: var(--warn); padding: 4px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }

/* ---------- 条码打印 ---------- */
.print-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.print-layout > * { min-width: 0; }
/* 桌面端: 预览面板吸顶固定, 滚动左侧滑块面板时预览始终同步可见 */
@media (min-width: 901px) {
  .print-layout > .panel:last-child { position: sticky; top: 16px; }
}
.print-config .f-label:first-of-type { margin-top: 4px; }
.tip { color: var(--text-sub); font-size: 12.5px; line-height: 1.7; margin-top: 12px; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.printer-actions { display: flex; gap: 8px; margin-top: 10px; }
.printer-actions .btn { flex: 1; }
.print-methods { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.print-methods .btn { width: 100%; padding: 13px 12px; font-size: 15px; justify-content: center; }
.btn-ghost-big {
  background: #fff; color: var(--primary); border: 1.5px solid var(--primary);
}
.btn-ghost-big:hover { background: var(--primary-light); }
.bt-status {
  font-size: 13px; color: var(--text-sub); background: #f1f3f8; border-radius: 8px;
  padding: 9px 12px; margin-bottom: 10px;
}
.bt-status.ok { background: #e6f4ea; color: var(--ok); font-weight: 600; }
.msg.ok { color: var(--ok); }
.msg.err { color: #e03131; }
.label-preview {
  border: 2px dashed #c8d0e0; border-radius: 10px; padding: 20px;
  display: flex; justify-content: safe center; align-items: safe center; min-height: 220px;
  overflow: auto; /* 上下/左右可滚动, 调节位置时预览始终可达 */
}
.label-card {
  width: 40mm; min-height: 30mm; background: #fff; border: 1px solid #ddd;
  padding: 2mm 1.5mm; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: Arial, "Microsoft YaHei", sans-serif; text-align: center;
  position: relative; /* 供手动调节缩放/位置 */
  transform-origin: top center;
  margin: auto; /* flex 内安全居中, 溢出时仍可滚动查看 */
}
.label-card .lc-date { font-size: 7px; color: #888; line-height: 1.1; }
.label-card .lc-name { font-size: 9px; font-weight: 700; line-height: 1.2; margin-top: .5mm; }
.label-card .lc-spec { font-size: 7.5px; color: #444; margin-top: .5mm; line-height: 1.2; }
.label-card .lc-svg { width: 95%; height: auto; margin-top: .5mm; }
.label-card .lc-code { font-size: 6.5px; letter-spacing: .4px; margin-top: .5mm; }

/* ---------- 发货扫码 ---------- */
.ship-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; align-items: start; }
.ship-layout > * { min-width: 0; }
.order-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px;
  cursor: pointer; background: #fff; transition: border-color .15s; min-width: 0;
}
.order-card:hover { border-color: var(--accent); }
.order-card.selected { border-color: var(--accent); background: #f5f8ff; }
.order-no { font-size: 12px; color: var(--text-sub); margin-top: 5px; font-family: Consolas, monospace; word-break: break-all; }
.order-meta { color: var(--text-sub); font-size: 12.5px; margin-top: 4px; word-break: break-all; }
.order-customer { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 2px; }
.order-goods { font-size: 13px; color: var(--text-sub); margin-top: 3px; word-break: break-all; }
.order-qty { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 3px; }
.order-badge { float: right; font-size: 12px; padding: 3px 10px; border-radius: 20px; }
.order-badge.pending { background: #fff1e6; color: var(--warn); }
.order-badge.done { background: #e6f4ea; color: var(--ok); }
.order-card .cancel-order {
  float: right; margin-left: 8px; background: none; border: 1px solid #f0c9c9; color: #e03131;
  font-size: 12px; padding: 3px 10px; border-radius: 20px; cursor: pointer; margin-top: 2px;
}
.order-card .cancel-order:hover { background: #fff0f0; }
.sub-count { color: var(--text-sub); font-size: 12.5px; font-weight: 400; margin-left: 6px; }
.mt16 { margin-top: 16px; }

/* 订单核验进度 */
.ship-progress { margin-bottom: 10px; }
.sp-bar { height: 8px; background: #eef1f6; border-radius: 5px; overflow: hidden; margin-top: 6px; }
.sp-fill { height: 100%; background: linear-gradient(90deg, #5b8cff, #2f6bff); border-radius: 5px; transition: width .3s; }
.sp-bar.full .sp-fill { background: linear-gradient(90deg, #51cf66, #2f9e44); }
.sp-text { font-size: 12.5px; color: var(--text-sub); }
.ship-customer { margin-bottom: 10px; font-size: 14px; word-break: break-all; }
.ship-item {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; background: #fff;
  gap: 10px; min-width: 0; flex-wrap: wrap;
}
.ship-item > div:first-child { min-width: 0; flex: 1 1 180px; }
.ship-item.verified { border-color: var(--ok); background: #f0f9f2; }
.ship-item-name { font-weight: 600; word-break: break-all; }
.ship-item-sub { color: var(--text-sub); font-size: 12px; margin-top: 2px; word-break: break-all; }
.ship-item-qty { font-weight: 700; font-size: 15px; }
.ship-item-count { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ship-item-count .it-progress { width: 70px; height: 6px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.ship-item-count .it-progress i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .3s; }
.ship-item-count .it-txt { font-size: 12.5px; color: var(--text-sub); min-width: 88px; text-align: right; }
.verify-mark { margin-left: 10px; font-weight: 700; color: var(--ok); }
.verify-batch { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.verify-batch label { font-size: 13px; color: var(--text-sub); }
.verify-batch input { width: 70px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; text-align: center; }
.verify-batch input:focus { outline: none; border-color: var(--accent); }
.verify-hint { font-size: 12px; color: var(--text-sub); }
/* 扫码枪/手动输入条码 */
.verify-gun { margin: 10px 0 12px; }
.verify-gun label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.gun-row { display: flex; gap: 8px; }
.gun-row input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; letter-spacing: 0.5px;
}
.gun-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12); }
.gun-row .btn { white-space: nowrap; }
.ship-actions { display: flex; gap: 10px; margin-top: 14px; }
.msg { margin-top: 10px; font-size: 13.5px; }
.msg.ok { color: var(--ok); }
.msg.err { color: #e03131; }
.scan-tip-box {
  background: #f8fafd; border: 1px dashed var(--border); border-radius: 8px;
  padding: 12px; text-align: center; color: var(--text-sub); margin-bottom: 10px; font-size: 13px;
}
.set-stock-cur {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 10px; text-align: center;
}.in-session {
  background: #eaf1ff; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px;
  color: var(--accent); font-size: 13px; font-weight: 600; text-align: center;
}
#qrReader, #qrReaderIn { margin-top: 10px; width: 100%; }
#qrReader video, #qrReaderIn video { width: 100%; border-radius: 8px; }

/* ---------- 全屏扫码 ---------- */
#scanOverlay {
  position: fixed; inset: 0; z-index: 200; background: #000;
  display: flex; flex-direction: column;
}
.scan-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 18px; color: #fff; background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  position: relative; z-index: 5; box-shadow: 0 1px 0 rgba(255,255,255,.1);
}
.scan-title { font-size: 17px; font-weight: 700; letter-spacing: .5px; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.scan-close {
  background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 16px;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; line-height: 1;
}
.scan-close:active { background: rgba(255,255,255,.3); }
.scan-body { flex: 1; position: relative; overflow: hidden; }
#scanReader { position: absolute; inset: 0; }
#scanReader video { width: 100%; height: 100%; object-fit: cover; }
/* html5-qrcode 自绘取景框与自有取景框重复, 隐藏库的框, 视频铺满全屏 */
#scanReader #qr-shaded-region { width: 100% !important; height: 100% !important; top: 0 !important; left: 0 !important; }
#scanReader #qr-shaded-region > div { display: none !important; }
.scan-frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(78vw, 340px); height: min(78vw, 340px);
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.52);
  border-radius: 16px;
}
.scan-corner {
  position: absolute; width: 34px; height: 34px; border: 4px solid #4dabf7;
  filter: drop-shadow(0 0 6px rgba(77,171,247,.9));
}
.scan-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; border-radius: 10px 0 0 0; }
.scan-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 10px 0 0; }
.scan-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 10px; }
.scan-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 10px 0; }
.scan-line {
  position: absolute; left: 3%; right: 3%; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #4dabf7 15%, #74c0fc 50%, #4dabf7 85%, transparent);
  top: 45%; box-shadow: 0 0 14px rgba(77,171,247,.95);
  animation: scanmove 2.2s ease-in-out infinite;
}
@keyframes scanmove {
  0%, 100% { top: 38%; }
  50% { top: 62%; }
}
.scan-frame-hint {
  position: absolute; bottom: -34px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.9); font-size: 13px;
}
.scan-result {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: 78px; z-index: 6; max-width: 92%;
  background: rgba(0,0,0,.72); color: #fff; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 600;
  border-left: 4px solid #4dabf7; display: none;
  text-align: center;
}
.scan-result.ok { border-left-color: #51cf66; }
.scan-result.err { border-left-color: #ff6b6b; }
.scan-panel {
  background: #fff; border-radius: 18px 18px 0 0; padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  z-index: 6; max-height: 46vh; overflow-y: auto;
  box-shadow: 0 -6px 24px rgba(0,0,0,.25);
}
.scan-panel-title { font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.sp-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.sp-row .f-label { margin: 0; white-space: nowrap; }
.sp-row select.search-input { min-width: 0; width: 100%; }
.sp-row input[type="number"] {
  flex: 1; min-width: 90px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; font-size: 18px; font-weight: 600; text-align: center;
  background: #f6f8fb;
}
.sp-row input[type="number"]:focus { outline: none; border-color: var(--accent); }
.sp-actions { display: flex; gap: 10px; }
.sp-actions .btn { flex: 1; padding: 13px; font-size: 15px; font-weight: 600; border-radius: 12px; }
.sp-info { font-size: 13px; color: var(--text); margin-bottom: 8px; font-weight: 600; }
.sp-info .sub { color: var(--text-sub); font-weight: 400; font-size: 12px; margin-left: 6px; }
.sp-progress { margin: 6px 0 10px; }
.sp-progress .sp-bar { height: 10px; background: #eef1f6; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.sp-progress .sp-fill { height: 100%; background: linear-gradient(90deg, #5b8cff, #2f6bff); border-radius: 6px; transition: width .3s; }
.sp-progress .sp-bar.full .sp-fill { background: linear-gradient(90deg, #51cf66, #2f9e44); }
.sp-progress .sp-text { font-size: 14px; font-weight: 600; color: var(--text); }
.scan-tip-line { font-size: 12.5px; color: var(--text-sub); margin-top: 8px; text-align: center; }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 22, 42, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: maskIn .18s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 16px; width: 440px; max-width: 100%;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(10, 20, 45, .28);
  min-width: 0; overflow: hidden;
  animation: modalIn .22s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-lg { width: 560px; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; font-size: 16px; font-weight: 700;
  background: linear-gradient(135deg, #f4f7ff, #fff);
  border-bottom: 1px solid var(--border);
}
.modal-title { display: inline-flex; align-items: center; gap: 9px; }
.mt-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #5b8cff, #2f6bff);
  color: #fff; font-size: 15px; box-shadow: 0 3px 8px rgba(47, 107, 255, .3);
}
.modal-body { padding: 14px 20px 18px; overflow-y: auto; min-height: 0; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--border); background: #fafbfd;
}
.modal .search-input { width: 100%; min-width: 0; margin-bottom: 4px; }
/* 弹窗内输入框统一样式 */
.modal input[type="text"], .modal input[type="number"], .modal select {
  width: 100%; min-width: 0;
  border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 13px; font-size: 14px; background: #fbfcfe;
  font-family: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s;
}
.modal input[type="text"]:focus, .modal input[type="number"]:focus, .modal select:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
.modal input::placeholder { color: #a6afc0; }

/* 订单明细行 */
.oi-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.oi-row select { flex: 1; min-width: 0; }
.oi-row input { width: 90px; flex-shrink: 0; }
.oi-del { background: none; border: none; color: #e03131; cursor: pointer; font-size: 15px; padding: 6px; flex-shrink: 0; }
/* ===== 编辑发货明细弹窗 v5.69: 明细行对齐 + 删除订单 ===== */
.edit-rec-modal { width: 620px; }
.er-head {
  display: grid; grid-template-columns: 1fr 110px; gap: 10px;
  padding: 0 14px 6px; font-size: 12px; color: var(--text-sub);
}
.er-head span:last-child { text-align: center; }
.er-item {
  display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center;
  padding: 10px 12px; margin-bottom: 8px; min-width: 0;
  border: 1px solid var(--border); border-radius: 10px; background: #fbfcfe;
}
.er-main { min-width: 0; }
.er-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.er-meta { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.er-qty { display: flex; align-items: center; gap: 6px; min-width: 0; }
.er-qty input { width: 72px; padding: 8px 4px; text-align: center; }
.er-qty .er-unit { font-size: 12.5px; color: var(--text-sub); flex-shrink: 0; }
.modal-foot .btn-danger { margin-right: auto; }
.btn-danger { background: #fff; color: #e03131; border: 1px solid #f0c9c9; }
.btn-danger:hover { background: #fff0f0; }
@media (max-width: 900px) {
  .edit-rec-modal { width: 100%; }
  .er-head, .er-item { grid-template-columns: 1fr 96px; }
  .er-qty input { width: 64px; }
}

/* ---------- 底部导航(手机) ---------- */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--border); padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
  justify-content: space-around; flex-direction: row; align-items: stretch;
}
.bottom-nav .nav-item {
  flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px;
  color: var(--text-sub); width: auto; text-align: center; border-radius: 8px;
  flex: 1 1 0; min-width: 0; justify-content: center;
}
.bottom-nav .nav-item .nav-ico { font-size: 17px; width: auto; }
.bottom-nav .nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottom-nav .nav-item.active { background: #eaf1ff; color: var(--accent); }

/* ---------- 打印样式(仅标签) ---------- */

/* 商品仓库归属标签 */
.scope-tag { display:inline-block; padding:1px 6px; margin-left:4px; border-radius:4px; font-size:10px; font-weight:600; background:#eef2ff; color:#2f6bff; vertical-align:1px; }
.scope-tag.single { background:#fff7ed; color:#e8590c; }
/* 库存筛选栏 */
/* 库存工具条: 仓库切换(左) + 筛选/打印(右) */
.stock-toolbar { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin:10px 0 6px; }
.stock-toolbar .wh-tabs { margin:0; }
.stock-filters { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-left:auto; }
.stock-filters .search-input { width:auto; min-width:106px; padding:8px 12px; border-radius:6px; background:#fff; }
.stock-filters .btn { white-space:nowrap; padding:8px 30px; font-weight:600; border-radius:6px; }
@media (max-width:720px) {
  .stock-toolbar { flex-direction:column; align-items:stretch; }
  .stock-toolbar .wh-tabs { width:100%; }
  .stock-toolbar .wh-tab { flex:1; text-align:center; }
  .stock-filters { width:100%; justify-content:flex-end; }
}
.print-area { display: none; }
@media print {
  @page { margin: 0; }
  html, body { height: auto !important; overflow: visible !important; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  ::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
  #app { display: none !important; }
  .modal-mask { display: none !important; }
  body > :not(.print-area):not(script):not(style) { display: none !important; }
  .print-area { display: block; }
  .print-label {
    width: 60mm; min-height: 40mm; padding: 6mm 4mm; page-break-after: always;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  .pl-name { font-size: 12px; font-weight: 700; }
  .pl-spec { font-size: 10px; color: #444; margin-top: 1mm; }
  .pl-svg { width: 100%; height: 14mm; }
  .pl-code { font-size: 9px; letter-spacing: .5px; margin-top: .5mm; }
  .pl-meta { font-size: 8.5px; color: #555; margin-top: 1mm; display: flex; gap: 3mm; }
}

/* ---------- 发货记录页 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px; margin: 4px 0 10px;
  background: var(--panel, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
}
.filter-bar .search-input { flex: 0 1 auto; min-width: 130px; }
.filter-bar input[type="date"].search-input { min-width: 148px; }
.filter-bar .filter-sep { color: var(--text-sub, #6b7280); font-size: 13px; }
.filter-bar .btn { white-space: nowrap; }
.rec-summary {
  margin: 2px 0 10px; font-size: 13px; color: var(--text-sub, #6b7280);
}
.rec-detail { font-size: 12.5px; color: #374151; line-height: 1.55; }
#recTableWrap .tbl td { vertical-align: middle; }
#recCards .pc-card .pc-detail-items { border-top: 1px dashed var(--border, #e5e7eb); margin-top: 8px; padding-top: 8px; }

/* 发货记录分页 */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 14px 0 6px;
}
.pager .pager-info { font-size: 13px; color: var(--text-sub, #6b7280); }
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* 发货记录打印报表 */
.print-records { font-family: "Microsoft YaHei", sans-serif; color: #000; }
.print-records .pr-head { text-align: center; margin-bottom: 10px; }
.print-records .pr-title { font-size: 18px; font-weight: 700; }
.print-records .pr-sub { font-size: 11px; color: #444; margin-top: 4px; }
.print-records table { width: 100%; border-collapse: collapse; margin-top: 6px; table-layout: fixed; }
.print-records th, .print-records td {
  border: 1px solid #333; padding: 5px 6px; font-size: 11.5px; text-align: left; vertical-align: middle;
  word-wrap: break-word; overflow-wrap: break-word; word-break: break-all;
}
.print-records th { background: #f0f0f0; font-weight: 700; white-space: normal; }
.print-records td.c { text-align: center; }
.print-records .rec-pr-table th, .print-records .rec-pr-table td { padding: 3px 4px; font-size: 10.5px; }
.print-records .pr-total {
  display: flex; justify-content: space-between; font-weight: 700; background: #fafafa;
  border: 1px solid #333; border-top: none; padding: 5px 6px; font-size: 11.5px;
}
.print-records .pr-total .c { text-align: center; }
.print-records .pr-total span { flex: 1; }
.print-records .pr-total span.c { flex: 0 0 18%; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .modal-mask { padding: 12px; align-items: flex-end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-body { padding: 12px 14px 16px; }
  .modal-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; min-width: 120px; }
  .oi-row { flex-wrap: nowrap; }
  .oi-row select { min-width: 0; }
  .sidebar { display: none; }
  .main { padding: 16px 14px 70px; max-width: 100%; }
  .bottom-nav { display: flex; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-2col { grid-template-columns: 1fr; gap: 0; }
  .ship-layout { grid-template-columns: 1fr; }
  .print-layout { grid-template-columns: 1fr; }
  .bar-chart { height: 150px; gap: 8px; overflow-x: auto; }
  .page-head h2 { font-size: 17px; }
  .btn-new-order { padding: 9px 14px 9px 11px; font-size: 13px; }
  .search-input { min-width: 0; flex: 1; }
  .head-actions { width: 100%; }
  .panel { padding: 13px 14px; }
  .tbl { min-width: 520px; }
  .verify-batch { gap: 8px; }
  .verify-batch .verify-hint { flex-basis: 100%; }
  /* 手机端：宽表格全部切换为可点击卡片（无需左右滑动） */
  #prodTableWrap, #dsRecentWrap, #stockWrap, #rpByProductWrap, #rpRecentWrap, #recTableWrap { display: none; }
  #prodCards, #dsRecentCards, #stockCards, #rpByProductCards, #rpRecentCards, #recCards { display: block; }
  /* 手机端筛选栏: 2列紧凑布局(搜索框整行, 其余控件两两一行) */
  .filter-bar { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .filter-bar .search-input { flex: 1 1 40%; width: auto; min-width: 0; }
  .filter-bar .btn { flex: 1 1 40%; margin: 0; }
  #recKeyword { flex: 1 1 100%; }
  .filter-bar .filter-sep { flex: 0 0 auto; align-self: center; }
}
@media (max-width: 480px) {
  .stat-card { padding: 12px 14px; }
  .stat-num { font-size: 24px; }
  .panel-title { font-size: 14px; }
  .bar-chart { gap: 6px; }
  .bar-val { font-size: 11px; }
  .bar-date { font-size: 10.5px; }
  .sp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .sp-actions .btn { width: 100%; }
  #btnScanAgainV { grid-column: 1; grid-row: 1; }
  #btnScanBack { grid-column: 2; grid-row: 1; }
  #btnScanConfirm { grid-column: 1 / -1; grid-row: 2; padding: 14px; font-size: 16px; }
  #btnScanSaveIn { grid-column: 1 / -1; grid-row: 1; padding: 14px; font-size: 16px; }
  #btnScanAgainIn { grid-column: 1; grid-row: 2; }
  #btnScanBackIn { grid-column: 2; grid-row: 2; }
  .scan-frame { width: min(84vw, 300px); height: min(84vw, 300px); }
}

/* v5.46 商品输入+箭头下拉 (新建发货单发货明细) */
.oi-pick { position: relative; flex: 1 1 0; min-width: 0; }
.oi-pick .oi-prod-inp { width: 100%; min-width: 0; padding-right: 40px; border-radius: 8px; box-sizing: border-box; }
.oi-arrow { position: absolute; right: 0; top: 0; bottom: 0; width: 38px; border: none; background: transparent; cursor: pointer; font-size: 15px; color: #868e96; display: flex; align-items: center; justify-content: center; transition: color .15s; }
.oi-arrow:hover { color: #4c6ef5; }
.oi-drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid #d8d8d8; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.14); display: none; text-align: left; }
.oi-opt { padding: 9px 12px; cursor: pointer; font-size: 14px; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oi-opt:hover { background: #eef2ff; }
@media (max-width: 900px) {
  .oi-row { flex-wrap: wrap; }
  .oi-pick { flex: 1 1 100%; }
  .oi-qty { flex: 1 1 90px; }
}

/* ===== 历史入库 ===== */
.his-row { cursor: pointer; }
.his-row:hover td { background: #f6f8fc; }
.his-card { cursor: pointer; }

/* ===== v5.51 淡季/旺季预警 ===== */
.peak-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.f-label-sm { font-size: 12px; color: #7d8597; margin: 2px 0 2px; }
.season-tag { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 8px; font-size: 11px; line-height: 16px; vertical-align: 1px; }
.season-tag.peak { background: #fff3e0; color: #e65100; }
.season-tag.off { background: #e8eaf6; color: #3949ab; }

/* ===== v5.51 淡季/旺季预警 ===== */
.peak-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.f-label-sm { font-size: 12px; color: #7d8597; margin: 2px 0 2px; }
.season-tag { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 8px; font-size: 11px; line-height: 16px; vertical-align: 1px; }
.season-tag.peak { background: #fff3e0; color: #e65100; }
.season-tag.off { background: #e8eaf6; color: #3949ab; }

/* ===== v5.52 库存分组(同品名/小号+规格 归为同类) ===== */
.group-row { cursor: pointer; }
.group-row:hover td { background: #f5f7fb; }
.group-row.open td { background: #eef2fb; }
.group-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px; background: #e3f0ff; color: #1a5cb8; font-size: 11px; line-height: 18px; vertical-align: 1px; font-weight: normal; }
.group-toggle { display: inline-block; width: 24px; height: 24px; line-height: 22px; text-align: center; border: 1px solid #c9d4e5; border-radius: 6px; color: #4a607a; font-size: 12px; background: #fff; }
.group-row.open .group-toggle { border-color: #1a5cb8; color: #1a5cb8; background: #eef2fb; }
.group-detail td { background: #f8fafd !important; padding: 6px 10px; }
.gd-wrap { overflow-x: auto; }
.gd-table { margin: 0; min-width: 560px; }
.gd-table thead th { background: #e9eef6; color: #4a607a; font-size: 12px; padding: 5px 8px; }
.gd-table tbody td { padding: 6px 8px; font-size: 13px; }
.pc-detail-title { border-top: 1px dashed #dbe3ee; padding-top: 6px; margin-top: 2px; }
.pc-detail-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #e3e9f2; font-size: 13px; }
.pc-detail-item .pc-k { width: 64px; color: #7d8597; }
.pc-detail-item .pc-v2 { color: #1a5cb8; font-weight: 600; margin-left: auto; }

/* v5.58 工作台内部滚动 */
/* #page-dashboard 不再单独滚动 */
/* 条码打印商品下拉宽度限制 */
#bcProduct { max-width: 100%; width: 100%; }
.print-config .search-input { width: 100%; }
/* 新建发货单弹窗加大 */
#orderModal .modal { width: 720px; max-width: 96vw; }
/* 分页器页码跳转 */
.pager .page-jump { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; font-size: 13px; color: #5b6b8c; }
.pager .page-jump input { width: 56px; padding: 4px 8px; border: 1px solid #d8dee9; border-radius: 6px; font-size: 13px; text-align: center; }
.pager .page-jump button { padding: 4px 10px; font-size: 13px; }

/* v5.59 工作台两个卡片内部滚动 */
#page-dashboard .grid-2col .panel { max-height: 420px; display: flex; flex-direction: column; }
#page-dashboard .grid-2col .panel .bar-chart,
#page-dashboard .grid-2col .panel .alert-list { overflow-y: auto; max-height: 360px; }
/* 条码打印下拉宽度对齐 */
.print-config #bcProduct, .print-config #bcBags { width: 100%; box-sizing: border-box; }
/* ===== 条码打印: 商品输入+下拉 v5.70 ===== */
.combo { position: relative; }
.combo .combo-input { width: 100%; box-sizing: border-box; padding-right: 40px; }
.combo-arrow {
  position: absolute; right: 1px; top: 1px; bottom: 1px; width: 38px;
  border: none; border-left: 1px solid #e6eaf2; border-radius: 0 8px 8px 0;
  background: #fff; color: #6b7280; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.combo-arrow:hover { color: var(--accent, #2f6bff); background: #f5f8ff; }
.combo-drop {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70;
  max-height: 260px; overflow-y: auto; background: #fff;
  border: 1px solid #dde3ee; border-radius: 10px;
  box-shadow: 0 10px 26px rgba(15, 22, 42, .14);
}
.combo-opt {
  padding: 9px 12px; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-opt:hover, .combo-opt.active { background: #eef3ff; color: var(--accent, #2f6bff); }
.combo-empty { padding: 12px; font-size: 13px; color: var(--text-sub, #667); text-align: center; }
.print-config #bcProduct option, .print-config #bcBags option { padding: 0 4px; }

/* ===== 手机端优化 v5.61 ===== */
@media (max-width: 900px) {
  /* 新建发货单: 袋数/单价/数量一行紧凑排列 */
  .oi-row { gap: 6px; margin-bottom: 8px; }
  .oi-bags { flex: 1 1 80px; min-width: 0; }
  .oi-price { flex: 1 1 70px; min-width: 0; }
  .oi-qty { flex: 1 1 60px; min-width: 0; }
  /* 盈亏汇总卡片 */
  .pf-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pf-summary > div { padding: 10px; }
  /* 打印按钮全宽 */
  .print-records .pr-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  /* 分页器手机端 */
  .pager { flex-wrap: wrap; gap: 8px; font-size: 13px; }
  .page-jump { flex-basis: 100%; justify-content: center; display: flex; gap: 6px; }
  /* 工作台卡片 */
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 12px; }
  .stat-num { font-size: 22px; }
  /* 筛选按钮 */
  .filter-bar .btn { font-size: 13px; padding: 8px 10px; }
  .filter-bar .search-input { font-size: 13px; }
  /* 发货记录卡片 */
  .pc-card { padding: 10px 12px; margin-bottom: 8px; }
  .pc-item { font-size: 12.5px; }
  /* 弹窗 */
  #orderModal .modal { width: 100%; }
  /* 条码打印页 */
  .print-layout { gap: 12px; }
  #bcPreview { min-height: 200px; }
  /* 库存卡片 */
  .stock-card { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-num { font-size: 20px; }
  .pf-summary { grid-template-columns: 1fr; }
  .print-records .pr-summary { grid-template-columns: 1fr; }
}

/* ===== 账号管理 ===== */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 20px; }
.user-card { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.06); display: flex; align-items: center; gap: 16px; transition: .25s; border: 1px solid #f0f0f0; }
.user-card:hover { box-shadow: 0 8px 24px rgba(102,126,234,.12); transform: translateY(-3px); border-color: #e0e7ff; }
.user-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 16px; font-weight: 600; color: #1a1a2e; }
.user-username { font-size: 13px; color: #999; margin-top: 3px; }
.user-role { display: inline-block; margin-top: 8px; padding: 3px 12px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.role-admin { background: #ffe0e0; color: #c0392b; }
.role-mgr { background: #fff3cd; color: #856404; }
.role-op { background: #d4edda; color: #155724; }
.role-view { background: #e2e3e5; color: #383d41; }
.user-actions { display: flex; gap: 8px; flex-shrink: 0; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 16px; padding: 32px; width: 420px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 24px; color: #1a1a2e; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-row input, .form-row select { width: 100%; padding: 10px 14px; border: 1px solid #e0e0e0; border-radius: 10px; font-size: 14px; box-sizing: border-box; }
.form-row input:focus, .form-row select:focus { outline: none; border-color: #667eea; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

.user-perms { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.perm-tag { background: #f0f0f5; color: #666; padding: 2px 8px; border-radius: 8px; font-size: 11px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.perm-grid label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #444; cursor: pointer; }
.perm-grid input[type=checkbox] { width: auto; }

/* 查看员模式: 隐藏敏感列 */
.view-only .col-price, .view-only .col-cost, .view-only .col-money,
.view-only .col-unitprice, .view-only .col-total, .view-only .col-profit,
.view-only th[data-sensitive], .view-only td[data-sensitive] { display: none !important; }
.view-only .btn-danger, .view-only .btn-edit { display: none !important; }

.perm-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-toggle { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: #f5f5fa; border-radius: 8px; cursor: pointer; font-size: 12px; }
.perm-toggle:hover { background: #eef; }
.perm-name { color: #555; }
.switch { width: 32px; height: 18px; background: #ccc; border-radius: 10px; position: relative; display: inline-block; transition: .2s; }
.switch .slider { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: .2s; }
.switch.on { background: #667eea; }
.switch.on .slider { left: 16px; }
#userTable td { vertical-align: top; }

.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; margin-top: 16px; }
.user-card2 { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); border: 1px solid #f0f0f0; }
.user-card-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #f0f0f0; margin-bottom: 14px; }
.user-card-head .user-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; flex-shrink: 0; }
.user-card-head .user-name { font-size: 15px; font-weight: 600; }
.user-card-head .user-username { font-size: 12px; color: #999; }
.user-card-head .btn { margin-left: auto; }
.badge-admin { background: #ffe0e0; color: #c0392b; padding: 3px 10px; border-radius: 10px; font-size: 11px; margin-left: auto; }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: #f8f8fc; border-radius: 8px; cursor: pointer; font-size: 13px; }
.perm-row:hover { background: #eef; }
.perm-label { color: #444; }
.switch { width: 34px; height: 19px; background: #ccc; border-radius: 10px; position: relative; display: inline-block; transition: .2s; flex-shrink: 0; }
.switch .slider { position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: #fff; border-radius: 50%; transition: .2s; }
.switch.on { background: #667eea; }
.switch.on .slider { left: 17px; }

.hide-price .col-price, .hide-price .col-cost, .hide-price .col-money, .hide-price .col-total,
.hide-price td[data-price], .hide-price th[data-price] { display: none !important; }

@media (max-width: 768px) {
  .user-grid { grid-template-columns: 1fr !important; }
  .perm-list { grid-template-columns: 1fr !important; }
  .user-card2 { padding: 14px !important; }
}

.hide-price td[data-price], .hide-price th[data-price],
.hide-stock-price td[data-price], .hide-stock-price th[data-price],
.hide-history-price td[data-price], .hide-history-price th[data-price] { display: none !important; }

/* 次级权限隐藏价格列 - 用nth-child */
.hide-price #recordsTable tbody tr td:nth-child(11),
.hide-price #recordsTable tbody tr td:nth-child(12),
.hide-price #recordsTable tbody tr td:nth-child(13),
.hide-price #recordsTable tbody tr td:nth-child(14),
.hide-stock-price #stockTable tbody tr td:nth-child(11),
.hide-stock-price #stockTable tbody tr td:nth-child(12),
.hide-stock-price #stockTable tbody tr td:nth-child(13),
.hide-stock-price #stockTable tbody tr td:nth-child(14),
.hide-stock-price #stockTable tbody tr td:nth-child(15),
.hide-history-price #historyTable tbody tr td:nth-child(4),
.hide-history-price #historyTable tbody tr td:nth-child(10),
.hide-history-price #historyTable tbody tr td:nth-child(11),
.hide-history-price #historyTable tbody tr td:nth-child(14),
.hide-history-price #historyTable tbody tr td:nth-child(15) { display: none !important; }

/* 次级权限隐藏价格列 */
.hide-price #recTableWrap tbody tr td:nth-child(11),
.hide-price #recTableWrap tbody tr td:nth-child(12),
.hide-price #recTableWrap tbody tr td:nth-child(13),
.hide-price #recTableWrap tbody tr td:nth-child(14),
.hide-stock-price #stockWrap tbody tr td:nth-child(11),
.hide-stock-price #stockWrap tbody tr td:nth-child(12),
.hide-stock-price #stockWrap tbody tr td:nth-child(13),
.hide-stock-price #stockWrap tbody tr td:nth-child(14),
.hide-stock-price #stockWrap tbody tr td:nth-child(15),
.hide-history-price #hisTableWrap tbody tr td:nth-child(4),
.hide-history-price #hisTableWrap tbody tr td:nth-child(10),
.hide-history-price #hisTableWrap tbody tr td:nth-child(11),
.hide-history-price #hisTableWrap tbody tr td:nth-child(14),
.hide-history-price #hisTableWrap tbody tr td:nth-child(15) { display: none !important; }

/* 次级只读: 商品档案隐藏单价/成本价 */
.hide-product-price #prodList tbody tr td:nth-child(5),
.hide-product-price #prodList tbody tr td:nth-child(6) { display: none !important; }
.hide-product-price #prodList thead th:nth-child(5),
.hide-product-price #prodList thead th:nth-child(6) { display: none !important; }

/* 次级只读: 库存隐藏上月结余(第5列) */
.hide-stock-price #stockWrap tbody tr td:nth-child(5),
.hide-stock-price #stockWrap thead th:nth-child(5) { display: none !important; }
