/* ============================================================
   盘货工作台 · 手机端样式（绿色清新风）
   参考：浅暖灰底 / 墨绿主色 / 大圆角白卡 / 渐变绿头部
   ============================================================ */
:root {
  --bg: #f4f5f0;
  --card: #ffffff;
  --line: #e9ece4;
  --line-2: #f1f3ec;
  --text: #24312a;
  --sub: #8b958c;
  --sub-2: #aab3aa;
  --primary: #2f6b4e;
  --primary-2: #3f8a63;
  --primary-soft: #e9f3ec;
  --grad-a: #3a7d5d;
  --grad-b: #5c9e7c;
  --blue: #2f6fd6;
  --blue-soft: #e9f0fd;
  --red: #d94336;
  --red-soft: #fdecea;
  --green: #1d8a5c;
  --amber: #d97e14;
  --amber-soft: #fdf3e2;
  --ok-bg: #edf7f0;
  --diff-bg: #fdedeb;
  --radius: 18px;
  --shadow: 0 2px 6px rgba(52, 78, 64, .04), 0 8px 20px rgba(52, 78, 64, .06);
  --tap: 46px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body { max-width: 100vw; overflow-x: hidden; }
button, input, select, textarea { font-family: inherit; font-size: 16px; color: var(--text); }
button { cursor: pointer; }
input, select, textarea { outline: none; }
a { color: var(--primary); }

/* ---------------- 布局骨架 ---------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; padding: 12px 14px calc(96px + var(--safe-b)); }
.main.has-no-bar { padding-bottom: calc(24px + var(--safe-b)); }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 6px;
  height: 56px; padding: 0 10px 0 6px;
  background: var(--bg);
}
.tb-btn {
  min-width: 44px; height: 44px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 21px; border-radius: 14px; color: var(--text); padding: 0 8px;
}
.tb-btn:active { background: #e9ede4; }
.tb-ico {
  flex: none; width: 34px; height: 34px; margin-left: 2px;
  border-radius: 11px; background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.tb-ico svg { display: block; }
.tb-title { flex: 1; font-size: 18.5px; font-weight: 800; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-title small { display: block; font-size: 12px; color: var(--sub); font-weight: 400; letter-spacing: 0; }

.searchbar { padding: 4px 14px 10px; background: var(--bg); }
.searchbar input {
  width: 100%; height: 42px; border-radius: 999px; border: 0;
  background: #eaede3; padding: 0 18px; font-size: 15.5px;
}
.searchbar input::placeholder { color: #a8b1a5; }

/* ---------------- 抽屉 ---------------- */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 84%; max-width: 340px;
  background: #fff; z-index: 90; transform: translateX(-102%);
  transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column; box-shadow: 6px 0 24px rgba(30, 55, 42, .14);
}
.drawer.open { transform: translateX(0); }
.scrim {
  position: fixed; inset: 0; background: rgba(20, 35, 27, .45); z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .24s;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.drawer-head {
  padding: 24px 18px 0;
  background: linear-gradient(140deg, var(--grad-a), var(--grad-b));
  color: #fff; position: relative; overflow: hidden;
}
.drawer-head::before {
  content: ''; position: absolute; right: -46px; top: -46px; width: 150px; height: 150px;
  border-radius: 50%; background: rgba(255, 255, 255, .09);
}
.drawer-head::after {
  content: ''; position: absolute; right: 26px; bottom: -60px; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(255, 255, 255, .07);
}
.drawer-head .brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.drawer-head .b-avatar {
  width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .22);
  border: 1.5px solid rgba(255, 255, 255, .35);
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700;
  position: relative; cursor: pointer; flex: none;
}
.drawer-head .b-avatar img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
}
.drawer-head .b-avatar .av-cam {
  position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px;
  border-radius: 50%; background: rgba(255, 255, 255, .95); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .22);
}
.brand-txt { min-width: 0; }
.b-title { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.b-sub { font-size: 12.5px; opacity: .92; margin-top: 3px; }
.b-edit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; margin-left: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .18); color: #fff; opacity: .8;
  cursor: pointer; vertical-align: -5px; transition: background .15s, transform .15s;
}
.b-edit:active { opacity: 1; transform: scale(1.12); background: rgba(255, 255, 255, .32); }
.ico-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 32px; padding: 0; color: var(--primary); opacity: .75; }
.ico-btn:active { opacity: 1; }
.btn svg { vertical-align: -3px; margin-right: 2px; }

/* ---- 线条图标通用规则 ---- */
h3 svg { vertical-align: -3.5px; margin-right: 6px; color: var(--primary); opacity: .9; }
.sheet .s-btn .si { display: flex; align-items: center; justify-content: center; }
.sheet .s-btn .si svg { width: 19px; height: 19px; display: block; color: var(--primary); }
.report .r-ico svg { width: 22px; height: 22px; display: block; }
.rl svg { vertical-align: -2.5px; margin-right: 3px; color: var(--primary); opacity: .85; }
.it-meta svg, .rv svg { vertical-align: -2.5px; margin-right: 2px; color: var(--primary); }
.hero-date svg { vertical-align: -2px; opacity: .85; }

.dstats {
  position: relative; z-index: 1;
  display: flex; margin-top: 16px; padding: 12px 2px 14px;
  border-top: 1px solid rgba(255, 255, 255, .22);
}
.dstats > div { flex: 1; text-align: left; padding-left: 4px; }
.dstats > div + div { border-left: 1px solid rgba(255, 255, 255, .18); padding-left: 16px; }
.dstats b { display: block; font-size: 21px; font-weight: 800; line-height: 1.2; }
.dstats span { font-size: 11.5px; opacity: .82; }
.dstat-link { cursor: pointer; border-radius: 10px; transition: background .15s, transform .1s; }
.dstat-link:active { background: rgba(255, 255, 255, .14); transform: scale(.96); }
.dstat-link::after { content: '›'; margin-left: 4px; opacity: .6; font-weight: 600; }

.drawer-nav { flex: 1; overflow-y: auto; padding: 10px 10px 14px; -webkit-overflow-scrolling: touch; }
.nav-group { padding: 14px 10px 6px; font-size: 12px; color: var(--sub-2); letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 0 12px; margin-bottom: 2px;
  border: 0; background: transparent; border-radius: 14px;
  font-size: 16.5px; text-align: left; color: var(--text);
}
.nav-item .ni-ico { width: 26px; display: inline-flex; align-items: center; justify-content: center; color: #75816f; }
.nav-item .ni-ico svg { display: block; }
.nav-item.active .ni-ico { color: var(--primary); }
.nav-item .ni-label { flex: 1; }
.nav-item::after { content: '›'; margin-left: auto; font-size: 19px; color: #c3cac2; font-weight: 400; }
.nav-item .ni-badge {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; margin-left: auto;
  background: var(--red); color: #fff; font-size: 12px; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700;
}
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.nav-item.active::after { color: var(--primary); }
.nav-item:active { background: #f0f4ec; }
.nav-sub { padding: 0 0 6px 8px; }
.nav-sub button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  min-height: 40px; padding: 0 12px 0 32px; font-size: 15px; color: var(--sub);
  border-radius: 12px; position: relative;
}
.nav-sub button::before {
  content: ''; position: absolute; left: 20px; top: 50%; width: 6px; height: 6px;
  margin-top: -3px; border-radius: 50%; background: #ccd4c9;
}
.nav-sub button.active { color: var(--primary); font-weight: 700; background: var(--primary-soft); }
.nav-sub button.active::before { background: var(--primary); }

.drawer-foot { padding: 12px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--sub); }
.drawer-foot .who { font-size: 14px; color: var(--text); margin-bottom: 4px; }

/* ---------------- 首页问候横幅 ---------------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(140deg, var(--grad-a), var(--grad-b));
  border-radius: 22px; padding: 18px 18px 16px; margin-bottom: 14px; color: #fff;
}
.hero::before {
  content: ''; position: absolute; right: -40px; top: -50px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(255, 255, 255, .1);
}
.hero::after {
  content: ''; position: absolute; right: 60px; bottom: -70px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.hero-greet { font-size: 21px; font-weight: 800; letter-spacing: .3px; position: relative; z-index: 1; }
.hero-date {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, .15); border: 0; color: #fff;
  font-size: 13px; border-radius: 999px; padding: 5px 12px; margin-top: 8px;
  position: relative; z-index: 1; cursor: pointer; font-family: inherit;
}
.hero-date:active { background: rgba(255, 255, 255, .3); }
.hero-stats {
  position: relative; z-index: 1;
  display: flex; margin-top: 14px; padding: 12px 8px;
  background: rgba(255, 255, 255, .16); border-radius: 16px;
}
.hero-stats > div { flex: 1; text-align: center; }
.hero-stats > div + div { border-left: 1px solid rgba(255, 255, 255, .22); }
.hero-stats b { display: block; font-size: 20px; font-weight: 800; }
.hero-stats span { font-size: 11.5px; opacity: .85; }
.hero-stats .hstat { cursor: pointer; border-radius: 12px; transition: background .15s; }
.hero-stats .hstat:active { background: rgba(255, 255, 255, .18); }
.hero-stats .hstat.on { background: rgba(255, 255, 255, .22); }

/* ---------------- 统计卡片 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.stat {
  background: var(--card); border: 0; border-radius: 16px;
  padding: 12px 6px; text-align: center; position: relative; min-height: 78px;
  box-shadow: var(--shadow);
}
.stat.on { background: var(--primary-soft); }
.stat .sv { font-size: 23px; font-weight: 800; line-height: 1.15; }
.stat .sl { font-size: 11.5px; color: var(--sub); margin-top: 3px; }
.stat.s-wait .sv { color: var(--text); }
.stat.s-done .sv { color: var(--green); }
.stat.s-diff .sv { color: var(--red); }
.stat.s-alert .sv { color: var(--amber); }

/* ---------------- 筛选 ---------------- */
.filters { background: var(--card); border: 0; border-radius: 16px; padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  flex: none; height: 36px; padding: 0 16px; border-radius: 999px; border: 0;
  background: #f0f2ea; font-size: 14.5px; color: var(--sub); display: inline-flex; align-items: center;
}
.chip.on { background: var(--primary); color: #fff; font-weight: 700; }
.chip.warn.on { background: var(--amber); }
.mchips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.mchip {
  flex: none; height: 36px; padding: 0 16px; border-radius: 999px; border: 0;
  background: #f0f2ea; font-size: 14.5px; color: var(--sub); display: inline-flex; align-items: center;
  font-family: inherit; cursor: pointer;
}
.mchip.on { background: var(--primary); color: #fff; font-weight: 700; }
.selects { display: flex; gap: 8px; margin-top: 10px; }
.selects select {
  flex: 1; height: 40px; border-radius: 999px; border: 0;
  background: #f0f2ea; padding: 0 14px; font-size: 14.5px; color: var(--text);
  appearance: none; background-image: none;
}

/* ---------------- 货品卡片 ---------------- */
.listbar {
  display: flex; align-items: center; gap: 10px; padding: 4px 4px 8px; font-size: 13.5px; color: var(--sub);
}
.listbar .grow { flex: 1; }
.chips .grow { flex: 1; }
.blind-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--card); color: var(--sub);
  border-radius: 999px; padding: 4px 10px; font-size: 12.5px; line-height: 1;
  cursor: pointer; transition: all .15s; flex: none;
}
.blind-btn:active { transform: scale(.95); }
.blind-btn.on {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.card {
  background: var(--card); border: 0; border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
  transition: background .18s;
}
.card.item.ok { background: var(--ok-bg); }
.card.item.diff { background: var(--diff-bg); }
.card.item.sel { box-shadow: 0 0 0 2px rgba(47, 107, 78, .4), var(--shadow); }

.it-top { display: flex; gap: 10px; align-items: flex-start; }
.ck { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; margin-top: 2px; }
.ck input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.ck i {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c8d1c5; background: #fff;
  display: block; position: relative;
}
.ck input:checked + i { background: var(--primary); border-color: var(--primary); }
.ck input:checked + i::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg);
}
.it-name { flex: 1; min-width: 0; }
.nm { font-size: 17px; font-weight: 700; line-height: 1.3; word-break: break-all; }
.it-meta { font-size: 12.5px; color: var(--sub); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.it-meta .cat {
  background: #f0f2ea; border-radius: 7px; padding: 1px 7px; color: #63705f;
}
.it-meta.ep { color: var(--amber); }
.it-book { text-align: right; flex: none; }
.it-book span { display: block; font-size: 11.5px; color: var(--sub); }
.it-book b { font-size: 20px; font-weight: 800; }
.it-book i { font-style: normal; font-size: 11.5px; color: var(--sub); margin-left: 2px; }

/* 每日盘点数据条：昨日期末 / 今日进货 / 日消耗（横向滑动） */
.it-daybar { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 9px; padding-bottom: 2px; scrollbar-width: none; }
.it-daybar::-webkit-scrollbar { display: none; }
.it-daybar .db { flex: none; white-space: nowrap; font-size: 11px; color: var(--sub); background: #f2f5f0; border-radius: 9px; padding: 5px 10px; }
.it-daybar .db b { font-size: 13.5px; font-weight: 800; color: var(--text); margin-left: 3px; font-variant-numeric: tabular-nums; }
.it-daybar .db b.in { color: #17845a; }
.it-daybar .db b.use { color: #d9342b; }

.it-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.stepper { flex: 1; display: flex; align-items: stretch; border: 0; border-radius: 14px; overflow: hidden; background: #f0f2ea; }
.stepper.filled { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary); }
.stepper button {
  width: 52px; min-height: 48px; border: 0; background: transparent; font-size: 24px; color: #5c6a58; line-height: 1;
}
.stepper button:active { background: rgba(47, 107, 78, .1); }
.stepper input {
  flex: 1; min-width: 0; border: 0; text-align: center; font-size: 21px; font-weight: 700;
  background: transparent; padding: 0 4px;
}
.stepper input::placeholder { font-size: 15px; font-weight: 400; color: #a9b2a4; }
.diff { flex: none; min-width: 82px; text-align: center; font-size: 15px; font-weight: 800; border-radius: 12px; padding: 8px 6px; }
.diff.none { color: var(--sub); background: #f0f2ea; font-weight: 500; }
.diff.zero { color: var(--green); background: #e2f4e9; }
.diff.up { color: var(--blue); background: var(--blue-soft); }
.diff.down { color: var(--red); background: var(--red-soft); }

.it-row2 { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.remark {
  flex: 1; height: 44px; border-radius: 12px; border: 0;
  background: #f0f2ea; padding: 0 14px; font-size: 15px;
}
.photo-btn {
  flex: none; width: 48px; height: 44px; border-radius: 12px; border: 0;
  background: #f0f2ea; display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; position: relative; overflow: hidden;
}
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb b {
  position: absolute; top: 0; right: 0; width: 22px; height: 22px; background: rgba(0, 0, 0, .55);
  color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center;
  border-bottom-left-radius: 8px; font-weight: 400;
}
.tag-warn { display: inline-block; font-size: 11px; background: var(--amber-soft); color: var(--amber); border-radius: 7px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.tag-exp { display: inline-block; font-size: 11px; border-radius: 7px; padding: 1px 6px; margin-left: 6px; }
.tag-exp.soon { background: #fdeedd; color: #c46a0a; }
.tag-exp.over { background: var(--red-soft); color: var(--red); }
.tag-exp.ok { background: #f0f2ea; color: #63705f; }

.cfields { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cfield { flex: 1 1 46%; min-width: 130px; }
.cfield label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 3px; }
.cfield input { width: 100%; height: 44px; border-radius: 12px; border: 0; background: #f0f2ea; padding: 0 12px; }

.lock-note { font-size: 12.5px; color: var(--amber); background: var(--amber-soft); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }

/* ---------------- 底部操作栏 ---------------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; gap: 8px; padding: 10px 14px calc(10px + var(--safe-b));
  background: rgba(255, 255, 255, .96); border-top: 0;
  box-shadow: 0 -4px 18px rgba(52, 78, 64, .07);
  backdrop-filter: blur(8px);
}
.actionbar .btn { flex: 1; }
.btn {
  min-height: 48px; border-radius: 14px; border: 0; background: #f0f2ea;
  font-size: 16px; font-weight: 600; color: var(--text); padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: translateY(1px); background: #e6e9de; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(47, 107, 78, .28); }
.btn.primary:active { background: var(--primary-2); }
.btn.ghost { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.btn.warn { background: var(--amber); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; font-size: 14.5px; border-radius: 12px; padding: 0 12px; flex: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------- 通用区块 ---------------- */
.sec { background: var(--card); border: 0; border-radius: var(--radius); padding: 16px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.sec h3 { margin: 0 0 12px; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.sec h3 .hint { font-size: 12px; color: var(--sub); font-weight: 400; margin-left: auto; }
.sec.tint { background: var(--primary-soft); }
.row { display: flex; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: 0; }
.row .rl { flex: 1; font-size: 15.5px; }
.row .rl small { display: block; font-size: 12.5px; color: var(--sub); font-weight: 400; }
.row .rv { font-size: 15px; color: var(--sub); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13.5px; color: var(--sub); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; border-radius: 13px; border: 0;
  background: #f0f2ea; padding: 10px 14px; font-size: 16px;
}
.field textarea { min-height: 76px; resize: vertical; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch i { display: block; width: 52px; height: 32px; border-radius: 16px; background: #d6dcd0; transition: .2s; position: relative; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(20px); }

.empty { text-align: center; color: var(--sub); padding: 46px 20px; font-size: 15px; }
.empty .e-ico { font-size: 40px; display: block; margin-bottom: 10px; opacity: .7; }

.kpi { display: flex; gap: 10px; margin-bottom: 12px; }
.kpi > div { flex: 1; background: #fff; border: 0; border-radius: 16px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 19px; }
.kpi span { font-size: 11.5px; color: var(--sub); }
.kpi .up b { color: var(--blue); }
.kpi .down b { color: var(--red); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: #f0f2ea; color: #63705f; }
.pill.ok { background: #e2f4e9; color: var(--green); }
.pill.draft { background: var(--amber-soft); color: var(--amber); }
.pill.diff { background: var(--red-soft); color: var(--red); }

/* ---------------- 底部弹层 ---------------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: none; }
.sheet-wrap.show { display: block; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(20, 35, 27, .48); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; background: #fff;
  border-radius: 24px 24px 0 0; padding: 18px 16px calc(20px + var(--safe-b));
  max-height: 84vh; overflow-y: auto; animation: up .24s cubic-bezier(.4, 0, .2, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet h3 { margin: 0 0 4px; font-size: 18.5px; font-weight: 800; }
.sheet .s-sub { font-size: 13.5px; color: var(--sub); margin-bottom: 14px; }
.sheet .s-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px;
  border: 0; background: #f0f2ea; border-radius: 15px;
  padding: 0 14px; font-size: 16.5px; margin-bottom: 8px; text-align: left;
}
.sheet .s-btn:active { background: #e6e9de; }
.sheet .s-btn .si { font-size: 20px; }
.sheet .s-btn.danger { color: var(--red); background: var(--red-soft); }
.sheet .s-btn .sd { font-size: 12.5px; color: var(--sub); font-weight: 400; display: block; }

/* 隐藏所有辅助小字：顶栏副标题 / 标题旁提示 / 行描述 / 弹窗按钮说明 */
.tb-title small, .sec h3 .hint, .row .rl small, .sheet .s-btn .sd { display: none !important; }

/* ---------------- 日历选择面板 ---------------- */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 12px 0 10px; }
.cal-nav {
  width: 36px; height: 36px; border: 0; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 22px; line-height: 1; padding-bottom: 3px;
}
.cal-nav:active { transform: scale(.92); }
.cal-title { font-size: 16px; font-weight: 800; min-width: 118px; text-align: center; color: var(--text); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-d { position: relative; height: 42px; border: 0; border-radius: 13px; font-size: 14.5px; color: var(--text); background: transparent; }
.cal-d.blank { visibility: hidden; }
.cal-d.today { color: var(--primary); font-weight: 800; }
.cal-d:active { background: var(--primary-soft); }
.cal-d.has::after {
  content: ''; position: absolute; left: 50%; bottom: 6px;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--primary);
}
.cal-d.sel { background: var(--primary); color: #fff; font-weight: 800; }
.cal-d.sel.has::after { background: #fff; }
.cal-d.sel:active { background: var(--primary); }
#calClose { margin-top: 12px; }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: rgba(36, 49, 42, .93); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 15px; z-index: 200; opacity: 0; pointer-events: none; transition: .22s; max-width: 84vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b33027; }
.toast.ok { background: #23714f; }

.modal-wrap { position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-wrap.show { display: flex; }
.modal-scrim { position: absolute; inset: 0; background: rgba(20, 35, 27, .5); }
.modal {
  position: relative; background: #fff; border-radius: 20px; padding: 22px 20px; width: 100%; max-width: 360px;
  animation: pop .2s ease-out;
}
@keyframes pop { from { transform: scale(.94); opacity: .5 } to { transform: none; opacity: 1 } }
.modal h3 { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.modal p { margin: 0 0 16px; font-size: 15px; color: #55645a; }
.modal .m-acts { display: flex; gap: 10px; }
.modal .m-acts .btn { flex: 1; }
.modal .m-list { max-height: 200px; overflow-y: auto; background: #f0f2ea; border-radius: 12px; padding: 8px 12px; margin-bottom: 14px; font-size: 14px; }
.modal .m-list div { padding: 3px 0; border-bottom: 1px dashed #e0e4d8; }
.modal .m-list div:last-child { border-bottom: 0; }

/* ---------------- 报表卡 ---------------- */
.report { display: flex; align-items: center; gap: 12px; }
.report .r-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.report .r-txt { flex: 1; }
.report .r-txt b { display: block; font-size: 16.5px; }
.report .r-txt span { font-size: 12.5px; color: var(--sub); }

/* 分享页横幅 */
.share-banner { background: linear-gradient(140deg, var(--grad-a), var(--grad-b)); color: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.share-banner b { font-size: 17px; }
.share-banner p { margin: 4px 0 0; font-size: 13px; opacity: .95; }

/* ---------------- 打印 ---------------- */
#printArea { display: none; }
@media print {
  html, body { background: #fff !important; font-size: 12px; }
  .app, .drawer, .scrim, .actionbar, .sheet-wrap, .modal-wrap, .toast { display: none !important; }
  #printArea { display: block !important; }
  .p-doc { color: #000; }
  .p-doc h1 { font-size: 18px; text-align: center; margin: 0 0 4px; letter-spacing: 2px; }
  .p-doc .p-sub { text-align: center; font-size: 11px; color: #333; margin-bottom: 8px; }
  .p-doc .p-head { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 11.5px; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 5px 0; margin-bottom: 6px; }
  .p-doc table { width: 100%; border-collapse: collapse; }
  .p-doc th, .p-doc td { border: 1px solid #333; padding: 3px 4px; font-size: 11.5px; }
  .p-doc th { background: #eee !important; font-weight: 700; }
  .p-doc td.n { text-align: right; }
  .p-doc td.c { text-align: center; }
  .p-doc tfoot td { font-weight: 700; }
  .p-doc .p-sign { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12px; }
  .p-doc .p-foot { margin-top: 10px; font-size: 10px; color: #666; text-align: right; }
  .p-doc .p-ticket-head { text-align: center; border-bottom: 1px dashed #000; padding-bottom: 4px; margin-bottom: 4px; }
  .p-doc .p-ticket-line { display: flex; justify-content: space-between; font-size: 11px; border-bottom: 1px dotted #999; padding: 3px 0; }
  .p-doc .p-ticket-line .t-n { flex: 1; word-break: break-all; padding-right: 6px; }
  .p-doc .p-ticket-line .t-v { flex: none; font-weight: 700; }
  .p-doc .p-ticket-total { border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 4px 0; margin-top: 4px; font-size: 11.5px; }
  .p-doc pre { font-family: inherit; white-space: pre-wrap; margin: 0; }
}

/* 小票 58mm 精简模板宽度控制（@page size 由 JS 注入 #printPageStyle 控制） */
body.print-58 .p-doc { width: 54mm; margin: 0 auto; }
body.print-58 .p-doc h1 { font-size: 14px; letter-spacing: 0; }
body.print-58 .p-doc .p-head { gap: 2px 10px; font-size: 10.5px; }
body.print-58 .p-doc { font-size: 11px; }

/* 桌面浏览器预览时限制宽度，模拟手机 */
@media (min-width: 720px) {
  body { background: #e7eae2; }
  .app { max-width: 430px; margin: 0 auto; background: var(--bg); min-height: 100vh; box-shadow: 0 0 40px rgba(40, 60, 48, .12); }
  .drawer { left: calc(50% - 215px); }
  .actionbar { max-width: 430px; left: 50%; right: auto; width: 430px; transform: translateX(-50%); border-radius: 0 0 4px 4px; }
  .toast { bottom: 104px; }
}

/* ================= 月汇总表 ================= */
.mon-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mon-nav .grow { flex: 1 1 0; min-width: 0; }
.mon-ym { font-size: 18px; letter-spacing: .5px; white-space: nowrap; flex-shrink: 0; }
.mon-sel { border: 1px solid #e2e7e3; border-radius: 10px; padding: 6px 10px; font-size: 13px; background: #fff; color: inherit; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; margin-left: auto; font-family: inherit; cursor: pointer; max-width: 100%; }
.mp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mp-cell { padding: 11px 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: inherit; font-size: 14px; font-family: inherit; cursor: pointer; }
.mp-cell.on { background: #2f6b4e; border-color: #2f6b4e; color: #fff; font-weight: 600; }
.mon-sum { display: flex; gap: 10px; margin-top: 12px; }
.mon-sum .ms { flex: 1; text-align: center; background: #f2f6f3; border-radius: 12px; padding: 10px 6px 8px; }
.mon-sum .ms b { display: block; font-size: 17px; line-height: 1.3; }
.mon-sum .ms span { font-size: 11px; color: var(--sub); }
.mtable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.mtable { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 13px; }
.mtable th, .mtable td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.mtable thead th { color: var(--sub); font-weight: 600; font-size: 12px; border-bottom: 2px solid var(--line); }
.mtable th.sticky, .mtable td.sticky { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 128px; max-width: 168px; overflow: hidden; text-overflow: ellipsis; }
.mtable td.sticky small { display: block; color: var(--sub); font-size: 11px; font-weight: 400; }
.mtable td.num { font-variant-numeric: tabular-nums; }
.mtable td.in { color: #17845a; }
.mtable td.use { color: #d9342b; font-weight: 700; }
.mtable td.close { font-weight: 700; }
