:root {
  --taxi-yellow: #f8c72e;
  --taxi-gold: #c88718;
  --ink: #17130b;
  --deep-green: #153d36;
  --cream: #fff8e5;
  --paper: #fffdf5;
  --line: rgba(23, 19, 11, 0.16);
  --muted: #6e6048;
  --danger: #b63827;
  --success: #17754f;
  --shadow: 0 24px 70px rgba(23, 19, 11, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(248, 199, 46, 0.72), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgba(21, 61, 54, 0.2), transparent 24rem),
    linear-gradient(135deg, #fff6cf 0%, #f5e3b5 42%, #e8c77e 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(45deg, rgba(23, 19, 11, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(23, 19, 11, 0.05) 25%, transparent 25%);
  background-position:
    0 0,
    0 12px;
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 72%);
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 108px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero__copy,
.setup-card,
.exam-panel,
.result-panel,
.meter-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero__copy {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 36px;
  background:
    linear-gradient(115deg, rgba(255, 253, 245, 0.92), rgba(255, 248, 229, 0.72)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(248, 199, 46, 0.16) 18px 36px);
}

.hero__copy::after {
  position: absolute;
  right: -70px;
  bottom: -105px;
  width: 310px;
  height: 310px;
  border: 26px solid rgba(21, 61, 54, 0.16);
  border-radius: 50%;
  content: "";
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--taxi-gold);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 4px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.05em;
}

.hero__lead {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.8;
}

.meter-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  padding: 28px;
  border-radius: 32px;
  color: var(--cream);
  background:
    linear-gradient(160deg, rgba(21, 61, 54, 0.96), rgba(23, 19, 11, 0.92)),
    radial-gradient(circle at top right, rgba(248, 199, 46, 0.4), transparent 60%);
}

.meter-card__number {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.6rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 0.9;
}

.meter-card__label {
  display: block;
  margin-top: 10px;
  color: var(--taxi-yellow);
  font-size: 1.15rem;
  font-weight: 900;
}

.meter-card__sub {
  color: rgba(255, 248, 229, 0.78);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
}

.setup-card,
.exam-panel,
.result-panel {
  border-radius: 32px;
  background: rgba(255, 253, 245, 0.86);
}

.setup-card {
  padding: clamp(22px, 4vw, 36px);
}

.section-heading {
  margin-bottom: 22px;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 20px;
}

.field-block {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 248, 229, 0.7);
}

.field-block legend,
.field-block > label {
  display: block;
  margin-bottom: 14px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-weight: 900;
}

.subject-card {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--paper);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.subject-card + .subject-card {
  margin-top: 12px;
}

.subject-card:has(input:checked) {
  border-color: rgba(21, 61, 54, 0.55);
  background: rgba(248, 199, 46, 0.28);
}

.subject-card:hover {
  transform: translateY(-1px);
}

.subject-card input {
  width: 20px;
  height: 20px;
  accent-color: var(--deep-green);
}

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

.subject-card small,
.hint {
  color: var(--muted);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.92rem;
}

.region-block.is-disabled {
  opacity: 0.55;
}

select {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--paper);
}

.hint {
  margin: 12px 0 0;
  line-height: 1.6;
}

.pool-panel {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 18px;
  border-radius: 24px;
  color: var(--cream);
  background: linear-gradient(120deg, var(--ink), var(--deep-green));
}

.pool-panel__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pool-panel__label {
  margin-bottom: 4px;
  color: rgba(255, 248, 229, 0.72);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.9rem;
}

.pool-panel__counts {
  margin-bottom: 0;
  color: var(--taxi-yellow);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 900;
}

.primary-btn,
.secondary-btn {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-weight: 900;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.primary-btn {
  border: 0;
  color: var(--ink);
  background: var(--taxi-yellow);
  box-shadow: 0 12px 26px rgba(248, 199, 46, 0.24);
}

.secondary-btn {
  border: 1px solid rgba(23, 19, 11, 0.2);
  color: var(--ink);
  background: rgba(255, 253, 245, 0.92);
}

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

.primary-btn:disabled,
.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.exam-panel {
  margin-top: 24px;
  padding: clamp(20px, 4vw, 34px);
}

.exam-topbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.exam-meta {
  margin: 0;
  color: var(--muted);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.progress-box {
  min-width: 190px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(248, 199, 46, 0.22);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-weight: 900;
}

.progress-track {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 19, 11, 0.12);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--deep-green);
  transition: width 180ms ease;
}

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

.section-divider {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 14px 0 2px;
  color: var(--deep-green);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-weight: 900;
}

.section-divider::after {
  flex: 1;
  height: 1px;
  content: "";
  background: var(--line);
}

.question-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  animation: rise-in 420ms ease both;
}

.question-card.is-correct {
  border-color: rgba(23, 117, 79, 0.38);
  background: rgba(236, 250, 239, 0.86);
}

.question-card.is-wrong,
.question-card.is-missing {
  border-color: rgba(182, 56, 39, 0.38);
  background: rgba(255, 241, 233, 0.86);
}

.question-card.is-filtered {
  display: none;
}

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

.question-number {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--cream);
  background: var(--ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.86rem;
  font-weight: 900;
}

.question-source {
  color: var(--muted);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: right;
}

.question-text {
  margin-bottom: 16px;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.75;
}

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

.option {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 248, 229, 0.58);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.option input {
  width: 18px;
  height: 18px;
  accent-color: var(--deep-green);
}

.option__key {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--cream);
  background: var(--deep-green);
  font-weight: 900;
}

.option.is-selected {
  border-color: rgba(21, 61, 54, 0.48);
  background: rgba(248, 199, 46, 0.22);
}

.option.is-answer {
  border-color: rgba(23, 117, 79, 0.58);
  background: rgba(214, 246, 225, 0.8);
}

.option.is-wrong-choice {
  border-color: rgba(182, 56, 39, 0.54);
  background: rgba(255, 225, 215, 0.8);
}

.answer-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-weight: 800;
}

.answer-note.is-correct {
  color: var(--success);
  background: rgba(23, 117, 79, 0.1);
}

.answer-note.is-wrong {
  color: var(--danger);
  background: rgba(182, 56, 39, 0.1);
}

.sticky-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 22px;
}

.sticky-actions {
  position: sticky;
  bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 245, 0.9);
  backdrop-filter: blur(16px);
}

.result-panel {
  margin-top: 24px;
  padding: clamp(20px, 4vw, 34px);
}

.score-line {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
}

.score-number {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 11vw, 8rem);
  font-weight: 900;
  line-height: 0.9;
}

.score-number span {
  color: var(--taxi-gold);
  font-size: 0.34em;
}

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

.score-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 248, 229, 0.7);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.score-item strong {
  display: block;
  margin-top: 4px;
  font-size: 1.5rem;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .meter-card {
    min-height: 190px;
  }

  .exam-topbar,
  .pool-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .pool-panel__actions {
    width: 100%;
    flex-direction: column;
  }

  .progress-box {
    min-width: 0;
  }

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

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero__copy,
  .setup-card,
  .exam-panel,
  .result-panel {
    border-radius: 22px;
  }

  .question-head,
  .score-line {
    display: block;
  }

  .question-source {
    margin-top: 8px;
    text-align: left;
  }

  .option {
    grid-template-columns: auto 30px minmax(0, 1fr);
    padding: 12px;
  }

  .sticky-actions {
    justify-content: stretch;
    border-radius: 22px;
  }

  .sticky-actions button,
  .result-actions button,
  .pool-panel button {
    width: 100%;
  }
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  padding: 10px 16px;
  color: rgba(23, 19, 11, 0.78);
  background: rgba(255, 253, 245, 0.92);
  border-top: 1px solid var(--line);
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  font-size: 0.9rem;
  text-align: center;
  backdrop-filter: blur(8px);
}

.site-footer a {
  color: inherit;
}

