/* ============================================================
   资产管家 · 样式表
   浅色/深色双主题，全部色值集中在 :root / [data-theme="dark"]
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2430;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --primary: #3b6ef5;
  --primary-soft: #eaf0fe;
  --danger: #e5484d;
  --success: #18a058;
  --up: #e5484d;      /* 涨 / 盈 */
  --down: #18a058;    /* 跌 / 亏 */
  --gold: #d4a017;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --card-2: #fafbfc;
  --line-soft: #f2f3f5;
  --hover: #fafbfd;
  --input-bg: #ffffff;
  --seg-bg: #f0f1f3;
  --warn-bg: #fff4e5;
  --warn-border: #ffd8a8;
  --warn-text: #7a4b00;
  --ok-bg: #e9f8ef;
  --ok-border: #bbe8cb;
  --ok-text: #12643a;
}

[data-theme="dark"] {
  --bg: #14161c;
  --card: #1c1f27;
  --text: #e8eaef;
  --text-sub: #9aa1ad;
  --border: #2b2f3a;
  --primary: #5b8cff;
  --primary-soft: #1e2a47;
  --danger: #ff6b6f;
  --success: #34c77b;
  --up: #ff6b6f;
  --down: #34c77b;
  --gold: #e0b53c;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  --card-2: #22262f;
  --line-soft: #262a33;
  --hover: #23272f;
  --input-bg: #191c23;
  --seg-bg: #262a33;
  --warn-bg: #33280f;
  --warn-border: #5c4616;
  --warn-text: #f0c674;
  --ok-bg: #12301f;
  --ok-border: #1d5334;
  --ok-text: #6fd79b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: hidden;
  overscroll-behavior-x: none;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
  header { padding-top: env(safe-area-inset-top); }
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
b, strong { font-weight: 700; }
::selection { background: var(--primary-soft); }

/* ================= 顶部导航 ================= */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.logo .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--primary), #7c5cf0);
  flex: none;
}

.logo .logo-txt {
  flex: 0 0 auto;
  white-space: nowrap;
  word-break: keep-all;
}

.app-ver {
  font-size: 11px;
  font-weight: 400;
  color: #9aa0a6;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

nav.top-nav {
  display: flex;
  gap: 2px;
  flex: 1 1 auto;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
nav.top-nav::-webkit-scrollbar { display: none; }

nav.top-nav button {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
  font-weight: 500;
}
nav.top-nav button:hover { background: var(--hover); color: var(--text); }
nav.top-nav button.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

.acct {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.acct-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}
.acct-badge.local { background: var(--seg-bg); color: var(--text-sub); }

.acct-name {
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 2px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ================= 主体 ================= */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px 64px;
}

.page { display: none; }
.page.active { display: block; animation: fade .18s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ================= 卡片 ================= */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.card-head h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2px;
}

.sub-text {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.7;
}

.hint-line {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px dashed var(--border);
}

/* ================= 统计卡 ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  min-width: 0;
}

.stat-card .label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.stat-card .st-delta { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.stat-card .value {
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 800;
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  word-break: break-all;
}
.stat-card .value.pos { color: var(--up); }
.stat-card .value.neg { color: var(--down); }
.stat-card .value.blue { color: var(--primary); }
.stat-card .sub { font-size: 11.5px; color: var(--text-sub); margin-top: 5px; line-height: 1.5; }

/* ================= 走势图 ================= */
.chart-wrap {
  position: relative;
  height: 220px;
  margin: 4px 0 2px;
}
.chart-wrap canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(16, 24, 40, .16);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .12s;
  z-index: 5;
  font-variant-numeric: tabular-nums;
}
.chart-tip.on { opacity: 1; }
.chart-tip b { font-weight: 700; }
.chart-tip .t-date { color: var(--text-sub); font-size: 11.5px; margin-bottom: 2px; }
.chart-tip .t-row { display: flex; align-items: center; gap: 6px; }
.chart-tip .t-dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }

.trend-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-sub);
  padding: 2px 0 6px;
}
.trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trend-legend i { width: 9px; height: 3px; border-radius: 2px; display: inline-block; }
.trend-legend b { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }

.trend-range {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.tr-chip {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.tr-chip:hover { background: var(--hover); }
.tr-chip.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

.trend-day {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

/* ================= 各分类市值 ================= */
.cat-list { display: flex; flex-direction: column; gap: 10px; }

.cat-row {
  display: grid;
  grid-template-columns: 92px 1fr 104px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.cat-row .cat-nm {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-row .cat-nm i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
.cat-row .cat-track {
  height: 8px;
  border-radius: 99px;
  background: var(--seg-bg);
  overflow: hidden;
}
.cat-row .cat-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}
.cat-row .cat-amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.cat-row .cat-amt small { color: var(--text-sub); font-weight: 400; margin-left: 4px; font-size: 11.5px; }

/* ================= 按钮 ================= */
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(.5px); }
.btn.primary, .btn.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.ghost, .btn.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-sub);
  font-weight: 500;
}
.btn.ghost:hover, .btn.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--danger); border-color: var(--border); background: transparent; }
.btn.sm, .btn.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ================= 表格 ================= */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--hover); }
.num-r { text-align: right; font-variant-numeric: tabular-nums; }
.td-nm { white-space: normal; min-width: 120px; }
.td-nm .nm { font-weight: 600; }
.td-nm .code { font-size: 11.5px; color: var(--text-sub); margin-left: 5px; }
.pos { color: var(--up); }
.neg { color: var(--down); }
.muted { color: var(--text-sub); }

.cat-group-row td {
  background: var(--card-2);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}
.cat-group-row .g-amt { float: right; font-variant-numeric: tabular-nums; color: var(--text); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions button {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12.5px;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 6px;
}
.row-actions button:hover { background: var(--primary-soft); }
.row-actions button.del { color: var(--danger); }
.row-actions button.del:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* ================= 空状态 ================= */
.empty {
  text-align: center;
  color: var(--text-sub);
  font-size: 13px;
  padding: 34px 16px;
  line-height: 1.9;
}
.empty .big { font-size: 26px; display: block; margin-bottom: 6px; opacity: .5; }

/* ================= chip ================= */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 10px; }
.chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-sub);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
}
.chip:hover { background: var(--hover); }
.chip.on { background: var(--primary-soft); border-color: transparent; color: var(--primary); font-weight: 700; }

/* ================= 分段控件 ================= */
.seg {
  display: flex;
  gap: 4px;
  background: var(--seg-bg);
  padding: 3px;
  border-radius: 10px;
}
.seg button {
  flex: 1 1 0;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button.on { background: var(--card); color: var(--text); font-weight: 700; box-shadow: var(--shadow); }

/* ================= 自由之路 ================= */
.fr-quote {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-sub);
  letter-spacing: .5px;
  margin: 2px 0 12px;
}

.fr-hero {
  text-align: center;
  padding: 26px 16px 22px;
  background: linear-gradient(160deg, var(--primary-soft) 0%, var(--card) 72%);
}
.fr-label { font-size: 13px; color: var(--text-sub); letter-spacing: .5px; }
.fr-big {
  font-size: clamp(26px, 6.6vw, 38px);
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  margin: 6px 0 4px;
  line-height: 1.2;
  word-break: break-all;
}
.fr-sub { font-size: 13px; color: var(--text-sub); }

.fr-pad { padding: 0 2px; }

.fr-dots {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-sub);
  margin: 14px 0 6px;
}
.fr-dots span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.fr-dots i {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--seg-bg);
  border: 1px solid var(--border);
}
.fr-dots span.on i { background: var(--primary); border-color: var(--primary); }
.fr-dots span.on { color: var(--primary); font-weight: 700; }

.fr-bar-wrap { padding: 4px 2px 0; }
.fr-track {
  position: relative;
  height: 34px;
  display: flex;
  align-items: center;
}
.fr-bar-bg {
  width: 100%;
  height: 12px;
  border-radius: 99px;
  background: var(--seg-bg);
  overflow: hidden;
}
.fr-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7c5cf0, var(--primary));
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
  position: relative;
}
.fr-fire {
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-style: normal;
  line-height: 1;
}

.fr-pct {
  position: absolute;
  top: -14px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  transition: left .5s cubic-bezier(.2, .8, .2, 1);
  white-space: nowrap;
}

.fr-scale {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 8px;
}
.fr-scale b { color: var(--text); font-variant-numeric: tabular-nums; }

.fr-other-div {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card-2);
}

.fr-level {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.7;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.fr-level.warm { background: var(--warn-bg); color: var(--warn-text); font-weight: 500; }

.fr-foot { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.fr-foot-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-sub);
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.fr-foot-row:last-child { border-bottom: none; padding-bottom: 0; }
.fr-foot-row b { color: var(--text); font-variant-numeric: tabular-nums; }

.fr-cnt { font-size: 12.5px; color: var(--text-sub); }

/* ================= 主动收入 ================= */
.inc-hero {
  text-align: center;
  padding: 24px 16px 20px;
  background: linear-gradient(160deg, var(--primary-soft) 0%, var(--card) 70%);
}
.inc-label { font-size: 13px; color: var(--text-sub); letter-spacing: .5px; }
.inc-big {
  font-size: clamp(26px, 7vw, 38px);
  font-weight: 800;
  letter-spacing: -1px;
  margin: 6px 0 4px;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  word-break: break-all;
}
.inc-sub { font-size: 13px; color: var(--text-sub); line-height: 1.6; }

.inc-list { padding: 2px 2px 4px; }
.inc-month {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-sub);
}
.inc-month b { font-size: 14px; color: var(--text); }
.inc-month .sum { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

.inc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.inc-row:last-child { border-bottom: none; }
.inc-row .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inc-row .nm small { color: var(--text-sub); margin-left: 6px; font-size: 11.5px; }
.inc-row .amt { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ================= 资讯 ================= */
.news-list { display: flex; flex-direction: column; }
.news-item {
  padding: 12px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.news-item:last-child { border-bottom: none; }
.news-item .n-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-sub);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.news-item .n-tag {
  flex: none;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.news-item .n-tag.hit { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.news-item .n-title { font-size: 13.8px; line-height: 1.65; font-weight: 600; }
.news-item .n-title .kw { color: var(--danger); }
.news-item .n-body { font-size: 12.8px; color: var(--text-sub); line-height: 1.7; margin-top: 4px; }

/* ================= 分红跑马灯 ================= */
#div-marquee {
  overflow: hidden;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 0;
  margin-bottom: 14px;
  white-space: nowrap;
  position: relative;
}
#div-marquee::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--card), transparent 6%, transparent 94%, var(--card));
}
#div-marquee-in {
  display: inline-block;
  padding-left: 100%;
  font-size: 12.5px;
  color: var(--text-sub);
  animation: marquee 32s linear infinite;
}
#div-marquee-in span { margin-right: 26px; }
#div-marquee-in b { color: var(--up); font-variant-numeric: tabular-nums; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ================= 弹窗 ================= */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 24, .46);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-mask.on { display: flex; }

.modal {
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(8, 12, 20, .28);
  animation: pop .18s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--text-sub); }

input[type="text"], input[type="number"], input[type="password"],
input[type="date"], input[type="email"], select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  padding: 9px 11px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }

.input-with-unit { display: flex; align-items: stretch; }
.input-with-unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-with-unit span {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 10px 10px 0;
  background: var(--card-2);
  white-space: nowrap;
}

.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-foot .btn.ghost { margin-right: auto; }

/* ================= Toast ================= */
#toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 12px);
  background: rgba(24, 27, 34, .94);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 4000;
  max-width: 86vw;
  text-align: center;
  line-height: 1.5;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: rgba(200, 40, 45, .96); }
#toast.ok { background: rgba(20, 130, 75, .96); }

/* ================= 登录门 ================= */
#auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
#auth-gate.on { display: flex; }

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(8, 12, 20, .12);
  padding: 26px 22px 22px;
  width: 100%;
  max-width: 400px;
  margin: auto;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}
.auth-brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--primary), #7c5cf0);
}
.auth-sub {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 18px;
}
.auth-tabs { margin-bottom: 16px; }
.auth-fields { display: flex; flex-direction: column; gap: 11px; }
.auth-err {
  font-size: 12.5px;
  color: var(--danger);
  min-height: 18px;
  line-height: 1.6;
  margin-top: 4px;
}
.auth-tip {
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.8;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  text-align: center;
}
.auth-tip a { color: var(--primary); text-decoration: none; cursor: pointer; }

/* ================= 设置 / 资料 ================= */
.settings-body { font-size: 13.5px; line-height: 1.8; color: var(--text-sub); }
.settings-body p { margin-bottom: 10px; }
.settings-body b { color: var(--text); }

.fx-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--text-sub);
}
.fx-row input { max-width: 150px; }

.kv-list { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.kv-row:last-child { border-bottom: none; padding-bottom: 0; }
.kv-row .k { color: var(--text-sub); }
.kv-row .v { font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-all; text-align: right; }

/* ================= 底部标签栏（移动端） ================= */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
}
.tabbar button {
  flex: 1 1 0;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 10.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  cursor: pointer;
}
.tabbar button svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tabbar button.active { color: var(--primary); font-weight: 700; }

/* ================= 响应式 ================= */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  header { padding: 0 12px; }
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 9px 0;
    gap: 8px;
  }
  .logo { font-size: 16px; }
  nav.top-nav { display: none; }
  .tabbar { display: flex; }
  main { padding: 14px 12px 86px; }
  .card { padding: 15px 14px; border-radius: 13px; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 12px 13px; }
  .chart-wrap { height: 186px; }
  .cat-row { grid-template-columns: 74px 1fr 88px; font-size: 12.5px; }
  .hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 16px 15px; max-height: 92vh; }
  th, td { padding: 9px 8px; }
  .fr-big { font-size: clamp(24px, 8vw, 32px); }
}

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

/* 打印时去掉交互外壳 */
@media print {
  header, .tabbar, .modal-mask, #toast, #auth-gate { display: none !important; }
  main { padding: 0; }
  .card { box-shadow: none; }
}

/* ============================================================
   家庭共享相关：视角条 / 同步状态 / 成员标签 / 成员管理
   ============================================================ */

/* ---- 视角切换条（贴在上栏下方） ---- */
.scope-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 24px;
  border-top: 1px solid var(--line-soft);
  overflow: hidden;
}
.scope-cap { flex: none; font-size: 12px; color: var(--text-sub); }
.scope-chips {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.scope-chips::-webkit-scrollbar { display: none; }
.scope-chip {
  flex: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-sub);
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.scope-chip:hover { background: var(--hover); }
.scope-chip.on { background: var(--primary-soft); border-color: transparent; color: var(--primary); font-weight: 700; }

.sync-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-sub);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sync-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--success); display: inline-block; }
.sync-dot.busy { background: var(--gold); animation: syncPulse 1.2s infinite; }
.sync-dot.err { background: var(--danger); }
.sync-dot.warn { background: var(--text-sub); }
@keyframes syncPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---- 成员标签 ---- */
.otag {
  display: inline-block;
  font-size: 10.5px;
  line-height: 1.5;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--seg-bg);
  color: var(--text-sub);
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}
.otag.mine { background: var(--primary-soft); color: var(--primary); }

/* ---- 总览：成员对比 ---- */
.member-list { display: flex; flex-direction: column; gap: 12px; }
.mrow {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.mrow:hover { background: var(--hover); border-color: var(--primary); }
.mrow-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 13.5px; }
.mrow-name { font-weight: 700; }
.mrow-name small { color: var(--text-sub); font-weight: 400; margin-left: 6px; font-size: 11.5px; }
.mrow-net { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); white-space: nowrap; }
.mrow-bars { display: flex; flex-direction: column; gap: 5px; margin: 9px 0 8px; }
.mrow-track { height: 7px; border-radius: 99px; background: var(--seg-bg); overflow: hidden; }
.mrow-track.debt { height: 5px; }
.mrow-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s ease; }
.mrow-track.debt .mrow-fill { background: var(--danger); }
.mrow-meta { font-size: 11.5px; color: var(--text-sub); font-variant-numeric: tabular-nums; }

/* ---- 成员管理列表 ---- */
.member-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 10px;
}
.member-row:last-child { margin-bottom: 0; }
.member-row.off { opacity: .62; }
.mr-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.mr-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mr-stat { font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.mr-sub { display: flex; gap: 14px; font-size: 11.5px; margin-top: 6px; flex-wrap: wrap; }
.role-badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--seg-bg);
  color: var(--text-sub);
  font-weight: 600;
  white-space: nowrap;
}
.role-badge.owner { background: var(--primary-soft); color: var(--primary); }
.role-badge.admin { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); }
.role-badge.readonly { background: var(--line-soft); }
.role-badge.off { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.perm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 9px 0; }
.perm-chip {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-sub);
}
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; }
.perm-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  cursor: pointer;
}
.perm-item input { width: 15px; height: 15px; flex: none; }

/* ---- 操作日志 ---- */
.audit-list { display: flex; flex-direction: column; }
.audit-row {
  display: grid;
  grid-template-columns: 118px 84px 104px 1fr;
  gap: 8px;
  font-size: 12.5px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.audit-row:last-child { border-bottom: none; }
.audit-row .a-time { color: var(--text-sub); font-variant-numeric: tabular-nums; }
.audit-row .a-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-row .a-act { color: var(--primary); white-space: nowrap; }
.audit-row .a-detail { color: var(--text-sub); word-break: break-all; }

/* ---- 账本选择门 ---- */
#ledger-gate {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
#ledger-gate.on { display: flex; }
.lg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.lg-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13.5px;
  text-align: left;
}
.lg-item:hover { background: var(--hover); border-color: var(--primary); }
.lg-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-meta { flex: none; font-size: 11.5px; color: var(--text-sub); }
.invite-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 640px) {
  .scope-bar { padding: 7px 12px; gap: 8px; }
  .audit-row { grid-template-columns: 96px 62px 88px 1fr; font-size: 11.5px; }
  .mrow-net { font-size: 12.5px; }
}

/* ============================================================
   自由之路 · 成长之路（生活化 / 卡通）
   ============================================================ */

.fr-quote { position: relative; }
.fr-quote .q-emoji { display: inline-block; animation: bob 2.6s ease-in-out infinite; }

/* ---- 天空卡片 ---- */
.fr-sky-card {
  position: relative;
  overflow: hidden;
  padding: 42px 20px 20px;
  background: linear-gradient(180deg, #eaf3ff 0%, var(--card) 52%, var(--card) 100%);
  border-radius: var(--radius);
}
.fr-sky-card .age-row,
.fr-sky-card .hero-num,
.fr-sky-card .road,
.fr-sky-card .mini-stats,
.fr-sky-card .plan-row,
.fr-sky-card #fr-actual { position: relative; z-index: 1; }
[data-theme="dark"] .fr-sky-card { background: linear-gradient(180deg, #1b2334 0%, var(--card) 50%, var(--card) 100%); }

.fr-sky-card .sky { position: absolute; inset: 0 0 auto 0; height: 92px; pointer-events: none; z-index: 0; }
.fr-sky-card .sun {
  position: absolute; right: 14px; top: 4px; font-size: 30px; line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(255, 190, 60, .45));
  animation: sunPulse 3.4s ease-in-out infinite;
}
.fr-sky-card .cloud { position: absolute; font-size: 22px; opacity: .85; animation: drift 9s ease-in-out infinite; }
.fr-sky-card .cloud.c1 { left: 7%; top: 20px; font-size: 19px; animation-delay: -2s; }
.fr-sky-card .cloud.c2 { left: 44%; top: 6px; font-size: 14px; opacity: .5; animation-delay: -5s; }
.fr-sky-card .grass {
  position: absolute; bottom: -6px; height: 14px; width: 46%;
  border-radius: 50% 50% 0 0; opacity: .28;
}
.fr-sky-card .grass.g1 { left: -6%; background: radial-gradient(ellipse at 50% 100%, #34c77b, transparent 70%); }
.fr-sky-card .grass.g2 { right: -6%; background: radial-gradient(ellipse at 50% 100%, #7c5cf0, transparent 70%); }

@keyframes sunPulse {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50% { transform: scale(1.09) rotate(3deg); }
}
@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(14px); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ---- 年龄行 ---- */
.age-row {
  position: relative;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-sub);
  margin-bottom: 14px;
}
.age-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px 4px 12px;
  box-shadow: var(--shadow);
  color: var(--text-sub);
  white-space: nowrap;
}
.age-pill input {
  width: 56px; border: none !important; background: transparent !important;
  padding: 2px 0 !important; font-weight: 800; font-size: 15px;
  color: var(--primary); text-align: center; box-shadow: none !important;
  -moz-appearance: textfield;
}
.age-pill input::-webkit-outer-spin-button,
.age-pill input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.age-arrow { color: var(--text-sub); opacity: .7; }
.age-left {
  margin-left: auto; font-size: 12px; padding: 3px 10px;
  border-radius: 999px; background: var(--primary-soft); color: var(--primary);
  font-weight: 600; white-space: nowrap;
}

/* ---- 大数字 ---- */
.hero-num { text-align: center; padding: 2px 0 12px; }
.hero-num .hn-label { font-size: 12.5px; color: var(--text-sub); letter-spacing: .4px; }
.hero-num .hn-big {
  font-size: clamp(27px, 7vw, 40px); font-weight: 800; letter-spacing: -1px;
  color: var(--primary); line-height: 1.15; margin: 4px 0 2px;
  font-variant-numeric: tabular-nums; word-break: break-all;
}
.hero-num .hn-sub { font-size: 12.5px; color: var(--text-sub); }

/* ---- 小路进度 ---- */
.road { position: relative; padding: 6px 2px 0; }
.road-track {
  position: relative; height: 16px; border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--seg-bg) 0 10px, var(--line-soft) 10px 20px);
  border: 1px solid var(--border);
  overflow: visible;
}
.road-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ffd166, #34c77b 55%, #3b6ef5);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .02) inset;
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
  position: relative;
}
.road-fill::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 60%);
}
.road-walker {
  position: absolute; top: -20px; font-size: 22px; line-height: 1;
  transform: translateX(-50%);
  transition: left .6s cubic-bezier(.2, .8, .2, 1);
  animation: bob 1.6s ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .2));
  z-index: 2;
}
.road-meta {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--text-sub); margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.road-meta #fr-level { color: var(--primary); font-weight: 700; }

/* ---- 四个小指标 ---- */
.mini-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 14px;
}
.ms {
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 11px; padding: 9px 8px; text-align: center;
  min-width: 0;
}
.ms b {
  display: block; font-size: 14px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ms span { font-size: 11px; color: var(--text-sub); }

.plan-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-top: 12px; font-size: 12.5px; color: var(--text-sub);
}
.plan-row label { display: inline-flex; align-items: center; gap: 6px; }
.plan-row input {
  width: 92px; padding: 6px 9px; font-size: 13px; font-weight: 700;
  border-radius: 9px; text-align: right; font-variant-numeric: tabular-nums;
}

/* ---- 关卡地图 ---- */
.level-chip {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  padding: 1px 8px; border-radius: 999px; margin-left: 6px;
  background: var(--primary-soft); color: var(--primary);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.path { position: relative; padding: 6px 0 2px; }
.pnode {
  position: relative;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 9px 0;
  animation: fade .3s ease both;
}
.pnode:nth-child(even) { margin-left: 16px; }
.pnode:nth-child(even) .pcard { background: var(--card-2); }
.pnode::before {
  content: ""; position: absolute; left: 21px; top: 0; bottom: 0;
  border-left: 2px dashed var(--border); z-index: 0;
}
.pnode:first-child::before { top: 28px; }
.pnode:last-child::before { bottom: calc(100% - 30px); }

.pdot {
  position: relative; z-index: 1; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 21px; line-height: 1;
  background: var(--card); border: 2px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.pnode:hover .pdot { transform: translateY(-2px) scale(1.05); }

.pcard {
  flex: 1 1 auto; min-width: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s;
}
.pnode:hover .pcard { transform: translateX(2px); }

.ptop { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ptop b { font-size: 14px; }
.psub { font-size: 11.5px; color: var(--text-sub); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pmeta { font-size: 11.5px; color: var(--text-sub); margin-top: 6px; line-height: 1.6; }
.pmeta b { color: var(--text); }

.pbar {
  height: 7px; border-radius: 999px; background: var(--seg-bg);
  overflow: hidden; margin-top: 8px;
}
.pbar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ffd166, #3b6ef5);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.pbade {
  flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; white-space: nowrap;
  background: var(--seg-bg); color: var(--text-sub);
}
.pbade.free {
  background: linear-gradient(135deg, #d7f7e4, #c9f0dd);
  color: #106b3d;
  animation: pop .45s ease;
  box-shadow: 0 0 0 1px rgba(52, 199, 123, .28);
}
[data-theme="dark"] .pbade.free { background: linear-gradient(135deg, #123d27, #10301f); color: #6fd79b; }
.pbade.part { background: var(--primary-soft); color: var(--primary); }
.pbade.lock { background: var(--line-soft); color: var(--text-sub); }
.pbade.age { background: var(--primary-soft); color: var(--primary); }

/* 关卡状态 */
.pnode.free .pdot {
  border-color: #34c77b;
  background: radial-gradient(circle at 30% 25%, #ffffff, #e6fbf0 70%);
  box-shadow: 0 0 0 4px rgba(52, 199, 123, .14), 0 4px 12px rgba(52, 199, 123, .22);
}
[data-theme="dark"] .pnode.free .pdot { background: radial-gradient(circle at 30% 25%, #1d2b23, #14251b 70%); }
.pnode.free .pcard { border-color: rgba(52, 199, 123, .42); }
.pnode.free .pbar i { background: linear-gradient(90deg, #8ce8b4, #34c77b); }

.pnode.partial .pdot { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent); }
.pnode.partial .pcard { border-color: color-mix(in srgb, var(--primary) 36%, var(--border)); }

.pnode.locked .pdot { opacity: .62; filter: grayscale(.5); }
.pnode.locked .pbar i { background: var(--border); }

.pnode.finish .pdot { font-size: 22px; }
.pnode.finish.free .pdot { animation: pop .5s ease; }
.pnode.start .pdot { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 14%, transparent); }

.path-tip {
  margin-top: 12px; padding: 10px 12px; line-height: 1.8;
  background: var(--card-2); border: 1px dashed var(--border); border-radius: 10px;
}
.path-tip b { color: var(--primary); }

@keyframes pop {
  0% { transform: scale(.86); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ---- 生活开支清单 ---- */
.life-list { display: flex; flex-direction: column; gap: 8px; }
.life-row {
  display: flex; align-items: center; gap: 11px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 12px; background: var(--card);
  transition: background .15s, border-color .15s, transform .15s;
}
.life-row:hover { background: var(--hover); transform: translateX(2px); }
.life-row.free { border-color: rgba(52, 199, 123, .4); background: linear-gradient(90deg, color-mix(in srgb, #34c77b 8%, var(--card)), var(--card) 55%); }

.lr-emoji {
  flex: none; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; font-size: 19px;
  background: var(--card-2); border: 1px solid var(--border);
}
.life-row.free .lr-emoji { background: color-mix(in srgb, #34c77b 14%, var(--card)); border-color: rgba(52, 199, 123, .35); }
.lr-main { flex: 1 1 auto; min-width: 0; }
.lr-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lr-sub { font-size: 11.5px; color: var(--text-sub); margin-top: 2px; font-variant-numeric: tabular-nums; }
.lr-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lr-right .row-actions button:disabled { opacity: .3; cursor: not-allowed; }

/* ---- 图标选择 ---- */
.emoji-pick {
  display: flex; flex-wrap: wrap; gap: 6px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; background: var(--card-2);
  max-height: 132px; overflow-y: auto;
}
.emoji-btn {
  width: 34px; height: 34px; border-radius: 9px; font-size: 18px; line-height: 1;
  border: 1px solid transparent; background: var(--card); cursor: pointer;
  transition: transform .12s, border-color .12s, background .12s;
  display: grid; place-items: center;
}
.emoji-btn:hover { transform: translateY(-2px) scale(1.06); }
.emoji-btn.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }

@media (max-width: 640px) {
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .ms b { font-size: 13px; }
  .pnode:nth-child(even) { margin-left: 8px; }
  .pdot { width: 38px; height: 38px; font-size: 18px; }
  .pnode::before { left: 18px; }
  .pnode { gap: 9px; }
  .pcard { padding: 9px 10px; }
  .age-left { margin-left: 0; }
  .life-row { flex-wrap: wrap; }
  .lr-right { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .plan-row input { width: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  .fr-sky-card .sun, .fr-sky-card .cloud, .road-walker, .fr-quote .q-emoji { animation: none !important; }
}

/* ============================================================
   收益概览（动态行情）
   ============================================================ */
.pnl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 4px 0 2px;
}
.pnl-item {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  min-width: 0;
}
.pnl-item span { display: block; font-size: 11.5px; color: var(--text-sub); margin-bottom: 4px; }
.pnl-item b {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
  display: block;
  word-break: break-all;
}
.pnl-item b.pos { color: var(--up); }
.pnl-item b.neg { color: var(--down); }
#pnl-card .sub-text { line-height: 1.7; }
#quote-auto {
  font-size: 12.5px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-sub);
  max-width: 130px;
}

/* ============================================================
   本月零花钱
   ============================================================ */
#card-money .card-head input[type="number"] {
  width: 96px;
  padding: 6px 9px;
  font-size: 13.5px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.money-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0 12px;
  flex-wrap: wrap;
}
.mh-label { font-size: 12.5px; color: var(--text-sub); }
.mh-big {
  font-size: clamp(24px, 6vw, 34px);
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--text);
  word-break: break-all;
}
.mh-big.pos { color: var(--success); }
.mh-big.neg { color: var(--danger); }
.mh-side {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.mh-side div { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--text-sub); }
.mh-side b { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }

.money-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--seg-bg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.money-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #34c77b, #3b6ef5);
  transition: width .45s cubic-bezier(.2, .8, .2, 1);
}
.money-bar i.warn { background: linear-gradient(90deg, #ffd166, #f59e0b); }
.money-bar i.over { background: linear-gradient(90deg, #ff8a8a, #e5484d); }

/* ============================================================
   导入持仓预览
   ============================================================ */
.import-preview { margin-top: 12px; }
.import-preview table { font-size: 12.5px; }
.import-preview th, .import-preview td { padding: 7px 8px; }
.import-preview .pbade { font-size: 10.5px; }

/* ============================================================
   操作日志里的字段差异
   ============================================================ */
.audit-row .dfd {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 5px;
  margin: 2px 4px 2px 0;
  color: var(--text);
}

@media (max-width: 900px) {
  .pnl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .pnl-item { padding: 9px 10px; }
  .pnl-item b { font-size: 15px; }
  .money-hero { gap: 10px; }
  .mh-side { gap: 12px; }
  #card-money .card-head input[type="number"] { width: 84px; }
}

/* ============================================================
   留言板 · 卡通便利贴
   ============================================================ */
.notes-card { position: relative; overflow: hidden; }
.notes-card::after {
  content: "📌";
  position: absolute;
  right: 14px;
  top: 8px;
  font-size: 22px;
  opacity: .35;
  transform: rotate(12deg);
  pointer-events: none;
}
.notes-sub { font-size: 12px; font-weight: 400; color: var(--text-sub); margin-left: 6px; }

.notes-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px 14px;
  padding: 14px 2px 6px;
}

/* 便利贴本体 */
.note {
  position: relative;
  border-radius: 4px 4px 10px 4px;
  padding: 22px 14px 12px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff6c9;
  color: #4a3b12;
  box-shadow: 0 6px 14px rgba(16, 24, 40, .10), 0 1px 0 rgba(0, 0, 0, .03) inset;
  transform: rotate(var(--rot, 0deg));
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s;
  cursor: default;
  animation: noteIn .32s cubic-bezier(.2, .8, .2, 1) both;
}
.note.editable { cursor: pointer; }
.note.editable:hover,
.note:hover {
  transform: rotate(0deg) translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(16, 24, 40, .16);
  z-index: 3;
}
@keyframes noteIn {
  from { opacity: 0; transform: translateY(8px) rotate(var(--rot, 0deg)) scale(.96); }
  to { opacity: 1; transform: rotate(var(--rot, 0deg)); }
}

/* 胶带 */
.note-tape {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 66px;
  height: 18px;
  transform: translateX(-50%) rotate(-2.5deg);
  background: rgba(255, 255, 255, .55);
  border-left: 1px dashed rgba(255, 255, 255, .85);
  border-right: 1px dashed rgba(255, 255, 255, .85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.note:hover .note-tape { transform: translateX(-50%) rotate(1.5deg); }

.note-top { display: flex; align-items: center; gap: 6px; }
.note-emoji { font-size: 17px; line-height: 1; }
.note-author {
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  color: rgba(0, 0, 0, .55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72%;
}
.note-text {
  flex: 1 1 auto;
  font-size: 13.5px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}
.note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.note-date { font-size: 11px; color: rgba(0, 0, 0, .42); white-space: nowrap; }
.note-reacts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(0, 0, 0, .07);
  background: rgba(255, 255, 255, .55);
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 12px;
  line-height: 1.6;
  cursor: pointer;
  transition: transform .12s, background .12s, border-color .12s;
  color: inherit;
}
.react-btn i { font-style: normal; font-size: 11px; font-weight: 700; }
.react-btn:hover { transform: translateY(-1px) scale(1.06); background: rgba(255, 255, 255, .85); }
.react-btn.on { background: #fff; border-color: rgba(0, 0, 0, .18); box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }

/* 8 种便利贴配色（浅色主题） */
.note.c0 { background: #fff6c9; color: #5b4713; }   /* 柠檬黄 */
.note.c1 { background: #ffe0e6; color: #6b2233; }   /* 樱花粉 */
.note.c2 { background: #d9f2e6; color: #12503a; }   /* 薄荷绿 */
.note.c3 { background: #dce9ff; color: #1b3a6b; }   /* 天空蓝 */
.note.c4 { background: #eee4ff; color: #402a63; }   /* 薰衣草 */
.note.c5 { background: #ffe6cf; color: #6b3d13; }   /* 蜜桃橙 */
.note.c6 { background: #e4f5c9; color: #3a5413; }   /* 青草绿 */
.note.c7 { background: #d9f4f7; color: #14494f; }   /* 湖水青 */

/* 深色主题：降低亮度、提高文字对比 */
[data-theme="dark"] .note { box-shadow: 0 6px 16px rgba(0, 0, 0, .45); }
[data-theme="dark"] .note.c0 { background: #4a421e; color: #f7ecb8; }
[data-theme="dark"] .note.c1 { background: #4a2833; color: #ffd9e2; }
[data-theme="dark"] .note.c2 { background: #1d3f33; color: #c8f2de; }
[data-theme="dark"] .note.c3 { background: #1e334f; color: #cfe2ff; }
[data-theme="dark"] .note.c4 { background: #33284a; color: #e4d8ff; }
[data-theme="dark"] .note.c5 { background: #4a3620; color: #ffdcbc; }
[data-theme="dark"] .note.c6 { background: #2e3f1c; color: #dff5bd; }
[data-theme="dark"] .note.c7 { background: #1c3d42; color: #c8f0f5; }
[data-theme="dark"] .note-author { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .72); }
[data-theme="dark"] .note-date { color: rgba(255, 255, 255, .45); }
[data-theme="dark"] .react-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .12); }
[data-theme="dark"] .react-btn.on { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .3); }
[data-theme="dark"] .note-tape { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .25); }

/* 写作区 */
.note-composer {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 4px 0 10px;
  background: var(--card-2);
}
.note-composer textarea {
  width: 100%;
  min-height: 74px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}
.note-composer textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.note-composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.emoji-pick.small { max-height: none; padding: 6px; gap: 4px; background: transparent; border: none; }
.emoji-pick.small .emoji-btn { width: 30px; height: 30px; font-size: 16px; }

#note-modal textarea { min-height: 96px; }

@media (max-width: 640px) {
  .notes-wall { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
  .note { padding: 20px 11px 10px; min-height: 104px; }
  .note-text { font-size: 13px; }
  .note-author { max-width: 64%; }
  .note-composer-row { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .note, .note:hover { animation: none !important; transform: none !important; }
}

/* ============================================================
   留言板互动：今日心情 / 连续打卡 / 撒花
   ============================================================ */
.mood-row {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 2px 0 10px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary-soft) 55%, var(--card)), var(--card));
}
.mood-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mood-cap { font-size: 12.5px; color: var(--text-sub); white-space: nowrap; }
.mood-pick { display: flex; gap: 5px; flex-wrap: wrap; flex: 1 1 auto; }
.mood-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .15s cubic-bezier(.2,.8,.2,1), border-color .15s, box-shadow .15s, background .15s;
}
.mood-btn:hover { transform: translateY(-3px) scale(1.12) rotate(-4deg); }
.mood-btn.on {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
  animation: moodPop .42s cubic-bezier(.2,.8,.2,1);
}
.mood-btn.on i {
  position: absolute;
  right: -3px;
  bottom: -3px;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
}
@keyframes moodPop {
  0% { transform: scale(.8); }
  60% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.mood-streak {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.mood-sub {
  font-size: 11.5px;
  color: var(--text-sub);
  margin-top: 8px;
  line-height: 1.6;
}
.mood-other {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 4px;
  font-size: 11.5px;
  color: var(--text);
}

/* 撒花 */
.notes-card { position: relative; }
.confetti {
  position: absolute;
  bottom: 8px;
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
  animation: confettiUp 1.7s cubic-bezier(.2,.7,.3,1) forwards;
  z-index: 5;
}
@keyframes confettiUp {
  0% { transform: translate(0, 0) scale(.5) rotate(0deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx, 0px), -170px) rotate(60deg) scale(1.15); opacity: 0; }
}

@media (max-width: 640px) {
  .mood-btn { width: 31px; height: 31px; font-size: 16px; }
  .mood-streak { padding: 2px 8px; font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .confetti { display: none !important; }
  .mood-btn:hover { transform: none; }
}

/* ============================================================
   服务器存储 / 备份 提示条
   ============================================================ */
.server-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
  border-radius: 12px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 13px;
  line-height: 1.75;
  animation: noticeIn .3s cubic-bezier(.2,.8,.2,1) both;
}
.server-notice.danger {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, var(--card));
  color: var(--danger);
}
.server-notice .sn-body { flex: 1 1 auto; min-width: 0; }
.server-notice .sn-line + .sn-line { margin-top: 6px; }
.server-notice b { font-weight: 700; }
.server-notice code {
  background: color-mix(in srgb, currentColor 12%, transparent);
  border-radius: 5px;
  padding: 0 5px;
  font-size: 12px;
  word-break: break-all;
}
.server-notice .sn-close {
  flex: none;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: .55;
  padding: 0 2px 2px;
}
.server-notice .sn-close:hover { opacity: 1; }
@keyframes noticeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
#card-storage .kv-row .v { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
