:root {
  color-scheme: light;
  --ink: #172333;
  --muted: #667384;
  --line: #d9e0e8;
  --soft: #f4f7fa;
  --navy: #17324d;
  --front: #c43f4b;
  --back: #2673a8;
  --teal: #1f7a73;
  --amber: #b7791f;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(23, 50, 77, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}

button, table { font: inherit; }

.site-header {
  background: var(--navy);
  color: var(--white);
  border-bottom: 5px solid #cf4d57;
}

.header-inner,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 265px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.62fr);
  gap: 56px;
  align-items: center;
  padding: 42px 0 38px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: #9fb3c7;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  color: #ced9e4;
  font-size: 17px;
  line-height: 1.75;
}

.latest-draw {
  padding-left: 32px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.latest-label {
  display: block;
  margin-bottom: 5px;
  color: #d7e1eb;
  font-size: 14px;
}

#latestDate { color: #9fb3c7; font-size: 13px; }

.number-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.ball {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ball.front { background: #cf4d57; }
.ball.back { background: #2d7cb2; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--white);
  box-shadow: var(--shadow);
}

.summary-item {
  min-height: 96px;
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}

.summary-item:last-child { border-right: 0; }
.summary-item span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.summary-item strong { font-size: 20px; font-variant-numeric: tabular-nums; }

.analysis-band,
.charts-section,
.metrics-section,
.method-section { padding: 70px 0 0; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-kicker { color: #a14850; }
h2 { margin-bottom: 0; font-size: 28px; line-height: 1.25; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.segmented button {
  min-width: 64px;
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--navy); color: #fff; }

.finding-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.finding {
  min-height: 160px;
  padding: 24px;
  border-top: 3px solid var(--teal);
  background: var(--soft);
}

.finding:nth-child(2) { border-top-color: var(--amber); }
.finding:nth-child(3) { border-top-color: var(--front); }
.finding h3 { margin-bottom: 12px; font-size: 17px; }
.finding p { margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.75; }

.legend { display: flex; gap: 18px; color: var(--muted); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend b { font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.line { width: 23px; border-top: 2px solid #cf4d57; }
.chart-controls { display: flex; align-items: center; gap: 22px; }
.model-switch button { min-width: 86px; }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.chart-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 50, 77, 0.055);
}

.chart-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

.chart-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 12px;
}

.position-tag { display: flex; align-items: center; gap: 10px; }
.position-tag i { width: 9px; height: 32px; background: var(--chart-color); }
.position-tag h3 { margin-bottom: 3px; font-size: 17px; }
.position-tag span { color: var(--muted); font-size: 12px; }
.chart-stat { text-align: right; font-variant-numeric: tabular-nums; }
.chart-stat strong { display: block; font-size: 18px; }
.chart-stat span { color: var(--muted); font-size: 11px; }

.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8.2;
  min-height: 245px;
  padding: 0 12px 8px;
}

canvas { width: 100%; height: 100%; display: block; }

.chart-tooltip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  transform: translate(-50%, -115%);
  padding: 7px 9px;
  color: #fff;
  background: rgba(23, 35, 51, 0.94);
  font-size: 11px;
  line-height: 1.45;
  white-space: nowrap;
  opacity: 0;
}

.chart-tooltip.visible { opacity: 1; }

.card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: #fafbfd;
}

.card-metrics div { padding: 12px 16px; border-right: 1px solid var(--line); }
.card-metrics div:last-child { border-right: 0; }
.card-metrics span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.card-metrics strong { font-size: 13px; font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; border-top: 3px solid var(--navy); }
table { width: 100%; min-width: 1120px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 15px 14px; border-bottom: 1px solid var(--line); text-align: right; }
th { color: var(--muted); background: var(--soft); font-size: 11px; font-weight: 700; }
th:first-child, td:first-child, th:last-child, td:last-child { text-align: left; }
td { font-variant-numeric: tabular-nums; }
td:last-child { color: var(--muted); }
td.positive { color: var(--teal); font-weight: 700; }
td.negative { color: #9b4b55; }

.method-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
  margin-top: 70px;
  padding: 48px;
  background: var(--navy);
  color: #fff;
}

.method-section .section-kicker { color: #a9bfd2; }
.method-copy p { color: #ced9e4; line-height: 1.8; }
.method-copy p:last-child { margin-bottom: 0; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 34px 0 45px;
  color: var(--muted);
  font-size: 12px;
}

footer p { margin: 0; }

@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr; gap: 32px; }
  .latest-draw { padding-left: 0; padding-top: 24px; border-left: 0; border-top: 1px solid rgba(255,255,255,.22); }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .finding-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card:last-child:nth-child(odd) { grid-column: auto; }
  .method-section { grid-template-columns: 1fr; gap: 25px; padding: 34px; }
}

@media (max-width: 620px) {
  .header-inner, main, footer { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: auto; padding: 34px 0 30px; }
  h1 { font-size: 36px; }
  .lead { font-size: 15px; }
  .summary-item { padding: 18px 14px; min-height: 84px; }
  .summary-item strong { font-size: 16px; }
  .analysis-band, .charts-section, .metrics-section { padding-top: 52px; }
  .section-heading { align-items: start; flex-direction: column; }
  .chart-controls { width: 100%; align-items: flex-start; flex-direction: column; gap: 14px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; min-width: 0; padding-inline: 6px; }
  .chart-card-header { padding: 17px 16px 10px; }
  .canvas-wrap { min-height: 230px; padding-inline: 4px; }
  .card-metrics div { padding: 10px; }
  .method-section { margin-top: 52px; padding: 28px 20px; }
  footer { flex-direction: column; padding-top: 28px; }
}
