:root {
  --navy: #203a59;
  --navy-deep: #142b45;
  --gold: #c7aa62;
  --gold-soft: #efe5c8;
  --carbon: #212528;
  --muted: #67717a;
  --line: #d8dee3;
  --surface: #f4f7f9;
  --white: #ffffff;
  --danger: #9a3f3f;
  --progress: 14%;
}

* { box-sizing: border-box; }

html { background: var(--navy); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--carbon);
  background:
    linear-gradient(90deg, var(--navy) 0 10px, transparent 10px),
    var(--surface);
  font-family: "Noto Sans TC", system-ui, sans-serif;
}

button, input { font: inherit; }

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 22px max(34px, env(safe-area-inset-bottom));
  background: var(--white);
  border-inline: 1px solid rgba(32, 58, 89, 0.08);
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 18px;
}

.brand-logo {
  display: block;
  width: 176px;
  height: auto;
}

.test-badge {
  padding: 5px 9px;
  color: var(--navy-deep);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  font: 500 11px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
}

.intro { margin: 48px 0 34px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--navy);
  font: 500 12px/1.4 "IBM Plex Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, legend {
  font-family: "Manrope", "Noto Sans TC", sans-serif;
  letter-spacing: -0.03em;
}

h1 {
  max-width: 640px;
  margin: 0;
  font-size: clamp(30px, 7vw, 48px);
  line-height: 1.12;
  font-weight: 750;
}

.intro > p:last-child {
  max-width: 570px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.progress-block {
  margin-bottom: 36px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mono { font-family: "IBM Plex Mono", monospace; }

.progress-track {
  position: relative;
  height: 3px;
  overflow: visible;
  background: #e9edf0;
}

.progress-track::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  content: "";
  background: var(--navy);
  transition: width 240ms ease;
}

.progress-track::after {
  position: absolute;
  top: 50%;
  left: var(--progress);
  width: 10px;
  height: 10px;
  content: "";
  background: var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
  transition: left 240ms ease;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  padding: 0;
  color: var(--navy-deep);
  font-size: clamp(23px, 5vw, 31px);
  line-height: 1.25;
  font-weight: 750;
}

.step-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.choice-list {
  display: grid;
  gap: 0;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 13px;
  align-items: start;
  padding: 18px 4px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: color 160ms ease, background 160ms ease, padding 160ms ease;
}

.choice:hover { background: #f8fafb; }

.choice:has(input:checked) {
  padding-inline: 14px;
  color: var(--navy-deep);
  background: linear-gradient(90deg, rgba(199, 170, 98, 0.22), rgba(199, 170, 98, 0.05));
  border-bottom-color: var(--gold);
}

.choice input {
  width: 18px;
  height: 18px;
  margin: 4px 0 0;
  accent-color: var(--navy);
}

.choice strong,
.choice small { display: block; }

.choice strong {
  font-size: 16px;
  line-height: 1.45;
  font-weight: 650;
}

.choice small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.error-message {
  min-height: 22px;
  margin: 16px 0 4px;
  color: var(--danger);
  font-size: 13px;
}

.form-controls,
.result-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-controls { justify-content: flex-end; }

.button {
  min-height: 50px;
  padding: 0 22px;
  cursor: pointer;
  border: 1px solid var(--navy);
  border-radius: 0;
  font-weight: 650;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.button:active { transform: translateY(1px); }

.button:focus-visible,
.choice:has(input:focus-visible) {
  outline: 3px solid rgba(199, 170, 98, 0.55);
  outline-offset: 3px;
}

.button.primary {
  color: var(--white);
  background: var(--navy);
}

.button.primary:hover { background: var(--navy-deep); }

.button.secondary {
  color: var(--navy);
  background: var(--white);
}

.result-panel {
  margin-top: 30px;
  padding-top: 28px;
  border-top: 8px solid var(--navy);
}

.result-panel h2 {
  margin: 0;
  font-size: clamp(25px, 6vw, 36px);
  line-height: 1.2;
}

.result-range {
  margin: 24px 0 10px;
  color: var(--navy-deep);
  font: 750 clamp(31px, 8vw, 52px)/1.12 "Manrope", sans-serif;
  letter-spacing: -0.04em;
}

.result-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.result-reasons {
  margin: 22px 0 0;
  padding: 16px 18px 16px 36px;
  color: var(--navy-deep);
  background: var(--gold-soft);
  line-height: 1.7;
}

.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.result-summary span {
  padding: 6px 9px;
  color: var(--navy-deep);
  border: 1px solid #cbd5dc;
  font-size: 11px;
}

.disclaimer {
  margin: 26px 0;
  padding-left: 14px;
  color: var(--muted);
  border-left: 2px solid var(--gold);
  font-size: 12px;
  line-height: 1.8;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

[hidden] { display: none !important; }

@media (max-width: 560px) {
  body { background: var(--white); }
  .app-shell { padding-inline: 18px; border: 0; }
  .brand-logo { width: 154px; }
  .intro { margin-top: 38px; }
  .form-controls .button { flex: 1; }
  .result-actions { flex-direction: column; }
  .result-actions .button { width: 100%; }
  footer { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
