:root {
  color-scheme: light;
  --ink: #20252f;
  --muted: #687080;
  --paper: rgba(255, 255, 255, 0.88);
  --line: rgba(44, 57, 79, 0.13);
  --brand: #6267d9;
  --brand-dark: #484db5;
  --brand-soft: #eeefff;
  --coral: #ef7c72;
  --danger: #b42336;
  --shadow: 0 24px 70px rgba(50, 55, 100, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 7%, rgba(255, 210, 198, 0.72), transparent 30rem),
    radial-gradient(circle at 90% 15%, rgba(195, 202, 255, 0.78), transparent 34rem),
    linear-gradient(145deg, #fff9f6 0%, #f4f5ff 55%, #f8f3ff 100%);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.page-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 56px; }
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
  gap: 28px;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.66));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero::after {
  position: absolute; right: -80px; bottom: -110px; width: 290px; height: 290px;
  border: 52px solid rgba(98,103,217,.08); border-radius: 50%; content: "";
}
.hero-copy, .score-preview { position: relative; z-index: 1; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px;
  color: var(--brand-dark); font-size: .84rem; font-weight: 800; letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow::before { width: 28px; height: 2px; border-radius: 2px; background: var(--coral); content: ""; }
h1,h2,p { margin-top: 0; }
h1 {
  max-width: 720px; margin-bottom: 18px; font-size: clamp(2.35rem,7vw,5.3rem);
  font-weight: 850; letter-spacing: -.055em; line-height: 1.02;
}
.hero-copy > p:not(.eyebrow) { max-width: 650px; margin-bottom: 25px; color: var(--muted); font-size: clamp(1rem,2vw,1.13rem); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  padding: 7px 12px; border: 1px solid rgba(98,103,217,.17); border-radius: 999px;
  color: #5055aa; background: rgba(238,239,255,.78); font-size: .83rem; font-weight: 700;
}
.score-preview {
  align-self: center; padding: 24px; border: 1px solid rgba(98,103,217,.12);
  border-radius: var(--radius-lg); background: rgba(247,247,255,.82);
}
.score-preview .label { color: var(--muted); font-size: .82rem; font-weight: 700; letter-spacing: .08em; }
.score-number { display: flex; align-items: baseline; gap: 7px; margin: 6px 0 5px; }
.score-number strong { color: var(--brand-dark); font-size: clamp(3.2rem,8vw,5.2rem); letter-spacing: -.07em; line-height: 1; }
.score-number span { color: var(--muted); font-weight: 700; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: .8rem; font-weight: 650; }
.progress-track { overflow: hidden; height: 8px; border-radius: 999px; background: #dedff4; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--coral),var(--brand)); transition: width 180ms ease; }
.instructions { margin: 42px 0 20px; }
.instructions h2 { margin-bottom: 4px; font-size: clamp(1.45rem,3vw,2rem); letter-spacing: -.025em; }
.instructions p { margin-bottom: 0; color: var(--muted); font-weight: 650; }
.notice {
  margin: 0 0 18px; padding: 14px 17px; border: 1px solid rgba(98,103,217,.2);
  border-radius: 14px; background: rgba(255,255,255,.8); color: var(--brand-dark);
}
.notice-error { border-color: rgba(180,35,54,.3); color: var(--danger); background: rgba(255,244,246,.92); }
.text-button { padding: 0; border: 0; color: inherit; background: none; font-weight: 800; text-decoration: underline; cursor: pointer; }
.questions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.question-card {
  display: grid; grid-template-columns: 50px minmax(0,1fr) 74px; gap: 16px; align-items: center;
  min-height: 132px; padding: 22px; border: 1px solid rgba(255,255,255,.84);
  border-radius: var(--radius-lg); background: var(--paper); box-shadow: 0 12px 32px rgba(50,55,90,.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.question-card:hover,.question-card:focus-within { border-color: rgba(98,103,217,.28); box-shadow: 0 17px 38px rgba(50,55,90,.11); transform: translateY(-2px); }
.question-card.is-invalid { border-color: rgba(180,35,54,.65); background: rgba(255,247,248,.94); }
.question-index {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px;
  color: var(--brand-dark); background: var(--brand-soft); font-size: .85rem; font-weight: 850;
}
.question-main label { display: block; font-size: .96rem; font-weight: 700; line-height: 1.55; }
.score-input {
  width: 74px; height: 54px; padding: 4px 8px; border: 2px solid #d8d9e8; border-radius: 15px;
  color: var(--brand-dark); background: white; text-align: center; font-size: 1.25rem; font-weight: 850;
  outline: none; transition: border-color 150ms ease, box-shadow 150ms ease;
}
.score-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(98,103,217,.14); }
.score-input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180,35,54,.1); }
.actions {
  position: sticky; z-index: 5; bottom: 16px; display: flex; justify-content: center; gap: 12px;
  width: fit-content; max-width: calc(100% - 20px); margin: 30px auto; padding: 10px;
  border: 1px solid rgba(255,255,255,.85); border-radius: 999px; background: rgba(255,255,255,.82);
  box-shadow: 0 15px 45px rgba(46,49,85,.16); backdrop-filter: blur(16px);
}
.button { min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; font-weight: 800; cursor: pointer; transition: transform 150ms ease, opacity 150ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(98,103,217,.28); outline-offset: 3px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { color: white; background: linear-gradient(135deg,var(--brand),var(--brand-dark)); box-shadow: 0 9px 20px rgba(72,77,181,.28); }
.button-secondary { color: #5c6170; background: #f0f1f5; }
.result { scroll-margin-top: 24px; display: none; margin-top: 38px; }
.result.is-visible { display: block; animation: reveal 360ms ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } }
.result-card {
  position: relative; overflow: hidden; padding: clamp(26px,5vw,48px); border: 1px solid rgba(255,255,255,.82);
  border-radius: var(--radius-xl); color: white; background: linear-gradient(135deg,#5a527b,#8a79ad); box-shadow: var(--shadow);
}
.result-card::after {
  position: absolute; top: -100px; right: -90px; width: 310px; height: 310px;
  border: 62px solid rgba(255,255,255,.08); border-radius: 50%; content: "";
}
.result-heading { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.result-kicker { margin-bottom: 6px; color: rgba(255,255,255,.72); font-size: .82rem; font-weight: 800; letter-spacing: .12em; }
.result-heading h2 { margin-bottom: 10px; font-size: clamp(2rem,5vw,3.5rem); letter-spacing: -.045em; line-height: 1.05; }
.result-heading p { max-width: 680px; margin-bottom: 0; color: rgba(255,255,255,.86); }
.grade-seal {
  flex: 0 0 auto; display: grid; place-items: center; width: 104px; height: 104px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 9px rgba(255,255,255,.06); font-size: 3rem; font-weight: 900; line-height: 1;
}
.total-card { position: relative; z-index: 1; display: inline-flex; align-items: baseline; gap: 12px; padding: 14px 18px; border-radius: 15px; background: rgba(255,255,255,.1); }
.total-card span { color: rgba(255,255,255,.7); }
.total-card strong { font-size: 1.7rem; }
.advice { position: relative; z-index: 1; margin: 18px 0 0; padding: 17px 20px; border-left: 3px solid rgba(255,255,255,.72); border-radius: 0 12px 12px 0; background: rgba(15,18,55,.12); color: rgba(255,255,255,.92); }
footer { padding: 30px 12px 0; color: var(--muted); text-align: center; font-size: .78rem; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .score-preview { max-width: 420px; }
  .questions { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page-shell { width: min(100% - 20px,1120px); padding-top: 10px; }
  .hero { padding: 27px 22px; border-radius: 24px; }
  .question-card { grid-template-columns: 42px minmax(0,1fr) 64px; padding: 18px 16px; }
  .question-index { width: 40px; height: 40px; border-radius: 13px; }
  .score-input { width: 64px; height: 50px; }
  .actions { bottom: 9px; gap: 7px; width: calc(100% - 4px); max-width: none; }
  .button { flex: 1; padding: 0 15px; font-size: .88rem; }
  .result-heading { flex-direction: column-reverse; }
  .grade-seal { width: 84px; height: 84px; font-size: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
