:root {
  --bg: #f3f6f8;
  --paper: #ffffff;
  --ink: #102a2a;
  --text: #34444d;
  --muted: #667085;
  --line: #dfe8ec;
  --teal: #006e6d;
  --teal-soft: #eaf7f5;
  --blue: #345da8;
  --blue-soft: #eef4ff;
  --amber: #9a6a00;
  --amber-soft: #fff4cd;
  --red: #b13a1e;
  --red-soft: #fff1ed;
  --shadow: 0 18px 46px rgba(16, 42, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button {
  border: 0;
  font: inherit;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(234, 247, 245, 0.72), rgba(243, 246, 248, 0) 280px),
    var(--bg);
}

.screen {
  display: none;
  min-height: calc(100dvh - 40px);
  animation: screen-in 240ms ease both;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 18px 0 22px;
  padding: 8px;
  border: 1px solid rgba(0, 110, 109, 0.26);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.brand-mark__logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.eyebrow,
.question-kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
}

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

h1 {
  color: var(--ink);
  font-size: 34px;
  font-weight: 800;
  line-height: 44px;
}

.lead {
  margin-top: 18px;
  color: var(--text);
  font-size: 17px;
  line-height: 30px;
}

.stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
}

.stage-card {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.stage-card strong {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  line-height: 34px;
  text-align: center;
}

.stage-card span {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
}

.stage-a strong {
  background: var(--teal);
}

.stage-b strong {
  background: var(--blue);
}

.stage-c strong {
  background: var(--amber);
}

.stage-d strong {
  background: var(--red);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
  width: 100%;
  margin-top: auto;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 12px 24px rgba(0, 110, 109, 0.2);
  gap: 8px;
}

.secondary-action {
  min-height: 44px;
  color: var(--teal);
  background: var(--teal-soft);
}

.primary-action:active,
.secondary-action:active,
.option-button:active,
.icon-button:active {
  transform: scale(0.98);
}

.quiz-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 14px;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(243, 246, 248, 0.92) 100%);
}

.icon-button {
  flex: 0 0 auto;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
}

.icon-button:disabled {
  color: #aab4ba;
  cursor: default;
  opacity: 0.55;
}

.progress-wrap {
  flex: 1;
  min-width: 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.progress-label span:first-child {
  color: var(--ink);
  font-weight: 800;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4e8;
}

.progress-fill {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 220ms ease;
}

.question-card,
.result-section,
.cta-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.question-card {
  padding: 22px;
}

#question-title {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 34px;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.option-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  width: 100%;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fbfcfd;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.option-button:hover {
  border-color: rgba(0, 110, 109, 0.42);
  background: #f8fbfc;
}

.option-button.is-selected {
  border-color: var(--option-color);
  background: var(--option-soft);
}

.option-letter {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--option-color);
  background: var(--option-soft);
  font-weight: 800;
}

.option-text {
  align-self: center;
  font-size: 16px;
  line-height: 26px;
}

.result-hero {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
  padding: 20px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.result-letter {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-size: 30px;
  font-weight: 900;
}

#result-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 32px;
}

#result-summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 25px;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.score-pill {
  padding: 10px 8px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-align: center;
}

.score-pill strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 24px;
}

.score-pill span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.result-section {
  padding: 18px;
  margin-top: 12px;
  box-shadow: none;
}

.result-section h3 {
  color: var(--teal);
  font-size: 17px;
  line-height: 26px;
}

.result-section p,
.result-section li {
  color: var(--text);
  font-size: 16px;
  line-height: 28px;
}

.result-section p {
  margin-top: 8px;
}

.result-section ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.result-section li {
  position: relative;
  padding-left: 18px;
}

.result-section li::before {
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d6a645;
  content: "";
}

.result-note {
  background: var(--teal-soft);
  border-color: #bfe6df;
}

.cta-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
}

.cta-panel__content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
}

.cta-panel__copy {
  min-width: 0;
  padding-right: 12px;
}

.cta-panel__image {
  display: block;
  width: min(100%, 150px);
  height: auto;
  max-height: 150px;
  margin: 0 auto;
  object-fit: contain;
}

.cta-panel strong,
.cta-panel span {
  display: block;
}

.cta-panel strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 26px;
}

.cta-panel span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 24px;
}

@media (max-width: 360px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  h1 {
    font-size: 30px;
    line-height: 40px;
  }

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

  .result-hero {
    grid-template-columns: 1fr;
  }
}
