/* 盘库云平台 - 共用设计系统（风格参考停车云平台：渐变品牌 + 圆角卡片 + 数字化分页） */
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-deep: #1e3a8a;
  --brand-soft: #eff5ff;
  --brand-line: #c7dbfb;
  --brand-grad: linear-gradient(135deg, #1e3a8a 0%, #2563eb 62%, #3b82f6 100%);
  --brand-glow: 0 8px 22px rgba(37, 99, 235, .22);

  --ok: #15803d;
  --ok-soft: #e8f5ec;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --danger: #c62828;
  --danger-soft: #fceceb;
  --info: #0e7490;
  --info-soft: #e5f4f8;

  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #8b93a3;
  --line: #e5e8ee;
  --line-2: #f0f2f6;
  --bg: #f3f5f9;
  --card: #ffffff;

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, .05), 0 10px 24px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
ul { list-style: none; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #d5dae3; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #bcc3cf; background-clip: content-box; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------------- 布局 ---------------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 20px 22px 60px; }
.wrap-wide { max-width: 1600px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.right { text-align: right; } .center { text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }

/* ---------------- 通用 Logo（登录页/其他页复用；后台顶栏即页签栏） ---------------- */
.logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; letter-spacing: .2px; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.logo-mark svg { width: 17px; height: 17px; }

/* ---------------- 管理后台：左侧栏（通栏） + 卡片式多页签 ---------------- */
.admin-shell { margin-left: 216px; height: 100vh; display: flex; align-items: stretch; overflow: hidden; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 216px; z-index: 40;
  overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(178deg, #2f6ae0 0%, #1e40af 34%, #1a357f 64%, #14265c 100%);
  box-shadow: inset -8px 0 18px -12px rgba(9, 18, 44, .55), 4px 0 16px rgba(13, 26, 64, .16);
}
.sb-brand {
  height: 58px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0));
}
.sb-logo { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.sb-logo svg { width: 18px; height: 18px; }
.sb-name { font-size: 14.5px; font-weight: 650; color: #fff; letter-spacing: .5px; white-space: nowrap; }
.sb-slogan { font-size: 10.5px; color: rgba(255, 255, 255, .52); letter-spacing: 1.5px; margin-top: 1px; }
#sbMenu { flex: 1; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; min-height: 0; }
.sb-foot { flex: none; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .12); background: rgba(9, 18, 44, .18); }
/* 侧栏底部用户区：半透明圆角面板 */
.sb-user {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px; padding: 10px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.sb-ava {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .16));
  border: 1px solid rgba(255, 255, 255, .38); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 650;
  box-shadow: 0 2px 8px rgba(9, 18, 44, .25);
}
.sb-uinfo { min-width: 0; }
.sb-uname { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-urole {
  color: rgba(255, 255, 255, .72); font-size: 10.5px; margin-top: 1px;
  display: inline-flex; align-items: center; gap: 4px;
}
.sb-urole::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 4px rgba(74, 222, 128, .8); }
.sb-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sb-logout {
  flex: 1; min-width: 0; padding: 5px 8px; border-radius: 9px; cursor: pointer; font-size: 11.5px; letter-spacing: .5px;
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .92);
  transition: background .15s, border-color .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-logout:hover { background: rgba(239, 68, 68, .32); border-color: rgba(252, 165, 165, .5); color: #fff; }
.sb-foot .sb-ver { flex: none; }
.sb-ver {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-family: var(--mono);
  color: rgba(255, 255, 255, .88); background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 20px; padding: 2px 10px;
}
.sb-copy { margin-top: 7px; font-size: 10px; line-height: 1.5; color: rgba(255, 255, 255, .38); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-group { margin-top: 14px; }
.sb-group:first-child { margin-top: 6px; }
.sb-title {
  font-size: 11px; color: rgba(255, 255, 255, .42); letter-spacing: 3px;
  padding: 0 12px 6px; font-weight: 500;
}
.sb-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 9px;
  color: rgba(255, 255, 255, .78); font-size: 13.5px; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left; margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.sb-item:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.sb-item.on {
  background: rgba(255, 255, 255, .17); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 #7cb0ff;
}
.sb-ico { width: 20px; text-align: center; flex: none; font-size: 15px; }
.sb-txt { flex: 1; }
.sb-badge {
  font-size: 10.5px; padding: 1px 7px; border-radius: 9px;
  background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .75);
}
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
/* 页签栏：品牌渐变条（顶栏右侧） */
.page-tabs {
  display: flex; gap: 6px; padding: 0 18px; overflow-x: auto; flex: none;
  align-items: center; height: 58px; min-height: 58px;
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 36%, #3b82f6 66%, #60a5fa 100%);
  box-shadow: 0 2px 12px rgba(30, 58, 138, .22);
  scrollbar-width: thin;
}
.page-tabs::-webkit-scrollbar { height: 5px; }
.page-tabs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .38); border-radius: 4px; }
.ptab {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px 7px 13px;
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 10px; font-size: 13px; color: rgba(255, 255, 255, .92);
  cursor: pointer; white-space: nowrap; backdrop-filter: blur(4px);
  transition: background .15s, color .15s, transform .15s;
  max-width: 200px; user-select: none;
}
.ptab:hover { background: rgba(255, 255, 255, .28); color: #fff; transform: translateY(-1px); }
.ptab.on {
  background: #fff; color: var(--brand); font-weight: 600; border-color: #fff;
  box-shadow: 0 6px 16px rgba(9, 18, 44, .24);
}
.ptab .ptab-t { overflow: hidden; text-overflow: ellipsis; }
.ptab .ptab-x {
  border: none; background: none; cursor: pointer; color: inherit; opacity: .62;
  font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 5px; flex: none;
}
.ptab .ptab-x:hover { background: var(--danger-soft); color: var(--danger); opacity: 1; }
/* 页签栏中间空白处：心电图小动画 */
.tabs-ecg {
  flex: 1; min-width: 80px; height: 100%; margin-left: 14px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tabs-ecg svg { height: 30px; width: min(430px, 100%); overflow: visible; }
.ecg-base { fill: none; stroke: rgba(255, 255, 255, .3); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.ecg-run {
  fill: none; stroke: #5eead4; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 110 540;
  filter: drop-shadow(0 0 5px rgba(94, 234, 212, .85));
  animation: ecgrun 3.2s linear infinite;
}
@keyframes ecgrun { from { stroke-dashoffset: 650; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .ecg-run { animation: none; stroke-dasharray: none; opacity: .85; } }
.admin-content {
  flex: 1; background: var(--bg);
  padding: 16px 18px 0; min-width: 0; min-height: 0;
  overflow-y: auto; scrollbar-width: thin;
}
.admin-content > .page:not(#page-dash):not(:has(.pager)) { padding-bottom: 16px; }
@media (max-width: 960px) and (min-width: 701px) {
  .sidebar { width: 62px; }
  .admin-shell { margin-left: 62px; }
  .sb-brand { justify-content: center; padding: 0 6px; }
  .sb-name, .sb-slogan, .sb-copy { display: none; }
  .sb-brand > div { display: none; }
  .sb-user { justify-content: center; padding-bottom: 8px; }
  .sb-uinfo { display: none; }
  .lo-txt { display: none; }
  .sb-actions { flex-direction: column; gap: 6px; }
  .sb-logout { padding: 6px 0; font-size: 14px; }
  .sb-foot { text-align: left; padding: 10px 8px; }
  .sb-ver { padding: 2px 6px; font-size: 10px; }
  .sb-title { display: none; }
  .sb-txt, .sb-badge { display: none; }
  .sb-item { justify-content: center; padding: 10px 0; }
}

/* 权限表 */
.perm-group td {
  background: linear-gradient(180deg, #f8fafd, #f3f6fb) !important;
  font-weight: 600; color: var(--ink-2); font-size: 12.5px; letter-spacing: .3px;
}
.perm-y { color: var(--ok); font-weight: 700; font-size: 15px; }
.perm-n { color: #c6cdd9; font-size: 13px; }
.perm-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.perm-legend b { color: var(--brand); }
.perm-lock { font-size: 11.5px; color: var(--ink-3); }
.perm-chk { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.perm-chk:disabled { cursor: not-allowed; opacity: .8; }
.perm-cell { text-align: center; }
.perm-save-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(90deg, var(--brand-soft), #fff);
  border: 1px solid var(--brand-line); border-radius: var(--r); padding: 10px 14px; margin-top: 14px;
}
.perm-dirty { font-size: 12.5px; color: var(--warn); font-weight: 600; }

/* ---------------- 看板：满屏图表布局（按 1920×1000 设计，纵向铺满不空旷） ---------------- */
.admin-content { display: flex; flex-direction: column; }
.admin-content > .page.on#page-dash { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dash-board {
  display: grid; gap: 10px; grid-template-columns: repeat(12, 1fr); align-items: stretch;
  flex: 1; min-height: 0;
  grid-template-rows: auto minmax(0, 1.3fr) minmax(0, 2.1fr) minmax(0, .8fr);
}
.dash-board > .sp-3 { grid-column: span 3; }
.dash-board > .sp-4 { grid-column: span 4; }
.dash-board > .sp-5 { grid-column: span 5; }
.dash-board > .sp-6 { grid-column: span 6; }
.dash-board > .sp-7 { grid-column: span 7; }
.dash-board > .sp-8 { grid-column: span 8; }
.dash-board > .sp-12 { grid-column: span 12; }
.dash-board > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.dash-board > .card > .chart-line-wrap { flex: 1; min-height: 0; display: flex; align-items: stretch; }
.dash-board > .card > .chart-line-wrap .chart-svg { width: 100%; height: 100%; }
.dash-board > .card > .donut-row { flex: 1; min-height: 0; align-content: center; }
.dash-board .donut-box { width: 140px; height: 140px; }
.dash-board > .card > .rank-list { flex: 1; min-height: 0; overflow: auto; }
.dash-board > .card > .table-wrap { flex: 1; min-height: 0; overflow: auto; }
/* 差异概况：三个彩色大数磁贴，填满卡片 */
.diff-row { flex: 1; min-height: 0; display: flex; gap: 10px; align-items: stretch; }
.diff-tile {
  flex: 1; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; min-height: 0;
}
.dt-neg { background: linear-gradient(160deg, #fff5f5, #ffe9e9); border: 1px solid #ffd9d9; }
.dt-pos { background: linear-gradient(160deg, #f0fdf6, #dcf7e8); border: 1px solid #c4ecd8; }
.dt-num { font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.dt-neg .dt-num { color: var(--danger); }
.dt-pos .dt-num { color: var(--ok); }
.dt-lbl { font-size: 12px; color: var(--ink-2); }
@media (max-width: 1400px) {
  .dash-board { grid-template-rows: none; }
  .dash-board > .sp-3 { grid-column: span 6; }
  .dash-board > .sp-4 { grid-column: span 6; }
  .dash-board > .sp-8 { grid-column: span 12; }
  .dash-board > .sp-12 { grid-column: span 12; }
}
@media (max-width: 860px) {
  .dash-board > .sp-3, .dash-board > .sp-4, .dash-board > .sp-6 { grid-column: span 12; }
}
/* KPI 渐变卡 */
.kpi-grad {
  background: linear-gradient(135deg, #fff 0%, #f7fbff 62%, #eef5ff 100%);
  border-color: #dbe8fb;
}
.kpi-grad:before { width: 4px; opacity: 1; }
.kpi-ico {
  width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand); font-size: 16px; flex: none;
  border: 1px solid var(--brand-line);
}
.kpi-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* KPI 快捷链接卡：可点击跳转，右上角箭头 + 悬停浮起 */
.kpi-link { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.kpi-link::after {
  content: '↗'; position: absolute; top: 10px; right: 12px;
  font-size: 13px; color: var(--brand); opacity: .55; transition: opacity .15s ease, transform .15s ease;
}
.kpi-link:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 8px 20px rgba(37, 99, 235, .12); }
.kpi-link:hover::after { opacity: 1; transform: translate(2px, -2px); }
/* 折线图 */
.chart-line-wrap { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-legend .lg-num { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
/* 环形图 */
.donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-row > .donut-box { flex: none; }
.donut-box { position: relative; width: 148px; height: 148px; flex: none; }
.donut-box svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; pointer-events: none;
}
.donut-center .dc-num { font-size: 20px; font-weight: 650; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.donut-center .dc-num.dc-sm { font-size: 13px; letter-spacing: 0; }   /* 长金额自适应缩小，不遮环带 */
.donut-center .dc-lbl { font-size: 11.5px; color: var(--ink-3); }
.legend-list { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-item .lg-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-item .lg-name { color: var(--ink-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-item .lg-val { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
/* TOP 排行 */
.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-item { display: flex; align-items: center; gap: 10px; }
.rank-no {
  width: 20px; height: 20px; border-radius: 6px; flex: none; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; color: #fff; background: #9fb2cc;
}
.rank-item:nth-child(1) .rank-no { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.rank-item:nth-child(2) .rank-no { background: linear-gradient(135deg, #64748b, #94a3b8); }
.rank-item:nth-child(3) .rank-no { background: linear-gradient(135deg, #b45309, #d97706); }
.rank-item .rk-name { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .rk-sub { font-size: 11px; color: var(--ink-3); }
.rank-item .rk-val { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--brand); }
.rank-bar { height: 6px; border-radius: 4px; background: #eef2f8; overflow: hidden; margin-top: 4px; }
.rank-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand-grad); }
/* 关联货品小标签 */
.rel-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line);
  border-radius: 20px; padding: 1px 9px; cursor: pointer;
}
.rel-tag:hover { background: #e2edff; }
.rel-none { font-size: 12px; color: var(--ink-3); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: var(--shadow);
  transition: box-shadow .18s ease, border-color .18s ease;
}
@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow-md); border-color: #d9e2f2; }
}
.card-flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.card-sub { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: .3px; }

/* ---------------- KPI ---------------- */
.kpi {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 13px 15px 13px 18px; box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.kpi:before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-grad); opacity: .85; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-line); }
.kpi-label { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.4px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.kpi-foot { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.kpi-foot .up { color: var(--ok); }
.kpi-foot .down { color: var(--danger); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 15px; border: 1px solid var(--line); background: var(--card);
  border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; color: var(--ink);
  transition: all .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 500; box-shadow: var(--brand-glow); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
/* hover 效果只给真正有鼠标的设备：触摸屏点按后 :hover 会残留，
   曾导致 btn-primary 被盖成近白底+白字（文字"消失"） */
@media (hover: hover) {
  .btn:hover { border-color: #c3cad6; background: #fbfcfe; color: var(--brand); }
  .btn-primary:hover { filter: brightness(1.06); border-color: transparent; color: #fff; background: var(--brand-grad); }
  .btn-danger:hover { filter: brightness(.94); color: #fff; }
  .btn-ghost:hover { background: var(--brand-soft); }
}
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: var(--r); }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.input, .select, .textarea {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 9px 12px; resize: vertical; min-height: 68px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28, 95, 208, .12); }
.input::placeholder { color: #b3b9c4; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%238a92a3' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 13px; padding-right: 30px; }
.search-input { height: 36px; }

/* ---------------- 徽标 / 标签 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-mut { background: var(--line-2); color: var(--ink-3); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; flex: none; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* 条码 */
.barcode {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  border-radius: 4px; font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: .6px; background: #1c4f9c; color: #fff; border: 1px solid #16407f;
}
.barcode-sm { height: 20px; font-size: 11.5px; padding: 0 6px; letter-spacing: .3px; }

/* ---------------- 表格 ---------------- */
.table-wrap {
  overflow: auto; border-radius: var(--r); border: 1px solid var(--line-2); background: #fff;
}
table.tb { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tb th {
  text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12.5px; letter-spacing: .2px;
  padding: 8px 12px; background: linear-gradient(180deg, #f8fafd, #f3f6fb); white-space: nowrap;
  position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--brand-line);
}
table.tb td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; background: #fff; }
table.tb tbody tr:hover td { background: #f8fbff; }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb .num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
table.tb .money { font-variant-numeric: tabular-nums; font-weight: 600; }
table.tb input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.empty { padding: 32px 0; text-align: center; color: var(--ink-3); font-size: 13px; }

/* 差异配色（正=盘盈 红、负=盘亏 绿？——仓库惯例：盘盈标蓝、盘亏标红） */
.diff-pos { color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; }
.diff-neg { color: var(--danger); font-weight: 600; font-variant-numeric: tabular-nums; }
.diff-zero { color: var(--ok); font-variant-numeric: tabular-nums; }

/* ---------------- 分页（吸底：长表格滚动时页码栏始终可见） ---------------- */
.pager {
  display: flex; align-items: center; gap: 8px; margin: 10px -16px -14px; font-size: 13px; color: var(--ink-2);
  flex-wrap: wrap; padding: 10px 16px 12px;
  position: sticky; bottom: 0; z-index: 6;
  background: #fff; border-top: 1px solid var(--line-2);
  box-shadow: 0 -8px 20px rgba(16, 24, 40, .08);
  border-radius: 0 0 var(--r) var(--r);
}
.pager .pg-info { margin-right: auto; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; flex: none; }
.pager .pg-info b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pager button.pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); background: #fff;
  border-radius: var(--r-sm); cursor: pointer; font-size: 12.5px; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; transition: all .14s;
  white-space: nowrap; flex: none;
}
.pager button.pg-btn:hover:not(:disabled) { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }
.pager button.pg-btn:disabled { opacity: .42; cursor: not-allowed; }
.pager button.pg-btn.on { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: var(--brand-glow); }
.pager .pg-total { margin-left: auto; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; flex: none; }
.pager .pg-total b { color: var(--brand); font-weight: 600; }
.pager .pg-gap { color: var(--ink-3); padding: 0 1px; font-size: 12.5px; flex: none; }
.pager .pg-arrow { font-size: 16px; line-height: 1; padding: 0 10px; }
.pager .pg-size {
  height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff;
  padding: 0 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; flex: none; outline: none;
}
.pager .pg-size:focus { border-color: var(--brand); }
.pager .pg-jump { color: var(--ink-3); font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; }
.pager .pg-jump-input {
  width: 54px; height: 30px; border: 1px solid var(--line); border-radius: var(--r-sm);
  text-align: center; font-size: 12.5px; outline: none; transition: border-color .15s;
}
.pager .pg-jump-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(28, 95, 208, .12); }
/* 宽屏（1920 档）：分页条更大更透气 */
@media (min-width: 1700px) {
  .pager { font-size: 13.5px; }
  .pager button.pg-btn { min-width: 34px; height: 34px; font-size: 13px; }
  .pager .pg-size { height: 34px; }
}

/* ---------------- 进度 / 占比条 ---------------- */
.bar { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); transition: width .3s; }
.bar-ok > i { background: var(--ok); }
.bar-warn > i { background: var(--warn); }
.bar-danger > i { background: var(--danger); }

/* ---------------- 标签页 ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button {
  background: none; border: none; padding: 10px 14px; cursor: pointer; font-size: 13.5px;
  color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 30px; padding: 0 12px; border: 1px solid var(--line); background: #fff; border-radius: 20px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s;
}
.chip:hover { border-color: var(--brand-line); color: var(--brand); }
.chip.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); font-weight: 500; }

/* ---------------- 弹窗 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .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-out;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  animation: modalUp .22s cubic-bezier(.2, .9, .3, 1.15) both;
}
@keyframes modalUp { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-lg { max-width: 820px; }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, #f8fafd, #fff); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.x-btn { border: none; background: none; cursor: pointer; color: var(--ink-3); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.x-btn:hover { background: var(--line-2); color: var(--ink); }

/* ---------------- 轻提示 ---------------- */
.toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); animation: toastIn .18s ease-out; max-width: 80vw;
}
.toast-ok { background: #14532d; }
.toast-err { background: #7f1d1d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 登录页（品牌分屏大舞台） ---------------- */
.login-stage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 24px;
  position: relative; overflow: hidden;
  background: linear-gradient(140deg, #14265c 0%, #1e3a8a 30%, #2563eb 64%, #3b82f6 100%);
}
.login-stage::before, .login-stage::after {
  content: ''; position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0) 65%);
}
.login-stage::before { width: 620px; height: 620px; left: -180px; top: -200px; animation: drift 16s ease-in-out infinite alternate; }
.login-stage::after { width: 720px; height: 720px; right: -240px; bottom: -280px; animation: drift 20s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(40px, 26px); } }
.login-split {
  display: flex; align-items: stretch; width: 100%; max-width: 960px;
  position: relative; z-index: 1;
  box-shadow: 0 30px 70px rgba(10, 18, 40, .4);
  border-radius: 24px;
}
.login-brand {
  flex: 1.1; color: #fff; padding: 44px 46px 36px;
  display: flex; flex-direction: column; justify-content: center; min-width: 0;
  background: linear-gradient(160deg, rgba(30, 58, 138, .55), rgba(37, 99, 235, .28));
  border: 1px solid rgba(255, 255, 255, .16); border-right: none;
  border-radius: 24px 0 0 24px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lb-logo { display: flex; align-items: center; gap: 11px; font-size: 16px; font-weight: 600; letter-spacing: .5px; margin-bottom: 30px; }
.lb-logo .logo-mark { width: 38px; height: 38px; border-radius: 12px; }
.lb-logo .logo-mark svg { width: 21px; height: 21px; }
.lb-title { font-size: 31px; font-weight: 700; line-height: 1.4; letter-spacing: 1.5px; text-shadow: 0 2px 14px rgba(15, 23, 42, .3); }
.lb-title small { display: block; font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .72); letter-spacing: 3px; margin-top: 6px; }
.lb-feats { margin-top: 30px; display: flex; flex-direction: column; gap: 13px; }
.lb-feats li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: rgba(255, 255, 255, .9); line-height: 1.65; }
.lb-feats li b { color: #fff; }
.lb-foot {
  margin-top: 34px; font-size: 11.5px; color: rgba(255, 255, 255, .55); letter-spacing: 1.5px;
  border-top: 1px dashed rgba(255, 255, 255, .24); padding-top: 15px;
}
.login-card {
  flex: none; width: 396px; background: rgba(255, 255, 255, .97); border-radius: 0 24px 24px 0;
  padding: 38px 34px 30px; border: 1px solid rgba(255, 255, 255, .6);
  display: flex; flex-direction: column; justify-content: center;
  animation: modalUp .38s cubic-bezier(.2, .9, .3, 1.1) both;
}
.login-hint { background: #f7f9fc; border: 1px dashed var(--line); border-radius: var(--r); padding: 10px 12px; font-size: 12px; color: var(--ink-2); line-height: 1.9; }
@media (max-width: 880px) {
  .login-split { max-width: 430px; flex-direction: column; }
  .login-brand { display: none; }
  .login-card { border-radius: 20px; width: 100%; }
}
/* 1920×1000 档：舞台铺满、面板放大、版权常驻底部 */
@media (min-width: 1700px) {
  .login-split { max-width: 1140px; }
  .login-brand { padding: 52px 54px 42px; }
  .lb-title { font-size: 36px; }
  .login-card { width: 430px; padding: 42px 38px 32px; }
}
.login-copyright {
  position: absolute; left: 0; right: 0; bottom: 16px; text-align: center;
  color: rgba(255, 255, 255, .55); font-size: 12px; letter-spacing: .5px; z-index: 1;
  text-shadow: 0 1px 4px rgba(15, 23, 42, .35);
}
.login-copyright .ver { font-family: var(--mono); opacity: .85; margin-left: 10px; }

/* ---------------- 通用动效 ---------------- */
.page.on > * { animation: fadeUp .22s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.filter-card { background: linear-gradient(180deg, #fbfcff, #fff); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow); }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }
.scroll-y { overflow-y: auto; }

/* ---------------- 打印（报表中心等页面：只打内容区，隐藏侧栏/页签/按钮） ---------------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff !important; }
  .sidebar, .page-tabs, .filter-card, .pager, .btn, .toast-wrap { display: none !important; }
  .print-hide { display: none !important; }
  .admin-shell { margin-left: 0 !important; height: auto !important; overflow: visible !important; display: block !important; }
  .admin-content { overflow: visible !important; padding: 0 !important; }
  .page { display: none !important; }
  .page.on { display: block !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .table-wrap { max-height: none !important; overflow: visible !important; }
  .tb { font-size: 11px !important; }
  .tb th { background: #f0f3f8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kpi-value, .diff-tile b { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ================================================================
   PDA 盘库 App 专用（阿布设计）
   ================================================================ */
.pda-root {
  min-height: 100vh; max-width: 480px; margin: 0 auto;
  background: #eef1f6; display: flex; flex-direction: column;
  position: relative; box-shadow: 0 0 40px rgba(16,24,40,.08);
}
.pda-head {
  background: var(--brand-grad); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  position: sticky; top: 0; z-index: 20;
}
.pda-head .t { font-size: 16.5px; font-weight: 600; }
.pda-head .s { font-size: 11.5px; opacity: .85; }
.pda-body { flex: 1; padding: 12px 12px 84px; display: flex; flex-direction: column; gap: 12px; }

/* 底部导航 */
.pda-tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex; background: #fff;
  border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom);
}
.pda-tabbar button {
  flex: 1; border: none; background: none; padding: 9px 0 10px; cursor: pointer;
  color: var(--ink-3); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.pda-tabbar button.on { color: var(--brand); }
.pda-tabbar button.on .tab-ico { background: var(--brand-soft); }
.pda-tabbar svg { width: 21px; height: 21px; }
.tab-ico { width: 44px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; transition: background .15s; }

/* 扫码输入区 —— PDA 扫码枪即键盘输入 + 回车 */
.scan-box {
  background: #fff; border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow);
  border: 1px solid var(--brand-line);
}
.scan-box.focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.scan-input {
  width: 100%; height: 52px; border: 2px dashed var(--brand-line); border-radius: 12px;
  font-size: 19px; font-family: var(--mono); letter-spacing: 1px; text-align: center;
  outline: none; background: var(--brand-soft); color: var(--ink);
}
.scan-input:focus { border-style: solid; border-color: var(--brand); background: #fff; }
/* 扫码识别后的锁定态：内容只读回显，点按不出键盘（手动输入走 ⌨️ 按钮解锁） */
.scan-input[readonly] { background: #eef2f7; color: #475569; border-style: solid; border-color: #dbe3ec; }
.scan-hint { font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: 8px; }

/* 盘点 / 入库 模式切换 */
.seg-on { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }

/* 盘点结果卡 */
.result-card {
  border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow);
  border: 1px solid var(--line); overflow: hidden; animation: fadeUp .2s ease-out;
}
.result-card.flash-ok { animation: flashOk .5s; }
.result-card.flash-diff { animation: flashDiff .5s; }
@keyframes flashOk { 0% { background: var(--ok-soft); } 100% { background: #fff; } }
@keyframes flashDiff { 0% { background: var(--warn-soft); } 100% { background: #fff; } }
.result-top { padding: 14px 16px 10px; border-bottom: 1px dashed var(--line-2); }
.result-name { font-size: 17px; font-weight: 600; }
.result-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.result-nums { display: grid; grid-template-columns: repeat(3, 1fr); padding: 12px 8px; gap: 4px; }
.result-cell { text-align: center; }
.result-cell .lb { font-size: 11.5px; color: var(--ink-3); }
.result-cell .v { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.result-diff-tag {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px; font-size: 14px; font-weight: 600;
}
.result-diff-tag.flat { background: var(--ok-soft); color: var(--ok); }
.result-diff-tag.gain { background: var(--brand-soft); color: var(--brand); }
.result-diff-tag.loss { background: var(--danger-soft); color: var(--danger); }

/* 数量输入键盘 */
.qty-pad { padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.qty-input-row { display: flex; gap: 8px; align-items: center; }
.qty-input {
  flex: 1; height: 56px; border: 1px solid var(--line); border-radius: 12px; text-align: center;
  font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; outline: none;
}
.qty-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.qty-step {
  width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  font-size: 26px; font-weight: 600; color: var(--brand); cursor: pointer; flex: none;
}
.qty-step:active { background: var(--brand-soft); }
.pad-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.pad-grid button {
  height: 52px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 21px; font-weight: 600; cursor: pointer; transition: all .1s;
}
.pad-grid button:active { background: var(--brand-soft); border-color: var(--brand-line); }
.pad-grid button.act { background: var(--brand-grad); border-color: transparent; color: #fff; }
.pad-grid button.act-ok { background: var(--ok); border-color: transparent; color: #fff; }
.pad-grid button.wide { grid-column: span 2; }

/* 任务卡 */
.task-card {
  background: #fff; border-radius: var(--r-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; transition: all .15s;
}
.task-card:active { transform: scale(.985); }
.task-card .t-name { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.task-card .t-meta { font-size: 12px; color: var(--ink-3); margin-top: 5px; display: flex; gap: 12px; flex-wrap: wrap; }
.task-card .t-prog { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.task-card .t-prog .bar { flex: 1; height: 8px; }
.task-card .t-prog .pc { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }

/* 快捷记录（最近盘点） */
.recent-item {
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px;
  border: 1px solid var(--line); padding: 10px 14px; font-size: 13px;
}
.recent-item .code { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.recent-item .diff { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }

/* 统计头部小卡 */
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-kpi { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 10px 6px; text-align: center; }
.mini-kpi .lb { font-size: 11px; color: var(--ink-3); }
.mini-kpi .v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ---------------- 手机端适配（≤700px：抽屉侧栏 + 密度压缩） ---------------- */
/* 抽屉遮罩：桌面默认隐形，仅 body.sb-open 时显示（sb-open 只会在手机端被置位） */
.sb-mask {
  position: fixed; inset: 0; z-index: 39; background: rgba(17, 24, 39, .45);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
body.sb-open .sb-mask { opacity: 1; pointer-events: auto; }
.mob-menu-btn { display: none; }
@media (max-width: 700px) {
  /* 顶栏：汉堡按钮 + 页签横滚；心电图动画收起让位 */
  .mob-menu-btn {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 34px; height: 34px; margin-right: 6px; border-radius: 9px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .38); background: rgba(255, 255, 255, .16);
    color: #fff; font-size: 16px; line-height: 1;
  }
  .tabs-ecg { display: none; }
  .page-tabs { padding: 0 10px; height: 52px; min-height: 52px; }
  .ptab { max-width: 150px; padding: 6px 8px 6px 11px; }

  /* 侧栏 → 左侧抽屉，点汉堡滑出、点遮罩收回 */
  .sidebar {
    width: 252px; transform: translateX(-105%); transition: transform .25s ease;
    box-shadow: 8px 0 28px rgba(9, 18, 44, .35);
  }
  body.sb-open .sidebar { transform: none; }
  /* 恢复被 701-960px 图标栏模式隐藏的内容 */
  .sb-brand { justify-content: flex-start; padding: 0 14px; }
  .sb-brand > div { display: block; }
  .sb-name, .sb-slogan, .sb-copy, .sb-title { display: block; }
  .sb-user { padding: 10px 12px; }
  .sb-uinfo { display: block; }
  .lo-txt { display: inline; }
  .sb-item { justify-content: flex-start; padding: 9px 11px; }
  .sb-txt, .sb-badge { display: inline; }
  .sb-actions { flex-direction: row; }
  .sb-logout { padding: 5px 8px; font-size: 11.5px; }

  /* 主区占满全宽 */
  .admin-shell { margin-left: 0; height: 100vh; height: 100dvh; }
  .admin-content { padding: 10px 10px 0; }

  /* 看板：桌面是「满屏填充」布局（flex:1 钉死高度+fr 均分行），手机改自然文档流，
     行高随内容撑开、由 admin-content 滚动，否则 KPI/图表会被均分行裁切 */
  .admin-content > .page.on#page-dash { display: block; flex: none; min-height: auto; }
  #page-dash { padding-bottom: 16px; }
  .dash-board { gap: 8px; grid-template-rows: none; flex: none; }
  .dash-board > .sp-3 { grid-column: span 6; }
  .dash-board > .sp-4, .dash-board > .sp-8 { grid-column: span 12; }
  .dash-board .donut-box { width: 118px; height: 118px; }
  .kpi-value { font-size: 22px; }
  .dt-num { font-size: 24px; }

  /* 触控友好：输入 16px 防 iOS 聚焦自动放大 */
  .input, .select, .textarea { font-size: 16px; }
  .input, .select { height: 42px; }
  .btn { height: 40px; padding: 0 14px; }
  .btn-sm { height: 34px; padding: 0 12px; }
  .chip { height: 34px; }
  .chip-group { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 密度：卡片 / 间距 */
  .card { padding: 12px 13px; border-radius: 14px; }
  .mt12 { margin-top: 8px; } .mt16 { margin-top: 10px; } .mt20 { margin-top: 12px; }

  /* 筛选栏：控件流式铺满、不固定宽度 */
  .filter-card { padding: 10px 12px; }
  .filter-card .input, .filter-card .select { width: auto !important; flex: 1 1 130px; min-width: 0; }
  .filter-card .search-input { flex: 2 1 160px; }

  /* ---------- 表格 → 卡片流（表头文字由 JS 写入 data-label，参考停车云） ---------- */
  .table-wrap { overflow: visible !important; max-height: none !important; border: none !important; background: transparent; border-radius: 0; -webkit-overflow-scrolling: touch; }
  table.tb { display: block; font-size: 13.5px; }
  table.tb thead { display: none; }
  table.tb tbody { display: block; }
  table.tb tbody tr {
    display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 4px 12px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  }
  table.tb tbody tr:last-child { margin-bottom: 0; }
  table.tb tbody td {
    display: block; position: relative; padding: 7px 0 7px 84px; min-height: 30px;
    background: transparent !important; text-align: right; word-break: break-word;
    border-bottom: 1px dashed var(--line-2);
  }
  table.tb tbody td:last-child { border-bottom: none; }
  table.tb tbody td::before {
    content: attr(data-label); position: absolute; left: 0; top: 7px; width: 76px;
    text-align: left; color: var(--ink-3); font-size: 12.5px; font-weight: 500; line-height: 1.6;
  }
  table.tb tbody td[data-label=''] { padding-left: 0; }
  table.tb tbody td[data-label='']::before { display: none; }
  table.tb tbody td > .input, table.tb tbody td > .select { max-width: 100%; }
  /* 空行 / 合并单元格行：整卡居中，不出标签 */
  table.tb tbody tr.tb-empty-row { padding: 0; border: none; box-shadow: none; margin-bottom: 0; }
  table.tb tbody tr.tb-empty-row td { display: block; text-align: center; padding: 18px 0; border-bottom: none; }
  table.tb tbody tr.tb-empty-row td::before { display: none; }
  /* 表单型表格（行内输入/下拉）：保留表格形态 + 横向滚动 */
  table.tb.tb-form { display: table; min-width: 560px; white-space: nowrap; }
  table.tb.tb-form thead { display: table-header-group; }
  table.tb.tb-form tbody { display: table-row-group; }
  table.tb.tb-form tbody tr { display: table-row; background: none; border: none; box-shadow: none; padding: 0; margin: 0; }
  table.tb.tb-form tbody td { display: table-cell; text-align: left; padding: 7px 9px; min-height: 0; border-bottom: 1px solid var(--line-2); }
  table.tb.tb-form tbody td::before { display: none; }
  .table-wrap.tb-form-wrap { overflow: auto !important; border: 1px solid var(--line-2) !important; border-radius: 10px; background: #fff; }

  /* ---------- 弹窗 → 底部抽屉 ---------- */
  .mask { padding: 0; align-items: flex-end; }
  .modal, .modal-lg { max-width: none; width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; }
  .modal-head { position: sticky; top: 0; z-index: 3; background: #fff; padding: 14px 16px; border-radius: 18px 18px 0 0; }
  .modal-body { padding: 14px 16px; }
  .modal-foot {
    position: sticky; bottom: 0; z-index: 3; background: #fff; flex-wrap: wrap; gap: 8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
  .modal-foot .btn { flex: 1 1 40%; height: 44px; }

  /* 分页压缩：隐藏跳页，按钮加高 */
  .pager { margin: 10px -13px -13px; padding: 8px 12px 10px; }
  .pager .pg-jump { display: none; }
  .pager button.pg-btn { min-width: 34px; height: 34px; padding: 0 7px; font-size: 12px; }
  .toast { max-width: 88vw; }
}

@media (prefers-reduced-motion: reduce) {
  .page.on > *, .result-card, .toast { animation: none; }
  .live-dot { animation: none; }
}

/* ---------------- 摄像头扫码层 ---------------- */
.cam-mask { position: fixed; inset: 0; z-index: 400; background: #000; display: flex; align-items: center; justify-content: center; }
.cam-mask video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: relative; width: 82%; height: 34vh; max-width: 440px; }
.cam-frame i { position: absolute; width: 28px; height: 28px; border: 3px solid #fff; opacity: .92; }
.cam-frame .c1 { left: 0; top: 0; border-right: none; border-bottom: none; border-radius: 10px 0 0 0; }
.cam-frame .c2 { right: 0; top: 0; border-left: none; border-bottom: none; border-radius: 0 10px 0 0; }
.cam-frame .c3 { left: 0; bottom: 0; border-right: none; border-top: none; border-radius: 0 0 0 10px; }
.cam-frame .c4 { right: 0; bottom: 0; border-left: none; border-top: none; border-radius: 0 0 10px 0; }
.cam-frame .laser {
  position: absolute; left: 5%; right: 5%; top: 50%; height: 2px;
  background: linear-gradient(90deg, transparent, #ef4444 30%, #ef4444 70%, transparent);
  box-shadow: 0 0 8px rgba(239, 68, 68, .8);
  animation: laserMove 2.2s ease-in-out infinite;
}
@keyframes laserMove { 0%, 100% { top: 10%; } 50% { top: 90%; } }
.cam-hint {
  position: absolute; bottom: 11vh; left: 0; right: 0; text-align: center;
  color: #fff; font-size: 13.5px; text-shadow: 0 1px 4px rgba(0, 0, 0, .65);
}
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 12px 14px; }
.cam-top button {
  border: none; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px;
  padding: 9px 18px; border-radius: 20px; cursor: pointer;
}
.cam-top button.on { background: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  .cam-frame .laser { animation: none; }
}
