:root {
  --bg:       #f0f4f9;
  --bg-card:  #ffffff;
  --bg-elev:  #f8fafc;
  --border:   rgba(15, 23, 42, 0.08);
  --ba:       rgba(180, 83, 9, 0.18);   /* border-accent */

  --navy:   #1e3a5f;
  --gold:   #c8920a;
  --gold-s: rgba(200, 146, 10, 0.10);
  --red:    #dc2626;
  --red-s:  rgba(220, 38, 38, 0.08);
  --green:  #059669;
  --green-s:rgba(5, 150, 105, 0.08);
  --amber:  #b45309;
  --amber-s:rgba(180, 83, 9, 0.08);
  --blue:   #2563eb;
  --blue-s: rgba(37, 99, 235, 0.08);

  --ink:    #0f172a;
  --sub:    #475569;
  --muted:  #94a3b8;
  --line:   rgba(15, 23, 42, 0.06);

  --sh-card: 0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.04);
  --sh-sm:   0 1px 3px rgba(15,23,42,0.08);
  --r:    16px;
  --r-sm: 10px;
}

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

body {
  font-family: "Outfit", "PingFang SC", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

/* ─── Shell ─── */
.app-shell {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100svh;
  background: var(--bg);
  position: relative;
}

/* ─── Views ─── */
.view { display: none; }
.view.active { display: flex; flex-direction: column; min-height: 100svh; }

/* ─── Top bar ─── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  background: rgba(240, 244, 249, 0.95);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; color: var(--ink); }

@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.65; }
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-s);
  border: 1px solid var(--ba);
  color: var(--amber);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* Detail header */
.back-btn {
  display: flex; align-items: center; gap: 4px;
  background: transparent; border: 0;
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--blue); cursor: pointer; padding: 0;
}
.detail-header-right {
  display: flex; align-items: center; gap: 8px;
}
.detail-name {
  font-family: "Noto Serif SC", serif;
  font-size: 18px; font-weight: 600;
}

/* ─── Page body ─── */
.page-body { flex: 1; padding: 4px 0 24px; overflow-y: auto; }

/* ─── Section label ─── */
.section-lbl {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  padding: 18px 20px 8px;
}
.section-lbl::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}

/* ─── Hero KPI card ─── */
.hero-card {
  margin: 12px 16px 0;
  background: linear-gradient(135deg, #f0f6ff 0%, #eef2fb 55%, #f5f8ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--sh-card);
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute; top: -50px; right: -50px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.kpi-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.kpi { display: flex; flex-direction: column; align-items: center; position: relative; }
.kpi + .kpi::before {
  content: ""; position: absolute; left: 0; top: 10%; height: 80%;
  width: 1px; background: rgba(37,99,235,0.10);
}
.kpi-val {
  font-size: 21px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  color: var(--ink); line-height: 1;
}
.kpi-val.up   { color: var(--green); }
.kpi-val.gold { color: var(--amber); }
.kpi-lbl { font-size: 10px; color: var(--muted); margin-top: 5px; }

/* ─── List tab switcher ─── */
.list-tabs {
  display: flex; gap: 0;
  margin: 16px 16px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px;
  box-shadow: var(--sh-sm);
}
.ltab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: 0;
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  border-radius: 7px; padding: 9px 6px;
  transition: background 0.15s, color 0.15s;
}
.ltab.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(30,58,95,0.18);
}
.ltab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 10px; font-weight: 700;
}
.ltab.active .ltab-badge { background: rgba(255,255,255,0.25); }

/* ─── List tab panels ─── */
.ltab-panel { display: none; }
.ltab-panel.active { display: block; }

/* ─── Client list ─── */
.client-list { padding: 8px 16px 0; display: grid; gap: 8px; }

.client-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.client-card:active { box-shadow: none; }

.client-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue-s);
  border: 1px solid rgba(37,99,235,0.12);
  color: var(--blue); font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ci { flex: 1; min-width: 0; }
.client-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.client-name .ph { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.client-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Pending-specific: alert reason */
.client-alert-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 5px;
}
.alert-chip {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
  background: var(--amber-s); color: var(--amber);
}
.alert-chip.red { background: var(--red-s); color: var(--red); }
.alert-reason { font-size: 11px; color: var(--sub); }

.risk-badge {
  font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px; flex-shrink: 0;
}
.r-con   { background: var(--green-s); color: var(--green); }
.r-wen   { background: var(--blue-s);  color: var(--blue); }
.r-pin   { background: var(--gold-s);  color: var(--amber); }
.r-cheng { background: var(--amber-s); color: var(--amber); }
.r-jin   { background: var(--red-s);   color: var(--red); }

.chevron {
  color: var(--muted); flex-shrink: 0;
}

/* ─── Search / sort ─── */
.search-wrap { padding: 8px 16px 0; }

input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font: inherit; font-size: 13px; color: var(--ink);
  box-shadow: var(--sh-sm);
}

.sort-row {
  display: flex; gap: 8px;
  padding: 8px 16px 4px;
}

.sort-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--r-sm);
  padding: 7px 14px;
  font: inherit; font-size: 12px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  box-shadow: var(--sh-sm);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sort-btn.active {
  background: var(--blue-s);
  color: var(--blue);
  border-color: rgba(37,99,235,0.20);
}
.sort-btn svg { flex-shrink: 0; transition: transform 0.2s; }
.sort-btn.desc svg { transform: rotate(180deg); }

/* ─── Bottom bar ─── */
.bottom-bar {
  padding: 12px 16px 28px;
  background: rgba(240,244,249,0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.bottom-btn {
  display: block; width: 100%;
  background: var(--navy); color: #fff;
  border: 0; border-radius: var(--r-sm);
  padding: 15px; font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: center;
  box-shadow: 0 4px 14px rgba(30,58,95,0.24);
}

/* ─── Client summary card (detail) ─── */
.client-summary-card {
  margin: 12px 16px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 20px;
  display: flex; align-items: center;
  box-shadow: var(--sh-card);
}
.cs-item { flex: 1; display: flex; flex-direction: column; align-items: center; }
.cs-val {
  font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink); line-height: 1;
}
.cs-val-sm   { font-size: 13px; }
.cs-val-warn { color: var(--amber); }
.cs-lbl { font-size: 10px; color: var(--muted); margin-top: 4px; }
.cs-divider { width: 1px; height: 32px; background: var(--line); flex-shrink: 0; }

/* ─── Holdings ─── */
.holding-list { padding: 0 16px; }
.holding-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.holding-row:last-child { border-bottom: 0; }
.h-name { font-size: 14px; font-weight: 500; }
.h-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.h-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.h-amt { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.h-pct { font-size: 11px; color: var(--muted); }

.code-tag {
  display: inline-block;
  font-size: 10px; color: var(--muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; margin-left: 4px;
  vertical-align: middle;
}

/* ─── Steps ─── */
.steps-wrap { padding: 0 16px; }
.steps {
  display: flex; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  box-shadow: var(--sh-sm);
}
.step {
  flex: 1; text-align: center;
  font-size: 12px; font-weight: 500; color: var(--muted);
}
.step.active { color: var(--navy); font-weight: 700; }
.step.done   { color: var(--green); }
.step-line   { width: 20px; height: 1px; background: var(--line); flex-shrink: 0; }

.step-panel { display: none; }
.step-panel.active { display: block; }

/* ─── Diagnosis ─── */
.diag-header {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 16px 20px 4px;
}
.diag-score-num {
  font-family: "Noto Serif SC", serif;
  font-size: 56px; line-height: 1;
  color: var(--amber); letter-spacing: -0.02em;
}
.diag-score-unit { font-size: 18px; color: var(--muted); padding-bottom: 5px; }
.diag-score-lbl  { font-size: 12px; color: var(--muted); padding-bottom: 7px; margin-left: 4px; }

/* Signal cards */
.signal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }

.sig-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px; box-shadow: var(--sh-sm);
  position: relative; overflow: hidden;
}
.sig-card.red   { border-color: rgba(220,38,38,0.20); background: linear-gradient(135deg,#fff5f5 0%,#fff 100%); }
.sig-card.amber { border-color: rgba(180,83,9,0.20);  background: linear-gradient(135deg,#fffbf0 0%,#fff 100%); }
.sig-card.green { border-color: rgba(5,150,105,0.20); background: linear-gradient(135deg,#f0fdf8 0%,#fff 100%); }

.sig-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sig-dot  { width: 8px; height: 8px; border-radius: 50%; }
.sig-card.red   .sig-dot { background: var(--red);   box-shadow: 0 0 6px rgba(220,38,38,.4); }
.sig-card.amber .sig-dot { background: var(--gold);  box-shadow: 0 0 6px rgba(200,146,10,.4); }
.sig-card.green .sig-dot { background: var(--green); box-shadow: 0 0 6px rgba(5,150,105,.4); }

.sig-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.sig-card.red   .sig-badge { color: var(--red);   background: var(--red-s); }
.sig-card.amber .sig-badge { color: var(--amber); background: var(--amber-s); }
.sig-card.green .sig-badge { color: var(--green); background: var(--green-s); }

.sig-name { font-size: 11px; font-weight: 500; color: var(--sub); margin-bottom: 6px; }
.sig-val  { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.03em; margin-bottom: 3px; }
.sig-card.red   .sig-val { color: var(--red); }
.sig-card.amber .sig-val { color: var(--amber); }
.sig-card.green .sig-val { color: var(--green); }
.sig-desc { font-size: 10px; color: var(--muted); line-height: 1.5; }
.sig-bar-wrap { margin-top: 10px; }
.sig-bar-bg   { height: 3px; background: rgba(0,0,0,0.05); border-radius: 2px; }
.sig-bar-fill { height: 100%; border-radius: 2px; transition: width 1.2s cubic-bezier(.16,1,.3,1); }
.sig-card.red   .sig-bar-fill { background: var(--red); }
.sig-card.amber .sig-bar-fill { background: var(--gold); }
.sig-card.green .sig-bar-fill { background: var(--green); }

/* ─── Model switch ─── */
.model-wrap { padding: 8px 16px 0; }
.model-switch {
  display: inline-flex;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 4px; gap: 4px;
  box-shadow: var(--sh-sm);
}
.model-btn {
  border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 500;
  padding: 7px 12px; font-family: inherit; border: 0; cursor: pointer;
}
.model-btn.active {
  background: var(--navy); color: #fff;
  box-shadow: 0 2px 8px rgba(30,58,95,0.18);
}

/* ─── Alloc list ─── */
.alloc-list { padding: 0 16px; display: grid; gap: 9px; }
.alloc-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 14px; box-shadow: var(--sh-sm);
}
.ring-wrap { flex-shrink: 0; }
.alloc-info { flex: 1; }
.alloc-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.alloc-pct  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.alloc-amt  { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }

/* ─── Product list ─── */
.product-list { padding: 0 16px; display: grid; gap: 9px; }
.product-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 14px; box-shadow: var(--sh-sm);
}
.product-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.product-name { font-size: 14px; font-weight: 500; color: var(--ink); flex: 1; }
.product-cat  { font-size: 10px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.product-cat.c-cash   { background: var(--green-s); color: var(--green); }
.product-cat.c-fixed  { background: var(--blue-s);  color: var(--blue); }
.product-cat.c-equity { background: var(--red-s);   color: var(--red); }
.product-cat.c-ins    { background: var(--gold-s);  color: var(--amber); }
.product-meta { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* ─── Report ─── */
.report-wrap { padding: 0 16px; }
.report-head {
  text-align: center; padding: 24px 0 18px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.report-bank  { font-size: 11px; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; }
.report-title { font-family: "Noto Serif SC", serif; font-size: 22px; font-weight: 600; }
.report-meta  { font-size: 11px; color: var(--muted); margin-top: 6px; }

.rs { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rs:last-of-type { border-bottom: 0; }
.rs-lbl  { font-size: 10px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.rs-text { font-size: 13px; color: var(--sub); line-height: 1.7; }

.report-tbl { display: grid; gap: 0; font-size: 13px; }
.rt-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rt-row.hdr { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 0.08em; }
.rt-row:last-child { border-bottom: 0; }
.inc { color: var(--green); font-weight: 600; }
.dec { color: var(--red);   font-weight: 600; }
.neu { color: var(--muted); }

.disclaimer .rs-text { font-size: 11px; }

/* ─── 待处理说明卡片 ─── */
.alert-detail-card {
  margin: 0 16px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.alert-detail-card.red { border-left-color: var(--red); }
.adc-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 11px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.adc-sep    { color: var(--border); font-size: 13px; }
.adc-reason { font-size: 13px; color: var(--ink); font-weight: 500; }
.adc-script { padding: 12px 14px; background: var(--bg-elev); }
.adc-script-lbl {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.adc-script-text {
  font-size: 13px; color: var(--sub); line-height: 1.8;
  margin-bottom: 10px;
}
.adc-script-text:last-child { margin-bottom: 0; }

/* ─── 录入客户页 ─── */
.photo-guide-card {
  margin: 12px 16px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 16px 16px;
  box-shadow: var(--sh-card);
  text-align: center;
}
.photo-guide-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.photo-guide-sub   { font-size: 12px; color: var(--muted); margin-bottom: 20px; }

.viewfinder {
  position: relative;
  background: var(--bg-elev);
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  overflow: hidden;
}
.vf-corner {
  position: absolute; width: 16px; height: 16px;
  border-color: var(--navy); border-style: solid; border-width: 0;
}
.vf-corner.tl { top: 8px;  left: 8px;  border-top-width: 2.5px; border-left-width: 2.5px;  border-top-left-radius: 4px; }
.vf-corner.tr { top: 8px;  right: 8px; border-top-width: 2.5px; border-right-width: 2.5px; border-top-right-radius: 4px; }
.vf-corner.bl { bottom: 8px; left: 8px;  border-bottom-width: 2.5px; border-left-width: 2.5px;  border-bottom-left-radius: 4px; }
.vf-corner.br { bottom: 8px; right: 8px; border-bottom-width: 2.5px; border-right-width: 2.5px; border-bottom-right-radius: 4px; }

.vf-scan-line {
  position: absolute; left: 0; right: 0; top: 40%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,.5), transparent);
  animation: scan 2.4s ease-in-out infinite;
}
@keyframes scan { 0%,100% { top: 15%; } 50% { top: 80%; } }

.vf-sample { text-align: left; }
.vfs-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--line);
}
.vfs-row:last-child { border-bottom: 0; }
.vfs-lbl { font-size: 11px; color: var(--muted); width: 60px; flex-shrink: 0; }
.vfs-val { font-size: 13px; color: var(--ink); font-weight: 500; }

/* 持仓截图样例 */
.vf-holding-sample { text-align: left; }
.vfh-title { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.vfh-total { font-size: 12px; color: var(--sub); margin-bottom: 8px; }
.vfh-total strong { color: var(--ink); font-weight: 600; }
.vfh-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.vfh-row.last { border-bottom: 0; }
.vfh-left  { display: flex; flex-direction: column; gap: 2px; }
.vfh-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.vfh-name  { font-size: 12px; font-weight: 500; color: var(--ink); }
.vfh-code  { font-size: 10px; color: var(--muted); }
.vfh-amt   { font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.vfh-ret   { font-size: 10px; font-weight: 500; }
.vfh-ret.up    { color: var(--green); }
.vfh-ret.down  { color: var(--red); }
.vfh-ret.muted { color: var(--muted); }

.photo-tips-list { display: flex; flex-direction: column; gap: 5px; margin-top: 14px; }
.photo-tip {
  display: flex; align-items: flex-start; gap: 5px;
  font-size: 11px; color: var(--muted); line-height: 1.5;
  text-align: left;
}
.photo-tip svg { flex-shrink: 0; margin-top: 1px; }

/* ─── 手工录入表单 ─── */
.form-card {
  margin: 12px 16px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--sh-card);
}
.form-section-lbl {
  font-size: 10px; font-weight: 600; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.form-row { margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-lbl  { display: block; font-size: 12px; font-weight: 500; color: var(--sub); margin-bottom: 6px; }
.form-input {
  width: 100%; box-sizing: border-box;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px;
  font: inherit; font-size: 14px; color: var(--ink);
  outline: none; transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--navy); }
.form-textarea { resize: none; line-height: 1.6; }

.form-radio-group { display: flex; gap: 16px; padding-top: 10px; }
.form-radio { display: flex; align-items: center; gap: 5px; font-size: 14px; color: var(--ink); cursor: pointer; }
.form-radio input { accent-color: var(--navy); width: 15px; height: 15px; }

.form-seg {
  display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 2px;
}
.seg-btn {
  flex-shrink: 0;
  padding: 6px 12px; border-radius: 999px;
  font: inherit; font-size: 12px; font-weight: 500;
  background: var(--bg-elev); color: var(--sub);
  border: 1px solid var(--border);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.seg-btn.active {
  background: var(--navy); color: #fff; border-color: var(--navy);
}

/* ─── 调仓说明框 ─── */
.adj-note-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
}
.adj-note-text { font-size: 13px; color: var(--sub); line-height: 1.75; }
.adj-note-text strong { color: var(--navy); font-weight: 600; }
.adj-note-list {
  margin: 10px 0 0 2px; padding-left: 16px;
  display: flex; flex-direction: column; gap: 5px;
}
.adj-note-list li { font-size: 13px; color: var(--sub); line-height: 1.6; }

/* ─── Chart card ─── */
.chart-card {
  margin: 0 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 12px 8px;
  box-shadow: var(--sh-card);
  overflow: hidden;
}
.chart-box { width: 100%; }
.chart-legend {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 4px 2px;
}
.cl-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--sub); }
.cl-dot  { width: 10px; height: 3px; border-radius: 2px; flex-shrink: 0; }

/* ─── Allocation compare table ─── */
.compare-wrap {
  margin: 0 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.compare-hdr {
  display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  padding: 8px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.compare-row {
  display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
}
.compare-row:last-child { border-bottom: 0; }
.compare-row.over  { border-left-color: var(--amber); }
.compare-row.under { border-left-color: var(--blue); }
.compare-row.flat  { border-left-color: var(--green); }

.compare-cat { font-size: 13px; font-weight: 500; color: var(--ink); }
.compare-num { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--sub); }
.compare-delta {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 5px;
  white-space: nowrap; justify-self: start;
}
.compare-row.over  .compare-delta { color: var(--amber); background: var(--amber-s); }
.compare-row.under .compare-delta { color: var(--blue);  background: var(--blue-s); }
.compare-row.flat  .compare-delta { color: var(--green); background: var(--green-s); }

/* ─── Grouped products (step 2) ─── */
.prod-group {
  margin: 0 16px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.prod-group-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.prod-group-ring { flex-shrink: 0; }
.prod-group-info { display: flex; flex-direction: column; gap: 1px; }
.prod-group-pct  { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.prod-group-amt  { font-size: 11px; color: var(--muted); }
.prod-group-cat  { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.prod-group-cat.c-cash,  .rpl-cat.c-cash   { background: var(--green-s); color: var(--green); }
.prod-group-cat.c-fixed, .rpl-cat.c-fixed  { background: var(--blue-s);  color: var(--blue); }
.prod-group-cat.c-equity,.rpl-cat.c-equity { background: var(--red-s);   color: var(--red); }
.prod-group-cat.c-ins,   .rpl-cat.c-ins    { background: var(--gold-s);  color: var(--amber); }
.prod-group-meta { font-size: 12px; color: var(--muted); margin-left: auto; }

/* 增配/减配/持平 标签 */
.adj-tag {
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
  white-space: nowrap; margin-left: auto; flex-shrink: 0;
}
.adj-inc { background: var(--blue-s);  color: var(--blue); }
.adj-dec { background: var(--amber-s); color: var(--amber); }
.adj-neu { background: var(--green-s); color: var(--green); }

.prod-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.prod-item:last-child { border-bottom: 0; }
.prod-check {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.prod-check.checked { background: var(--navy); border-color: var(--navy); }
.prod-check.checked::after { content: ""; width: 6px; height: 4px; border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff; transform: rotate(-45deg) translateY(-1px); display: block; }
.prod-item-info { flex: 1; }
.prod-item-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.prod-item-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.prod-swap-btn  {
  font-size: 11px; font-weight: 500; color: var(--blue);
  background: var(--blue-s); border: 1px solid rgba(37,99,235,.15);
  border-radius: 6px; padding: 3px 9px;
  font-family: inherit; cursor: pointer; flex-shrink: 0;
}

/* ─── Report product list ─── */
.report-product-list { display: grid; gap: 6px; }
.rpl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.rpl-item:last-child { border-bottom: 0; }
.rpl-cat  { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.rpl-name { font-size: 13px; font-weight: 500; flex: 1; }
.rpl-meta { font-size: 11px; color: var(--muted); }

/* ─── Buttons ─── */
button { font-family: inherit; cursor: pointer; }

.primary-btn {
  background: var(--navy); color: #fff; border: 0;
  border-radius: var(--r-sm); padding: 12px 18px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 2px 8px rgba(30,58,95,0.18);
}
.ghost-btn {
  display: block; width: 100%;
  background: transparent; color: var(--muted);
  border: 0; border-radius: var(--r-sm); padding: 11px;
  font: inherit; font-size: 13px; font-weight: 500; text-align: center;
  margin-top: 8px;
}
.ghost-btn:active { color: var(--sub); }
.full-btn {
  display: block; width: 100%;
  background: var(--navy); color: #fff; border: 0;
  border-radius: var(--r-sm); padding: 15px;
  font: inherit; font-size: 15px; font-weight: 600; text-align: center;
  margin-top: 20px;
  box-shadow: 0 4px 14px rgba(30,58,95,0.24);
}
.btn-wrap { padding: 0 16px; }
