

:root {
  --ink: #25231f;
  --muted: #756f65;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #ded7ca;
  --navy: #173d5b;
  --red: #d84b40;
  --green: #238365;
  --gold: #c4872f;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 8%, rgba(205, 179, 126, .16), transparent 24rem),
    linear-gradient(180deg, #f8f5ee 0, var(--paper) 42rem);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
button { font: inherit; }
main { min-height: 100vh; }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1480px) / 2));
  border-bottom: 1px solid rgba(70, 62, 50, .12);
  background: rgba(250, 247, 240, .85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; background: var(--navy); color: white;
  font-family: "STKaiti", serif; font-size: 23px;
}
.brand div { display: grid; gap: 2px; }
.brand b { letter-spacing: .04em; }
.brand small, .asof { color: var(--muted); font-size: 12px; }
.asof { display: flex; gap: 10px; align-items: center; }
.asof b { color: var(--ink); }
.asof span { padding-left: 10px; border-left: 1px solid var(--line); }
.refresh-button, .logout-link {
  border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; color: var(--navy);
  padding: 7px 10px; font-size: 12px; font-weight: 750; text-decoration: none; cursor: pointer;
}
.refresh-button:disabled { opacity: .55; cursor: wait; }
.logout-link { color: var(--muted); }

.hero {
  max-width: 1480px; margin: 0 auto; padding: 54px 28px 36px;
  display: flex; justify-content: space-between; align-items: end; gap: 40px;
}
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; margin: 0 0 10px; }
h1 { margin: 0; font-size: clamp(36px, 5vw, 66px); letter-spacing: -.05em; line-height: 1; }
h1 span { display: inline-block; color: #8c8478; font-size: .27em; letter-spacing: .08em; margin-left: 12px; vertical-align: middle; }
.hero-copy { color: var(--muted); max-width: 650px; font-size: 16px; margin: 18px 0 0; line-height: 1.75; }
.quote {
  min-width: 220px; display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,253,248,.75);
}
.quote small, .quote em { grid-column: 1 / -1; color: var(--muted); font-style: normal; }
.quote strong { font-size: 38px; letter-spacing: -.04em; margin-top: 4px; }
.quote span { color: var(--muted); font-size: 12px; }
.quote em { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; font-size: 12px; }

.workspace {
  max-width: 1480px; margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px;
}
.chart-card, .insight-card, .signal-board, .t-card, .scenario-section {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 16px 50px rgba(55, 45, 30, .05);
}
.chart-card { min-width: 0; overflow: hidden; }
.toolbar { min-height: 66px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); gap: 12px; }
.period-tabs { display: flex; gap: 4px; background: #eee8dd; padding: 4px; border-radius: 11px; }
.period-tabs button, .mode-switch button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: 8px; padding: 8px 13px; font-weight: 700; font-size: 13px;
}
.period-tabs button.active, .mode-switch button.active { background: var(--ink); color: white; box-shadow: 0 3px 10px rgba(0,0,0,.14); }
.stock-select label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.stock-select select { min-width: 150px; border: 1px solid #b8c2cf; border-radius: 9px; background: #fff; color: var(--ink); padding: 8px 30px 8px 10px; font: inherit; font-weight: 750; cursor: pointer; }
.layer-controls { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.layer-controls label { cursor: pointer; }
.layer-controls input { position: absolute; opacity: 0; }
.layer-controls span { display: block; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }
.layer-controls input:checked + span { color: var(--navy); border-color: #90a8b8; background: #edf4f7; font-weight: 700; }
.date-control { margin-left: auto; }
.date-control label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.date-control input { border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); padding: 6px 8px; font: inherit; }
.coverage { min-height: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 7px 18px; background: #f7f8fa; border-bottom: 1px solid #e5e9ef; color: #687385; font-size: 11px; }
.coverage strong { color: #a35d13; font-weight: 700; }
.chart-shell { position: relative; padding: 0 12px 12px; }
.quote-strip { min-height: 36px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 7px 8px; color: #667085; font-size: 12px; font-variant-numeric: tabular-nums; border-bottom: 1px solid #edf0f4; }
.quote-strip b { color: #273142; }
.quote-strip em { color: #273142; font-style: normal; font-weight: 650; }
.quote-strip .rise { color: #db4038; font-weight: 750; }
.quote-strip .fall { color: #148263; font-weight: 750; }
.chart-canvas { width: 100%; min-height: 690px; }
.pane-label { position: absolute; left: 23px; z-index: 2; pointer-events: none; color: #778397; font-size: 10px; font-weight: 700; }
.volume-label { top: 500px; }
.macd-label { top: 607px; }
.macd-label span { color: #d97706; }
.macd-label i { color: #2563eb; font-style: normal; }
.chart-foot { min-height: 38px; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 6px 8px 0; color: var(--muted); font-size: 11px; }
.chart-foot span { display: inline-flex; align-items: center; gap: 5px; }
.chart-foot i { width: 18px; height: 2px; display: inline-block; }
.legend-stick { background: #244d70; }
.legend-segment { border-top: 3px dashed #9a5b24; }
.legend-zone { border-top: 2px dashed #d89a2b; }
.chart-stat { margin-left: auto; }
.active-zone { color: #885b17; font-weight: 700; }
.signal-summary { width: 100%; color: #7c3aed; font-weight: 750; }
.strict-conclusion { margin: 7px 8px 2px; padding: 10px 12px; display: flex; gap: 10px; align-items: baseline; border-radius: 8px; background: #f2f5f8; color: #5c6675; font-size: 12px; line-height: 1.6; }
.strict-conclusion b { color: var(--navy); white-space: nowrap; }
.endpoint-list { margin: 0 8px 4px; padding: 8px 12px; display: flex; gap: 10px; border-top: 1px dashed #d8dee7; color: #6a7280; font-size: 11px; line-height: 1.6; overflow-x: auto; }
.endpoint-list b { color: #475569; white-space: nowrap; }
.endpoint-list span { white-space: nowrap; }
.loading { height: 620px; display: grid; place-items: center; color: var(--muted); }

.insight-card { padding: 25px; display: flex; flex-direction: column; }
.status { font-weight: 800; font-size: 20px; line-height: 1.35; margin-bottom: 16px; }
.status.positive { color: var(--red); }
.status.warning { color: var(--green); }
.status.neutral { color: var(--navy); }
.structure-copy { color: #5d574f; line-height: 1.8; font-size: 14px; }
.insight-card dl { margin: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.insight-card dl div { display: grid; grid-template-columns: 52px 1fr; padding: 11px 0; }
.insight-card dl div + div { border-top: 1px solid var(--line); }
.insight-card dt { color: var(--muted); font-size: 12px; }
.insight-card dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }
.focus-box { background: #f3eee3; border-left: 3px solid var(--gold); padding: 14px 15px; margin-top: 4px; }
.focus-box b { font-size: 12px; color: #8b641e; }
.focus-box p { margin: 7px 0 0; font-size: 13px; line-height: 1.65; }
.method-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: auto; }
.level-chain { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 18px; }
.level-chain span { padding: 6px 9px; border-radius: 20px; background: #eee9df; color: var(--muted); font-size: 11px; }
.level-chain span.on { background: var(--navy); color: white; }
.level-chain i { color: #aaa196; font-style: normal; }

.signal-board, .t-card, .scenario-section { max-width: 1424px; margin: 18px auto 0; padding: 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.025em; }
.badge { padding: 8px 12px; border-radius: 20px; background: #fff2d8; color: #91601a; font-size: 12px; font-weight: 800; }
.signal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.signal-grid article { background: #f5f1e8; border: 1px solid #e5ddcf; padding: 17px; border-radius: 13px; }
.signal-grid small { color: var(--gold); font-weight: 800; }
.signal-grid b { display: block; margin: 7px 0; }
.signal-grid p { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 0; }
.analysis-board { padding: 30px; }
.trend-badge { min-width: 76px; text-align: center; padding: 9px 14px; border-radius: 22px; font-size: 13px; font-weight: 850; }
.trend-badge.上涨 { background: #fff0ed; color: var(--red); }
.trend-badge.下跌 { background: #eaf5f0; color: var(--green); }
.trend-badge.盘整, .trend-badge.结构不足 { background: #f4ecd9; color: #8a641e; }
.analysis-stack { display: grid; gap: 12px; }
.level-analysis { border: 1px solid #e0d9cc; border-radius: 15px; background: #faf8f3; overflow: hidden; }
.level-title { min-height: 48px; display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid #e8e1d6; }
.level-title span { min-width: 145px; color: var(--gold); font-size: 12px; font-weight: 850; letter-spacing: .04em; }
.level-title b { color: #303944; font-size: 14px; }
.metric-row { display: flex; flex-wrap: wrap; gap: 10px 25px; padding: 14px 17px 4px; color: var(--muted); font-size: 12px; }
.metric-row b { color: var(--navy); }
.decision-line { margin: 10px 16px; padding: 12px 14px; border-left: 3px solid var(--gold); background: #f1ede4; color: #4f4b44; font-size: 13px; line-height: 1.7; }
.analysis-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 5px 16px 16px; gap: 8px; }
.analysis-facts div { min-width: 0; padding: 10px 12px; border-radius: 9px; background: white; border: 1px solid #e8e3da; }
.analysis-facts dt, .operation-grid small, .trigger-grid small { color: var(--muted); font-size: 10px; }
.analysis-facts dd { margin: 5px 0 0; color: #333942; font-size: 12px; font-weight: 750; }
.operation-level { border-color: #c7d5df; background: #f5f8fa; }
.operation-level .level-title { background: #eaf1f5; border-color: #cfdae2; }
.operation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 16px; }
.operation-grid div, .trigger-grid div { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 9px; background: white; border: 1px solid #dce5eb; }
.operation-grid strong, .trigger-grid strong { color: #314152; font-size: 12px; line-height: 1.6; }
.invalidation { margin: 0 16px 15px; padding: 11px 13px; display: flex; gap: 12px; border-radius: 9px; background: #fff1ed; color: #6d514b; font-size: 12px; line-height: 1.6; }
.invalidation b { color: var(--red); white-space: nowrap; }
.trigger-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 16px; }
.t-checks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 14px 16px 8px; }
.t-checks span { padding: 9px 10px; border-radius: 8px; background: #eeeae2; color: #81796e; font-size: 11px; font-weight: 750; text-align: center; }
.t-checks span.yes { background: #e9f5ef; color: #187354; }
.t-action { margin: 5px 16px 8px; padding: 12px 14px; border-radius: 9px; background: #2e3742; color: white; font-size: 13px; font-weight: 700; line-height: 1.65; }
.t-risk { margin: 0 16px 15px; color: var(--muted); font-size: 11px; }
.analysis-disclaimer { margin: 14px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.pathway { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 15px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.pathway i { color: #aaa197; font-style: normal; }
.pathway .goal { color: var(--red); }

.mode-switch { background: #eee8dd; padding: 4px; border-radius: 11px; }
.t-grid { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 12px; }
.t-step { min-height: 105px; padding: 19px; border-radius: 14px; background: #f5f1e8; display: flex; flex-direction: column; gap: 10px; }
.t-step b { color: var(--navy); }
.t-step span { color: var(--muted); line-height: 1.6; font-size: 13px; }
.t-arrow { display: grid; place-items: center; color: #a89c8d; }
.risk-strip { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; padding: 13px 16px; background: #2e2b27; color: #eee6d7; border-radius: 11px; font-size: 12px; }
.risk-strip strong { color: #efc36e; }

.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.scenario-grid article { border-radius: 14px; padding: 20px; border: 1px solid var(--line); }
.scenario-grid span { font-size: 11px; font-weight: 850; letter-spacing: .12em; }
.scenario-grid h3 { margin: 9px 0; }
.scenario-grid p { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0; }
.scenario-grid .up { background: #fff1ed; }
.scenario-grid .up span { color: var(--red); }
.scenario-grid .flat { background: #f7f1e5; }
.scenario-grid .flat span { color: #9a6c23; }
.scenario-grid .down { background: #edf5f1; }
.scenario-grid .down span { color: var(--green); }

footer { max-width: 1424px; margin: 30px auto 0; padding: 22px 28px 45px; color: var(--muted); font-size: 11px; line-height: 1.7; display: flex; justify-content: space-between; gap: 30px; }
footer p { max-width: 720px; margin: 0; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .insight-card { min-height: 360px; }
  .signal-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { align-items: start; flex-direction: column; }
  .date-control { margin-left: 0; }
  .layer-controls { justify-content: start; }
  .analysis-facts, .operation-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .asof span { display: none; }
  .logout-link { display: none; }
  .hero { padding: 34px 16px 24px; align-items: start; flex-direction: column; }
  .quote { width: 100%; }
  .workspace { padding: 0 12px; }
  .chart-card { border-radius: 14px; }
  .period-tabs { width: 100%; overflow-x: auto; }
  .period-tabs button { white-space: nowrap; flex: 1; }
  .chart-canvas { min-height: 610px; }
  .quote-strip { gap: 7px 10px; }
  .pane-label { display: none; }
  .chart-stat, .active-zone { width: 100%; margin-left: 0; }
  .signal-board, .t-card, .scenario-section { margin: 12px 12px 0; padding: 20px 16px; }
  .signal-grid, .scenario-grid { grid-template-columns: 1fr; }
  .analysis-board { padding: 20px 14px; }
  .level-title { align-items: flex-start; flex-direction: column; gap: 4px; }
  .analysis-facts, .operation-grid, .trigger-grid, .t-checks { grid-template-columns: 1fr; }
  .invalidation { flex-direction: column; gap: 4px; }
  .pathway { align-items: stretch; flex-direction: column; }
  .pathway i { transform: rotate(90deg); align-self: center; }
  .t-grid { grid-template-columns: 1fr; }
  .t-arrow { transform: rotate(90deg); }
  footer { flex-direction: column; padding: 22px 18px 38px; }
}
