:root {
  --paper: #f8f1e4;
  --card: rgba(255, 250, 240, .86);
  --ink: #20231f;
  --muted: #69645b;
  --line: rgba(47, 38, 26, .14);
  --red: #a8322d;
  --jade: #23685c;
  --gold: #b9852c;
  --blue: #29486f;
  --shadow: 0 16px 36px rgba(52, 34, 17, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 10%, rgba(184, 133, 44, .18), transparent 26rem),
    radial-gradient(circle at 92% 16%, rgba(35, 104, 92, .14), transparent 24rem),
    linear-gradient(150deg, #fbf7ef 0%, #f1e0c4 52%, #eaf0ec 100%);
}

a, button, select { font: inherit; }
a { color: inherit; }

.tool-shell {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 900;
}

.brand span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fffaf0;
  border: 1px solid rgba(168, 50, 45, .24);
  color: var(--red);
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a, .ghost-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, .72);
  text-decoration: none;
  color: var(--ink);
}

.hero {
  padding: clamp(24px, 5vw, 46px);
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(32, 35, 31, .86), rgba(32, 35, 31, .48)),
    repeating-linear-gradient(45deg, rgba(255, 250, 240, .06) 0 11px, transparent 11px 22px),
    linear-gradient(135deg, #5d241f, #1f5b51 58%, #263f61);
  color: #fffaf0;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: #d9af66;
  font-size: 14px;
  font-weight: 900;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.1;
}

.hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 250, 240, .86);
  font-size: 20px;
  line-height: 1.75;
}

.panel {
  margin-top: 16px;
  padding: clamp(18px, 4vw, 28px);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 18px;
  align-items: end;
}

.setup h2 { margin-bottom: 8px; }
.setup p, .result p, .wrong-item p { color: var(--muted); line-height: 1.75; }

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

select {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffaf0;
  padding: 0 12px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button, .primary, .ghost {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

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

.ghost {
  background: #fffaf0;
  border-color: var(--line);
  color: var(--ink);
}

.exam-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 8px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffaf0;
  margin-bottom: 18px;
}

.progress div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--jade));
  transition: width .2s ease;
}

.question-card h2 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.3;
}

#questionMeta {
  color: var(--red);
  font-weight: 900;
}

.options {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.option {
  width: 100%;
  min-height: 58px;
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffaf0;
  text-align: left;
  cursor: pointer;
}

.option.is-selected {
  border-color: rgba(168, 50, 45, .45);
  box-shadow: 0 10px 20px rgba(100, 60, 20, .1);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.score-grid div {
  padding: 16px;
  border-radius: 8px;
  background: #fffaf0;
  border: 1px solid var(--line);
}

.score-grid strong {
  display: block;
  color: var(--red);
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1;
}

.score-grid span {
  color: var(--muted);
  font-weight: 800;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
}

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

.wrong-item {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fffaf0;
}

.wrong-item h3 {
  margin-bottom: 10px;
}

.wrong-item strong {
  color: var(--jade);
}

.knowledge-box {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(35, 104, 92, .16);
  background: rgba(35, 104, 92, .07);
}

.knowledge-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.knowledge-box span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-right: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fffaf0;
  color: var(--jade);
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 780px) {
  .tool-header, .setup, .section-head {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

  .hero p:last-child {
    font-size: 17px;
  }

  .action-row > * {
    width: 100%;
  }
}
