/* 库存管理系统 全站样式：手机优先，电脑端放宽
   设计规则：16px 基准字号、圆角 16、主色 #2563eb、灰阶 #f6f7f9 / #e9edf3
   手机端所有列表用「一条一张卡片」，电脑端用标准表格。 */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #9aa3af;
  --line: #e9edf3;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eef4ff;
  --primary-line: #c7d7ff;
  --success: #15803d;
  --success-soft: #ecfdf3;
  --success-line: #bbf7d0;
  --warning: #c2410c;
  --warning-soft: #fff7ed;
  --warning-line: #fed7aa;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;
  --neutral-50: #f9fafb;
  --neutral-100: #f3f4f6;
  --neutral-200: #e5e7eb;
  --neutral-500: #6b7280;
  --neutral-700: #374151;
  --in: #16a34a;
  --in-dark: #15803d;
  --in-soft: #ecfdf5;
  --in-line: #bbf7d0;
  --out: #ea580c;
  --out-dark: #c2410c;
  --out-soft: #fff7ed;
  --out-line: #fed7aa;
  --ok: var(--success);
  --ok-soft: var(--success-soft);
  --warn: var(--warning);
  --warn-soft: var(--warning-soft);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
  --shadow-soft: 0 1px 2px rgba(17, 24, 39, 0.04);
  --tabbar-h: 62px;

  /* 密度变量：移动端在下面的 @media 里改这一组就能整体增密 */
  --sp-1: 6px;      /* 小间距：标签、行内间隙 */
  --sp-2: 10px;     /* 中间距：卡片之间、字段之间 */
  --sp-3: 14px;     /* 大间距：区块之间 */
  --fs-xs: 0.72rem; /* 辅助小字 */
  --fs-sm: 0.82rem; /* 正文小字 */
  --fs-md: 0.95rem; /* 列表主字 */
  --card-pad: 14px; /* 卡片内边距 */
  --row-h: 56px;    /* 列表目标行高 */
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3 { line-height: 1.3; }

.icon { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 顶栏 ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 247, 249, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.appbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  min-height: 56px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.appbar-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  border-radius: 12px;
  color: var(--text);
}
.appbar-back:active { background: var(--line); }
.brand { display: none; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.brand-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary); color: #fff; font-size: 0.75rem; letter-spacing: 0.02em;
}
.brand-name { font-size: 1rem; }
.appbar-title {
  flex: 1;
  font-size: 1.02rem;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar-action { min-width: 40px; text-align: right; font-size: 0.92rem; }
.appbar-action a { color: var(--primary); font-weight: 600; }
.title-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.68rem;
  font-weight: 600;
  vertical-align: 2px;
  white-space: nowrap;
}
.desktop-nav { display: none; }

/* ---------- 主体 ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 16px 28px;
}
.page-title { display: none; margin: 4px 0 14px; font-size: 1.35rem; font-weight: 700; }

.card {
  background: var(--surface);
  border: 1px solid rgba(233, 237, 243, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 14px;
}
.card h2, .card h3 { margin: 0 0 12px; font-size: 1.02rem; font-weight: 650; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .link { font-size: 0.88rem; font-weight: 600; }

.muted { color: var(--muted); font-size: 0.9rem; }
.hint { color: var(--muted-2); font-size: 0.82rem; margin: 8px 0 0; }
.warn-text { color: var(--warn); font-weight: 650; }
.error-text { color: var(--danger); }

/* ---------- 提示条 ---------- */
.flash {
  border-radius: 12px;
  padding: 11px 14px;
  margin: 0 0 14px;
  border: 1px solid transparent;
  font-size: 0.94rem;
}
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }
.flash.err { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: #fed7aa; }
.flash a { font-weight: 600; text-decoration: underline; }

/* ---------- 表单 ---------- */
.grid { display: grid; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 0.86rem; color: var(--muted); font-weight: 500; }

input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #dbe1ea;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 76px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid #dbe1ea;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-soft { background: var(--primary-soft); border-color: #dbe6ff; color: var(--primary-dark); }
.btn-in { background: var(--in); border-color: var(--in); color: #fff; }
.btn-out { background: var(--out); border-color: var(--out); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--neutral-200); color: var(--neutral-700); }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: 0.88rem; border-radius: 10px; }
.btn-lg { min-height: 52px; font-size: 1.02rem; }
.btn-block { width: 100%; }

.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input { min-height: 38px; padding: 6px 10px; font-size: 0.92rem; width: 110px; }

/* ---------- 标签 / Tab ---------- */
.tabs { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; }
.tab {
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.92rem;
  white-space: nowrap;
  font-weight: 500;
}
.tab.active { background: var(--primary-soft); border-color: #c7d7ff; color: var(--primary-dark); font-weight: 650; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #eef1f5; border-radius: 14px; }
.segmented a {
  display: flex; align-items: center; justify-content: center;
  min-height: 46px; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: 1rem;
}
.segmented a.active { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow-soft); }
.segmented.segmented-in { background: var(--in-soft); border: 1px solid var(--in-line); }
.segmented.segmented-in a.active { color: var(--in-dark); }
.segmented.segmented-out { background: var(--out-soft); border: 1px solid var(--out-line); }
.segmented.segmented-out a.active { color: var(--out-dark); }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-in { background: var(--success-soft); color: var(--success); }
.badge-out { background: var(--out-soft); color: var(--out-dark); }
.badge-void { background: #eef0f3; color: #6b7280; }
.badge-off { background: var(--danger-soft); color: var(--danger); }
.badge-me { background: var(--primary-soft); color: var(--primary-dark); }

/* 账号管理：一行式紧凑列表 */
.account-list { display: grid; gap: 8px; }
.account-row { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.acc-line1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.acc-name { min-width: 0; font-weight: 650; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.78rem; }
.acc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.acc-actions .btn { min-height: 44px; padding: 0 12px; }
.badge-on { background: var(--ok-soft); color: var(--ok); }

/* ---------- 仪表盘：横向指标条 + 紧凑入口 ---------- */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 12px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 6px;
  background: var(--surface);
  text-align: center;
  color: var(--text);
}
.metric .m-value { font-size: 1.18rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.metric .m-label { font-size: 0.74rem; color: var(--muted); }
.metric.is-warn .m-value { color: var(--warning); }

.quick-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; padding: 8px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}
.quick-item .qi {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary-dark);
}
.quick-item .qi .icon { width: 18px; height: 18px; }
.quick-item .qi-in { background: var(--in-soft); color: var(--in-dark); }
.quick-item .qi-out { background: var(--out-soft); color: var(--out-dark); }
.quick-item:active { background: var(--neutral-50); }

/* ---------- 单据卡片列表（首页 / 单据列表共用） ---------- */
.doc-list { display: grid; gap: 10px; }
.doc-row {
  display: block;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
}
.doc-row:active { background: #f2f5fa; }
.doc-row .line1 { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.doc-no { font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.doc-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.84rem; margin-top: 5px; flex-wrap: wrap; }
.doc-arrow { color: var(--muted-2); }

/* ---------- 预警条目：左色条分级 ---------- */
.warn-list { display: grid; gap: 8px; }
.warn-row {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 9px 12px 9px 15px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.warn-row::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--warning);
}
.warn-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.warn-name { font-weight: 650; font-size: 0.95rem; min-width: 0; }
.warn-tag {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.72rem;
  font-weight: 700;
}
.warn-sub { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.78rem; }
.warn-sub b { color: var(--warning); font-variant-numeric: tabular-nums; }
.warn-row.warn-out { background: #fff5f5; border-color: var(--danger-line); }
.warn-row.warn-out::before { background: var(--danger); }
.warn-row.warn-out .warn-tag { background: #fee2e2; color: #b91c1c; }
.warn-row.warn-out .warn-sub b { color: #b91c1c; }
.warn-row.warn-low { background: var(--warning-soft); border-color: var(--warning-line); }
.warn-row.warn-low::before { background: #f97316; }
.warn-row.warn-near { background: #fffbeb; border-color: #fde68a; }
.warn-row.warn-near::before { background: #f59e0b; }
.warn-row.warn-near .warn-tag { background: #fef3c7; color: #a16207; }
.warn-row.warn-near .warn-sub b { color: #a16207; }

/* ---------- 库存列表：紧凑卡片 ---------- */
.stock-list { display: grid; gap: 8px; }
.stock-row {
  position: relative;
  padding: 8px 12px 8px 15px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stock-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.stock-name { font-weight: 650; font-size: 0.95rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-qty { flex: none; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stock-qty small { font-size: 0.76rem; font-weight: 500; color: var(--muted); }
.stock-sub { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; color: var(--muted); font-size: 0.76rem; }
.stock-sub .stock-wh { color: var(--primary-dark); }
.stock-row.warn-out, .stock-row.warn-low, .stock-row.warn-near { border-color: var(--warning-line); }
.stock-row.warn-out { background: #fff5f5; border-color: var(--danger-line); }
.stock-row.warn-low { background: #fffaf5; }
.stock-row.warn-near { background: #fffdf5; border-color: #fde68a; }
.stock-row.warn-out::before, .stock-row.warn-low::before, .stock-row.warn-near::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: 12px 0 0 12px;
  background: var(--warning);
}
.stock-row.warn-out::before { background: var(--danger); }
.stock-row.warn-near::before { background: #f59e0b; }
.stock-row.warn-out .stock-qty { color: #b91c1c; }
.stock-row.warn-low .stock-qty, .stock-row.warn-near .stock-qty { color: var(--warning); }

/* ---------- 表格：手机端转卡片 ---------- */
.table-wrap { width: 100%; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.92rem; vertical-align: middle; }
th { background: #f9fafc; color: #374151; white-space: nowrap; font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; }
td .num { font-variant-numeric: tabular-nums; }

/* ---------- 登录页 ---------- */
.page-login { background: linear-gradient(160deg, #eef4ff 0%, #f6f7f9 55%, #eef9f4 100%); }
.page-login .appbar, .page-login .footer, .page-login .tabbar { display: none; }
.page-login .container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 18px; }
.login-wrap { width: 100%; max-width: 400px; }
.login-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 18px 50px rgba(17, 24, 39, 0.1); padding: 26px 22px 22px; border: 1px solid #fff; }
.login-logo {
  width: 52px; height: 52px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 1.25rem;
  margin-bottom: 16px; box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}
.login-title { margin: 0 0 4px; font-size: 1.4rem; }
.login-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; }
.login-card .btn { margin-top: 6px; }

/* ---------- 开单 ---------- */
.doc-toolbar { display: grid; gap: 10px; }
.search-box { position: relative; }
.search-box input { padding-right: 44px; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: none; border-radius: 999px;
  background: var(--neutral-100); color: var(--neutral-700);
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.search-clear[hidden] { display: none; }

/* 临时结果区：在文档流里展开，最大 45vh，内部独立滚动，选中后自动收起 */
.search-panel {
  max-height: 45vh;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fff; box-shadow: var(--shadow-soft); overflow: hidden;
}
.search-panel[hidden] { display: none; }
.search-panel-head {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: #f9fafc; font-size: 0.78rem; color: var(--muted);
}
.search-panel-head button {
  border: none; background: none; padding: 6px 4px;
  color: var(--primary); font: inherit; font-weight: 600; cursor: pointer;
}
.search-results { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.search-results:empty { display: none; }
.search-item {
  display: block; width: 100%; text-align: left;
  padding: 12px 14px; min-height: 56px;
  border: none; border-bottom: 1px solid var(--line);
  background: #fff; cursor: pointer; font-family: inherit; color: var(--text); font-size: 0.98rem;
}
.search-item:last-child { border-bottom: none; }
.search-item strong { display: block; font-weight: 600; }
.search-item small { display: block; color: var(--muted); margin-top: 2px; font-size: 0.82rem; }
.search-item:active { background: #f2f5fa; }

.cart { display: grid; gap: 10px; margin: 14px 0; }
.cart-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px 13px 16px;
  background: var(--surface-2);
}
.cart-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--primary);
}
.cart-item.item-in { border-color: var(--in-line); background: #f7fdf9; }
.cart-item.item-in::before { background: var(--in); }
.cart-item.item-out { border-color: var(--out-line); background: #fffaf6; }
.cart-item.item-out::before { background: var(--out); }
.cart-item .item-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cart-item .item-name { font-weight: 700; font-size: 1rem; }
.cart-item .item-meta { color: var(--muted); font-size: 0.84rem; margin-top: 2px; }
.cart-item .item-stock { color: var(--neutral-700); font-size: 0.78rem; margin-top: 4px; }
.qty-panel {
  margin-top: 10px;
  padding: 10px 12px 12px;
  border: 1px dashed var(--neutral-200);
  border-radius: 12px;
  background: #fff;
}
.item-in .qty-panel { border-color: var(--in-line); background: var(--in-soft); }
.item-out .qty-panel { border-color: var(--out-line); background: var(--out-soft); }
.qty-label { display: block; margin-bottom: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; color: var(--neutral-700); }
.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--neutral-200);
  background: #fff;
  color: var(--neutral-700);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
}
.qty-btn:active { transform: scale(0.97); }
.qty-input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 4px 8px;
  border-radius: 12px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.qty-unit { flex: none; min-width: 26px; color: var(--neutral-700); font-size: 0.9rem; }
.qty-tip { margin-top: 6px; color: var(--muted); font-size: 0.76rem; }
.cart-empty { padding: 26px 16px; text-align: center; color: var(--muted); border: 1px dashed #d7dee8; border-radius: 14px; }

/* 开单：库房与搜索区留在文档流里，不再用 sticky 覆盖下面的明细 */
.doc-toolbar { padding: 2px 0 0; }
.doc-context { display: flex; gap: 10px; align-items: stretch; }
.current-wh { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px 8px; }
.wh-label { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 2px; }
.current-wh select { width: 100%; border: none; background: transparent; font-size: 1rem; font-weight: 700; min-height: 34px; padding: 0; }
.doc-date { width: 132px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px 8px; }
.doc-date label { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 2px; }
.doc-date input { width: 100%; border: none; background: transparent; padding: 0; min-height: 34px; font-size: 0.92rem; }
.doc-toolbar .search-box input { min-height: 48px; }
.doc-card .cart { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.doc-card .card-head h2 { font-size: 1rem; }
.search-result { border-bottom: 1px solid var(--line); }
.search-result:last-child { border-bottom: none; }
.search-result .search-item { border-bottom: none; }
.search-item.no-stock { opacity: 0.62; cursor: not-allowed; }
.stock-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.stock-chip { padding: 2px 8px; border-radius: 999px; background: var(--neutral-100); color: var(--neutral-700); font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.stock-chip.is-current { background: var(--out-soft); color: var(--out-dark); font-weight: 700; }
.stock-current, .stock-none { display: inline-block; margin-top: 6px; color: var(--muted); font-size: 0.78rem; }
.wh-pick { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 12px; background: var(--out-soft); border-top: 1px solid var(--out-line); }
.wh-pick[hidden] { display: none; }
.wh-pick-label { width: 100%; font-size: 0.78rem; color: var(--out-dark); font-weight: 700; }
.wh-pick-btn { min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--out-line); background: #fff; color: var(--out-dark); font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.cart-item.just-added { animation: cartFlash 0.9s ease; }
@keyframes cartFlash {
  0% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3); }
  100% { box-shadow: none; }
}
.qty-input.invalid { border-color: var(--danger); background: var(--danger-soft); }
.qty-error { margin-top: 6px; color: var(--danger); font-size: 0.8rem; }
.cart-total { display: flex; align-items: baseline; gap: 8px; padding: 12px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; color: var(--neutral-700); }
.cart-total strong { font-size: 1.3rem; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- 盘库 ---------- */
.check-toolbar { display: grid; gap: 10px; }
.check-filter { margin-top: 0; }
.check-list { display: grid; gap: 8px; }
.check-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.check-row.hidden { display: none; }
.check-row.just-added { animation: cartFlash 0.9s ease; }
.date-range { display: flex; align-items: center; gap: 6px; }
.date-range input { flex: 1; min-width: 0; }
.check-name { font-weight: 650; }
.check-meta { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.check-book { color: var(--neutral-700); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.check-real {
  width: 100%; min-height: 48px; text-align: center;
  font-size: 1.08rem; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
}
.check-diff { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); }
.check-diff.diff-plus { color: var(--success); font-weight: 650; }
.check-diff.diff-minus { color: var(--danger); font-weight: 650; }
.check-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.check-sum { padding: 6px 10px; border-radius: 10px; background: var(--neutral-50); font-size: 0.84rem; }
.check-sum.gain { background: var(--success-soft); color: var(--success); }
.check-sum.loss { background: var(--danger-soft); color: var(--danger); }

/* ---------- 操作日志 ---------- */
.log-qty { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 14px; font-size: 0.86rem; color: var(--muted); }
.pager a, .pager .disabled { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; min-height: 40px; display: inline-flex; align-items: center; }
.pager .disabled { color: var(--muted); opacity: 0.55; }

.sticky-actions {
  position: sticky;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px);
  padding: 10px 0;
  background: linear-gradient(to top, var(--bg) 72%, rgba(246, 247, 249, 0));
  z-index: 30;
}
.form-msg { min-height: 1.3em; color: var(--danger); font-size: 0.88rem; margin: 0 0 6px; text-align: center; }
.form-msg.ok { color: var(--ok); }
/* 紧凑提示条：图标 + 一句短话，详情可展开 */
.hint-bar {
  display: flex; align-items: flex-start; gap: 8px; text-align: left;
  padding: 7px 10px; border: 1px solid var(--danger-soft); border-radius: 10px;
  background: var(--danger-soft); color: var(--danger); font-size: 0.82rem; line-height: 1.35;
}
.hint-bar .hint-icon {
  flex: none; width: 18px; height: 18px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--danger); font-size: 0.72rem; font-weight: 700;
}
.hint-bar .hint-text { flex: 1 1 auto; min-width: 0; }
.hint-bar .hint-more {
  flex: none; border: none; background: none; padding: 0;
  color: var(--danger); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer;
}
.hint-detail {
  margin: 6px 0 0; padding: 8px 10px; border-radius: 10px;
  background: var(--surface-2); color: var(--neutral-700); font-size: 0.8rem; text-align: left;
}
.hint-detail[hidden] { display: none; }
/* 底部提交栏吸底时，给页面留出等高空间，最后一条明细/备注不会被压住 */
.doc-actions-space { height: 104px; }

/* ---------- 空状态 ---------- */
.empty, .empty-state { text-align: center; color: var(--muted); padding: 26px 12px; }
.empty-state .e-icon {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.empty-state .e-icon .icon { width: 26px; height: 26px; }
.empty-state p { margin: 0 0 12px; }

/* ---------- 我的 ---------- */
.profile-card { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-size: 1.2rem; font-weight: 700;
  flex: none;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}
.p-body { min-width: 0; }
.p-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.1rem; font-weight: 700; }
.p-company { margin-top: 3px; color: var(--text); font-size: 0.9rem; font-weight: 550; }
.p-account { margin-top: 2px; color: var(--muted); font-size: 0.8rem; }
.role-badge { padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 650; white-space: nowrap; }
.role-admin { background: var(--primary-soft); color: var(--primary-dark); }
.role-operator { background: var(--neutral-100); color: var(--neutral-700); }
.role-super { background: #f5f3ff; color: #6d28d9; }

.entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.entry {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 66px; padding: 10px 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 550;
}
.entry .qi {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary-dark);
}
.entry .qi .icon { width: 18px; height: 18px; }
.entry .qi-in { background: var(--in-soft); color: var(--in-dark); }
.entry:active { background: var(--neutral-50); }
.logout-block { display: flex; justify-content: center; margin: 18px 0 10px; }
.logout-block .btn { width: auto; min-width: 200px; color: var(--neutral-500); gap: 6px; }
.logout-block .btn .icon { width: 18px; height: 18px; }

/* ---------- 物品：库房预警线覆盖 ---------- */
.override-list { display: grid; gap: 6px; margin-top: 10px; }
.override-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.82rem;
}
.override-wh { font-weight: 650; }
.override-value { margin-left: auto; color: var(--primary-dark); font-weight: 600; }

/* ---------- 明细 ---------- */
.detail-list { display: grid; gap: 8px; margin: 0; }
.detail-list div { display: flex; gap: 12px; align-items: baseline; }
.detail-list dt { color: var(--muted); min-width: 78px; font-size: 0.9rem; }
.detail-list dd { margin: 0; }

/* ---------- 页脚 / 底部导航 ---------- */
.footer { text-align: center; color: var(--muted-2); font-size: 0.8rem; padding: 8px 16px 24px; }
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-item {
  flex: 1;
  min-height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #8b94a3;
  font-size: 0.76rem;
}
.tabbar-item .icon { width: 24px; height: 24px; }
.tabbar-item.active { color: var(--primary); font-weight: 650; }
.tabbar-item.active .icon { stroke-width: 2.1; }

.print-only { display: none; }

/* 物品资料 / 单据列表：手机紧凑列表，桌面隐藏 */
.product-list { display: none; }
.doc-list-mobile { display: none; }

/* ---------- 手机 ---------- */
@media (max-width: 719px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 14px; }
  .tabs { margin-left: -2px; margin-right: -2px; }

  /* 表格变卡片：一行一条，自动读取表头 */
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: grid; gap: 10px; }
  .table-wrap tr {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 6px 13px;
  }
  .table-wrap td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed #edf0f4;
    text-align: right;
    font-size: 0.92rem;
  }
  .table-wrap td:last-child { border-bottom: none; }
  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 500;
    font-size: 0.82rem;
    text-align: left;
    flex: 0 0 auto;
    padding-right: 8px;
  }
  .table-wrap td[colspan] { display: block; text-align: center; }
  .table-wrap td[colspan]::before { content: none; }
  .table-wrap td.actions { justify-content: flex-end; flex-wrap: wrap; }
  .table-wrap td.num { text-align: right; }
  .table-wrap td:empty { display: none; }

  /* 桌面端操作按钮在卡片右侧 */
  .table-wrap td.actions .inline-form { display: inline-flex; }
}

/* ---------- 移动端密度（手机主场景，≤480px） ---------- */
@media (max-width: 480px) {
  :root {
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 10px;
    --fs-xs: 0.68rem;
    --fs-sm: 0.76rem;
    --fs-md: 0.9rem;
    --card-pad: 10px;
    --row-h: 54px;
    --tabbar-h: 56px;
  }

  .container { padding: 8px 10px 20px; }
  .card { padding: var(--card-pad); margin-bottom: var(--sp-2); border-radius: 12px; }
  .card h2, .card h3 { margin-bottom: var(--sp-1); font-size: var(--fs-md); }
  .card-head { margin-bottom: var(--sp-1); gap: var(--sp-1); }
  .card-head .link { font-size: var(--fs-sm); }
  .muted { font-size: var(--fs-sm); }
  .hint { font-size: var(--fs-xs); margin-top: var(--sp-1); }
  .grid { gap: var(--sp-2); }
  .field { gap: 3px; }
  .field label { font-size: var(--fs-xs); }
  input, select, textarea { min-height: 44px; padding: 8px 11px; border-radius: 10px; }
  textarea { min-height: 58px; }
  .btn { min-height: 44px; padding: 8px 14px; font-size: var(--fs-md); border-radius: 10px; }
  .btn-lg { min-height: 46px; }
  .btn-sm { min-height: 36px; padding: 5px 10px; font-size: var(--fs-sm); }
  .flash { padding: 8px 10px; font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
  .tabs { gap: var(--sp-1); margin-bottom: var(--sp-2); }
  .tab { padding: 6px 12px; font-size: var(--fs-sm); }
  .badge { padding: 2px 7px; font-size: var(--fs-xs); }

  /* 首页：指标条 44-48px、入口 62-64px、图标 20px */
  .metric-strip { margin-bottom: var(--sp-2); border-radius: 10px; }
  .metric { padding: 3px 4px; }
  .metric .m-value { font-size: 1.06rem; line-height: 1.2; }
  .metric .m-label { font-size: var(--fs-xs); }
  .quick-row { gap: var(--sp-1); margin-bottom: var(--sp-2); }
  .quick-item, .entry { min-height: 62px; padding: 5px 2px; gap: 2px; border-radius: 10px; font-size: 0.78rem; }
  .quick-item .qi, .entry .qi { width: 26px; height: 26px; border-radius: 8px; }
  .quick-item .qi .icon, .entry .qi .icon { width: 20px; height: 20px; }
  .entry-grid { gap: var(--sp-1); }

  /* 列表：单条 52-60px，一条最多两行 */
  .account-row { padding: 8px 10px; border-radius: 10px; }
  .acc-name { font-size: var(--fs-md); }
  .acc-meta { font-size: var(--fs-xs); gap: 8px; }
  .acc-actions { gap: 6px; }

  .doc-list, .stock-list, .warn-list, .check-list { gap: 6px; }
  .doc-row { padding: 7px 10px; border-radius: 10px; min-height: var(--row-h); }
  .stock-row { min-height: var(--row-h); }
  .doc-row .line1 { gap: 6px; }
  .doc-no { font-size: var(--fs-md); }
  .doc-meta { font-size: var(--fs-xs); margin-top: 2px; gap: 6px; }
  .doc-arrow { font-size: var(--fs-sm); }
  .stock-row { padding: 6px 9px 6px 12px; border-radius: 10px; }
  .stock-main { gap: 8px; }
  .stock-name { font-size: var(--fs-md); }
  .stock-qty { font-size: var(--fs-md); }
  .stock-qty small { font-size: var(--fs-xs); }
  .stock-sub { margin-top: 1px; gap: 5px; font-size: var(--fs-xs); }
  .warn-row { padding: 6px 9px 6px 13px; border-radius: 10px; gap: 1px; }
  .warn-name { font-size: var(--fs-md); }
  .warn-sub { font-size: var(--fs-xs); gap: 6px; }
  .warn-tag { padding: 0 6px; font-size: var(--fs-xs); }

  /* 表格卡片化：间距收紧 */
  .table-wrap tbody { gap: 6px; }
  .table-wrap tr { padding: 2px 10px; border-radius: 10px; }
  .table-wrap td { padding: 5px 0; font-size: var(--fs-sm); }
  .table-wrap td::before { font-size: var(--fs-xs); }
  .table-wrap td.empty { padding: 14px 0; }

  /* 物品资料：手机端一行式紧凑列表（桌面仍用表格） */
  .product-list { display: grid; gap: 6px; }
  .product-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center; gap: 0 8px; padding: 6px 10px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  }
  .product-row .p-main { min-width: 0; }
  .product-row .p-line1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .product-row .p-name { flex: 1 1 auto; min-width: 0; font-weight: 650; font-size: var(--fs-md); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .product-row .p-status { flex: none; }
  .product-row .p-meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.3; white-space: nowrap; }
  .product-row .p-meta .p-desc { overflow: hidden; text-overflow: ellipsis; }
  .product-row .p-actions { display: flex; align-items: center; gap: 4px; }
  .product-row .p-actions .btn { min-height: 44px; padding: 0 10px; }
  .product-row .p-actions .inline-form { display: inline-flex; }
  .product-table { display: none; }

  /* 物品页：手机先看到列表，新增/编辑表单排到列表后面 */
  .products-page .container { display: flex; flex-direction: column; }
  .products-page .product-list-card { order: 1; }
  .products-page .product-form-card { order: 2; }
  .products-page .product-warn-card { order: 3; }

  /* 单据列表：手机用一行式紧凑行，表格隐藏 */
  .doc-table { display: none; }
  .doc-list-mobile { display: grid; gap: 6px; }
  .doc-filter { grid-template-columns: 1fr 1fr !important; gap: var(--sp-1) !important; }
  .doc-filter .field { gap: 2px; }

  /* 开单：库房+日期一行，搜索 44px */
  .doc-toolbar { gap: var(--sp-1); }
  .doc-context { gap: var(--sp-1); }
  .current-wh, .doc-date { padding: 4px 9px 6px; border-radius: 10px; }
  .wh-label, .doc-date label { font-size: var(--fs-xs); margin-bottom: 0; }
  .current-wh select { min-height: 26px; font-size: var(--fs-md); }
  .doc-date { width: 116px; }
  .doc-date input { min-height: 26px; font-size: var(--fs-sm); padding: 0; }
  .doc-toolbar .search-box input { min-height: 44px; }
  .segmented { border-radius: 10px; }
  .segmented a { min-height: 40px; font-size: var(--fs-md); }
  .search-panel { border-radius: 12px; }
  .search-panel-head { padding: 6px 10px; font-size: var(--fs-xs); }
  .search-item { min-height: 56px; padding: 8px 10px; font-size: var(--fs-md); }
  .search-item small { font-size: var(--fs-xs); margin-top: 1px; }
  .stock-chip { font-size: var(--fs-xs); }
  .wh-pick { padding: 8px 10px 9px; }
  .wh-pick-btn { min-height: 44px; }

  /* 手机开单：明细跟着整页滚动，避免「页面里再套一层滚动」 */
  .doc-card .cart { max-height: none; overflow: visible; }
  .cart { gap: var(--sp-2); margin: var(--sp-2) 0; }
  .cart-item { padding: 8px 10px 9px 13px; border-radius: 12px; }
  .cart-item .item-name { font-size: var(--fs-md); }
  /* 编码·规格·可用合并成一行，省掉一整行高度 */
  .cart-item .item-meta, .cart-item .item-stock { display: inline; font-size: var(--fs-xs); margin-top: 0; }
  .cart-item .item-meta::after { content: ' · '; }
  .qty-panel { margin-top: 4px; padding: 4px 8px 6px; border-radius: 10px; }
  .qty-label { display: none; }
  .qty-control { gap: 6px; }
  .qty-btn { width: 44px; height: 44px; border-radius: 10px; }
  .qty-input { min-height: 44px; font-size: 1.22rem; border-radius: 10px; }
  .qty-unit { min-width: 22px; font-size: var(--fs-sm); }
  .cart-total { padding: 8px 2px 0; margin-top: 2px; }
  .cart-total strong { font-size: 1.05rem; }
  .cart-empty { padding: 16px 10px; border-radius: 12px; }

  /* 盘库 / 日志 */
  .check-row { padding: 7px 9px; gap: 6px; grid-template-columns: minmax(0, 1fr) 92px; border-radius: 10px; }
  .check-real { min-height: 44px; font-size: 1rem; }
  .check-name { font-size: var(--fs-md); }
  .check-meta { font-size: var(--fs-xs); margin-top: 0; }
  .check-book { font-size: var(--fs-xs); }
  .check-summary { gap: 6px; margin: 2px 0 8px; }
  .check-sum { padding: 4px 8px; font-size: var(--fs-xs); }
  .pager { padding-top: var(--sp-2); }
  .pager a, .pager .disabled { min-height: 40px; padding: 6px 12px; }

  /* 底部提交栏与底栏：视觉更矮，热区仍 ≥48 */
  .sticky-actions { padding: 8px 0; }
  .sticky-actions .btn { min-height: 46px; }
  .form-msg { font-size: var(--fs-sm); margin-bottom: 4px; }
  .hint-bar, .hint-detail { font-size: var(--fs-xs); padding: 6px 8px; }
  .doc-actions-space { height: 92px; }
  .tabbar-item { min-height: 52px; gap: 1px; font-size: 0.68rem; }
  .tabbar-item .icon { width: 21px; height: 21px; }
  body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
}

/* ---------- 电脑 ---------- */
@media (min-width: 720px) {
  body.has-tabbar { padding-bottom: env(safe-area-inset-bottom); }
  .appbar-inner { min-height: 62px; padding: 0 24px; gap: 22px; }
  .appbar-back, .appbar-title, .tabbar { display: none; }
  .brand { display: inline-flex; }
  .appbar-action { order: 3; }
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    order: 2;
    margin-left: auto;
  }
  .desktop-nav a {
    padding: 7px 11px;
    border-radius: 9px;
    color: #4b5563;
    font-size: 0.9rem;
    font-weight: 500;
  }
  .desktop-nav a:hover { background: #eef1f6; color: var(--text); }
  .desktop-nav a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 650; }
  .nav-user { color: var(--muted-2); font-size: 0.82rem; padding: 0 6px; }

  .container { padding: 24px 24px 44px; }
  .page-title { display: block; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .doc-list { grid-template-columns: 1fr 1fr; }
  .stock-list { grid-template-columns: 1fr 1fr; }
  .warn-list { grid-template-columns: 1fr 1fr; }
  .entry-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 620px; }
  th, td { padding: 11px 12px; }
  .table-wrap td.actions { white-space: nowrap; padding-top: 9px; padding-bottom: 9px; }
  .sticky-actions { bottom: 14px; }
  .sticky-actions .btn { width: auto; min-width: 240px; float: right; }
  .form-msg { text-align: right; }
  .doc-card .cart { max-height: 52vh; }
  .qty-control { max-width: 320px; }
  .qty-input { max-width: 180px; }
  .filter-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; align-items: end; }
  .pw-form { max-width: 460px; }
  .logout-block .btn { max-width: 360px; margin: 0 auto; }
  .login-wrap { max-width: 400px; }
  .filter-row { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; align-items: end; }
  .filter-row-6 { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; align-items: end; }
  .filter-row-3 { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) auto !important; align-items: end; }
}

/* 窄屏时指标条与入口保持四列，仅缩小字号 */
@media (max-width: 380px) {
  .metric .m-value { font-size: 1.05rem; }
  .metric .m-label { font-size: 0.7rem; }
  .quick-item, .entry { font-size: 0.78rem; }
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; padding: 0; }
  .no-print, .appbar, .footer, .tabbar, .tabs, .sticky-actions, .appbar-action { display: none !important; }
  .container { max-width: none; padding: 0; }
  .card { border: none; box-shadow: none; padding: 0; margin: 0 0 12px; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; }
  th, td { padding: 4px 6px; font-size: 12px; }
  .print-only { display: block; }
}
