/* 第四版设计：苹果 iOS 26「液态玻璃」。
   底下是一层很淡的低饱和背景；卡片、按钮、底部导航是磨砂玻璃（半透明 + 模糊 + 顶边高光）；
   大数字用实色，不用渐变。颜色克制：只有链接和选中用苹果蓝，开销类目条用类目色。
   风格（我 → 风格）：跟随手机 / 雾白（浅）/ 石墨（深）/ 深海（深蓝）。 */
:root {
  --bg: #eceef2; --surface: rgba(255, 255, 255, .58); --surface-solid: #f7f7f9; --surface-2: rgba(120, 120, 128, .12);
  --text: #1d1d1f; --text-2: #6e6e73; --text-3: #9b9ba1;
  --sep: rgba(0, 0, 0, .07); --accent: #0071e3; --accent-press: #0062c4; --accent-soft: rgba(0, 113, 227, .1);
  --pos: #1f9d55; --neg: #e0352b; --warn: #b86e00; --warn-soft: rgba(255, 159, 10, .12);
  --grad-a: #1d1d1f; --grad-b: #1d1d1f; --grad-c: #1d1d1f; --over-a: #e0352b; --over-b: #e0352b;
  --edge: rgba(255, 255, 255, .78); --hi: rgba(255, 255, 255, .95);
  --shadow: 0 1px 1px rgba(20, 30, 50, .03), 0 10px 30px rgba(20, 30, 50, .07);
  --overlay: rgba(20, 22, 28, .28); --tabbar: rgba(250, 250, 252, .78); --tab-on: rgba(120, 120, 128, .14); --sheet: rgba(248, 248, 250, .9);
  --wall: radial-gradient(75% 45% at 0% 0%, #cbd6ec 0%, transparent 70%), radial-gradient(60% 40% at 100% 18%, #e0d4ee 0%, transparent 70%),
    radial-gradient(85% 50% at 85% 100%, #eedcc8 0%, transparent 70%), radial-gradient(60% 40% at 0% 75%, #cfe2e1 0%, transparent 70%),
    linear-gradient(180deg, #f2f3f6, #e8eaef);
  --blur: blur(26px) saturate(170%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --num: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Inter, system-ui, sans-serif;
  --r: 22px; --tab-h: 54px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0c; --surface: rgba(255, 255, 255, .075); --surface-solid: #1c1c1f; --surface-2: rgba(120, 120, 128, .24);
    --text: #f5f5f7; --text-2: #98989f; --text-3: #636368;
    --sep: rgba(255, 255, 255, .09); --accent: #2997ff; --accent-press: #1a7fe0; --accent-soft: rgba(41, 151, 255, .16);
    --pos: #30d158; --neg: #ff453a; --warn: #ffd60a; --warn-soft: rgba(255, 214, 10, .12);
    --grad-a: #f5f5f7; --grad-b: #f5f5f7; --grad-c: #f5f5f7; --over-a: #ff453a; --over-b: #ff453a;
    --edge: rgba(255, 255, 255, .13); --hi: rgba(255, 255, 255, .2);
    --shadow: 0 10px 34px rgba(0, 0, 0, .35); --overlay: rgba(0, 0, 0, .55); --tabbar: rgba(34, 34, 38, .8); --tab-on: rgba(255, 255, 255, .12); --sheet: rgba(36, 36, 40, .92);
    --wall: radial-gradient(75% 45% at 0% 0%, #1e293b 0%, transparent 70%), radial-gradient(60% 40% at 100% 20%, #272236 0%, transparent 70%),
      radial-gradient(85% 50% at 80% 100%, #2c2219 0%, transparent 70%), #0a0a0c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0c; --surface: rgba(255, 255, 255, .075); --surface-solid: #1c1c1f; --surface-2: rgba(120, 120, 128, .24);
  --text: #f5f5f7; --text-2: #98989f; --text-3: #636368;
  --sep: rgba(255, 255, 255, .09); --accent: #2997ff; --accent-press: #1a7fe0; --accent-soft: rgba(41, 151, 255, .16);
  --pos: #30d158; --neg: #ff453a; --warn: #ffd60a; --warn-soft: rgba(255, 214, 10, .12);
  --grad-a: #f5f5f7; --grad-b: #f5f5f7; --grad-c: #f5f5f7; --over-a: #ff453a; --over-b: #ff453a;
  --edge: rgba(255, 255, 255, .13); --hi: rgba(255, 255, 255, .2);
  --shadow: 0 10px 34px rgba(0, 0, 0, .35); --overlay: rgba(0, 0, 0, .55); --tabbar: rgba(34, 34, 38, .8); --tab-on: rgba(255, 255, 255, .12); --sheet: rgba(36, 36, 40, .92);
  --wall: radial-gradient(75% 45% at 0% 0%, #1e293b 0%, transparent 70%), radial-gradient(60% 40% at 100% 20%, #272236 0%, transparent 70%),
    radial-gradient(85% 50% at 80% 100%, #2c2219 0%, transparent 70%), #0a0a0c;
  color-scheme: dark;
}
:root[data-style="navy"] {
  --bg: #060d18; --surface-solid: #101b2b; --accent: #4cb4ff;
  --wall: radial-gradient(80% 50% at 0% 0%, #123259 0%, transparent 70%), radial-gradient(60% 42% at 100% 25%, #0f3a4a 0%, transparent 70%),
    radial-gradient(85% 50% at 70% 100%, #1a2148 0%, transparent 70%), #060d18;
  --tabbar: rgba(22, 36, 56, .82); --sheet: rgba(20, 32, 50, .92);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 var(--font); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.loading { padding: 40vh 0 0; text-align: center; color: var(--text-3); }
[hidden] { display: none !important; }

/* ---------- 外框 ---------- */
.shell { min-height: 100vh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 20px); }
.page { max-width: 620px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) 8px max(18px, env(safe-area-inset-left, 0px)); }
.titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 2px; min-height: 44px; }
.large-title { font-size: 2.05rem; font-weight: 700; letter-spacing: -.01em; margin: 0; line-height: 1.12; text-wrap: balance; }
.subtitle { color: var(--text-2); font-size: .92rem; margin: 2px 0 18px; }
.back { display: inline-flex; align-items: center; min-height: 40px; font-size: 1.02rem; margin-left: -2px; }
.back::before { content: ""; width: 10px; height: 10px; border-left: 2.4px solid currentColor; border-bottom: 2.4px solid currentColor;
  transform: rotate(45deg); margin: 0 6px 0 4px; border-radius: 1px; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.iconbtn svg { width: 20px; height: 20px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 2px max(8px, env(safe-area-inset-left, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-right, 0px));
  background: var(--tabbar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep); }
.tabbar a { flex: 1; max-width: 140px; min-height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--text-3); font-size: .66rem; font-weight: 600; }
.tabbar a svg { width: 25px; height: 25px; }
.tabbar a.on { color: var(--accent); }
@media (min-width: 900px) {
  .shell { padding: 0 0 0 232px; }
  .tabbar { top: 0; right: auto; width: 232px; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 30px 14px; border-top: 0;
    border-right: .5px solid var(--sep); background: var(--surface); }
  .tabbar::before { content: attr(data-brand); display: block; font-weight: 700; font-size: 1.2rem; padding: 0 12px 22px; color: var(--text); letter-spacing: -.01em; }
  .tabbar a { max-width: none; flex: 0 0 auto; min-height: 42px; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0 12px;
    border-radius: 10px; font-size: .96rem; font-weight: 500; color: var(--text); }
  .tabbar a svg { width: 20px; height: 20px; color: var(--text-2); }
  .tabbar a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .tabbar a.on svg { color: var(--accent); }
  .page { padding-top: 34px; }
}

/* ---------- 首页 ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 20px 18px; margin: 0 0 12px; }
.hero .label { color: var(--text-2); font-size: .95rem; font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.big { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.025em; line-height: 1.08; word-break: break-all; font-size: 2.25rem; margin: 4px 0 8px; }
.hero .big { font-size: clamp(2.55rem, 12.5vw, 3.6rem); margin: 6px 0 10px; }
.big .cur { font-size: .42em; font-weight: 600; margin-right: 3px; vertical-align: .62em; letter-spacing: 0; }
.grad { background: linear-gradient(100deg, var(--grad-a), var(--grad-b) 55%, var(--grad-c)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad.over { background-image: linear-gradient(100deg, var(--over-a), var(--over-b)); }
.hero .line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 1rem; color: var(--text); }
.hero .line b { font-family: var(--num); font-weight: 600; }
.formula { border-top: .5px solid var(--sep); margin-top: 14px; padding-top: 10px; color: var(--text-2); font-size: .78rem; line-height: 1.55; }
.formula .num { color: var(--text); }
.hero-note { color: var(--neg); font-weight: 600; font-size: .92rem; margin: 0 0 4px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 12px; }
.tile { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.tile .k { color: var(--text-2); font-size: .8rem; font-weight: 500; }
.tile .v { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.32rem; letter-spacing: -.015em; margin-top: 2px; overflow-wrap: anywhere; }
.tile .v .cur { font-size: .6em; font-weight: 600; margin-right: 2px; }
.tile .s { color: var(--text-3); font-size: .74rem; margin-top: 2px; }
.tile, .hero, .card { container-type: inline-size; }
.fit { white-space: nowrap; word-break: normal; overflow: hidden; }
.tile .duo.fit { font-size: min(1.02rem, calc(100cqw / var(--w))); }
.tile .v.fit { font-size: min(1.32rem, calc(100cqw / var(--w))); }
.big.fit { font-size: min(2.25rem, calc(100cqw / var(--w))); }
.hero .big.fit { font-size: min(clamp(2.55rem, 12.5vw, 3.6rem), calc(100cqw / var(--w))); }
.tile .duo { display: flex; flex-direction: column; font-family: var(--num); font-weight: 600; font-size: 1.02rem; margin-top: 2px; }

.cats h2 { font-size: 1.05rem; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; }
.cats h2 small { color: var(--text-2); font-weight: 500; font-size: .78rem; }
.catbar { display: flex; gap: 2px; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: 0 0 8px; }
.catbar i { display: block; height: 100%; min-width: 3px; }
.legend { list-style: none; margin: 0; padding: 0; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 48px; align-items: center; gap: 10px; padding: 9px 0; border-top: .5px solid var(--sep); font-size: .95rem; }
.legend li:first-child { border-top: 0; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; }
.legend .amt { font-family: var(--num); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend .pct { color: var(--text-2); font-size: .82rem; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 分组列表 ---------- */
.section { font-size: .8rem; color: var(--text-2); margin: 24px 16px 8px; font-weight: 500; }
.group { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; margin: 0 0 10px; }
.row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 11px 18px;
  color: var(--text); width: 100%; background: none; border: 0; text-align: left; }
.row + .row::before, .frow + .frow::before, .row + .frow::before, .frow + .row::before { content: ""; position: absolute; top: 0; left: 18px; right: 0; border-top: .5px solid var(--sep); }
a.row, button.row { cursor: pointer; }
a.row:active, button.row:active { background: var(--surface-2); }
.row .l { display: flex; flex-direction: column; min-width: 0; }
.row .l small { color: var(--text-2); font-size: .8rem; line-height: 1.35; }
.row .r { display: flex; align-items: center; gap: 8px; color: var(--text-2); text-align: right; flex: none; max-width: 62%; }
.row .r b { color: var(--text); font-weight: 600; font-family: var(--num); font-variant-numeric: tabular-nums; }
.row.nav .r::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--text-3); border-top: 2px solid var(--text-3); transform: rotate(45deg); margin-left: 2px; flex: none; }
.ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; margin-right: 12px; }
.ico svg { width: 18px; height: 18px; }
.row .lead { display: flex; align-items: center; min-width: 0; margin: 0; color: inherit; font-size: inherit; }
.pos { color: var(--pos) !important; }
.neg { color: var(--neg) !important; }
.muted { color: var(--text-2); }
.small { font-size: .8rem; }
.mask { letter-spacing: .12em; color: var(--text-3) !important; }
.foot { color: var(--text-3); font-size: .74rem; margin: 10px 18px 0; line-height: 1.55; }
.empty { text-align: center; color: var(--text-2); padding: 30px 18px; }
.danger-text { color: var(--neg); }
.addrow { color: var(--accent); font-weight: 500; }

/* ---------- 表单 ---------- */
.frow { position: relative; display: grid; grid-template-columns: minmax(88px, 40%) 1fr; align-items: center; gap: 10px; min-height: 52px; padding: 4px 18px; }
.frow > span { font-size: .96rem; }
.frow input, .frow select { width: 100%; min-height: 44px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: right; padding: 0; }
.frow input::placeholder { color: var(--text-3); }
.frow input:focus, .frow select:focus { outline: none; }
.frow:focus-within { background: var(--surface-2); }
.frow select { -webkit-appearance: none; appearance: none; color: var(--accent); direction: rtl; cursor: pointer; }
.frow select option { direction: ltr; }
.frow.stack { grid-template-columns: 1fr; padding: 10px 18px; }
.frow.stack input { text-align: left; }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; border: 0; border-radius: 14px; cursor: pointer;
  font-size: 1.03rem; font-weight: 600; margin: 14px 0 6px; background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: none; }
.btn.primary:active { background: var(--accent-press); }
.btn.danger { color: var(--neg); }
.btn:disabled { opacity: .5; }
.btn-link { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 1rem; min-height: 44px; cursor: pointer; padding: 0 6px; }
.msg { min-height: 1.3em; margin: 6px 18px 0; font-size: .85rem; }
.msg.err { color: var(--neg); }
.msg.ok { color: var(--pos); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch { -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--surface-2); position: relative;
  cursor: pointer; transition: background .2s; flex: none; margin: 0; box-shadow: inset 0 0 0 1px var(--sep); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .22); transition: transform .2s; }
.switch:checked { background: #34c759; box-shadow: none; }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .45; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 99px; padding: 6px 12px; min-height: 32px; cursor: pointer;
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .85rem; box-shadow: var(--shadow); }
.chip::after { content: ""; width: 6px; height: 6px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 16px; min-height: 52px; }
.tags > .muted { padding: 0 2px; }
.tag { font-size: .8rem; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--text); }

/* ---------- 底部弹出 ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; padding: 8px max(10px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)); }
.sheet .group { margin-bottom: 8px; box-shadow: none; }
.sheet h3 { margin: 0; padding: 14px 18px 6px; font-size: .8rem; color: var(--text-2); font-weight: 500; text-align: center; }
.sheet .row.opt { justify-content: center; font-size: 1.1rem; color: var(--accent); min-height: 56px; }
.sheet .row.opt.sel::after { content: "✓"; position: absolute; right: 20px; font-weight: 700; }
.sheet .cancel { justify-content: center; font-weight: 600; color: var(--accent); }
.sheet form { padding: 0 0 6px; }
@media (min-width: 900px) { .sheet-bg { align-items: center; } }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; max-width: 400px; margin: 0 auto;
  padding: 24px max(18px, env(safe-area-inset-right, 0px)) 24px max(18px, env(safe-area-inset-left, 0px)); }
.logo { width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(135deg, var(--grad-a), var(--grad-b) 60%, var(--grad-c)); display: grid; place-items: center; margin: 0 0 18px; }
.logo svg { width: 34px; height: 34px; }
.langs { display: flex; justify-content: center; gap: 18px; margin-top: 10px; }

/* ---------- 引导 ---------- */
.steps { display: flex; gap: 5px; margin: 6px 0 12px; }
.steps i { flex: 1; height: 4px; border-radius: 99px; background: var(--sep); }
.steps i.done { background: var(--accent); }
.lead { color: var(--text-2); margin: 0 0 18px; font-size: .98rem; }
.navbtns { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.welcome-list { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.welcome-list li { display: flex; gap: 14px; align-items: center; padding: 11px 18px; position: relative; }
.welcome-list li + li::before { content: ""; position: absolute; top: 0; left: 60px; right: 0; border-top: .5px solid var(--sep); }
.welcome-list li::after { counter-increment: s; content: counter(s); order: -1; flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }
.welcome-list li div { display: flex; flex-direction: column; }
.welcome-list small { color: var(--text-2); font-size: .8rem; }

/* ---------- 人员、资产 ---------- */
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); }
.avatar.lg { width: 60px; height: 60px; font-size: 1.4rem; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; font-size: 1.3rem; user-select: all; }
.profile { display: flex; align-items: center; gap: 14px; padding: 18px; }
.profile .l { display: flex; flex-direction: column; min-width: 0; }
.profile b { font-size: 1.15rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ================= 液态玻璃 ================= */
body { background: transparent; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--wall); pointer-events: none; }
.card, .tile, .group, .iconbtn, .chip, .btn:not(.primary), .profile {
  background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--edge); box-shadow: inset 0 1px 0 var(--hi), var(--shadow); }
.group.profile { border-radius: var(--r); }
.btn { border-radius: 99px; }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:active { opacity: .85; background: var(--text); }
.chip, .iconbtn { box-shadow: inset 0 1px 0 var(--hi), 0 4px 14px rgba(0, 0, 0, .06); }
.sheet .group { background: var(--sheet); box-shadow: inset 0 1px 0 var(--hi), 0 20px 50px rgba(0, 0, 0, .25); border-radius: 26px; }
.sheet-bg { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.grad, .grad.over { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--text); }
.grad.over { color: var(--neg); }
.big { font-weight: 600; letter-spacing: -.03em; }
.big .cur { color: var(--text-2); font-weight: 500; }
.tile .v { font-weight: 600; }
.tile .v .cur { color: var(--text-2); }
.yearbar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 4px 0 12px; }
.yearbar i { display: block; height: 100%; border-radius: 99px; background: var(--text); opacity: .85; }
.hero .line { justify-content: space-between; color: var(--text-2); font-size: .95rem; }
.hero .line b, .hero .line span[data-testid] { color: var(--text); }
.hero .label small { color: var(--text-3); font-weight: 500; font-size: .8rem; }
.avatar { background: linear-gradient(160deg, #a8a8ae, #7c7c82); }
.logo { background: linear-gradient(160deg, #3a3a3e, #121214); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px rgba(0, 0, 0, .2); }
.ico { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.login .group, .login .card { margin-bottom: 12px; }

/* 底部导航：悬浮的玻璃胶囊 */
.tabbar { left: 50%; right: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  width: min(360px, calc(100% - 44px)); padding: 6px; gap: 4px; border-radius: 99px; border: 1px solid var(--edge); border-top: 1px solid var(--edge);
  background: var(--tabbar); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--hi), 0 12px 34px rgba(0, 0, 0, .14); }
.tabbar a { max-width: none; min-height: 52px; border-radius: 99px; color: var(--text-2); }
.tabbar a.on { background: var(--tab-on); color: var(--accent); }
.shell { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 44px); }
@media (min-width: 900px) {
  .shell { padding: 0 0 0 256px; }
  .tabbar { left: 16px; top: 16px; bottom: 16px; transform: none; width: 224px; border-radius: 28px; padding: 26px 12px; background: var(--tabbar); }
  .tabbar a { border-radius: 14px; color: var(--text); }
  .tabbar a.on { background: var(--tab-on); color: var(--accent); }
}

/* ================= 单据 ================= */
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.pill.warn { background: rgba(255, 159, 10, .16); color: #b25e00; }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.pill.neg { background: rgba(255, 59, 48, .13); color: var(--neg); }
.pill.pos { background: rgba(52, 199, 89, .15); color: var(--pos); }
.pill.mute { background: var(--surface-2); color: var(--text-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.warn { color: #ffb340; } }
:root[data-theme="dark"] .pill.warn { color: #ffb340; }
.rr { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.rr b { font-family: var(--num); font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.ico.round { border-radius: 50%; font-size: .78rem; font-weight: 700; }
.wrap { white-space: pre-wrap; overflow-wrap: anywhere; text-align: right; }
.seg { display: flex; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: 99px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--edge); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 var(--hi); }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { flex: 1 0 auto; text-align: center; padding: 7px 12px; border-radius: 99px; color: var(--text-2); font-size: .86rem; font-weight: 600; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.seg .on { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.seg.in { margin: 0; flex: 1; background: var(--surface-2); border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.upwrap { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.upwrap[hidden] { display: none; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 0; padding: 0; cursor: pointer; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .pdf { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 700; color: var(--text-2); }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.thumb.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: auto; min-width: 76px; padding: 0 12px;
  border: 1.5px dashed var(--text-3); background: transparent; color: var(--accent); }
.thumb.add span { font-size: 1.4rem; line-height: 1; }
.thumb.add small { font-size: .72rem; color: var(--text-2); text-align: center; }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.viewer img { max-width: 100%; max-height: 80vh; border-radius: 12px; }
.viewer .btn { width: auto; padding: 0 22px; }
.ti { position: relative; display: inline-flex; }
.badge { position: absolute; top: -4px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ff3b30; color: #fff;
  font: 700 11px/18px var(--font); font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--surface-solid); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 4px 0 6px; }
.qbtn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px 14px; border-radius: var(--r); color: var(--text); font-weight: 600; font-size: .9rem;
  background: var(--surface); border: 1px solid var(--edge); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 var(--hi), var(--shadow); }
.qi { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); }
.qi svg { width: 22px; height: 22px; }
.note-neg { border-color: rgba(255, 59, 48, .35); }
.note-neg b { color: var(--neg); }
.note-neg p { margin: 6px 0 0; white-space: pre-wrap; }
.navbtns.two { grid-template-columns: 1fr 1fr; }
.navbtns.two .btn { margin-top: 10px; }
.hero.doc .label { margin-bottom: 2px; }
.hero.doc .line { color: var(--text); }
.frow textarea { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; resize: vertical; padding: 6px 0; min-height: 60px; }
.frow textarea:focus { outline: none; }
.frow input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 44px; }
.frow[hidden], .row[hidden] { display: none; }
.frow.bare > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.frow.bare { padding: 4px 18px; }
.upwrap.pair { flex-direction: row; flex-wrap: wrap; }
.row.tier .l { gap: 2px; }
.row.tier .l b { font-size: 1rem; }

/* AI 读票据（第 10 章） */
.ai-note { display: block; font-size: 13px; line-height: 1.4; flex-basis: 100%; overflow-wrap: anywhere; }
.ai-note[hidden] { display: none; }
.row.ai-warn { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
