:root {
  --teal: #66abb2;
  --teal-ink: #2a7a82;
  --deep: #163d42;
  --deep-2: #236068;
  --line: #a8d4d8;
  --bg: #f4f8f8;
  --card: #ffffff;
  --ink: #1d2b2d;
  --muted: #5d7275;
  --shadow: 0 12px 40px rgba(22, 61, 66, 0.12);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Inter", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--teal-ink); }

.topbar {
  background: linear-gradient(160deg, var(--deep) 0%, var(--deep-2) 100%);
  color: #fff;
}
.topbar-inner {
  max-width: 720px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
.topbar img { height: 40px; width: auto; }
.topbar .brand { font-weight: 700; letter-spacing: .02em; }
.topbar .brand small { display: block; color: var(--teal); font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.topbar nav { margin-left: auto; font-size: 14px; }
.topbar nav a { color: #d8eeef; text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }

main { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.card {
  background: var(--card); border: 1px solid #e1eeef; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 24px;
}

/* intro */
.eyebrow { color: var(--teal-ink); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.2; margin: 6px 0 12px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 24px; }
.fact { background: var(--bg); border-radius: 10px; padding: 12px; text-align: center; }
.fact b { display: block; font-size: 22px; color: var(--deep); }
.fact span { font-size: 13px; color: var(--muted); }
.how { font-size: 14px; color: var(--muted); padding-left: 18px; margin: 0 0 24px; }
.how li { margin-bottom: 4px; }

.btn {
  display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--deep-2); color: #fff; font: inherit; font-weight: 700;
  padding: 14px 28px; min-width: 200px; text-align: center; text-decoration: none;
}
.btn:hover:not(:disabled) { background: var(--deep); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--teal-ink); border: 1.5px solid var(--line); }

/* quiz */
.progress { height: 6px; background: #e1eeef; border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--teal); transition: width .3s; }
.progress-text { font-size: 13px; color: var(--muted); margin: 8px 0 20px; }
.prompt { font-size: 15px; color: var(--muted); margin: 0 0 8px; text-align: center; }
.stem {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: center; color: var(--deep); margin: 0 0 24px; line-height: 1.2;
}
.stem.char { font-size: 96px; font-weight: 500; }
.stem.word { font-size: 56px; font-weight: 500; letter-spacing: .05em; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option {
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer;
  font: inherit; color: var(--ink); padding: 14px 12px; min-height: 56px; text-align: center;
  transition: border-color .15s, background .15s;
}
@media (hover: hover) { .option:hover { border-color: var(--teal-ink); background: #f0f8f8; } }
.option:active { border-color: var(--teal-ink); background: #e3f1f2; }
.option.pinyin { font-size: 22px; }
.option.zh { font-family: "Noto Sans SC", sans-serif; font-size: 24px; }
.option.en { font-size: 15px; grid-column: 1 / -1; text-align: left; }
.idk {
  display: block; width: 100%; margin-top: 12px; background: none; cursor: pointer;
  border: 1.5px dashed #c5d6d8; border-radius: 10px; padding: 12px; color: var(--muted); font: inherit;
}
@media (hover: hover) { .idk:hover { border-color: var(--muted); color: var(--ink); } }
.hint { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; }

/* result */
.result-head { text-align: center; }
.level-badge {
  display: inline-block; background: linear-gradient(160deg, var(--deep), var(--deep-2));
  color: #fff; border-radius: 999px; padding: 6px 18px; font-weight: 700; margin: 8px 0 14px;
}
.count-wrap { transition: filter .3s; }
.count-wrap.blurred { filter: blur(9px); user-select: none; }
.count { font-size: clamp(48px, 12vw, 72px); font-weight: 800; color: var(--deep); line-height: 1; }
.count small { font-size: 18px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.unit { color: var(--muted); margin-top: 6px; }
.note { font-size: 13px; color: var(--muted); margin-top: 10px; }

.gate {
  margin: 24px auto 0; max-width: 460px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); text-align: left;
}
.gate-head { background: linear-gradient(160deg, var(--deep) 0%, #1e5459 60%, var(--deep-2) 100%); color: #f0fafa; padding: 20px 24px; }
.gate-head b { display: block; font-size: 17px; }
.gate-head span { font-size: 13px; color: rgba(168, 212, 216, .9); }
.gate form { padding: 18px 24px 22px; background: #fff; }
.gate label { display: block; font-size: 11px; font-weight: 700; color: var(--teal-ink); letter-spacing: .12em; text-transform: uppercase; margin: 10px 0 6px; }
.gate input {
  width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit;
}
.gate input:focus { outline: none; border-color: var(--teal-ink); }
.gate .btn { width: 100%; margin-top: 16px; }
.gate .err { color: #b3261e; font-size: 13px; margin: 10px 0 0; }
.gate .privacy { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.section-title { font-size: 18px; margin: 32px 0 12px; }
.band-row { display: grid; grid-template-columns: 170px 1fr 44px; gap: 10px; align-items: center; font-size: 14px; margin-bottom: 6px; }
.band-row.skipped { color: #9db0b2; }
.band-bar { height: 10px; background: #e6f0f1; border-radius: 5px; overflow: hidden; }
.band-bar span { display: block; height: 100%; background: var(--teal); border-radius: 5px; }
.band-pct { text-align: right; font-variant-numeric: tabular-nums; }
.missed { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.missed li { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.missed li.none { grid-column: 1 / -1; }
.m-zh { display: block; font-family: "Noto Sans SC", sans-serif; font-size: 20px; color: var(--deep); }
.m-info { display: block; font-size: 12px; color: var(--muted); }
.method { font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }

/* share poster */
.poster { text-align: center; margin-top: 8px; }
.poster img { width: 100%; max-width: 360px; border-radius: 12px; box-shadow: var(--shadow); display: block; margin: 0 auto 14px; }
.poster .actions { margin-top: 0; }

/* SEO content on the intro screen */
.seo { margin-top: 36px; border-top: 1px solid #e1eeef; padding-top: 8px; }
.seo h2 { font-size: 18px; margin: 22px 0 10px; }
.hsk-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hsk-table th, .hsk-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e1eeef; }
.hsk-table th { color: var(--teal-ink); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.hsk-table td:last-child, .hsk-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.faq details { border-bottom: 1px solid #e1eeef; padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

footer { text-align: center; font-size: 12px; color: var(--muted); padding: 0 16px 32px; }

@media (max-width: 520px) {
  .card { padding: 22px 16px; }
  .facts { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .fact b { font-size: 18px; }
  .stem.char { font-size: 80px; }
  .stem.word { font-size: 44px; }
  .band-row { grid-template-columns: 120px 1fr 40px; font-size: 12px; }
  .btn { width: 100%; }
}
