/* 清账 · 个人债务台账（方案 B 视觉 + 左侧导航） */
:root {
  --paper: #f7f5f0;
  --card: #fffefb;
  --ink: #26251f;
  --ink-2: #4f4d45;
  --muted: #7d7a70;
  --line: #e6e1d6;
  --line-soft: #f0ece3;
  --green: #1f6f5c;
  --green-soft: #e9f2ee;
  --terra: #b96636;
  --terra-soft: #fbf0e8;
  --gold: #a8863d;
  --red: #b4463a;
  --red-soft: #fbeeeb;
  --shadow-sm: 0 1px 2px rgba(60, 52, 36, .04);
  --shadow-md: 0 14px 40px rgba(60, 52, 36, .07);
  --shadow-lg: 0 30px 80px rgba(60, 52, 36, .16);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center;
  padding: 40px 28px;
  background:
    radial-gradient(900px 600px at 8% 0%, #fffdf7, transparent 65%),
    radial-gradient(700px 500px at 95% 100%, #efe9dc, transparent 62%),
    var(--paper);
}
.login-inner {
  width: min(1120px, 100%);
  display: grid; grid-template-columns: 1.08fr .92fr;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-md);
  min-height: 620px;
}
.login-art {
  position: relative; padding: 56px 58px;
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 92% 8%, #eef3ee 0, transparent 46%),
    radial-gradient(circle at 6% 92%, #f6eee6 0, transparent 48%),
    #fbfaf5;
  overflow: hidden;
}
.login-art::after {
  content: ""; position: absolute; right: -110px; bottom: -130px;
  width: 360px; height: 360px; border-radius: 50%;
  border: 1px solid #e6e0d2;
  box-shadow: 0 0 0 26px rgba(230,224,210,.18), 0 0 0 54px rgba(230,224,210,.1);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 60px; position: relative; z-index: 1; }
.logo {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: #fff; font-family: var(--serif); font-size: 19px;
  flex: none;
}
.login-logo b { font-family: var(--serif); font-size: 20px; letter-spacing: .12em; }
.login-logo em {
  font-style: normal; font-size: 9px; letter-spacing: .16em; color: var(--muted);
  padding-left: 14px; border-left: 1px solid var(--line);
}
.login-art h1 {
  margin: 0 0 22px; font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 4vw, 58px); line-height: 1.24; letter-spacing: -.02em;
  position: relative; z-index: 1;
}
.login-lede { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 2; position: relative; z-index: 1; }
.art-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  margin-top: 66px; position: relative; z-index: 1;
}
.art-stats b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.art-stats span { display: block; margin-top: 6px; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.art-line { height: 1px; background: var(--line); margin-top: 30px; width: 82%; position: relative; z-index: 1; }

.login-box { display: grid; align-items: center; padding: 52px 56px; }
.login-box form { width: 100%; max-width: 340px; margin: 0 auto; }
.login-eyebrow { margin: 0 0 14px; font-size: 10px; letter-spacing: .2em; color: var(--gold); }
.login-box h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: -.01em; }
.login-sub { margin: 0 0 32px; font-size: 12px; color: var(--muted); }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 11px; color: var(--ink-2); letter-spacing: .04em; margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fdfcf8; outline: none; font-size: 13px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { height: auto; padding: 11px 14px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #9cbcae; box-shadow: 0 0 0 3px rgba(31,111,92,.08); background: #fff;
}
.login-error { min-height: 18px; font-size: 11.5px; color: var(--red); margin: -4px 0 10px; }
.btn-primary {
  width: 100%; height: 48px; border: 0; border-radius: 12px;
  background: var(--green); color: #fff; font-size: 14px; letter-spacing: .06em;
  box-shadow: 0 10px 24px rgba(31,111,92,.18);
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(31,111,92,.24); }
.btn-quiet {
  width: 100%; height: 44px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--ink-2); font-size: 12px;
}
.btn-quiet:hover { background: #faf8f2; }
.login-hint { margin: 20px 0 0; font-size: 10.5px; line-height: 1.8; color: #a7a398; text-align: center; }

/* ---------- 框架 ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 26px 20px 22px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfaf5, #f6f3ec);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand .logo { width: 38px; height: 38px; font-size: 17px; }
.brand b { display: block; font-family: var(--serif); font-size: 17px; letter-spacing: .1em; }
.brand small { display: block; margin-top: 3px; font-size: 8px; letter-spacing: .16em; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 36px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  border: 0; background: transparent; border-radius: 12px;
  padding: 11px 13px; text-align: left; font-size: 13px; color: var(--muted);
  transition: background .2s, color .2s;
}
.nav-item svg { flex: none; opacity: .8; }
.nav-item:hover { color: var(--ink); background: #f0ece1; }
.nav-item.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(60,52,36,.08); }
.nav-item.active svg { color: var(--green); opacity: 1; }

.side-card {
  margin-top: 28px; padding: 16px 18px 15px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.side-label { display: block; font-size: 10px; letter-spacing: .06em; color: var(--muted); }
.side-total {
  display: block; margin-top: 7px;
  font-family: var(--serif); font-size: 24px; font-weight: 500;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.side-bar { height: 4px; border-radius: 2px; background: #efeade; margin: 13px 0 7px; overflow: hidden; }
.side-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: linear-gradient(90deg, #2f8b74, #a9c9bb); transition: width .3s; }
.side-meta { font-size: 9.5px; color: var(--muted); }
.side-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft);
  font-size: 10.5px; color: var(--muted);
}
.side-row b { font-size: 12.5px; color: var(--ink-2); font-weight: 550; font-variant-numeric: tabular-nums; }

.side-user { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 0 6px; }
.side-user small { display: block; font-size: 9px; color: var(--muted); letter-spacing: .04em; }
.side-user b { display: block; margin-top: 3px; font-size: 12px; font-weight: 550; color: var(--ink-2); }
.side-user-actions { display: flex; gap: 4px; }
.user-action {
  border: 0; background: transparent; color: var(--muted); padding: 6px;
  border-radius: 8px; display: inline-grid; place-items: center; line-height: 1;
  transition: background .15s, color .15s;
}
.user-action:hover { color: var(--ink); background: #f0ece1; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 17px 40px 15px;
  background: rgba(247,245,240,.88); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(230,225,214,.7);
}
.crumb { margin: 0 0 5px; font-size: 9px; letter-spacing: .18em; color: var(--muted); }
.topbar h1 { margin: 0; font-family: var(--serif); font-size: 23px; font-weight: 500; letter-spacing: .02em; }
.top-right { display: flex; align-items: center; gap: 9px; }
.base-tag { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; margin-right: 4px; }

.wrap { width: min(1120px, calc(100% - 80px)); margin: 0 auto; padding: 32px 0 56px; flex: 1; }
.site-foot {
  width: min(1120px, calc(100% - 80px)); margin: 0 auto; padding: 18px 0 30px;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted);
}
.site-foot button { border: 0; background: transparent; color: var(--muted); font-size: 10.5px; }
.site-foot button:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 250px; gap: 28px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 26px;
  padding: 38px 44px; box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.hero-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.hero-eyebrow i { width: 26px; height: 1px; background: var(--green); }
.hero-total { margin: 16px 0 6px; font-size: clamp(38px, 4.4vw, 56px); letter-spacing: -.045em; font-weight: 500; font-variant-numeric: tabular-nums; }
.hero-total small { font-size: 18px; font-weight: 400; color: var(--ink-2); margin-left: 10px; }
.hero-note { font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.hero-note b { color: var(--green); font-weight: 600; }
.hero-progress { height: 6px; border-radius: 3px; background: #eee9dd; margin: 26px 0 10px; overflow: hidden; max-width: 420px; }
.hero-progress i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #2f8b74, #9fc3b7); }
.hero-progress-meta { display: flex; justify-content: space-between; max-width: 420px; font-size: 10px; color: var(--muted); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; background: #f3efe6;
  font-size: 10.5px; color: var(--ink-2);
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.chip.terra i { background: var(--terra); }

.hero-ring { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.donut {
  position: relative; width: 168px; height: 168px; border-radius: 50%;
  background: conic-gradient(var(--green) 0 47.7%, var(--terra) 0 100%);
  display: grid; place-items: center;
}
.donut::after {
  content: ""; position: absolute; inset: 13px; border-radius: 50%;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line-soft);
}
.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center b { display: block; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.donut-center span { display: block; margin-top: 4px; font-size: 9px; letter-spacing: .08em; color: var(--muted); }
.ring-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; font-size: 10.5px; color: var(--muted); }
.ring-legend span { display: flex; align-items: center; gap: 6px; }
.ring-legend i { width: 7px; height: 7px; border-radius: 2px; }

/* ---------- 统计 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 34px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.stat span { font-size: 10.5px; color: var(--muted); letter-spacing: .05em; }
.stat b { display: block; margin-top: 9px; font-size: 21px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.stat em { display: block; margin-top: 7px; font-style: normal; font-size: 10px; color: var(--muted); }
.stat.accent b { color: var(--green); }

.insight {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; border-radius: 16px;
  background: #fdf7ef; border: 1px solid #efe3d1;
}
.insight > i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--terra); margin-top: 5px; }
.insight b { display: block; font-size: 11.5px; color: var(--ink); }
.insight p { margin: 4px 0 0; font-size: 10.5px; line-height: 1.75; color: var(--muted); }

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin: 0 0 18px;
}
.section-head h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: -.01em; }
.section-head p { margin: 5px 0 0; font-size: 11px; color: var(--muted); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.btn {
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 12px; color: var(--ink-2); transition: all .15s;
}
.btn:hover { border-color: #c9c3b5; }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 8px 20px rgba(31,111,92,.16); }
.btn.primary:hover { background: #1b6150; }
.btn.small { height: 32px; padding: 0 13px; font-size: 11px; }
.btn.danger { color: var(--red); border-color: #ecd4cf; background: var(--red-soft); }
.link { border: 0; background: transparent; color: var(--green); font-size: 11.5px; padding: 4px; }
.link:hover { text-decoration: underline; }

/* ---------- 债务卡片 ---------- */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 7px 15px; font-size: 11.5px; color: var(--muted);
}
.filter-chip:hover { color: var(--ink); }
.filter-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted);
}
.search input { width: 160px; border: 0; outline: 0; background: transparent; font-size: 11.5px; }
.search:focus-within { border-color: #a9c4b8; box-shadow: 0 0 0 3px rgba(31,111,92,.07); }

.debt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.debt-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px 22px 18px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.debt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d5cfc1; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.card-name h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.badge {
  font-size: 9px; line-height: 1; padding: 4px 7px; border-radius: 999px;
  background: #f3efe6; color: var(--muted); white-space: nowrap;
}
.badge.bank { background: #eef2ee; color: var(--green); }
.badge.card { background: #f4eee2; color: #8a6d3b; }
.badge.online { background: #e9f1f3; color: #26717d; }
.badge.private { background: var(--terra-soft); color: var(--terra); }
.badge.secret { background: #f3e9e1; color: #8d5b2b; }
.rate-chip { font-size: 10.5px; color: var(--muted); background: #f6f2ea; padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.rate-chip.high { color: var(--red); background: var(--red-soft); }
.card-balance { margin-top: 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-balance span { font-size: 10px; color: var(--muted); }
.card-balance b { font-size: 22px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.card-bar { height: 4px; border-radius: 2px; background: #efeade; margin: 12px 0 15px; overflow: hidden; }
.card-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #2f8b74, #a9c9bb); }
.card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 4px; }
.card-meta span { display: block; font-size: 9.5px; color: var(--muted); margin-bottom: 5px; }
.card-meta b { display: block; font-size: 11.5px; font-weight: 550; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line-soft); font-size: 10px; color: var(--muted); }
.card-foot .more { color: var(--green); opacity: 0; transition: opacity .15s; }
.debt-card:hover .card-foot .more { opacity: 1; }

.empty { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 12px; background: var(--card); border: 1px dashed var(--line); border-radius: 18px; }

/* ---------- 债务明细表 ---------- */
.toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sort-select {
  height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink-2); font-size: 11.5px; outline: none;
}
.sort-select:focus { border-color: #a9c4b8; box-shadow: 0 0 0 3px rgba(31,111,92,.07); }

.ledger-summary {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px;
  margin: 0 4px 10px; font-size: 11px; color: var(--muted);
}
.ledger-summary b { color: var(--ink); font-weight: 550; font-variant-numeric: tabular-nums; }
.ledger {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.ledger-scroll { overflow-x: auto; }
.ledger table { width: 100%; border-collapse: collapse; min-width: 980px; }
.ledger thead th {
  text-align: left; padding: 13px 16px; font-size: 9.5px; font-weight: 500;
  letter-spacing: .08em; color: var(--muted); background: #faf8f2;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ledger thead th.num { text-align: right; }
.ledger tbody td {
  padding: 15px 16px; border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--ink-2); vertical-align: middle; white-space: nowrap;
}
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr { cursor: pointer; transition: background .15s; }
.ledger tbody tr:hover { background: #fbfaf6; }
.ledger .col-name { min-width: 190px; white-space: normal; }
.col-name b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.col-name span {
  display: block; margin-top: 4px; font-size: 9.5px; color: var(--muted);
  max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger td.balance { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.col-method { color: var(--muted); }
.rate-val { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--green); }
.rate-val.mid { color: #b96636; }
.rate-val.high { color: var(--red); }
.rate-val.muted { color: var(--muted); font-weight: 400; }
.col-progress { width: 120px; }
.mini-track {
  display: inline-block; width: 58px; height: 4px; border-radius: 999px;
  background: #ece8de; overflow: hidden; vertical-align: middle;
}
.mini-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2f8b74, #a9c9bb); }
.col-progress em { font-style: normal; margin-left: 7px; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ledger .col-actions { text-align: right; white-space: nowrap; }
.col-actions button {
  border: 0; background: transparent; padding: 4px 5px; font-size: 10.5px; color: var(--muted);
}
.col-actions button:hover { color: var(--green); }
.col-actions button.danger:hover { color: var(--red); }

/* ---------- 还款时间线 ---------- */
.timeline { background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.timeline-day { border-bottom: 1px solid var(--line-soft); }
.timeline-day:last-child { border-bottom: 0; }
.day-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 24px; background: #faf8f2; font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.day-head b { color: var(--ink-2); font-weight: 550; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1.4fr) .8fr .6fr .6fr auto; align-items: center; gap: 16px; padding: 15px 24px; border-top: 1px solid var(--line-soft); font-size: 11.5px; }
.pay-row:first-child { border-top: 0; }
.pay-name { font-size: 12.5px; font-weight: 550; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.pay-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pay-num b { font-size: 13px; color: var(--ink); }
.pay-num span { display: block; font-size: 9px; color: var(--muted); margin-top: 2px; }
.pay-note { text-align: right; color: var(--muted); font-size: 10.5px; }
.pay-empty { padding: 50px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(38, 33, 25, .42);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.dialog-layer {
  position: fixed; inset: 0; z-index: 80; padding: 26px;
  display: grid; place-items: center;
  background: rgba(38, 33, 25, .46); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.dialog-layer.open { opacity: 1; pointer-events: auto; }
.dialog {
  width: 100%; max-width: 600px; max-height: 90vh; overflow: auto;
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow-lg);
  transform: translateY(12px); transition: transform .22s;
}
.dialog.wide { max-width: 680px; }
.dialog-layer.open .dialog { transform: none; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 28px 30px 16px; }
.dialog-head h3 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 500; }
.dialog-head p { margin: 6px 0 0; font-size: 10.5px; color: var(--muted); }
.close-x {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 17px; line-height: 1;
  display: grid; place-items: center; flex: none;
}
.close-x:hover { background: #f6f2e9; color: var(--ink); }
.dialog-body { padding: 6px 30px 8px; }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 30px 26px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { min-height: 18px; font-size: 11.5px; color: var(--red); margin: 2px 0 0; }
.secret-line { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-size: 11px; color: var(--muted); }
.secret-line input { width: 16px; height: 16px; accent-color: var(--green); }

.preview-line {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 14px; padding: 13px 16px; border-radius: 12px;
  background: #f2f7f4; border: 1px solid #dce9e2; font-size: 10.5px; color: var(--muted);
}
.preview-line b { font-size: 15px; color: var(--green); font-variant-numeric: tabular-nums; }

.detail-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.detail-balance { font-size: 38px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.detail-of { font-size: 11px; color: var(--muted); }
.detail-progress { height: 5px; border-radius: 3px; background: #efeade; margin: 18px 0 8px; overflow: hidden; }
.detail-progress i { display: block; height: 100%; background: linear-gradient(90deg, #2f8b74, #a9c9bb); }
.detail-meta { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 24px; }
.detail-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: 14px; overflow: hidden;
}
.detail-cell { background: var(--card); padding: 13px 14px; }
.detail-cell span { display: block; font-size: 9.5px; color: var(--muted); }
.detail-cell b { display: block; margin-top: 6px; font-size: 12px; font-weight: 550; font-variant-numeric: tabular-nums; }
.detail-note { margin: 16px 0 0; padding: 13px 15px; background: #faf8f2; border-radius: 12px; font-size: 11px; line-height: 1.8; color: var(--ink-2); }
.detail-sub { margin: 26px 0 10px; font-family: var(--serif); font-size: 16px; font-weight: 500; }
.mini-list { border-top: 1px solid var(--line-soft); }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.mini-row span { color: var(--muted); }
.mini-row b { font-variant-numeric: tabular-nums; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 100;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; font-size: 12px;
  padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d6d0c2; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }

@media (max-width: 1180px) {
  .wrap, .site-foot { width: calc(100% - 48px); }
  .topbar { padding: 16px 24px 14px; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .login-inner { grid-template-columns: 1fr; min-height: 0; }
  .login-art { padding: 40px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .login-logo { margin-bottom: 34px; }
  .login-art h1 { font-size: 38px; }
  .art-stats { margin-top: 36px; }
  .login-box { padding: 40px; }

  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 14px; padding: 14px 20px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; }
  .brand small { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 2px; margin: 0; margin-left: auto; }
  .nav-item { width: auto; padding: 8px 13px; font-size: 12px; }
  .side-card { display: none; }
  .side-user { margin: 0; }

  .topbar { position: static; }
  .hero { grid-template-columns: 1fr; }
  .hero-ring { flex-direction: row; justify-content: flex-start; gap: 28px; }
  .debt-grid { grid-template-columns: 1fr; }
  .pay-row { grid-template-columns: minmax(0, 1.4fr) .8fr .6fr; }
  .pay-row .pay-num:nth-child(4), .pay-row .pay-note { display: none; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .sidebar { padding: 12px 14px; }
  .base-tag { display: none; }
  .topbar { padding: 14px 16px 12px; }
  .topbar h1 { font-size: 20px; }
  .top-right { gap: 7px; }
  .btn { height: 34px; padding: 0 13px; font-size: 11.5px; }
  .wrap, .site-foot { width: calc(100% - 32px); }
  .hero { padding: 26px 22px; border-radius: 20px; }
  .stat-row { gap: 10px; grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 15px 16px; }
  .stat b { font-size: 18px; }
  .art-stats { grid-template-columns: 1fr; gap: 14px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- 还款登记 ---------- */
.repay-layout {
  display: grid; grid-template-columns: 322px minmax(0, 1fr);
  gap: 18px; align-items: start;
}
.repay-form-card, .schedule-card, .history-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-sm);
}
.repay-form-card { padding: 22px 22px 20px; }
.repay-eyebrow {
  margin: 0 0 5px; font-size: 9px; letter-spacing: .16em; color: var(--muted);
}
.repay-form-card h3 { margin: 0 0 16px; font-size: 17px; font-weight: 600; }
.repay-form-card .field { margin-bottom: 12px; }
.repay-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.repay-mini-grid .field { margin-bottom: 0; }
.repay-fill {
  display: block; margin: 10px 0 12px auto; padding: 0;
  border: 0; background: transparent; color: var(--green); font-size: 10.5px;
}
.repay-fill:hover { text-decoration: underline; }
.repay-calc {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px;
  padding: 10px 0; margin-bottom: 12px;
  border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line);
  font-size: 10px; color: var(--muted);
}
.repay-calc b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.repay-hint { margin: 10px 0 14px; font-size: 10px; line-height: 1.7; color: var(--muted); }
.repay-actions { display: flex; justify-content: flex-end; gap: 8px; }
.repay-form-card textarea { resize: vertical; }

.schedule-card { min-width: 0; display: flex; flex-direction: column; }
.side-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 17px 20px 13px; border-bottom: 1px solid var(--line-soft);
}
.side-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.side-head > div > span {
  display: block; margin-top: 3px; font-size: 8.5px; letter-spacing: .14em; color: var(--muted);
}
.side-figure { text-align: right; }
.side-figure b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.side-figure span { font-size: 10px; color: var(--muted); }
.schedule-scroll { overflow: auto; max-height: 432px; }
.history-scroll { overflow: auto; max-height: 320px; }
.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th {
  position: sticky; top: 0; z-index: 1; background: #faf8f2; text-align: left;
  padding: 10px 14px; font-size: 9px; letter-spacing: .06em; font-weight: 500;
  color: var(--muted); border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.mini-table th.num { text-align: right; }
.mini-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 10.5px; color: var(--ink-2); white-space: nowrap;
}
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.schedule-note {
  margin: 0; padding: 9px 16px 12px; font-size: 9.5px; color: var(--muted);
  border-top: 1px solid var(--line-soft);
}
.schedule-empty { padding: 64px 24px; text-align: center; font-size: 11px; line-height: 1.8; color: var(--muted); }
.history-card { margin-top: 18px; }
.history-name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.history-note { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.history-empty { padding: 30px 16px; text-align: center; color: var(--muted); }

@media (max-width: 980px) {
  .repay-layout { grid-template-columns: 1fr; }
  .schedule-scroll { max-height: 380px; }
}

/* ---------- 还款计划 ---------- */
.plan-controls-card {
  display: grid; grid-template-columns: minmax(240px, 1.2fr) 1fr auto;
  gap: 20px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.plan-budget-label { display: block; font-size: 9.5px; letter-spacing: .12em; color: var(--muted); }
.plan-budget-input { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; }
.plan-budget-input > span { font-family: var(--serif); font-size: 20px; color: var(--muted); }
.plan-budget-input input {
  width: 100%; min-width: 0; border: 0; border-bottom: 1px solid transparent; padding: 0 0 2px;
  background: transparent; outline: none; font-family: var(--serif); font-size: 30px;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  transition: border-color .15s;
}
.plan-budget-input input:focus { border-bottom-color: var(--green); }
.plan-budget-hint { margin: 6px 0 0; font-size: 10px; color: var(--muted); }
.plan-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plan-presets > span { width: 100%; font-size: 9px; letter-spacing: .12em; color: var(--muted); }
.plan-preset {
  border: 1px solid var(--line); background: #fdfcf8; border-radius: 999px;
  padding: 6px 11px; font-size: 10.5px; color: var(--ink-2); white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.plan-preset:hover { border-color: #bcd4c9; background: var(--green-soft); color: var(--green); }
.plan-strategy-wrap { min-width: 168px; }
.plan-strategy-label { display: block; font-size: 9px; letter-spacing: .12em; color: var(--muted); margin-bottom: 7px; text-align: right; }
.plan-tabs { display: flex; gap: 3px; padding: 4px; border-radius: 12px; background: #f3efe5; }
.plan-tab {
  border: 0; background: transparent; border-radius: 9px; padding: 7px 11px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.plan-tab.active { background: var(--card); color: var(--ink); font-weight: 550; box-shadow: var(--shadow-sm); }

.plan-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 26px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 28px 32px; box-shadow: var(--shadow-sm);
}
.plan-big {
  margin: 10px 0 7px; font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 4vw, 48px); line-height: 1.15; letter-spacing: -.04em;
}
.plan-sub { margin: 0; font-size: 11px; line-height: 1.9; color: var(--muted); }
.plan-metrics {
  display: grid; grid-template-columns: repeat(3, minmax(104px, 1fr)); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: 14px; overflow: hidden;
}
.plan-metric { background: var(--card); padding: 13px 15px; }
.plan-metric span { display: block; font-size: 9px; color: var(--muted); }
.plan-metric b { display: block; margin-top: 6px; font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; }
.plan-metric b.warn { color: var(--red); }
.plan-warn { margin-top: 14px; }

.plan-chart-card, .plan-debt-card {
  margin-top: 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-sm); overflow: hidden;
}
.plan-chart { padding: 16px 20px 0; }
.plan-chart svg { display: block; width: 100%; height: 178px; }
.plan-chart-x {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 2px 15px; font-size: 9px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.plan-table-scroll { overflow: auto; }
.plan-debt-card .mini-table th, .plan-debt-card .mini-table td { padding: 11px 18px; }
.plan-debt-name { font-weight: 550; color: var(--ink); }
.plan-payoff { font-variant-numeric: tabular-nums; display: inline-block; }
.plan-payoff em { display: block; margin-top: 3px; font-style: normal; font-size: 9px; color: var(--muted); }
.plan-unpaid { font-size: 10px; color: var(--red); }

@media (max-width: 1180px) {
  .plan-controls-card { grid-template-columns: minmax(0, 1fr) auto; }
  .plan-strategy-wrap { grid-column: 1 / -1; }
  .plan-strategy-label { text-align: left; }
}
@media (max-width: 980px) {
  .plan-hero { grid-template-columns: 1fr; }
  .plan-metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .plan-controls-card { grid-template-columns: 1fr; padding: 17px 18px; }
  .plan-presets { gap: 5px; }
  .plan-hero { padding: 24px 22px; border-radius: 18px; }
  .plan-big { font-size: 34px; }
  .plan-metrics { grid-template-columns: 1fr 1fr; }
  .plan-chart { padding: 14px 12px 0; }
  .plan-chart svg { height: 150px; }
}

/* ---------- 个人设置 ---------- */
.settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.settings-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px 26px; box-shadow: var(--shadow-sm);
}
.settings-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.settings-hint { margin: 6px 0 18px; font-size: 10.5px; color: var(--muted); line-height: 1.7; }
.settings-field { margin-bottom: 14px; }
.settings-field label {
  display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .04em; margin-bottom: 6px;
}
.settings-field input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fdfcf8; outline: none; font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.settings-field input:focus {
  border-color: #9cbcae; box-shadow: 0 0 0 3px rgba(31,111,92,.08); background: #fff;
}
.settings-field input[disabled] {
  background: #f4f1e9; color: var(--muted); cursor: not-allowed;
}
.settings-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.settings-error { font-size: 11px; color: var(--red); flex: 1; }
.loading-block { padding: 60px 0; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 980px) {
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .settings-card { padding: 20px 18px; }
}

