:root {
  color-scheme: light;
  --ink: #14211b;
  --muted: #617068;
  --line: #d5ddd8;
  --paper: #ffffff;
  --wash: #f3f6f4;
  --green: #147a50;
  --green-dark: #0d5437;
  --green-soft: #e7f3ed;
  --blue: #2864d7;
  --red: #b52d2d;
  --radius: 4px;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--wash); color: var(--ink); }
body { margin: 0; min-width: 300px; background: var(--paper); }
button, select { font: inherit; }
a { color: inherit; }

.review-banner {
  min-height: 38px;
  padding: 8px max(28px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #6d3800;
  background: #fff2d8;
  border-bottom: 1px solid #e6c98f;
  font-size: 12px;
}
.review-banner strong { letter-spacing: 0; }

.site-header {
  min-height: 72px;
  padding: 12px max(28px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--ink); border-radius: var(--radius); font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.readonly-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.readonly-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.shell, .report-shell { width: min(1180px, calc(100% - 56px)); margin: 0 auto; }
.shell > section { padding: 44px 0; border-bottom: 1px solid var(--line); }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 32px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 12px; font-weight: 750; letter-spacing: 0; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; }
h2 { font-size: 23px; line-height: 1.25; }
.lede { margin: 13px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }

.button { min-height: 42px; padding: 0 17px; border: 1px solid var(--ink); border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color 140ms, border-color 140ms, color 140ms; }
.button.primary { background: var(--ink); color: white; }
.button.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.button.secondary { background: white; color: var(--ink); }
.button.secondary:hover { border-color: var(--green); color: var(--green-dark); }
.button:focus-visible, select:focus-visible, .keypoint-list button:focus-visible, svg [role="button"]:focus-visible circle { outline: 3px solid #83b9ff; outline-offset: 2px; }
.button:disabled { border-color: #b8c1bc; background: #e7ebe8; color: #8b958f; cursor: not-allowed; }

.section-heading { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading > span, .section-heading > output { color: var(--muted); font-size: 13px; }
.replay-panel { padding-top: 34px !important; }
.state-label { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; }
.state-label[data-state="playing"] { color: var(--green-dark); border-color: #93cbb1; background: var(--green-soft); }
.state-label[data-state="degraded"] { color: var(--red); border-color: #e6b0b0; background: #fff0f0; }
.progress-track { width: 100%; height: 5px; overflow: hidden; background: #e4e9e6; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--green); transition: width 180ms linear; }
.replay-body { min-height: 310px; display: grid; grid-template-columns: 1.35fr .65fr; border: 1px solid var(--line); border-top: 0; }
.event-list { max-height: 310px; margin: 0; padding: 15px 26px; overflow: auto; list-style: none; }
.event-list li { min-height: 58px; padding: 10px 0; border-bottom: 1px solid #e8ece9; display: grid; grid-template-columns: 12px 1fr auto; gap: 13px; align-items: start; }
.event-list i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--green); }
.event-list strong, .event-list span { display: block; }
.event-list strong { font-size: 14px; }
.event-list span, .event-list time { margin-top: 3px; color: var(--muted); font-size: 12px; }
.current-event { padding: 30px; border-left: 1px solid var(--line); background: var(--wash); display: flex; flex-direction: column; }
.current-event strong { margin-top: 13px; font-size: 22px; line-height: 1.35; }
.current-event p { color: var(--muted); line-height: 1.7; }
.event-stage { color: var(--green); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.time-label { margin-top: auto; font-variant-numeric: tabular-nums; font-size: 13px; }
.replay-controls { padding-top: 16px; display: flex; align-items: center; gap: 10px; }
.replay-controls label { margin-left: auto; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
select { min-height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: white; color: var(--ink); }
.notice { padding: 12px 14px; border-left: 3px solid; }
.notice.error { color: #7b1f1f; border-color: var(--red); background: #fff3f3; }

.metric-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.metric { min-height: 135px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric span { font-size: 13px; }
.metric strong { display: block; margin: 10px 0 7px; font-size: 30px; font-variant-numeric: tabular-nums; }
.metric small { font-size: 12px; }
.metric.featured { background: var(--ink); color: white; }
.metric.featured span, .metric.featured small { color: #bed0c6; }

.split-section { display: grid; grid-template-columns: .72fr 1.28fr; gap: 54px; }
.distribution { border-top: 1px solid var(--line); }
.distribution div { min-height: 57px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.distribution span { color: var(--muted); font-size: 13px; }
.distribution strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: var(--wash); font-weight: 750; }
tbody tr:last-child td { border-bottom: 0; }

.heatmap-layout { min-height: 430px; display: grid; grid-template-columns: 1fr 360px; border: 1px solid var(--line); }
.keypoint-heatmap { width: 100%; height: 430px; background: #fbfcfb; }
.keypoint-heatmap .bones line { stroke: #889990; stroke-width: 4; stroke-linecap: round; }
.keypoint-heatmap [role="button"] { cursor: pointer; }
.keypoint-heatmap circle { stroke: white; stroke-width: 3; transition: r 120ms, stroke 120ms; }
.keypoint-heatmap text { fill: var(--ink); font-size: 11px; pointer-events: none; }
.keypoint-heatmap [role="button"]:hover circle, .keypoint-heatmap [role="button"].selected circle { r: 14px; stroke: var(--ink); }
.keypoint-list { max-height: 430px; overflow: auto; border-left: 1px solid var(--line); }
.keypoint-list button { width: 100%; min-height: 44px; padding: 0 15px; border: 0; border-bottom: 1px solid #e6ebe8; display: flex; align-items: center; justify-content: space-between; background: white; color: var(--ink); cursor: pointer; text-align: left; }
.keypoint-list button:hover, .keypoint-list button.selected { background: var(--green-soft); }
.keypoint-list strong { font-variant-numeric: tabular-nums; }
.site-footer { min-height: 92px; padding: 26px max(28px, calc((100vw - 1180px) / 2)); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); background: var(--wash); font-size: 13px; }

.report-page { background: var(--wash); }
.report-shell { margin-top: 28px; margin-bottom: 28px; padding: 40px; background: white; box-shadow: 0 2px 12px rgb(20 33 27 / 8%); }
.report-shell > .review-banner { margin: -40px -40px 32px; padding: 10px 20px; }
.report-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-bottom: 25px; border-bottom: 2px solid var(--ink); }
.report-shell > section { margin-top: 42px; }
.report-shell h2 { margin-bottom: 16px; }
.report-shell footer { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 780px) {
  body > .review-banner { padding: 8px 16px; align-items: flex-start; flex-direction: column; gap: 2px; }
  .site-header { min-height: 64px; padding: 10px 18px; }
  .readonly-badge { font-size: 0; }
  .shell, .report-shell { width: calc(100% - 32px); }
  .shell > section { padding: 32px 0; }
  .intro { display: block; }
  .intro .button { margin-top: 21px; }
  h1 { font-size: 32px; }
  h2 { font-size: 20px; }
  .replay-body { grid-template-columns: 1fr; }
  .current-event { min-height: 210px; border-top: 1px solid var(--line); border-left: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 118px; padding: 16px; }
  .metric strong { font-size: 25px; }
  .split-section { grid-template-columns: 1fr; gap: 36px; }
  .heatmap-layout { grid-template-columns: 1fr; }
  .keypoint-heatmap { height: 340px; }
  .keypoint-list { max-height: 280px; border-top: 1px solid var(--line); border-left: 0; }
  .section-heading { align-items: start; }
  .section-heading > output { max-width: 46%; text-align: right; }
  .replay-controls { flex-wrap: wrap; }
  .replay-controls label { width: 100%; margin: 4px 0 0; justify-content: space-between; }
  .report-shell { margin-top: 0; margin-bottom: 0; padding: 28px 20px; box-shadow: none; }
  .report-shell > .review-banner { margin: -28px -20px 26px; }
  .report-header { display: block; }
  .report-header .button { margin-top: 18px; }
  .site-footer { padding: 24px 18px; flex-direction: column; }
}
