:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667084;
  --line: #dce3ed;
  --brand: #145c9e;
  --brand-dark: #0f3f70;
  --accent: #f7c948;
  --ok-bg: #fff5bf;
  --ok-line: #e6ba35;
  --shadow: 0 18px 48px rgba(21, 36, 61, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(20, 92, 158, 0.1), transparent 34%),
    linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 56px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 2px 26px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.subhead {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 12px;
  min-width: 240px;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
}

.stats strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-panel {
  position: sticky;
  top: 0;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(16px);
}

.search-box {
  display: grid;
  grid-template-columns: 34px 1fr 40px;
  align-items: center;
  min-height: 58px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f1f5f9;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.search-box:focus-within {
  border-color: var(--brand);
  background: #fff;
}

.search-icon {
  color: var(--brand);
  font-size: 26px;
  line-height: 1;
  text-align: center;
}

#searchInput {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 19px;
}

#searchInput::placeholder {
  color: #8b96a8;
}

#clearButton {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #d7dee9;
  color: #475569;
  cursor: pointer;
  font-size: 22px;
  line-height: 30px;
}

#clearButton:hover {
  background: #cbd5e1;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.filter {
  min-width: 72px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344256;
  cursor: pointer;
  padding: 8px 14px;
}

.filter:hover,
.filter.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.result-meta {
  min-height: 44px;
  padding: 14px 2px 2px;
  color: var(--muted);
}

.result-meta p {
  margin: 0;
}

.results {
  display: grid;
  gap: 14px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(21, 36, 61, 0.06);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbff;
  padding: 14px 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #e7f0fa;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
}

.score {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.card-body {
  padding: 18px;
}

.question {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.75;
}

.options {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.option {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px 12px;
  line-height: 1.65;
}

.option.correct {
  border-color: var(--ok-line);
  background: var(--ok-bg);
}

.option-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e7edf5;
  color: #233248;
  font-weight: 800;
}

.option.correct .option-label {
  background: var(--accent);
}

.answer-line,
.analysis {
  margin: 14px 0 0;
  border-left: 4px solid var(--brand);
  background: #f3f7fb;
  padding: 10px 12px;
  color: #2d3b4f;
  line-height: 1.7;
}

.analysis {
  border-left-color: #9aa8ba;
  background: #f7f8fa;
}

mark {
  border-radius: 4px;
  background: #ffe88a;
  color: inherit;
  padding: 0 2px;
}

.empty {
  border: 1px dashed #b9c5d5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 42px 22px;
  text-align: center;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 22px, 1120px);
    padding-top: 22px;
  }

  .hero {
    display: block;
    padding-bottom: 18px;
  }

  .subhead {
    font-size: 16px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    min-width: 0;
    margin-top: 18px;
  }

  .search-panel {
    padding: 10px;
  }

  #searchInput {
    font-size: 16px;
  }

  .card-head,
  .card-body {
    padding: 14px;
  }

  .question {
    font-size: 16px;
  }
}
