/* 轻库存 · 界面样式（数据看板风格 / 蓝色主色） */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2430;
  --sub: #6b7280;
  --mute: #9aa3af;
  --line: #eef1f5;
  --brand: #2f6bff;
  --brand-d: #2558e0;
  --brand-l: #eef3ff;
  --green: #12b981;
  --green-l: #e8f8f2;
  --red: #ef4444;
  --red-l: #feeded;
  --orange: #f59e0b;
  --orange-l: #fff5e6;
  --purple: #8b5cf6;
  --purple-l: #f3efff;
  --teal: #0ea5a4;
  /* 旧页面沿用的别名，保持兼容 */
  --blue: #2f6bff;
  --blue-l: #eef3ff;
  --green-d: #0a9a6a;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(17, 34, 68, .05);
}
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
input, button, select, textarea { font-family: inherit; font-size: 14px; outline: none; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.hide { display: none !important; }
.only-desk { display: block; }
.only-mob { display: none; }

/* ---------- 登录 / 初始化 ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(900px 500px at 15% 0%, #e4ecff 0%, rgba(245, 247, 250, 0) 60%), var(--bg);
}
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 20px; padding: 32px 28px; box-shadow: 0 16px 48px rgba(31, 63, 130, .1); }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 11px; color: #fff; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4d86ff, #2453d6);
  box-shadow: 0 6px 14px rgba(47, 107, 255, .35);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.auth-sub { color: var(--sub); margin: 8px 0 22px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #e6eaf0; border-radius: 10px; background: #fafbfc; transition: .18s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .1); }
.btn {
  border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 500; cursor: pointer;
  background: #f1f3f6; color: var(--text); transition: .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(180deg, #3d78ff, #2f6bff); color: #fff; box-shadow: 0 4px 12px rgba(47, 107, 255, .28); }
.btn.primary:hover { background: linear-gradient(180deg, #3670f2, #2558e0); }
.btn.block { width: 100%; padding: 13px; font-size: 15px; }
.btn.ghost { background: #fff; border: 1px solid #e6eaf0; color: #374151; }
.btn.danger { background: var(--red-l); color: var(--red); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.tiny { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.auth-err { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 10px; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 224px; flex: 0 0 224px; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 9px; padding: 2px 8px 4px; }
.side-brand .brand-logo { width: 34px; height: 34px; border-radius: 10px; }
.side-brand .brand-logo svg { width: 18px; height: 18px; }
.side-brand b { font-size: 15px; }
.side-brand small { display: block; font-size: 9px; color: var(--mute); letter-spacing: .6px; font-weight: 400; }
.side-co { font-size: 11px; color: var(--mute); padding: 6px 8px 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  color: #4b5563; margin-bottom: 2px; transition: .15s; font-size: 13.5px; position: relative;
}
.nav-item svg { width: 18px; height: 18px; stroke: #8a94a6; flex: 0 0 18px; fill: none; stroke-width: 1.8; }
.nav-item:hover { background: #f7f9fc; }
.nav-item.active { background: var(--brand-l); color: var(--brand); font-weight: 600; }
.nav-item.active svg { stroke: var(--brand); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side-foot { margin-top: auto; padding-top: 14px; }
.license-pill { display: block; font-size: 12px; padding: 8px 10px; border-radius: 9px; background: #f5f7fa; color: var(--sub); cursor: pointer; text-align: center; }
.license-pill.warn { background: var(--orange-l); color: #b45309; }
.license-pill.bad { background: var(--red-l); color: var(--red); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar h2 { font-size: 18px; }
.topbar .sub { font-size: 12px; color: var(--mute); margin-top: 3px; }
.tb-back { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-l); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.view { padding: 16px 24px 40px; flex: 1; max-width: 1240px; width: 100%; }

/* 手机底部导航 */
.tabbar { display: none; }

/* ---------- 卡片 / 通用 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-title h3 svg { width: 17px; height: 17px; stroke: var(--brand); fill: none; stroke-width: 2; }
.card-title .more { font-size: 12px; color: var(--mute); cursor: pointer; }
.card-title .more:hover { color: var(--brand); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--sub); }
.small { font-size: 12px; }
.big { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.num { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.empty { text-align: center; padding: 36px 10px; color: var(--mute); font-size: 13px; }
.empty .em-ico { font-size: 28px; display: block; margin-bottom: 8px; opacity: .45; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; line-height: 18px; }
.pill.green { background: var(--green-l); color: #078a5f; }
.pill.red { background: var(--red-l); color: var(--red); }
.pill.orange { background: var(--orange-l); color: #b45309; }
.pill.blue { background: var(--brand-l); color: var(--brand); }
.pill.gray { background: #f2f4f7; color: var(--sub); }

/* ---------- 表单要素 ---------- */
.inp { padding: 9px 12px; border: 1px solid #e6eaf0; border-radius: 9px; background: #fff; min-width: 0; color: var(--text); }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .1); }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .f-search { flex: 1 1 240px; min-width: 140px; }
.filters .f-date { flex: 0 0 auto; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; color: var(--mute); font-weight: 500; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12px; background: #fafbfd; }
table.tbl th:first-child { border-radius: 8px 0 0 8px; }
table.tbl th:last-child { border-radius: 0 8px 8px 0; }
table.tbl td { padding: 12px 10px; border-bottom: 1px solid #f4f6f9; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.clickable { cursor: pointer; }
table.tbl tr.clickable:hover { background: #fafbfd; }
.right { text-align: right !important; }
.nowrap { white-space: nowrap; }
.thumb { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: #f2f4f7; flex: 0 0 34px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--mute); }
.mob-list { display: none; }
.mob-item { padding: 13px 4px; border-bottom: 1px solid #f4f6f9; }
.mob-item:last-child { border-bottom: 0; }
.mob-item .mi-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mob-item .mi-name { font-weight: 600; font-size: 14px; }
.mob-item .mi-qty { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mob-item .mi-sub { font-size: 11px; color: var(--mute); margin-top: 3px; }
.mob-item .mi-foot { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12px; color: var(--sub); }

/* ---------- 数据看板 ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.dash-head p { margin: 0; font-size: 12px; color: var(--mute); }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi-card { background: #fff; border-radius: 14px; padding: 18px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.kpi-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 46px; }
.kpi-ico svg { width: 22px; height: 22px; fill: none; stroke-width: 1.8; }
.kpi-l { font-size: 12px; color: var(--mute); }
.kpi-v { font-size: 24px; font-weight: 700; letter-spacing: -.4px; margin: 1px 0 2px; line-height: 1.25; }
.kpi-v small { font-size: 12px; font-weight: 400; color: var(--sub); margin-left: 3px; }
.kpi-d { font-size: 11px; color: var(--mute); }
.kpi-d b { font-weight: 600; }
.up { color: #0aa06e; }
.down { color: var(--red); }
.dash-2 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 14px; margin-top: 14px; }
.dash-3 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.chart-legend { display: flex; gap: 16px; font-size: 11px; color: var(--sub); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.donut-row { display: flex; align-items: center; gap: 12px; }
.donut { position: relative; width: 152px; height: 152px; flex: 0 0 152px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center b { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.donut-center span { font-size: 11px; color: var(--mute); }
.cat-list { flex: 1; min-width: 0; }
.cat-item { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; color: var(--sub); }
.cat-item i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.cat-item .cn { width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cat-item .cp { width: 42px; text-align: right; color: var(--mute); }
.cat-item .ca { flex: 1; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.alert-card .card-title h3 svg { stroke: var(--red); }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #f0f2f6; }
.alert-row:last-child { border-bottom: 0; }
.alert-row .ar-ico { width: 26px; height: 26px; border-radius: 7px; background: #f7f9fc; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.alert-row .ar-main { flex: 1; min-width: 0; }
.alert-row .ar-name { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-row .ar-sub { font-size: 11px; color: var(--mute); }
.alert-row .ar-val { font-size: 12px; color: var(--red); white-space: nowrap; }
.btn-alert { width: 100%; margin-top: 10px; border: 0; border-radius: 9px; padding: 9px; background: linear-gradient(180deg, #ff6b6b, #ef4444); color: #fff; font-size: 13px; cursor: pointer; }
.ring-row { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 108px; height: 108px; flex: 0 0 108px; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-size: 20px; font-weight: 700; }
.ring-center span { font-size: 10px; color: var(--mute); }
.ring-stats { flex: 1; font-size: 12px; }
.ring-stat { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; color: var(--sub); }
.ring-stat i { width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; display: inline-block; }
.ring-stat b { color: var(--text); font-weight: 600; }
.hero { background: linear-gradient(135deg, #4785ff 0%, #2f6bff 55%, #1b47c2 100%); color: #fff; border-radius: 18px; padding: 20px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .12); right: -60px; top: -90px; }
.hero::before { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .07); right: 60px; bottom: -70px; }
.hero .lab { font-size: 12px; opacity: .85; }
.hero .big { font-size: 30px; margin: 4px 0 2px; position: relative; z-index: 1; }
.hero .stats { display: flex; gap: 24px; margin-top: 14px; font-size: 12px; opacity: .95; position: relative; z-index: 1; }
.hero .stats b { font-size: 16px; display: block; font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick button { background: #fff; border: 0; border-radius: 14px; padding: 14px 8px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text); transition: .15s; }
.quick button:active { transform: scale(.97); }
.quick .qi { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.quick .qi svg { width: 19px; height: 19px; fill: none; stroke-width: 2; }
.qi.g { background: var(--brand-l); color: var(--brand); }
.qi.o { background: var(--orange-l); color: #c2750a; }
.qi.b { background: #e8f6fd; color: #0b93c7; }
.qi.r { background: var(--purple-l); color: var(--purple); }
.quick span { font-size: 12px; color: #4b5563; }
.order-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #f4f6f9; cursor: pointer; }
.order-row:last-child { border-bottom: 0; }
.order-row .ono { font-size: 12px; color: var(--mute); font-weight: 500; }
.order-row .nm { font-size: 12.5px; }
.order-row .amt { font-size: 13px; font-weight: 600; }
.kpi { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.kpi .kico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.kpi b { display: block; font-size: 15px; font-weight: 600; }
.kpi span { font-size: 11px; color: var(--sub); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 92px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 62px; }
.bar { width: 9px; border-radius: 4px 4px 2px 2px; background: var(--brand); min-height: 2px; }
.bar.out { background: #7ee2c1; }
.bar-col .d { font-size: 10px; color: var(--mute); }
.legend { display: flex; gap: 14px; font-size: 11px; color: var(--sub); margin-top: 6px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.alert-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f4f6f9; cursor: pointer; }
.alert-item:last-child { border-bottom: 0; }
.alert-item .dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.dot.high { background: var(--red); }
.dot.mid { background: var(--orange); }
.dot.low { background: #c7c9cc; }
.alert-item p { margin: 0; font-size: 13px; flex: 1; }

/* ---------- 单据页 ---------- */
.seg { display: inline-flex; flex-wrap: nowrap; background: #fff; border-radius: 10px; padding: 3px; box-shadow: var(--shadow); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 15px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--sub); white-space: nowrap; }
.seg button.on { background: var(--brand); color: #fff; font-weight: 500; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 8px; background: #f5f7fa; border: 1px solid transparent; cursor: pointer; font-size: 13px; color: var(--sub); }
.chip.on { background: var(--brand-l); border-color: #cfdcff; color: var(--brand); font-weight: 500; }
.scan-box { display: flex; gap: 8px; flex-wrap: nowrap; }
.scan-box input { flex: 1; min-width: 0; padding: 12px 14px; border: 1.5px dashed #cfd8e6; border-radius: 11px; background: #fafbfd; font-size: 15px; }
.scan-box input:focus { border-color: var(--brand); border-style: solid; background: #fff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .08); }
.scan-box .btn { flex: 0 0 auto; white-space: nowrap; }
.line-item { display: grid; grid-template-columns: 1fr 92px 84px 26px; gap: 8px; align-items: center; padding: 11px 0; border-bottom: 1px solid #f4f6f9; }
.line-item:last-child { border-bottom: 0; }
.line-item .li-name { font-size: 13px; font-weight: 500; }
.line-item .li-sub { font-size: 11px; color: var(--mute); }
.line-item input { width: 100%; padding: 7px 8px; border: 1px solid #e6eaf0; border-radius: 8px; text-align: right; }
.line-item input:focus { border-color: var(--brand); }
.li-del { border: 0; background: transparent; color: #c4cbd6; cursor: pointer; font-size: 16px; padding: 4px; }
.li-del:hover { color: var(--red); }
.total-bar { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; }
.total-bar .tnum { font-size: 22px; font-weight: 700; color: var(--text); }
.form-foot { position: sticky; bottom: 0; background: rgba(245, 247, 250, .94); backdrop-filter: blur(10px); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 14px; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; animation: pop .2s ease; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-h { padding: 18px 20px 6px; display: flex; align-items: center; justify-content: space-between; }
.modal-h h3 { font-size: 16px; }
.modal-x { border: 0; background: transparent; font-size: 20px; color: var(--mute); cursor: pointer; line-height: 1; padding: 0 2px; }
.modal-b { padding: 12px 20px; }
.modal-f { padding: 10px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-f .btn { min-width: 88px; }
.picker { max-height: 55vh; overflow: auto; margin: -4px -6px; }
.picker-item { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-radius: 9px; cursor: pointer; }
.picker-item:hover { background: #f7f9fc; }
.picker-item .pi-name { font-size: 13px; font-weight: 500; }
.picker-item .pi-sub { font-size: 11px; color: var(--mute); }

/* ---------- 提示 ---------- */
.toast { position: fixed; left: 50%; top: 22px; transform: translateX(-50%); background: rgba(23, 24, 26, .88); color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; z-index: 200; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); animation: pop .2s; max-width: 86vw; }
.toast.ok { background: rgba(10, 160, 110, .95); }
.toast.err { background: rgba(220, 60, 60, .95); }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar { padding: 12px 16px; }
  .view { padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); max-width: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar button { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0; color: var(--mute); font-size: 11px; cursor: pointer; border-radius: 10px; }
  .tabbar button svg { width: 21px; height: 21px; stroke: #9aa3af; fill: none; stroke-width: 1.9; }
  .tabbar button.on { color: var(--brand); font-weight: 600; }
  .tabbar button.on svg { stroke: var(--brand); }
  .g2, .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(3, 1fr); }
  .kpi { padding: 10px 8px; gap: 8px; }
  .kpi .kico { width: 26px; height: 26px; font-size: 13px; }
  .kpi b { font-size: 13px; }
  .kpi span { font-size: 10px; }
  .hero { padding: 20px 18px; }
  .hero .big { font-size: 27px; }
  .quick { gap: 8px; }
  .quick button { color: #fff; padding: 15px 6px 13px; border-radius: 14px; box-shadow: 0 8px 18px rgba(31, 63, 130, .16); }
  .quick button:nth-child(1) { background: linear-gradient(140deg, #4d86ff, #2b5ee8); }
  .quick button:nth-child(2) { background: linear-gradient(140deg, #2ed3b7, #0ea98f); }
  .quick button:nth-child(3) { background: linear-gradient(140deg, #ffb340, #f18514); }
  .quick button:nth-child(4) { background: linear-gradient(140deg, #9d7bff, #7145e8); }
  .quick .qi { width: auto; height: auto; background: transparent; }
  .quick .qi svg { width: 22px; height: 22px; stroke: #fff; }
  .quick span { color: #fff; font-size: 12px; font-weight: 500; }
  .line-item { grid-template-columns: 1fr 74px 70px 24px; }
  .filters .f-search { flex: 1 1 100%; }
  .filters .f-date { flex: 1 1 36%; }
  .filters .f-date { flex: 1 1 40%; }
  .filters .btn { flex: 0 0 auto; }
  .scan-box input { min-width: 0; }
  .scan-box .btn { padding-left: 12px; padding-right: 12px; }
  .modal { max-height: 92vh; border-radius: 16px; }
  .table-mobile thead { display: none; }
  .desk-table { display: none; }
  .mob-list { display: block; }
  .topbar .sub { display: none; }
  .topbar h2 { font-size: 17px; }
  .topbar-stock .tb-back { display: flex; align-items: center; justify-content: center; border: 0; background: transparent; padding: 4px; margin: 0 2px 0 -6px; color: #1f2430; }
  .top-actions .license-pill { display: none; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1; padding: 7px 6px; }
  .form-foot { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .only-desk { display: none; }
  .only-mob { display: block; }
  .dash-2, .dash-3 { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 12px; gap: 10px; }
  .kpi-ico { width: 36px; height: 36px; flex: 0 0 36px; }
  .kpi-ico svg { width: 18px; height: 18px; }
  .kpi-v { font-size: 18px; }
  .donut-row { gap: 8px; }
  .donut { width: 128px; height: 128px; flex: 0 0 128px; }
  .cat-item .cn { width: 46px; }
}
@media (max-width: 380px) {
  .quick { grid-template-columns: repeat(2, 1fr); }
}

/* ================= 手机新版看板 ================= */
.m-head { display: none; }
@media (max-width: 860px) {
  .topbar-home { display: none !important; }
  .m-head {
    display: block; margin: -14px -14px 0; padding: 18px 16px 60px;
    background: linear-gradient(150deg, #4482ff 0%, #2f6bff 52%, #1b47c2 100%);
    color: #fff; border-radius: 0 0 26px 26px; position: relative; overflow: hidden;
  }
  .m-head::after { content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,.12); right: -70px; top: -100px; }
  .m-head::before { content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.08); right: 40px; bottom: -60px; }
  .mh-top { display: flex; align-items: flex-start; justify-content: space-between; position: relative; z-index: 1; }
  .mh-title { font-size: 23px; font-weight: 800; letter-spacing: .6px; }
  .mh-sub { font-size: 11px; opacity: .85; margin-top: 5px; letter-spacing: .3px; }
  .mh-tools { display: flex; align-items: center; gap: 8px; }
  .m-bell { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18); border: 0; color: #fff; display: flex; align-items: center; justify-content: center; position: relative; }
  .m-bell i { position: absolute; top: -3px; right: -4px; background: #ff4d4f; color: #fff; font-style: normal; font-size: 9px; min-width: 15px; height: 15px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
  .m-search { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 24px; padding: 7px 8px 7px 14px; margin-top: 14px; box-shadow: 0 8px 18px rgba(10, 35, 100, .18); position: relative; z-index: 1; }
  .m-search input { flex: 1; border: 0; background: transparent; font-size: 12.5px; color: #1f2430; min-width: 0; padding: 2px 0; }
  .m-search input::placeholder { color: #a8b0bd; }
  .ms-ico { color: #9aa3af; display: flex; flex: 0 0 auto; }
  .ms-btn { border: 0; background: transparent; color: #6b7280; padding: 3px; display: flex; flex: 0 0 auto; }
  .ms-filter { border: 0; background: #eef3ff; color: #2f6bff; border-radius: 16px; padding: 6px 12px; font-size: 11.5px; display: flex; gap: 3px; align-items: center; flex: 0 0 auto; }
  .m-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: -46px 0 0; position: relative; z-index: 2; }
  .m-kpi { background: #fff; border-radius: 12px; padding: 8px 6px; box-shadow: 0 6px 16px rgba(20, 50, 120, .14); display: flex; align-items: center; gap: 5px; min-width: 0; }
  .m-kpi .mi { width: 22px; height: 22px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex: 0 0 22px; }
  .m-kpi .mi svg { width: 13px; height: 13px; }
  .m-kpi .mtx { min-width: 0; flex: 1; }
  .m-kpi .ml { font-size: 8.5px; color: #8b95a5; white-space: nowrap; overflow: hidden; }
  .m-kpi .mv { font-size: 12px; font-weight: 700; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-kpi .mv small { font-size: 7.5px; font-weight: 400; color: #8b95a5; margin-left: 1px; }
  .m-kpi .md { font-size: 8px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-donut-row { display: flex; gap: 6px; align-items: center; }
  .m-donut { position: relative; width: 132px; height: 132px; flex: 0 0 132px; }
  .m-donut .donut-center b { font-size: 16px; }
  .m-donut .donut-center span { font-size: 9px; }
  .m-cats { flex: 1; min-width: 0; }
  .m-cat { display: flex; align-items: center; gap: 4px; padding: 3.5px 0; font-size: 9px; }
  .m-cat .pill { font-size: 8.5px; padding: 1px 6px; border-radius: 4px; max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-cat .pct { width: 32px; text-align: right; color: #6b7280; flex: 0 0 32px; }
  .m-cat .qty { flex: 1; text-align: right; color: #1f2430; white-space: nowrap; }
  .m-insight { margin-top: 10px; background: #f1f6ff; border-radius: 9px; padding: 8px 10px; font-size: 10px; color: #3b5b95; display: flex; gap: 6px; align-items: center; line-height: 1.4; }
  .m-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; align-items: stretch; }
  .m-duo > .card { padding: 12px; border-radius: 14px; margin: 0 !important; box-shadow: 0 2px 8px rgba(17,34,68,.04); }
  .alert-mini { background: linear-gradient(180deg, #fff7f7, #fff); border: 1px solid #ffe4e4; }
  .alert-mini .t { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; color: #d63b3b; gap: 4px; }
  .alert-mini .t em { font-style: normal; }
  .alert-mini .badge { background: #ffe3e3; color: #e54848; font-size: 8px; padding: 1px 5px; border-radius: 5px; font-weight: 500; white-space: nowrap; }
  .am-btn { width: 100%; margin: 8px 0 6px; border: 0; background: linear-gradient(180deg, #ff6b6b, #ef4444); color: #fff; font-size: 10px; padding: 6px; border-radius: 7px; }
  .am-row { display: flex; align-items: center; gap: 4px; padding: 3.5px 0; font-size: 9px; color: #6b7280; border-top: 1px dashed #ffeaea; }
  .am-row:first-of-type { border-top: 0; }
  .am-row b { font-weight: 500; color: #1f2430; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .am-row span { white-space: nowrap; }
  .am-low { color: #e54848; font-size: 8px; background: #ffe9e9; border-radius: 4px; padding: 1px 4px; white-space: nowrap; }
  .take-mini { background: linear-gradient(180deg, #f3f8ff, #fff); border: 1px solid #e4edff; }
  .take-mini .t { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 700; color: #2f6bff; }
  .take-mini .t span { font-size: 8px; color: #8b95a5; font-weight: 400; }
  .tm-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
  .tm-ring { width: 82px; height: 82px; position: relative; flex: 0 0 82px; }
  .tm-ring .ring-center b { font-size: 15px; }
  .tm-ring .ring-center span { font-size: 8px; }
  .tm-legend { font-size: 9px; flex: 1; min-width: 0; }
  .tm-lg { display: flex; justify-content: space-between; padding: 2.5px 0; color: #6b7280; gap: 4px; }
  .tm-lg i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 3px; }
  .tm-lg b { color: #1f2430; font-weight: 600; white-space: nowrap; }
  .m-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
  .m-q { background: transparent; border: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 2px; font-size: 10px; color: #4b5563; }
  .m-q i { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #eef3ff; color: #2f6bff; }
  .m-q i svg { width: 20px; height: 20px; }
  .m-q:nth-child(2) i { background: #e8f8f2; color: #0aa06e; }
  .m-q:nth-child(3) i { background: #fff5e6; color: #c2750a; }
  .m-q:nth-child(4) i { background: #f3efff; color: #8b5cf6; }
  .m-q:nth-child(5) i { background: #e8f6fd; color: #0b93c7; }
  .tabbar { overflow: visible; padding-top: 9px; }
  .tab-plus {
    flex: 0 0 52px !important; width: 52px; height: 52px; min-height: 52px; margin-top: -26px;
    border-radius: 50% !important; background: linear-gradient(180deg, #4d86ff, #2f6bff) !important;
    box-shadow: 0 8px 18px rgba(47, 107, 255, .42); align-self: flex-start; justify-content: center; padding: 0 !important; color: #fff !important;
  }
  .tab-plus svg { width: 24px; height: 24px; stroke: #fff !important; }
  .tab-plus + button, .tabbar button { min-width: 0; }
  .stock-banner { background: linear-gradient(135deg, #eef4ff, #f8fbff); border: 1px solid #e3ecff; border-radius: 14px; padding: 11px 14px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .stock-banner .sb-l { font-size: 9.5px; color: #6b7280; }
  .stock-banner .sb-v { font-size: 17px; font-weight: 700; color: #1f2430; margin-top: 1px; }
  .stock-banner .sb-v small { font-size: 9px; color: #8b95a5; font-weight: 400; margin-left: 2px; }
  .stock-banner .sb-low { color: #e54848; }
  .stock-item { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid #f4f6f9; cursor: pointer; }
  .stock-item:last-child { border-bottom: 0; }
  .si-thumb { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; flex: 0 0 40px; }
  .si-main { flex: 1; min-width: 0; }
  .si-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .si-sub { font-size: 9px; color: #9aa3af; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .si-right { text-align: right; flex: 0 0 auto; }
  .si-qty { font-size: 15px; font-weight: 700; line-height: 1.2; }
  .si-qty small { font-size: 9px; color: #8b95a5; font-weight: 400; margin-left: 2px; }
  .si-low { display: inline-block; margin-top: 3px; font-size: 8px; color: #e54848; background: #ffe9e9; padding: 1px 5px; border-radius: 4px; }
  .si-amt { font-size: 9px; color: #8b95a5; margin-top: 2px; }
  .pager { display: flex; justify-content: center; align-items: center; gap: 5px; padding: 12px 0 4px; font-size: 10px; color: #6b7280; flex-wrap: wrap; }
  .pager button { min-width: 26px; height: 26px; border: 1px solid #e6eaf0; background: #fff; border-radius: 7px; color: #6b7280; font-size: 11px; }
  .pager button.on { background: #2f6bff; border-color: #2f6bff; color: #fff; }
  .pager .pinfo { margin-right: 4px; }
  .pager { padding-bottom: 10px; }
  .m-st-search { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e8edf5; border-radius: 22px; padding: 6px 8px 6px 13px; box-shadow: 0 3px 10px rgba(20, 50, 120, .05); }
  .m-st-search input { flex: 1; border: 0; background: transparent; font-size: 12px; color: #1f2430; min-width: 0; padding: 3px 0; }
  .m-st-search input::placeholder { color: #a8b0bd; }
  .st-seg { display: flex; background: #eef2f8; border-radius: 12px; padding: 3px; margin-top: 9px; gap: 3px; box-shadow: none; border: 0; }
  .st-seg button { flex: 1; padding: 8px 0; font-size: 12.5px; border-radius: 9px; color: #5b6472; background: transparent; }
  .st-seg button.on { background: #fff; color: #2f6bff; font-weight: 600; box-shadow: 0 2px 6px rgba(20, 50, 120, .10); }
  .stock-thead { display: flex; justify-content: space-between; font-size: 9.5px; color: #9aa3af; padding: 8px 2px 5px; border-bottom: 1px solid #f0f3f8; }
  .si-mv { font-size: 8.5px; color: #9aa3af; margin-top: 3px; }
  .si-mv b { font-weight: 600; }
}
.qsheet { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qsheet button { border: 0; background: #f5f8ff; border-radius: 12px; padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: #1f2430; }
.qsheet i { width: 44px; height: 44px; border-radius: 50%; background: #e8efff; color: #2f6bff; display: flex; align-items: center; justify-content: center; }
