:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --fg: #111827;
  --muted: #5b6472;
  --border: #dfe3ea;
  --accent: #2563eb;
  --accent2: #7c3aed;
  --ok: #047857;
  --bad: #b91c1c;
  --code: #0f172a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(1280px, calc(100% - 40px)); margin: 0 auto; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 8px 14px; background: #fff; border: 1px solid var(--accent);
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.nav { min-height: 64px; display: flex; align-items: center; gap: 18px; }
.brand { color: var(--fg); font-weight: 800; font-size: 19px; }
.brand span { color: var(--accent); }
.grow { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav-links a { color: var(--fg); font-size: 13.5px; }
.nav-links a.active { color: var(--accent); font-weight: 700; }

.hero { padding: 58px 0 32px; text-align: center; }
.eyebrow {
  color: var(--accent); font-size: 11px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
}
.hero h1 { margin: 10px 0 14px; font-size: clamp(34px, 5.5vw, 54px); line-height: 1.08; }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { max-width: 820px; margin: 0 auto; color: var(--muted); font-size: 18px; }
.badges { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.badge {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); font-size: 12.5px; background: #fff;
}
.badge.hl { color: var(--accent); border-color: var(--accent); }
.badge.ok { color: var(--ok); border-color: #a7f3d0; background: #ecfdf5; }

.lab-shell {
  display: grid; grid-template-columns: minmax(330px, 410px) minmax(0, 1fr);
  gap: 18px; align-items: start; padding-bottom: 42px;
}
.controls { display: grid; gap: 14px; position: sticky; top: 80px; }
.panel, .results {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 1px 3px rgba(16,24,40,.05);
}
.panel { padding: 18px; }
.panel h2, .results h2 { margin: 0 0 5px; font-size: 18px; }
.panel p, .results-head p { margin: 0 0 13px; color: var(--muted); font-size: 13px; }
.panel.compact p { min-height: 44px; }
label { display: block; margin: 11px 0 5px; font-size: 12px; color: var(--muted); font-weight: 650; }
select, textarea, button {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--fg); font: inherit;
}
select { padding: 8px 10px; }
textarea {
  min-height: 300px; resize: vertical; padding: 12px;
  font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
}
button {
  margin-top: 10px; padding: 9px 12px; cursor: pointer;
  font-weight: 650;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover:not(:disabled) { background: #1d4ed8; }

.results { min-height: 640px; overflow: hidden; }
.results-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.results-head h2 { margin-top: 3px; }
#summary {
  display: flex; align-items: center; gap: 8px; min-height: 26px;
  font-size: 13px; color: var(--muted);
}
#result { padding: 16px 18px 20px; }
.empty {
  min-height: 430px; display: grid; place-content: center; text-align: center;
  gap: 8px; color: var(--muted); padding: 40px;
}
.empty strong { color: var(--fg); font-size: 20px; }
.empty code { background: #f3f4f6; border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .03em;
}
.pill.ok { color: var(--ok); background: #ecfdf5; border: 1px solid #a7f3d0; }
.pill.bad { color: var(--bad); background: #fef2f2; border: 1px solid #fecaca; }

.evidence-table {
  width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px;
}
.evidence-table th, .evidence-table td {
  border-bottom: 1px solid var(--border); padding: 8px 7px;
  text-align: left; vertical-align: top; overflow: hidden; text-overflow: ellipsis;
}
.evidence-table th { background: #f8fafc; color: var(--muted); }
.evidence-table th:nth-child(1) { width: 12%; }
.evidence-table th:nth-child(2) { width: 10%; }
.evidence-table th:nth-child(3),
.evidence-table th:nth-child(4) { width: 33%; }
.evidence-table th:nth-child(5) { width: 12%; }
.evidence-list { overflow-x: auto; }
details { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
summary { cursor: pointer; color: var(--accent); font-weight: 650; }
pre {
  margin: 10px 0 0; padding: 14px; overflow: auto;
  border-radius: 10px; background: var(--code); color: #e2e8f0;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.scope {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; padding-bottom: 54px;
}
.scope-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 13px; padding: 18px;
}
.scope-card h2 { margin: 0 0 6px; font-size: 16px; }
.scope-card p { margin: 0; color: var(--muted); font-size: 13.5px; }

footer { border-top: 1px solid var(--border); background: #fff; padding: 24px 0 36px; color: var(--muted); font-size: 12.5px; }
footer .wrap { display: grid; gap: 4px; }

@media (max-width: 980px) {
  .lab-shell { grid-template-columns: 1fr; }
  .controls {
    position: static; max-height: none; overflow: visible; padding-right: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .controls .compact { grid-column: 1 / -1; }
  .scope { grid-template-columns: 1fr; }
}
@media (min-width: 981px) {
  .controls {
    max-height: calc(100vh - 96px); overflow-y: auto;
    overscroll-behavior: contain; padding-right: 4px;
  }
}
@media (max-width: 680px) {
  .wrap { width: min(100% - 24px, 1280px); }
  .nav { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .hero { padding-top: 42px; }
  .controls { grid-template-columns: 1fr; }
  textarea { min-height: 260px; }
  .results-head { align-items: flex-start; flex-direction: column; }
  .evidence-table { min-width: 760px; }
}
