:root {
  --ink: #17201d;
  --muted: #68716e;
  --soft: #f5f6f4;
  --paper: #eef0ed;
  --panel: #ffffff;
  --line: #dde1dd;
  --line-strong: #cdd3ce;
  --green: #167354;
  --green-soft: #eaf4ef;
  --red: #b4473e;
  --red-soft: #f9eeec;
  --amber: #9a681d;
  --amber-soft: #fbf3e4;
  --gold: #8a6a1f;
  --gold-soft: #f7f0dc;
  --pitch: #0f3527;
  --shadow: 0 10px 30px rgba(23,32,29,.045);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  padding: 0 3vw;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand > span:last-child { min-width: 0; }
.brand strong { display: block; font-size: 15px; line-height: 1.2; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: .13em; }
.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #b9cdc4;
  border-radius: 10px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 15px;
  font-weight: 750;
}
nav { height: 68px; display: flex; gap: 26px; }
.nav-link {
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}
.nav-link:hover, .nav-link.active { color: var(--ink); border-color: var(--green); }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.top-actions form { margin: 0; }
.refresh-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.refresh-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.refresh-status.loading i { animation: pulse 1s ease infinite; }
.refresh-status.bad { color: var(--red); }
.refresh-status.bad i { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.ghost, .icon-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  padding: 7px 11px;
  font-size: 11px;
}
.ghost:hover, .icon-button:hover { color: var(--ink); border-color: var(--line-strong); }
main { width: min(1380px, 94vw); margin: 0 auto; padding: 36px 0 70px; }
.view { display: none; }
.view.active { display: block; animation: appear .2s ease; }
@keyframes appear { from { opacity: 0; } }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.compact-page-head { align-items: center; }
.section-label { margin: 0 0 7px; color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: .08em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.015em; }
.muted { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.date-context { text-align: right; }
.date-context span { display: block; color: var(--muted); font-size: 10px; }
.date-context strong { display: block; margin-top: 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.warning {
  margin: -4px 0 16px;
  padding: 12px 15px;
  border: 1px solid #ead7b3;
  border-radius: 10px;
  color: #73501b;
  background: var(--amber-soft);
  font-size: 12px;
}
.hidden { display: none !important; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.summary-grid.capital-summary { grid-template-columns: repeat(3, 1fr); }
.summary-card {
  min-width: 0;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.summary-card.roi-card { border-top: 3px solid var(--green); padding-top: 18px; }
.metric-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.info {
  width: 17px;
  height: 17px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  line-height: 15px;
}
.amount, .compact-amount, .account-rows strong, td {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.amount {
  display: block;
  margin: 17px 0 8px;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(25px, 2.5vw, 32px);
  font-weight: 680;
  line-height: 1;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-card small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px 15px; }
.compact-head { padding-bottom: 12px; }
.panel-caption { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.today-panel { margin-bottom: 14px; }
.today-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.today-grid > div { min-width: 0; padding: 17px 22px 19px; border-right: 1px solid var(--line); }
.today-grid > div:last-child { border-right: 0; }
.today-grid span { display: block; color: var(--muted); font-size: 11px; }
.compact-amount { display: block; margin: 8px 0 5px; font-size: 21px; font-weight: 680; letter-spacing: -.025em; }
.today-grid small { color: var(--muted); font-size: 10px; }
.quiet-badge { padding: 5px 9px; border-radius: 7px; color: var(--muted); background: var(--soft); font-size: 10px; }
.analysis-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, .8fr); gap: 14px; margin-bottom: 14px; }
.range-control, .segmented { display: flex; padding: 3px; border-radius: 8px; background: var(--soft); }
.range-control button, .segmented button {
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  padding: 6px 10px;
  font-size: 10px;
}
.range-control button.active, .segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 5px rgba(23,32,29,.09); }
.chart-legend { display: flex; gap: 16px; padding: 0 22px; color: var(--muted); font-size: 10px; }
.line-key, .bar-key { display: inline-block; width: 13px; height: 3px; margin-right: 5px; vertical-align: middle; background: var(--green); }
.bar-key { height: 7px; background: #9eaaa5; }
.chart { height: 270px; padding: 12px 18px 18px; }
.chart.empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: #e6e9e6; stroke-width: 1; }
.chart .area { fill: url(#areaGradient); }
.chart .equity-line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .bar-pos { fill: #9ab8aa; }
.chart .bar-neg { fill: #d7aaa5; }
.chart text { fill: var(--muted); font-size: 10px; }
.account-rows { padding: 0 22px 4px; }
.account-rows > div { display: flex; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.account-rows > div:last-child { border-bottom: 0; }
.account-rows span { color: var(--muted); font-size: 11px; }
.account-rows strong { font-size: 13px; }
.account-note { margin: 5px 22px 20px; padding: 11px 12px; border-radius: 8px; color: var(--muted); background: var(--soft); font-size: 10px; line-height: 1.55; }
.table-panel { margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th { padding: 11px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-align: left; white-space: nowrap; }
td { padding: 14px 18px; border-bottom: 1px solid #edf0ed; font-size: 12px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfa; }
.sub { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 6px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 700; }
.badge.warn { color: var(--amber); background: var(--amber-soft); }
.badge.bad { color: var(--red); background: var(--red-soft); }
select { padding: 9px 30px 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 11px; }
.signal-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.signal-filters input { min-width: 210px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 11px; outline: 0; }
.signal-filters input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.signal-funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.signal-funnel article { min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.signal-funnel span, .signal-funnel small { display: block; color: var(--muted); font-size: 10px; }
.signal-funnel strong { display: block; margin: 8px 0 5px; font-size: 24px; font-variant-numeric: tabular-nums; }
.signal-table { min-width: 1180px; }
.reason-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.signal-explanation { margin: 10px 0 24px; padding: 13px 15px; border-radius: 9px; color: var(--ink); background: var(--soft); font-size: 12px; line-height: 1.6; }
.order-link { padding: 0; border: 0; color: var(--green); background: transparent; font-weight: 700; text-align: left; }
.signal-group-note { color: var(--ink); }
.signal-group-toggle { display: block; margin-top: 5px; font-size: 9px; cursor: pointer; }
.signal-group-child { background: #fafbfa; }
.signal-group-child td:first-child { padding-left: 30px; }
.drawer { position: fixed; z-index: 50; right: 0; top: 0; bottom: 0; width: min(600px, 94vw); padding: 34px; overflow-y: auto; border-left: 1px solid var(--line); background: #fff; box-shadow: -18px 0 55px rgba(23,32,29,.14); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease; }
.drawer.open { opacity: 1; visibility: visible; pointer-events: auto; }
.drawer-shade { display: none; position: fixed; z-index: 45; inset: 0; background: rgba(23,32,29,.28); }
.drawer-shade.open { display: block; }
.drawer-close { float: right; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: #fff; font-size: 21px; }
.detail-title { margin: 25px 0 6px; font-size: 27px; line-height: 1.25; letter-spacing: -.025em; }
.detail-meta { color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 22px 0; }
.detail-grid div { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.detail-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.detail-grid strong { font-size: 12px; }
.timeline { margin: 22px 0 0 6px; padding-left: 20px; border-left: 1px solid var(--line); }
.timeline article { position: relative; margin-bottom: 20px; }
.timeline article::before { content: ""; position: absolute; left: -25px; top: 4px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.timeline h4 { margin: 0 0 4px; font-size: 12px; }
.timeline p { color: var(--muted); font-size: 10px; }
.quote-audit-detail { display: block; margin-top: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); }
.quote-audit-detail > strong, .quote-audit-detail > span { display: block; }
.quote-audit-detail > strong { margin-bottom: 3px; font-size: 11px; }
.quote-audit-detail > span { color: var(--muted); line-height: 1.55; }
.quote-audit-detail ul { margin: 7px 0 0; padding: 0; list-style: none; }
.quote-audit-detail li { display: grid; grid-template-columns: 64px 1fr; gap: 7px; padding: 3px 0; border-top: 1px dashed var(--line); }
.quote-audit-detail li strong { font-size: 10px; }
.quote-audit-detail li span { color: var(--muted); }
.quote-audit-detail em { display: block; margin-top: 6px; color: var(--red); font-style: normal; }
.health-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.health-card { padding: 22px; }
.health-card span { color: var(--muted); font-size: 11px; }
.health-card strong { display: block; margin: 13px 0 6px; font-size: 20px; }
.health-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.rules { margin: 0; padding: 0 28px 24px 43px; color: var(--muted); font-size: 12px; }
.rules li { padding: 6px 0; }
.rules code { color: var(--green); }

.reconciliation-head { margin-bottom: 18px; }
.reconciliation-status {
  display: grid;
  grid-template-columns: minmax(230px, .7fr) minmax(300px, 1.5fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 14px;
  padding: 19px 22px;
  border: 1px solid #bed7ca;
  border-radius: 14px;
  background: var(--green-soft);
}
.reconciliation-status.pending { border-color: #ead7b3; background: var(--amber-soft); }
.reconciliation-status.bad { border-color: #e5c4c0; background: var(--red-soft); }
.reconciliation-status span { display: block; color: var(--muted); font-size: 10px; }
.reconciliation-status strong { display: block; margin-top: 4px; font-size: 18px; }
.reconciliation-status p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.reconciliation-status .difference-pill {
  padding: 7px 10px;
  border: 1px solid rgba(22,115,84,.18);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255,255,255,.58);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.source-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.source-panel { min-width: 0; }
.official-source { border-top: 3px solid #1d6383; }
.system-source { border-top: 3px solid var(--green); }
.source-metrics { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.source-metrics > div { min-width: 0; padding: 17px 21px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.source-metrics > div:nth-child(even) { border-right: 0; }
.source-metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
.source-metrics span, .source-metrics small { display: block; color: var(--muted); font-size: 10px; }
.source-metrics strong { display: block; margin: 8px 0 4px; overflow: hidden; font-size: 23px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.source-note { margin: 0; padding: 13px 21px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.55; }
.equation-panel, .credit-panel { margin-bottom: 14px; }
.position-panel { border-top: 3px solid #1d6383; }
.position-panel .panel-head { padding-top: 17px; }
.recon-equation { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 22px 22px; }
.capital-equation { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr; }
.recon-equation > div { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.recon-equation > b { color: var(--muted); font-size: 15px; }
.recon-equation span { display: block; color: var(--muted); font-size: 9px; }
.recon-equation strong { display: block; margin-top: 6px; font-size: 18px; font-variant-numeric: tabular-nums; }
.recon-equation .equation-result { border-color: #bed7ca; background: var(--green-soft); }
.credit-timeline { display: flex; gap: 7px; min-height: 98px; padding: 4px 22px 19px; overflow-x: auto; }
.credit-timeline.empty { align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.credit-point { min-width: 112px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); }
.credit-point span, .credit-point small { display: block; color: var(--muted); font-size: 8px; }
.credit-point strong { display: block; margin: 6px 0 5px; font-size: 16px; font-variant-numeric: tabular-nums; }
.credit-point .credit-delta { color: var(--muted); font-size: 9px; font-weight: 700; }
.reconciliation-table { min-width: 1260px; }
.reconciliation-table td:last-child { min-width: 120px; }

.login-page { display: grid; place-items: center; padding: 24px; background: var(--paper); }
.login-shell { width: min(780px, 100%); min-height: 460px; display: grid; grid-template-columns: .9fr 1.1fr; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 22px 60px rgba(23,32,29,.10); }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; padding: 42px; border-right: 1px solid var(--line); background: var(--soft); }
.login-intro .brand-mark { margin-bottom: 80px; }
.login-intro h1 { font-size: 33px; }
.login-intro p:last-child { color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 44px; }
.login-card h2 { margin-bottom: 24px; font-size: 24px; }
.login-card label { display: block; margin-bottom: 15px; color: var(--muted); font-size: 11px; }
.login-card input { display: block; width: 100%; margin-top: 6px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #fff; }
.login-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.login-card button { width: 100%; margin: 4px 0 16px; padding: 12px; border: 0; border-radius: 8px; color: #fff; background: var(--green); font-weight: 700; }
.login-card small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.login-error { color: var(--red); font-size: 11px; }
.login-error:empty { display: none; }

/* ---- v2 作战总览 / 纸面流水 ---- */
.battle-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 26px 28px;
  border-radius: 16px;
  color: #f2f7f4;
  background:
    radial-gradient(1100px 320px at 8% -40%, rgba(53,142,104,.55), transparent 62%),
    radial-gradient(700px 260px at 96% 130%, rgba(138,106,31,.38), transparent 60%),
    var(--pitch);
}
.battle-hero .section-label { color: #a9d8c0; }
.battle-hero h1 { margin-bottom: 8px; color: #fff; }
.battle-hero .muted { max-width: 640px; color: #c3d6cc; }
.battle-hero-status { display: flex; flex-direction: column; align-items: end; gap: 7px; text-align: right; }
.battle-hero-status small { color: #a9bfb4; font-size: 11px; white-space: nowrap; }
.mode-pill {
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: #e9f4ee;
  background: rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.mode-pill.paper-mode { border-color: rgba(240,214,138,.5); color: #f4e3ac; background: rgba(138,106,31,.24); }
.mode-pill.live-mode { border-color: rgba(126,224,178,.55); color: #b8f0d4; background: rgba(22,115,84,.35); }
.mode-pill.maint-mode { border-color: rgba(240,214,138,.6); color: #f4e3ac; background: rgba(138,106,31,.35); }
.mode-pill.down-mode { border-color: rgba(238,133,120,.65); color: #ffd2cb; background: rgba(150,40,30,.45); animation: downPulse 1.6s ease-in-out infinite; }
@keyframes downPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,70,55,.45); } 50% { box-shadow: 0 0 0 7px rgba(220,70,55,0); } }
.health-banner { margin: 0 0 14px; padding: 12px 16px; border-radius: 10px; font-size: 13px; font-weight: 700; line-height: 1.6; }
.health-banner.hidden { display: none; }
.health-banner.warn { border: 1px solid rgba(240,214,138,.55); color: #f4e3ac; background: rgba(138,106,31,.22); }
.health-banner.bad { border: 1px solid rgba(238,133,120,.7); color: #ffd2cb; background: rgba(150,40,30,.4); }
.luopan-week-meta {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 0 0 14px;
}
.luopan-week-meta > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.luopan-week-meta span { display: block; color: var(--muted); font-size: 11px; }
.luopan-week-meta strong { display: block; margin-top: 4px; font-size: 15px; }
.strategy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.luopan-grid { grid-template-columns: repeat(3, 1fr); }
.strategy-split-label { margin: 4px 0 8px; }
.strategy-card {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.strategy-card.total-card { border-top: 3px solid var(--gold); }
.strategy-head { display: flex; align-items: center; gap: 9px; }
.strategy-head h2 { font-size: 14px; }
.strategy-tag {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: var(--muted);
}
.strategy-tag.c1 { background: #167354; }
.strategy-tag.c2 { background: #2b5f8f; }
.strategy-tag.c3 { background: #7a4a9e; }
.strategy-tag.total-tag { background: var(--gold); }
.strategy-main { display: flex; align-items: baseline; gap: 8px; }
.strategy-main .amount { margin: 14px 0 6px; }
.strategy-main span { color: var(--muted); font-size: 10px; }
.strategy-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.strategy-split span { display: block; color: var(--muted); font-size: 10px; }
.strategy-split strong { display: block; margin: 3px 0 2px; font-size: 15px; font-variant-numeric: tabular-nums; }
.strategy-split small { color: var(--muted); font-size: 9px; }
.strategy-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 9px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 10px; }
.outcome-pill {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--soft);
}
.outcome-pill.positive { border-color: #bcd9cc; color: var(--green); background: var(--green-soft); }
.outcome-pill.negative { border-color: #e4c4c0; color: var(--red); background: var(--red-soft); }
.chart .strategy-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .strategy-line.total-line { stroke-width: 2.5; stroke-dasharray: 2 5; }
.legend-note { margin-left: auto; color: var(--muted); }
#paperChartLegend { flex-wrap: wrap; row-gap: 4px; }

@media (max-width: 1050px) {
  nav { gap: 14px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid.capital-summary { grid-template-columns: repeat(2, 1fr); }
  .analysis-grid { grid-template-columns: 1fr; }
  .strategy-grid { grid-template-columns: repeat(2, 1fr); }
  .luopan-grid { grid-template-columns: 1fr; }
  .luopan-week-meta { grid-template-columns: repeat(2, 1fr); }
  .account-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
  .signal-funnel { grid-template-columns: repeat(2, 1fr); }
  .source-columns { grid-template-columns: 1fr; }
  .recon-equation { grid-template-columns: repeat(4, 1fr); }
  .recon-equation > b { display: none; }
}
@media (max-width: 760px) {
  .topbar { min-height: 62px; grid-template-columns: 1fr auto; padding: 0 15px; backdrop-filter: none; }
  .brand small { display: none; }
  .topbar nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 58px; justify-content: space-around; border-top: 1px solid var(--line); background: #fff; }
  .nav-link { flex: 1 1 0; min-width: 0; padding: 0 1px; border-bottom: 0; border-top: 2px solid transparent; font-size: 10px; white-space: nowrap; }
  .nav-link.active { border-top-color: var(--green); }
  .refresh-status { position: fixed; right: 14px; bottom: 68px; z-index: 42; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
  .icon-button { display: none; }
  main { width: calc(100% - 24px); padding: 25px 0 82px; }
  .page-head { align-items: start; flex-direction: column; margin-bottom: 18px; }
  .date-context { text-align: left; }
  .summary-grid { gap: 9px; }
  .summary-card { min-height: 120px; padding: 16px; }
  .amount { font-size: 25px; }
  .today-grid { grid-template-columns: 1fr 1fr; }
  .today-grid > div { border-bottom: 1px solid var(--line); }
  .today-grid > div:nth-child(2) { border-right: 0; }
  .today-grid > div:nth-child(3), .today-grid > div:nth-child(4) { border-bottom: 0; }
  .account-rows { display: block; }
  .health-grid { grid-template-columns: 1fr; }
  .reconciliation-status { grid-template-columns: 1fr; gap: 11px; }
  .source-metrics { grid-template-columns: 1fr; }
  .source-metrics > div { border-right: 0; }
  .source-metrics > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .source-metrics > div:last-child { border-bottom: 0; }
  .recon-equation { grid-template-columns: 1fr; }
  .recon-equation > b { display: none; }
  .signal-filters { width: 100%; justify-content: flex-start; }
  .signal-filters input { min-width: 0; flex: 1 1 100%; }
  .panel-head { padding: 18px 16px 13px; }
  .chart { height: 235px; padding-left: 10px; padding-right: 10px; }
  .drawer { padding: 25px 20px; }
  .login-page { padding: 14px; }
  .login-shell { min-height: 0; grid-template-columns: 1fr; }
  .login-intro { padding: 25px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-intro .brand-mark { margin-bottom: 36px; }
  .login-intro h1 { font-size: 27px; }
  .login-card { padding: 30px 25px; }
}
@media (max-width: 470px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid.capital-summary { grid-template-columns: 1fr; }
  .summary-card { min-height: 108px; }
  .today-grid > div { padding: 15px 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .top-actions .ghost { padding: 7px 9px; }
  .signal-funnel { grid-template-columns: 1fr 1fr; gap: 8px; }
  .signal-funnel article { padding: 14px; }
  .strategy-grid { grid-template-columns: 1fr; }
  .battle-hero { flex-direction: column; align-items: start; padding: 20px; }
  .battle-hero-status { align-items: start; text-align: left; }
}
