:root {
  --ink: #252c3c;
  --muted: #697083;
  --paper: #fffaf2;
  --cream: #f6efe3;
  --coral: #eb6b53;
  --coral-dark: #bf4f3f;
  --gold: #f5c75d;
  --mint: #b9d8cc;
  --navy: #263246;
  --line: #eadfce;
  font-family: "Noto Sans", "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 18%, rgba(245, 199, 93, .18), transparent 24rem), var(--level-wash, #fbe3df);
  transition: background-color .45s ease;
}
button, input { font: inherit; }
button { cursor: pointer; }
.page-shell { max-width: 1180px; margin: auto; padding: 0 42px 30px; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 10px; line-height: .98; letter-spacing: .12em; font-weight: 600; }
.brand strong { color: var(--coral); font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--paper); background: var(--coral); border-radius: 50%; font-size: 25px; line-height: 1; transform: rotate(-22deg); }
.topbar-note { font-size: 10px; letter-spacing: .15em; color: var(--muted); font-weight: 700; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--gold); }
.intro-panel { display: grid; grid-template-columns: 1.1fr .9fr; min-height: 365px; align-items: center; gap: 30px; }
.intro-copy { padding: 58px 0 50px; }
.eyebrow, .section-kicker { color: var(--coral); font-size: 11px; letter-spacing: .17em; font-weight: 700; margin: 0 0 17px; }
h1, h2 { font-family: "Noto Serif", Fraunces, Georgia, serif; font-weight: 600; }
h1 { font-size: clamp(48px, 6vw, 78px); line-height: .97; letter-spacing: -.035em; margin: 0 0 24px; }
h1 em { color: var(--coral); font-style: normal; }
.intro-text { max-width: 390px; color: var(--muted); line-height: 1.65; font-size: 16px; margin: 0 0 27px; }
.intro-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.intro-tags span { border: 1px solid var(--line); color: var(--muted); padding: 7px 11px; font-size: 9px; letter-spacing: .14em; font-weight: 700; }
.moon-art { height: 310px; position: relative; overflow: hidden; background: var(--navy); border-radius: 2px; isolation: isolate; }
.moon-art::before { content: ""; position: absolute; inset: 0; opacity: .28; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 35px 35px; }
.moon-glow { position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(245, 199, 93, .15); top: 28px; right: 84px; filter: blur(15px); }
.moon { position: absolute; width: 154px; height: 154px; border-radius: 50%; right: 119px; top: 61px; background: #ffdf80; box-shadow: 0 0 36px rgba(255, 223, 128, .35); }
.moon::after { content: ""; position: absolute; width: 154px; height: 154px; border-radius: 50%; background: var(--navy); left: 35px; top: -10px; }
.cloud { position: absolute; height: 14px; width: 82px; border-top: 2px solid rgba(185, 216, 204, .55); border-radius: 50%; }
.cloud-one { top: 110px; left: 65px; transform: rotate(-9deg); }
.cloud-two { top: 195px; right: 43px; transform: rotate(8deg); }
.pagoda { position: absolute; bottom: 0; left: 96px; width: 86px; height: 92px; background: #e56b54; clip-path: polygon(42% 0, 58% 0, 58% 12%, 82% 12%, 72% 23%, 66% 23%, 66% 45%, 80% 45%, 70% 54%, 65% 54%, 65% 77%, 91% 77%, 100% 88%, 0 88%, 9% 77%, 35% 77%, 35% 54%, 30% 54%, 20% 45%, 34% 45%, 34% 23%, 28% 23%, 18% 12%, 42% 12%); }
.pagoda i { position: absolute; background: var(--navy); width: 19px; height: 19px; left: 34px; top: 25px; border: 2px solid rgba(255,255,255,.2); }
.pagoda i:nth-child(2) { top: 48px; }.pagoda i:nth-child(3) { top: 70px; }.pagoda b { position: absolute; width: 3px; height: 15px; background: var(--gold); left: 42px; top: -14px; }
.art-label { position: absolute; right: 24px; bottom: 22px; color: var(--gold); font-family: "Noto Serif", Fraunces, serif; font-size: 21px; line-height: 1.1; }.art-label small { color: rgba(255,255,255,.65); font-family: "Noto Sans", "DM Sans", sans-serif; font-size: 9px; letter-spacing: .08em; }
.quiz-card { background: white; border: 1px solid var(--line); padding: 34px 42px 36px; box-shadow: 0 14px 40px rgba(37, 44, 60, .05); }
.quiz-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }.section-kicker { margin-bottom: 7px; font-size: 10px; }h2 { font-size: 31px; line-height: 1.1; margin: 0; }
.score-pill { background: var(--cream); color: var(--coral); padding: 11px 13px 9px; min-width: 92px; text-align: center; font-family: "Noto Serif", Fraunces, serif; font-size: 22px; }.score-pill small { display: block; font-family: "Noto Sans", "DM Sans", sans-serif; color: var(--muted); font-size: 8px; letter-spacing: .13em; font-weight: 700; }
.progress-row { display: flex; align-items: center; gap: 13px; margin: 25px 0 29px; }.progress-track { height: 6px; background: var(--cream); flex: 1; }.progress-fill { width: 12.5%; height: 100%; background: var(--coral); transition: width .35s ease; }.progress-row span { min-width: 38px; color: var(--muted); font-size: 11px; font-weight: 700; }
.question-type { font-size: 10px; letter-spacing: .14em; font-weight: 700; color: var(--coral); margin-bottom: 9px; }.question-text { font-family: "Noto Serif", Fraunces, Georgia, serif; font-size: clamp(23px, 3vw, 31px); line-height: 1.22; margin: 0 0 24px; max-width: 800px; }.question-text span { color: var(--coral); }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 730px; }.option { background: var(--paper); color: var(--ink); border: 1px solid var(--line); min-height: 56px; padding: 13px 16px; text-align: left; transition: .18s ease; }.option:hover, .option.selected { border-color: var(--coral); background: #fff1ed; }.option.selected { box-shadow: inset 4px 0 var(--coral); }.option:focus-visible, .button:focus-visible, .answer-input:focus-visible { outline: 3px solid rgba(235,107,83,.3); outline-offset: 2px; }.option strong { color: var(--coral); margin-right: 7px; font-size: 12px; }.option small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.answer-input { display: block; width: min(100%, 430px); border: 1px solid var(--line); background: var(--paper); padding: 15px 17px; font-size: 17px; color: var(--ink); }.answer-input::placeholder { color: #aaa6a0; }.input-hint { display: block; margin-top: 9px; color: var(--muted); font-size: 11px; }
.feedback { min-height: 28px; margin-top: 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }.feedback.correct { color: #47806d; }.feedback.incorrect { color: var(--coral-dark); }.feedback strong { font-weight: 700; }
.quiz-actions { display: flex; justify-content: flex-end; margin-top: 5px; }.button { border: 0; padding: 13px 20px; font-weight: 700; font-size: 13px; }.button-primary { color: white; background: var(--coral); }.button-primary:hover { background: var(--coral-dark); }.button span { margin-left: 12px; font-size: 18px; vertical-align: -1px; }
.fact-strip { display: flex; align-items: center; gap: 16px; padding: 24px 8px 20px; color: var(--muted); }.fact-icon { color: var(--gold); font-size: 23px; }.fact-strip p { flex: 1; font-size: 13px; line-height: 1.5; margin: 0; }.fact-strip strong { color: var(--ink); }.fact-chinese { color: var(--coral); font-family: Fraunces, serif; font-size: 20px; line-height: 1; text-align: right; }.fact-chinese small { color: var(--muted); font-family: "DM Sans", sans-serif; font-size: 9px; }.result { text-align: center; padding: 38px 0 20px; }.result .result-moon { font-size: 54px; color: var(--gold); margin-bottom: 10px; }.result-kicker { color: var(--coral) !important; font-size: 10px; font-weight: 700; letter-spacing: .16em; margin-bottom: 9px !important; }.result h3 { font-family: Fraunces, serif; font-size: 40px; margin: 0 0 10px; }.result p { color: var(--muted); margin: 0 auto 25px; max-width: 520px; line-height: 1.6; }.result-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }.result .button { margin: 0; }.button-secondary { color: var(--ink); background: var(--cream); }.button-secondary:hover { background: var(--line); }
footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: #aaa6a0; font-size: 10px; letter-spacing: .05em; padding-top: 18px; }
@media (max-width: 700px) { .page-shell { padding: 0 18px 22px; }.topbar { height: 76px; }.topbar-note { display: none; }.intro-panel { display: block; min-height: 0; }.intro-copy { padding: 44px 0 30px; }h1 { font-size: 53px; }.moon-art { height: 215px; }.moon { width: 110px; height: 110px; right: 67px; top: 44px; }.moon::after { width: 110px; height: 110px; left: 26px; top: -7px; }.moon-glow { width: 165px; height: 165px; right: 39px; top: 18px; }.pagoda { left: 42px; transform: scale(.78); transform-origin: bottom left; }.art-label { right: 16px; bottom: 16px; }.quiz-card { padding: 26px 20px 27px; }.quiz-meta h2 { font-size: 26px; }.options { grid-template-columns: 1fr; }.question-text { font-size: 25px; }.fact-strip { align-items: flex-start; padding-left: 0; }.fact-chinese { display: none; }footer { flex-direction: column; gap: 8px; } }

body[data-level="1"] { --level-wash: #fbe3df; }
body[data-level="2"] { --level-wash: #f9e1d6; }
body[data-level="3"] { --level-wash: #f8e5cf; }
body[data-level="4"] { --level-wash: #f7edc7; }
body[data-level="5"] { --level-wash: #f3efc6; }
body[data-level="6"] { --level-wash: #e6eccb; }
body[data-level="7"] { --level-wash: #d6e8d0; }
body[data-level="8"] { --level-wash: #c6e3d3; }
.certificate-modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(37, 44, 60, .58); }
.certificate-modal[hidden] { display: none; }
.certificate { position: relative; width: min(100%, 620px); padding: 46px 42px 40px; text-align: center; background: var(--paper); border: 8px solid var(--gold); box-shadow: 0 20px 70px rgba(37, 44, 60, .25); }
.certificate-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; }
.certificate-kicker, .certificate-label { color: var(--coral); font-size: 10px; letter-spacing: .18em; font-weight: 700; }.certificate-kicker { margin: 0 0 20px; }.certificate-label { margin: 0 0 10px; }.certificate-moon { color: var(--gold); font-size: 48px; line-height: 1; }.certificate h2 { margin: 0 0 16px; font-size: clamp(30px, 5vw, 46px); }.certificate-copy { max-width: 410px; margin: 0 auto 20px; color: var(--muted); line-height: 1.6; }.certificate-score { display: grid; gap: 3px; margin: 22px auto; color: var(--coral); }.certificate-score strong { font-family: "Noto Serif", Fraunces, serif; font-size: 34px; }.certificate-score span { color: var(--muted); font-size: 9px; letter-spacing: .14em; font-weight: 700; }.certificate-greeting { margin: 22px 0 25px; color: var(--coral); font-family: "Noto Serif", Fraunces, serif; font-size: 22px; }.certificate-greeting small { color: var(--muted); font-family: "Noto Sans", "DM Sans", sans-serif; font-size: 10px; }.certificate .button { margin: 0; }
@media print { body > *:not(.page-shell) { display: none !important; }.certificate-modal { position: static; display: block; background: transparent; padding: 0; }.certificate { width: 100%; border-width: 8px; box-shadow: none; }.certificate-close, .certificate .button { display: none; } }
.confetti { position: fixed; inset: 0; z-index: 10; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -18px; left: var(--left); width: 8px; height: 13px; background: var(--confetti-color); transform: rotate(var(--rotation)); animation: confetti-drop var(--duration) var(--delay) linear infinite; }
.confetti[hidden] { display: none; }
@keyframes confetti-drop { from { opacity: 0; transform: translateY(-10vh) rotate(0deg); } 10% { opacity: 1; } to { opacity: 0; transform: translateY(110vh) rotate(var(--rotation)); } }
