:root {
  color-scheme: light;
  --ink: #191915;
  --muted: #6d6c65;
  --paper: #f4f1e9;
  --paper-strong: #ebe6da;
  --line: #cdc6b8;
  --accent: #ff5a36;
  --accent-soft: #ffd7cd;
  --green: #236b50;
  --white: #fffdf8;
  --shadow: 0 14px 34px rgba(25, 25, 21, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
  background: var(--paper-strong);
  padding: 0.12em 0.34em;
}

.hero {
  min-height: 620px;
  padding: 38px clamp(20px, 5vw, 76px) 46px;
  color: var(--white);
  background:
    linear-gradient(125deg, rgba(255, 90, 54, 0.19), transparent 32%),
    var(--ink);
  border-bottom: 7px solid var(--accent);
}

.hero__eyebrow,
.section-kicker {
  margin: 0 0 22px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
}

.hero__eyebrow { color: var(--accent); }

.hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: start;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(68px, 11vw, 154px);
  line-height: 0.83;
  letter-spacing: -0.075em;
  font-weight: 800;
}

.hero__intro {
  max-width: 680px;
  margin: 34px 0 0;
  color: #bbb9b0;
  font-size: clamp(16px, 1.8vw, 22px);
}

.hero__intro code { color: var(--white); background: #33332e; }

.hero__stamp {
  display: grid;
  gap: 4px;
  justify-items: end;
  padding-top: 10px;
  color: #aaa89f;
  text-align: right;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.hero__stamp span { color: var(--accent); }
.hero__stamp strong { color: var(--white); font-size: 14px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 52px;
  border-top: 1px solid #484840;
  border-left: 1px solid #484840;
}

.stat {
  min-height: 130px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #484840;
  border-bottom: 1px solid #484840;
}

.stat span, .stat small { color: #9e9b92; }
.stat strong { font-size: clamp(28px, 4vw, 54px); line-height: 1; letter-spacing: -0.04em; }

main { padding: 64px clamp(20px, 5vw, 76px) 88px; }

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 calc(clamp(20px, 5vw, 76px) * -1) 44px;
  padding: 24px clamp(20px, 5vw, 76px);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

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

.section-kicker { margin-bottom: 5px; color: var(--accent); }
h2 { margin: 0; font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.045em; line-height: 1; }
.result-status { margin: 0; color: var(--muted); text-align: right; }

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr) auto;
  gap: 10px;
  align-items: end;
}

.controls label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }

input, select, button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
}

input:focus, select:focus, button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

button { cursor: pointer; background: var(--ink); color: var(--white); border-color: var(--ink); font-weight: 700; }
button:hover { background: var(--accent); border-color: var(--accent); }

.hierarchy { display: grid; gap: 64px; }

.level-one-group[hidden],
.level-two-group[hidden],
.path-item[hidden] { display: none; }

.level-one-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--ink);
}

.level-one-index {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.level-one-header h3 { margin: 0; font-size: clamp(34px, 5vw, 66px); line-height: 1; letter-spacing: -0.05em; }
.level-one-meta { color: var(--muted); font-size: 13px; }

.level-two-group { margin-top: 32px; }
.level-two-header { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; margin-bottom: 10px; }
.level-two-header h4 { margin: 0; font-size: 22px; letter-spacing: -0.025em; }
.level-two-meta { color: var(--muted); font-size: 12px; }

.path-list { border-top: 1px solid var(--line); }
.path-item { border-bottom: 1px solid var(--line); }

.path-item summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 26px minmax(180px, 1fr) minmax(110px, auto) minmax(110px, auto) 20px;
  gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 12px 4px;
}

.path-item summary::-webkit-details-marker { display: none; }
.path-rank { color: var(--muted); font: 12px "SFMono-Regular", Consolas, monospace; }
.path-name { font-size: 18px; font-weight: 750; }
.path-metric { display: grid; gap: 2px; justify-items: end; }
.path-metric span { color: var(--muted); font-size: 11px; }
.path-metric strong { font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; }
.path-arrow { width: 10px; height: 10px; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); transition: transform 160ms ease; }
.path-item[open] .path-arrow { transform: rotate(225deg); }

.cases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 2px 0 22px 42px;
}

.case {
  min-width: 0;
  padding: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--accent);
}

.case__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.case__number { color: var(--accent); font: 12px "SFMono-Regular", Consolas, monospace; }
.case__platform { padding: 3px 7px; background: var(--paper-strong); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.case h5 { margin: 0 0 9px; font-size: 15px; line-height: 1.35; }
.case__value { margin: 0; color: var(--green); font: 13px/1.55 "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.case__value a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.case__meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin: 16px 0 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font: 11px "SFMono-Regular", Consolas, monospace; }

.empty-state { padding: 100px 20px; text-align: center; border-top: 1px solid var(--line); }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { font-size: 30px; }
.empty-state span { margin-top: 6px; color: var(--muted); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(20px, 5vw, 76px);
  background: var(--ink);
  color: #9e9b92;
  font-size: 12px;
}

@media (max-width: 980px) {
  .hero__layout { grid-template-columns: 1fr; }
  .hero__stamp { justify-items: start; text-align: left; }
  .controls { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .cases { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero { min-height: auto; padding-top: 26px; }
  h1 { font-size: clamp(58px, 21vw, 88px); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { min-height: 110px; }
  .toolbar { position: static; }
  .toolbar__heading { align-items: flex-start; flex-direction: column; }
  .result-status { text-align: left; }
  .controls { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .level-one-header { grid-template-columns: auto 1fr; }
  .level-one-meta { grid-column: 2; }
  .level-two-header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .path-item summary { grid-template-columns: 22px minmax(0, 1fr) 18px; gap: 10px; }
  .path-metric { display: none; }
  .cases { padding-left: 0; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .path-arrow { transition: none; }
}
