:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #1d2328;
  --muted: #626c72;
  --brand: #7c3aed;
  --brand-dark: #5b21b6;
  --green: #15803d;
  --red: #b91c1c;
  --line: #dfe3e8;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font-family: inherit;
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.header-inner,
.setup-inner,
.content,
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
}

.brand-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand {
  color: var(--brand);
  font-weight: 700;
}

.brand-slash {
  color: var(--line);
}

.brand-block h1 {
  margin: 0;
  font-size: 22px;
}

.header-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.setup {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
}

.setup-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
}

.field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
  font-size: 14px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-ghost-dark {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.notice {
  max-width: 860px;
  margin: 12px auto 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #fdf3e0;
  color: #92400e;
  font-size: 13px;
}

.content {
  padding: 26px 20px 60px;
}

.quiz-panel,
.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.quiz-index {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.quiz-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: #f0ecfb;
  color: var(--brand-dark);
  font-size: 12px;
}

.score-box {
  text-align: right;
  flex: 0 0 auto;
}

.score-box span {
  display: block;
  font-size: 20px;
  font-weight: 700;
}

.score-sub {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: #e8eaee;
  margin: 16px 0 22px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--brand);
  transition: width 0.25s ease;
}

.question-stem {
  margin: 0 0 18px;
  font-size: 20px;
  line-height: 1.55;
}

.options {
  display: grid;
  gap: 10px;
}

.option-btn {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--brand);
  background: #faf8ff;
}

.option-btn.correct {
  border-color: var(--green);
  background: #eef7f0;
  color: var(--green);
  font-weight: 700;
}

.option-btn.wrong {
  border-color: var(--red);
  background: #fdeeee;
  color: var(--red);
}

.option-btn:disabled {
  cursor: default;
}

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #f4f6f8;
  border-left: 4px solid var(--brand);
  color: #37424a;
  font-size: 14px;
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.result-score {
  text-align: center;
  padding: 18px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

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

.result-num {
  margin: 4px 0;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.1;
}

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

.review-list {
  display: grid;
  gap: 12px;
}

.review-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
}

.review-item.correct {
  border-left: 4px solid var(--green);
}

.review-item.wrong {
  border-left: 4px solid var(--red);
}

.review-q {
  margin: 0 0 6px;
  font-weight: 700;
}

.review-line {
  margin: 2px 0;
  color: var(--muted);
}

.review-line strong {
  color: var(--ink);
}

.review-explain {
  margin: 8px 0 0;
  color: #37424a;
}

.result-actions {
  margin-top: 22px;
  text-align: center;
}

.intro {
  margin-top: 22px;
}

.intro-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.intro-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.intro-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 24px 20px;
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer p {
  margin: 0;
}

@media (max-width: 720px) {
  .setup-inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .setup-inner .btn {
    grid-column: 1 / -1;
  }

  .quiz-panel,
  .result-panel {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .setup-inner {
    grid-template-columns: 1fr;
  }
}
