:root {
  --bg: #eef1f7;
  --card: #ffffff;
  --ink: #14171c;
  --ink-2: #2a2f36;
  --muted: #58606c;
  --muted-2: #6f7783;
  --line: #e8ecf3;
  --lime: #d8f24b;
  --lime-deep: #c3e02f;
  --charcoal: #23272e;
  --charcoal-2: #2c313a;
  --steel: #dfe8f4;
  --steel-2: #cddbec;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 44px -30px rgba(22, 38, 63, 0.42), 0 2px 6px rgba(22, 38, 63, 0.04);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 6% -12%, rgba(47, 91, 234, 0.1) 0%, rgba(47, 91, 234, 0) 60%),
    radial-gradient(900px 560px at 104% -6%, rgba(15, 160, 140, 0.1) 0%, rgba(15, 160, 140, 0) 58%),
    radial-gradient(760px 500px at 50% 110%, rgba(216, 242, 75, 0.16) 0%, rgba(216, 242, 75, 0) 60%),
    linear-gradient(180deg, #f4f7fc 0%, #edf1f8 45%, #eaeef6 100%);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

.app { min-height: 100vh; padding-bottom: calc(108px + env(safe-area-inset-bottom)); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  background: rgba(244, 247, 252, 0.82);
  backdrop-filter: blur(18px) saturate(150%);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-lockup { height: 26px; width: auto; display: block; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px -12px rgba(22, 38, 63, 0.45);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.16s, background 0.16s;
}
.icon-btn:hover { background: #fff; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.spin svg { animation: spin 0.85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 页面标题 ---------- */
.view { padding: 6px 16px 10px; }

.dash {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "head"
    "kpi"
    "dark"
    "steel"
    "top"
    "foot";
}

.dash > * { min-width: 0; }

.page-head {
  grid-area: head;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 0;
}
.page-head h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1.4px;
  line-height: 1.15;
}
.page-sub {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--muted);
}
.live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--ink-2);
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 600;
  box-shadow: 0 8px 18px -14px rgba(22, 38, 63, 0.5);
}
.live i { width: 5px; height: 5px; border-radius: 50%; background: #23272e; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---------- KPI 带 ---------- */
.kpi-band {
  grid-area: kpi;
  background:
    radial-gradient(120% 130% at 100% -10%, rgba(216, 242, 75, 0.28) 0%, rgba(216, 242, 75, 0) 46%),
    linear-gradient(158deg, #ffffff 0%, #f8fbff 52%, #edf3ff 100%);
  border-radius: var(--radius);
  padding: 18px 4px 14px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease both;
}

.kpi {
  padding: 0 16px;
  display: grid;
  gap: 4px;
  align-content: start;
}
.kpi + .kpi { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.kpi span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.kpi-num {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1.4px;
  line-height: 1.06;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.kpi-num i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted-2); letter-spacing: 0.5px; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); font-family: var(--mono); letter-spacing: 0.1px; }

.tag-lime {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--lime);
  color: #23280a;
  border-radius: 5px;
  padding: 2px 6px;
  font-style: normal;
}

.kpi-track { padding: 16px 16px 2px; margin-top: 4px; border-top: 1px solid var(--line); }
.track-bar {
  display: flex;
  gap: 3px;
  height: 9px;
  border-radius: 99px;
  overflow: hidden;
}
.track-bar i { display: block; height: 100%; }
.track-bar i:first-child { border-radius: 99px 0 0 99px; }
.track-bar i:last-child { border-radius: 0 99px 99px 0; }
.track-legend {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.track-legend span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 9.5px; }
.track-legend i { width: 7px; height: 7px; border-radius: 2px; }
.track-total { margin-left: auto; color: var(--ink-2); font-weight: 600; }

/* ---------- 深色列表块 ---------- */
.panel-dark {
  grid-area: dark;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(216, 242, 75, 0.16) 0%, rgba(216, 242, 75, 0) 50%),
    linear-gradient(165deg, #1d2127 0%, #262b33 60%, #20242b 100%);
  border-radius: var(--radius);
  padding: 16px 16px 8px;
  color: #f2f4f8;
  box-shadow: 0 26px 50px -34px rgba(18, 22, 30, 0.85);
  animation: fadeUp 0.45s ease both;
}
.dark-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.dark-head span { font-size: 14px; font-weight: 700; letter-spacing: 0.2px; }
.dark-head em { font-style: normal; font-family: var(--mono); font-size: 9px; letter-spacing: 1.2px; color: rgba(255, 255, 255, 0.6); }

.dark-list { display: flex; flex-direction: column; }
.dark-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}
.dark-row:last-child { border-bottom: 0; }
.dark-row.on { background: rgba(216, 242, 75, 0.14); border-bottom-color: transparent; }
.dr-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.dr-code { font-family: var(--mono); font-size: 9px; letter-spacing: 0.8px; color: rgba(255, 255, 255, 0.42); }
.dr-spec { font-size: 13.5px; font-weight: 600; letter-spacing: -0.2px; }
.dr-note {
  font-family: var(--mono);
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.58);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.dr-right { text-align: right; flex: none; }
.dr-right b { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.dr-right span { font-family: var(--mono); font-size: 10px; color: rgba(255, 255, 255, 0.6); }
.dark-empty { padding: 22px 0; text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.45); }
.dark-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}
.dark-foot b { font-size: 15px; color: #fff; font-variant-numeric: tabular-nums; }

/* ---------- 钢蓝面板 ---------- */
.panel-steel {
  grid-area: steel;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(155deg, #e8f0fc 0%, #d5e2f4 55%, #c9d9ef 100%);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 18px 40px -32px rgba(30, 58, 96, 0.5);
  animation: fadeUp 0.5s ease both;
}
.steel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.steel-head span { font-size: 13px; font-weight: 700; letter-spacing: 0.3px; }
.steel-head em { font-style: normal; font-family: var(--mono); font-size: 9px; letter-spacing: 1.2px; color: rgba(30, 50, 80, 0.45); }

.steel-row { margin-bottom: 13px; }
.steel-row:last-of-type { margin-bottom: 0; }
.steel-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.steel-name { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; letter-spacing: 0.3px; }
.steel-name i { width: 8px; height: 8px; border-radius: 2px; }
.steel-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.steel-track { height: 7px; margin-top: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.7); overflow: hidden; }
.steel-track i { display: block; height: 100%; border-radius: 99px; }
.steel-sub { margin-top: 6px; font-family: var(--mono); font-size: 9.5px; color: rgba(30, 50, 80, 0.5); }
.steel-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.75);
  font-size: 11.5px;
  color: rgba(30, 50, 80, 0.6);
}
.steel-foot b { font-size: 15px; color: #16233a; font-variant-numeric: tabular-nums; }

/* ---------- 白色面板 ---------- */
.panel {
  grid-area: top;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
  display: flex;
  flex-direction: column;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.panel-head h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.3px; }
.panel-head span { font-family: var(--mono); font-size: 9px; letter-spacing: 1.2px; color: var(--muted-2); }

.row-list { display: flex; flex-direction: column; }
.row-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  cursor: pointer;
}
.row-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.row-dot { width: 4px; height: 22px; border-radius: 99px; flex: none; }
.ri-main { flex: 1; min-width: 0; }
.ri-title { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-title b { font-weight: 800; margin-right: 5px; }
.ri-sub { font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); margin-top: 3px; }
.ri-right { text-align: right; flex: none; }
.ri-right b { display: block; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.ri-right span { font-family: var(--mono); font-size: 8.5px; color: var(--muted-2); letter-spacing: 1px; }

/* ---------- 库存页 ---------- */
.page { display: flex; flex-direction: column; gap: 12px; max-width: 1240px; margin: 0 auto; }

.filters { display: flex; flex-direction: column; gap: 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.search input { border: 0; outline: 0; background: none; flex: 1; font-size: 13.5px; min-width: 0; }
.search input::placeholder { color: var(--muted-2); }
.search svg { width: 16px; height: 16px; color: var(--muted-2); flex: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 1px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 8px 18px -16px rgba(22, 38, 63, 0.5);
  transition: all 0.16s;
}
.chip.on {
  background: linear-gradient(135deg, #23272e, #3b4350);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 20px -14px rgba(22, 38, 63, 0.9);
}

.list-hint {
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.8px;
  color: var(--muted-2);
}

.stock-list { display: grid; gap: 10px; }
.stock-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 14px 16px 14px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.14s;
}
.stock-row:active { transform: scale(0.994); }
.sr-bar { position: absolute; left: 7px; top: 16px; bottom: 16px; width: 4px; border-radius: 99px; }
.sr-main { flex: 1; min-width: 0; }
.sr-top { display: flex; align-items: center; gap: 7px; }
.sr-code { font-family: var(--mono); font-size: 9px; color: var(--muted-2); letter-spacing: 0.7px; }
.sr-title { font-size: 14.5px; font-weight: 700; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-title b { font-weight: 800; margin-right: 5px; }
.sr-meta { font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); margin-top: 4px; }
.sr-right { text-align: right; flex: none; }
.sr-qty { font-size: 21px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sr-qty i { font-style: normal; font-size: 9.5px; color: var(--muted-2); margin-left: 3px; letter-spacing: 0.4px; }
.sr-val { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 3px; }

.tag {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.8px;
  padding: 3px 7px;
  border-radius: 5px;
  text-transform: uppercase;
}
.tag-lime { background: var(--lime); color: #23280a; font-weight: 700; }
.tag-ghost { background: #eef1f6; color: var(--muted); }
.tag-spot { background: var(--charcoal); color: #fff; font-weight: 700; }

/* ---------- 流水页 ---------- */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}
.seg button {
  border: 0;
  background: none;
  border-radius: 999px;
  padding: 9px 0;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.seg button.on { background: var(--charcoal); color: #fff; font-weight: 700; }

.flow-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flow-sum div {
  border-radius: 18px;
  padding: 14px 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.flow-sum span { display: block; font-size: 10.5px; color: var(--muted-2); }
.flow-sum b { display: block; font-size: 20px; font-weight: 800; margin-top: 4px; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; }
.flow-sum em { display: block; font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 2px; }

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}

.mv { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mv:last-child { border-bottom: 0; padding-bottom: 2px; }
.mv-icon {
  flex: none;
  width: 34px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: #eef1f6;
  color: var(--muted);
}
.mv-icon.in { background: var(--lime); color: #23280a; }
.mv-main { flex: 1; min-width: 0; }
.mv-title { font-size: 13.5px; font-weight: 700; }
.mv-title b { font-weight: 800; margin-right: 4px; }
.mv-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.55;
}
.mv-val { text-align: right; flex: none; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.4px; }
.mv-val small { display: block; font-weight: 400; font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); margin-top: 2px; }

/* ---------- 页脚 ---------- */
.footer-note {
  grid-area: foot;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.6px;
  color: var(--muted-2);
  line-height: 1.9;
}
.footer-logo { height: 17px; opacity: 0.5; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 6px;
  max-width: 420px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px) saturate(150%);
  border-radius: 999px;
  box-shadow: 0 18px 40px -22px rgba(22, 38, 63, 0.45), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}
.tabbar button {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 0;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.tabbar button svg { width: 17px; height: 17px; }
.tabbar button.on {
  background: linear-gradient(135deg, #dcf75a, #c1e02b);
  color: #23280a;
  font-weight: 700;
  box-shadow: 0 10px 22px -12px rgba(190, 220, 45, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ---------- 弹层 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(23, 30, 42, 0.36);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
  z-index: 40;
}
.mask.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 8px 20px calc(28px + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 26px 26px 0 0;
  transform: translateY(102%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 -24px 60px -30px rgba(22, 38, 63, 0.45);
}
.sheet.on { transform: translateY(0); }
.sheet-grab { width: 36px; height: 4px; border-radius: 99px; background: #e3e8f0; margin: 4px auto 16px; }
.sheet h3 { margin: 0 0 5px; font-size: 19px; letter-spacing: -0.4px; font-weight: 800; }
.sheet .sub { font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.sheet-tag { width: 30px; height: 4px; border-radius: 99px; margin-bottom: 12px; }

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.kv div {
  background: #f5f8fd;
  border-radius: 14px;
  padding: 12px 13px;
}
.kv span { display: block; font-size: 10px; color: var(--muted-2); letter-spacing: 0.4px; }
.kv b { font-size: 17px; font-weight: 800; letter-spacing: -0.6px; margin-top: 3px; display: block; font-variant-numeric: tabular-nums; }
.kv b i { font-style: normal; font-size: 10px; color: var(--muted-2); margin-left: 2px; }

.actions { display: grid; grid-template-columns: 1fr; margin-top: 16px; }
.actions button {
  border: 0;
  border-radius: 999px;
  padding: 14px 0;
  font-size: 13.5px;
  font-weight: 700;
  background: var(--charcoal);
  color: #fff;
  cursor: pointer;
}

.share-url {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f5f8fd;
  border-radius: 14px;
  font-family: var(--mono);
  font-size: 11px;
  word-break: break-all;
  color: var(--muted);
}
.qr-wrap { margin-top: 14px; display: grid; place-items: center; }
.qr-wrap img { width: 176px; height: 176px; border-radius: 16px; background: #fff; }
.qr-tip { text-align: center; font-size: 10.5px; color: var(--muted-2); margin-top: 8px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 108px;
  transform: translate(-50%, 10px);
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s;
  z-index: 60;
  max-width: 82vw;
  text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #7d1d12; }

.loading {
  padding: 70px 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted-2);
  font-family: var(--mono);
}
.empty { padding: 42px 0; text-align: center; font-size: 12.5px; color: var(--muted-2); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
body.no-anim *, body.no-anim *::before, body.no-anim *::after {
  animation: none !important;
  transition: none !important;
}

/* ---------- 平板 ---------- */
@media (min-width: 700px) {
  .view { padding: 8px 24px 14px; }
  .dash {
    max-width: 1040px;
    margin: 0 auto;
    gap: 16px;
    grid-template-columns: 1.15fr 1fr;
    grid-template-areas:
      "head head"
      "kpi kpi"
      "dark steel"
      "top top"
      "foot foot";
  }
  .kpi-band { display: grid; grid-template-columns: repeat(4, 1fr); padding: 20px 6px 16px; }
  .kpi + .kpi { border-top: 0; border-left: 1px solid var(--line); padding-top: 0; margin-top: 0; padding-left: 20px; }
  .kpi-track { grid-column: 1 / -1; padding: 18px 14px 0; margin-top: 14px; border-top: 1px solid var(--line); }
  .kpi-num { font-size: 29px; }
  .page-head h1 { font-size: 38px; }
  .stock-list { grid-template-columns: 1fr 1fr; }
  .flow-sum { grid-template-columns: repeat(3, 1fr); }
  .sheet {
    left: 50%;
    right: auto;
    bottom: 24px;
    width: min(460px, 92vw);
    border-radius: 26px;
    transform: translate(-50%, 120%);
    padding-bottom: 24px;
  }
  .sheet.on { transform: translate(-50%, 0); }
  .sheet-grab { display: none; }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: auto; max-width: none; padding: 6px 8px; }
  .tabbar button { padding: 10px 22px; }
}

/* ---------- 桌面 ---------- */
@media (min-width: 1080px) {
  .view { padding: 12px 28px 18px; }
  .dash {
    max-width: 1300px;
    gap: 18px;
    grid-template-columns: 1.35fr 1.05fr;
    grid-template-areas:
      "head head"
      "kpi kpi"
      "dark steel"
      "top steel"
      "foot foot";
  }
  .kpi-num { font-size: 34px; }
  .page-head h1 { font-size: 44px; }
  .dark-row { padding: 13px 12px; }
  .dr-mid { max-width: 45%; }
}
@media (min-width: 1440px) {
  .dash { max-width: 1400px; }
}

/* ---------- 管理后台 ---------- */
.admin-body { background-image: none; background: var(--bg); }
.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(244, 247, 252, 0.86);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.admin-link { color: var(--muted); font-size: 12px; text-decoration: none; font-family: var(--mono); letter-spacing: 0.5px; }
.admin-link:hover { color: var(--ink); }
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 18px 16px 60px; }

.card {
  margin-top: 14px;
  border-radius: var(--radius);
  padding: 20px 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.card-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-bottom: 14px;
}
.card-title small { font-weight: 400; color: var(--muted-2); font-size: 10.5px; }

.admin-hint, .admin-note { font-size: 11.5px; color: var(--muted-2); margin-top: 10px; line-height: 1.8; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.hide { display: none !important; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 16px;
  border: 1.5px dashed #cfdaea;
  border-radius: 18px;
  background: #f7faff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.drop:hover, .drop.over { border-color: var(--charcoal); background: #f1f6ff; }
.drop svg { width: 26px; height: 26px; color: var(--muted); }
.drop b { font-size: 13.5px; font-weight: 700; }
.drop span { font-size: 11px; color: var(--muted-2); }

.admin-msg { margin-top: 12px; font-size: 12.5px; line-height: 1.8; }
.admin-msg.ok { color: #1f3d12; background: #f0f8dd; border-radius: 12px; padding: 10px 14px; }
.admin-msg.err { color: #7d1d12; background: #fdeeeb; border-radius: 12px; padding: 10px 14px; }
.admin-steps { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 2; color: var(--muted); }
.admin-steps li::marker { color: var(--muted-2); font-family: var(--mono); }

.field { margin-top: 14px; }
.field label { display: block; font-size: 10.5px; color: var(--muted-2); margin-bottom: 6px; letter-spacing: 0.4px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid transparent;
  background: #f5f8fd;
  border-radius: 14px;
  padding: 12px 14px;
  outline: 0;
  font-size: 14px;
  color: var(--ink);
  appearance: none;
}
.field input::placeholder { color: var(--muted-2); }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a1ad' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 15px;
  padding-right: 36px;
}
.field input:focus, .field select:focus, .field textarea:focus { background: #fff; box-shadow: 0 0 0 2px var(--lime); }

.two-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.submit {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  padding: 14px 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--charcoal);
  cursor: pointer;
  transition: opacity 0.18s, transform 0.12s;
}
.submit:hover { opacity: 0.9; }
.submit:active { transform: scale(0.995); }
.submit:disabled { opacity: 0.35; cursor: default; }
.submit.small { width: auto; margin: 0; padding: 12px 24px; font-size: 12.5px; }

.ghost-btn {
  border: 0;
  background: #eef1f6;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
}
.ghost-btn:hover { background: #e4e9f1; }

.table-scroll { overflow-x: auto; margin-top: 12px; border-radius: 16px; background: #f7f9fd; }
.edit-table { border-collapse: collapse; width: 100%; min-width: 780px; font-size: 12.5px; }
.edit-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.3px;
  padding: 11px 6px;
  text-align: center;
  white-space: nowrap;
}
.edit-table td { padding: 4px; border-top: 1px solid #eef2f8; }
.edit-table input {
  width: 100%;
  border: 1px solid transparent;
  background: #fff;
  border-radius: 9px;
  padding: 7px 8px;
  font-size: 12.5px;
  text-align: center;
  color: var(--ink);
  min-width: 0;
}
.edit-table input:focus { outline: 0; box-shadow: 0 0 0 2px var(--lime); }
.edit-table td.w-code input { width: 52px; }
.edit-table td.w-brand input { width: 64px; }
.edit-table td.w-num input { width: 78px; }
.edit-table td.w-note input { min-width: 150px; text-align: left; }

.flow-edit-list { margin-top: 14px; }
.flow-edit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.flow-edit-item:last-child { border-bottom: 0; }
.flow-edit-item .fi-main { flex: 1; min-width: 0; }
.flow-edit-item .fi-sub { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; font-family: var(--mono); }
.flow-edit-item .fi-type {
  flex: none;
  font-family: var(--mono);
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.8px;
  background: #eef1f6;
  color: var(--muted);
}
.flow-edit-item .fi-type.in { background: var(--lime); color: #23280a; font-weight: 700; }
.flow-edit-item .fi-del {
  border: 0;
  background: #eef1f6;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
}
.flow-edit-item .fi-del:hover { color: #7d1d12; background: #fdeeeb; }

/* ---------- 桌面：导航移到顶部，避免遮挡内容 ---------- */
@media (min-width: 1080px) {
  .app { display: flex; flex-direction: column; padding-bottom: 32px; }
  .topbar { order: 0; }
  .tabbar {
    order: 1;
    position: static;
    transform: none;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 2px auto 0;
    width: auto;
    max-width: none;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 26px -22px rgba(22, 38, 63, 0.5);
  }
  .tabbar button { padding: 10px 24px; }
  .view { order: 2; }
}

/* ---------- 移动端：底部导航下方内容渐隐，避免"硬切" ---------- */
@media (max-width: 1079px) {
  .app::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(112px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(238, 241, 247, 0) 0%, rgba(238, 241, 247, 0.86) 52%, #eef1f7 88%);
    pointer-events: none;
    z-index: 25;
  }
}

/* ---------- 醒目块：今日销售 ---------- */
.kpi.hot {
  margin: 16px 8px;
  padding: 13px 15px 14px;
  border-radius: 18px;
  border-top: 0 !important;
  border-left: 0 !important;
  background: linear-gradient(140deg, #e6fb7c 0%, #d3ee3f 52%, #b9dd1e 100%);
  box-shadow: 0 18px 34px -22px rgba(150, 190, 20, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #23280a;
}
.kpi.hot span { color: #3f480f; }
.kpi.hot .kpi-num { color: #1c2106; }
.kpi.hot .kpi-num i { color: #4a5412; }
.kpi.hot em { color: #454f10; }
.kpi.hot .tag-lime { background: #23272e; color: var(--lime); }
@media (min-width: 700px) {
  .kpi.hot { margin: 0 10px; padding: 14px 16px; }
}
