:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", sans-serif;
  background: #07111f;
  color: #e8f0ff;
  --panel: #0d1a2d;
  --panel-2: #101f36;
  --line: #243753;
  --muted: #91a6c6;
  --blue: #58a6ff;
  --green: #43d19e;
  --amber: #f4ba58;
  --red: #ff7383;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: #8bc2ff; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 17px 26px;
  border-bottom: 1px solid var(--line);
  background: #091426ee;
  backdrop-filter: blur(18px);
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 21px; letter-spacing: -.02em; }
.eyebrow {
  margin: 0 0 4px;
  color: #7ea8e8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
}
.tabs { display: flex; gap: 7px; }
.tabs button, .control {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  background: #0d1a2d;
  color: #b8c9e4;
}
.tabs button.active, .tabs button:hover {
  border-color: #4879b8;
  background: #173152;
  color: white;
}
#app { min-height: calc(100vh - 72px); }
.loading, .empty { padding: 40px; color: var(--muted); }
.overview { width: min(1320px, calc(100% - 40px)); margin: 28px auto 60px; }
.hero {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 18px;
  margin-bottom: 20px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(155deg, #10213a, #0b1729);
  padding: 20px;
}
.hero h2 { max-width: 720px; font-size: clamp(25px, 4vw, 44px); line-height: 1.08; }
.muted { color: var(--muted); }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 24px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 15px;
}
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 7px; font-size: 25px; }
.section-title { margin: 28px 0 12px; font-size: 18px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: var(--panel); }
th, td { padding: 11px 13px; border-bottom: 1px solid #20324c; text-align: left; font-size: 13px; }
th { color: #9fb7da; background: #0d1a2d; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.workspace { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow: auto;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #091426;
}
.filters { display: grid; gap: 8px; margin-bottom: 12px; }
.filters input, .filters select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  background: #07111f;
  color: white;
}
.case-list { display: grid; gap: 5px; }
.case-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px;
  background: transparent;
  color: #c5d3e9;
  text-align: left;
}
.case-item:hover, .case-item.active { border-color: #31547d; background: #11243f; }
.case-item strong, .case-item span { display: block; }
.case-item strong { font-size: 12px; color: #7da9e4; margin-bottom: 4px; }
.case-item span { font-size: 12px; line-height: 1.4; }
.detail { min-width: 0; padding: 22px; }
.case-head { margin-bottom: 16px; }
.case-head h2 { margin: 5px 0 10px; font-size: 22px; }
.case-head pre, .answer {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns, 2), minmax(380px, 1fr));
  gap: 14px;
  overflow-x: auto;
  align-items: start;
  padding-bottom: 24px;
}
.candidate {
  min-width: 380px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}
.candidate.winner { border-color: #3a8b70; box-shadow: 0 0 0 1px #3a8b7055; }
.candidate > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.candidate h3 { margin: 0; font-size: 17px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.badge { border-radius: 999px; padding: 4px 7px; background: #1c3455; color: #bcd7ff; font-size: 10px; }
.badge.good { background: #143c34; color: #7ce2be; }
.badge.bad { background: #49212a; color: #ff9dab; }
.big-score { font-size: 25px; font-weight: 750; color: white; white-space: nowrap; }
.candidate-body { padding: 15px; }
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 12px 0; }
.score-box { border: 1px solid #263c5a; border-radius: 8px; padding: 8px; background: #0a1628; }
.score-box span { display: block; color: var(--muted); font-size: 10px; }
.score-box b { display: block; margin-top: 4px; font-size: 16px; }
.judge-reason { color: #c3d1e7; font-size: 13px; line-height: 1.6; }
.issues { margin: 8px 0 14px; padding-left: 20px; color: #ffb6bf; font-size: 12px; line-height: 1.55; }
details { border-top: 1px solid #21344f; padding: 11px 0 0; margin-top: 11px; }
summary { color: #9fc4f2; font-size: 13px; cursor: pointer; }
.result {
  margin-top: 9px;
  border: 1px solid #20344f;
  border-radius: 9px;
  padding: 10px;
  background: #081426;
}
.result h4 { margin: 0 0 5px; font-size: 13px; }
.result p { margin: 5px 0; color: #b6c5dc; font-size: 12px; line-height: 1.5; }
.result small { color: #7890b2; }
.timeline { display: grid; gap: 8px; margin: 10px 0; }
.step { border-left: 2px solid #31577f; padding-left: 10px; color: #b9c9df; font-size: 12px; line-height: 1.5; }
.answer { max-height: 520px; overflow: auto; padding: 12px; border-radius: 9px; background: #081426; }

@media (max-width: 920px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .case-list { max-height: 300px; overflow: auto; }
  .hero { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .candidate-grid { grid-template-columns: repeat(var(--columns, 2), 86vw); }
}
