/* 家当 · 样式 */
:root {
  --accent: #2F7D6D;
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --card2: #F7F7FA;
  --text: #1C1C1E;
  --muted: #8A8A8E;
  --line: rgba(60, 60, 67, .14);
  --exp: #2E9E62;
  --inc: #E5484D;
  --danger: #E5484D;
  --warn: #B7791F;
  --fill: rgba(120, 120, 128, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1C1C1E; --card2: #2C2C2E; --text: #F2F2F7; --muted: #98989F;
    --line: rgba(84, 84, 88, .55); --fill: rgba(120, 120, 128, .24); --exp: #3DBB78; --inc: #FF6369;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1C1C1E; --card2: #2C2C2E; --text: #F2F2F7; --muted: #98989F;
  --line: rgba(84, 84, 88, .55); --fill: rgba(120, 120, 128, .24); --exp: #3DBB78; --inc: #FF6369;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none;
}
input, textarea, select { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 0 calc(16px + var(--safe-b)); overscroll-behavior: contain; }
.loading { text-align: center; color: var(--muted); margin-top: 40vh; }
.spacer { height: 24px; }
.ico { width: 22px; height: 22px; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.strong { font-weight: 600; }
.exp { color: var(--exp); }
.inc { color: var(--inc); }
.accent { color: var(--accent); }
.danger-text { color: var(--danger) !important; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pad { padding: 12px 16px; }
.pad0 { padding: 0; }
.strike { text-decoration: line-through; }

/* ---------- 顶栏 ---------- */
.hdr { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: calc(6px + var(--safe-t)) 8px 6px; min-height: 48px; background: var(--bg); position: relative; z-index: 2; }
.hl, .hr { display: flex; align-items: center; gap: 2px; }
.hr { justify-content: flex-end; }
.ht { text-align: center; min-width: 0; }
.htt { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.hts { font-size: 12px; color: var(--muted); }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); }
.iconbtn.on { background: var(--fill); }
.iconbtn.sm { width: 32px; height: 32px; }
.iconbtn.flip .ico { transform: scaleX(-1); }
.iconbtn:disabled { opacity: .3; }
.link { color: var(--accent); padding: 8px; font-size: 16px; }
.link.small { font-size: 14px; padding: 4px 6px; }
.bookbtn { display: flex; align-items: center; gap: 4px; font-size: 17px; font-weight: 600; padding: 6px 8px; }
.bookbtn .ico { width: 16px; height: 16px; color: var(--muted); }

/* ---------- 卡片 / 列表 ---------- */
.card { background: var(--card); border-radius: var(--radius); margin: 8px 12px; box-shadow: var(--shadow); overflow: hidden; }
.card.pad { padding: 14px 16px; }
.list .row + .row, .list .txn + .txn, .list .row + .txn, .list .txn + .row { border-top: .5px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 50px; }
.row.tap:active, .txn.tap:active, .frow.tap:active { background: var(--fill); }
.row.sel, .txn.sel { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ric { flex: none; display: grid; place-items: center; }
.mic { font-size: 22px; width: 32px; text-align: center; }
.rmain { flex: 1; min-width: 0; }
.rt { font-size: 16px; }
.rs { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rr { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.rr.two { display: flex; flex-direction: column; font-size: 14px; }
.chev { color: var(--muted); opacity: .6; }
.chev .ico { width: 16px; height: 16px; }
.chev.on { color: var(--accent); opacity: 1; }
.sublabel { font-size: 13px; color: var(--muted); padding: 14px 18px 2px; }
.sectionhead { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 0; }
.empty { text-align: center; color: var(--muted); padding: 48px 24px; }
.emptyic { font-size: 40px; margin-bottom: 8px; }
.badge { display: inline-grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--c) 18%, transparent); flex: none; line-height: 1; }
.badge.addb { background: var(--fill); width: 44px; height: 44px; font-size: 20px; color: var(--muted); }
.pill { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--fill); color: var(--muted); margin-left: 6px; vertical-align: 2px; font-weight: 500; }
.pill.inuse { background: color-mix(in srgb, #2F80ED 16%, transparent); color: #2F80ED; }
.pill.stock { background: color-mix(in srgb, #F2994A 18%, transparent); color: #C26B15; }
.pill.amortize { background: color-mix(in srgb, #9B51E0 16%, transparent); color: #9B51E0; }
.pill.auto { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.pill.reimb { background: color-mix(in srgb, #E5484D 14%, transparent); color: #E5484D; }

/* ---------- 流水行 ---------- */
.txn { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 58px; }
.tmain { flex: 1; min-width: 0; }
.tt { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ta { flex: none; text-align: right; font-size: 16px; font-variant-numeric: tabular-nums; font-weight: 500; }
.ta small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.ta.muted { color: var(--muted); }
.dgroup { margin-top: 6px; }
.dhead { display: flex; justify-content: space-between; padding: 8px 18px 0; font-size: 13px; color: var(--muted); }
.dgroup .card { margin-top: 4px; }
.cbox { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; }
.cbox.on { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--card); }

/* ---------- 首页 ---------- */
.hero { margin: 8px 12px; padding: 16px 18px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000)); }
.herotop { display: flex; justify-content: space-between; align-items: center; font-size: 14px; opacity: .92; }
.heronum { font-size: 34px; font-weight: 700; margin: 6px 0 10px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.herorow { display: flex; gap: 20px; }
.herorow div { display: flex; flex-direction: column; }
.herorow small { font-size: 12px; opacity: .8; }
.herorow b { font-variant-numeric: tabular-nums; }
.gtiles { display: grid; grid-template-columns: repeat(3, 1fr); }
.gtile { padding: 12px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; border-left: .5px solid var(--line); }
.gtile:first-child { border-left: 0; }
.gtile b { font-size: 16px; font-variant-numeric: tabular-nums; }
.gtile small { font-size: 12px; color: var(--muted); }
.gtile.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.gtile.on small:first-child { color: var(--accent); font-weight: 600; }
.banner { margin: 8px 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); font-size: 14px; }
.banner.warn { background: color-mix(in srgb, #F2C94C 25%, var(--card)); }
.sumrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); padding: 12px 6px; text-align: center; }
.sumrow div { display: flex; flex-direction: column; }
.sumrow small { color: var(--muted); font-size: 12px; }
.sumrow b { font-variant-numeric: tabular-nums; font-size: 16px; }
.bignum { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0; }
.bignum.sm { font-size: 22px; margin: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; border-top: .5px solid var(--line); }
.kv:first-of-type { margin-top: 8px; }
.kv span { color: var(--muted); }
.actions { display: flex; gap: 8px; padding: 4px 12px; flex-wrap: wrap; }
.actions .btn { flex: 1; min-width: 30%; }
.legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }

/* ---------- 按钮、分段、开关 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 12px; font-size: 16px; font-weight: 500; background: var(--card); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--fill); }
.btn.soft { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { display: flex; width: calc(100% - 24px); margin: 10px 12px; }
.btn.small { height: 32px; font-size: 14px; padding: 0 12px; }
.btn.round { width: 44px; padding: 0; border-radius: 50%; font-size: 22px; background: var(--fill); }
.btn:disabled { opacity: .4; }
.btn:active { opacity: .7; }
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { flex: 1; height: 32px; border-radius: 8px; font-size: 14px; color: var(--text); white-space: nowrap; padding: 0 6px; }
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
.seg.sm button { height: 30px; font-size: 13px; }
.seg.xs { display: inline-flex; }
.seg.xs button { height: 28px; font-size: 13px; padding: 0 10px; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--fill); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; left: 2px; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch.on { background: #34C759; }
.switch.on i { transform: translateX(20px); }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--fill); font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--accent); color: #fff; }
.chip.light { background: rgba(255, 255, 255, .22); color: #fff; height: 28px; font-size: 13px; }
.chip.add { color: var(--accent); background: transparent; border: 1px dashed var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 12px; }
.chipwrap { display: inline-flex; align-items: center; }
.chipx { margin-left: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--fill); font-size: 14px; }
.pbar { height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; margin: 8px 0 6px; }
.pbar i { display: block; height: 100%; border-radius: 3px; }
.colors { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.cdot { width: 30px; height: 30px; border-radius: 50%; display: inline-block; }
.cdot.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--text); }
.cdot.sm { width: 18px; height: 18px; vertical-align: middle; }

/* ---------- 表单 ---------- */
.input { width: 100%; height: 44px; border-radius: 10px; border: 0; background: var(--card); color: var(--text); padding: 0 12px; font-size: 16px; outline: none; }
.input.center { text-align: center; }
.input.big { font-size: 22px; font-weight: 600; width: 90px; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 12px; }
.twocol .input, .lbody > .input { background: var(--card2); }
.lbody > .input { margin: 6px 0; }
.fields .frow + .frow, .fields .frow + .subfields { border-top: .5px solid var(--line); }
.frow { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 50px; width: 100%; text-align: left; }
.frow.col { flex-direction: column; align-items: stretch; padding: 10px 14px; gap: 8px; }
.frow.col .seg { width: 100%; }
.frowhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fl { flex: none; color: var(--text); font-size: 15px; }
.fv { flex: 1; text-align: right; min-width: 0; color: var(--text); display: flex; justify-content: flex-end; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.fv span { overflow: hidden; text-overflow: ellipsis; }
.fr { margin-left: auto; }
.finput { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 16px; text-align: right; outline: none; height: 44px; padding: 0; font-family: inherit; }
.finput::placeholder, .input::placeholder { color: var(--muted); }
select.finput { -webkit-appearance: none; appearance: none; text-align-last: right; }
textarea.finput { height: auto; min-height: 24px; resize: none; padding: 13px 0; line-height: 1.4; text-align: left; }
.frow.note { align-items: flex-start; }
.frow.note .fl { padding-top: 14px; }
.finput.qty { flex: 0 0 56px; text-align: center; background: var(--fill); border-radius: 8px; height: 34px; }
.finput.unit { flex: 0 0 52px; text-align: center; background: var(--fill); border-radius: 8px; height: 34px; }
.finput.tiny { flex: 0 0 60px; text-align: center; background: var(--fill); border-radius: 8px; height: 34px; }
.finput.emoji { flex: 0 0 56px; text-align: center; font-size: 22px; background: var(--fill); border-radius: 8px; height: 40px; }
input[type="date"].finput, input[type="datetime-local"].finput { text-align: right; -webkit-appearance: none; appearance: none; min-height: 34px; }
.subfields { padding: 2px 0 6px; display: flex; flex-direction: column; }
.sf { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; font-size: 14px; }
.sf > span:first-child { color: var(--muted); }
.sf .finput { font-size: 15px; height: 38px; }
.inline { display: flex; align-items: center; gap: 8px; }
.morebtn { justify-content: center; color: var(--accent); font-size: 14px; gap: 4px; }
.morebtn .ico { width: 16px; height: 16px; }
.photos { padding: 10px 14px; align-items: flex-start; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex: 1; }
.thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; position: relative; background: var(--fill); display: grid; place-items: center; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; line-height: 20px; }
.note-line { display: block; margin: 0 16px 6px; font-size: 13px; color: var(--muted); text-align: center; width: calc(100% - 32px); }
.note-line.link { color: var(--accent); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 0 6px; flex-wrap: wrap; }

/* ---------- 流水页 ---------- */
.pnav { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.ptitle { font-size: 16px; font-weight: 600; padding: 8px; }
.searchbar { display: flex; gap: 8px; align-items: center; padding: 4px 12px 8px; }
.searchbar .input { background: var(--card); height: 38px; }
.filterbar { display: flex; align-items: center; gap: 4px; margin: 4px 12px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); font-size: 13px; }
.filterbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selbar { display: flex; gap: 4px; align-items: center; padding: 8px 10px calc(8px + var(--safe-b)); background: var(--card); border-top: .5px solid var(--line); font-size: 14px; }
.selbar span { flex: 1; color: var(--muted); }
.selbar button { padding: 8px 8px; color: var(--accent); }
.calendar { padding: 8px; }
.cweek, .cgrid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cweek span { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.cday { min-height: 54px; display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-radius: 10px; gap: 1px; }
.cday.off { visibility: hidden; }
.cday .cn { font-size: 15px; }
.cday .ce { font-size: 10.5px; color: var(--exp); }
.cday .ci { font-size: 10.5px; color: var(--inc); }
.cday.today .cn { color: #fff; background: var(--accent); border-radius: 50%; width: 24px; height: 24px; line-height: 24px; text-align: center; }
.cday.on { background: var(--fill); }

/* ---------- 弹出层 ---------- */
#layers .layer { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.layer .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.layer .panel { position: relative; background: var(--bg); border-radius: 16px 16px 0 0; max-height: 88vh; display: flex; flex-direction: column; padding-bottom: var(--safe-b); }
.layer.tall .panel { height: 88vh; }
.layer.enter .panel { animation: up .22s ease-out; }
.layer.enter .scrim { animation: fade .22s ease-out; }
@keyframes up { from { transform: translateY(40%); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.layer.full { justify-content: stretch; }
.layer.full .scrim { display: none; }
.layer.full .panel { height: 100%; max-height: none; border-radius: 0; padding-top: var(--safe-t); padding-bottom: 0; }
.layer.dlg { justify-content: center; align-items: center; }
.layer.dlg .panel { border-radius: 16px; width: min(320px, 86vw); padding: 0; background: var(--card); }
.layer.as { justify-content: flex-end; }
.layer.as .panel { background: transparent; padding: 0 8px calc(8px + var(--safe-b)); }
.lhead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 8px; font-size: 17px; }
.lhead > :last-child { justify-self: end; }
.lhead b { font-weight: 600; text-align: center; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbody { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 0 16px; flex: 1; min-height: 0; }
.lbody > p, .lbody > .seg, .lbody > .card, .lbody > .list { margin-left: 12px; margin-right: 12px; }
.lbody > .seg { margin-bottom: 8px; }
.lbody > .card.fields { margin: 8px 12px; }
.lbody > .list { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.lpad { padding: 0 12px 8px; }
.lpad .input { background: var(--card); }
.dialog { padding: 18px 16px 12px; }
.dtitle { font-weight: 600; font-size: 17px; text-align: center; }
.dmsg { color: var(--muted); font-size: 14px; text-align: center; margin-top: 6px; }
.dialog .input { margin-top: 14px; background: var(--card2); }
.dbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.actionsheet { display: flex; flex-direction: column; gap: 8px; }
.astitle { background: var(--card); border-radius: 14px 14px 0 0; margin-bottom: -8px; padding: 12px 16px; text-align: center; font-size: 13px; color: var(--muted); border-bottom: .5px solid var(--line); }
.asgroup { background: var(--card); border-radius: 14px; overflow: hidden; max-height: 60vh; overflow-y: auto; }
.astitle + .asgroup { border-radius: 0 0 14px 14px; }
.asbtn { display: block; width: 100%; min-height: 54px; padding: 10px 16px; font-size: 17px; color: var(--accent); text-align: center; }
.asbtn small { display: block; font-size: 12px; color: var(--muted); }
.asbtn + .asbtn { border-top: .5px solid var(--line); }
.asbtn.danger { color: var(--danger); }
.asbtn.cancel { background: var(--card); border-radius: 14px; font-weight: 600; }
body.has-layer #screen .body { overflow: hidden; }

/* ---------- 分类选择 ---------- */
.toprow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 12px 8px; scrollbar-width: none; }
.toprow::-webkit-scrollbar { display: none; }
.topchip { flex: none; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--card); font-size: 14px; white-space: nowrap; }
.topchip.on { background: var(--accent); color: #fff; }
.crumbs { display: flex; align-items: center; gap: 2px; padding: 0 12px 6px; overflow-x: auto; white-space: nowrap; font-size: 14px; }
.crumb { padding: 4px 6px; border-radius: 6px; color: var(--accent); }
.crumb.on { color: var(--text); font-weight: 600; }
.sep { color: var(--muted); }
.catgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; padding: 10px 8px; }
.catcell { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; padding: 4px 0; border-radius: 12px; }
.catcell .cn { font-size: 13px; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.catcell .more { position: absolute; top: 2px; right: 10px; font-size: 14px; color: var(--muted); }
.catcell.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cattree .row { padding-left: 6px; }
.cattree .depth2 { padding-left: 24px; background: var(--card2); }
.cattree .depth3 { padding-left: 42px; background: var(--card2); }
.cattree .depth4 { padding-left: 60px; background: var(--card2); }
.tw { width: 22px; height: 22px; flex: none; color: var(--muted); font-size: 18px; transition: transform .15s; }
.tw.open { transform: rotate(90deg); }

/* ---------- 记一笔 ---------- */
.ehead { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 6px; padding: 6px 8px; }
.ehead .seg button { font-size: 14px; }
.ehead > :last-child { justify-self: end; }
.ebody { padding-top: 4px; }
.amount { display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; padding: 12px 20px 0; font-variant-numeric: tabular-nums; }
.amount .cur { font-size: 22px; color: var(--muted); }
.amount .num { font-size: 40px; font-weight: 600; letter-spacing: -.5px; word-break: break-all; text-align: right; }
.amount.exp .num { color: var(--exp); }
.amount.inc .num { color: var(--inc); }
.amount-sub { text-align: right; padding: 0 20px 6px; min-height: 20px; color: var(--muted); font-size: 14px; }
.ebtns { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; padding: 6px 12px; }
.keypad { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--card2) 94%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); padding: 8px 6px calc(8px + var(--safe-b)); border-top: .5px solid var(--line); }
.kprow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 6px; }
.key { height: 52px; border-radius: 10px; background: var(--card); font-size: 22px; font-weight: 500; display: grid; place-items: center; box-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
.key:active { background: var(--fill); }
.key.fn { background: var(--fill); font-size: 22px; }
.key.ok { background: var(--accent); color: #fff; font-size: 18px; }
.key .ico { width: 24px; height: 24px; }
.kphide { position: absolute; top: -30px; right: 8px; width: 40px; height: 26px; border-radius: 8px 8px 0 0; background: color-mix(in srgb, var(--card2) 94%, transparent); display: grid; place-items: center; color: var(--muted); }
.kphide .ico { width: 18px; height: 18px; }

/* ---------- 底部导航 ---------- */
#tabbar { display: flex; align-items: stretch; background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: .5px solid var(--line); padding-bottom: var(--safe-b); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; font-size: 10.5px; color: var(--muted); }
.tab .ico { width: 24px; height: 24px; }
.tab.on { color: var(--accent); }
.tab.add { color: var(--accent); }
.tab.add .plus { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin-top: -14px; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 45%, transparent); }
.tab.add .plus .ico { width: 24px; height: 24px; stroke-width: 2.4; }

/* ---------- 提示 / 锁屏 / 其他 ---------- */
#toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: rgba(30, 30, 32, .92); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 999; max-width: 86vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#lock { display: none; }
#lock.on { display: flex; position: fixed; inset: 0; z-index: 1000; background: var(--bg); align-items: center; justify-content: center; }
.lockbox { text-align: center; width: 280px; }
.lockic { font-size: 40px; }
.locktitle { margin: 10px 0 16px; }
.dots { display: flex; gap: 14px; justify-content: center; margin-bottom: 24px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--text); }
.dots i.on { background: var(--text); }
.lockpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lockpad button { height: 64px; border-radius: 50%; background: var(--fill); font-size: 26px; width: 64px; margin: 0 auto; }
.lockok { margin-top: 18px; color: var(--accent); padding: 10px 20px; }
.updatebar { position: fixed; left: 12px; right: 12px; top: calc(8px + var(--safe-t)); z-index: 998; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.updatebar button { color: #fff; text-decoration: underline; font-weight: 600; }
.prose h3 { font-size: 16px; margin: 14px 0 4px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart.donut { width: 210px; height: 210px; margin: 0 auto; }
.chart .dc1 { font-size: 12px; fill: var(--muted); }
.chart .dc2 { font-size: 17px; font-weight: 700; fill: var(--text); }
.chart .axl { font-size: 10px; fill: var(--muted); }
.chart .axl.hl { fill: var(--text); font-weight: 600; }
.chart .axv { font-size: 10px; fill: var(--muted); }
.chart.bars, .chart.line { height: 180px; margin-top: 8px; }
