:root {
  --ink: #172033;
  --muted: #667085;
  --paper: #ffffff;
  --line: #dde5f0;
  --mint: #29d6a3;
  --sky: #2f80ed;
  --coral: #ff6b6b;
  --lemon: #ffd166;
  --violet: #7c5cff;
  --soft-mint: #e8fff8;
  --soft-sky: #eaf4ff;
  --soft-coral: #fff0ee;
  --shadow: 0 18px 45px rgba(28, 41, 68, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(135deg, rgba(41, 214, 163, 0.24) 0 18%, transparent 18% 100%),
    linear-gradient(315deg, rgba(255, 209, 102, 0.26) 0 16%, transparent 16% 100%),
    linear-gradient(180deg, #f9fcff 0%, #edf7ff 46%, #fff7f1 100%);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  overflow: hidden;
  min-height: 230px;
  padding: 32px;
  color: #101828;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.7)),
    repeating-linear-gradient(135deg, rgba(47, 128, 237, 0.12) 0 10px, transparent 10px 26px),
    linear-gradient(135deg, #d9fff2 0%, #eaf3ff 46%, #fff1ce 100%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 18px;
  width: 220px;
  height: 16px;
  background: linear-gradient(90deg, var(--coral), var(--lemon), var(--mint), var(--sky));
  border-radius: 999px;
  opacity: 0.8;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 12px;
  padding: 7px 12px;
  color: #0f766e;
  font-size: 14px;
  font-weight: 800;
  background: rgba(41, 214, 163, 0.17);
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 999px;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.04;
  font-weight: 900;
}

.subtitle {
  max-width: 720px;
  margin: 18px 0 0;
  color: #344054;
  font-size: 18px;
  line-height: 1.7;
}

.hero-badge {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 152px;
  height: 152px;
  color: #ffffff;
  background: conic-gradient(from 220deg, var(--coral), var(--lemon), var(--mint), var(--sky), var(--violet), var(--coral));
  border: 8px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  box-shadow: 0 18px 36px rgba(47, 128, 237, 0.22);
  text-align: center;
}

.badge-number {
  display: block;
  font-size: 46px;
  line-height: 1;
  font-weight: 950;
}

.badge-label {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 800;
}

.status-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(221, 229, 240, 0.88);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(28, 41, 68, 0.08);
  backdrop-filter: blur(12px);
}

.status-bar > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.status-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-bar strong {
  font-size: 18px;
}

.question-list {
  display: grid;
  gap: 16px;
}

.question-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-left: 7px solid var(--sky);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(28, 41, 68, 0.08);
}

.question-card:nth-child(4n + 2) {
  border-left-color: var(--mint);
}

.question-card:nth-child(4n + 3) {
  border-left-color: var(--coral);
}

.question-card:nth-child(4n + 4) {
  border-left-color: var(--lemon);
}

.question-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.question-number {
  color: #175cd3;
  font-size: 14px;
  font-weight: 850;
}

.score-pill {
  flex: 0 0 auto;
  padding: 5px 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  background: var(--soft-sky);
  border-radius: 999px;
}

.question-title {
  margin: 0 0 16px;
  font-size: 19px;
  line-height: 1.6;
  font-weight: 850;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #d6deeb;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.option:hover {
  border-color: #8ec5ff;
  box-shadow: 0 10px 22px rgba(47, 128, 237, 0.12);
  transform: translateY(-1px);
}

.option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.option-letter {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #175cd3;
  font-weight: 900;
  background: #eef6ff;
  border: 1px solid #c8ddff;
  border-radius: 50%;
}

.option-text {
  font-size: 16px;
  line-height: 1.55;
}

.option:has(input:checked),
.option.is-selected {
  color: #0b4a6f;
  background: linear-gradient(90deg, rgba(41, 214, 163, 0.16), rgba(47, 128, 237, 0.1));
  border-color: #29b6c8;
  box-shadow: 0 12px 26px rgba(41, 182, 200, 0.18);
}

.option:has(input:checked) .option-letter,
.option.is-selected .option-letter {
  color: #ffffff;
  background: var(--sky);
  border-color: var(--sky);
}

.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(90deg, var(--coral), var(--sky));
  box-shadow: 0 14px 26px rgba(47, 128, 237, 0.24);
}

.secondary-button {
  color: #175cd3;
  background: #ffffff;
  border: 1px solid #b8d4ff;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.hidden {
  display: none;
}

.result-view {
  min-height: calc(100vh - 76px);
}

.result-card {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.result-card.pass {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 76px);
  text-align: center;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.72)),
    repeating-linear-gradient(45deg, rgba(255, 107, 107, 0.18) 0 12px, transparent 12px 28px),
    linear-gradient(135deg, #e2fff5 0%, #e9f3ff 38%, #fff0c2 100%);
}

.result-card.pass::before,
.result-card.pass::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 18px;
  background: linear-gradient(90deg, var(--mint), var(--sky), var(--lemon), var(--coral), var(--violet));
}

.result-card.pass::before {
  top: 0;
}

.result-card.pass::after {
  bottom: 0;
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.confetti span {
  position: absolute;
  width: 10px;
  height: 18px;
  background: var(--coral);
  border-radius: 2px;
  animation: floatParty 2.8s ease-in-out infinite;
}

.confetti span:nth-child(3n) {
  background: var(--mint);
}

.confetti span:nth-child(3n + 1) {
  background: var(--lemon);
}

.confetti span:nth-child(4n) {
  background: var(--sky);
}

.result-kicker {
  margin: 0 0 14px;
  color: #0f766e;
  font-size: 16px;
  font-weight: 900;
}

.result-title {
  margin: 0;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 1.05;
  font-weight: 950;
}

.score-display {
  margin: 22px auto 14px;
  width: min(420px, 100%);
  padding: 22px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--sky), var(--mint));
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(41, 182, 200, 0.22);
}

.score-display strong {
  display: block;
  font-size: clamp(54px, 11vw, 112px);
  line-height: 1;
  font-weight: 950;
}

.score-display span {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  font-weight: 850;
}

.result-note {
  max-width: 700px;
  margin: 16px auto 0;
  color: #344054;
  font-size: 18px;
  line-height: 1.7;
}

.time-line {
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.fail-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.fail-title {
  margin: 0;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.1;
  font-weight: 950;
}

.fail-subtitle {
  margin: 12px 0 0;
  color: #475467;
  font-size: 17px;
  line-height: 1.7;
}

.fail-score {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  border-radius: 50%;
  text-align: center;
}

.fail-score strong {
  font-size: 38px;
  line-height: 1;
}

.fail-score span {
  font-size: 14px;
  font-weight: 800;
}

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

.wrong-card {
  padding: 18px;
  background: #fffafa;
  border: 1px solid #ffd4d4;
  border-radius: 8px;
}

.wrong-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.5;
}

.wrong-meta {
  margin: 8px 0;
  color: #344054;
  line-height: 1.6;
}

.wrong-meta strong {
  color: #b42318;
}

.analysis {
  margin: 10px 0 0;
  color: #475467;
  line-height: 1.7;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

@keyframes floatParty {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(16px) rotate(16deg);
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1080px);
    padding: 12px 0 32px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .hero-badge {
    width: 118px;
    height: 118px;
  }

  .badge-number {
    font-size: 34px;
  }

  .question-card {
    padding: 18px;
  }

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

  .option {
    grid-template-columns: 34px 1fr;
    padding: 11px;
  }

  .actions,
  .result-actions {
    flex-direction: column;
  }

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

  .fail-top {
    grid-template-columns: 1fr;
  }

  .fail-score {
    width: 118px;
    height: 118px;
  }
}
