/* ============ 茶仓管家 · 移动优先样式 ============ */
:root {
  --tea: #6B4E2E;          /* 主色：茶褐 */
  --tea-dark: #55401F;
  --tea-light: #F4EDE3;    /* 浅茶底 */
  --ink: #2B2620;          /* 主文字 */
  --ink-2: #6E655A;        /* 次文字 */
  --line: #E5DDD1;
  --card: #FFFFFF;
  --bg: #FAF7F2;
  --red: #C0392B;
  --red-bg: #FDECEA;
  --green: #1E7A46;
  --green-bg: #E8F5EE;
  --amber: #9C6B1E;
  --amber-bg: #FBF3E2;
  --blue: #2C5F8A;
  --blue-bg: #EAF1F7;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(85, 64, 31, 0.08);
}

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

html { font-size: 17px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

button { font-family: inherit; font-size: 1rem; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--ink); }

#app { max-width: 760px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1rem;
  padding-top: calc(0.7rem + env(safe-area-inset-top));
  background: var(--tea); color: #fff;
}
.topbar-left { display: flex; align-items: center; gap: 0.55rem; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; }
.logo-mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; position: relative; display: inline-block;
}
.logo-mark::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--tea);
}
.topbar-right { display: flex; gap: 0.3rem; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border: none; border-radius: 12px;
  background: transparent; color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.18); }
.topbar-logout {
  border: none; background: transparent; color: #fff; font-weight: 650;
  font-size: 0.92rem; padding: 0 0.45rem; min-height: 44px; cursor: pointer;
}
.topbar-logout:active { opacity: 0.7; }
.badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #FF4D3A; color: #fff; font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--tea);
}

/* ---------- 主区 ---------- */
#view { flex: 1; padding: 1rem 1rem 1.4rem; padding-bottom: calc(5.4rem + env(safe-area-inset-bottom)); }
#view:focus { outline: none; }

.page-title { font-size: 1.35rem; font-weight: 700; margin: 0.2rem 0 0.9rem; }
.page-sub { color: var(--ink-2); font-size: 0.92rem; margin: -0.6rem 0 0.9rem; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 1rem; margin-bottom: 0.9rem;
}

/* ---------- 首页 ---------- */
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-bottom: 1rem; }
.hero-btn {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 1.05rem 0.6rem; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  font-weight: 700; font-size: 1.05rem; color: var(--ink);
  transition: border-color 0.15s, transform 0.1s;
}
.hero-btn:active { transform: scale(0.97); border-color: var(--tea); }
.hero-btn .hb-ico {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
}
.hb-ico { font-size: 1.2rem; font-weight: 700; }
.hb-tea { background: var(--tea-light); color: var(--tea); }
.hb-green { background: var(--green-bg); color: var(--green); }
.hb-blue { background: var(--blue-bg); color: var(--blue); }
.hb-amber { background: var(--amber-bg); color: var(--amber); }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.stat-cell { text-align: center; padding: 0.5rem 0.2rem; }
.stat-num { font-size: 1.3rem; font-weight: 700; }
.stat-label { font-size: 0.82rem; color: var(--ink-2); margin-top: 0.1rem; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 1.2rem 0 0.6rem; }
.section-head h2 { font-size: 1.08rem; }
.link-btn { background: none; border: none; color: var(--tea); font-weight: 600; cursor: pointer; padding: 0.3rem; }

.alert-row {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.75rem 0.85rem; border-radius: 12px; margin-bottom: 0.5rem;
}
.alert-low { background: var(--red-bg); color: var(--red); }
.alert-over { background: var(--amber-bg); color: var(--amber); }
.alert-row .ar-name { font-weight: 700; flex: 1; }
.alert-row .ar-name small { display: block; font-weight: 400; font-size: 0.85rem; }
.alert-row .ar-qty { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }

.quick-list .card { margin-bottom: 0.55rem; padding: 0.85rem 1rem; display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.quick-list .card:active { border-color: var(--tea); }
.ql-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--tea-light); color: var(--tea); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.quick-list .ql-txt { flex: 1; }
.quick-list .ql-txt b { display: block; }
.quick-list .ql-txt small { color: var(--ink-2); }
.caret { color: var(--ink-2); }

/* ---------- 表单 ---------- */
.form-block { margin-bottom: 1rem; }
.form-block > label { display: block; font-weight: 700; margin-bottom: 0.35rem; font-size: 0.95rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.field-row-3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 0.7rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; padding: 0.72rem 0.8rem;
  border: 1.5px solid var(--line); border-radius: 11px; background: #fff;
  min-height: 48px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--tea); }
input[type="number"] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; }
textarea { min-height: 70px; resize: vertical; }

.hint { font-size: 0.85rem; color: var(--ink-2); margin-top: 0.3rem; }

/* 多条目行 */
.entry-list { display: flex; flex-direction: column; gap: 0.75rem; }
.entry {
  background: var(--tea-light); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 0.8rem; position: relative;
}
.entry .e-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.entry .e-head b { font-size: 0.95rem; }
.e-del { background: none; border: none; color: var(--red); font-size: 0.9rem; font-weight: 600; cursor: pointer; padding: 0.3rem 0.4rem; }
.entry .field-row { margin-bottom: 0.6rem; }
.entry .field-row:last-child { margin-bottom: 0; }
.pick-item {
  width: 100%; text-align: left; min-height: 52px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 0.5rem 0.8rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.pick-item .pi-name { font-weight: 700; }
.pick-item .pi-name small { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.82rem; }
.pick-item .pi-qty { color: var(--ink-2); white-space: nowrap; font-size: 0.85rem; }
.e-amount { text-align: right; color: var(--tea); font-weight: 700; font-size: 0.95rem; margin-top: 0.5rem; }

.btn {
  display: block; width: 100%; border: none; border-radius: 13px;
  min-height: 56px; padding: 0.8rem 1rem; font-size: 1.08rem; font-weight: 700;
  cursor: pointer; text-align: center;
}
.btn-primary { background: var(--tea); color: #fff; }
.btn-primary:active { background: var(--tea-dark); }
.btn-outline { background: #fff; color: var(--tea); border: 2px solid var(--tea); }
.btn-ghost { background: none; color: var(--ink-2); border: none; min-height: 44px; width: auto; margin: 0 auto; display: block; }
.btn-danger { background: #fff; color: var(--red); border: 2px solid var(--red); }
.btn-row { display: flex; gap: 0.7rem; margin-top: 0.8rem; }
.btn-row .btn { flex: 1; }

.total-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--tea); color: #fff; border-radius: 13px;
  padding: 0.8rem 1.1rem; font-size: 1.05rem; margin: 1rem 0 0.8rem;
}
.total-bar b { font-size: 1.3rem; }

/* ---------- 库存列表 ---------- */
.search-bar { display: flex; gap: 0.55rem; margin-bottom: 0.75rem; }
.search-bar input { flex: 1; }
.scan-btn {
  width: 52px; min-width: 52px; height: 52px; border-radius: 11px; border: none;
  background: var(--tea); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.chips { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.15rem 0.15rem 0.7rem; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 0.45rem 0.95rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink-2); font-weight: 600; white-space: nowrap; cursor: pointer; font-size: 0.92rem;
}
.chip.on { background: var(--tea); border-color: var(--tea); color: #fff; }

.tree-group { margin-bottom: 0.6rem; }
.tree-head {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  background: var(--tea-light); border: none; border-radius: 12px;
  padding: 0.75rem 1rem; font-size: 1.02rem; font-weight: 700; color: var(--ink); cursor: pointer;
}
.tree-head .tg-count { margin-left: auto; color: var(--ink-2); font-size: 0.88rem; font-weight: 500; }
.tree-head .tg-arrow { transition: transform 0.2s; color: var(--ink-2); }
.tree-group.closed .tg-arrow { transform: rotate(-90deg); }
.tree-group.closed .tree-body { display: none; }

.stock-row {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.85rem 1rem; margin-top: 0.5rem; cursor: pointer;
}
.stock-row:active { border-color: var(--tea); }
.sr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.sr-name { font-weight: 700; font-size: 1.05rem; }
.sr-sub { color: var(--ink-2); font-size: 0.84rem; margin-top: 0.15rem; }
.sr-qty { font-size: 1.2rem; font-weight: 700; white-space: nowrap; }
.sr-qty small { font-size: 0.82rem; color: var(--ink-2); font-weight: 400; }
.sr-meta { display: flex; gap: 0.9rem; margin-top: 0.5rem; font-size: 0.85rem; color: var(--ink-2); flex-wrap: wrap; }

.tag { display: inline-block; padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.tag-low { background: var(--red-bg); color: var(--red); }
.tag-over { background: var(--amber-bg); color: var(--amber); }
.tag-ok { background: var(--green-bg); color: var(--green); }
.tag-cat { background: var(--tea-light); color: var(--tea); }
.tag-gift { background: var(--blue-bg); color: var(--blue); }

/* ---------- 打印送货单 ---------- */
#print-area { display: none; }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
}

/* ---------- 报表 ---------- */
.seg { display: flex; background: var(--tea-light); border-radius: 12px; padding: 0.28rem; gap: 0.28rem; margin-bottom: 0.9rem; }
.seg button {
  flex: 1; border: none; background: transparent; border-radius: 9px;
  padding: 0.55rem 0.3rem; font-weight: 700; color: var(--ink-2); cursor: pointer;
}
.seg button.on { background: #fff; color: var(--tea); box-shadow: 0 1px 4px rgba(85, 64, 31, 0.15); }

.filter-row { display: flex; gap: 0.55rem; margin-bottom: 0.8rem; align-items: center; }
.filter-row select { min-width: 0; }
.filter-row input[type="date"] { flex: 1; min-width: 0; }

.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-bottom: 0.9rem; }
.summary-cell { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 0.9rem; }
.summary-cell .sc-label { font-size: 0.82rem; color: var(--ink-2); }
.summary-cell .sc-val { font-size: 1.25rem; font-weight: 700; margin-top: 0.1rem; }

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; overflow-x: auto; }
table { min-width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.65rem 0.7rem; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--tea-light); font-size: 0.84rem; color: var(--ink-2); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; }
.t-row-in td:first-child { color: var(--green); font-weight: 600; }
.t-row-out td:first-child { color: var(--red); font-weight: 600; }
.table-foot { padding: 0.7rem 0.9rem; background: var(--tea-light); font-weight: 700; display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }

.mini-btn {
  border: 1.5px solid var(--tea); color: var(--tea); background: #fff;
  border-radius: 10px; padding: 0.45rem 0.9rem; font-weight: 600; cursor: pointer;
}
.mini-btn:active { background: var(--tea-light); }

/* ---------- 详情 ---------- */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; margin-top: 0.7rem; }
.kv-grid .k { color: var(--ink-2); font-size: 0.84rem; }
.kv-grid .v { font-weight: 600; }
.kv-full { grid-column: 1 / -1; }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 24, 15, 0.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: #fff; width: 100%; max-width: 760px;
  border-radius: 20px 20px 0 0; max-height: 88vh; overflow-y: auto;
  padding: 1.1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
  animation: slideUp 0.22s ease-out;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.modal-head h3 { font-size: 1.15rem; }
.modal-close { background: var(--tea-light); border: none; width: 38px; height: 38px; border-radius: 50%; color: var(--tea); font-size: 1.05rem; cursor: pointer; font-weight: 700; }

.picker-search { margin-bottom: 0.7rem; }
.picker-list { display: flex; flex-direction: column; gap: 0.5rem; }
.picker-row {
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 0.7rem 0.9rem; cursor: pointer; text-align: left; width: 100%;
}
.picker-row:active { border-color: var(--tea); background: var(--tea-light); }
.picker-row .pr-name { font-weight: 700; font-size: 1rem; }
.picker-row .pr-sub { color: var(--ink-2); font-size: 0.83rem; }

/* ---------- 扫码 ---------- */
.scan-area { position: relative; border-radius: var(--radius); overflow: hidden; background: #111; }
.scan-area video { width: 100%; display: block; }
.scan-hint { text-align: center; color: var(--ink-2); margin-top: 0.7rem; }
.scan-frame {
  position: absolute; left: 10%; right: 10%; top: 40%; height: 90px;
  border: 2.5px solid #7ED77E; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
}

/* ---------- 引导 ---------- */
.guide-mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(30, 24, 15, 0.82);
  display: flex; align-items: center; justify-content: center; padding: 1.4rem;
}
.guide-card {
  background: #fff; border-radius: 18px; max-width: 380px; width: 100%;
  padding: 1.6rem 1.4rem; text-align: center;
}
.guide-card h3 { margin-bottom: 0.6rem; font-size: 1.2rem; }
.guide-card p { color: var(--ink-2); margin-bottom: 1.2rem; }
.guide-step { color: var(--tea); font-weight: 700; font-size: 0.88rem; margin-bottom: 0.4rem; }
.guide-ico { width: 64px; height: 64px; margin: 0 auto 0.9rem; border-radius: 18px; background: var(--tea-light); color: var(--tea); display: flex; align-items: center; justify-content: center; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(6.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 0.7rem 1.2rem; border-radius: 12px;
  font-size: 0.95rem; z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red); }
#toast.ok { background: var(--green); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--ink-2); padding: 2.2rem 1rem; }
.empty .em-ico { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.4; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 760px; z-index: 40;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(85, 64, 31, 0.06);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.18rem;
  padding: 0.5rem 0 0.55rem; background: none; border: none;
  color: var(--ink-2); font-size: 0.78rem; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.tab.on { color: var(--tea); }
.tab svg { width: 26px; height: 26px; }
.tab-strong svg { color: inherit; }

/* ---------- 桌面适配 ---------- */
@media (min-width: 640px) {
  .hero-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-mask { align-items: center; }
  .modal { border-radius: 18px; max-height: 86vh; }
  .tabbar { border-radius: 16px 16px 0 0; }
}

/* ---------- 登录门 ---------- */
/* 改登录或脚本时，把本文件、index.html、sw.js 里的 20260927d 一起改 */
#gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #f4f7f2;
}
.gate-photo {
  flex: 0 0 auto;
  height: 56.25vw;
  max-height: 420px;
  background: #f4f7f2 url("../img/gate-bg.png?v=20260927d") center / cover no-repeat;
}
#gate[hidden], #app[hidden], #gate-form[hidden], #gate-shops[hidden], #gate-join[hidden], #gate-register[hidden], #gate-to-join[hidden], #gate-to-login[hidden], #gate-to-register[hidden] { display: none !important; }
.gate-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: -1.6rem auto 0;
  background: #f7faf6;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 28px rgba(43, 38, 32, 0.08);
  padding: 1.45rem 1.25rem calc(1.15rem + env(safe-area-inset-bottom));
}
.gate-brand { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.15rem; }
.gate-mark {
  width: 46px; height: 46px; border-radius: 14px; background: var(--tea); flex-shrink: 0; position: relative;
}
.gate-mark::before, .gate-mark::after {
  content: ""; position: absolute; left: 11px; right: 11px; border: 2px solid #f6efe6;
}
.gate-mark::before { top: 12px; height: 8px; border-radius: 8px 8px 2px 2px; border-bottom: none; }
.gate-mark::after { top: 22px; height: 12px; border-radius: 2px 2px 10px 10px; }
.gate-card h1 { font-size: 1.55rem; line-height: 1.2; margin: 0; }
.gate-lead { color: var(--ink-2); margin: 0.15rem 0 0; font-size: 0.92rem; }
.gate-card .form-block { margin-bottom: 0.85rem; }
.gate-card .form-block > label { font-size: 0.88rem; margin-bottom: 0.28rem; }
.gate-card input {
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid #e3d7c8;
  border-radius: 14px;
  background: #fff;
  font-size: 1.05rem;
}
.gate-card input:focus { border-color: var(--tea); box-shadow: 0 0 0 3px rgba(107, 78, 46, 0.14); }
.gate-err { color: var(--red); min-height: 1.2rem; margin: 0.1rem 0 0.35rem; font-size: 0.9rem; }
.gate-card .btn-primary { margin-top: 0.15rem; border-radius: 14px; }
.gate-link {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.2rem;
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
@media (min-width: 800px) {
  #gate {
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    background: #eef4ea url("../img/gate-bg.png?v=20260927d") center 42% / cover no-repeat;
  }
  .gate-photo { display: none; }
  .gate-card {
    width: 400px;
    margin: 0 0 0 auto;
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(20, 12, 6, 0.28);
    padding: 1.7rem 1.45rem 1.2rem;
  }
}

.chart-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 0.85rem 0.75rem;
  margin: 0.8rem 0;
}
.chart-title { font-weight: 750; margin-bottom: 0.35rem; }
.hbar { display: grid; grid-template-columns: 4.6rem 1fr auto; gap: 0.45rem; align-items: center; margin: 0.38rem 0; }
.hbar-name { font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--tea-light); border-radius: 99px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 99px; }
.hbar-val { font-size: 0.8rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.vchart { display: flex; align-items: flex-end; gap: 0.35rem; height: 132px; }
.vcol { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.vpair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.vbar { display: inline-block; width: 8px; border-radius: 4px 4px 1px 1px; min-height: 2px; }
.vbar.in { background: var(--green); }
.vbar.out { background: var(--tea); }
.vcol small { color: var(--ink-2); font-size: 0.68rem; margin-top: 0.2rem; }
.chart-legend { display: flex; gap: 0.9rem; margin-top: 0.45rem; color: var(--ink-2); font-size: 0.82rem; }
.chart-legend .vbar { width: 10px; height: 10px; min-height: 10px; border-radius: 2px; margin-right: 0.25rem; vertical-align: -1px; }

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none; transition: none; }
}
