:root {
  --bg: #edf2f9; --card: #ffffff; --text: #0b1220; --mute: #475569; --faint: #64748b;
  --border: #cfd9e6; --blue: #135bff; --green: #008f5a; --red: #e11d48;
  --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: #e8eef7; 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(--blue-dark); box-shadow: 0 2px 8px rgba(19,91,255,.14); }
.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: #f2f6fc; 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, var(--blue-dark), #06b6d4); 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 #dce5fb; background: var(--brand-soft); 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, var(--blue-dark), #06b6d4); transition: width .3s ease; }
.progress-fill.base { background: linear-gradient(90deg, var(--green), #62ac9b); }
.progress-fill.stretch { background: linear-gradient(90deg, var(--gold-dark), #d1a24a); }
.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: var(--brand-soft); 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 var(--brand-soft); }
.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; text-shadow: 0 1px 2px rgba(0,0,0,.35); }

/* 月份分组行 */
tr.month-row { cursor: pointer; background: #f2f6fc; }
tr.month-row:hover { background: #e8effa; }
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: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.deposit-summary .ds-item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #f4f7fc; font-size: 12px; color: var(--mute); }
.deposit-summary .ds-item b { display: block; font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 3px; }
tr.due-soon td { background: #fff1d2; }
tr.matured td { background: #eef2f7; color: #64748b; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.soon { background: var(--amber-soft); color: var(--amber); }
.badge.done { background: #e2e8f0; color: #475569; }

/* 环形图悬停 */
.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(1100px 560px at 50% -8%, #c9ddff 0%, var(--bg) 58%, #e4ecf7 100%); padding: 24px; }
.login-shell { width: 100%; max-width: 390px; }
.login-card { background: rgba(255,255,255,.95); border: 1px solid rgba(207,217,230,.95); border-radius: 20px; padding: 34px 30px 26px; box-shadow: 0 22px 56px rgba(11,18,32,.16); 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,var(--blue),var(--blue-dark)); box-shadow: 0 10px 24px rgba(19,91,255,.32); }
.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: #f4f7fc; outline: none; transition: .15s; }
.login-card input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(19,91,255,.14); }
.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: #edf2f9;
  --card: #ffffff;
  --text: #0b1220;
  --mute: #475569;
  --faint: #64748b;
  --border: #cfd9e6;
  --blue: #135bff;
  --blue-dark: #003ed6;
  --green: #008f5a;
  --red: #e11d48;
  --indigo: #4f46e5;
  --indigo-dark: #3730c9;
  --gold: #d97706;
  --gold-dark: #a94f00;
  --sky: #0284c7;
  --sky-dark: #0369a1;
  --slate: #64748b;
  --slate-dark: #475569;
  --brand-soft: #e0eaff;
  --tone-indigo: #e8e7ff;
  --tone-teal: #d8f8ec;
  --tone-gold: #fff1d2;
  --tone-rose: #ffe2e9;
  --tone-sky: #ddf4ff;
  --tone-slate: #e9eef6;
  --amber: #b45309;
  --amber-soft: #fff1d2;
  --green-soft: #d8f8ec;
  --red-soft: #ffe2e9;
  --line-soft: #e1e8f2;
  --hover: #f3f7ff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11,18,32,.04), 0 12px 30px rgba(11,18,32,.07);
}
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,var(--blue),var(--blue-dark));
  box-shadow: 0 8px 20px rgba(19,91,255,.34);
}
.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: var(--faint); }
.nav-label { margin: 30px 10px 9px; font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--faint); }
.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: var(--mute); text-align: left;
  transition: background .15s ease, color .15s ease;
}
.sidebar .tab:hover { background: var(--hover); color: var(--text); }
.sidebar .tab.active { background: var(--brand-soft); color: var(--blue-dark); 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: var(--blue);
}
.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: var(--brand-soft); color: var(--blue); 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: var(--faint); }

/* 工作区与顶栏 */
.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,.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(207,217,230,.95);
}
.page-kicker { font-size: 9.5px; font-weight: 800; letter-spacing: .18em; color: var(--blue); 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: var(--faint); }
.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: var(--hover); font-size: 11.5px; color: var(--mute); white-space: nowrap;
}
.topbar .status { font-size: 11.5px; color: var(--faint); 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: var(--hover); border-color: #b9c8da; }
.topbar .eye-btn.on { background: var(--red-soft); border-color: #ffb3c4; }

.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: var(--blue); box-shadow: 0 3px 10px rgba(19,91,255,.24);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { opacity: 1; background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,62,214,.28); }
.btn.ghost { background: #f7faff; border: 1px solid var(--border); box-shadow: none; color: #1e293b; }
.btn.ghost:hover { background: var(--line-soft); }
table th { background: #f2f6fc; 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,#06132e 0%,#0a2a73 46%,#135bff 100%);
  color: #fff; box-shadow: 0 20px 48px rgba(6,19,46,.24);
}
#view-dash .hero::after {
  content: ''; position: absolute; right: -90px; top: -110px; width: 310px; height: 310px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,189,248,.42), rgba(56,189,248,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(184,211,255,.2);
  pointer-events: none;
}
#view-dash .hero-label { position: relative; z-index: 1; color: #cfe0ff; 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: #d8e5ff; font-size: 12.5px; }
#view-dash .hero-sub .up { color: #5ef2c0; }
#view-dash .hero-sub .down { color: #ff9fb2; }
#view-dash .hero [style*="color:#9ca3af"] { color: #c7d7f5 !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,.1); border: 1px solid rgba(255,255,255,.18);
}
#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: #a9bedf; }
#view-dash .goal-unit { color: #cbd5e1; }
#view-dash .goal-bar { background: rgba(255,255,255,.18); }
#view-dash .goal-fill { background: linear-gradient(90deg,#22d3ee,#818cf8); }
#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(18,24,38,.02), 0 7px 20px rgba(24,39,75,.03);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
#view-dash .mini:hover { border-color: #b9c8da; box-shadow: 0 10px 26px rgba(11,18,32,.1); transform: translateY(-1px); }
#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, var(--blue));
}
#view-dash .mini .hero-label { color: var(--mute); font-size: 11.5px; }
#view-dash .mini .hero-label::before {
  content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 6px;
  border-radius: 50%; background: var(--mini-color); vertical-align: 1px;
}
#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: #f2f6fc; }
tr.month-row:hover { background: #e8effa; }
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: #d5deea; border-radius: 12px; padding: 15px; background: #fff; }
.review-item textarea, .rv-text { background: #f4f7fc; }

/* 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(9, minmax(0, 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: 8.8px; color: var(--mute); letter-spacing: -.045em;
  }
  .sidebar .tab:hover { background: transparent; }
  .sidebar .tab.active { background: transparent; color: var(--blue); 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; }
}

/* 只读账户接入 */
.account-grid { display: grid; gap: 16px; }
.crypto-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.us-grid { grid-template-columns: minmax(0, 1fr); }
.account-card { display: flex; flex-direction: column; overflow: hidden; min-height: 430px; }
.account-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.account-ident { display: flex; align-items: center; gap: 11px; min-width: 0; }
.account-ident h3 { font-size: 15px; letter-spacing: -.02em; }
.account-ident small { display: block; margin-top: 3px; color: var(--faint); font-size: 10.5px; white-space: nowrap; }
.provider-logo {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  border-radius: 11px; font-size: 12px; font-weight: 800; letter-spacing: -.04em;
}
.provider-logo.binance { color: var(--gold-dark); background: var(--tone-gold); }
.provider-logo.bitget { color: var(--sky-dark); background: var(--tone-sky); }
.provider-logo.ibkr { color: var(--indigo-dark); background: var(--tone-indigo); }
.integration-badge {
  flex: 0 0 auto; padding: 4px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 650;
  color: var(--faint); background: #f3f5f8; border: 1px solid var(--border);
}
.integration-badge.connected { color: var(--green); background: var(--green-soft); border-color: #8edfc1; }
.integration-badge.syncing { color: var(--amber); background: var(--amber-soft); border-color: #f0c27a; }
.integration-badge.error { color: var(--red); background: var(--red-soft); border-color: #ffa9bd; }
.account-body { flex: 1; padding: 16px 18px 12px; min-width: 0; }
.account-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.account-summary.ibkr-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.account-summary.ibkr-summary .account-metric.ibkr-wide { grid-column: span 2; }
.account-summary.crypto-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.account-metric { min-width: 0; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: #f8faff; }
.account-metric span { display: block; color: var(--faint); font-size: 10px; white-space: nowrap; }
.account-metric b { display: block; margin-top: 4px; color: var(--text); font-size: 16px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.account-metric b.pnl-up { color: var(--green); }
.account-metric b.pnl-down { color: var(--red); }
.account-metric small { display: block; margin-top: 3px; color: var(--faint); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-table-wrap { margin: 12px -18px 0; overflow-x: auto; border-top: 1px solid #f1f5f9; }
.account-table { width: 100%; border-collapse: collapse; }
.account-table.ibkr-table { min-width: 930px; }
.account-table.crypto-asset-table { min-width: 548px; }
.account-table.crypto-asset-table th, .account-table.crypto-asset-table td { padding-left: 6px; padding-right: 6px; font-size: 10.5px; }
.account-table th { padding: 8px 11px; background: #f4f7fc; color: var(--faint); font-size: 9.5px; font-weight: 650; }
.account-table td { padding: 8px 11px; font-size: 11.5px; }
.account-table td.num, .account-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.account-table tfoot th { background: #fff; border-top: 1px solid var(--border); color: #334155; font-size: 10.5px; }
.account-table .asset-symbol { font-weight: 700; color: #334155; }
.account-table .asset-symbol small { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; font-weight: 500; }
.account-table .pnl-up { color: var(--green); }
.account-table .pnl-down { color: var(--red); }
.account-table .account-table-empty { padding: 22px; text-align: center; color: #64748b; }
.account-table.bitget-position-table { min-width: 880px; }
.account-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 15px; padding-top: 13px; border-top: 1px solid #f1f5f9; }
.account-subhead h4 { margin: 0; color: var(--text); font-size: 12px; font-weight: 700; }
.account-subhead span { color: var(--faint); font-size: 10px; }
.bitget-position-wrap { margin-top: 8px; }
.account-inline-error { margin-top: 9px; padding: 8px 11px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 10.5px; line-height: 1.55; }
.account-empty {
  min-height: 235px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 26px 20px; text-align: center; color: var(--faint);
}
.account-empty b { color: #475569; font-size: 13.5px; }
.account-empty span { max-width: 300px; font-size: 11.5px; line-height: 1.7; }
.account-empty .account-empty-action { margin-top: 3px; }
.account-loading { min-height: 235px; display: grid; place-items: center; color: var(--faint); font-size: 12px; }
.account-loading::before {
  content: ''; width: 22px; height: 22px; margin-bottom: 9px; border-radius: 50%;
  border: 2px solid var(--brand-soft); border-top-color: var(--blue); animation: accountSpin .8s linear infinite;
}
@keyframes accountSpin { to { transform: rotate(360deg); } }
.account-error {
  margin-top: 11px; padding: 10px 12px; border: 1px solid #ffa9bd; border-radius: 9px;
  background: var(--red-soft); color: var(--red); font-size: 11px; line-height: 1.6; word-break: break-word;
}
.account-note { margin-top: 9px; color: var(--faint); font-size: 10px; line-height: 1.6; }
.account-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 7px;
  padding: 11px 18px; border-top: 1px solid #f1f5f9; background: #fff;
}
.account-foot .btn { padding: 6px 11px; font-size: 11.5px; }
.account-delete { margin-left: 2px; padding: 6px 4px; color: var(--faint); font-size: 10.5px; }
.account-delete:hover { color: var(--red); }
.account-delete.hidden { display: none !important; }
.account-page-hint { padding: 12px 2px 0; color: var(--faint); line-height: 1.7; }

.account-modal { width: min(480px, 92vw); max-height: 92vh; overflow-y: auto; }
.account-modal-sub { margin: -3px 0 13px; color: var(--mute); font-size: 12px; line-height: 1.65; }
.account-fields label { display: block; margin-top: 11px; color: var(--mute); font-size: 11.5px; font-weight: 600; }
.account-fields input { margin-top: 6px; }
.account-modal-guide {
  margin-top: 13px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: #f8fafc; color: var(--mute); font-size: 10.5px; line-height: 1.7;
}
.account-security { margin-top: 9px; color: var(--faint); font-size: 10px; line-height: 1.65; }
.account-security code { padding: 1px 4px; border-radius: 4px; background: var(--tone-slate); color: var(--mute); }

/* 黄金台账 */
.gold-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.gold-stat { position: relative; overflow: hidden; padding: 17px 19px 16px; }
.gold-stat::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold-accent, var(--gold)); }
.gold-stat.physical { --gold-accent: var(--gold); background: linear-gradient(135deg,var(--tone-gold) 0%,#fff 76%); }
.gold-stat.paper { --gold-accent: var(--sky); background: linear-gradient(135deg,var(--tone-sky) 0%,#fff 76%); }
.gold-stat.total { --gold-accent: #4f8cff; background: linear-gradient(135deg,#06132e 0%,#0b3fa8 100%); color: #fff; box-shadow: 0 14px 30px rgba(6,19,46,.22); }
.gold-stat-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--mute); font-size: 11.5px; font-weight: 650; }
.gold-stat.total .gold-stat-label { color: #d8e5ff; }
.gold-stat-label small { color: var(--faint); font-size: 9.5px; font-weight: 500; }
.gold-stat-value { display: block; margin-top: 7px; font-size: 24px; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.gold-stat.total .gold-stat-value { color: #fff; }
.gold-stat-sub { display: block; margin-top: 6px; color: var(--faint); font-size: 10.5px; line-height: 1.5; }
.gold-stat.total .gold-stat-sub { color: #bcd0f5; }
.gold-heading, .member-heading { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.gold-heading .range, .member-heading .range { color: var(--faint); }
#gold-table select { min-width: 92px; }
#gold-table td.gold-value { color: var(--text); font-weight: 650; }

/* 会员 */
.member-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.member-kpi { position: relative; overflow: hidden; padding: 17px 19px 16px; }
.member-kpi::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--member-accent, var(--blue)); }
.member-kpi.members { --member-accent: var(--indigo); background: linear-gradient(135deg,var(--tone-indigo) 0%,#fff 76%); }
.member-kpi.revenue { --member-accent: var(--green); background: linear-gradient(135deg,var(--green-soft) 0%,#fff 76%); }
.member-kpi.wallet { --member-accent: var(--sky); background: linear-gradient(135deg,var(--tone-sky) 0%,#fff 76%); }
.member-kpi span { display: block; color: var(--mute); font-size: 11.5px; font-weight: 650; }
.member-kpi b { display: block; margin-top: 7px; font-size: 25px; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.member-kpi small { display: block; margin-top: 6px; color: var(--faint); font-size: 10.5px; line-height: 1.5; }
.member-wallet-card { margin-bottom: 14px; }
.member-wallet-list { display: grid; gap: 9px; padding: 2px 20px 18px; }
.member-wallet-item { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 13px; border: 1px solid var(--border); border-radius: 11px; background: #f8faff; }
.member-wallet-network { flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; background: var(--brand-soft); color: var(--blue-dark); font-size: 9.5px; font-weight: 750; letter-spacing: .02em; }
.member-wallet-main { min-width: 0; flex: 1; }
.member-wallet-main b { display: block; color: #334155; font-size: 12.5px; font-weight: 650; }
.member-wallet-address { display: block; margin-top: 3px; color: var(--faint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-wallet-side { flex: 0 0 auto; text-align: right; }
.member-wallet-side b { display: block; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.member-wallet-side small { display: block; margin-top: 3px; color: var(--faint); font-size: 9.5px; }
.member-wallet-side small.error { color: var(--red); max-width: 190px; white-space: normal; }
.member-wallet-delete { flex: 0 0 auto; width: 27px; height: 27px; border-radius: 7px; color: var(--faint); font-size: 11px; }
.member-wallet-delete:hover { color: var(--red); background: var(--red-soft); }
.member-wallet-empty { min-height: 96px; display: flex; align-items: center; justify-content: center; border: 1px dashed #c5d3e4; border-radius: 11px; color: var(--faint); font-size: 11.5px; text-align: center; padding: 18px; }
.member-payment-card .table-wrap { max-width: 100%; }
.member-payment-card td.tx { color: var(--mute); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; }
.member-payment-card td.member-name { color: #334155; font-weight: 600; }
.member-payment-card td.revenue { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }
.member-empty { color: var(--faint); text-align: center; padding: 22px !important; }
.member-form-modal { width: min(540px, 92vw); max-height: 92vh; overflow-y: auto; }
.member-payment-modal { width: min(640px, 94vw); }
.member-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.member-form-row { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; min-width: 0; }
.member-form-row.wide { grid-column: 1 / -1; }
.member-form-row label { color: var(--mute); font-size: 11px; font-weight: 650; }
.member-form-row input, .member-form-row select { width: 100%; margin-top: 0; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; background: #fff; font-size: 13px; }
.member-form-row input:focus, .member-form-row select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49,87,213,.08); }

@media (max-width: 1080px) {
  .crypto-grid { grid-template-columns: 1fr; }
  .account-card { min-height: 0; }
}
@media (max-width: 860px) {
  .account-head { padding: 13px 14px; }
  .account-body { padding: 13px 14px 10px; }
  .account-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-summary .account-metric:first-child { grid-column: 1 / -1; }
  .account-summary.ibkr-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-summary.ibkr-summary .account-metric:first-child { grid-column: auto; }
  .account-summary.crypto-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-summary.crypto-summary .account-metric:first-child { grid-column: auto; }
  .account-table-wrap { margin: 11px -14px 0; }
  .account-foot { padding: 10px 14px; }
  .account-page-hint { padding: 10px 2px 0; }
  .gold-summary, .member-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gold-stat:last-child, .member-kpi:last-child { grid-column: 1 / -1; }
  .gold-stat, .member-kpi { padding: 14px 15px 13px; }
  .gold-stat-value { font-size: 21px; }
  .member-kpi b { font-size: 22px; }
  .member-wallet-list { padding: 2px 14px 15px; }
  .deposit-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px 14px; }
  .deposit-summary .ds-item:last-child { grid-column: 1 / -1; }
  .deposit-summary .ds-item { padding: 10px 12px; }
  .deposit-summary .ds-item b { font-size: 16px; }
}
@media (max-width: 420px) {
  .account-ident { gap: 9px; }
  .account-ident h3 { font-size: 14px; }
  .account-ident small { font-size: 9.5px; }
  .provider-logo { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
  .integration-badge { padding: 4px 7px; font-size: 9.5px; }
  .account-metric { padding: 10px; }
  .account-metric b { font-size: 14px; }
  .member-wallet-item { flex-wrap: wrap; align-items: flex-start; }
  .member-wallet-main { flex-basis: calc(100% - 112px); }
  .member-wallet-side { margin-left: auto; }
  .member-wallet-network { order: 0; }
  .member-wallet-delete { order: 1; }
  .member-wallet-main { order: 2; }
  .member-wallet-side { order: 3; }
  .member-form-grid { grid-template-columns: 1fr; }
  .member-form-row.wide { grid-column: auto; }
  .gold-heading, .member-heading { width: 100%; flex-wrap: wrap; gap: 3px 9px; }
}
@media (max-width: 600px) {
  .account-table.crypto-asset-table { min-width: 0; }
  .account-table.crypto-asset-table .crypto-qty,
  .account-table.crypto-asset-table .crypto-price { display: none; }
  .account-table.crypto-asset-table th, .account-table.crypto-asset-table td { padding-left: 4px; padding-right: 4px; }
}

/* 顶栏图标：用线性图标替代 emoji */
#btn-hide, #btn-logout { font-size: 0; color: var(--mute); }
#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: var(--mute); 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: #c7d7f5; white-space: nowrap; }
.hero-stat b { font-size: 14px; font-weight: 650; color: #eef4ff; font-variant-numeric: tabular-nums; }
.hero-stat b.up { color: #5ef2c0; }
.hero-stat b.down { color: #ff9fb2; }
.hero-date { position: relative; z-index: 1; margin-top: 12px; font-size: 10.5px; color: #b8cdf2; }

/* 目标金额：只读文本 + 编辑按钮 */
.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: #dce6ff; 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: var(--blue-dark); }
.goal-save:hover { background: var(--brand-soft); }
.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; }

/* 净值图类型切换 */
.chart-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-left: auto; min-width: 0; }
.chart-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--tone-slate); }
.chart-switch .chart-mode {
  padding: 4px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  line-height: 1.2; color: var(--mute); white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.chart-switch .chart-mode:hover { color: var(--text); }
.chart-switch .chart-mode.active { background: #fff; color: var(--blue-dark); box-shadow: 0 1px 2px rgba(18,24,38,.08); }
.chart-card .chart-tools .range { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#networth-chart .bar-seg, #networth-chart .bar-growth { transition: opacity .15s ease; }
#networth-chart .bar-seg:hover, #networth-chart .bar-growth:hover { opacity: .78; }

@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; }
  .chart-card .card-head { align-items: flex-start; }
  .chart-card .chart-tools { width: 100%; justify-content: space-between; }
  .chart-card .chart-tools .range { white-space: normal; text-align: right; }
}

/* Android APK 下载 */
.download-btn { text-decoration: none; color: var(--mute); }
.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: var(--green); }
.side-profile small.syncing { color: var(--amber); }
.side-profile small.offline { color: var(--red); }
.logout-text { margin: 0 0 4px; color: var(--mute); font-size: 13px; line-height: 1.65; }
.modal-actions button.danger { background: var(--red); color: #fff; }
.modal-actions button.danger:hover { background: #b44f5e; }
.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: var(--faint); }
.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: var(--hover); }
.diary-item.active { background: var(--brand-soft); border-color: #dce5fb; }
.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: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.diary-item.active .diary-item-date { color: var(--blue-dark); }
.diary-list-empty { padding: 26px 14px; text-align: center; color: var(--faint); 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: var(--faint); }
.diary-save-state.dirty { color: var(--amber); }
.diary-save-state.saved { color: var(--green); }
.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: var(--faint); }
.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: var(--faint); 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: var(--mute); 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: var(--mute); background: transparent;
}
.log-month-head:hover { background: var(--hover); }
.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 #64748b; 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: #64748b; }
.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: var(--blue-dark); }
.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: var(--faint);
  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: var(--faint); font-size: 10.5px;
}
.diary-timestamps b { color: var(--mute); font-weight: 500; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .diary-timestamps { padding: 8px 15px; gap: 3px 14px; }
}

/* ============================================================
   A/B/C/D 风险配比与利润提取
   ============================================================ */
.mini-sub { margin-left: 5px; color: var(--faint); font-size: 10px; font-weight: 500; }
.risk-card, .sweep-card { margin-top: 17px; overflow: hidden; }
.risk-target-edit { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.risk-target-label { font-size: 11px; color: var(--faint); }
.risk-target-edit label {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px 7px; border: 1px solid var(--border); border-radius: 7px;
  background: #f8fafc; color: var(--mute); font-size: 11px;
}
.risk-target-edit input {
  width: 34px; border: 0; outline: none; background: transparent;
  color: var(--text); font-size: 11.5px; text-align: right;
}
.risk-body { padding: 16px 20px 17px; }
.risk-bar {
  display: flex; height: 18px; overflow: hidden; border-radius: 999px;
  background: var(--line-soft); box-shadow: inset 0 1px 2px rgba(18,24,38,.04);
}
.risk-seg { display: flex; align-items: center; justify-content: center; min-width: 2px; color: #fff; font-size: 9.5px; font-weight: 700; white-space: nowrap; transition: width .3s ease; }
.risk-empty { padding: 3px 12px; color: var(--faint); font-size: 10.5px; }
.risk-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 13px; }
.risk-stat {
  position: relative; overflow: hidden; padding: 11px 12px 10px;
  border: 1px solid var(--border); border-radius: 11px; background: #fff;
}
.risk-stat::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--risk-color); }
.risk-stat-head { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; font-weight: 650; color: #334155; }
.risk-stat-head small { color: var(--faint); font-size: 10px; font-weight: 400; }
.risk-stat > b { display: block; margin-top: 4px; font-size: 21px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.risk-stat > small { display: block; margin-top: 2px; color: var(--faint); font-size: 10px; }
.risk-stat.off > small { color: var(--amber); }
.risk-note { margin-top: 10px; font-size: 10.5px; color: var(--faint); line-height: 1.6; }
.sweep-title { display: flex; align-items: baseline; gap: 8px; }
.sweep-kicker { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--amber); }
.sweep-body { padding: 14px 20px 17px; }
.sweep-rule {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px;
  border: 1px solid #eadcbe; border-radius: 10px; background: var(--amber-soft);
  color: #855a1d; font-size: 12px; line-height: 1.6;
}
.sweep-rule b { white-space: nowrap; }
.sweep-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--mute); font-size: 11px; }
.sweep-stats b { color: #334155; font-variant-numeric: tabular-nums; }
.sweep-list { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.sweep-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 11px; }
.sweep-route { min-width: 54px; font-weight: 700; color: #475569; }
.sweep-date { color: var(--faint); }
.sweep-item b { margin-left: auto; color: #334155; font-variant-numeric: tabular-nums; }
.sweep-item small { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); }
.sweep-empty { padding: 9px 2px 2px; color: var(--faint); font-size: 11px; }
.transfer-modal { width: min(420px, 92vw); }
.transfer-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.transfer-row label { width: 68px; flex: 0 0 68px; color: var(--mute); font-size: 12px; }
.transfer-row input, .transfer-row select { flex: 1; min-width: 0; margin-top: 0; }
.transfer-modal #transfer-note { margin-top: 10px; }
.transfer-hint { margin-top: 8px; color: var(--faint); font-size: 10.5px; line-height: 1.55; }
@media (max-width: 860px) {
  .risk-target-edit { width: 100%; }
  .risk-body { padding: 13px 14px 15px; }
  .risk-cards { grid-template-columns: 1fr; gap: 7px; }
  .sweep-body { padding: 12px 14px 15px; }
  .sweep-item { flex-wrap: wrap; }
  .sweep-item b { margin-left: auto; }
  .sweep-item small { flex-basis: 100%; max-width: none; padding-left: 64px; }
}

.risk-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 11px; color: var(--mute); }
.risk-summary b { color: #334155; font-size: 14px; font-variant-numeric: tabular-nums; }
.risk-money { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 4px; color: var(--faint); font-size: 10.5px; }
.risk-money b { color: #475569; font-weight: 600; font-variant-numeric: tabular-nums; }
.risk-gap { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }
.risk-stat.off .risk-gap { color: var(--amber); }
@media (max-width: 860px) {
  .risk-summary { margin-bottom: 7px; }
  .risk-money { gap: 2px 8px; }
}
.risk-stat .risk-gap.up { color: var(--amber); font-weight: 650; }
.risk-stat .risk-gap.down { color: var(--blue); font-weight: 650; }

/* ============================================================
   凯利配置测算
   ============================================================ */
.kelly-card { order: 1; grid-column: 1 / -1; margin-top: 0; overflow: hidden; }
.risk-card, .sweep-card { order: 2; }
.kelly-heading { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.kelly-body { padding: 16px 20px 17px; }
.kelly-body.collapsed { display: none; }
.kelly-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.kelly-asset { position: relative; overflow: hidden; padding: 11px 12px 10px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.kelly-asset::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--kc); }
.kelly-asset-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 7px; }
.kelly-asset-head b { font-size: 14px; color: var(--kc); }
.kelly-asset-head span { color: var(--faint); font-size: 10.5px; }
.kelly-asset label { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--mute); font-size: 10.5px; }
.kelly-asset input { width: 74px; margin-left: auto; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; background: #f8fafc; color: var(--text); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.kelly-unit { width: 8px; color: var(--faint); font-size: 9.5px; }
.kelly-params { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.kelly-params label { display: flex; align-items: center; gap: 5px; color: var(--mute); font-size: 10.5px; }
.kelly-params input { width: 64px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; background: #f8fafc; color: var(--text); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.kelly-params label span { color: var(--faint); font-size: 9.5px; }
.kelly-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.kelly-hint { color: var(--faint); font-size: 10.5px; }
.kelly-hint.err { color: #e11d48; }
.kelly-result { margin-top: 14px; }
.kelly-result:empty { display: none; }
.kelly-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.kelly-sum { position: relative; overflow: hidden; padding: 11px 12px 10px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.kelly-sum::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--kc); }
.kelly-sum span { display: block; overflow: hidden; color: var(--faint); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.kelly-sum b { display: block; margin-top: 3px; font-size: 21px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kelly-sum small { display: block; margin-top: 2px; color: var(--faint); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.kelly-bar { display: flex; height: 30px; margin-top: 14px; overflow: hidden; border-radius: 9px; background: var(--line-soft); box-shadow: inset 0 1px 2px rgba(18,24,38,.04); }
.kelly-seg { display: flex; align-items: center; justify-content: center; min-width: 2px; color: #fff; font-size: 9.5px; font-weight: 700; white-space: nowrap; transition: width .3s ease; }
.kelly-table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.kelly-table th, .kelly-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.kelly-table th { color: var(--faint); font-size: 9.5px; font-weight: 600; }
.kelly-table th:first-child, .kelly-table td:first-child { text-align: left; color: var(--mute); }
.kelly-table tr.active td { background: #f3f7ff; color: var(--blue); font-weight: 700; }
.kelly-stats { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 10px; color: var(--faint); font-size: 10px; }
.kelly-stats b { color: #334155; font-variant-numeric: tabular-nums; }
.kelly-warn { margin-top: 9px; padding: 8px 10px; border: 1px solid #f3d3c4; border-radius: 8px; background: #fff7f2; color: #9a3412; font-size: 10.5px; line-height: 1.55; }
.kelly-note { margin-top: 11px; color: var(--faint); font-size: 10.5px; line-height: 1.6; }

/* C 类高波动现货：分数凯利 + 回撤预算 */
.spot-kelly { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border); }
.spot-kelly-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.spot-kelly-head h4 { margin: 0; color: var(--text); font-size: 13.5px; font-weight: 750; letter-spacing: -.01em; }
.spot-kelly-head span { display: block; margin-top: 3px; color: var(--faint); font-size: 10.5px; }
.spot-kelly-head > small { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: #fff1f2; color: #be123c; font-size: 9.5px; font-weight: 650; white-space: nowrap; }
.spot-kelly-inputs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.spot-kelly-inputs label { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 7px 8px; border: 1px solid var(--border); border-radius: 9px; background: #f8fafc; color: var(--mute); font-size: 10px; }
.spot-kelly-inputs label > span { flex: 0 0 auto; color: var(--faint); font-size: 9px; }
.spot-kelly-inputs input { flex: 0 0 54px; width: 54px; min-width: 0; margin-left: auto; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.spot-kelly-result { margin-top: 12px; }
.spot-kelly-empty { padding: 10px 12px; border-radius: 9px; background: #f8fafc; color: var(--faint); font-size: 10.5px; }
.spot-kelly-empty.err { background: #fff1f2; color: #be123c; }
.spot-kelly-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.spot-metric { padding: 10px 11px 9px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.spot-metric span { display: block; color: var(--faint); font-size: 9.5px; }
.spot-metric b { display: block; margin-top: 3px; color: var(--text); font-size: 20px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.spot-metric small { display: block; min-height: 13px; margin-top: 2px; color: var(--faint); font-size: 9px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.spot-metric.primary { border-color: #b9caf8; background: #f3f7ff; }
.spot-metric.primary b { color: var(--blue); }
.spot-metric.danger { border-color: #fecdd3; background: #fff7f8; }
.spot-metric.danger b { color: #be123c; }
.spot-kelly-bar { display: flex; height: 26px; margin-top: 10px; overflow: hidden; border-radius: 8px; background: #e8edf5; box-shadow: inset 0 1px 2px rgba(18,24,38,.04); }
.spot-kelly-bar span { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; font-size: 9.5px; font-weight: 700; white-space: nowrap; transition: width .3s ease; }
.spot-kelly-bar .spot-risk { background: #f59e0b; color: #fff; }
.spot-kelly-bar .spot-cash { background: #e2e8f0; color: #64748b; }
.spot-kelly-stats { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-top: 9px; color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.spot-kelly-stats b { color: #334155; }
.spot-kelly-warn { margin-top: 9px; padding: 8px 10px; border: 1px solid #fecdd3; border-radius: 8px; background: #fff7f8; color: #9f1239; font-size: 10.5px; line-height: 1.55; }
.spot-kelly-warn p + p { margin-top: 5px; }
.spot-kelly-note { margin-top: 9px; color: var(--faint); font-size: 10px; line-height: 1.65; }
@media (max-width: 860px) {
  .kelly-body { padding: 13px 14px 15px; }
  .kelly-grid { grid-template-columns: 1fr; gap: 7px; }
  .kelly-summary { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .kelly-table { display: block; margin-top: 11px; }
  .kelly-table thead { display: none; }
  .kelly-table tbody { display: grid; gap: 7px; }
  .kelly-table tr { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px 8px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
  .kelly-table tr.active { border-color: #b9caf8; background: #f3f7ff; }
  .kelly-table td { padding: 0; border: 0; text-align: left; white-space: normal; }
  .kelly-table td:first-child { grid-column: 1 / -1; padding-bottom: 7px; border-bottom: 1px dashed var(--border); color: var(--text); font-weight: 700; }
  .kelly-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--faint); font-size: 8.5px; font-weight: 600; }
  .kelly-table tr.active td { background: transparent; }
  .spot-kelly-head { flex-direction: column; gap: 6px; }
  .spot-kelly-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spot-kelly-inputs label:first-child { grid-column: 1 / -1; }
  .spot-kelly-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spot-kelly-bar { height: 30px; }
}
@media (max-width: 600px) {
  .spot-kelly-inputs { grid-template-columns: 1fr; }
  .spot-kelly-inputs label:first-child { grid-column: auto; }
  .spot-kelly-inputs input { flex-basis: 72px; width: 72px; }
}
