:root {
  --bg: #fbf2e8;
  --surface: #fffaf3;
  --surface-2: #f5e9da;
  --text: #3c3027;
  --text-2: #7d6c5d;
  --text-3: #ab9784;
  --line: #ecdfce;
  --primary: #c8743e;
  --primary-soft: #fbe6d6;
  --up: #d2603f;
  --down: #5a9367;
  --amber: #c98a2b;
  --coral: #c25a3a;
  --green: #6b8a3a;
  --radius: 14px;
  --nav-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.header-inner {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.header-title { font-size: 17px; font-weight: 600; flex: 1; }
.header-date { font-size: 12px; color: var(--text-3); margin-right: 8px; }
.header-menu-btn { background: rgba(0,0,0,.06); border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 20px; cursor: pointer; padding: 0; line-height: 1; transition: background .15s; }
.header-menu-btn:hover { background: rgba(0,0,0,.12); }
.header-menu { position: absolute; top: 50px; right: 14px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; z-index: 100; min-width: 200px; }
.header-menu button { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text, #333); }
.header-menu button:hover { background: rgba(0,0,0,.06); }
.header-inner { position: relative; }

/* Main */
.app-main {
  overflow: visible;
  padding: 14px 14px calc(var(--nav-h) + var(--safe-b) + 16px);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 移动端记账：min-height:100vh + 明细列表 flex 填满，消除内容短时的下方空白；
   桌面端由下方 @media(min-width:680px) 内的 grid 接管（源序在后，自动覆盖 display）。 */
.tab-panel.active[data-tab="ledger"] { min-height: 100vh; display: flex; flex-direction: column; }
.tab-panel.active[data-tab="ledger"] .ledger-pos-detail { display: flex; flex-direction: column; min-height: 0; }
.tab-panel.active[data-tab="ledger"] .ledger-pos-detail { border-color: var(--primary); border-width: 2px; box-shadow: 0 4px 16px rgba(31,94,122,.10); background: var(--surface); }
  .tab-panel.active[data-tab="ledger"] .ledger-pos-detail .block-title { font-size: 15px; }
  .tab-panel.active[data-tab="ledger"] .ledger-pos-detail .ledger-list { flex: 1 1 auto; min-height: 220px; overflow-y: auto; }

/* Cards / blocks */
.hero-card {
  background: linear-gradient(135deg, #20494f, #1f5e7a);
  color: #fff;
  border-radius: 18px;
  padding: 18px 18px;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(31, 94, 122, 0.18);
}
.hero-greet { font-size: 19px; font-weight: 600; }
.hero-sub { font-size: 12px; opacity: .85; margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--line);
}
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-value { font-size: 20px; font-weight: 600; margin-top: 6px; }
.stat-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.block-title { font-size: 14px; font-weight: 600; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 13px; padding: 4px 2px; }
  .link-btn.on { color: var(--coral); font-weight: 700; }

/* 内嵌记一笔小卡片（紧凑版：全功能 5 字段 + 计算器/账户/历史常用） */
.inline-form {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px;
}
.inline-form-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.inline-form-title { font-size: 14px; font-weight: 600; }
.inline-form-hint { font-size: 11px; color: var(--text-3); }
.inline-form-body { display: flex; flex-direction: column; gap: 6px; }
.inline-form .seg { display: flex; background: var(--surface-2); border-radius: 8px; padding: 2px; }
.inline-form .seg button { flex: 1; padding: 5px 0; font-size: 12px; border: none; background: none; border-radius: 6px; color: var(--text-2); }
.inline-form .seg button.on { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.inline-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 6px; align-items: start; }
.inline-form .field label { display: block; font-size: 11px; color: var(--text-2); margin-bottom: 2px; }
.inline-form .field input[type="date"],
.inline-form .field input[type="text"],
.inline-form .field input:not([type]) {
  width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; background: var(--bg); color: var(--text); box-sizing: border-box;
}
.inline-form .amt-row { display: flex; gap: 4px; align-items: center; }
.inline-form .amt-row input { flex: 1; min-width: 0; }
.inline-form .calc-btn { width: 26px; height: 26px; flex-shrink: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; font-size: 13px; cursor: pointer; }
.inline-form .calc-box { background: var(--surface-2); border-radius: 8px; padding: 6px; margin-top: 5px; }
.inline-form .cat-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.inline-form .cat-pick .cat-chip { padding: 3px 8px; font-size: 11px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; color: var(--text-2); cursor: pointer; }
.inline-form .cat-pick .cat-chip.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); font-weight: 600; }
.inline-form .hist-pick { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 3px; }
.inline-form .hist-pick .hist-label { font-size: 11px; color: var(--text-3); align-self: center; margin-right: 2px; }
.inline-form .hist-pick .hist-chip { padding: 2px 7px; font-size: 11px; border: 1px dashed var(--line); background: var(--surface-2); border-radius: 10px; color: var(--text-3); cursor: pointer; }
.inline-form .hist-pick .hist-chip.on { color: var(--primary); border-style: solid; border-color: var(--primary); }
.inline-form .inline-ok { width: 100%; padding: 7px 0; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.inline-form .inline-ok:active { opacity: 0.85; }

/* News */
.aggreg-card { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.aggreg-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.aggreg-row { display: flex; gap: 10px; }
.aggreg-item { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 10px; font-size: 13px; text-decoration: none; color: var(--text); }
.aggreg-dot { width: 8px; height: 8px; border-radius: 50%; }

.news-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.news-meta { font-size: 12px; color: var(--text-3); }
.refresh-btn { background: var(--primary-soft); color: var(--primary); border: none; border-radius: 20px; padding: 6px 14px; font-size: 13px; }
.news-section { margin-bottom: 12px; }
.news-item { display: flex; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: none; }
.news-time { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 42px; padding-top: 1px; }
.news-text { font-size: 14px; line-height: 1.55; }
.news-item.important .news-text { color: var(--up); font-weight: 500; }
.news-badge { display:inline-block; font-size: 10px; color: #fff; background: var(--up); border-radius: 4px; padding: 0 4px; margin-right: 6px; vertical-align: 1px; }
.news-sec-title { font-size: 12px; color: var(--text-2); font-weight: 600; margin: 6px 2px 2px; }
.news-mini .news-item { padding: 9px 2px; }

/* Summary (ledger/side) */
.summary-card { display: flex; background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding: 16px 8px; margin-bottom: 14px; }
.sum-item { flex: 1; text-align: center; border-right: 1px solid var(--line); }
.sum-item:last-child { border-right: none; }
.sum-label { font-size: 12px; color: var(--text-2); }
.sum-value { font-size: 18px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }

.cat-bars { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.cat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.cat-row:last-child { margin-bottom: 0; }
.cat-name { width: 56px; font-size: 12px; color: var(--text-2); }
.cat-track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.cat-fill { height: 100%; background: var(--primary); border-radius: 4px; }
.cat-amt { width: 70px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Ledger list */
.ledger-list, .plan-list, .log-list, .side-list { display: flex; flex-direction: column; }
  /* 桌面端 row 2 两列（左记一笔 / 右明细）时明细行要更紧凑 */
  .ledger-pos-detail .led-row { padding: 10px 4px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: flex-start; }
  .ledger-pos-detail .led-row:last-child { border-bottom: none; }
  .ledger-pos-detail .led-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 19px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.08); flex-shrink: 0; margin-top: 2px; }
  .ledger-pos-detail .led-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .ledger-pos-detail .led-primary { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ledger-pos-detail .led-sub { font-size: 12px; color: var(--text-3); line-height: 1.3; display: flex; gap: 6px; align-items: center; }
  .ledger-pos-detail .led-cat { font-weight: 500; color: var(--text-2); }
  .ledger-pos-detail .led-sep { opacity: .5; }
  .ledger-pos-detail .led-date { font-variant-numeric: tabular-nums; opacity: .75; }
  .ledger-pos-detail .led-acc-inline { padding: 1px 8px; background: var(--surface-2); border-radius: 7px; font-size: 12px; color: var(--text-2); font-weight: 500; }
  .ledger-pos-detail .led-acc-empty { color: var(--text-3); font-style: italic; }
  .ledger-pos-detail .led-amt { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; flex-shrink: 0; padding-top: 2px; }
  .ledger-pos-detail .led-amt.in { color: var(--up); }
  .ledger-pos-detail .led-amt.out { color: var(--text); }
  /* 年账本弹窗内：仍用 3 列 grid（竖排在小弹窗里太挤） */
  .yb-month .led-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border-bottom: 1px solid var(--line); }
  .yb-month .led-ico { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
  .yb-month .led-main { display: flex; flex-direction: column; gap: 1px; }
  .yb-month .led-primary { font-size: 13px; font-weight: 600; }
  .yb-month .led-sub { font-size: 11px; color: var(--text-3); }
  .yb-month .led-amt { font-size: 14px; }
  .yb-month .led-row:last-child { border-bottom: 1px solid var(--line); }

/* Fitness */
.streak-card { background: linear-gradient(135deg, #993c1d, #c25a2e); color: #fff; border-radius: 18px; padding: 20px; text-align: center; margin-bottom: 14px; }
.streak-num { font-size: 38px; font-weight: 700; line-height: 1; }
.streak-label { font-size: 12px; opacity: .9; margin-top: 6px; }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding: 6px 2px; }
.trend-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-fill { width: 70%; background: var(--coral); border-radius: 5px 5px 0 0; min-height: 3px; transition: height .3s; }
.trend-fill.empty { background: var(--surface-2); }
.trend-day { font-size: 10px; color: var(--text-3); margin-top: 5px; }
.plan-row { display: flex; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.plan-row:last-child { border-bottom: none; }
.plan-check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); margin-right: 11px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; flex-shrink: 0; }
.plan-check.done { background: var(--green); border-color: var(--green); }
.plan-main { flex: 1; }
.plan-name { font-size: 14px; }
.plan-name.done { color: var(--text-3); text-decoration: line-through; }
.plan-meta { font-size: 11px; color: var(--text-3); }
.log-row { display: flex; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-row:last-child { border-bottom: none; }
.log-name { flex: 1; }
.log-date { color: var(--text-3); font-size: 12px; }

/* Side */
.side-row { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.side-row:last-child { border-bottom: none; }
.side-top { display: flex; justify-content: space-between; align-items: center; }
.side-name { font-size: 14px; font-weight: 500; }
.side-net { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.side-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; display: flex; gap: 12px; }

/* Quick grid */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-item { background: var(--surface-2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.quick-ico { font-size: 18px; }
.quick-label { font-size: 13px; font-weight: 500; }
.quick-sub { font-size: 11px; color: var(--text-3); }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: calc(var(--nav-h) + var(--safe-b));
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 30;
  padding-bottom: var(--safe-b);
}
.nav-btn {
  flex: 1; background: none; border: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-3); font-size: 11px; padding: 0;
}
.nav-btn.active { color: var(--primary); }
.nav-ico { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Sheet */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: none; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheet-mask.show { display: flex; }
.sheet {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: 18px 18px 0 0; padding: 16px 16px calc(20px + var(--safe-b));
  max-height: 86vh; overflow-y: auto; animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%);} to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head span { font-size: 16px; font-weight: 600; }
.sheet-close { background: none; border: none; font-size: 18px; color: var(--text-3); }
.sheet-body { display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--text-2); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 14px;
  background: var(--surface); color: var(--text); font-family: inherit;
}
.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; border: none; background: none; padding: 9px; border-radius: 8px; font-size: 14px; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sheet-ok { background: var(--primary); color: #fff; border: none; border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 600; margin-top: 4px; }
.cat-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip { border: 1px solid var(--line); border-radius: 18px; padding: 7px 13px; font-size: 13px; background: var(--surface); }
.cat-chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 30px); transform: translateX(-50%);
  background: rgba(28,32,36,.92); color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 60; white-space: nowrap;
}
.toast.show { opacity: 1; }

.empty-tip { text-align: center; color: var(--text-3); font-size: 13px; padding: 24px 0; }
.empty-tip::before, .dt-empty::before {
  content: ""; display: block; width: 32px; height: 32px; margin: 0 auto 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='15' rx='4.5' ry='3.6' fill='%23c8743e'/%3E%3Cellipse cx='5.5' cy='9' rx='1.9' ry='2.4' fill='%23c8743e'/%3E%3Cellipse cx='9.5' cy='5.5' rx='1.7' ry='2.3' fill='%23c8743e'/%3E%3Cellipse cx='14.5' cy='5.5' rx='1.7' ry='2.3' fill='%23c8743e'/%3E%3Cellipse cx='18.5' cy='9' rx='1.9' ry='2.4' fill='%23c8743e'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .5;
}

/* Sync bar */
.sync-bar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; transition: background .2s; }
.sync-dot.online { background: #1f9d55; box-shadow: 0 0 0 3px rgba(31,157,85,.18); }
.sync-dot.offline { background: #d98300; }
.sync-text { flex: 1; font-size: 13px; color: var(--text-2); }
.sync-act { font-size: 12px; color: var(--primary); background: none; border: 1px solid var(--line); border-radius: 14px; padding: 5px 10px; cursor: pointer; }
.sync-gear { font-size: 15px; color: var(--text-2); background: none; border: none; padding: 4px 6px; cursor: pointer; }
.sync-meta { font-size: 11px; color: var(--text-3); margin: -8px 0 14px 2px; }
  /* v20260831.1：顶部同步状态指示器 + 可展开诊断条（此前 HTML 中元素丢失导致静默失效） */
  .sync-indicator { display: flex; align-items: center; gap: 5px; margin-right: 8px; padding: 4px 8px; border-radius: 14px; cursor: pointer; user-select: none; transition: background .15s; }
  .sync-indicator:hover { background: rgba(0,0,0,.06); }
  .sync-indicator .sync-text { font-size: 11.5px; color: var(--text-2); white-space: nowrap; flex: none; }
  .header-inner .sync-meta { display: block; font-size: 10.5px; color: var(--text-3); background: rgba(0,0,0,.04); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; margin: 6px 0 0; line-height: 1.5; word-break: break-all; }
  @media (max-width: 560px) { .sync-indicator .sync-text { display: none; } .sync-indicator { padding: 6px; } }

/* Budget */
.budget-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.budget-card.warn { border-color: var(--amber); }
.budget-card.over { border-color: var(--up); }
.budget-top { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.budget-bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.budget-fill { height: 100%; background: var(--primary); border-radius: 5px; transition: width .3s; }
.budget-card.warn .budget-fill { background: var(--amber); }
.budget-card.over .budget-fill { background: var(--up); }
.budget-meta { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.budget-card.warn .budget-meta { color: var(--amber); }
.budget-card.over .budget-meta { color: var(--up); }
.link-inline { color: var(--primary); }

/* Accounts */
.acc-summary { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.acc-summary b { color: var(--text); font-size: 15px; }
.acc-list { display: flex; flex-direction: column; }
.acc-row { display: flex; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color 0.15s; }
.acc-row:last-child { border-bottom: none; }
.acc-row:hover { background-color: var(--surface-2); }
.acc-row:active { background-color: var(--line); }
.acc-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 11px; flex-shrink: 0; }
.acc-main { flex: 1; min-width: 0; }
.acc-name { font-size: 14px; }
.acc-type { font-size: 11px; color: var(--text-3); }
.acc-bal { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-x {
  width: 26px; height: 26px; border: none; background: transparent;
  color: var(--text-3); font-size: 20px; line-height: 1;
  margin-left: 10px; border-radius: 50%; cursor: pointer;
  opacity: 0.45; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.acc-row:hover .acc-x { opacity: 0.85; }
.acc-x:hover { background: var(--up); color: #fff; opacity: 1; }
.acc-x:active { transform: scale(0.92); }

/* Over-budget + delete */
.cat-fill.over { background: var(--up); }
.cat-amt.over { color: var(--up); }
.sheet-ok.danger { background: var(--up); }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; }
.field.row label { margin: 0; }
.field.row input { width: 120px; text-align: right; }
.del-info { font-size: 14px; line-height: 1.6; }
.del-sub { font-size: 12px; color: var(--text-3); }
.sheet-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; text-align: center; line-height: 1.5; }
.sheet-hint.danger { color: var(--up); }

/* 资讯·自动化聚合器 */
.news-sources { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.news-sources::-webkit-scrollbar { display: none; }
.src-chip {
  flex: 0 0 auto; min-width: 116px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 13px; display: flex; flex-direction: column; gap: 5px; cursor: pointer;
}
.src-chip.active { border-color: var(--primary); background: var(--primary-soft); }
.src-name { font-size: 14px; font-weight: 600; color: var(--text); }
.src-sched { font-size: 11px; color: var(--text-3); }
.src-badge { font-size: 10px; padding: 2px 7px; border-radius: 10px; align-self: flex-start; }
.src-badge.ok { background: rgba(31,157,85,.14); color: #15803d; }
.src-badge.warn { background: rgba(217,131,0,.16); color: #b45309; }
.src-badge.stale { background: var(--surface-2); color: var(--text-3); }

.news-content { padding: 4px 0 8px; }
.poster-wrap { display: flex; flex-direction: column; gap: 10px; }
.poster-img { width: 100%; border-radius: 14px; border: 1px solid var(--line); background: #0f1a2b; }
.poster-actions { display: flex; }
.poster-link { font-size: 13px; color: var(--primary); text-decoration: none; }

.md-body { font-size: 14px; line-height: 1.72; color: var(--text); }
.md-body h1 { font-size: 19px; margin: 4px 0 12px; }
.md-body h2 { font-size: 17px; margin: 18px 0 10px; }
.md-body h3 { font-size: 15px; margin: 16px 0 8px; }
.md-body h4 { font-size: 14px; margin: 14px 0 6px; }
.md-body p { margin: 8px 0; }
.md-body ul, .md-body ol { margin: 8px 0; padding-left: 22px; }
.md-body li { margin: 4px 0; }
.md-body blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--text-2); }
.md-body code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.md-body a { color: var(--primary); }
.md-body hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ============ 健身 Tab 底部扩展 ============ */
/* 记录今日表单 */
.body-form { display: flex; flex-direction: column; gap: 10px; }
.body-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.body-field { display: flex; flex-direction: column; gap: 4px; }
.body-field label { font-size: 12px; color: var(--text-2); }
.body-field label small { color: var(--text-3); font-size: 11px; margin-left: 4px; }
.body-field input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.body-field input:focus { border-color: var(--coral); }
.body-save {
  height: 44px; border: none; border-radius: 22px; background: var(--coral); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 4px;
  box-shadow: 0 2px 8px rgba(153,60,29,.18);
}
.body-save:active { transform: translateY(1px); }

/* 关键指标 */
.body-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.body-kpi-cell {
  background: var(--surface-2); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.body-kpi-cap { font-size: 12px; color: var(--text-2); }
.body-kpi-val { font-size: 20px; font-weight: 600; color: var(--text); }
.body-kpi-val small { font-size: 12px; color: var(--text-2); margin-left: 4px; font-weight: 400; }
.body-kpi-val.up { color: var(--up); }
.body-kpi-val.down { color: var(--down); }
.body-target-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.body-target-field { display: flex; flex-direction: column; gap: 4px; }
.body-target-field label { font-size: 12px; color: var(--text-2); }
.body-target-field input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
}
.body-target-field input:focus { border-color: var(--coral); }
.body-target-btn {
  height: 40px; padding: 0 18px; border: 1px solid var(--coral); background: #fff; color: var(--coral);
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.body-target-btn:active { background: var(--coral); color: #fff; }

/* 健身万年历 */
.cal { padding: 4px 0; }
.cal-nav { font-size: 18px; padding: 2px 10px; }
.cal-weekrow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  font-size: 11px; color: var(--text-3); text-align: center; margin-bottom: 6px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1;
  background: var(--surface-2); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
  border: 1px solid transparent;
}
.cal-cell.empty { background: transparent; cursor: default; }
.cal-cell.has { background: #fff5ef; border-color: #f5d8c5; }
.cal-cell.today { border-color: var(--coral); background: #fff; box-shadow: 0 0 0 1px var(--coral); }
.cal-cell:active { background: #ffece0; }
.cal-day { font-size: 13px; font-weight: 500; color: var(--text); }
.cal-cell.today .cal-day { color: var(--coral); font-weight: 700; }
.cal-marks { display: flex; gap: 2px; margin-top: 2px; }
.cal-mark { width: 6px; height: 6px; border-radius: 50%; }
.cal-mark-leg { background: #d8382e; }
.cal-mark-back { background: #1f5e7a; }
.cal-mark-arm { background: #ba7517; }
.cal-mark-other { background: #5b626b; }

/* 部位多选 chips */
.parts-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 18px;
  font-size: 13px; cursor: pointer; user-select: none;
  background: var(--surface); color: var(--text-2);
}
.chip.on { background: var(--coral); color: #fff; border-color: var(--coral); }
.chip input { display: none; }

/* 弹窗内的时间选择 */
.time-row { display: flex; align-items: center; gap: 10px; }
.time-input {
  flex: 0 0 auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 16px; font-family: inherit; background: #fff; color: var(--text);
  min-width: 120px;
}
.time-hint { font-size: 12px; color: var(--text-3); }

/* 日历格子里显示时间 */
.cal-time { font-size: 10px; color: var(--coral); margin-top: 2px; font-weight: 600; }

/* 月度总结 */
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.summary-stat {
  background: var(--surface-2); border-radius: 10px; padding: 10px 6px;
  text-align: center;
}
.summary-stat .summary-num { font-size: 18px; font-weight: 600; color: var(--text); }
.summary-stat .summary-cap { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.summary-stat .summary-num.down { color: var(--down); }
.summary-stat .summary-num.up { color: var(--up); }
.summary-section-title { font-size: 12px; color: var(--text-2); margin: 12px 0 6px; }
.summary-bars { display: flex; flex-direction: column; gap: 6px; }
.summary-row { display: grid; grid-template-columns: 40px 1fr 56px; align-items: center; gap: 8px; font-size: 12px; }
.summary-label { color: var(--text-2); }
.summary-bar { background: var(--surface-2); border-radius: 4px; height: 8px; overflow: hidden; }
.summary-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.sum-fill-leg { background: #d8382e; }
.sum-fill-back { background: #1f5e7a; }
.sum-fill-arm { background: #ba7517; }
.sum-fill-other { background: #5b626b; }
.summary-num { color: var(--text); text-align: right; font-size: 12px; }
.summary-kcal { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-2); }
.summary-kcal b { color: var(--text); }

/* 经期 */
.period-readout { margin-top: 10px; }
.period-phase {
  background: var(--surface-2); padding: 10px 14px; border-radius: 10px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.period-phase-name { font-size: 14px; font-weight: 600; }
.period-phase-day { font-size: 12px; color: var(--text-2); }
.period-next { font-size: 13px; color: var(--text-2); padding: 0 4px; }
.period-next b { color: var(--text); font-weight: 600; }
.period-ov { font-size: 12px; color: var(--text-2); padding: 4px 4px 0; }
.period-ov b { color: var(--c-purple, #7b5ea7); font-weight: 600; }
.period-logged { font-size: 12px; color: var(--text-2); margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.period-chip { background: var(--primary-soft); color: var(--text); padding: 3px 8px; border-radius: 8px; font-size: 11px; }

/* 记账检索栏 */
.ledger-search { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.ls-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ls-row .ls-kw { flex: 1 1 140px; min-width: 120px; }
.ls-row .ls-cat, .ls-row .ls-type, .ls-row .ls-date, .ls-row .ls-amt {
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 13px;
}
.ls-row .ls-date { width: 130px; }
.ls-row .ls-amt { width: 84px; }
.ls-reset { padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 13px; }
.ls-count { font-size: 12px; color: var(--text-2); align-self: center; }
.led-row.ls-hit .led-main { color: var(--coral); }
.ls-kw, .ls-cat, .ls-type, .ls-date, .ls-amt { font-family: inherit; }
.block-sub { font-size: 12px; color: var(--text-2); font-weight: 400; margin-left: 6px; }

/* 记账本（按年成册） */
  .ledger-books { margin-top: 4px; }
  .yb-shelf { display: flex; gap: 11px; overflow-x: auto; padding: 6px 2px 12px; }
  .yb-shelf::-webkit-scrollbar { height: 6px; }
  .yb-shelf::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
  .yb-book { flex: 0 0 auto; width: 96px; height: 134px; display: flex; border-radius: 3px 9px 9px 3px; overflow: hidden; cursor: pointer; background: var(--surface); box-shadow: 0 3px 10px rgba(0,0,0,.14); transition: transform .15s, box-shadow .15s; position: relative; }
  .yb-book:hover, .yb-book:focus { transform: translateY(-5px); box-shadow: 0 9px 18px rgba(0,0,0,.22); outline: none; }
  .yb-spine { width: 11px; flex: 0 0 11px; background: var(--primary); border-right: 1px solid rgba(255,255,255,.18); box-shadow: inset -2px 0 4px rgba(0,0,0,.18); }
  .yb-cover { flex: 1; padding: 10px 9px; display: flex; flex-direction: column; gap: 5px; background: linear-gradient(170deg, #fbf6e9 0%, #f4ecd4 100%); position: relative; }
  /* 封面右上角细书签 */
  .yb-cover::after { content: ""; position: absolute; top: 0; right: 6px; width: 2px; height: 30%; background: var(--primary); opacity: .35; border-radius: 0 0 2px 2px; }
  .yb-year { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 700; letter-spacing: .5px; color: #2d2418; line-height: 1; text-shadow: 0 1px 0 rgba(255,255,255,.6); cursor: text; }
  .yb-game-title { font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 700; letter-spacing: .5px; color: #5b2b8a; line-height: 1; text-shadow: 0 1px 0 rgba(255,255,255,.6); padding: 4px 0 2px; }
  .yb-meta { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; margin-top: 2px; }
  .yb-meta .yb-out { color: #c45a3a; }
  .yb-meta .yb-in { color: #5e9a6a; }
  .yb-count { margin-top: auto; font-size: 10px; color: #8a7a5a; font-style: italic; }
  /* 五色书脊循环：红橙绿蓝紫 */
  .yb-book:nth-child(5n+1) .yb-spine { background: #c0504d; }
  .yb-book:nth-child(5n+2) .yb-spine { background: #e0962f; }
  .yb-book:nth-child(5n+3) .yb-spine { background: #4f9d69; }
  .yb-book:nth-child(5n+4) .yb-spine { background: #3d7ec8; }
  .yb-book:nth-child(5n+5) .yb-spine { background: #8e6cc0; }

  /* 账本徽标：游戏/未分类/普通 */
  .yb-tag { display: inline-flex; align-items: center; gap: 3px; align-self: flex-start; padding: 2px 7px; font-size: 10px; font-weight: 600; border-radius: 7px; line-height: 1.2; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .yb-tag-game { background: rgba(142,108,192,.16); color: #6a3fa6; }
  .yb-tag-other { background: rgba(74,138,180,.14); color: #3a7aaf; }
  .yb-tag-empty { background: rgba(170,150,90,.13); color: #8a7a4a; }
  /* 游戏账本：紫色书脊 + 米色封面保留 + 紫色徽标 */
  .yb-book-special .yb-cover { background: linear-gradient(170deg, #f1e7f8 0%, #e2d2ed 100%); }
  .yb-book-special .yb-spine { background: #8e6cc0 !important; }
  /* 未分类账本：灰棕色书脊 + 浅灰封面（替代斜纹，不夸张） */
  .yb-book-empty .yb-cover { background: linear-gradient(170deg, #f6f4ef 0%, #e9e3d3 100%); }
  .yb-book-empty .yb-spine { background: #a89878 !important; }
  .yb-book-empty .yb-year { color: #6a5d3a; }
  .yb-book-empty { opacity: 0.88; }

/* 记账本弹窗内：KPI / 检索 / 按月分页 */
.yb-kpi { display: flex; gap: 8px; margin: 2px 0 12px; }
.yb-kpi-item { flex: 1; text-align: center; background: var(--surface-2); border-radius: 10px; padding: 8px 4px; }
.yb-kpi-cap { font-size: 11px; color: var(--text-2); }
.yb-kpi-val { font-size: 14px; font-weight: 700; margin-top: 2px; }
.yb-kpi-val.up { color: var(--up); }
.yb-kpi-val.down { color: var(--down); }
.yb-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.yb-toolbar .ls-kw { flex: 1 1 140px; min-width: 120px; }
.yb-toolbar .ls-type, .yb-toolbar .ls-cat { padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit; }
.yb-list { display: flex; flex-direction: column; gap: 14px; }
.yb-month { background: var(--surface); border-radius: 12px; overflow: hidden; }
.yb-month-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.yb-month-name { font-weight: 700; font-size: 15px; }
.yb-month-meta { display: flex; gap: 10px; font-size: 12px; align-items: center; }
.yb-month-meta .down { color: var(--down); }
.yb-month-meta .up { color: var(--up); }
.yb-month-n { color: var(--text-2); }
.yb-month .led-row { padding-left: 12px; padding-right: 12px; }
.yb-month .led-row:last-child { border-bottom: 1px solid var(--line); }

/* 账本徽标（行级）：游戏紫 / 普通灰 */
  .led-book { display: inline-block; margin-left: 6px; padding: 1px 7px; font-size: 10px; font-weight: 600; border-radius: 8px; background: var(--surface-2); color: var(--text-2); vertical-align: 1px; white-space: nowrap; }
  .led-book.game { background: rgba(142,108,192,.16); color: #7a4ec0; }
  .led-book.empty { background: rgba(170,150,90,.13); color: #8a7a4a; }
  .led-expand-row { padding: 10px 0 4px; text-align: center; border-top: 1px dashed var(--line); }

/* 账本筛选 chip（贴在记账本书架上方） */
.book-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.book-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 14px; font-size: 12px; cursor: pointer; user-select: none; background: var(--surface); color: var(--text-2, #666); transition: all .15s; }
.book-chip:hover { border-color: var(--primary, #c8743e); color: var(--primary, #c8743e); }
.book-chip em { font-style: normal; font-size: 11px; opacity: .7; }
.book-chip.on { background: var(--primary, #c8743e); color: #fff; border-color: var(--primary, #c8743e); }
.book-chip.on em { opacity: .9; }
.book-chip-all { background: #fff; color: var(--text, #333); }

/* 保险区块（嵌入记账 tab） */
.insurance-block { background: linear-gradient(180deg, #fafaf8 0%, var(--surface, #fff) 100%); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.insurance-block .block-title { font-weight: 600; }
.ins-mini-kpi .sum-label { font-size: 11px; }
.ins-mini-kpi .sum-value { font-size: 18px; }
.ins-collapsible summary { cursor: pointer; padding: 6px 8px; background: rgba(0,0,0,.03); border-radius: 6px; font-size: 13px; color: var(--text, #333); list-style: none; user-select: none; }
.ins-collapsible summary::-webkit-details-marker { display: none; }
.ins-collapsible summary::before { content: "▸ "; opacity: .6; }
.ins-collapsible[open] summary::before { content: "▾ "; }
.ins-collapsible[open] summary { margin-bottom: 4px; }

/* 保险 tab */
.ins-list, .ins-log-list, .remind-list { display: flex; flex-direction: column; gap: 10px; }
.ins-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.ins-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ins-title { font-size: 15px; }
.ins-type { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); }
.ins-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.ins-due-row { padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 8px; }
.ins-due-row b { color: var(--text); }
.ins-loan-tag { padding: 1px 7px; border-radius: 7px; background: rgba(229,90,90,.12); color: #c43c3c; font-size: 11px; font-weight: 600; }
.ins-note { color: var(--text-2); font-size: 11px; }
.ins-actions { display: flex; gap: 12px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.ins-log-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ins-log-row:last-child { border-bottom: none; }
.ins-log-main { flex: 1; }
.ins-log-meta { flex: 2; color: var(--text-2); font-size: 12px; }
.ins-log-del { color: var(--text-2); font-size: 12px; }
.remind-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.remind-row:last-child { border-bottom: none; }
.remind-main { display: flex; flex-direction: column; gap: 2px; font-size: 13px; flex: 1; }
.remind-main b { font-size: 14px; }
.remind-meta { font-size: 11px; color: var(--text-2); }
.remind-due { display: flex; align-items: center; gap: 8px; }
.remind-date { font-size: 12px; color: var(--text-2); }
.remind-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; }
.remind-badge.overdue { background: rgba(229,90,90,.15); color: #c43c3c; }
.remind-badge.today { background: rgba(229,159,67,.18); color: #b67215; }
.remind-badge.soon { background: rgba(229,90,90,.12); color: #c43c3c; }
.remind-badge.warn { background: rgba(229,159,67,.14); color: #b67215; }
.remind-badge.ok { background: var(--surface-2); color: var(--text-2); }

/* 年度总结 */
.ann-summary { display: flex; gap: 10px; margin-bottom: 12px; }
.ann-kpi { flex: 1; background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: center; }
.ann-kpi-cap { font-size: 12px; color: var(--text-2); }
.ann-kpi-val { font-size: 15px; font-weight: 700; margin-top: 2px; }
.ann-kpi-val.down { color: var(--up); }
.ann-kpi-val.up { color: var(--down); }
.ann-chart-title { font-size: 13px; font-weight: 600; margin: 14px 0 8px; }
.ann-monthly { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.ann-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.ann-bar { width: 70%; background: linear-gradient(180deg, var(--primary), var(--coral)); border-radius: 4px 4px 0 0; min-height: 2px; }
.ann-bar-cap { font-size: 9px; color: var(--text-2); }
.ann-bar-m { font-size: 10px; color: var(--text-3); }
.ann-cat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 13px; }
.ann-cat-name { width: 72px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann-cat-track { flex: 1; height: 14px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.ann-cat-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--coral)); border-radius: 7px; }
.ann-cat-amt { width: 110px; text-align: right; color: var(--text-2); font-size: 12px; }
.ann-sug { margin: 6px 0 0; padding-left: 18px; color: var(--text); font-size: 13px; }
.ann-sug li { margin-bottom: 6px; }

/* 万年历节日高亮 */
.home-cal .hc-cell.fest .hc-lunar { color: var(--coral); font-weight: 700; }
.home-cal .hc-cell.fest { background: #fff7ec; }

/* 健身月历 经期/排卵着色 */
.cal-cell.p-period { background: #fde7e6 !important; }
.cal-cell.p-period-p { background: #fbeede !important; }
.cal-cell.p-ovulation { background: #efe7f7 !important; }
.cal-cell.p-fertile { background: #eef5ea !important; }
.cal-pd { position: absolute; top: 2px; right: 3px; font-size: 9px; line-height: 1; padding: 1px 3px; border-radius: 6px; color: #fff; }
.cal-pd-period { background: #d8382e; }
.cal-pd-ov { background: #7b5ea7; }
.cal-pd-fer { background: #5a9367; }
.cal-cell { position: relative; }

/* 日志行带部位 */
.log-parts { font-size: 11px; color: var(--text-3); margin-left: 6px; }

/* ===== v20260813.11 增量样式 ===== */

/* 时间分隔符 + 提示 */
.time-sep { font-size: 14px; color: var(--text-2); }

/* 块标题右侧辅助文 */
.block-aux { font-size: 11px; color: var(--text-3); margin-left: auto; }

/* ===== 体重报告 8 项指标 ===== */
.br-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.br-cell {
  background: var(--card-2, #fafafa);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.br-cap { font-size: 11px; color: var(--text-2); }
.br-val { font-size: 18px; font-weight: 600; color: var(--text); line-height: 1.1; }
.br-val small { font-size: 11px; color: var(--text-2); margin-left: 2px; font-weight: 400; }
.br-level { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: var(--line); color: var(--text-2); }
.br-cell.good { border-color: #b8d8a3; background: #f1f9eb; }
.br-cell.good .br-level { background: #3b6d11; color: #fff; }
.br-cell.warn { border-color: #f0c69a; background: #fff6ec; }
.br-cell.warn .br-level { background: #ba7517; color: #fff; }
.br-cell.bad { border-color: #e6a09c; background: #fdeeed; }
.br-cell.bad .br-level { background: #d8382e; color: #fff; }
.br-meta { font-size: 11px; color: var(--text-3); margin-top: 10px; text-align: center; }
.br-advice { margin-top: 12px; background: linear-gradient(135deg, #eef6ff 0%, #f3f0ff 100%); border: 1px solid #d9e6ff; border-radius: 10px; padding: 10px 12px; }
.br-advice-head { font-size: 13px; font-weight: 600; color: #2b4a7a; margin-bottom: 6px; }
.br-advice-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.br-advice-list li { font-size: 12px; color: var(--text); line-height: 1.5; }

/* ===== 智能健康食谱 ===== */
.recipe-head {
  background: linear-gradient(135deg, #fff5eb 0%, #fde2cf 100%);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.recipe-mode { font-size: 14px; font-weight: 600; color: var(--coral); }
.recipe-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.recipe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.recipe-card {
  background: var(--card-2, #fafafa);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.recipe-type {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 4px;
}
.recipe-k { font-size: 10px; font-weight: 500; color: var(--coral); }
.recipe-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.recipe-items li {
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text-2);
}
.recipe-tip {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 10px;
  padding: 6px 10px;
  background: #fff8f0;
  border-radius: 8px;
  line-height: 1.5;
}

/* ===== v20260814.1 数据存储 / 备份 UI ===== */

/* 顶部提示条：克制、低饱和、可关闭 */
.storage-warn {
  display: none;
  margin: 8px 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(28, 32, 36, 0.06);
  font-size: 13px;
  line-height: 1.45;
  animation: sw-in .28s ease;
}
.storage-warn.show { display: block; }
@keyframes sw-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.storage-warn.warn { border-color: #f0c69a; background: #fff7ed; }
.storage-warn.error { border-color: #e6a09c; background: #fdeeed; }
.storage-warn.info { border-color: #bcd2e6; background: #f3f8fd; }
.sw-text { color: var(--text); margin-bottom: 8px; }
.sw-acts { display: flex; gap: 8px; }
.sw-act {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
}
.sw-act.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* 数据管理弹窗 */
.dm-stat {
  text-align: center;
  padding: 18px 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.dm-stat-num {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1;
}
.dm-stat-cap { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.dm-breakdown {
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
  margin-bottom: 14px;
}
.dm-status {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dm-status.ok { background: #f1f9eb; color: #3b6d11; }
.dm-status.bad { background: #fdeeed; color: #d8382e; }
.dm-actions { display: flex; flex-direction: column; gap: 8px; }
.dm-actions .sheet-ok { margin-top: 0; }
.sheet-ok.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.sheet-ok.mini { padding: 4px 10px; font-size: 12px; margin: 0; display: inline-block; }
.hint {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.6;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
}

/* ===== v20260819.1 数据备份 UI 改造 ===== */

/* 顶部常驻条：数据已累计 X 条 + 立即备份到云端 */
.remind-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff7ed, #fdf2e0);
  border: 1px solid #f1d9b1;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(176, 122, 30, 0.08);
  animation: rb-in .32s ease;
}
@keyframes rb-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.remind-bar .rb-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(156, 74, 37, 0.25);
}
.remind-bar .rb-text { flex: 1; min-width: 0; line-height: 1.35; }
.remind-bar .rb-line1 { font-size: 13px; color: var(--text); font-weight: 500; }
.remind-bar .rb-line1 b { color: var(--coral); font-weight: 700; font-size: 14px; padding: 0 2px; }
.remind-bar .rb-line2 { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.remind-bar .rb-acts { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.remind-bar .rb-primary {
  background: var(--coral);
  color: #fff;
  border: 1px solid var(--coral);
  border-radius: 18px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(156, 74, 37, 0.22);
}
.remind-bar .rb-secondary {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* =================== 生活仪表盘 =================== */
.dash-strip {
  display: flex; align-items: center; gap: 10px;
  background: #fbf4e4; border: 1px solid #f0e2c2;
  border-radius: 14px; padding: 12px 14px; margin-bottom: 12px;
}
.ds-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: #c47a2a; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.ds-text { flex: 1; min-width: 0; }
.ds-line1 { font-size: 13px; color: #5b4a2c; }
.ds-line1 b { color: #c47a2a; }
.ds-line2 { font-size: 11px; color: #8a7553; margin-top: 2px; }

.dc-stats {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.ds-cell {
  background: var(--bg); border-radius: 12px; padding: 9px 8px;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer;
  transition: background .15s;
}
.ds-cell:active { background: #ece5d6; }
.ds-cap { font-size: 10px; color: var(--text-3); display: flex; align-items: center; gap: 3px; }
.ds-cap .ds-ico { font-size: 10px; color: var(--text-2); }
.ds-val { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ds-val small { font-size: 9px; color: var(--text-3); font-weight: 400; }

.dash-todo {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px; margin-bottom: 14px;
}
.dt-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.dt-title { font-size: 15px; font-weight: 600; }
.dt-count { font-size: 11px; color: var(--text-3); }
.dt-input-row {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.dt-input-row input {
  flex: 1; padding: 8px 10px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.dt-input-row select {
  padding: 8px 6px; font-size: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
#dtAdd {
  width: 36px; font-size: 18px; font-weight: 300;
  background: var(--coral); color: #fff; border: none; border-radius: 10px;
}
#dtAdd:active { transform: scale(.95); }

.dt-list { display: flex; flex-direction: column; gap: 2px; }
.dt-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--line);
}
.dt-item:last-child { border-bottom: none; }
.dt-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); background: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: all .15s;
}
.dt-item.done .dt-check { background: #c47a2a; border-color: #c47a2a; }
.dt-item.done .dt-check::after {
  content: ""; width: 4px; height: 7px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.dt-text { flex: 1; font-size: 13px; min-width: 0; }
.dt-item.done .dt-text { color: var(--text-3); text-decoration: line-through; }
.dt-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
}
.dt-tag.buy { background: #f4e4d2; color: #c47a2a; }
.dt-tag.schedule { background: #e1edf6; color: var(--primary); }
.dt-del {
  background: transparent; border: none; color: var(--text-3);
  font-size: 16px; padding: 0 4px; cursor: pointer;
}
.dt-del:hover { color: var(--up); }
.dt-empty { color: var(--text-3); font-size: 13px; padding: 16px 0; text-align: center; }

/* 主页：万年历 + 挂历黄历 + 数据/待办 */
.home-cal-row {
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 14px;
}
.home-cal, .home-almanac {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px;
  box-shadow: 0 4px 14px rgba(60, 40, 10, 0.04);
}
.rc-block {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px; margin-bottom: 0;
  box-shadow: 0 4px 14px rgba(60, 40, 10, 0.04);
}
.rc-head { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text); }

.dash-hero-card .ring-side-val { font-size: 12px; }

/* ===== 记账：计算器弹窗 + 历史类目记忆 ===== */
.amt-row { display: flex; gap: 8px; align-items: stretch; }
.amt-row #fAmt { flex: 1; }
.calc-btn { flex: none; width: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 18px; cursor: pointer; }
.calc-btn:active { transform: scale(0.96); }
.calc-box { margin-top: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.calc-disp { text-align: right; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 6px 8px; background: var(--surface); border-radius: 8px; min-height: 22px; margin-bottom: 8px; color: var(--text); }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-key { padding: 10px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 16px; cursor: pointer; color: var(--text); }
.calc-key:active { transform: scale(0.95); }
.calc-eq { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.calc-del, .calc-clr { background: var(--surface-2); color: var(--text-2); }
.hist-pick { margin-bottom: 8px; }
.hist-label { font-size: 11px; color: var(--text-3); margin-bottom: 5px; }
.hist-chip { border: 1px dashed var(--amber); border-radius: 16px; padding: 5px 11px; font-size: 12px; background: #fff7ec; color: #9c5a1c; margin: 0 6px 6px 0; cursor: pointer; }
.hist-chip.on { background: var(--amber); color: #fff; border-style: solid; }

/* ===== 精油 ===== */
.oil-search { margin-bottom: 10px; }
.oil-search input { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: var(--surface); }
.oil-stock, .oil-formulas, .oil-records { display: flex; flex-direction: column; gap: 10px; }
.oil-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.oil-item-main { flex: 1; min-width: 0; }
.oil-item-name { font-weight: 600; font-size: 14px; }
.oil-item-eff { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.eff-chip { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); cursor: pointer; user-select: none; transition: background .15s; }
.eff-chip:hover { background: var(--primary); color: #fff; }
.eff-chip em { font-style: normal; opacity: .55; margin-left: 3px; font-size: 10px; }
.eff-chip.eff-on { background: var(--primary); color: #fff; }
.eff-chip.eff-on em { opacity: .9; }
.eff-none { font-size: 11px; color: var(--text-3); }
.oil-edit-eff { cursor: pointer; opacity: .55; margin-left: 4px; font-size: 11px; padding: 0 4px; }
.oil-edit-eff:hover { opacity: 1; }
.oil-eff-edit { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--surface-2); border-radius: 8px; min-height: 36px; }
.oil-item-stock { display: flex; align-items: center; gap: 6px; flex: none; }
.oil-step { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 15px; cursor: pointer; color: var(--text); }
.oil-qty { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 48px; text-align: center; }
.oil-del { cursor: pointer; font-size: 14px; opacity: .7; }
.oil-formula { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.of-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.of-oils { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.of-for { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.oil-rec-btn { width: 100%; padding: 8px; border: 1px solid var(--primary); border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 13px; cursor: pointer; font-weight: 600; }
.oil-rec-btn:active { transform: scale(0.98); }
.oil-rec { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; }
.oil-rec-name { font-weight: 600; }
.oil-rec-date { color: var(--text-2); margin-left: 8px; }
.oil-rec-note { color: var(--text-2); margin-top: 3px; font-size: 12px; }

/* ===== 心愿单 ===== */
.wish-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 10px; }
.wish-card.done { opacity: .6; }
.wish-card.done .wish-name { text-decoration: line-through; }
.wish-top { display: flex; align-items: center; gap: 8px; }
.wish-ck { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; color: var(--primary); flex: none; }
.wish-card.done .wish-ck { background: var(--primary); color: #fff; border-color: var(--primary); }
.wish-name { flex: 1; font-weight: 600; font-size: 14px; }
.wish-tag { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); margin-left: 4px; }
.wish-price { font-variant-numeric: tabular-nums; color: var(--coral); font-weight: 600; }
.wish-link { font-size: 13px; }
.wish-subs { margin: 8px 0 0 30px; display: flex; flex-direction: column; gap: 5px; }
.wish-sub { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.wish-sub.done .wish-sub-name { text-decoration: line-through; color: var(--text-3); }
.wish-sub-ck { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 11px; color: var(--primary); }
.wish-sub.done .wish-sub-ck { background: var(--primary); color: #fff; border-color: var(--primary); }
.wish-sub-name { flex: 1; }
.wish-sub-price { font-variant-numeric: tabular-nums; color: var(--text-2); }
.wish-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.wish-prio { font-size: 11px; padding: 2px 9px; border-radius: 9px; }
.wish-prio.p-3 { background: #fbe3dc; color: #b23b26; }
.wish-prio.p-2 { background: #fdf0d8; color: #9c6a12; }
.wish-prio.p-1 { background: var(--surface-2); color: var(--text-2); }
.wish-del { font-size: 12px; color: var(--text-3); cursor: pointer; }
.wish-del:active { color: var(--coral); }

/* ===== 宽屏：左侧栏 + 各 tab 横屏适配 + 猫咪元素 ===== */
.app-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.hero-paw { position: absolute; top: 14px; right: 14px; width: 20px; height: 20px; color: var(--amber); opacity: .45; pointer-events: none; }
.nav-brand { display: none; }

@media (min-width: 680px) {
  body { padding-left: 140px; }
  #app { max-width: 1040px; flex-direction: row; align-items: stretch; }

  /* 底栏 → 左侧固定 sidebar（B 方案：140px 宽 / 屏幕最左 / 铺满高度） */
  .bottom-nav {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 140px; height: 100%;
    transform: none; max-width: none;
    flex-direction: column; align-items: stretch;
    border-top: none; border-right: 1px solid var(--line);
    padding: 20px 10px 16px;
    z-index: 40;
    background: var(--surface);
  }
  .nav-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0 20px; }
  .cat-mascot { width: 54px; height: 54px; }
  .nav-brand-name { font-size: 13px; font-weight: 700; color: var(--text-1); letter-spacing: 2px; }
  .nav-btn {
    flex: none; padding: 11px 6px; margin: 3px 2px; border-radius: 10px;
    flex-direction: row; justify-content: flex-start; gap: 8px;
    font-size: 13px; padding-left: 14px;
  }
  .nav-btn.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
  .nav-ico { width: 20px; height: 20px; flex-shrink: 0; }

  /* 右侧内容区：flex 列，让 tab-panel 用 flex:1 填满，主区块得以向下延展 */
  .app-main { display: flex; flex-direction: column; overflow: visible; padding-bottom: 16px; }

  /* 桌面端：tab-panel 直接以视口高度为最小高度（不依赖父高度链，稳定）；
     内部 flex/grid 让主区块向下延展，消除内容短时的下方空白。 */
  .tab-panel.active { min-height: 100vh; }
  .tab-panel.active[data-tab="ledger"],
  .tab-panel.active[data-tab="fitness"],
  .tab-panel.active[data-tab="side"],
  .tab-panel.active[data-tab="oil"] { align-content: start; }

  /* home 横屏：万年历+黄历 横排 + 数据+待办 整页 */
  .home-cal-row { flex-direction: row; align-items: stretch; }
  .home-cal { flex: 1.1; min-width: 0; }
  .home-almanac { flex: 1; min-width: 0; }
  .dash-todo .dt-list { max-height: 60vh; overflow-y: auto; }

  /* 记账：扁平 grid 3 行；主人要求：
     row1 = 记一笔 (col1) + 本月明细 (col2) 各一半
     row2 = 资产账户 (col1) + 保险 (col2)
     row3 = 支出记录按类目 (col1) + 记账本 (col2)
   概览+预算合并卡片移到总览页。
   */
  .tab-panel.active[data-tab="ledger"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 14px;
  }
  /* row 1：记一笔 + 本月明细 同列各一半 */
  .ledger-top-grid { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
  .ledger-top-grid .inline-form { display: flex; flex-direction: column; margin: 0; }
  .ledger-top-grid .inline-form-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .ledger-top-grid .block, .ledger-top-grid .summary-card { margin-bottom: 0; }
  /* 明细卡片在桌面端与记一笔等高（紧凑，约 4-5 行内显） */
  .ledger-pos-detail { grid-column: 2; grid-row: 1; min-height: 0; display: flex; flex-direction: column; max-height: 520px; padding-bottom: 10px; }
  .ledger-pos-detail .block-head { flex-shrink: 0; }
  .ledger-pos-detail .ledger-search { flex-shrink: 0; }
  .ledger-pos-detail .ledger-list, .ledger-detail-block .ledger-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  /* row 2：资产账户 + 保险 同列各一半 */
  .ledger-acc-block { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; max-height: 360px; min-height: 0; min-width: 0; }
  .ledger-acc-block #accList { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .ledger-acc-block #accSummary { word-break: break-all; overflow-wrap: anywhere; min-width: 0; }
  .insurance-block { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; max-height: 360px; min-height: 0; min-width: 0; }
  .insurance-block > .summary-card { flex-shrink: 0; }
  .insurance-block #insRemindBlock { flex-shrink: 0; overflow-y: auto; }
  .insurance-block #insPolicyList { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  /* row 3：支出记录 + 记账本 同列各一半 */
  .ledger-cat-block { grid-column: 1; grid-row: 3; min-height: 0; display: flex; flex-direction: column; max-height: 380px; }
  .ledger-cat-block .cat-bars { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .ledger-books-block { grid-column: 2; grid-row: 3; min-height: 0; display: flex; flex-direction: column; max-height: 380px; }
  .ledger-books-block .book-chips { flex-shrink: 0; }
  .ledger-books-block .ledger-books { flex: 1 1 auto; min-height: 0; overflow-x: auto; overflow-y: hidden; padding: 6px 2px 4px; }

  /* 本月财务概览 + 预算 合并卡片内部（总览页） */
  .summary-merged .sum-head { display: flex; align-items: center; justify-content: space-between; }
  .summary-merged .sum-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
  .summary-merged .budget-merged { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .summary-merged .budget-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
  .summary-merged .budget-fill { height: 100%; background: linear-gradient(90deg, #4f9d69, #e0962f, #c0504d); border-radius: 4px; transition: width .4s; }
  .summary-merged .budget-meta { font-size: 11px; color: var(--text-2); }

  /* 健身：显式 col-left / col-right，不再依赖 nth-of-type 硬序 */
  .tab-panel.active[data-tab="fitness"] { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.3fr); gap: 14px; align-items: start; }
  .tab-panel.active[data-tab="fitness"] > * { margin-bottom: 0; }
  .tab-panel.active[data-tab="fitness"] > .col-left { grid-column: 1; }
  .tab-panel.active[data-tab="fitness"] > .col-right { grid-column: 2; }

  /* 副业：summary 落左列、项目落右列，消除左列空白 */
  .tab-panel.active[data-tab="side"] { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.4fr); gap: 14px; align-items: start; align-content: start; }
  .tab-panel.active[data-tab="side"] > * { margin-bottom: 0; }
  .tab-panel.active[data-tab="side"] > .summary-card { grid-column: 1; }
  .tab-panel.active[data-tab="side"] > .block { grid-column: 2; }

  /* 精油：库存(左) + 配方(右)，记录跨两列 */
  .tab-panel.active[data-tab="oil"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; align-content: start; }
  .tab-panel.active[data-tab="oil"] > * { margin-bottom: 0; }
  .tab-panel.active[data-tab="oil"] > .oil-col-1 { grid-column: 1; }
  .tab-panel.active[data-tab="oil"] > .oil-col-2 { grid-column: 2; }
  .tab-panel.active[data-tab="oil"] > .oil-col-3 { grid-column: 1 / -1; }

  /* 心愿单：单列卡片流 */
  .tab-panel.active[data-tab="wish"] { display: block; }

  /* 弹窗居中（不是底部抽屉） */
  .sheet-mask { align-items: center; }
  .sheet { border-radius: 18px; }
}

/* 启动 loading 屏（猫咪主题） */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--bg);
  transition: opacity .5s ease;
}
.boot.hide { opacity: 0; pointer-events: none; }
.boot-cat { width: 76px; height: 76px; animation: bootBob 1.6s ease-in-out infinite; }
.boot-text { font-size: 14px; color: var(--text-2); letter-spacing: 1px; animation: bootPulse 1.6s ease-in-out infinite; }
@keyframes bootBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bootPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ==================== 万年历（总览顶部） ==================== */
.home-cal { padding: 14px 12px 10px; }
.home-cal .hc-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.home-cal .hc-title {
  flex: 1; text-align: center; font-size: 15px; font-weight: 600;
  color: var(--text);
}
.home-cal .hc-nav {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--text-2); font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.home-cal .hc-nav:active { transform: scale(.95); }
.home-cal .hc-today {
  font-size: 11px; color: #fff; background: var(--primary);
  border: none; border-radius: 12px; padding: 4px 10px; cursor: pointer;
  font-family: -apple-system, "PingFang SC", sans-serif;
}
.home-cal .hc-today:active { transform: scale(.95); }
.home-cal .hc-weekrow {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px;
  margin-bottom: 4px;
}
.home-cal .hc-weekrow > span {
  text-align: center; font-size: 11px; color: var(--text-3);
  padding: 2px 0;
}
.home-cal .hc-weekrow > span:first-child { color: var(--up); }
.home-cal .hc-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px;
}
.home-cal .hc-cell {
  aspect-ratio: 1 / 1.05; border-radius: 8px;
  background: var(--bg); border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 2px 0; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  font-family: -apple-system, "PingFang SC", sans-serif;
}
.home-cal .hc-cell.empty { background: transparent; cursor: default; }
.home-cal .hc-cell:hover { background: #fdf2e3; }
.home-cal .hc-cell:active { transform: scale(.96); }
.home-cal .hc-cell.today { background: #fff5ef; border-color: var(--coral); }
.home-cal .hc-cell.selected {
  background: #c25a3a; color: #fffaf3;
}
.home-cal .hc-cell.selected .hc-day { color: #fffaf3; }
.home-cal .hc-cell.selected .hc-lunar { color: #ffe4d1; }
.home-cal .hc-cell.sun .hc-day { color: var(--up); }
.home-cal .hc-cell.selected.sun .hc-day { color: #fffaf3; }
.home-cal .hc-day { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.1; }
.home-cal .hc-cell.fest .hc-lunar { color: var(--up); font-weight: 600; }
.home-cal .hc-cell.selected.fest .hc-lunar { color: #ffe4d1; }
.home-cal .hc-lunar {
  font-size: 9px; color: var(--text-3); line-height: 1; margin-top: 2px;
  max-width: 96%; text-align: center; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.home-cal .hc-foot {
  text-align: center; font-size: 11px; color: var(--text-3);
  margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line);
}

/* ==================== 挂历黄历（总览顶部右侧） ==================== */
.home-almanac { padding: 0; overflow: hidden; }
.al-frame {
  position: relative;
  background: #fffaf0;
  border: 3px solid #d8382e;
  box-shadow:
    inset 0 0 0 1px #f5d97a,
    inset 0 0 0 4px #fffaf0,
    inset 0 0 0 5px #d8382e;
  border-radius: 4px;
  padding: 0 30px 8px;
  color: #1a1a1a;
  font-family: "Songti SC", "STSong", "STKaiti", "KaiTi", "SimSun", serif;
  overflow: hidden;
}
/* 顶部朱红大横幅：左年+中月大字+右ISO/周X */
.al-banner {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  margin: 0 -30px 6px; padding: 8px 30px 6px;
  background: linear-gradient(180deg, #d8382e 0%, #b52820 100%);
  color: #fff8ec;
  border-bottom: 2px solid #f5d97a;
  box-shadow: 0 1px 3px rgba(216, 56, 46, .25);
}
.al-banner-l, .al-banner-c, .al-banner-r { display: flex; align-items: baseline; }
.al-banner-l { justify-content: flex-start; }
.al-banner-c { justify-content: center; gap: 4px; }
.al-banner-r { justify-content: flex-end; gap: 4px; }
.al-banner-ybig { font-size: 16px; font-weight: 800; letter-spacing: 1px; font-family: "Times New Roman", serif; }
.al-banner-ycn { display: none; }
.al-banner-mbig { font-size: 32px; font-weight: 900; letter-spacing: 2px; font-family: "STKaiti", "KaiTi", serif; line-height: 1; padding: 0 6px; }
.al-banner-msize { font-size: 14px; font-weight: 700; letter-spacing: 1px; padding: 1px 5px; background: #fff8ec; color: #b52820; border-radius: 4px; }
.al-banner-iso { font-size: 11px; font-weight: 600; letter-spacing: 1px; opacity: .85; font-family: "Courier New", monospace; }
.al-banner-w { font-size: 11px; font-weight: 700; background: #fff8ec; color: #b52820; border-radius: 4px; padding: 1px 6px; }
/* 对联：每字一框，金边朱红字 */
.al-couplet {
  position: absolute; top: 50px;
  display: flex; flex-direction: column; gap: 2px;
  z-index: 2;
}
.al-couplet-l { left: 6px; }
.al-couplet-r { right: 6px; }
.al-couplet span {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  font-size: 12px; font-weight: 700;
  color: #fff8ec; background: #d8382e;
  border: 1.5px solid #f5d97a; border-radius: 2px;
  font-family: "STKaiti", "KaiTi", "STSong", "Songti SC", serif;
  box-shadow: 0 1px 2px rgba(216, 56, 46, .3);
}
/* 大数字区：超大数字 + 居中生肖字符（白字红底圆形叠在数字中央） */
.al-day-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 130px; margin: 8px 0 2px;
}
.al-day-num {
  font-size: 150px; font-weight: 900; line-height: 1;
  color: #d8382e;
  text-shadow: 1px 1px 0 #c25a3a, 2px 2px 0 #fff8ec;
  font-family: "STKaiti", "KaiTi", "STSong", "Songti SC", serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -4px;
}
.al-day-animal {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900;
  color: #fff8ec;
  background: radial-gradient(circle at 35% 30%, #e05a4a 0%, #c9342b 70%);
  border: 2px solid #fff8ec;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #f5d97a, 0 0 6px rgba(216, 56, 46, .5);
  font-family: "STKaiti", "KaiTi", serif;
}
/* 印章行：日/节气/周 三块 */
.al-stamp-row {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  margin: 4px 0;
}
.al-stamp-block {
  display: inline-flex; align-items: center; gap: 1px;
  background: #d8382e; color: #fff8ec;
  border: 1.5px solid #f5d97a; border-radius: 3px;
  padding: 2px 7px; font-size: 12px;
  font-family: "STKaiti", "KaiTi", serif; font-weight: 600;
}
.al-stamp-block b { font-size: 15px; font-weight: 900; }
/* 八字行 */
.al-bz-row {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  background: #fdf3e0; border: 1px solid #d8a26a; border-radius: 3px;
  padding: 3px 8px; margin: 3px 0;
  font-size: 11px; color: #1a1a1a;
  font-family: "STKaiti", "KaiTi", serif;
}
.al-bz-cap { color: #d8382e; font-weight: 800; letter-spacing: 1px; }
.al-bz-v { font-weight: 600; }
/* 宜忌双栏（朱红底金字） */
.al-yi-ji {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin: 4px 0;
}
.al-yi, .al-ji {
  background: #fffaf3; border: 1.5px solid #d8382e;
  border-radius: 3px; padding: 3px 5px;
}
.al-yi-cap, .al-ji-cap {
  font-size: 15px; font-weight: 900; line-height: 1; margin-bottom: 2px;
  text-align: center; letter-spacing: 6px;
  font-family: "STKaiti", "KaiTi", serif;
  padding: 1px 0;
}
.al-yi-cap { color: #fff8ec; background: #1f7a3a; border-radius: 2px; }
.al-ji-cap { color: #fff8ec; background: #d8382e; border-radius: 2px; }
.al-yi-list, .al-ji-list {
  display: flex; flex-wrap: wrap; gap: 2px;
  font-size: 10px; color: #1a1a1a;
  line-height: 1.3;
}
.al-yi-list span, .al-ji-list span {
  background: #fff; border: 1px solid #e8d4a8;
  border-radius: 2px; padding: 0 3px;
  white-space: nowrap;
}
.al-yi-list .muted, .al-ji-list .muted { color: #b0a08a; background: transparent; border-color: transparent; }
/* 快速行：冲煞/值神/建除/五行/纳音/星宿 6 项横排 */
.al-quick {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 8px;
  font-size: 10px; color: #1a1a1a; line-height: 1.35;
  padding: 3px 4px; background: #fdf3e0;
  border-top: 1px dashed #d8a26a; border-bottom: 1px dashed #d8a26a;
}
.al-quick span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-quick b { color: #d8382e; font-weight: 700; margin-right: 2px; }
/* 方位行：喜/福/财/阳贵/阴贵 5 项 */
.al-pos-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 0 4px;
  font-size: 10px; color: #1a1a1a; line-height: 1.4;
  padding: 2px 4px;
}
.al-pos-row b { color: #1f7a3a; font-weight: 800; margin-right: 2px; }
/* 吉凶行（吉神/凶煞/彭祖 跨整行） */
.al-jx-row {
  font-size: 10.5px; color: #1a1a1a; line-height: 1.4;
  padding: 1px 4px;
}
.al-jx-row b { color: #b5820c; font-weight: 800; margin-right: 4px; letter-spacing: 1px; }
/* 末排小字：九星/胎神/太岁/日禄/旬空 5 项 */
.al-tiny-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; gap: 0 4px;
  font-size: 9.5px; color: #5a4a3a; line-height: 1.4;
  padding: 2px 4px;
  background: #fff5ef;
  border-top: 1px dashed #d8a26a;
}
.al-tiny-row b { color: #a83528; font-weight: 700; margin-right: 2px; }
/* 十二时辰吉凶表（默认折叠，点击展开） */
.al-times {
  margin-top: 4px; padding-top: 4px;
  border-top: 1px dashed #d8a26a;
}
.al-times.collapsed { margin-top: 2px; padding-top: 0; border-top: none; }
.al-times.collapsed .al-times-grid { display: none; }
.al-times-cap {
  font-size: 11px; font-weight: 800; color: #d8382e;
  font-family: "STKaiti", "KaiTi", serif; letter-spacing: 1px;
  margin-bottom: 3px;
  display: flex; align-items: center; gap: 4px;
  background: linear-gradient(90deg, #fff5ef 60%, transparent 100%);
  padding: 2px 4px; border-radius: 2px;
}
.al-times.collapsed .al-times-cap { margin-bottom: 0; }
.al-times-toggle { user-select: none; cursor: pointer; }
.al-times-arrow { font-size: 10px; color: #8a5a3a; }
.al-times-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.al-t-row {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 2px 3px; border-radius: 3px;
  background: #fff; border: 1px solid #d8a26a;
  font-family: -apple-system, "PingFang SC", sans-serif;
}
.al-t-row.t-ji { background: #fff5ef; border-color: #d8382e; }
.al-t-row.t-xiong { background: #f4f5f7; border-color: #a8b0b8; }
.al-t-zhi { font-size: 12px; font-weight: 800; color: #1a1a1a; font-family: "STKaiti", "KaiTi", serif; }
.al-t-row.t-ji .al-t-zhi { color: #b52820; }
.al-t-row.t-xiong .al-t-zhi { color: #5a6066; }
.al-t-tag { font-size: 9px; font-weight: 800; padding: 0 4px; border-radius: 6px; }
.al-t-row.t-ji .al-t-tag { color: #fff8ec; background: #d8382e; }
.al-t-row.t-xiong .al-t-tag { color: #fff; background: #6c757d; }
.al-t-shen { font-size: 8px; color: #8a5a3a; }
@media (max-width: 420px) {
  .al-times-grid { grid-template-columns: repeat(3, 1fr); }
}
/* 窄屏挂历适配：对联收窄、横幅缩字号、大数字恢复 88px 视觉冲击 */
@media (max-width: 400px) {
  .al-frame { padding: 0 34px 10px; }
  .al-banner { margin: 0 -34px 6px; padding: 6px 34px 5px; }
  .al-banner-y { font-size: 14px; }
  .al-banner-m { font-size: 19px; }
  .al-banner-d { font-size: 22px; }
  .al-banner-w { font-size: 11px; }
  .al-couplet { top: 42px; }
  .al-couplet span { width: 20px; height: 20px; font-size: 12px; }
  .al-bigday-num { font-size: 72px; }
  .al-stamp { width: 40px; height: 40px; font-size: 20px; }
  .al-bigday { gap: 10px; }
}
/* 生日/纪念日 */
.al-events {
  margin-top: 4px; padding-top: 4px;
  border-top: 1px dashed #d8a26a;
}
.al-events-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 800; color: #d8382e;
  font-family: "STKaiti", "KaiTi", serif; letter-spacing: 1px;
}
.al-event-add {
  background: #d8382e; color: #fff;
  border: none; border-radius: 3px;
  width: 20px; height: 20px; font-size: 12px; font-weight: 900;
  cursor: pointer; line-height: 1;
}
.al-event-add:active { transform: scale(0.92); }
.al-event-list { margin-top: 3px; }
.al-event-item {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 5px; margin-bottom: 2px;
  background: #fffaf3; border: 1px solid #d8a26a; border-radius: 3px;
  font-size: 10px; color: #1a1a1a;
  font-family: -apple-system, "PingFang SC", sans-serif;
}
.al-event-icon { font-size: 11px; }
.al-event-title { flex: 1; font-weight: 600; }
.al-event-meta { color: #d8382e; font-size: 9px; }
.al-event-del {
  background: none; border: none; color: #c25a3a;
  cursor: pointer; font-size: 12px; padding: 0 2px;
}
.al-event-empty {
  font-size: 10px; color: #b0a08a; padding: 2px 0;
  font-family: -apple-system, "PingFang SC", sans-serif;
}
.al-foot {
  text-align: center; font-size: 9px; color: #8a5a3a;
  margin-top: 4px; padding-top: 3px; border-top: 1px dashed #d8a26a;
  font-family: -apple-system, "PingFang SC", sans-serif;
}
.al-empty {
  padding: 24px; text-align: center; color: var(--text-3); font-size: 12px;
}

/* 月份选择器弹窗 */
.month-picker {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: mp-fade .15s ease;
}
@keyframes mp-fade { from { opacity: 0; } to { opacity: 1; } }
.month-picker-card {
  background: #fffaf3;
  border: 2px solid #c9342b;
  border-radius: 12px;
  padding: 16px 18px;
  min-width: 280px; max-width: 90vw;
  box-shadow: 0 8px 32px rgba(201, 52, 43, 0.25);
  font-family: "Songti SC", "STSong", "STKaiti", "KaiTi", "SimSun", serif;
}
.month-picker-year {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  font-size: 18px; font-weight: 700; color: #4a2e1c;
  margin-bottom: 12px;
}
.month-picker-year button {
  background: #fff8ec; border: 1px solid #d8a26a; border-radius: 6px;
  width: 32px; height: 32px; font-size: 16px; color: #c9342b;
  cursor: pointer; font-weight: 700;
}
.month-picker-year button:active { transform: scale(0.92); }
.month-picker-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.month-picker-grid button {
  background: #fff8ec; border: 1px solid #d8a26a; border-radius: 6px;
  padding: 10px 0; font-size: 14px; color: #4a2e1c;
  cursor: pointer; font-family: inherit;
}
.month-picker-grid button:active { transform: scale(0.95); }
.month-picker-grid button.cur {
  background: #c9342b; color: #fff; border-color: #c9342b;
  font-weight: 700;
}
.month-picker-close {
  margin-top: 10px; text-align: center;
}
.month-picker-close button {
  background: none; border: 1px solid #d8a26a; border-radius: 6px;
  padding: 4px 16px; font-size: 12px; color: #8a5a3a; cursor: pointer;
}

/* 万年历格子可点击标题 + 事件角标 */
.home-cal .hc-title { cursor: pointer; user-select: none; }
.home-cal .hc-title:active { color: var(--coral); }
.hc-cell { position: relative; }
.hc-cell .hc-event-dot {
  position: absolute; top: 3px; right: 3px;
  width: 5px; height: 5px; border-radius: 50%;
  background: #c9342b;
}
.hc-cell.selected .hc-event-dot { background: #fffaf3; }

/* 添加记录弹窗表单 */
.an-form { display: flex; flex-direction: column; gap: 10px; padding: 8px 4px; font-family: -apple-system, "PingFang SC", sans-serif; }
.an-row { display: flex; flex-direction: column; gap: 4px; }
.an-row > label { font-size: 12px; color: #8a5a3a; font-weight: 600; }
.an-inp {
  padding: 8px 10px; font-size: 14px; color: #4a2e1c;
  background: #fffaf3; border: 1px solid #d8a26a; border-radius: 6px;
  font-family: inherit;
}
.an-inp:focus { outline: none; border-color: #c9342b; }
.an-kinds { display: flex; gap: 8px; flex-wrap: wrap; }
.an-kind {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; background: #fff8ec;
  border: 1px solid #d8a26a; border-radius: 6px;
  font-size: 13px; color: #4a2e1c; cursor: pointer;
}
.an-kind input { margin: 0; }
.an-kind:has(input:checked) { background: #c9342b; color: #fff; border-color: #c9342b; }
.an-switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4a2e1c; cursor: pointer; }
.an-switch input { width: 16px; height: 16px; }



/* ==================== 全局版面设计升级 v20260828.1 ==================== */
/* 统一卡片：浅阴影 + 更细腻边框 */
.block, .cat-bars, .aggreg-card, .budget-card, .summary-card, .streak-card, .oil-list {
  box-shadow: 0 1px 3px rgba(60, 48, 39, 0.06), 0 0 0 0.5px rgba(60, 48, 39, 0.02);
  border-color: var(--line);
}
/* 标题行：左 accent 条 + 更清晰层级 */
.block-head { position: relative; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.block-title {
  font-size: 15px; font-weight: 700; letter-spacing: 0.3px;
  padding-left: 9px; position: relative; color: var(--text);
}
.block-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #e2a06e);
}
/* 卡片标题区自适应：inline-form 与 calendar 头部同样处理 */
.inline-form .inline-form-head { position: relative; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.inline-form-title {
  font-size: 15px; font-weight: 700; letter-spacing: 0.3px;
  padding-left: 9px; position: relative; color: var(--text);
}
.inline-form-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #e2a06e);
}
/* Summary 卡片：间距更舒服，数值更大 */
.summary-card { padding: 18px 6px 14px; }
.sum-label { font-size: 11px; letter-spacing: 0.5px; }
.sum-value { font-size: 20px; font-weight: 700; margin-top: 5px; }
.summary-card .sum-head {
  position: relative; font-size: 13px; font-weight: 600; letter-spacing: 0.4px;
  padding-left: 9px; padding-bottom: 8px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line); color: var(--text);
}
.summary-card .sum-head::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #e2a06e);
}
.summary-card .sum-item { padding: 4px 6px; }
/* 连续打卡卡：新渐变 + 内高光 */
.streak-card {
  background: linear-gradient(135deg, #8a2f14 0%, #b5481f 55%, #d2603f 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 4px 14px rgba(138, 47, 20, .22);
  border-radius: 16px; padding: 22px 16px;
}
.streak-num { font-size: 42px; text-shadow: 0 2px 6px rgba(0,0,0,.18); }
.streak-label { letter-spacing: 1px; }
/* 明细行：hover 反馈 + 圆角图标 */
.led-row, .plan-row, .wish-row, .side-row, .acc-row { transition: background .15s; border-radius: 8px; }
.led-row:hover, .plan-row:hover, .wish-row:hover, .side-row:hover, .acc-row:hover { background: var(--surface-2); }
.led-ico { border-radius: 10px; background: linear-gradient(135deg, var(--surface-2), #f0e2d0); }
.led-cat { font-size: 14px; font-weight: 600; }
/* 空状态：图标 + 说明更清晰 */
.empty-tip { font-size: 13px; padding: 28px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-tip::before { font-size: 26px; display: block; margin-bottom: 2px; }
/* 分类条：进度条更圆润 */
.cat-fill { background: linear-gradient(90deg, var(--primary), #e29a62); }
.cat-track { background: var(--surface-2); }
/* 按钮 hover 反馈 */
.link-btn { transition: color .15s, opacity .15s; }
.link-btn:hover { color: var(--coral); }
.inline-ok, .body-save, .sheet-ok, .day-save { transition: transform .08s, opacity .15s; }
.inline-ok:active, .body-save:active, .sheet-ok:active { transform: scale(0.98); opacity: .9; }
/* 输入框统一 */
.body-field input, .inline-form input, .oil-search input, .dt-input {
  border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
.body-field input:focus, .inline-form input:focus, .oil-search input:focus, .dt-input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200, 116, 62, .12);
}
/* 记账分类 chips hover */
.inline-form .cat-pick .cat-chip:hover, .inline-form .hist-pick .hist-chip:hover { border-color: var(--primary); color: var(--primary); }
/* 桌面端卡片间距更舒服 */
@media (min-width: 680px) {
  .block, .cat-bars, .summary-card, .streak-card { padding-left: 16px; padding-right: 16px; }
  .block { padding-top: 15px; padding-bottom: 15px; }
}

/* ========== 二轮：副业/心愿/精油/健身/总览针对性排版 ========== */
/* 副业项目行 */
.side-row {
  padding: 11px 4px; border-bottom: 1px solid var(--line);
}
.side-row:last-child { border-bottom: none; }
.side-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.side-name { font-size: 14px; font-weight: 600; }
.side-net { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.side-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-3); margin-top: 3px; }
/* 心愿卡片 */
.wish-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; margin-bottom: 9px;
  box-shadow: 0 1px 2px rgba(60,48,39,.05);
  transition: opacity .2s, transform .1s;
}
.wish-card:active { transform: scale(.99); }
.wish-card.done { opacity: .55; }
.wish-top { display: flex; align-items: center; gap: 8px; }
.wish-ck { font-size: 18px; color: var(--text-3); cursor: pointer; }
.wish-card.done .wish-ck { color: var(--green); }
.wish-name { flex: 1; font-size: 14px; font-weight: 600; }
.wish-tag { font-size: 10px; background: var(--primary-soft); color: var(--primary); border-radius: 8px; padding: 1px 6px; margin-left: 4px; }
.wish-price { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wish-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.wish-prio { font-size: 11px; }
.wish-del { font-size: 11px; color: var(--text-3); cursor: pointer; }
.wish-del:hover { color: var(--coral); }
.wish-subs { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.wish-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.wish-sub-ck { cursor: pointer; color: var(--text-3); }
.wish-sub.done .wish-sub-name { text-decoration: line-through; color: var(--text-3); }
.wish-sub-price { margin-left: auto; font-variant-numeric: tabular-nums; }
/* 精油库存行 */
.oil-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.oil-item:last-child { border-bottom: none; }
.oil-item-main { flex: 1; min-width: 0; }
.oil-item-name { font-size: 14px; font-weight: 600; }
.oil-item-eff { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.eff-chip { font-size: 10px; background: var(--primary-soft); color: var(--primary); border-radius: 8px; padding: 1px 6px; }
.eff-none { font-size: 11px; color: var(--text-3); }
.oil-item-stock { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.oil-step { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); font-size: 15px; cursor: pointer; }
.oil-qty { min-width: 52px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.oil-del { cursor: pointer; opacity: .5; font-size: 13px; }
.oil-del:hover { opacity: 1; }
/* 精油配方卡 */
.oil-formula { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.oil-formula .f-name { flex: 1; font-size: 13px; font-weight: 600; }
.oil-rec-btn { font-size: 11px; padding: 4px 10px; border-radius: 8px; border: none; background: var(--primary); color: #fff; cursor: pointer; }
/* 使用记录 */
.oil-rec { background: var(--surface-2); border-radius: 8px; padding: 7px 10px; margin-bottom: 6px; font-size: 12px; }
.oil-rec-name { font-weight: 600; margin-right: 8px; }
.oil-rec-date { font-size: 11px; color: var(--text-3); }
.oil-rec-note { margin-top: 3px; color: var(--text-2); font-size: 11px; }
/* 健身 KPI 格 */
.body-kpi-cell { background: var(--surface-2); border-radius: 10px; padding: 9px 6px; text-align: center; }
.body-kpi-cap { font-size: 11px; color: var(--text-2); }
.body-kpi-val { font-size: 17px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
/* 健身表单：保存按钮主色 */
.body-save { width: 100%; padding: 10px 0; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.body-field label { font-size: 11px; color: var(--text-2); }
.body-field input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--bg); }
/* 目标体重行 */
.body-target-field input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--bg); }
.body-target-btn { padding: 8px 16px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
/* 总览仪表盘细节 */
.dash-actions button, .ds-btn { transition: opacity .15s; }
.dash-actions button:active, .ds-btn:active { opacity: .75; }
.dt-list { max-height: 40vh; overflow-y: auto; }
.dt-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px dashed var(--line); }
.dt-row:last-child { border-bottom: none; }
.dt-ck { font-size: 16px; cursor: pointer; color: var(--text-3); }
.dt-row.done .dt-txt { text-decoration: line-through; color: var(--text-3); }
.dt-k { font-size: 10px; background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 1px 5px; }
.dt-x { margin-left: auto; color: var(--text-3); cursor: pointer; font-size: 13px; }
/* 万年历 hc-cell 微调 */
.hc-cell { transition: background .15s, border-color .15s, transform .1s; }
.hc-cell:hover { background: #fbe6d6; }
/* 总览 6 格 */
.ds-cell { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(60,48,39,.05); }
.ds-cell:active { transform: scale(.97); }

/* ========== v20260828.2：健身 streak-card 改全宽+空状态引导卡 ========== */
/* 健身 streak-card 改占满全宽（不再被 col-right 拉高沉底） */
.tab-panel.active[data-tab="fitness"] > .streak-card { grid-column: 1 / -1; }
/* 健身 streak-card 紧凑排布（数字+文字+小提示在一行） */
.streak-card { display: flex; align-items: center; justify-content: space-around; gap: 14px; padding: 16px 18px; }
.streak-card > div { text-align: center; }
.streak-card .streak-num { font-size: 38px; line-height: 1; }
.streak-card .streak-label { font-size: 11px; opacity: .92; margin-top: 2px; letter-spacing: 1px; }
.streak-card .streak-sub { font-size: 11px; opacity: .78; margin-top: 2px; }
/* 空状态引导卡（无数据时显示） */
.empty-guide {
  background: var(--surface); border: 1.5px dashed var(--line); border-radius: 14px;
  padding: 36px 20px; text-align: center; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-top: 12px;
}
.empty-guide::before { content: "🐾"; font-size: 40px; opacity: .55; }
.empty-guide .eg-title { font-size: 15px; font-weight: 600; color: var(--text); }
.empty-guide .eg-sub { font-size: 12px; color: var(--text-3); max-width: 320px; line-height: 1.6; }
.empty-guide .eg-btn { display: inline-block; margin-top: 6px; padding: 8px 18px; background: var(--primary); color: #fff; border-radius: 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.empty-guide .eg-btn:hover { background: var(--coral); }
.empty-guide .eg-btn.eg-secondary { background: transparent; color: var(--primary); border: 1px solid var(--primary); margin-left: 8px; }
/* 让桌面端 grid 内容 start 排布（不 stretch 撑大） */
@media (min-width: 680px) {
  .tab-panel.active[data-tab="ledger"],
  .tab-panel.active[data-tab="fitness"] { align-content: start; }
}
/* 移动端空状态大卡更紧凑 */
@media (max-width: 480px) {
  .empty-guide { padding: 26px 14px; }
  .empty-guide::before { font-size: 32px; }
}
