:root {
  --midnight: #063a60;
  --midnight-soft: #075b8f;
  --emerald: #0877b6;
  --emerald-bright: #53b5e2;
  --mint: #e9f7fd;
  --gold: #f3bd39;
  --brand-red: #e30613;
  --brand-red-dark: #bd1019;
  --paper: #fbfdff;
  --ink: #0b3450;
  --muted: #587389;
  --line: #cae5f2;
  --danger: #c81722;
  --shadow: 0 20px 50px rgba(7, 91, 143, 0.15);
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.34), transparent 34%),
    linear-gradient(160deg, #7fcdf0 0%, #53b5e2 48%, #1488c6 100%);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, var(--paper) 55%, #f1f9fd 100%);
}

.site-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 2px 18px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  font-weight: 900;
  background: var(--brand-red);
  border-radius: 50% 50% 48% 48%;
  box-shadow: 7px 7px 0 var(--mint);
}

.eyebrow,
.brand-name,
.step-label,
.progress-count,
.question-kicker,
.draw-note,
.result-name,
.result-instruction,
.result-followup {
  margin: 0;
}

.eyebrow,
.step-label,
.question-kicker {
  color: var(--emerald);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-name {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 700;
}

.campaign-cover {
  position: relative;
  margin: 0 -18px;
  overflow: hidden;
  background: var(--emerald-bright);
  border-radius: 0 0 36px 36px;
  box-shadow: 0 22px 44px rgba(7, 91, 143, 0.22);
}

.campaign-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, transparent 42%, rgba(3, 54, 89, 0.15) 64%, rgba(3, 54, 89, 0.9) 100%);
}

.campaign-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 1.15;
  object-fit: cover;
  object-position: center;
}

.campaign-cover__title {
  position: absolute;
  z-index: 1;
  right: 24px;
  bottom: 24px;
  left: 24px;
  color: white;
}

.campaign-cover__title p {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.campaign-cover__title h1 {
  margin: 0;
  color: white;
  font-size: clamp(34px, 10vw, 48px);
  letter-spacing: 0.02em;
  text-shadow: 0 3px 16px rgba(0, 44, 75, 0.42);
}

.screen {
  display: none;
  min-height: calc(100dvh - 90px);
  animation: screen-enter 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.screen--active {
  display: block;
}

.hero-copy {
  padding: 30px 4px 22px;
}

.hero-copy--centered {
  padding-top: 34px;
  text-align: center;
}

.hero-copy--centered h1 {
  font-size: clamp(28px, 7.8vw, 38px);
  letter-spacing: -0.045em;
}

h1,
h2 {
  color: var(--midnight);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

h1 {
  margin: 12px 0 8px;
  font-size: clamp(31px, 9vw, 42px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.hero-copy h2 {
  margin: 10px 0 8px;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.25;
}

.hero-copy > p:last-child {
  max-width: 28em;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.hero-copy--centered > p:last-child {
  margin-right: auto;
  margin-left: auto;
}

.form-card,
.question-card {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-red);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.field {
  display: block;
  margin-bottom: 19px;
}

.field > span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.field > span em {
  margin-left: 6px;
  color: var(--brand-red);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 16px;
  background: #f4fafe;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input:focus {
  background: white;
  border-color: var(--emerald);
  box-shadow: 0 0 0 4px rgba(14, 124, 114, 0.12);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  color: var(--danger);
  font-size: 12px;
}

.privacy-note {
  margin: 14px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  padding: 13px 20px;
  border-radius: 14px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  color: white;
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  box-shadow: 0 10px 22px rgba(227, 6, 19, 0.22);
}

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

.secondary-button {
  color: var(--midnight);
  background: var(--mint);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.draw-card:focus-visible,
.option-button:focus-visible {
  outline: 3px solid rgba(213, 166, 66, 0.62);
  outline-offset: 3px;
}

.quiz-topline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 24px 3px 12px;
}

.quiz-topline h1 {
  margin-bottom: 0;
}

.progress-count {
  padding-bottom: 8px;
  color: var(--muted);
  font-family: "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.progress-count span {
  color: var(--emerald);
  font-size: 24px;
}

.progress-track {
  height: 5px;
  margin-bottom: 26px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-bright), var(--brand-red));
  border-radius: inherit;
  transition: width 240ms ease;
}

.question-card {
  min-height: 370px;
}

.question-card h2 {
  margin: 13px 0 10px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.55;
}

.selection-rule {
  margin: 0 0 22px;
  color: var(--emerald);
  font-size: 13px;
  font-weight: 700;
}

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

.option-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  color: var(--ink);
  text-align: left;
  background: #f5fbfe;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.option-letter {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--emerald);
  font-family: "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
  background: var(--mint);
  border-radius: 9px;
}

.option-button--selected {
  background: var(--mint);
  border-color: var(--emerald);
  box-shadow: inset 4px 0 0 var(--brand-red);
  transform: translateX(3px);
}

.option-button--selected .option-letter {
  color: white;
  background: var(--emerald);
}

.option-button:disabled:not(.option-button--selected) {
  cursor: not-allowed;
  opacity: 0.38;
}

.quiz-actions {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 12px;
  padding-top: 20px;
}

.submission-error {
  min-height: 22px;
  margin: 10px 4px 0;
  color: var(--danger);
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}

.draw-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 24px;
  perspective: 900px;
}

.draw-card {
  position: relative;
  display: flex;
  aspect-ratio: 0.58;
  padding: 12px 8px 10px;
  overflow: hidden;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  color: var(--midnight);
  background:
    radial-gradient(circle at 50% 32%, rgba(83, 181, 226, 0.2), transparent 40%),
    linear-gradient(155deg, #ffffff, #e7f6fc);
  border: 1px solid rgba(8, 119, 182, 0.22);
  border-radius: 22px;
  cursor: pointer;
  filter: drop-shadow(0 12px 16px rgba(11, 31, 51, 0.16));
  transition: transform 180ms ease, filter 180ms ease;
}

.draw-card::after {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 20px;
  height: 20px;
  content: "";
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}

.draw-card__number {
  color: var(--gold);
  font-family: "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: left;
}

.draw-card__image-wrap {
  display: grid;
  height: 78px;
  min-height: 78px;
  margin: 14px 0 12px;
  padding: 8px;
  overflow: hidden;
  flex: 0 0 78px;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(11, 31, 51, 0.08);
  border-radius: 8px 18px 8px 18px;
  box-shadow: inset 0 0 20px rgba(11, 31, 51, 0.035);
}

.draw-card__image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.draw-card__name {
  display: grid;
  min-height: 38px;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.draw-card__hint {
  margin-top: auto;
  color: var(--emerald);
  font-size: 11px;
  font-weight: 700;
}

.draw-card:active {
  transform: translateY(4px) scale(0.97);
}

.draw-card--chosen {
  animation: card-reveal 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
  filter: drop-shadow(0 18px 24px rgba(213, 166, 66, 0.38));
}

.draw-card--muted {
  opacity: 0.35;
  transform: scale(0.94);
}

.draw-note {
  margin-top: 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

#screen-result {
  place-items: center;
}

#screen-result.screen--active {
  display: grid;
}

.result-card {
  position: relative;
  width: 100%;
  padding: 56px 24px 52px;
  overflow: hidden;
  color: white;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(83, 181, 226, 0.48), transparent 40%),
    linear-gradient(160deg, #063a60, #0877b6);
  border: 1px solid rgba(213, 166, 66, 0.5);
  border-radius: 34px;
  box-shadow: 0 28px 72px rgba(11, 31, 51, 0.28);
}

.result-card::before,
.result-card::after {
  position: absolute;
  width: 68px;
  height: 68px;
  content: "";
  border: 1px solid rgba(213, 166, 66, 0.5);
}

.result-card::before {
  top: 14px;
  left: 14px;
  border-right: 0;
  border-bottom: 0;
  border-radius: 18px 0 0;
}

.result-card::after {
  right: 14px;
  bottom: 14px;
  border-top: 0;
  border-left: 0;
  border-radius: 0 0 18px;
}

.result-icon {
  display: grid;
  width: 86px;
  height: 86px;
  margin: 0 auto 28px;
  place-items: center;
  color: var(--midnight);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 42px;
  font-weight: 700;
  background: linear-gradient(145deg, #ffe9a8, var(--gold));
  border: 5px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 9px rgba(213, 166, 66, 0.1);
}

.step-label--gold {
  color: #efca72;
}

.result-card h1 {
  margin-top: 16px;
  color: white;
  font-size: clamp(38px, 11vw, 52px);
}

.result-name {
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
}

.result-divider {
  width: 54px;
  height: 1px;
  margin: 34px auto;
  background: var(--gold);
}

.result-instruction {
  font-size: 23px;
  font-weight: 800;
}

.result-followup {
  margin-top: 9px;
  color: #efca72;
  font-size: 17px;
  font-weight: 700;
}

.result-prize-copy {
  max-width: 16em;
  margin: 0 auto;
  color: white;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.75;
}

.result-prize-copy::first-letter {
  color: #fff4bf;
}

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

@keyframes card-reveal {
  0% {
    transform: rotateY(0) scale(1);
  }
  55% {
    transform: rotateY(150deg) scale(1.08);
  }
  100% {
    transform: rotateY(360deg) scale(1.03);
  }
}

@media (min-width: 521px) {
  .app-shell {
    margin-top: 22px;
    margin-bottom: 22px;
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  }
}

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

  .form-card,
  .question-card {
    padding: 20px;
  }

  .question-card h2 {
    font-size: 21px;
  }

  .campaign-cover {
    margin-right: -14px;
    margin-left: -14px;
  }
}

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