:root {
  --bg: #f3f5f0;
  --surface: #ffffff;
  --ink: #17211c;
  --muted: #66746c;
  --line: #d8e0da;
  --accent: #126f62;
  --accent-dark: #0c5148;
  --accent-soft: #e0f0eb;
  --gold: #a46b19;
  --gold-soft: #f7ead3;
  --ok: #237247;
  --ok-soft: #e7f4eb;
  --bad: #a93e31;
  --bad-soft: #f7e2dd;
  --shadow: 0 14px 38px rgba(32, 48, 39, 0.08);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 36px clamp(18px, 5vw, 56px) 56px;
}

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

h1 {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(22px, 3.2vw, 32px);
  line-height: 1.16;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 850;
}

.exam-hero {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 30px 0 6px;
}

.exam-hero.compact {
  max-width: 760px;
}

.setup-panel,
.question-card,
.result-card {
  margin-top: 28px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.count-box,
.count-summary {
  display: grid;
  gap: 9px;
  min-height: 124px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcf8;
}

.count-box span,
.count-summary span,
.count-box small,
.count-summary small,
.stat span,
.stat small {
  color: var(--muted);
  font-size: 14px;
}

.count-box select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 20px;
  font-weight: 760;
}

.count-box select:focus {
  outline: 2px solid #a8d5cb;
  outline-offset: 2px;
}

.count-summary strong {
  font-size: 40px;
  line-height: 1;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.result-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
  min-height: 128px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 32px;
  line-height: 1;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
}

.primary-button,
.ghost-button {
  min-height: 52px;
  border-radius: var(--radius);
  padding: 13px 22px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.ghost-button {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.question-shell {
  max-width: 900px;
  margin: 0 auto;
}

.exam-status {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}

.exam-status span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7e1;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.exit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.question-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 820;
}

.tag.warning {
  background: var(--gold-soft);
  color: var(--gold);
}

.sentence {
  margin-top: 18px;
  color: var(--ink);
  font-size: clamp(19px, 2.6vw, 25px);
  line-height: 1.42;
  font-weight: 680;
}

.target {
  border-bottom: 3px solid var(--gold);
  background: var(--gold-soft);
}

.choices {
  display: grid;
  gap: 11px;
  margin-top: 22px;
}

.choice-button {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.choice-button:disabled {
  cursor: default;
}

.choice-button.is-selected {
  border-color: var(--accent);
  background: #f0f8f5;
}

.choice-button.is-correct {
  border-color: #7eb894;
  background: var(--ok-soft);
}

.choice-button.is-wrong {
  border-color: #d39386;
  background: var(--bad-soft);
}

.choice-key {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 900;
}

.choice-button strong {
  display: block;
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.22;
}

.choice-button small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 15px;
}

.feedback {
  margin-top: 20px;
  padding: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.feedback strong {
  display: block;
  font-size: 17px;
}

.feedback p {
  margin-top: 8px;
  color: var(--muted);
}

.feedback.correct {
  border-color: #83bd98;
  background: var(--ok-soft);
  color: var(--ok);
}

.feedback.wrong {
  border-color: #d19488;
  background: var(--bad-soft);
  color: var(--bad);
}

.wrong-section {
  margin-top: 36px;
}

.wrong-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.wrong-card,
.empty-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcf8;
}

.wrong-card p {
  margin: 12px 0;
}

.wrong-card strong,
.wrong-card small {
  display: block;
}

.wrong-card small {
  margin-top: 8px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .exam-hero,
  .setup-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .app {
    padding: 20px 16px 40px;
  }

  .exam-hero {
    min-height: 0;
  }

  .setup-panel,
  .question-card,
  .result-card {
    padding: 18px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .exam-status {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .choice-button {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 58px;
    padding: 11px;
  }

  .choice-key {
    width: 38px;
    height: 38px;
  }
}
