:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #1a1d23; --mute: #6b7280; --faint: #9ca3af;
  --border: #e5e7eb; --blue: #2563eb; --green: #16a34a; --red: #dc2626;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: var(--font); font-size: 14px; color: var(--text); }
.hidden { display: none !important; }

/* 顶栏 */
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.brand-mark { color: var(--blue); font-size: 18px; }
.tabs { display: flex; gap: 4px; background: #f0f1f3; padding: 3px; border-radius: 9px; }
.tab { padding: 7px 16px; border-radius: 7px; font-size: 13.5px; color: var(--mute); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.market { font-size: 12.5px; color: var(--mute); }
.status { font-size: 12.5px; color: var(--faint); }
.status.saving { color: var(--mute); }
.status.ok { color: var(--green); }
.status.err { color: var(--red); }

/* 视图 */
.view { display: none; padding: 20px; max-width: 1180px; margin: 0 auto; }
.view.active { display: block; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; font-weight: 600; }
.range { font-size: 12px; color: var(--faint); }

/* 总览网格 */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.hero { padding: 22px; }
.hero-label { font-size: 13px; color: var(--mute); margin-bottom: 8px; }
.hero-value { font-size: 38px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 14px; margin-top: 8px; }
.hero-sub .up { color: var(--green); font-weight: 600; }
.hero-sub .down { color: var(--red); font-weight: 600; }
.mini { padding: 18px; }
.mini-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-pct { font-size: 12.5px; color: var(--faint); margin-top: 4px; }

.dash-lower { display: grid; grid-template-columns: 1fr 340px; gap: 14px; }
.chart-card { padding-bottom: 8px; }
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.alloc-card { padding-bottom: 16px; }
.donut { padding: 12px 18px 4px; }
.donut svg { width: 100%; height: auto; display: block; }
.legend { padding: 0 18px 8px; display: flex; flex-wrap: wrap; gap: 10px 16px; }
.legend .lg { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; }
.legend .lg b { color: var(--text); font-variant-numeric: tabular-nums; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #fafbfc; font-weight: 600; font-size: 12.5px; color: var(--mute); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td input, td select { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 6px; min-width: 70px; }
td input:focus, td select:focus { outline: none; border-color: var(--blue); background: #fff; }
td.calc { color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; }
td.calc.strong { color: var(--text); font-weight: 600; }
.row-del { width: 26px; height: 26px; border-radius: 6px; color: var(--faint); font-size: 12px; }
.row-del:hover { background: #fee2e2; color: var(--red); }
.hint { padding: 12px 18px; font-size: 12px; color: var(--faint); }
.btn { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--blue); color: #fff; }
.btn:hover { opacity: .9; }
.btn.ghost { background: #f0f1f3; color: var(--text); }

/* 响应式（手机端） */
@media (max-width: 860px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand-name { display: none; }
  .market { display: none; }
  .tabs { flex: 1; overflow-x: auto; }
  .tab { flex: 0 0 auto; text-align: center; padding: 8px 10px; font-size: 12.5px; }
  .view { padding: 12px; }
  .dash-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero { grid-column: 1 / -1; padding: 18px; }
  .hero-value { font-size: 30px; }
  .dash-lower { grid-template-columns: 1fr; gap: 10px; }
  .chart-card { order: 1; }
  .alloc-card { order: 2; }
  th, td { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .hero-value { font-size: 26px; }
  .mini-value { font-size: 20px; }
}

/* 目标进度条 */
.goal-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--mute); margin-bottom: 6px; }
.goal-head input { width: 130px; border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 13px; }
.goal-bar { height: 8px; background: #eef0f2; border-radius: 4px; overflow: hidden; }
.goal-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #60a5fa); border-radius: 4px; width: 0; transition: width .3s ease; }
.goal-pct { font-size: 12px; color: var(--mute); margin-top: 4px; }

/* 周复盘 */
.reviews { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.review-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.review-item .rv-date { font-size: 12.5px; color: var(--mute); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.review-item .rv-date input { border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 12.5px; }
.review-item textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; resize: vertical; min-height: 70px; font-family: var(--font); }
.review-item textarea:focus { outline: none; border-color: var(--blue); }
.rv-del { color: var(--faint); font-size: 12px; }
.rv-del:hover { color: var(--red); }

/* 隐私眼睛按钮 */
.eye-btn { width: 34px; height: 34px; border-radius: 8px; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; background: #f0f1f3; }
.eye-btn:hover { background: #e5e7eb; }
.eye-btn.on { background: #fee2e2; }

/* 密码弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,20,30,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { width: min(360px, 90vw); background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 16px 48px rgba(0,0,0,.2); }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.modal input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-top: 8px; }
.modal input:focus { outline: none; border-color: var(--blue); }
.modal-msg { font-size: 12.5px; color: var(--red); margin-top: 8px; min-height: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.modal-actions button { padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; background: #f0f1f3; }
.modal-actions button.primary { background: var(--blue); color: #fff; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: rgba(30,35,45,.94); color: #fff; font-size: 13.5px; padding: 9px 18px; border-radius: 8px; z-index: 120; }

/* 复盘只读文本 */
.rv-text {
  font-size: 13.5px; line-height: 1.75; color: var(--text); white-space: pre-wrap;
  background: #fafbfc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  user-select: none;
}
.rv-date { display: flex; align-items: center; gap: 8px; }

/* 卡片头部多按钮 */
.card-head .actions { display: flex; gap: 8px; }

/* ============ 2028 财务规划 ============ */
.plan-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 22px; margin-bottom: 14px; background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%); }
.plan-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--blue); margin-bottom: 7px; }
.plan-header h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.4px; }
.plan-header p { max-width: 680px; margin-top: 9px; color: var(--mute); font-size: 13.5px; line-height: 1.7; }
.plan-targets { display: grid; grid-template-columns: repeat(3, minmax(92px, 1fr)); gap: 8px; min-width: 330px; }
.plan-chip { padding: 11px 12px; border: 1px solid #dbeafe; background: #eff6ff; border-radius: 10px; }
.plan-chip span { display: block; color: var(--mute); font-size: 11.5px; }
.plan-chip b { display: block; margin-top: 3px; font-size: 18px; font-variant-numeric: tabular-nums; }
.plan-chip small { display: block; margin-top: 4px; color: var(--faint); font-size: 10.5px; line-height: 1.35; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.plan-card { overflow: hidden; }
.plan-progress { padding: 16px 18px 18px; }
.progress-row + .progress-row { margin-top: 15px; }
.progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; font-size: 13px; }
.progress-meta b { font-variant-numeric: tabular-nums; }
.progress-meta span { color: var(--mute); }
.progress-track { height: 9px; background: #eef0f2; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2563eb, #60a5fa); transition: width .3s ease; }
.progress-fill.base { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress-fill.stretch { background: linear-gradient(90deg, #d97706, #fbbf24); }
.plan-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.plan-rule { display: flex; gap: 9px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.55; }
.plan-rule:nth-child(odd) { border-right: 1px solid var(--border); }
.plan-rule-index { flex: 0 0 20px; height: 20px; border-radius: 6px; background: #eff6ff; color: var(--blue); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.plan-table-wrap { overflow-x: auto; }
.plan-table td.note { white-space: normal; min-width: 220px; color: var(--mute); line-height: 1.5; }
.plan-table td.amount { font-variant-numeric: tabular-nums; }
.plan-table tr:last-child td { border-bottom: none; }
.timeline { padding: 16px 18px 18px; }
.timeline-item { display: grid; grid-template-columns: 86px 14px 1fr; gap: 10px; align-items: start; }
.timeline-item + .timeline-item { margin-top: 15px; }
.timeline-date { color: var(--blue); font-size: 12.5px; font-weight: 700; padding-top: 1px; }
.timeline-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px #dbeafe; }
.timeline-body strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.timeline-body p { color: var(--mute); font-size: 12.5px; line-height: 1.55; }
.plan-note { padding: 12px 18px 16px; color: var(--faint); font-size: 12px; line-height: 1.6; border-top: 1px solid var(--border); }

@media (max-width: 860px) {
  .plan-header { flex-direction: column; padding: 18px; }
  .plan-targets { width: 100%; min-width: 0; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-rules { grid-template-columns: 1fr; }
  .plan-rule:nth-child(odd) { border-right: none; }
}
@media (max-width: 480px) {
  .plan-targets { grid-template-columns: 1fr; }
  .plan-header h2 { font-size: 21px; }
}

/* 动态资产卡 */
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 14px; }
@media (max-width: 860px) { .cards-row { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* 环形图百分比标签 */
.donut-pct { font-size: 11px; font-weight: 700; fill: #fff; }

/* 月份分组行 */
tr.month-row { cursor: pointer; background: #f7f8fa; }
tr.month-row:hover { background: #eef1f5; }
tr.month-row td { border-top: 1px solid var(--border); padding: 10px 12px; }
tr.month-row .m-toggle { display: inline-block; width: 16px; color: var(--mute); font-size: 12px; }
tr.month-row b { font-size: 14px; }
tr.month-row .m-meta { font-size: 12.5px; color: var(--faint); margin-left: 10px; }
tr.month-row .m-count { font-size: 12px; color: var(--faint); }

/* 存款页 */
.deposit-summary { display: flex; gap: 24px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.deposit-summary .ds-item { font-size: 13px; color: var(--mute); }
.deposit-summary .ds-item b { display: block; font-size: 19px; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 2px; }
tr.due-soon td { background: #fff7e6; }
tr.matured td { background: #f3f4f6; color: #9ca3af; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.badge.ok { background: #e8f5ee; color: #16a34a; }
.badge.soon { background: #fff1d6; color: #b45309; }
.badge.done { background: #e5e7eb; color: #6b7280; }

/* 环形图悬停 */
.alloc-card { position: relative; }
.donut-seg { cursor: pointer; transition: stroke-width .15s ease, opacity .15s ease; }
#donut svg { overflow: visible; }
.donut-tip {
  position: absolute; z-index: 40; pointer-events: none; min-width: 168px;
  background: rgba(28,33,44,.95); color: #fff; font-size: 12.5px; line-height: 1.7;
  padding: 9px 11px; border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.donut-tip .dt-name { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.donut-tip .dt-row { display: flex; justify-content: space-between; gap: 14px; }
.donut-tip .dt-row b { font-variant-numeric: tabular-nums; }
.legend .lg { cursor: pointer; transition: opacity .15s ease; }

/* 扇区只在描边上响应悬停（圆心是空的） */
.donut-seg { pointer-events: stroke; }

/* 小扇区百分比（环外） */
.donut-pct-sm { font-size: 11.5px; font-weight: 700; }

/* 环形图提示：分组子项 */
.donut-tip .dt-sub { padding-left: 8px; font-size: 11.5px; color: #cbd5e1; }
.donut-tip .dt-sub + .dt-row { }

/* 目标金额输入（带 ¥ 前缀） */
.goal-input-wrap { display: inline-flex; align-items: center; gap: 4px; }
.goal-unit { color: var(--mute); font-size: 13px; font-weight: 600; }

/* 云端登录 */
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 50% -10%, #dbeafe 0%, #f5f6f8 55%, #eef2f7 100%); padding: 24px; }
.login-shell { width: 100%; max-width: 390px; }
.login-card { background: rgba(255,255,255,.92); border: 1px solid rgba(229,231,235,.9); border-radius: 20px; padding: 34px 30px 26px; box-shadow: 0 18px 50px rgba(15,23,42,.10); backdrop-filter: blur(14px); text-align: center; }
.login-logo { width: 56px; height: 56px; border-radius: 17px; margin: 0 auto 14px; display: grid; place-items: center; color: #fff; font-size: 25px; background: linear-gradient(145deg,#3b82f6,#1d4ed8); box-shadow: 0 8px 20px rgba(37,99,235,.28); }
.login-card h1 { font-size: 23px; letter-spacing: .5px; }
.login-sub { margin: 7px 0 24px; font-size: 13px; color: var(--mute); }
.login-card form { text-align: left; }
.login-card label { display: block; font-size: 12.5px; color: var(--mute); margin: 0 0 7px 2px; }
.login-card input { width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 0 13px; background: #fafbfc; outline: none; transition: .15s; }
.login-card input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
.login-btn { width: 100%; height: 44px; margin-top: 14px; border-radius: 10px; font-size: 14px; }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-error { min-height: 19px; margin-top: 10px; font-size: 12.5px; color: var(--red); text-align: center; }
.login-foot { margin-top: 18px; font-size: 11.5px; color: var(--faint); }

/* ============================================================
   Web workspace redesign · 侧边栏 / 工作台 / 现代网页风格
   ============================================================ */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --mute: #64748b;
  --faint: #94a3b8;
  --border: #e7eaf0;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #059669;
  --red: #dc2626;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15,23,42,.03), 0 10px 28px rgba(15,23,42,.04);
}
body { background: var(--bg); -webkit-font-smoothing: antialiased; }
.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 60;
  display: flex; flex-direction: column;
  padding: 24px 16px 18px;
  background: #fff; border-right: 1px solid var(--border);
}
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; font-size: 17px; background: linear-gradient(145deg,#3b82f6,#1d4ed8);
  box-shadow: 0 7px 18px rgba(37,99,235,.28);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; font-size: 9px; font-weight: 700; letter-spacing: .14em; color: #94a3b8; }
.nav-label { margin: 30px 10px 9px; font-size: 10px; font-weight: 700; letter-spacing: .14em; color: #a1aab8; }
.sidebar .tabs { display: flex; flex-direction: column; gap: 4px; background: transparent; padding: 0; border-radius: 0; }
.sidebar .tab {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: #64748b; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.sidebar .tab:hover { background: #f6f8fb; color: #0f172a; }
.sidebar .tab.active { background: #eef4ff; color: #1d4ed8; font-weight: 650; box-shadow: none; }
.sidebar .tab.active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 3px; background: #2563eb;
}
.nav-ico { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 20px; }
.nav-ico svg { width: 19px; height: 19px; display: block; }
.side-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--border); }
.side-profile { display: flex; align-items: center; gap: 10px; }
.side-profile .avatar {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: #f0f5ff; color: #2563eb; font-size: 13px; font-weight: 700;
}
.side-profile div { display: flex; flex-direction: column; line-height: 1.35; }
.side-profile b { font-size: 12.5px; font-weight: 600; }
.side-profile small { font-size: 10.5px; color: #94a3b8; }

/* 工作区与顶栏 */
.workspace { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 30px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(231,234,240,.85);
}
.page-kicker { font-size: 9.5px; font-weight: 800; letter-spacing: .18em; color: #2563eb; margin-bottom: 4px; }
.page-title-wrap h1 { font-size: 23px; line-height: 1.2; letter-spacing: -.035em; font-weight: 700; }
.page-title-wrap p { margin-top: 4px; font-size: 12px; color: #94a3b8; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.topbar .market {
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px;
  background: #f8fafc; font-size: 11.5px; color: #64748b; white-space: nowrap;
}
.topbar .status { font-size: 11.5px; color: #94a3b8; white-space: nowrap; }
.topbar .eye-btn {
  width: 36px; height: 36px; border-radius: 10px; background: #fff;
  border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.topbar .eye-btn:hover { background: #f8fafc; border-color: #d7dce5; }
.topbar .eye-btn.on { background: #fef2f2; border-color: #fecaca; }

.workspace > main { width: 100%; max-width: 1480px; margin: 0 auto; padding: 26px 30px 44px; }
.view { padding: 0; max-width: none; margin: 0; }

/* 卡片与按钮 */
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); background: #fff;
}
.card-head { padding: 17px 21px; }
.card-head h3 { font-size: 14.5px; letter-spacing: -.02em; }
.card-head .range { font-size: 11.5px; }
.btn {
  padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 12.5px;
  background: #2563eb; box-shadow: 0 2px 6px rgba(37,99,235,.16);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { opacity: 1; background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 5px 12px rgba(37,99,235,.2); }
.btn.ghost { background: #f5f7fa; border: 1px solid #e7eaf0; box-shadow: none; color: #334155; }
.btn.ghost:hover { background: #eef2f7; }
table th { background: #f8fafc; font-size: 11.5px; letter-spacing: .01em; }
table td { font-size: 13px; }
th, td { padding: 10px 13px; }
.hint { padding: 12px 20px 14px; line-height: 1.6; }

/* 总览：左侧资产 hero + 右侧 6 个分类卡 */
#view-dash.active {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
  gap: 17px; align-items: stretch;
}
#view-dash .hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 30px 32px; border: 0; border-radius: 18px;
  background: linear-gradient(135deg,#0b1224 0%,#111c3d 52%,#17357a 100%);
  color: #fff; box-shadow: 0 18px 44px rgba(15,23,42,.18);
}
#view-dash .hero::after {
  content: ''; position: absolute; right: -90px; top: -110px; width: 310px; height: 310px; border-radius: 50%;
  background: radial-gradient(circle, rgba(96,165,250,.32), rgba(96,165,250,0) 68%);
  pointer-events: none;
}
#view-dash .hero::before {
  content: ''; position: absolute; right: 36px; bottom: -110px; width: 230px; height: 230px; border-radius: 50%;
  border: 1px solid rgba(147,197,253,.12);
  pointer-events: none;
}
#view-dash .hero-label { position: relative; z-index: 1; color: #93c5fd; font-size: 12px; letter-spacing: .04em; }
#view-dash .hero-value { position: relative; z-index: 1; margin-top: 6px; color: #fff; font-size: 46px; letter-spacing: -.045em; }
#view-dash .hero-sub { position: relative; z-index: 1; color: #cbd5e1; font-size: 12.5px; }
#view-dash .hero-sub .up { color: #6ee7b7; }
#view-dash .hero-sub .down { color: #fca5a5; }
#view-dash .hero [style*="color:#9ca3af"] { color: #94a3b8 !important; }
#view-dash .goal {
  position: relative; z-index: 1; margin-top: 20px !important;
  padding: 14px 15px 13px; border-radius: 12px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
}
#view-dash .goal-head { color: #cbd5e1; }
#view-dash .goal-head input {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff;
}
#view-dash .goal-head input::placeholder { color: #94a3b8; }
#view-dash .goal-unit { color: #cbd5e1; }
#view-dash .goal-bar { background: rgba(255,255,255,.13); }
#view-dash .goal-fill { background: linear-gradient(90deg,#60a5fa,#a5b4fc); }
#view-dash .goal-pct { color: #cbd5e1; }
#view-dash .cards-row {
  margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px;
}
#view-dash .mini {
  position: relative; overflow: hidden; padding: 16px 17px 15px;
  box-shadow: 0 1px 2px rgba(15,23,42,.02), 0 7px 20px rgba(15,23,42,.03);
}
#view-dash .mini::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--mini-color, #2563eb);
}
#view-dash .mini .hero-label { color: #64748b; font-size: 11.5px; }
#view-dash .mini-value { margin-top: 3px; font-size: 21px; letter-spacing: -.03em; }
#view-dash .mini-pct { margin-top: 3px; font-size: 11.5px; }
#view-dash .dash-lower {
  grid-column: 1 / -1; display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 17px;
}

/* 表格与月份分组 */
.table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
tr.month-row { background: #f8fafc; }
tr.month-row:hover { background: #f1f5f9; }
tr.month-row td { padding: 11px 13px; }
td input:focus, td select:focus { box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

/* 复盘 */
.reviews { padding: 16px 20px 20px; }
.review-item { border-color: #e7eaf0; border-radius: 12px; padding: 15px; background: #fff; }
.review-item textarea, .rv-text { background: #f8fafc; }

/* Toast 浮在底部导航之上 */
.toast { bottom: 28px; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  #view-dash.active { grid-template-columns: 1fr; }
  #view-dash .cards-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #view-dash .dash-lower { grid-column: 1; }
  .workspace > main { padding: 22px; }
  .topbar { padding: 16px 22px; }
}
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 70px; width: auto;
    z-index: 100; padding: 0 6px;
    border-right: 0; border-top: 1px solid var(--border);
    background: rgba(255,255,255,.96); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -8px 30px rgba(15,23,42,.06);
  }
  .sidebar .brand, .nav-label, .side-foot { display: none; }
  .sidebar .tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; height: 100%; }
  .sidebar .tab {
    flex-direction: column; justify-content: center; gap: 3px;
    padding: 7px 2px; border-radius: 0; text-align: center;
    font-size: 10.5px; color: #64748b;
  }
  .sidebar .tab:hover { background: transparent; }
  .sidebar .tab.active { background: transparent; color: #2563eb; font-weight: 650; }
  .sidebar .tab.active::before { display: none; }
  .nav-ico { width: 21px; height: 21px; flex-basis: 21px; }
  .nav-ico svg { width: 21px; height: 21px; }
  .workspace { padding-bottom: 70px; }
  .topbar { padding: 13px 16px; gap: 10px; }
  .page-kicker { display: none; }
  .page-title-wrap h1 { font-size: 20px; }
  .page-title-wrap p { display: none; }
  .topbar .market, .topbar .status { display: none; }
  .top-right { gap: 6px; }
  .topbar .eye-btn { width: 36px; height: 36px; }
  .workspace > main { padding: 14px 14px 24px; }
  #view-dash.active { display: block; }
  #view-dash .hero { margin-bottom: 12px; padding: 24px 21px; border-radius: 16px; }
  #view-dash .hero-value { font-size: 35px; }
  #view-dash .cards-row { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
  #view-dash .mini { padding: 14px 14px 13px; border-radius: 13px; }
  #view-dash .mini-value { font-size: 18px; }
  #view-dash .dash-lower { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .card-head { padding: 14px 15px; flex-wrap: wrap; gap: 9px; }
  .view > .card { border-radius: 14px; }
  .reviews { padding: 13px 14px 16px; }
  .toast { bottom: 86px; }
}
@media (max-width: 420px) {
  #view-dash .hero-value { font-size: 31px; }
  #view-dash .cards-row { gap: 8px; }
  #view-dash .mini { padding: 12px; }
  #view-dash .mini-value { font-size: 17px; }
  .topbar { padding: 12px 13px; }
  .topbar .eye-btn { width: 34px; height: 34px; }
  .workspace > main { padding: 12px 12px 20px; }
}

/* 顶栏图标：用线性图标替代 emoji */
#btn-hide, #btn-logout { font-size: 0; color: #64748b; }
#btn-hide::before, #btn-logout::before {
  content: ''; width: 17px; height: 17px; display: block;
  background: currentColor;
  -webkit-mask-position: center; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain;
  mask-position: center; mask-repeat: no-repeat; mask-size: contain;
}
#btn-hide::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 10.6a2 2 0 002.8 2.8'/%3E%3Cpath d='M9.9 5.2A10.8 10.8 0 0112 5c6.5 0 10 7 10 7a17.6 17.6 0 01-3.6 4.3'/%3E%3Cpath d='M6.2 6.2A17.4 17.4 0 002 12s3.5 7 10 7c1.6 0 3-.4 4.3-1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 10.6a2 2 0 002.8 2.8'/%3E%3Cpath d='M9.9 5.2A10.8 10.8 0 0112 5c6.5 0 10 7 10 7a17.6 17.6 0 01-3.6 4.3'/%3E%3Cpath d='M6.2 6.2A17.4 17.4 0 002 12s3.5 7 10 7c1.6 0 3-.4 4.3-1'/%3E%3C/svg%3E");
}
#btn-hide.on::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
#btn-logout::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v9'/%3E%3Cpath d='M6.4 6.4a8 8 0 1011.2 0'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v9'/%3E%3Cpath d='M6.4 6.4a8 8 0 1011.2 0'/%3E%3C/svg%3E");
}

/* 金币品牌标识 */
.brand-mark {
  background: #f7f3ea url('/icons/icon-192.png') center/cover no-repeat;
  color: transparent; font-size: 0; border-radius: 10px;
  border: 1px solid rgba(190,155,80,.16);
  box-shadow: 0 7px 18px rgba(180,140,40,.16);
}
.login-logo {
  background: #f7f3ea url('/icons/icon-192.png') center/cover no-repeat;
  color: transparent; font-size: 0; border-radius: 17px;
  border: 1px solid rgba(190,155,80,.16);
  box-shadow: 0 10px 26px rgba(180,140,40,.15);
}

/* 启动加载 */
.app-loading {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(900px 520px at 50% 30%, #fff 0%, #f3f5f9 62%, #eef1f6 100%);
}
.app-loading.hidden { display: none !important; }
.app-loading-coin {
  width: 62px; height: 62px; border-radius: 17px;
  background: #0f172a url('/icons/icon-192.png') center/cover no-repeat;
  box-shadow: 0 14px 32px rgba(15,23,42,.2);
  animation: coinPulse 1.5s ease-in-out infinite;
}
.app-loading p { font-size: 13px; color: #64748b; letter-spacing: .02em; }
@keyframes coinPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 14px 32px rgba(15,23,42,.2); }
  50% { transform: scale(1.06); box-shadow: 0 18px 40px rgba(185,130,20,.26); }
}

/* 总览收益指标 */
.hero-stats {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; margin-top: 20px;
}
.hero-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hero-stat span { font-size: 10.5px; color: #94a3b8; white-space: nowrap; }
.hero-stat b { font-size: 14px; font-weight: 650; color: #e2e8f0; font-variant-numeric: tabular-nums; }
.hero-stat b.up { color: #6ee7b7; }
.hero-stat b.down { color: #fca5a5; }
.hero-date { position: relative; z-index: 1; margin-top: 12px; font-size: 10.5px; color: #94a3b8; }

/* 目标金额：只读文本 + 编辑按钮 */
.goal-head { flex-wrap: wrap; gap: 8px 12px; }
.goal-title { color: #cbd5e1; font-size: 12.5px; white-space: nowrap; }
.goal-view { display: flex; align-items: center; gap: 9px; margin-left: auto; }
#goal-text { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.goal-edit {
  padding: 4px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600;
  color: #dbeafe; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16);
}
.goal-edit:hover { background: rgba(255,255,255,.16); }
.goal-editor { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.goal-editor.hidden { display: none; }
.goal-editor input { width: 132px; min-width: 96px; }
.goal-save, .goal-cancel {
  padding: 5px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.goal-save { background: #fff; color: #1d4ed8; }
.goal-save:hover { background: #eff6ff; }
.goal-save:disabled { opacity: .6; cursor: default; }
.goal-cancel { color: #cbd5e1; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.goal-cancel:hover { background: rgba(255,255,255,.12); }

@media (max-width: 860px) {
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 16px; }
  .hero-stat b { font-size: 13px; }
  .goal-head { row-gap: 9px; }
}
@media (max-width: 480px) {
  .goal-editor { flex: 1 1 100%; margin-left: 0; justify-content: flex-end; }
  .goal-editor input { flex: 1; width: auto; }
}




/* 净值图随窗口高度伸缩 */
.chart-card { display: flex; flex-direction: column; }
.chart-card .card-head { flex: 0 0 auto; }
.chart-card #networth-chart { flex: 1 1 auto; min-height: 300px; }
.chart-card #networth-chart svg { width: 100%; height: 100%; display: block; }

@media (min-width: 861px) {
  .chart-card #networth-chart {
    flex: 0 0 auto;
    height: clamp(300px, calc(100vh - 500px), 620px);
  }
}
@media (max-width: 860px) {
  .chart-card #networth-chart { flex: 0 0 300px; height: 300px; }
}

/* Android APK 下载 */
.download-btn { text-decoration: none; color: #64748b; }
.download-btn svg { width: 17px; height: 17px; display: block; }
.login-download {
  display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600;
  color: var(--blue); text-decoration: none;
}
.login-download:hover { text-decoration: underline; }

/* 云端状态与退出登录 */
.side-profile small { display: flex; align-items: center; gap: 5px; }
.side-profile small::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.side-profile small.online { color: #059669; }
.side-profile small.syncing { color: #d97706; }
.side-profile small.offline { color: #dc2626; }
.logout-text { margin: 0 0 4px; color: var(--mute); font-size: 13px; line-height: 1.65; }
.modal-actions button.danger { background: #dc2626; color: #fff; }
.modal-actions button.danger:hover { background: #b91c1c; }
.modal-actions button:disabled { opacity: .6; cursor: default; }

/* ============================================================
   日志 / 记事本
   ============================================================ */
.diary-layout {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 16px;
  min-height: clamp(520px, calc(100vh - 220px), 760px);
}
.diary-list-card, .diary-editor-card { display: flex; flex-direction: column; overflow: hidden; }
.diary-list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 16px 13px; border-bottom: 1px solid var(--border);
}
.diary-list-head > div { display: flex; align-items: baseline; gap: 8px; }
.diary-list-head h3 { font-size: 15px; font-weight: 700; }
.diary-count { font-size: 11px; color: #94a3b8; }
.diary-list { flex: 1; overflow-y: auto; padding: 8px; }
.diary-item {
  display: block; width: 100%; text-align: left;
  padding: 11px 12px; margin-bottom: 3px; border-radius: 10px;
  border: 1px solid transparent; color: inherit;
  transition: background .15s ease, border-color .15s ease;
}
.diary-item:hover { background: #f7f9fc; }
.diary-item.active { background: #eef4ff; border-color: #dbeafe; }
.diary-item-date { display: block; font-size: 12.5px; font-weight: 650; color: #334155; }
.diary-item-preview {
  display: block; margin-top: 4px; font-size: 11.5px; color: #94a3b8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.diary-item.active .diary-item-date { color: #1d4ed8; }
.diary-list-empty { padding: 26px 14px; text-align: center; color: #94a3b8; font-size: 12.5px; line-height: 1.8; }
.diary-editor-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.diary-date {
  border: 0; background: transparent; padding: 4px 0;
  font-size: 13.5px; font-weight: 650; color: var(--text); outline: none;
}
.diary-save-state { font-size: 11.5px; color: #94a3b8; }
.diary-save-state.dirty { color: #d97706; }
.diary-save-state.saved { color: #059669; }
.diary-actions { display: flex; gap: 8px; margin-left: auto; }
.diary-actions .btn { padding: 6px 12px; font-size: 12px; }
.diary-note {
  flex: 1; width: 100%; min-height: 360px; resize: none;
  border: 0; outline: none; padding: 20px 24px;
  font-family: var(--font); font-size: 15px; line-height: 1.9; color: var(--text);
  background: #fffefa;
}
.diary-note:disabled { background: #fafbfc; color: #94a3b8; }
.diary-note::placeholder { color: #b6bfcc; }
.diary-foot {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 18px; border-top: 1px solid var(--border);
  color: #94a3b8; font-size: 10.5px;
}
.diary-actions button:disabled { opacity: .55; cursor: default; }
@media (max-width: 860px) {
  .diary-layout { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
  .diary-list-card { flex: 0 0 auto; max-height: 236px; }
  .diary-list { max-height: 166px; }
  .diary-editor-card { min-height: 520px; }
  .diary-editor-head { padding: 12px 14px; gap: 8px; }
  .diary-save-state { order: 4; width: 100%; }
  .diary-note { min-height: 390px; padding: 16px 17px; font-size: 14px; }
  .diary-foot { padding: 8px 14px; }
}

/* 日志：标题与月份目录 */
.diary-title {
  width: 100%; flex: 0 0 auto;
  border: 0; outline: none; background: #fff;
  padding: 16px 20px 8px;
  font-family: var(--font); font-size: 21px; line-height: 1.35; font-weight: 700;
  color: var(--text); letter-spacing: -.02em;
}
.diary-title::placeholder { color: #b6bfcc; font-weight: 600; }
.diary-time { border: 0; background: transparent; padding: 4px 0; font-size: 12.5px; color: #64748b; outline: none; }
.log-month + .log-month { margin-top: 6px; }
.log-month-head {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 9px 10px 7px; border-radius: 8px; text-align: left;
  font-size: 11.5px; color: #64748b; background: transparent;
}
.log-month-head:hover { background: #f6f8fb; }
.log-month-head b { font-size: 11.5px; font-weight: 650; color: #475569; }
.log-month-toggle {
  width: 0; height: 0; flex: 0 0 auto;
  border-left: 4.5px solid transparent; border-right: 4.5px solid transparent;
  border-top: 5.5px solid #94a3b8; margin: 1px 4px 0 2px;
  transition: transform .15s ease;
}
.log-month-toggle.collapsed { transform: rotate(-90deg); }
.log-month-count { margin-left: auto; font-size: 10.5px; color: #a3adba; }
.log-month-items.hidden { display: none; }
.diary-item { padding: 10px 11px; margin-bottom: 2px; }
.diary-item-title {
  display: block; font-size: 12.8px; font-weight: 650; color: #334155;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.diary-item.active .diary-item-title { color: #1d4ed8; }
.diary-item-time { display: block; margin-top: 2px; font-size: 10px; color: #a0aab7; }
.diary-item-preview {
  display: block; margin-top: 4px; font-size: 11.5px; color: #94a3b8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 860px) {
  .diary-title { padding: 13px 15px 6px; font-size: 19px; }
  .diary-editor-head { padding-top: 8px; }
  .diary-time { font-size: 12px; }
}

/* 日志创建时间 / 最后修改时间 */
.diary-timestamps {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  padding: 8px 20px; border-bottom: 1px solid var(--border);
  background: #fbfcfe; color: #94a3b8; font-size: 10.5px;
}
.diary-timestamps b { color: #64748b; font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .diary-timestamps { padding: 8px 15px; gap: 3px 14px; }
}
