:root {
  color-scheme: light;
  --ink: #17201f;
  --paper: #f5f7f4;
  --surface: #ffffff;
  --line: #cfd5cf;
  --muted: #66706c;
  --accent: #d54f2a;
  --accent-dark: #a63218;
  --correct: #25664d;
  --correct-soft: #e4f0e9;
  --warning: #a26712;
  --shadow: 0 12px 28px rgb(23 32 31 / 8%);
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif !important;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.site-header {
  color: #fff;
  background: var(--ink);
  border-bottom: 4px solid var(--accent);
}

.header-inner,
.search-inner,
.results-section,
footer {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.wordmark-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
  font-size: 25px;
  font-weight: 700;
}

.wordmark-copy {
  display: grid;
  gap: 2px;
}

.wordmark-copy strong {
  font-size: 17px;
  font-weight: 700;
}

.wordmark-copy small,
.archive-count,
.section-index,
footer {
  letter-spacing: 0;
}

.wordmark-copy small {
  color: #aeb8b4;
  font-size: 10px;
}

.archive-count {
  color: #bac3bf;
  font-size: 11px;
}

.search-band {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.search-inner {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(0, 2.3fr);
  gap: 64px;
  padding: 56px 0 48px;
}

.section-index {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.2;
}

h2 {
  font-size: 25px;
}

.search-form > label,
.type-filter legend {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  border-bottom: 2px solid var(--ink);
}

.search-control:focus-within {
  border-color: var(--accent);
}

#search-input {
  min-width: 0;
  height: 54px;
  padding: 0 14px 0 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 18px;
}

#search-input::placeholder {
  color: #9ca49f;
}

.search-button {
  height: 46px;
  margin: 4px 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

.search-button:hover {
  background: var(--accent-dark);
}

.search-button:active {
  transform: translateY(1px);
}

.search-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.type-filter {
  margin: 26px 0 0;
  padding: 0;
  border: 0;
}

.segments {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.segment {
  min-height: 40px;
  padding: 8px 12px;
  color: var(--muted);
  background: #fff;
  border: 0;
  border-right: 1px solid var(--line);
  font-size: 13px;
}

.segment:last-child {
  border-right: 0;
}

.segment:hover {
  color: var(--ink);
  background: #f1f3f0;
}

.segment.is-active {
  color: #fff;
  background: var(--ink);
}

.results-section {
  min-height: 440px;
  padding: 44px 0 72px;
}

.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

#result-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.reset-button {
  padding: 4px 0;
  color: var(--accent-dark);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  font-size: 12px;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  color: var(--muted);
}

.empty-index {
  color: #d8deda;
  font-size: 70px;
  line-height: 1;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

.loading-state {
  padding: 42px 0 4px;
}

.loading-state span {
  display: block;
  height: 112px;
  margin-bottom: 12px;
  background: #e8ece8;
  border: 1px solid #dce1dc;
  border-radius: 5px;
  animation: pulse 1.2s ease-in-out infinite alternate;
}

.loading-state span:nth-child(2) {
  animation-delay: 160ms;
}

.loading-state span:nth-child(3) {
  animation-delay: 320ms;
}

@keyframes pulse {
  to { opacity: 0.48; }
}

.results-list {
  margin: 0;
  padding: 24px 0 0;
  display: grid;
  gap: 14px;
  list-style: none;
}

.pagination {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.page-button {
  min-width: 86px;
  min-height: 38px;
  padding: 8px 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.page-button:hover:not(:disabled) {
  color: var(--accent-dark);
  border-color: var(--accent);
}

.page-button:active:not(:disabled) {
  transform: translateY(1px);
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.page-status {
  min-width: 92px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 5px;
  box-shadow: 0 0 0 rgb(0 0 0 / 0%);
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 260ms ease forwards;
  animation-delay: var(--delay, 0ms);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.question-card:hover {
  border-left-color: var(--accent);
  box-shadow: var(--shadow);
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-card article {
  padding: 24px 26px 22px;
}

.question-header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
}

.question-number {
  padding-top: 4px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
}

.question-type {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--correct);
  font-size: 11px;
  font-weight: 700;
}

.question-title {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.65;
  letter-spacing: 0;
}

.options-list {
  margin: 18px 0 0 62px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.option {
  min-height: 42px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  background: #f5f7f4;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
}

.option.is-correct {
  color: #174b37;
  background: var(--correct-soft);
  border-color: #9fc5b2;
}

.option-label {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid #cbd2cd;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
}

.is-correct .option-label {
  color: #fff;
  background: var(--correct);
  border-color: var(--correct);
}

.option-text {
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.judgement {
  min-height: 48px;
  margin: 18px 0 0 62px;
  padding: 11px 14px;
  align-items: center;
  gap: 10px;
  color: var(--correct);
  background: var(--correct-soft);
  border-left: 3px solid var(--correct);
  font-weight: 700;
}

.judgement.is-false {
  color: var(--warning);
  background: #f7eedf;
  border-left-color: var(--warning);
}

.judgement-mark {
  font-size: 20px;
}

footer {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #7c8581;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

@media (max-width: 720px) {
  .header-inner,
  .search-inner,
  .results-section,
  footer {
    width: min(100% - 28px, 1120px);
  }

  .archive-count {
    display: none;
  }

  .search-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 38px 0 34px;
  }

  h1 {
    font-size: 29px;
  }

  .results-section {
    padding-top: 34px;
  }

  .results-header {
    align-items: start;
  }

  .result-meta {
    padding-top: 25px;
  }

  .question-card article {
    padding: 20px 16px 18px;
  }

  .question-header {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

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

  .options-list {
    margin-left: 44px;
    grid-template-columns: 1fr;
  }

  .judgement {
    margin-left: 44px;
  }
}

@media (max-width: 430px) {
  .search-control {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  #search-input {
    font-size: 16px;
  }

  .segments {
    grid-template-columns: repeat(2, 1fr);
  }

  .segment:nth-child(2) {
    border-right: 0;
  }

  .segment:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .results-header {
    display: grid;
  }

  .result-meta {
    justify-content: space-between;
    padding-top: 0;
  }

  .question-number {
    font-size: 18px;
  }

  .option {
    padding: 8px 9px;
  }

  .pagination {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .page-status {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    padding-bottom: 2px;
  }

  .page-button {
    grid-row: 2;
    min-width: 0;
  }

  footer {
    align-items: start;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
