:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --white: #fffdf7;
  --ink: #22231d;
  --muted: #65665d;
  --line: #dedbd0;
  --accent: #b93618;
  --orange: #fa7045;
  --soft: #fce7dc;
  --serif: Georgia, "Songti SC", SimSun, serif;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #a3341c; outline-offset: 4px; }
h1:focus { outline: none; }
a { color: var(--accent); text-underline-offset: .18em; }
p, h1, h2 { margin: 0; }
.shell { width: min(1160px, calc(100% - 88px)); margin-inline: auto; }
.top {
  height: 90px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  background: none;
  color: var(--ink);
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  font: bold 1.55rem var(--serif);
  letter-spacing: -.055em;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  margin-right: 10px;
  font-size: 1.25rem;
}
.orange, .question-mark { color: var(--accent); }
.text-button {
  border: 0;
  background: none;
  padding: .6rem .35rem;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
}
.text-button:hover { color: var(--accent); }
.text-button:disabled { color: #74746c; opacity: .55; }
.method-arrow { margin-left: .3rem; }
.top-actions { display: flex; align-items: center; gap: .9rem; }
.language-button { border: 1px solid var(--line); border-radius: 7px; min-width: 42px; padding: .4rem .45rem; }
.hero {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: clamp(2rem, 5vw, 5.25rem);
  align-items: center;
  padding-block: 70px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--accent);
  font-size: .79rem;
  font-weight: 700;
  letter-spacing: .11em;
}
.eyebrow > span[aria-hidden="true"] { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero h1 {
  font-size: clamp(2.65rem, 5.05vw, 5rem);
  line-height: 1.2;
  letter-spacing: -.075em;
  margin: 19px 0 23px;
}
.question-mark { font-family: var(--serif); }
.lede {
  color: var(--muted);
  font-size: clamp(.98rem, 1.4vw, 1.13rem);
  line-height: 1.9;
  max-width: 26em;
}
.start-row { display: flex; gap: 1rem; align-items: center; margin: 30px 0 15px; flex-wrap: wrap; }
.test-length { display: grid; gap: .4rem; text-align: center; }
.test-capacity { color: var(--muted); font-size: .82rem; }
.primary {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.7rem;
  padding: .75rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-weight: 650;
}
.primary:hover { background: #45463c; }
.primary:disabled { background: #e8e4d9; color: #666259; }
.primary span[aria-hidden] { color: #ff9d7b; font-size: 1.22rem; line-height: 1; }
.primary:disabled span[aria-hidden] { color: inherit; }
.hero-note { color: var(--muted); font-size: .82rem; }

.specimen {
  min-height: 400px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  border-radius: 20px;
  background: var(--orange);
}
.orbit {
  position: absolute;
  border: 1px solid rgba(57, 31, 19, .2);
  border-radius: 50%;
  width: 470px;
  height: 235px;
  transform: rotate(-36deg);
}
.orbit-two { width: 575px; height: 305px; }
.word-card, .card-back {
  width: 75%;
  max-width: 375px;
  aspect-ratio: 1.55;
  border-radius: 13px;
  border: 1px solid #381f15;
}
.card-back {
  position: absolute;
  background: #f36a43;
  transform: translate(1.5%, 2%) rotate(9deg);
}
.word-card {
  position: relative;
  padding: clamp(15px, 2.5vw, 26px);
  transform: rotate(-7deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff8e9;
  box-shadow: 0 10px 25px #6b2c1530;
}
.specimen-top, .specimen-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(.68rem, 1.1vw, .84rem);
}
.specimen-top { font-family: Consolas, monospace; letter-spacing: .1em; }
.specimen-top span:last-child { color: var(--accent); font-size: 1.3rem; line-height: 1; }
.specimen-bottom { border-top: 1px solid #d6cabb; padding-top: .7rem; }
.specimen-word { font: clamp(2.55rem, 6vw, 5.1rem)/1 var(--serif); letter-spacing: -.075em; }
.specimen-word span { color: var(--accent); }
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
  padding-block: 25px;
}
.feature { display: flex; align-items: flex-start; gap: 14px; padding: 6px 22px; }
.feature:first-child { padding-left: 0; }
.feature + .feature { border-left: 1px solid var(--line); }
.feature-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
  font-size: 1.2rem;
}
.feature h2 { font-size: .98rem; margin-bottom: .35rem; }
.feature p { color: var(--muted); font-size: .84rem; line-height: 1.6; }
.footer { padding-block: 28px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; font-size: .76rem; }
.footer > span:first-child { color: var(--ink); font: bold 1.05rem var(--serif); }
.narrow { width: min(100%, 690px); margin-inline: auto; padding-block: 36px 12px; }
.progress-label { display: flex; justify-content: space-between; font-size: .83rem; font-weight: 650; color: var(--muted); }
progress { display: block; width: 100%; height: 8px; border: 0; appearance: none; background: #eae3d5; border-radius: 8px; overflow: hidden; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #eae3d5; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 8px; }
#progress { margin: 12px 0 20px; }
.quiz-card, .result-panel { border: 1px solid var(--line); background: var(--white); border-radius: 16px; padding: clamp(18px, 4.9vw, 36px); }
#quiz-word { font: clamp(2.65rem, 8vw, 4.5rem)/1.15 var(--serif); letter-spacing: -.055em; margin: 8px 0 6px; overflow-wrap: anywhere; }
.quiz-hint { color: var(--muted); font-size: .85rem; margin-bottom: 16px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.choice { display: flex; align-items: center; color: inherit; background: transparent; text-align: left; width: 100%; gap: 12px; min-height: 49px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.choice:hover { background: var(--paper); }
.choice[data-selected] { border-color: var(--accent); background: #fff0e6; }
.choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-key { display: grid; place-items: center; flex: none; width: 27px; height: 27px; border-radius: 5px; background: var(--paper); color: var(--muted); font: .8rem Consolas, monospace; }
.choice[data-selected] .choice-key { background: var(--accent); color: white; }
.choice.unknown { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.quiz-actions, .dialog-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.result-lead { background: var(--soft); border-radius: 16px; padding: clamp(22px, 5.5vw, 44px); }
.result-lead h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-top: 8px; }
.result-range { margin-top: 12px; font: clamp(2.3rem, 7vw, 4.5rem)/1.13 var(--serif); letter-spacing: -.065em; }
#vocabulary-estimate { font-size: clamp(1.85rem, 6.6vw, 3.9rem); letter-spacing: -.035em; }
.result-range small { font: 1rem "Segoe UI", "Microsoft YaHei", sans-serif; }
.result-detail { margin-top: 12px; }
.result-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin: 1.4rem 0;
  padding-block: .9rem;
  border-block: 1px solid #d9c3b9;
}
.result-counts dt { color: var(--muted); font-size: .86rem; }
.result-counts dd { margin: .2rem 0 0; font: 1.4rem var(--serif); }
.result-actions { display: flex; align-items: center; gap: .65rem 1rem; flex-wrap: wrap; }
.result-actions a { text-decoration: none; }
.result-hint { color: var(--muted); margin: 7px 0 18px; font-size: .86rem; line-height: 1.6; }
.result-panel { margin-top: 15px; }
.result-panel h2, .review summary { font-size: 1.1rem; font-weight: 700; }
.result-panel h2 { margin-bottom: 15px; }
.band-row { display: grid; align-items: center; grid-template-columns: 9em 1fr 2em; gap: 12px; padding-block: 8px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.band-row strong { text-align: right; }
.review summary { cursor: pointer; }
.review ol { margin-bottom: 0; padding-left: 1.4rem; }
.review li { padding-block: 8px; }
.review li > span { display: block; font-size: .85rem; color: var(--muted); margin-top: 2px; }
.review-filter { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .75rem; font-size: .85rem; }
.review-filter select {
  min-height: 42px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .45rem .7rem;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}
.review-count { color: var(--muted); font-size: .84rem; margin-top: .65rem; }
.review-word { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; overflow-wrap: anywhere; }
.review-status { color: var(--muted); font-size: .79rem; }
.review-status[data-outcome="wrong"] { color: var(--accent); }
.review li > p { margin-top: .25rem; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.storage-notice { padding-block: 14px 0; color: var(--accent); font-size: .87rem; }
.footer > button { color: var(--muted); }
dialog { width: min(540px, calc(100% - 30px)); max-height: calc(100% - 30px); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--white); padding: clamp(20px, 5vw, 33px); }
dialog::backdrop { background: #22231d99; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { font-size: 1.25rem; }
dialog p { margin-top: 13px; line-height: 1.8; color: var(--muted); }
dialog .source-note { font-size: .85rem; }
.close { border: 0; background: var(--paper); color: var(--ink); border-radius: 7px; width: 36px; height: 36px; font-size: 1.2rem; }

html[lang="en"] .hero h1 { font-family: var(--serif); font-size: clamp(2.35rem, 4.1vw, 4.1rem); letter-spacing: -.06em; }
html[lang="en"] .result-range small { white-space: nowrap; }

@media (max-width: 840px) {
  .shell { width: calc(100% - 40px); }
  .hero { gap: 28px; padding-block: 46px; }
  .specimen { min-height: 330px; }
  .feature { padding-inline: 12px; }
}
@media (max-width: 620px) {
  .top { height: 65px; }
  .brand { font-size: 1.04rem; white-space: nowrap; }
  .brand-icon { width: 28px; height: 28px; flex: none; margin-right: 6px; }
  .top-actions { gap: .3rem; }
  .top-actions .text-button { font-size: .75rem; white-space: nowrap; }
  .method-arrow { display: none; }
  .hero { grid-template-columns: 1fr; padding-block: 35px 25px; }
  .hero h1 { margin-block: 12px 16px; }
  .start-row { margin-top: 20px; }
  .specimen { min-height: 0; aspect-ratio: 1.5; }
  .word-card, .card-back { width: 65%; max-width: 280px; }
  .features { grid-template-columns: 1fr; padding-block: 0; }
  .feature, .feature:first-child { padding: 13px 0; }
  .feature + .feature { border-left: 0; border-top: 1px solid var(--line); }
  .narrow { padding-top: 23px; }
  .band-row { grid-template-columns: 7.5em 1fr 1.7em; gap: 8px; font-size: .75rem; }
}
@media (max-width: 350px) {
  .top { gap: .35rem; }
  .language-button { min-width: 35px; }
  .brand { font-size: .96rem; }
  .footer { gap: .55rem; }
}
@media (forced-colors: active) {
  .choice[data-selected] { outline: 2px solid Highlight; }
}
.answer-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 6px; }
.answer-matrix button { min-height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-size: .82rem; white-space: nowrap; }
.matrix-legend { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; font-size: .8rem; }
.matrix-legend span { border-radius: 4px; padding: .25rem .5rem; }
.answer-matrix [data-outcome="correct"], .matrix-legend [data-outcome="correct"] { background: #def0df; color: #20512a; }
.answer-matrix [data-outcome="wrong"], .matrix-legend [data-outcome="wrong"] { background: #fbe2dc; color: #832e20; }
.answer-matrix [data-outcome="unknown"], .matrix-legend [data-outcome="unknown"] { background: #eeebdf; color: #554c37; }
.answer-matrix [aria-pressed="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.answer-detail { margin-top: 1rem; line-height: 1.65; overflow-wrap: anywhere; }
