:root {
  --bg: #f4f1ff;
  --card: #fff;
  --ink: #14121f;
  --muted: #6b6580;
  --line: #ece9ff;
  --primary: #6d5efc;
  --primary-soft: #ece9ff;
  --ok: #12b886;
  --danger: #ff4d6d;
  --warn: #f59e0b;
  --radius: 18px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --tab-h: 58px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
button, input, select { font: inherit; }
.hidden { display: none !important; }
#app { min-height: 100vh; padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }

/* 总览：整页不滚，仅下方明细区滚动 */
html.home-lock,
html.home-lock body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
html.home-lock body {
  position: fixed;
  inset: 0;
  width: 100%;
}
#app.home-lock {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  /* tabbar 为 fixed，需预留高度，否则内部滚动区被挡住 */
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#app.home-lock.no-tabbar {
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.page-home {
  padding-bottom: 8px;
  width: 100%;
}
#app.home-lock .page-home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.page-home .page-head-sticky {
  flex-shrink: 0;
  background: var(--bg);
  padding-top: 4px;
  z-index: 5;
}
#app.home-lock .page-home .home-top {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 46%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.page-home .home-cal {
  margin-bottom: 8px;
}
#app.home-lock .page-home .home-cal {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.page-home .home-cal .cal-nav,
.page-home .home-cal .home-sum,
.page-home .home-cal .cal-week {
  flex-shrink: 0;
}
.page-home .home-cal-body { min-height: 0; }
#app.home-lock .page-home .home-cal-body {
  flex: 1;
  min-height: 80px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
#app.home-lock .page-home .home-cal-body.cal-pos-pending {
  opacity: 0;
}
.page-home .home-detail { padding-bottom: 4px; }
#app.home-lock .page-home .home-detail {
  flex: 1 1 54%;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 2;
}
.page-home .home-detail-card { margin-bottom: 0; padding-bottom: 10px; }
#app.home-lock .page-home .home-detail-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.page-home .home-day-head {
  flex-shrink: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}
.home-day-title {
  margin-bottom: 8px;
  gap: 6px;
  align-items: center;
}
.home-day-title .strong {
  flex-shrink: 0;
  white-space: nowrap;
}
.home-today-net {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  font-size: 9px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.2;
}
.home-today-net .home-today-vs {
  color: #94a3b8;
  font-weight: 400;
}
.home-today-net .net-chg { font-size: 9px; gap: 1px; }
.home-today-net .arc-arrow { width: 10px; height: 10px; }
.page-home .home-day-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 16px;
}
.page-home .home-day-list .detail-block:first-child {
  margin-top: 8px;
}
#app.home-lock .page-outlook {
  flex: 1;
  min-height: 0;
}
#app.home-lock .page-platform {
  flex: 1;
  min-height: 0;
}
#app.home-lock .page-mine {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 8px;
  width: 100%;
}
.page-mine .mine-top {
  flex-shrink: 0;
  overflow: hidden;
  margin-bottom: 10px;
}
.mine-board {
  background: #fff;
  border: 1px solid #ece9ff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(80, 64, 180, 0.08);
  overflow: hidden;
}
.mine-board-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 8px;
  background: #fff;
}
.mine-board-head .profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.mine-board-head .name-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.mine-board-head .tx-title { font-size: 15px; font-weight: 700; flex-shrink: 0; }
.mine-board-head .phone-inline {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mine-board-head .contact-line { font-size: 11px; margin-top: 1px; }
.mine-board-head .link { font-size: 12px; }
.mine-board-head .head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.mine-board-head .logout-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.mine-board-net {
  padding: 4px 12px 8px;
}
.mine-board-net .dep-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7f5ff 0%, #eefaf5 100%);
  margin-bottom: 8px;
}
.mine-board-net .dep-hero-main { flex: 1; min-width: 0; }
.mine-board-net .dep-label {
  margin: 0 0 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.mine-board-net .dep-num-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.mine-board-net .dep-num {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.mine-board-net .outlook-pill {
  flex-shrink: 0;
  border: 1px solid #e0dbff;
  background: #fff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  margin-bottom: 2px;
}
.arc-arrow {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  overflow: visible;
}
.dep-num-wrap .arc-arrow { width: 18px; height: 18px; }
.arc-arrow.is-down { transform: scaleY(-1); }
.net-chg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.net-chg.is-up { color: var(--ok); }
.net-chg.is-down { color: var(--danger); }
.net-chg.is-flat { color: #94a3b8; font-weight: 650; }
.mine-board-formula {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  margin-bottom: 0;
}
.mine-board .acct-bals {
  margin: 0;
  padding: 0;
}
.mine-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 2px 12px 12px;
}
.mine-stats-noddebt {
  grid-template-columns: 1fr 1fr;
}
.mine-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #f7f5ff;
  border-radius: 12px;
  padding: 8px 9px;
  min-width: 0;
}
.mine-stat.is-debt {
  justify-content: flex-start;
  background: #fff5f7;
}
.mine-stat-k {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.mine-stat-v {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  width: 100%;
}
.mine-stat.is-debt .mine-stat-v { font-size: 13px; }
.mine-stat-slash {
  margin: 0 3px;
  color: #cbd5e1;
  font-weight: 500;
}
.mine-stat-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  min-width: 0;
}
.mine-stat-bar {
  height: 3px;
  flex: 1;
  min-width: 0;
  margin-top: 0;
  border-radius: 99px;
  background: #fde8e8;
  overflow: hidden;
}
.mine-stat-pct {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 650;
  color: #e11d48;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.mine-stat-bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #fb7185, #e11d48);
}
.mine-stat-bar-row.is-paid .mine-stat-bar,
.mine-stat-bar-row.is-done .mine-stat-bar {
  background: #dcfce7;
}
.mine-stat-bar-row.is-paid .mine-stat-bar span,
.mine-stat-bar-row.is-done .mine-stat-bar span {
  background: linear-gradient(90deg, #4ade80, #16a34a);
}
.mine-stat-bar-row.is-paid .mine-stat-pct,
.mine-stat-bar-row.is-done .mine-stat-pct {
  color: #16a34a;
}
.mine-stat-sub {
  margin-top: 5px;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 400;
}
button.mine-stat-sub.last-net-btn {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  border: none;
  padding: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: #94a3b8;
  font-size: 10px;
}
.mine-stat-sub .net-chg { margin-left: 0; font-size: 10px; }
.mine-stat-sub .arc-arrow { width: 12px; height: 12px; }
.page-mine .mine-menu {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  margin-bottom: 8px;
}
.page-mine .mine-logout {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 4px 0 8px;
}
.page-mine .mine-logout button {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 15px;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
}
.acct-bals {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 2px 0 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.acct-bals::-webkit-scrollbar { display: none; }
.acct-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 42vw;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  -webkit-text-size-adjust: 100%;
}
button.acct-chip {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  color: inherit;
  background: #f1f5f9;
  cursor: pointer;
}
.acct-chip-name {
  color: #64748b;
  max-width: 7.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 400;
}
.acct-chip-amt { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.acct-chip-debt { background: #fef2f2; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.login-wrap.has-nav {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 12px 16px 24px;
}
.login-wrap.has-nav .nav-bar { margin: 4px 0 12px; }
.login-wrap.has-nav .login-card { margin: 0 auto; }
.legal-links {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.icp-foot {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
}
.icp-foot a { color: #9ca3af; text-decoration: none; }
.legal-wrap .legal-doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 4px 32px;
  color: #374151;
  line-height: 1.75;
  font-size: 14px;
}
.legal-doc h2 {
  margin: 20px 0 8px;
  font-size: 16px;
  color: #111827;
}
.legal-doc p { margin: 0 0 8px; white-space: pre-wrap; }
.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  text-align: left;
}
.agree-row .check {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 1.5px solid var(--primary);
  border-radius: 4px;
  background: #fff;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
}
.agree-row .check.on {
  background: var(--primary);
  box-shadow: inset 0 0 0 2px #fff;
}
.agree-row .link { font-size: 13px; }
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  border: 1px solid #e8eef3;
  box-shadow: 0 8px 28px rgba(2, 132, 200, 0.06);
}
.login-card h1 { margin: 0 0 6px; font-size: 28px; }
.login-card .muted { margin-bottom: 20px; }
.login-card label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 13px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 18px;
}
.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.code-row input { flex: 1; min-width: 0; }
.code-row .code-btn {
  width: auto;
  flex-shrink: 0;
  margin-top: 0;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 13px;
}
.msg-ok { color: var(--ok); font-size: 13px; margin-top: 10px; }
.msg-err { color: var(--danger); font-size: 13px; margin-top: 10px; }
.err { color: var(--danger); font-size: 13px; margin-top: 10px; }
.hint { text-align: center; color: #9ca3af; font-size: 12px; margin-top: 16px; }

.page { padding: 12px 14px 20px; max-width: 720px; margin: 0 auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.link { color: var(--primary); background: none; border: none; padding: 0; cursor: pointer; font-size: 14px; font-weight: 600; }
a.link { text-decoration: none; }
.money-pos { color: var(--ok); }
.money-neg { color: var(--danger); }
.strong { font-weight: 700; }

.btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid #e5e7eb; color: var(--ink); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(80, 64, 180, 0.08);
}

.hero {
  background: #fff;
  border: 1px solid #e8eef3;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 8px 24px rgba(2, 132, 200, 0.05);
}
.page-head {
  text-align: center;
  margin-bottom: 8px;
  padding: 0;
}
.nav-bar {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.nav-bar .nav-side {
  width: 4.8em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  z-index: 1;
}
.nav-bar .nav-left { justify-content: flex-start; }
.nav-bar .nav-right {
  width: auto;
  min-width: 4.8em;
  margin-left: auto;
  justify-content: flex-end;
}
.nav-bar .back {
  margin: 0;
  padding: 4px 0;
  line-height: 1.2;
}
.nav-bar .nav-title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 5em;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.nav-bar .nav-title .badge { pointer-events: auto; }
.page-head-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: 8px 0 6px;
  margin-bottom: 4px;
}
.page-head .hero-title { font-size: 20px; font-weight: 700; }
.page-head .hero-sub { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.hero-title { font-size: 22px; font-weight: 700; }
.hero-sub { font-size: 13px; color: #9ca3af; margin-top: 4px; }
.add-btn {
  background: var(--primary-soft);
  color: var(--primary);
  border: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 650;
  cursor: pointer;
}
.btn-add-block {
  display: block; width: 100%; box-sizing: border-box;
  margin-top: 12px; padding: 12px; border: none; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
.summary-card {
  background: #fff;
  border: 1px solid #e8eef3;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(2, 132, 200, 0.05);
}
.summary-card .dep-label { margin-top: 0; font-size: 12px; color: var(--muted); }
.summary-card .dep-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  margin-bottom: 12px;
}
.summary-card .dep-num { margin: 0; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-card .outlook-entry {
  flex-shrink: 0;
  align-self: center;
}
.summary-card .metrics { margin-bottom: 0; }
.dep-label { margin-top: 16px; font-size: 13px; color: var(--muted); }
.dep-num { margin-top: 4px; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.metric {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.metric-debt { background: #fffbfb; border-color: #fde8e8; }
.metric-k { font-size: 11px; color: var(--muted); }
.metric-v {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.metric-v-lg { font-size: 17px; }
.metric-sub { margin-top: 2px; font-size: 10px; color: #9ca3af; }

.diag { border-left: none; background: #f0f9ff; }
.diag.bad { background: #fef2f2; }
.diag.warn { background: #fffbeb; }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 8px;
}
.diag.bad .tag { background: #fee2e2; color: var(--danger); }
.diag.warn .tag { background: #fef3c7; color: var(--warn); }
.diag-text { font-size: 14px; line-height: 1.5; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.chip-in { background: #ecfdf5; color: var(--ok); }
.chip-out { background: var(--primary-soft); color: var(--primary); }
.chip-rp { background: #fef2f2; color: var(--danger); }
.net { font-size: 24px; font-weight: 700; }

.sec { display: flex; justify-content: space-between; align-items: center; margin: 8px 2px 8px; }
.sec-title { font-size: 17px; font-weight: 700; }

.due-row, .list-row, .tx-row, .asset-row, .cal-row, .out-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}
.due-row:last-child, .list-row:last-child, .tx-row:last-child,
.asset-row:last-child, .cal-row:last-child, .out-row:last-child { border-bottom: none; }
.list-row.plat-row,
.due-row.plat-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.plat-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.plat-row .mine-stat-bar-row { margin-top: 0; }
.due-day {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.badge {
  font-size: 12px; font-weight: 650; padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.badge.badge-def-exp { background: #ecfdf5; color: #047857; font-size: 10px; padding: 1px 6px; }
.badge.badge-def-inc { background: #eff6ff; color: #1d4ed8; font-size: 10px; padding: 1px 6px; }
.asset-title {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}
.asset-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.asset-badges {
  display: inline-flex;
  flex-shrink: 0;
  gap: 4px;
  white-space: nowrap;
}
.asset-no-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.asset-no-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset-no-line .link { font-size: 12px; flex-shrink: 0; }
.badge.todo { background: #fef2f2; color: var(--danger); }
.badge.partial { background: #fffbeb; color: var(--warn); }
.badge.done { background: #ecfdf5; color: var(--ok); }
.badge.unset { background: #f3f4f6; color: var(--muted); }
.badge.debt-cat {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  vertical-align: middle;
  background: #eef2ff;
  color: #4338ca;
}
.badge.debt-cat.private {
  background: #f5f3ff;
  color: #7c3aed;
}

.tabs {
  display: flex; gap: 4px; background: #eef2f6; border-radius: 12px; padding: 4px; margin-bottom: 12px;
}
.tab {
  flex: 1; border: none; background: transparent; padding: 9px 4px; border-radius: 9px;
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.tab.on { background: #fff; color: var(--ink); font-weight: 700; }
.ana-tabs { margin: 0 0 12px; }
.ana-stick {
  position: sticky;
  top: 0;
  z-index: 16;
  background: var(--bg);
  padding: 8px 0 2px;
  margin: 0 -2px;
}
.ana-pie-svg {
  display: block;
  width: 100%;
  max-width: 440px;
  height: auto;
  margin: 0 auto 12px;
  overflow: visible;
}
.ana-pie-slice { cursor: pointer; }
.ana-pie-on {
  pointer-events: none;
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}
.ana-pie-legend { display: flex; flex-direction: column; gap: 2px; }
.ana-pie-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  font-size: 13px;
}
.ana-pie-row:last-child { border-bottom: none; }
.ana-pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ana-year-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 2px 10px;
}
.ana-year-nav {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  gap: 4px;
}
.ana-year-nav button {
  width: 28px;
  height: 28px;
}
.ana-year-nav .ym {
  min-width: 64px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}
.ana-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}
.ana-line-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.ana-line-svg {
  display: block;
  width: 100%;
  height: auto;
}
.ana-bar-amt {
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 2.5px;
}
.ana-year-nav button:disabled { opacity: 0.35; cursor: default; }
.ana-pie-name { flex: 1; min-width: 0; }
.ana-pie-pct { color: #94a3b8; font-size: 12px; }
.ana-pie-amt { font-weight: 700; font-variant-numeric: tabular-nums; }

.debt-seg-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  padding: 2px 0 10px;
  margin: 0 0 2px;
  flex-shrink: 0;
}
.debt-seg-bar .tabs {
  flex: 1;
  margin-bottom: 0;
}
.debt-seg-bar .link {
  flex-shrink: 0;
  padding: 0 2px;
}
.debt-body {
  min-height: 0;
}
.debt-sum {
  padding: 12px 14px 12px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #fff8f8 0%, #fff1f2 100%);
}
.debt-sum-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.debt-sum-item .k {
  font-size: 11px;
  color: #64748b;
}
.debt-sum-item .v {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
}
.debt-sum-int {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #fecdd3;
}
.debt-split-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #fecdd3;
}
.debt-sum-int-card .debt-split-bars {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.debt-split-col { min-width: 0; }
.debt-split-col .debt-sum-int-row {
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.debt-split-col .debt-sum-int-row span:first-child {
  font-size: 10px;
}
.debt-split-col .debt-sum-int-row span:last-child {
  font-size: 12px;
}
.debt-sum-int-card {
  padding: 10px 14px 12px;
  margin-bottom: 10px;
}
.debt-sum-int-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}
.debt-sum-int-row span:last-child {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 13px;
}

/* 展望：仅月份列表滚动（底部 tab 由 #app.home-lock 预留） */
.page-outlook {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 8px;
  width: 100%;
}
.page-outlook .nav-bar {
  flex-shrink: 0;
}
.page-outlook .debt-outlook-top {
  flex-shrink: 0;
}
.page-outlook .debt-outlook-top .outlook-prefs {
  margin-bottom: 8px;
}
.page-outlook .debt-outlook-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 16px;
}
.outlook-head,
.outlook-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.outlook-row {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.outlook-head {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 10px 0 8px;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  font-size: 10px;
  font-weight: 650;
  color: #94a3b8;
  line-height: 1.2;
}
.outlook-head > span:first-child { flex: 1; min-width: 0; text-align: center; }
.outlook-head-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 6.5em;
  text-align: center;
}
.outlook-head > span:last-child {
  flex-shrink: 0;
  min-width: 6.5em;
  text-align: center;
}
.outlook-row.neg,
.outlook-row.pos,
.outlook-row.current {
  margin: 0 -14px;
  padding: 12px 14px;
  border-radius: 10px;
  border-bottom-color: transparent;
}
.outlook-row.neg { background: #fef2f2; }
.outlook-row.pos { background: #f0fdf4; }
.outlook-row.current {
  background: #f0f9ff;
}
.outlook-row .outlook-net {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
}
.outlook-net .net-chg { font-size: 10px; margin-left: 0; }
.outlook-net .arc-arrow { width: 12px; height: 12px; }
.outlook-dep { flex-shrink: 0; }
.outlook-prefs label {
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.outlook-prefs input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  font-size: 15px;
}
.outlook-ym { flex: 1; min-width: 0; }
.outlook-ym .strong { white-space: nowrap; }
.outlook-grid {
  margin-top: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;
}
.outlook-meta {
  grid-column: 1;
  grid-row: 1;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.outlook-spendable {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  text-align: left;
}
.outlook-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
  font-size: 10px;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
}
.outlook-meta-row span:last-child {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.outlook-col {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  text-align: left;
}
.outlook-dep {
  grid-column: 2;
  grid-row: 2;
  flex-shrink: 0;
}
.outlook-col-k {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.2;
}
.outlook-col .outlook-net + .outlook-col-k { margin-top: 8px; }
.outlook-net {
  flex-shrink: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  min-width: 0;
  text-align: left;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex-wrap: wrap;
}
.outlook-pct {
  flex-shrink: 0;
  width: 3.2em;
  text-align: right;
  font-size: 12px;
  align-self: center;
}

.form label { display: block; margin: 12px 0 6px; font-size: 13px; color: var(--muted); }
.form input, .form select {
  width: 100%; padding: 11px 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb;
}
.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.types button {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 10px; padding: 10px 4px; cursor: pointer; font-size: 13px;
}
.types button.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

.bar-row { margin-bottom: 12px; font-size: 14px; }
.is-tx-detail { cursor: pointer; }
.bar-row.is-tx-detail:active,
.ana-ratio-row.is-tx-detail:active,
.trend-bar.is-tx-detail:active,
.mine-stat-bar-row.is-tx-detail:active,
.debt-split-col.is-tx-detail:active { opacity: 0.72; }
.bar-top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.track { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.fill { height: 100%; border-radius: 999px; background: var(--primary); }
.fill.income { background: var(--ok); }

.export-box { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ana-ratio-row { margin-bottom: 14px; }
.ana-ratio-row:last-child { margin-bottom: 0; }
.ana-ratio-row .row-between { font-size: 13px; margin-bottom: 6px; }
.trend-block {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}
.trend-block:last-child { border-bottom: none; padding-bottom: 0; }
.trend-block:first-child { padding-top: 0; }
.trend-bars { display: flex; flex-direction: column; gap: 6px; }
.trend-bar {
  display: grid; grid-template-columns: 20px 1fr 40px; gap: 8px; align-items: center;
  font-size: 12px; color: var(--muted);
}
.trend-bar em { font-style: normal; text-align: right; color: var(--ink); font-weight: 600; }
.kpi2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.kpi2 .card { margin: 0; }
.big { font-size: 24px; font-weight: 700; margin-top: 4px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 50;
}
.tabbar button {
  border: none; background: transparent; color: #9ca3af; font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.tabbar button.on { color: var(--primary); font-weight: 700; }
.tabbar .ico-svg {
  width: 24px; height: 24px; display: block;
  stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.tabbar button.on .ico-svg { stroke-width: 2.2; }

.back { border: none; background: none; color: var(--primary); font-size: 14px; cursor: pointer; margin-bottom: 8px; padding: 0; }
.del { color: var(--danger); font-size: 12px; border: none; background: none; cursor: pointer; }
.edit-link { color: var(--primary); font-size: 12px; border: none; background: none; cursor: pointer; margin-right: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.day { width: 48px; color: var(--primary); font-weight: 700; }
.flex1 { flex: 1; min-width: 0; }

.inst-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #f8fafc;
}
.inst-card .inst-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.inst-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.inst-grid label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.inst-grid input {
  width: 100%; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; font-size: 14px;
  box-sizing: border-box; background: #fff;
}
.inst-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn.sm { padding: 8px 12px; font-size: 13px; margin: 0; }
.btn.danger-ghost {
  background: #fff; color: var(--danger); border: 1px solid #fecaca;
}
.row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tx-row.tx-edit { cursor: pointer; }
.tx-row.tx-edit:active { background: #f8fafc; }
.tx-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
}
.tx-meta {
  margin-top: 3px;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
  line-height: 1.3;
}
.form label { display: block; margin: 10px 0 4px; font-size: 13px; color: #6b7280; }
.form input, .form select {
  width: 100%; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 10px 12px; font-size: 15px; background: #fff;
}
.msg-ok { color: #059669; font-size: 13px; margin-top: 8px; }
.msg-err { color: var(--danger); font-size: 13px; margin-top: 8px; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-mask.modal-lock {
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  box-sizing: border-box;
}
.modal-mask.modal-lock .modal-sheet {
  width: 100%;
  max-width: 360px;
  max-height: min(88vh, 520px);
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
}
#modal-root .modal-mask:nth-child(n+2) { z-index: 110; }
.modal-sheet {
  width: 100%; max-width: 480px; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,.12);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.modal-close {
  border: none; background: #f3f4f6; width: 32px; height: 32px;
  border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; color: #6b7280;
}
.tx-detail-sheet { max-height: 92vh; }
.txd { display: flex; flex-direction: column; gap: 10px; }
.txd-types { display: flex; gap: 6px; flex-wrap: wrap; }
.txd-types button {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 12px; cursor: pointer; color: #475569;
}
.txd-types button.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.txd-filters {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.txd-row { display: grid; gap: 8px; align-items: end; }
.txd-dates { grid-template-columns: 1fr 12px 1fr; }
.txd-sels { grid-template-columns: 1fr 1fr; }
.txd-span { grid-column: 1 / -1; }
.txd-cell { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.txd-cell span {
  font-size: 11px;
  font-weight: 650;
  color: #94a3b8;
  letter-spacing: 0.02em;
}
.txd-dash {
  display: block;
  height: 2px;
  margin: 0 0 19px;
  background: #cbd5e1;
  border-radius: 2px;
}
.txd-ctrl {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e5e7eb;
  font-size: 13px;
  color: #111827;
  box-sizing: border-box;
}
select.txd-ctrl {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2394a3b8' d='M1.2 1.2L6 6l4.8-4.8' stroke='%2394a3b8' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
input[type="date"].txd-ctrl {
  appearance: none;
  -webkit-appearance: none;
  line-height: 40px;
}
.txd-ctrl:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px #7dd3fc;
}
.txd-search {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #e5e7eb;
  overflow: hidden;
}
.txd-search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: none;
  background: transparent;
  padding: 0 12px;
  font-size: 13px;
}
.txd-search input:focus { outline: none; }
.txd-go {
  flex-shrink: 0;
  margin: 4px;
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.txd-sum { font-size: 12px; color: #64748b; }
.txd-list { max-height: 42vh; overflow: auto; -webkit-overflow-scrolling: touch; }
.sched-row {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid #f1f5f9;
}
.sched-row:last-child { border-bottom: none; }
.sched-row .muted { font-size: 12px; }
.sched-month.is-paid {
  background: #ecfdf5;
  border-radius: 12px;
  padding: 4px 8px 8px;
  border-bottom: none;
  margin: 4px 0 8px;
}
.sched-row.is-paid {
  background: #ecfdf5;
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
  margin: 0 -4px;
}
.sched-month:last-child { border-bottom: none; }
.sched-month-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 8px 0 4px; flex-wrap: wrap;
}
.sched-month .sched-row { padding-left: 4px; }
.sched-check {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none; flex-shrink: 0;
}
.sched-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.sched-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 0 2px 8px; font-size: 13px;
}
.sched-month-head .inst-del-month {
  margin-left: auto;
}

/* 平台详情：顶部固定，仅计划列表滚动 */
.page-platform {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  padding-bottom: 0;
}
.page-platform .plat-top {
  flex-shrink: 0;
}
.page-platform .plat-top .nav-bar {
  margin-bottom: 8px;
}
.plat-card-actions {
  margin-bottom: 8px;
}
.plat-card-actions .row-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.page-platform .plat-top .card {
  margin-bottom: 8px;
}
.page-platform .plat-top .sec {
  margin-bottom: 4px;
}
.page-platform .plat-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  margin-bottom: 0;
  padding-bottom: 4px;
}

/* 月历 */
.cal-panel { margin-bottom: 12px; }
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-nav .ym { font-size: 17px; font-weight: 700; }
.cal-nav button {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 8px;
  width: 36px; height: 36px; font-size: 18px; cursor: pointer; color: var(--ink);
}
.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px; margin-bottom: 4px; text-align: center;
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1; border: none; background: #f8fafc; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; cursor: default; padding: 0; position: relative;
  font-size: 13px; color: var(--ink);
}
.cal-cell.empty { background: transparent; }
.cal-cell.today { background: #e0f2fe; font-weight: 700; color: var(--primary); }
.cal-cell.has-due { cursor: pointer; }
.cal-cell.has-due .cal-dot {
  width: 5px; height: 5px; border-radius: 50%; background: #f97316;
}
.cal-cell.has-due .cal-dot.todo { background: #f97316; }
.cal-cell.has-due .cal-dot.partial {
  background: linear-gradient(135deg, #f97316 50%, #16a34a 50%);
}
.cal-cell.has-due .cal-dot.paid,
.cal-cell.has-due .cal-dot.ok { background: #16a34a; }
.cal-cell.has-due .cal-dot.overdue { background: #dc2626; }
.cal-cell.on {
  background: var(--primary); color: #fff; font-weight: 700;
}
.cal-cell.on .cal-dot.todo { background: #fdba74; }
.cal-cell.on .cal-dot.partial {
  background: linear-gradient(135deg, #fdba74 50%, #86efac 50%);
}
.cal-cell.on .cal-dot.paid,
.cal-cell.on .cal-dot.ok { background: #86efac; }
.cal-cell.on .cal-dot.overdue { background: #fca5a5; }
.cal-cell.mute { color: #cbd5e1; }
.cal-day-tip {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid #f1f5f9;
  font-size: 13px;
}

/* 总览综合日历格子：显示消费额 */
.home-cal .cal-cell {
  aspect-ratio: auto;
  min-height: 52px;
  padding: 4px 2px;
  gap: 1px;
}
.home-cal .cal-cell .d {
  font-size: 12px; font-weight: 600; line-height: 1.1;
}
.home-cal .cal-cell .amt {
  font-size: 9px; font-weight: 700; line-height: 1.1;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-cal .cal-cell .amt-pos { color: var(--ok); }
.home-cal .cal-cell .amt-neg { color: var(--danger); }
.home-cal .cal-cell .amt-zero { color: var(--muted); }
.home-cal .cal-cell.on .amt-pos { color: #bbf7d0; }
.home-cal .cal-cell.on .amt-neg { color: #fecaca; }
.home-cal .cal-cell.on .amt-zero { color: #e5e7eb; }
.home-cal .cal-cell .cal-dot {
  position: absolute; top: 4px; right: 4px;
}
.home-sum {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-bottom: 12px;
}
.home-sum.home-sum-noddebt {
  grid-template-columns: repeat(3, 1fr);
}
.home-sum .item {
  background: #f8fafc; border-radius: 10px; padding: 8px 4px; text-align: center;
}
.home-sum .k { font-size: 11px; color: var(--muted); }
.home-sum .v { font-size: 12px; font-weight: 700; margin-top: 2px; }
.detail-block { margin-top: 12px; }
.detail-block .title {
  font-size: 13px; font-weight: 700; margin-bottom: 0; color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 4px;
}
.due-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.mark-paid.mark-roll {
  color: #c2410c;
  border-color: #fdba74;
  background: #fff7ed;
}
.mark-paid {
  flex-shrink: 0;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.menu-list { padding: 4px 8px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 8px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}
.menu-item:last-child { border-bottom: none; }
.menu-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.menu-ico .ico-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-label { flex: 1; }
.menu-chevron {
  width: 18px;
  height: 18px;
  stroke: #d1d5db;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.menu-item-danger .menu-label { color: var(--danger); }
.menu-item-danger .menu-ico { background: #fef2f2; color: var(--danger); }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  font-weight: 500;
  margin: 4px 0;
}
.check-row input { margin-top: 2px; }

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-avatar .avatar-digit {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.profile-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bae6fd;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.profile-avatar .avatar-ico {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.profile-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eye-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  align-self: flex-start;
}
.eye-btn:active { background: #f9fafb; }
.eye-ico {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sec-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.sec-tab {
  flex: 1;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
}
.sec-tab.on {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}
#m-sec-panel {
  min-height: 72px;
  margin-bottom: 10px;
}

.form label.mfa-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  font-size: 15px;
  color: #111827;
  cursor: pointer;
}
.form label.mfa-choice input[type="radio"] {
  width: auto;
  flex: 0 0 auto;
  margin: 3px 0 0;
  padding: 0;
  accent-color: var(--primary);
}
.form label.mfa-choice .mfa-choice-txt {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.form label.mfa-choice .mfa-choice-txt strong {
  font-weight: 600;
}
.form label.mfa-choice .mfa-choice-txt .muted {
  display: block;
  margin-top: 2px;
}
.view-banner {
  margin: 8px 12px 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ece9ff, #e7fff6);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: #3b3560;
  box-sizing: border-box;
}
.view-banner > span {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.view-banner > .link {
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.4;
  padding: 4px 0;
  border: none;
  background: none;
  color: #5b4cf0;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.due-cfg {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #eee);
}
.due-cfg .cfg-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.due-cfg .tip {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
}
.due-cfg .rem-card {
  background: #f7f8fc;
  border: 1px solid var(--line, #ece9ff);
  border-radius: 12px;
  padding: 8px 10px;
  margin: 0 0 8px;
}
.due-cfg .rem-card-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.due-cfg .rem-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 12px;
}
.due-cfg .rem-field-time {
  flex: 0.85;
}
.due-cfg .rem-k {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
}
.due-cfg .rem-card select,
.due-cfg .rem-card input[type='time'] {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 8px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font: inherit;
  font-weight: 650;
}
.due-cfg .rem-del {
  flex-shrink: 0;
  align-self: flex-end;
  margin: 0;
  padding: 8px 2px;
  border: none;
  background: none;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
}
.due-cfg .rem-del:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.due-cfg .rem-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.due-cfg .self-test-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
}
.switch-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
}
.hint-pad { padding: 0 16px 8px; }
.scope-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.scope-row:last-child { border-bottom: none; }
.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.person-row:last-child { border-bottom: none; }
.copy-row { display: flex; gap: 20px; justify-content: center; margin-top: 12px; }
.bio-pad {
  margin: 20px auto 0;
  width: 160px;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.bio-pad .fp {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 40% 32%, #fff, #ece9ff 55%, #c9c2ff);
  box-shadow: 0 10px 24px rgba(109, 94, 252, 0.22);
}
.bio-pad .fp-ring {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 4px solid #6d5efc;
  opacity: 0.35;
}
.bio-pad .fp-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 48px;
  margin: -24px 0 0 -18px;
  border-radius: 18px;
  border: 4px solid #6d5efc;
}
.bio-pad .bio-cap { font-size: 14px; color: var(--primary); font-weight: 700; }
