:root {
  --ink: #17242b;
  --muted: #63727a;
  --line: #c9d3d8;
  --paper: #f4f7f7;
  --white: #ffffff;
  --teal: #216f63;
  --teal-soft: #e5f1ee;
  --blue: #3c6f9f;
  --blue-soft: #e7eff7;
  --red: #b34e42;
  --red-soft: #f8e8e5;
  --gold: #a06a18;
  --gold-soft: #f8eedb;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif; letter-spacing: 0; }
button, input { font: inherit; }

.topbar {
  min-height: 76px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 12px 28px; background: var(--white); border-bottom: 1px solid var(--line);
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 21px; line-height: 1.25; }
h2 { margin-bottom: 8px; font-size: 24px; line-height: 1.3; }
h3 { margin-bottom: 10px; font-size: 17px; line-height: 1.35; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.release-state { display: flex; align-items: center; gap: 8px; color: var(--teal); font-size: 12px; font-weight: 700; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }

.tabs { display: flex; gap: 0; padding: 0 28px; background: var(--white); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { min-width: 96px; padding: 12px 16px 10px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.tab:hover, .tab:focus-visible { color: var(--ink); background: var(--paper); outline: none; }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 750; }
.tab-link { min-width: 96px; padding: 12px 16px 10px; border-bottom: 3px solid transparent; color: var(--muted); text-align: center; text-decoration: none; white-space: nowrap; }
.tab-link:hover, .tab-link:focus-visible { color: var(--ink); background: var(--paper); outline: none; }

main { min-height: calc(100vh - 155px); }
.view { display: none; }
.view.active { display: block; }
.summary-band { display: grid; grid-template-columns: 1fr 190px; gap: 40px; padding: 32px 28px; background: var(--white); border-bottom: 1px solid var(--line); }
.summary-band p { max-width: 760px; margin-bottom: 0; color: #415159; line-height: 1.75; }
.release-facts { display: grid; align-content: center; border-left: 3px solid var(--teal); padding-left: 20px; }
.release-facts span, .release-facts small { color: var(--muted); font-size: 11px; }
.release-facts strong { margin: 4px 0; font-size: 28px; line-height: 1.1; color: var(--teal); }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: var(--white); }
.metric-item { min-height: 86px; padding: 17px 28px; border-right: 1px solid var(--line); }
.metric-item:last-child { border-right: 0; }
.metric-item span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.metric-item strong { font-size: 20px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .85fr); }
.panel { background: var(--white); padding: 24px 28px; border-bottom: 1px solid var(--line); }
.result-panel { border-right: 1px solid var(--line); }
.panel-head, .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.state { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border: 1px solid; border-radius: 4px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.state-pass { color: var(--teal); border-color: #87b8ac; background: var(--teal-soft); }
.state-negative { color: var(--red); border-color: #d8a29b; background: var(--red-soft); }
.comparison { margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(120px, 1fr) 56px; gap: 12px; align-items: center; margin: 12px 0; font-size: 12px; }
.track { height: 11px; background: #e7ecee; }
.fill { height: 100%; background: var(--blue); }
.bar-row.project .fill { background: var(--teal); }
.boundary { margin: 20px 0 0; padding: 12px 0 12px 14px; border-left: 3px solid var(--gold); color: #655026; font-size: 12px; line-height: 1.65; }
.protocol-panel img { display: block; width: 100%; max-height: 330px; object-fit: contain; background: #fbfcfc; }
.rolling-band { padding: 22px 28px; background: var(--white); border-bottom: 1px solid var(--line); }
.rolling-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 14px; background: var(--line); border: 1px solid var(--line); }
.rolling-item { min-width: 0; padding: 16px; background: var(--white); }
.rolling-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
.rolling-item > div { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rolling-item > div span { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.rolling-item dl { grid-template-columns: 150px minmax(0, 1fr); margin: 0; }
.rolling-item dd { text-align: right; }
.rolling-item small { display: block; color: var(--muted); font-size: 10px; }
.empty-state { color: var(--muted); }

.section-head { min-height: 82px; padding: 18px 28px; background: var(--white); border-bottom: 1px solid var(--line); }
.section-head h2 { margin-bottom: 0; }
.compact-stat { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 11px; }
.compact-stat strong { color: var(--ink); font-size: 27px; }
.lineage-switch { display: flex; gap: 0; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--white); overflow-x: auto; }
.lineage-tab { padding: 10px 14px 8px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.lineage-tab:hover, .lineage-tab:focus-visible { color: var(--ink); background: var(--paper); outline: none; }
.lineage-tab.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 750; }
.lineage-frame { display: block; width: 100%; height: calc(100vh - 279px); min-height: 680px; border: 0; background: var(--white); }

.run-table, .evidence-table { background: var(--white); }
.table-head, .table-row { display: grid; align-items: center; gap: 16px; padding: 12px 28px; border-bottom: 1px solid var(--line); }
.run-table .table-head, .run-table .table-row { grid-template-columns: 120px 220px 110px 110px minmax(260px, 1fr); }
.evidence-table .table-head, .evidence-table .table-row { grid-template-columns: minmax(300px, 1fr) 150px 120px 210px; }
.table-head { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.table-row { min-height: 58px; font-size: 12px; }
.table-row code { color: #3f5662; overflow-wrap: anywhere; }
.admitted { color: var(--teal); font-weight: 750; }
.not-admitted { color: var(--red); font-weight: 750; }
.filter-row { display: grid; grid-template-columns: auto minmax(240px, 520px); align-items: center; gap: 12px; padding: 12px 28px; background: var(--white); border-bottom: 1px solid var(--line); }
.filter-row label { color: var(--muted); font-size: 11px; font-weight: 750; }
.filter-row input { height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--paper); }

.repro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.repro-grid .panel { border-right: 1px solid var(--line); }
.repro-grid .panel:last-child { border-right: 0; }
dl { display: grid; grid-template-columns: 150px 1fr; margin: 18px 0; }
dt, dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
dt { color: var(--muted); }
.command { min-height: 34px; border: 1px solid var(--teal); border-radius: 4px; padding: 6px 12px; background: var(--teal); color: white; cursor: pointer; }
.command:hover, .command:focus-visible { background: #19584f; outline: 2px solid #9bc7bd; outline-offset: 2px; }
.command:disabled { cursor: wait; opacity: .62; }
.inference-panel p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.inference-result { display: grid; gap: 7px; min-height: 96px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.inference-result strong { color: var(--teal); font-size: 14px; }
.inference-result span { color: var(--ink); }
.inference-result small { color: var(--muted); }
.terminal-panel { background: #17242b; color: #e8eeee; }
.terminal-panel h3, .terminal-panel p { color: #e8eeee; }
pre { margin: 18px 0; padding: 18px; overflow: auto; border: 1px solid #49616b; background: #101a1f; color: #b9ded5; font-size: 13px; line-height: 1.7; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 12px 28px; border-top: 1px solid var(--line); background: var(--white); color: var(--muted); font-size: 10px; }

@media (max-width: 920px) {
  .topbar { padding: 12px 16px; align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  h1 { font-size: 18px; }
  h2 { font-size: 20px; }
  .tabs { padding: 0 8px; scrollbar-width: thin; }
  .tab { flex: 0 0 auto; min-width: auto; padding-inline: 12px; font-size: 12px; white-space: nowrap; }
  .tab-link { flex: 0 0 auto; min-width: auto; padding-inline: 12px; font-size: 12px; }
  .summary-band { grid-template-columns: 1fr; gap: 18px; padding: 24px 16px; }
  .release-facts { min-height: 72px; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-item { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .metric-item:nth-child(even) { border-right: 0; }
  .overview-grid, .repro-grid { grid-template-columns: 1fr; }
  .rolling-grid { grid-template-columns: 1fr; }
  .rolling-band { padding-inline: 16px; }
  .result-panel, .repro-grid .panel { border-right: 0; }
  .panel, .section-head { padding-inline: 16px; }
  .panel-head { flex-wrap: wrap; }
  .bar-row { grid-template-columns: 108px minmax(90px, 1fr) 48px; gap: 8px; }
  .lineage-frame { min-height: 760px; height: 760px; }
  .run-table, .evidence-table { overflow-x: auto; }
  .run-table .table-head, .run-table .table-row { min-width: 900px; }
  .evidence-table .table-head, .evidence-table .table-row { min-width: 900px; }
  .filter-row { padding-inline: 16px; }
  dl { grid-template-columns: 110px 1fr; }
  footer { padding-inline: 16px; flex-wrap: wrap; }
}
