:root {
  color-scheme: light;
  --paper: #f2f4f2;
  --ink: #1e2b28;
  --muted: #4b5b56;
  --accent: #24463e;
  --accent-hover: #18372f;
  --copper: #745549;
  --line: #4a65562c;
  --surface: #ffffffab;
  --focus: #4e6e61;
  --glass: blur(22px) saturate(135%);
  --shadow: 0 12px 40px #2842360d, 0 1px 2px #2842360a, inset 0 1px 0 #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 76% 4%, #e1e8e3 0%, transparent 55%),
    linear-gradient(139deg, #f9faf9, var(--paper) 56%, #edf0ee);
  background-attachment: fixed;
}
main { flex: 1; padding-block: clamp(28px, 4.2vw, 56px) 42px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { line-height: 1.16; font-weight: 690; letter-spacing: -.042em; overflow-wrap: anywhere; }
h2 { font-size: 1.1rem; font-weight: 680; line-height: 1.3; }
h3 { font-size: 1rem; font-weight: 680; }
:lang(zh-CN) h1 { letter-spacing: -.02em; }
button, input { font: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
button, summary { cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
h1:focus { outline: none; }
svg { flex: 0 0 auto; }
.shell { width: min(calc(100% - 48px), 1072px); margin-inline: auto; }

.header {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid #4a655617;
  background: #f8faf8bc;
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
}
.topbar { min-height: 64px; display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 1.13rem; font-weight: 750; letter-spacing: -.043em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #f4f8f5; }
.brand-mark svg { width: 19px; height: 19px; }
.nav-title { padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.language { position: relative; margin-left: auto; font-size: .84rem; }
.language summary { display: flex; gap: 7px; align-items: center; min-height: 37px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: #ffffff6b; white-space: nowrap; }
.language summary::after { content: ""; margin: -3px 2px 0; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); }
summary::-webkit-details-marker { display: none; }
.language ul { position: absolute; top: calc(100% + 6px); right: 0; min-width: 158px; width: max-content; margin: 0; padding: 5px; list-style: none; border: 1px solid #fff; border-radius: 14px; background: #fafcf9f5; box-shadow: var(--shadow); }
.language a { display: block; padding: 7px 11px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.language a:hover, .language a[aria-current] { background: #e6ece6; }

.panel, .disclosure-group {
  border: 1px solid #fff;
  background: linear-gradient(135deg, #ffffffd6, var(--surface));
  -webkit-backdrop-filter: var(--glass);
  backdrop-filter: var(--glass);
  box-shadow: var(--shadow);
}
.panel { border-radius: 25px; }
.kicker { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: .83rem; font-weight: 650; }
.lead { max-width: 62ch; color: var(--muted); font-size: clamp(.96rem, 2vw, 1.04rem); }
.mode-icon { flex: 0 0 auto; display: grid; place-items: center; width: 51px; height: 51px; border: 1px solid #405c4421; border-radius: 50%; background: #e8eee7; color: var(--accent); }
.flags .mode-icon { border-color: #76544922; background: #f0eae6; color: var(--copper); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 16px; margin: 15px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .82rem; }
.meta li { display: flex; align-items: center; gap: 5px; min-height: 24px; }
.meta svg { color: var(--accent); }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--accent); font-size: .87rem; font-weight: 620; text-decoration: none; }
.back:hover { text-decoration: underline; }
.alternate-mode { justify-self: start; width: fit-content; }

.home-wrap { width: min(100%, 1010px); margin-inline: auto; }
.home-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .89fr);
  align-items: center;
  gap: 18px;
  min-height: 350px;
  margin-bottom: 15px;
  padding: clamp(23px, 5vw, 64px);
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: 29px;
  background: linear-gradient(110deg, #fbfcfa, #f2f6f0 55%, #e6ede6);
  box-shadow: var(--shadow);
}
.home-copy { position: relative; z-index: 1; }
.home-hero .kicker { color: var(--copper); gap: 10px; }
.home-hero .kicker::before { content: ""; width: 17px; height: 1px; background: currentColor; }
.home-hero h1 { margin-block: 12px 13px; font-size: clamp(2.5rem, 6vw, 4.3rem); text-wrap: balance; }
.home-copy > .meta { margin-top: 24px; }
.atlas-art { display: block; width: 100%; height: auto; pointer-events: none; }
.home-hero .atlas-art { justify-self: center; width: 118%; max-width: 475px; margin-block: -50px; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 111px; padding: 18px 22px; border-radius: 19px; transition: box-shadow .18s, background-color .18s; }
.mode-card:hover { background-color: #fff; box-shadow: 0 12px 33px #28423616; }
.mode-card:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.mode-card h2 { margin-bottom: 4px; font-size: 1.22rem; overflow-wrap: anywhere; }
.mode-card p { font-size: .88rem; line-height: 1.38; color: var(--muted); }
.mode-link { color: var(--ink); text-decoration: none; }
.mode-link:focus-visible { outline: none; }
.mode-link::after { content: ""; position: absolute; inset: 0; }
.mode-cta { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--accent); background: #edf1ed; }

.intro-wrap, .quiz-wrap { width: min(100%, 930px); margin-inline: auto; }
.intro-wrap { display: grid; gap: 12px; }
.intro-wrap > .back:first-child { justify-self: start; margin-top: -6px; }
.intro-panel, .quiz-panel, .result-hero { padding: clamp(18px, 3.6vw, 40px); }
.intro-panel { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.27fr) minmax(0, 1fr); align-items: center; gap: clamp(25px, 4.6vw, 56px); min-height: 308px; overflow: hidden; }
.intro-panel > .atlas-art { position: absolute; z-index: -1; width: 480px; top: -106px; right: -86px; opacity: .46; }
.intro-copy .mode-icon { width: 35px; height: 35px; }
.intro-panel.flags .intro-copy > .kicker { color: var(--copper); }
.intro-copy h1 { margin: 14px 0 11px; font-size: clamp(1.7rem, 3.9vw, 3rem); text-wrap: balance; }
.intro-clause { display: inline-block; max-width: 100%; }
.intro-copy .meta { margin-top: 18px; }
.setup { padding: clamp(16px, 2.7vw, 25px); border: 1px solid #fff; border-radius: 19px; background: #fbfdfae0; box-shadow: 0 8px 28px #34534314, inset 0 1px 0 #fff; -webkit-backdrop-filter: var(--glass); backdrop-filter: var(--glass); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; padding: 0; font-size: .94rem; font-weight: 680; }
.difficulty { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 3px; border: 1px solid #45645324; border-radius: 12px; background: #54776310; }
.tier-choice { position: relative; display: grid; place-items: center; min-height: 39px; padding: 5px 8px; border-radius: 10px; border: 1px solid transparent; color: var(--muted); cursor: pointer; font-size: .92rem; font-weight: 620; text-align: center; }
.tier-choice:has(input:checked) { border-color: #fff; background: #fff; color: var(--accent-hover); box-shadow: 0 1px 4px #27473520; }
.tier-choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.tier-help { min-height: 1.45em; margin-top: 7px; color: var(--muted); font-size: .84rem; }
.tier-help [data-level="hard"], fieldset:has([value="hard"]:checked) .tier-help [data-level="easy"] { display: none; }
fieldset:has([value="hard"]:checked) .tier-help [data-level="hard"] { display: block; }
.setup .primary { width: 100%; min-height: 48px; margin-top: 16px; }
.notice { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #eddfd0; color: #613e33; font-size: .89rem; }
.invite-tier + p { margin-top: 5px; }

.primary, .secondary, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 15px; border: 1px solid transparent; border-radius: 11px; font-size: .92rem; font-weight: 640; text-align: center; }
.primary { background: var(--accent); color: #fffdf8; }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled { background: #e2e8e4; color: #55635b; cursor: default; }
.secondary { border-color: var(--line); background: #ffffff7d; color: var(--accent); }
.secondary:hover, .text-button:hover { background: #e7ece7; }
.text-button { padding-inline: 9px; background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.disclosure-group { border: 1px solid #4a655622; border-radius: 15px; background: #ffffff68; box-shadow: none; }
.disclosure + .disclosure { border-top: 1px solid var(--line); }
.disclosure > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 46px; padding: 8px 15px; list-style: none; font-size: .9rem; font-weight: 640; }
.disclosure > summary > span { display: flex; align-items: center; gap: 8px; }
.disclosure > summary svg { color: var(--accent); }
.disclosure[open] > summary > svg { transform: rotate(90deg); }
.disclosure-body { padding: 0 15px 13px; }
.rules { color: var(--muted); font-size: .88rem; }
.rules ul { margin: 0; padding-left: 1.2em; }
.rules li + li, .rules p + p { margin-top: 4px; }
.rules details { border-top: 1px solid var(--line); padding-block: 6px; }
.rules details:first-child { border-top: 0; }
.rules details summary { color: var(--ink); font-weight: 620; list-style: revert; }
.rules details summary::-webkit-details-marker { display: revert; }
.rules details p { margin-top: 5px; }

.quiz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
#q-progress { flex: 0 0 auto; color: var(--muted); font-size: .82rem; font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }
progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 10px; background: #dde6df; accent-color: var(--accent); }
progress::-webkit-progress-bar { border-radius: 10px; background: #dde6df; }
progress::-webkit-progress-value { border-radius: 10px; background: #54786a; }
progress::-moz-progress-bar { border-radius: 10px; background: #54786a; }
.quiz-columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: clamp(22px, 4vw, 46px); margin-top: 27px; }
.prompt { text-align: left; }
.prompt h1 { margin-bottom: 13px; font-size: clamp(1.21rem, 2.4vw, 1.67rem); text-wrap: balance; }
.flag-stage, .country-stage {
  display: grid;
  place-items: center;
  min-height: 222px;
  padding: 18px;
  border: 1px solid #4a655620;
  border-radius: 16px;
  background: linear-gradient(145deg, #edf2ee, #f5f7f3);
}
.flag-stage img { display: block; width: auto; max-width: 100%; height: clamp(125px, 24vw, 172px); object-fit: contain; filter: drop-shadow(0 3px 5px #233d3029); }
.country-stage { color: var(--accent-hover); font-size: clamp(1.5rem, 4vw, 2.55rem); font-weight: 690; text-align: center; overflow-wrap: anywhere; }
.answer-grid { display: grid; gap: 8px; }
.answer { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 11px; background: #ffffff83; color: var(--ink); text-align: left; font-size: .95rem; font-weight: 600; overflow-wrap: anywhere; }
.answer:hover { border-color: #749185; }
.answer:active { border-color: #597b6a; background: #e5eee8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.letter { flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #45645327; border-radius: 50%; background: #edf2ee; color: var(--muted); font-size: .76rem; }
.quiz-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.skip-button { border-color: transparent; background: transparent; }

.result-wrap { display: grid; gap: 11px; }
.result-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: clamp(22px, 5.1vw, 66px); }
.result-hero > .stats { grid-column: 2; align-self: start; }
.result-copy { align-self: end; }
.result-hero h1 { margin: 7px 0 6px; font-size: clamp(1.85rem, 4vw, 2.8rem); }
.score { position: relative; display: grid; grid-row: 1 / span 2; place-content: center; justify-items: center; gap: 5px; width: clamp(152px, 22vw, 204px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #e5eee8, #f8faf6 69%); color: var(--accent-hover); line-height: 1; font-variant-numeric: tabular-nums; }
.score strong { font-size: clamp(3.2rem, 6.3vw, 4.65rem); font-weight: 650; letter-spacing: -.07em; }
.score span { color: var(--muted); font-size: .84rem; font-weight: 570; }
.score-ring { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; }
.score-ticks { stroke: #6484767a; stroke-width: 1.3; stroke-dasharray: .37 1.63; }
.score-track { stroke: #d5e2d8; stroke-width: 2.4; }
.score-arc { stroke: #50786a; stroke-width: 3; transform: rotate(-90deg); transform-origin: center; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 16px 0 0; padding-top: 11px; border-top: 1px solid var(--line); }
.stats div { overflow-wrap: anywhere; }
.stats dt, .review-answers dt { color: var(--muted); font-size: .78rem; }
.stats dd, .review-answers dd { margin: 0; font-weight: 670; }
.report-panel { padding: 14px clamp(15px, 4vw, 23px); border-radius: 18px; }
.report-panel h2 { display: flex; align-items: center; gap: 8px; }
.report-panel h2 svg { color: var(--accent); }
.comparison { grid-template-columns: repeat(auto-fit, minmax(min(125px, 100%), 1fr)); margin-top: 9px; }
.compare .muted { margin-top: 8px; }
.muted { color: var(--muted); font-size: .85rem; }
.regions { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .88rem; }
.regions li { display: grid; align-items: center; grid-template-columns: minmax(5.5em, auto) 1fr 2em; gap: 8px; }
meter { width: 100%; min-width: 0; height: 11px; accent-color: var(--accent); }
meter::-webkit-meter-bar { border: 0; background: #e2e2d8; }
meter::-webkit-meter-optimum-value { background: #698171; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-panel p { margin-top: 5px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.copy-row input { flex: 1; min-width: min(210px, 100%); padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf9; color: var(--ink); font-size: .88rem; }
.review-panel { scroll-margin-top: 72px; }
.review-list { margin: 0; padding: 0; list-style: none; }
.review-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.review-list li > div:last-child { min-width: 0; overflow-wrap: anywhere; }
.review-list li:last-child { padding-bottom: 0; }
.review-num { flex: 0 0 1.7em; padding-top: 3px; color: var(--muted); font-size: .81rem; font-variant-numeric: tabular-nums; }
.review-flag { flex: 0 0 auto; width: 63px; height: 42px; display: grid; place-items: center; border-radius: 6px; background: #e8dfd1; }
.review-flag img { max-width: 56px; max-height: 36px; filter: drop-shadow(0 1px 2px #332e2824); }
.review-answers { display: flex; flex-wrap: wrap; gap: 4px 15px; margin: 3px 0; }
.review-answers .right dd { color: var(--accent); }
.review-list p { color: var(--muted); font-size: .86rem; }
.review-list p strong { color: var(--ink); }

.recommendations { min-width: 0; padding-top: 15px; border-top: 1px solid var(--line); }
.recommendations-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.recommendations-heading h2 { font-size: .96rem; }
.recommendations-heading p { color: var(--muted); font-size: .78rem; }
.recommendations ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 9px 0 0; padding: 0; list-style: none; }
.recommendations a { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #ffffff68; text-decoration: none; }
.recommendations a:hover { background: #fff; }
.recommendations a > span { min-width: 0; overflow-wrap: anywhere; }
.recommendations strong, .recommendation-description { display: block; }
.recommendations strong { font-size: .91rem; }
.recommendation-description { color: var(--muted); font-size: .79rem; }

.footer { padding-block: 14px; border-top: 1px solid #4a655618; color: var(--muted); font-size: .8rem; }
.footer .shell { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 16px; }
.footer a { color: inherit; }

@media (max-width: 690px) {
  .intro-panel, .quiz-columns { grid-template-columns: 1fr; gap: 19px; }
  .intro-panel { min-height: 0; }
  .intro-panel > .atlas-art { width: 325px; top: -72px; right: -132px; opacity: .35; }
  .setup { padding: 14px; }
  .quiz-columns { margin-top: 19px; }
  .prompt { text-align: center; }
  .flag-stage, .country-stage { min-height: 0; padding: 12px; }
  .country-stage { min-height: 101px; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 26px); }
  main { padding-top: 17px; }
  .topbar { min-height: 53px; gap: 8px; }
  .nav-title { padding-left: 8px; }
  .language summary { min-height: 44px; font-size: .78rem; }
  .back { min-height: 44px; }
  .panel { border-radius: 21px; }
  .home-hero { grid-template-columns: 1fr; min-height: 245px; border-radius: 23px; }
  .home-hero .atlas-art { position: absolute; inset: auto -96px -68px auto; width: 348px; margin: 0; opacity: .36; }
  .home-copy > .meta { margin-top: 16px; }
  .mode-grid { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { min-height: 83px; gap: 12px; padding: 14px 15px; }
  .mode-card .mode-icon { width: 43px; height: 43px; }
  .mode-card h2 { font-size: 1.07rem; }
  .result-hero { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; }
  .result-copy { grid-area: 1 / 1; align-self: center; }
  .result-hero h1 { font-size: clamp(1.4rem, 5vw, 1.85rem); }
  .result-hero > .stats { grid-column: 1 / -1; }
  .score { grid-area: 1 / 2; width: clamp(82px, 25vw, 116px); gap: 3px; }
  .score strong { font-size: clamp(1.75rem, 7vw, 2.55rem); }
  .score span { font-size: .67rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-actions > button:first-child { flex-basis: 100%; }
  .result-actions > .secondary { flex: 1 1 115px; }
  .review-list li { gap: 7px; }
  .review-flag { width: 51px; height: 35px; }
  .review-flag img { max-width: 46px; max-height: 30px; }
  .recommendations ul { grid-template-columns: 1fr; }
}
@media (max-width: 560px) and (max-height: 680px) {
  .quiz-panel { padding: 14px; }
  .quiz-columns { gap: 12px; margin-top: 14px; }
  .prompt h1 { margin-bottom: 8px; }
  .flag-stage { padding: 10px; }
  .flag-stage img { height: clamp(90px, 19vh, 125px); }
  .answer-grid { gap: 6px; }
  .answer { min-height: 44px; }
}
@media (min-width: 600px) and (max-width: 690px) and (orientation: landscape) {
  .quiz-columns { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .prompt { text-align: left; }
}
@media (max-width: 355px) {
  .nav-title { display: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .header, .panel, .setup, .disclosure-group, .language ul { background: #fbfdfa; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
