:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #66706b;
  --green: #185b43;
  --green-soft: #e9f1ed;
  --red: #a54b3d;
  --red-soft: #f8eeeb;
  --gold: #8d6a24;
  --line: #d9dfdc;
  --paper: #ffffff;
  --wash: #f5f7f6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button, select { font: inherit; }
a { color: inherit; }

.topbar {
  min-height: 70px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.96);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 6px; font-weight: 800; }
.brand small, .brand strong { display: block; }
.brand small { color: var(--muted); font-size: 11px; }
.brand strong { font-size: 15px; }
.download-link { color: var(--green); font-weight: 700; text-underline-offset: 5px; }

.band { padding: 58px 4vw; border-bottom: 1px solid var(--line); }
.hero { padding-top: 68px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); gap: 36px; }
.hero-copy { max-width: 820px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 12px; font-weight: 800; text-transform: uppercase; }
h1 { margin: 0; max-width: 760px; font-size: clamp(38px, 5vw, 68px); line-height: 1.06; letter-spacing: 0; }
.lead { max-width: 760px; margin: 22px 0 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.definition-note { align-self: end; border-left: 4px solid var(--red); background: var(--red-soft); padding: 20px; }
.definition-note strong { color: var(--red); }
.definition-note p { margin: 8px 0 0; color: #6d514b; line-height: 1.65; }

.summary-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); margin-top: 10px; }
.summary-grid > div { padding: 24px 18px 18px 0; border-right: 1px solid var(--line); }
.summary-grid > div:not(:first-child) { padding-left: 20px; }
.summary-grid strong { display: block; font-size: 30px; }
.summary-grid span { color: var(--muted); font-size: 13px; }

.daily-band { background: var(--wash); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: 28px; }
.section-heading > p { color: var(--muted); margin: 0; }
.retention-strip { display: grid; grid-template-columns: repeat(8, minmax(120px, 1fr)); border: 1px solid var(--line); background: white; overflow-x: auto; }
.retention-cell { min-width: 120px; padding: 18px 14px; border: 0; border-right: 1px solid var(--line); background: white; text-align: left; cursor: pointer; }
.retention-cell:last-child { border-right: 0; }
.retention-cell span, .retention-cell small { display: block; color: var(--muted); }
.retention-cell strong { display: block; margin: 5px 0 2px; font-size: 22px; color: var(--green); }
.retention-cell.active { background: var(--green-soft); box-shadow: inset 0 -3px var(--green); }

.controls-heading { align-items: center; }
.outcome-control { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.outcome-control select { min-width: 168px; padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); }
.metric-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.metric-tab { flex: 0 0 auto; padding: 12px 16px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.metric-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 800; }

.table-block { margin: 0 0 40px; }
.table-title { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; margin-bottom: 14px; }
.table-title h3 { margin: 0; font-size: 21px; }
.table-title p { margin: 0; color: var(--muted); font-size: 13px; }
.trend-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-bottom: 14px; }
.trend-strip > div { padding: 14px; border-right: 1px solid var(--line); min-height: 92px; }
.trend-strip > div:last-child { border-right: 0; }
.trend-strip span, .trend-strip small { display: block; color: var(--muted); font-size: 12px; }
.trend-strip strong { display: block; margin: 5px 0 4px; line-height: 1.3; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; background: var(--wash); }
th:first-child, td:first-child { text-align: left; }
tbody tr:hover { background: #fafcfb; }
td strong { color: var(--green); }
.sample { margin-left: 6px; padding: 2px 5px; border-radius: 3px; font-size: 10px; color: var(--green); background: var(--green-soft); }
.sample.谨慎 { color: var(--gold); background: #f8f2e2; }
.sample.小样本 { color: var(--red); background: var(--red-soft); }

.method-band { background: var(--wash); }
.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.method-grid article { padding: 22px 22px 10px 0; border-right: 1px solid var(--line); }
.method-grid article:not(:first-child) { padding-left: 22px; }
.method-grid p { color: var(--muted); line-height: 1.6; font-size: 14px; }
.downloads { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
.downloads a { color: var(--green); font-weight: 700; text-underline-offset: 4px; }
footer { padding: 28px 4vw; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .definition-note { max-width: 680px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .retention-strip { grid-template-columns: repeat(8, 140px); }
  .trend-strip, .method-grid { grid-template-columns: repeat(2, 1fr); }
  .trend-strip > div:nth-child(2), .method-grid article:nth-child(2) { border-right: 0; }
  .trend-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .topbar { padding: 0 18px; }
  .download-link { font-size: 12px; }
  .band { padding: 38px 18px; }
  h1 { font-size: 40px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid strong { font-size: 24px; }
  .section-heading, .table-title { display: block; }
  .section-heading > p, .table-title p { margin-top: 10px; }
  .controls-heading .outcome-control { margin-top: 20px; justify-content: space-between; }
  .trend-strip { grid-template-columns: 1fr; }
  .trend-strip > div { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .trend-strip > div:last-child { border-bottom: 0; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article, .method-grid article:not(:first-child) { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  th, td { padding: 12px 10px; }
  td:nth-child(2) { white-space: normal; min-width: 150px; }
}
