/* ==========================================================================
   手机端 · 独立样式（只服务 /mobile/，与电脑端 /desktop/ 完全不共享 DOM/CSS）
   设计基调：单列卡片流 + 底部胶囊导航；触控优先（44px 命中区）、
   安全区适配（env(safe-area-inset-*)）、下拉刷新、底部筛选弹层、粘性保存栏。
   ========================================================================== */
:root {
  --bg: #f4f6f3;
  --bg-soft: #eaeFE9;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --surface-3: #eef3ee;
  --line: #e3e9e2;
  --line-soft: #eef2ed;
  --line-strong: #ccd7ce;
  --ink: #10241c;
  --ink-2: #3f544a;
  --ink-3: #5e6e65;
  --ink-4: #55655d;
  --brand: #0f7a5e;
  --brand-dark: #0a5b46;
  --brand-soft: #e2f3ea;
  --brand-tint: #f1faf5;
  --gold: #96641a;
  --gold-soft: #fbf1de;
  --danger: #bb4130;
  --danger-soft: #fcece8;
  --warn: #8f6218;
  --warn-soft: #fdf4e1;
  --info: #2c6890;
  --info-soft: #e9f2f8;
  --violet: #6552a0;
  --violet-soft: #f0edf9;
  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px -4px rgba(16, 36, 28, .14), 0 1px 2px rgba(16, 36, 28, .04);
  --shadow-lg: 0 18px 46px -18px rgba(10, 40, 30, .32);
  --top-h: 56px;
  --tab-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --num: "SF Mono", "Cascadia Mono", "Roboto Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size:15.5px;
  line-height: 1.55;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg.ico { flex: none; vertical-align: -.16em; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.num, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.v, .money, .kpi-value { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
mark { background: #fff0bd; border-radius: 3px; padding: 0 2px; }

/* ---------------------------- 启动 / 登录 ---------------------------- */
.boot {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(165deg, #0f3a2d, #0b2b22 55%, #09231c);
  color: #eaf5ef;
  z-index: 90;
}
.boot-logo { filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
.boot-name { font-size: 17px; font-weight: 650; letter-spacing: .5px; margin-top: 11px; }
.boot-sub { font-size:13px; color: rgba(234,245,239,.6); }
.boot-bar {
  width: 120px; height: 3px; border-radius: 3px; margin-top: 18px;
  background: rgba(255,255,255,.12); overflow: hidden;
}
.boot-bar > i {
  display: block; width: 42%; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #2fc295, #7ee2c1);
  animation: bootSlide 2.4s linear infinite;
}
@keyframes bootSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) {
  .boot-bar > i { animation-duration: 4s; }
}
.boot-error {
  max-width: 320px; margin-top: 14px; text-align: center; font-size:13.5px;
  line-height: 1.75; color: #ffd9d2;
}
.boot-error .btn { margin-top: 14px; }

.login {
  position: fixed; inset: 0; z-index: 80;
  background: linear-gradient(170deg, #0f3a2d, #0a2820 60%, #071d17);
  display: flex; flex-direction: column;
  padding: calc(28px + var(--safe-t)) 22px calc(22px + var(--safe-b));
  overflow-y: auto;
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .nm { font-size: 16px; font-weight: 650; color: #fff; }
.login-brand .sb { font-size:11px; letter-spacing: 1.6px; color: rgba(226,242,236,.5); text-transform: uppercase; }
.login-hero { margin: auto 0 26px; }
.login-hero h1 {
  margin: 0 0 8px; font-size: 25px; line-height: 1.35; font-weight: 700;
  color: #fff; letter-spacing: -.3px;
}
.login-hero p { margin: 0; font-size:13.5px; line-height: 1.8; color: rgba(226,242,236,.62); }
.login-card {
  background: #fff; border-radius: 22px; padding: 20px 18px calc(18px + var(--safe-b));
  box-shadow: 0 26px 60px -24px rgba(0,0,0,.5);
}
.login-card h2 { margin: 0 0 2px; font-size: 18px; font-weight: 680; }
.login-card .sub { font-size:13.5px; color: var(--ink-3); margin-bottom: 16px; }
.login-err {
  display: none; margin-bottom: 12px; padding: 9px 11px; border-radius: 10px;
  background: var(--danger-soft); color: var(--danger); font-size:13.5px; line-height: 1.6;
}
.login-err.show { display: block; }
.login-foot { margin-top: 14px; font-size:11.5px; color: var(--ink-4); text-align: center; line-height: 1.7; }

/* ---------------------------- 外壳 ---------------------------- */
.shell { min-height: 100vh; }
.appbar {
  position: sticky; top: 0; z-index: 30;
  padding-top: var(--safe-t);
  background: rgba(244, 246, 243, .92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.appbar.scrolled { border-bottom-color: var(--line); background: rgba(244,246,243,.97); }
.appbar-in {
  height: var(--top-h); display: flex; align-items: center; gap: 10px;
  padding: 0 14px; max-width: 720px; margin: 0 auto;
}
.appbar-back {
  width: 44px; height: 44px; margin-left: -8px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink); flex: none;
}
.appbar-back:active { background: var(--surface-3); }
.appbar-title { min-width: 0; flex: 1; }
.appbar-title h1 { display: block; font-size: 18px; font-weight: 680; letter-spacing: -.2px; margin: 0; }
.appbar-title span { display: block; font-size:12.5px; color: var(--ink-3); margin-top: 1px; }
.appbar-act {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: var(--ink-2); flex: none; position: relative;
}
.appbar-act:active { background: var(--surface-3); }
.appbar-act .dot {
  position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 1.5px solid var(--bg);
}

.view {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 14px calc(var(--tab-h) + 26px + var(--safe-b));
  outline: none;
  min-height: calc(100vh - var(--top-h));
}
.view.no-tab { padding-bottom: calc(16px + var(--safe-b)); }
.view.has-savebar { padding-bottom: calc(84px + var(--safe-b)); }

/* 下拉刷新 */
.pull {
  position: fixed; top: calc(var(--safe-t) + 4px); left: 0; right: 0;
  height: 40px; display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size:13px; color: var(--ink-3); pointer-events: none;
  opacity: 0; transform: translateY(-42px); z-index: 25;
  transition: opacity .18s ease;
}
.pull.show { opacity: 1; }
.pull.loading .pull-ico { animation: spin .8s linear infinite; }
.pull-ico { display: inline-flex; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 底部导航 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size:11.5px; color: var(--ink-4); position: relative;
  -webkit-user-select: none; user-select: none;
}
.tab svg { transition: transform .16s ease; }
.tab:active svg { transform: scale(.9); }
.tab.on { color: var(--brand); font-weight: 650; }
.tab.on::before {
  content: ""; position: absolute; top: 0; width: 22px; height: 2.5px;
  border-radius: 0 0 3px 3px; background: var(--brand);
}
.tab.gap { visibility: hidden; }

/* 悬浮新建 */
.fab {
  position: fixed; right: 16px; z-index: 34;
  bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  width: 54px; height: 54px; border-radius: 19px;
  background: linear-gradient(160deg, #16886a, #0a5f49);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 26px -10px rgba(10,90,68,.75), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .16s ease, opacity .16s ease;
}
.fab:active { transform: scale(.93); }
.fab.hide { opacity: 0; pointer-events: none; transform: scale(.8); }

/* ---------------------------- 通用件 ---------------------------- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }

.sec-head {
  display: flex; align-items: baseline; gap: 8px;
  margin: 4px 2px 0;
}
.sec-head h2 { margin: 0; font-size:15.5px; font-weight: 680; letter-spacing: -.1px; }
.sec-head .more {
  margin: -14px 0 -14px auto; padding: 14px 2px; min-height: 46px; min-width: 46px;
  font-size:13px; color: var(--brand); font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card.pad { padding: 14px; }
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 14px 0;
}
.card-head h2, .card-head h3 { margin: 0; font-size:14.5px; font-weight: 680; }
.card-head .sub { font-size:12.5px; color: var(--ink-3); margin-top: 2px; }
.card-body { padding: 12px 14px 14px; }
.card-divide { height: 1px; background: var(--line-soft); margin: 0 14px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 15px; border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-size:14.5px; font-weight: 550;
  transition: transform .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.975); background: var(--surface-3); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary {
  background: linear-gradient(170deg, #158666, #0c6b51);
  border-color: #0b6049; color: #fff;
  box-shadow: 0 6px 16px -10px rgba(10,80,60,.9), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn.primary:active { background: linear-gradient(170deg, #12805f, #0a5b45); }
.btn.danger { background: var(--danger-soft); border-color: #f0c8be; color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.block { width: 100%; }
.btn.sm { min-height: 44px; padding: 0 11px; font-size:13.5px; border-radius: 10px; }
.btn.xs { min-height: 44px; min-width: 44px; padding: 0 9px; font-size:13px; border-radius: 9px; }
.btn.tall { min-height: 48px; font-size:15.5px; border-radius: 15px; }
.link-btn { color: var(--brand); font-size:13.5px; font-weight: 600; padding: 4px 2px; }
.link-btn.danger { color: var(--danger); }

/* 搜索 / 输入 */
.searchbox {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 12px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line);
}
.searchbox input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size:14.5px; padding: 0;
}
.searchbox input::placeholder { color: var(--ink-4); }
.searchbox .clear { width: 24px; height: 24px; display: grid; place-items: center; color: var(--ink-4); }

.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--ink); font-size:15.5px;
  outline: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,122,94,.12);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input.num, .input[type="number"] { font-variant-numeric: tabular-nums; }
.select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2375867c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
.textarea { min-height: 76px; resize: vertical; line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size:13.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size:12.5px; color: var(--ink-3); line-height: 1.6; }
.field .req { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size:14px; color: var(--ink-2); min-height: 32px; }
.check input { width: 19px; height: 19px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch > span {
  position: absolute; inset: 0; border-radius: 20px; background: var(--line-strong);
  transition: background .18s ease;
}
.switch > span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s ease;
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }

/* 分段 / 标签 */
.segmented {
  display: flex; padding: 3px; border-radius: 12px; background: var(--surface-3);
  border: 1px solid var(--line);
}
.segmented button {
  flex: 1; min-height: 34px; border-radius: 9px; font-size:13.5px; color: var(--ink-3);
  font-weight: 550;
}
.segmented button.on { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: var(--shadow); }
.chips {
  display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 1px 3px;
}
.chip {
  flex: none; min-height: 44px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size:13.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.chip.brand.on { background: var(--brand); border-color: var(--brand); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  min-height: 22px; padding: 0 8px; border-radius: 7px;
  font-size:11.5px; font-weight: 650; letter-spacing: .1px;
  background: var(--surface-3); color: var(--ink-2);
}
.pill.ok { background: var(--brand-soft); color: var(--brand-dark); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutral { background: var(--surface-3); color: var(--ink-3); }
.tag {
  display: inline-flex; align-items: center; height: 21px; padding: 0 7px;
  border-radius: 6px; background: var(--surface-3); color: var(--ink-3);
  font-size:11.5px; font-weight: 600;
}

/* 首页大卡 */
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 18px 17px 15px;
  background: linear-gradient(155deg, #124735, #0b3126 58%, #08261d);
  /* 渐变之外保留同色底：渐变色不被识别时（截图/对比度计算）仍取到深色背景 */
  background-color: #0b3126;
  color: #eaf5ef;
  box-shadow: 0 16px 34px -20px rgba(8,50,36,.9);
}
.hero::after {
  content: ""; position: absolute; inset: -40% 0 auto auto;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,206,155,.26), transparent 66%);
  pointer-events: none;
}
.hero-kicker {
  display: flex; align-items: center; gap: 7px;
  font-size:12.5px; color: rgba(228,244,236,.82); letter-spacing: .3px;
}
.hero-value {
  font-family: var(--num); font-size: 31px; font-weight: 700; letter-spacing: -.8px;
  margin: 7px 0 2px; line-height: 1.1;
}
.hero-value small { font-size: 16px; font-weight: 500; opacity: .7; margin-right: 2px; }
.hero-sub { font-size:13px; color: rgba(228,244,236,.82); }
.hero-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin-top: 15px; border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,.09);
}
.hero-grid > div {
  /* 用实色而非半透明叠层：对比度可控，截图/导出也不会串色 */
  background: #0a2a20; padding: 9px 6px; text-align: center;
}
.hero-grid .k { font-size:11.5px; color: rgba(228,244,236,.82); }
.hero-grid .v {
  font-size:14.5px; font-weight: 680; font-family: var(--num); margin-top: 2px;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* KPI 两列 */
.kpi2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 12px 13px; box-shadow: var(--shadow); min-width: 0;
}
.kpi-card .k { display: flex; align-items: center; gap: 5px; font-size:12.5px; color: var(--ink-3); }
.kpi-card .v {
  font-family: var(--num); font-size: 19px; font-weight: 700; letter-spacing: -.4px;
  margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-card .f { font-size:11.5px; color: var(--ink-4); margin-top: 2px; }
.kpi-card.warn .v { color: var(--warn); }
.kpi-card.danger .v { color: var(--danger); }
.kpi-card.brand .v { color: var(--brand); }

/* 快捷宫格 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 11px 4px; border-radius: 13px; color: var(--ink-2); font-size:12.5px;
  text-align: center;
}
.quick:active { background: var(--surface-2); }
.quick .ico-box {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-dark);
}
.quick .ico-box.gold { background: var(--gold-soft); color: var(--gold); }
.quick .ico-box.blue { background: var(--info-soft); color: var(--info); }
.quick .ico-box.violet { background: var(--violet-soft); color: var(--violet); }

/* 列表行 */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px; text-align: left; width: 100%;
  border-bottom: 1px solid var(--line-soft); color: var(--ink);
}
.list-item:last-child { border-bottom: 0; }
.list-item:active { background: var(--surface-2); }
.list-item .ic {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark);
}
.list-item .ic.gold { background: var(--gold-soft); color: var(--gold); }
.list-item .ic.blue { background: var(--info-soft); color: var(--info); }
.list-item .ic.violet { background: var(--violet-soft); color: var(--violet); }
.list-item .ic.red { background: var(--danger-soft); color: var(--danger); }
.list-item .bd { flex: 1; min-width: 0; }
.list-item .bd b { display: block; font-size:14.5px; font-weight: 600; }
.list-item .bd span { display: block; font-size:12.5px; color: var(--ink-3); margin-top: 1px; }
.list-item .end { flex: none; display: flex; align-items: center; gap: 6px; color: var(--ink-4); }

/* 单据卡片 */
.doc-card {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow);
  color: var(--ink);
}
.doc-card:active { background: var(--surface-2); }
.doc-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.doc-no { font-size:13.5px; font-weight: 680; letter-spacing: .2px; font-family: var(--num); }
.doc-top .pill { margin-left: auto; }
.doc-mid { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.doc-name { font-size:15.5px; font-weight: 620; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-date { font-size:12.5px; color: var(--ink-3); flex: none; margin-left: auto; }
.doc-amt {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  margin-top: 10px; padding: 8px 4px; border-radius: 11px; background: var(--surface-2);
}
.doc-amt > div { text-align: center; min-width: 0; }
.doc-amt .k { font-size:11.5px; color: var(--ink-3); }
.doc-amt .v {
  font-size:14px; font-weight: 680; font-family: var(--num); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-amt .v.red { color: var(--danger); }
.doc-amt .v.green { color: var(--brand); }
.doc-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size:12.5px; color: var(--ink-3); }
.doc-foot .acts { margin-left: auto; display: flex; gap: 6px; }

/* 空状态 / 骨架 */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 46px 20px; text-align: center;
}
.empty .eic {
  width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-3); margin-bottom: 2px;
}
.empty b { font-size:15px; font-weight: 620; }
.empty span { font-size:13.5px; color: var(--ink-3); line-height: 1.7; max-width: 260px; }
.empty .btn { margin-top: 6px; }
.sk { background: linear-gradient(90deg, #edf1ec 25%, #f5f8f4 37%, #edf1ec 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-line { height: 13px; }
.sk-card { height: 92px; border-radius: var(--radius); }
.sk-row { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }

/* 明细行 */
.line-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.line-item:last-child { border-bottom: 0; }
.line-item .nm { font-size:14px; font-weight: 600; }
.line-item .meta { font-size:11.5px; color: var(--ink-3); margin-top: 1px; }
.line-item .qty { font-size:13px; color: var(--ink-2); font-family: var(--num); }
.line-item .amt { margin-left: auto; font-size:14.5px; font-weight: 680; font-family: var(--num); white-space: nowrap; }

/* 编辑页明细 / 其他收支：一屏一行的卡片式录入（手机上输入框不挤成一条） */
.edit-item, .edit-other {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.edit-item:last-child, .edit-other:last-child { border-bottom: 0; }
.edit-item .grid3 {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.mini-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-field > span { font-size:12.5px; color: var(--ink-3); }
.mini-field .input { min-height: 40px; padding: 8px 10px; font-size:14.5px; }
.totals { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.totals .t { display: flex; align-items: baseline; justify-content: space-between; font-size:13.5px; color: var(--ink-3); }
.totals .t b { color: var(--ink); font-family: var(--num); font-weight: 620; }
.totals .t.grand { font-size:14.5px; color: var(--ink); margin-top: 2px; }
.totals .t.grand b { font-size: 20px; font-weight: 720; color: var(--brand); letter-spacing: -.4px; }

/* 信息键值 */
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; font-size:13.5px; }
.kv:not(:last-child) { border-bottom: 1px solid var(--line-soft); }
.kv .k { color: var(--ink-3); flex: none; font-size:13.5px; }
.kv .v { text-align: right; min-width: 0; font-weight: 550; word-break: break-word; }

/* 时间线 */
.timeline { position: relative; padding-left: 16px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1.5px; background: var(--line); }
.tl { position: relative; padding: 7px 0; }
.tl::before {
  content: ""; position: absolute; left: -15px; top: 13px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--brand); border: 2px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--brand-soft);
}
.tl.warn::before { background: var(--warn); box-shadow: 0 0 0 1.5px var(--warn-soft); }
.tl .top { display: flex; align-items: baseline; gap: 8px; }
.tl .top b { font-size:14.5px; font-family: var(--num); }
.tl .top span { margin-left: auto; font-size:11.5px; color: var(--ink-3); }
.tl .sub { font-size:12.5px; color: var(--ink-3); margin-top: 1px; }

/* ---------------------------- 底部弹层 ---------------------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(9, 24, 19, .46);
  opacity: 0; transition: opacity .2s ease;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-mask.show { opacity: 1; }
.sheet {
  width: 100%; max-width: 720px; max-height: 90vh;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding-bottom: var(--safe-b);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.22,.8,.28,1);
  box-shadow: 0 -12px 40px -16px rgba(0,0,0,.4);
}
.sheet-mask.show .sheet { transform: translateY(0); }
.sheet-grab {
  width: 38px; height: 4.5px; border-radius: 4px; background: var(--line-strong);
  margin: 8px auto 0; flex: none;
}
.sheet-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px 10px; flex: none;
  border-bottom: 1px solid var(--line-soft);
}
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 680; }
.sheet-head .sub { font-size:12.5px; color: var(--ink-3); margin-top: 2px; }
.sheet-head .close {
  margin-left: auto; width: 34px; height: 34px; margin-top: -4px;
  border-radius: 11px; display: grid; place-items: center; color: var(--ink-3); flex: none;
}
.sheet-head .close:active { background: var(--surface-3); }
.sheet-body { padding: 14px 16px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  display: flex; gap: 8px; padding: 11px 16px calc(11px + var(--safe-b));
  border-top: 1px solid var(--line-soft); flex: none;
  background: var(--surface);
}
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.primary { flex: 1.4; }

/* 选项弹层（筛选、菜单、更多） */
.opt-list { display: flex; flex-direction: column; gap: 2px; }
.opt {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 4px;
  font-size:15px; color: var(--ink); text-align: left; width: 100%;
  border-bottom: 1px solid var(--line-soft);
}
.opt:last-child { border-bottom: 0; }
.opt:active { background: var(--surface-2); }
.opt .t { flex: 1; min-width: 0; }
.opt .d { font-size:12.5px; color: var(--ink-3); margin-top: 1px; }
.opt .ck { color: var(--brand); }
.opt.danger { color: var(--danger); }

/* 对话框（承载旧打印模块 / 确认框） */
.dlg-mask {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(9,24,19,.5); display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; transition: opacity .18s ease;
}
.dlg-mask.show { opacity: 1; }
.dlg {
  width: 100%; max-width: 560px; max-height: 88vh;
  background: var(--surface); border-radius: 20px;
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(.96); transition: transform .18s ease;
  box-shadow: var(--shadow-lg);
}
.dlg-mask.show .dlg { transform: scale(1); }
.dlg.wide { max-width: 720px; }
.dlg-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 15px 15px 10px;
  border-bottom: 1px solid var(--line-soft); flex: none;
}
.dlg-head h3 { margin: 0; font-size: 16px; font-weight: 680; }
.dlg-head .sub { font-size:12.5px; color: var(--ink-3); margin-top: 2px; }
.dlg-head .close { margin-left: auto; width: 34px; height: 34px; margin-top: -4px; border-radius: 11px; display: grid; place-items: center; color: var(--ink-3); }
.dlg-body { padding: 14px 15px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.dlg-body.flush { padding: 0; }
.dlg-foot {
  display: flex; gap: 8px; padding: 11px 15px calc(11px + var(--safe-b));
  border-top: 1px solid var(--line-soft); flex: none; flex-wrap: wrap;
  background: var(--surface);
}
.dlg-foot .btn { flex: 1; }
.dlg-foot .btn.primary { flex: 1.4; }
.confirm-text { font-size:14.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; }

/* Toast */
.toast-root {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 95;
  top: calc(var(--safe-t) + 12px); display: flex; flex-direction: column; gap: 8px;
  width: min(92vw, 420px); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 11px 14px; border-radius: 14px;
  background: rgba(16, 36, 28, .95); color: #f1f8f4;
  font-size:13.5px; line-height: 1.55; box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
}
.toast.err { background: #8f3125; }
.toast.warn { background: #7f5a12; }
.toast.leaving { opacity: 0; transform: translateY(-6px); transition: all .18s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* 粘性保存栏 */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px calc(10px + var(--safe-b));
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 26px -18px rgba(0,0,0,.35);
}
.savebar .sum { min-width: 0; flex: 1; }
.savebar .sum .k { font-size:11.5px; color: var(--ink-3); }
.savebar .sum .v { font-size: 19px; font-weight: 720; font-family: var(--num); color: var(--brand); letter-spacing: -.4px; }
.savebar .btn { min-width: 128px; min-height: 46px; border-radius: 14px; }
.savebar .state { font-size:11.5px; color: var(--warn); margin-left: 2px; }

/* 统计块 */
.stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat3 > div {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 11px 6px; text-align: center; box-shadow: var(--shadow); min-width: 0;
}
.stat3 .k { font-size:11.5px; color: var(--ink-3); }
.stat3 .v { font-size: 15px; font-weight: 700; font-family: var(--num); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat3 .v.red { color: var(--danger); }
.stat3 .v.green { color: var(--brand); }

/* 图表：纯 CSS 柱状 */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding-top: 6px; }
.bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar { width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #24a180, #0f7a5e); min-height: 3px; transition: height .3s ease; }
.bars .bar.paid { background: linear-gradient(180deg, #d3a75a, #bf8733); }
.bars .lb { font-size:11.5px; color: var(--ink-4); white-space: nowrap; }

/* 分组头（吸顶） */
.list-group { margin-top: 2px; }
.group-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 2px 8px;
  font-size:13.5px; font-weight: 650; color: var(--ink-2);
}
.group-head .grow { font-weight: 550; color: var(--ink-3); font-size:12.5px; }

/* 打印机预览在手机上的补充（print-doc.css 里只有旧版选择器，这里按新结构补齐） */
.dlg .pd-set { flex-wrap: wrap; gap: 8px; padding: 8px; }
/* 每组设置单独占一行：纸张大小 / 页边距里的输入框是 nowrap 的，
   并排撑出的最小宽度（约 460px）会把弹窗顶得比手机屏还宽，右侧内容被裁掉 */
.dlg .pd-set__g { flex: 1 1 100%; flex-wrap: wrap; row-gap: 4px; }
.dlg .pd-set__g > b { flex: none; }
.dlg .pd-num { width: 54px; }
.dlg .pd-set__tail { margin-left: 0; flex: 1 1 100%; justify-content: space-between; }
.dlg .pd-bar { gap: 6px; font-size:12.5px; }
.dlg .pd-bar #pd-info { flex: 1 1 100%; }
.dlg .pd-bar .pd-zoom { margin-left: 0; flex: 1 1 100%; justify-content: space-between; background: #f6f8fb; border: 1px solid #e3e8ef; border-radius: 9px; padding: 4px 6px; }
.dlg .pd-bar .pd-zoom .btn { min-height: 34px; padding: 6px 9px; font-size:13px; }
.dlg .pd-stage { padding: 10px 6px; max-height: 56vh; }
/* 预览弹窗里的整体宽度：纸张 241mm≈911px，任何一层没解除 min-width:auto
   都会把弹窗撑大，手机上一屏只能看到左半张纸 */
.dlg .dlg-body { min-width: 0; }
.dlg .pd-foot { display: flex; flex-direction: column; gap: 8px; flex: 1 1 100%; }
.dlg .pd-foot-rest { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.dlg .pd-foot .btn { width: 100%; flex: 1 1 auto; }
.dlg .pd-foot .pd-foot-main { flex: 1 1 100%; }

/* 小屏更紧凑 */
@media (max-width: 360px) {
  .view { padding-left: 11px; padding-right: 11px; }
  .hero-value { font-size: 27px; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .quick { font-size:11px; }
  .kpi-card .v { font-size: 17px; }
}
@media (min-width: 600px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
