/* ===========================================================================
   HSK mock test — hsk-exam.html (2026-10-31)
   ---------------------------------------------------------------------------
   The test, its intro and its score (assets/hsk-exam.js). Colours are the
   theme's (assets/theme.css): the coral of the HSK hub for marks and the
   current section, the theme's correct / wrong / selected for answers.
   The test itself is laid out like the paper (Yi: "做成试卷的样式"): one
   section on one sheet, the questions set in a Song face as the paper prints
   them; what the student types stays in a plain sans.
   =========================================================================== */
:root {
  --hx-zh: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Source Han Sans SC', sans-serif;
  --hx-song: 'Songti SC', 'STSong', 'SimSun', 'Noto Serif SC', 'Noto Serif CJK SC', 'Source Han Serif SC', serif;
  --hx-accent: var(--t-area-hsk-ink);
  --hx-mark: var(--t-area-hsk-mark);
  --hx-tint: var(--t-area-hsk-tint);
  --hx-rule: var(--t-ink-2);
}
.hx-main { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1rem 6rem; font-family: var(--t-ui); color: var(--t-ink); }
@media (min-width: 768px) { .hx-main { padding: 2rem 2rem 7rem; } }
.hx-main [lang="zh-CN"] { font-family: var(--hx-zh); }
.hx-main *, .hx-main *::before, .hx-main *::after { box-sizing: border-box; }
.hx-say { color: var(--t-muted); }

.hx-card {
  background: var(--t-white); border: 1px solid var(--t-line-soft); border-radius: var(--t-r-lg);
  box-shadow: var(--t-sh-1); padding: 1.35rem 1.15rem;
}
@media (min-width: 768px) { .hx-card { padding: 2rem 2.25rem; } }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.hx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.6rem; padding: 0 1.15rem; border-radius: var(--t-r-pill); border: 1px solid transparent;
  background: var(--t-action-fill); color: var(--t-white); font: 600 .95rem/1 var(--t-ui);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.hx-btn:hover { background: var(--t-action-hover); }
.hx-btn.is-ghost { background: var(--t-white); color: var(--t-ink); border-color: var(--t-line); }
.hx-btn.is-ghost:hover { border-color: var(--t-ink); }
.hx-btn.is-small { min-height: 2.15rem; padding: 0 .9rem; font-size: .85rem; }
.hx-btn:disabled { opacity: .45; cursor: default; }
.hx-link { padding: 0; background: none; border: 0; color: var(--hx-accent); font: 500 .85rem var(--t-ui); cursor: pointer; text-decoration: underline; }
.hx-row-btns { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.hx-main button:focus-visible, .hx-main a:focus-visible, .hx-main input:focus-visible, .hx-main textarea:focus-visible {
  outline: 3px solid var(--t-focus); outline-offset: 2px;
}

/* ── Intro ───────────────────────────────────────────────────────────────── */
.hx-kicker { margin: 0 0 .75rem; font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--hx-accent); }
.hx-intro h1, .hx-result h1 { margin: 0; font-family: var(--t-display); font-size: 2.1rem; line-height: 1.15; }
@media (min-width: 768px) { .hx-intro h1, .hx-result h1 { font-size: 2.6rem; } }
.hx-lede { margin: .75rem 0 0; color: var(--t-muted); font-size: 1.05rem; line-height: 1.6; }
.hx-facts { display: grid; gap: .5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .hx-facts { grid-template-columns: repeat(3, 1fr); } }
.hx-facts li { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem; border-radius: var(--t-r-md); background: var(--t-sand); }
.hx-facts b { font-weight: 600; }
.hx-facts span { color: var(--t-muted); font-size: .9rem; }
.hx-h2 { margin: 2rem 0 .8rem; font-family: var(--t-display); font-size: 1.35rem; }
.hx-modes { display: grid; gap: .75rem; }
@media (min-width: 640px) { .hx-modes { grid-template-columns: 1fr 1fr; } }
.hx-mode {
  display: flex; flex-direction: column; gap: .4rem; padding: 1.25rem; text-align: left;
  border: 1.5px solid var(--t-line); border-radius: var(--t-r-md); background: var(--t-white);
  font: inherit; color: inherit; cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.hx-mode:hover { border-color: var(--hx-accent); transform: translateY(-2px); box-shadow: var(--t-sh-2); }
.hx-mode b { font-size: 1.1rem; }
.hx-mode span { color: var(--t-muted); font-size: .92rem; line-height: 1.5; }
.hx-note { margin: 1.25rem 0 0; padding: .85rem 1rem; border-radius: var(--t-r-md); background: var(--t-info-tint); color: var(--t-ink-2); font-size: .92rem; line-height: 1.55; }
.hx-note.is-warn { background: var(--t-warning-tint); }
.hx-resume { margin: 1.5rem 0 0; padding: 1rem 1.15rem; border-radius: var(--t-r-md); background: var(--hx-tint); }
.hx-resume p { margin: 0 0 .75rem; line-height: 1.55; }
.hx-links { margin: 1.5rem 0 0; }
.hx-links a { color: var(--t-muted); }

/* ── The bar: sections, clock, answer sheet ──────────────────────────────── */
.hx-bar {
  position: sticky; top: calc(var(--mw-header-h, 80px) + .5rem); z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .9rem;
  margin: 0 0 1rem; padding: .6rem .8rem; border: 1px solid var(--t-line-soft); border-radius: var(--t-r-md);
  background: rgba(255, 255, 255, .96); box-shadow: var(--t-sh-2); backdrop-filter: blur(6px);
}
.hx-bar-title { color: var(--t-ink); font-size: .95rem; font-weight: 600; text-decoration: none; }
.hx-secs { display: flex; flex-wrap: wrap; gap: .35rem; }
.hx-sec {
  padding: .35rem .8rem; border: 1px solid var(--t-line); border-radius: var(--t-r-pill); background: var(--t-white);
  font: 500 .85rem var(--t-ui); color: var(--t-ink-2); cursor: pointer;
}
.hx-sec small { margin-left: .15rem; color: var(--t-muted); font-variant-numeric: tabular-nums; }
.hx-sec.is-now { border-color: var(--hx-accent); background: var(--hx-tint); color: var(--hx-accent); }
.hx-sec.is-past { opacity: .55; }
.hx-sec:disabled { cursor: default; }
.hx-bar-end { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-left: auto; }
.hx-clock { padding: .3rem .75rem; border-radius: var(--t-r-pill); background: var(--t-sand); font: 600 .9rem var(--t-ui); font-variant-numeric: tabular-nums; }
.hx-clock.is-low { background: var(--t-wrong-tint); color: var(--t-wrong-ink); }
.hx-mode-tag { padding: .3rem .65rem; border-radius: var(--t-r-pill); background: var(--t-sand); color: var(--t-muted); font-size: .8rem; }
.hx-sheet-btn svg, .hx-full-btn svg { width: 15px; height: 15px; }
.hx-full-btn[aria-pressed="true"] { border-color: var(--hx-accent); color: var(--hx-accent); }
/* a phone: one row — the section you are in, the clock, full screen, the answer sheet, finish */
@media (max-width: 640px) {
  .hx-bar { top: calc(var(--mw-header-h, 64px) + .25rem); flex-wrap: nowrap; gap: .4rem; padding: .45rem .5rem; }
  .hx-bar-title, .hx-mode-tag, .hx-sheet-label, .hx-full-label, .hx-clock-sec { display: none; }
  .hx-sec:not(.is-now) { display: none; }
  .hx-sec { padding: .35rem .65rem; white-space: nowrap; }
  .hx-bar-end { flex-wrap: nowrap; gap: .3rem; }
  .hx-bar .hx-sheet-btn, .hx-bar .hx-full-btn { flex: none; width: 2.15rem; padding: 0; }
}

/* Full screen (body.hx-full, assets/hsk-exam.js): the test alone, like the computer-based HSK — the browser's full
   screen where it has one, and the site's header, footer and feedback button out of the way either way. */
body.hx-full .site-header, body.hx-full .site-footer, body.hx-full .mw-fb-fab { display: none !important; }
body.hx-full .hx-main { padding-top: calc(env(safe-area-inset-top, 0px) + .75rem); }
body.hx-full .hx-bar { top: calc(env(safe-area-inset-top, 0px) + .5rem); }

/* ── The paper ───────────────────────────────────────────────────────────── */
/* One section on one sheet (assets/hsk-exam.js drawDoc): the section and its parts headed in the middle, the question
   numbers in the margin, the options in columns, the pictures and the word bank where the paper has them. */
.hx-doc {
  margin: 0; padding: 1.5rem 1rem 2rem; outline: none;
  background: var(--t-white); border: 1px solid var(--t-line-soft); border-radius: var(--t-r-sm);
  box-shadow: 0 1px 2px rgba(22, 33, 28, .05), 0 12px 32px rgba(22, 33, 28, .07);
}
@media (min-width: 768px) { .hx-doc { padding: 2.75rem 3.25rem 3rem; } }
@media (max-width: 640px) { .hx-doc { margin: 0 -.5rem; padding: 1.25rem .75rem 1.75rem; } }
.hx-doc [lang="zh-CN"] { font-family: var(--hx-song); }

.hx-doc-head { margin: 0 0 2rem; text-align: center; }
.hx-doc-kicker { margin: 0; color: var(--t-muted); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; }
.hx-doc-title { margin: .45rem 0 0; font-family: var(--t-display); font-size: 2rem; line-height: 1.15; letter-spacing: .04em; }
.hx-doc-meta { margin: .35rem 0 0; color: var(--t-muted); font-size: .92rem; }
.hx-doc-note {
  max-width: 36rem; margin: 1rem auto 0; padding: .6rem .95rem; border-radius: var(--t-r-md);
  background: var(--t-info-tint); color: var(--t-ink-2); font-size: .9rem; line-height: 1.55;
}

.hx-part + .hx-part { margin-top: 2.75rem; }
.hx-part-head h3 { margin: 0; text-align: center; font-family: var(--t-display); font-size: 1.3rem; letter-spacing: .03em; }
.hx-range { margin: .9rem 0 .4rem; color: var(--t-ink-2); font-size: .95rem; line-height: 1.55; }
.hx-range b { margin-right: .2rem; color: var(--t-ink); font-weight: 700; }
.hx-grp { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; margin: 1.5rem 0 .55rem; padding: .2rem 0; border-radius: var(--t-r-sm); font-size: .95rem; }
.hx-part-head + .hx-blk > .hx-grp:first-child { margin-top: .6rem; }
.hx-grp b { font-weight: 700; }
.hx-grp .hx-hint { margin: 0; }
.hx-grp.is-playing { background: var(--hx-tint); box-shadow: 0 0 0 .45rem var(--hx-tint); }

/* a question: the number in the margin, the question, the flag at the far side */
.hx-q {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) 2.1rem; grid-template-areas: "no main flag";
  column-gap: .35rem; padding: .5rem 0; border-radius: var(--t-r-sm); outline: none;
}
.hx-q > .hx-no { grid-area: no; padding-top: .5rem; font: 500 1rem/1.4 var(--t-ui); font-variant-numeric: tabular-nums; }
.hx-t-char .hx-q > .hx-no { padding-top: 1.05rem; }
.hx-t-read-choice .hx-q > .hx-no, .hx-t-arrange .hx-q > .hx-no, .hx-q.hx-write > .hx-no { padding-top: .35rem; }
.hx-q > .hx-q-main { grid-area: main; min-width: 0; }
.hx-q > .hx-flag { grid-area: flag; justify-self: end; }
.hx-q:focus-visible { box-shadow: 0 0 0 3px var(--t-focus); }
.hx-q.is-playing { background: var(--hx-tint); box-shadow: 0 0 0 .45rem var(--hx-tint); }
.hx-t-read-choice .hx-q, .hx-t-order .hx-q, .hx-q.hx-write { padding: .85rem 0; }
.hx-t-match .hx-q, .hx-t-bank .hx-q { padding: .35rem 0; }
/* a phone: the flag moves into the corner, beside the first line of the question, which leaves it room */
@media (max-width: 640px) {
  .hx-q { position: relative; grid-template-columns: 2.15rem minmax(0, 1fr); grid-template-areas: "no main"; column-gap: .25rem; }
  .hx-q > .hx-flag { position: absolute; top: .45rem; right: -.35rem; }
  .hx-q-main > :first-child { margin-right: 2.1rem; }
  .hx-q .hx-q-line { column-gap: .5rem; }        /* a play button and five letters still share a line */
  .hx-q .hx-bubs { gap: .25rem; }
}
.hx-q-line { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; }
.hx-q-line > .hx-opts { flex: 1 1 18rem; margin: 0; }
.hx-q-line > .hx-text, .hx-q-line > .hx-lines { flex: 1 1 20rem; }

.hx-flag {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0;
  border: 1px solid transparent; border-radius: 50%; background: none; color: var(--t-faint); cursor: pointer;
}
.hx-flag svg { width: 15px; height: 15px; }
.hx-flag:hover { border-color: var(--t-line-soft); color: var(--t-warning-ink); }
.hx-flag.is-on { border-color: var(--t-warning-mark); background: var(--t-warning-tint); color: var(--t-warning-ink); }

.hx-play {
  display: inline-flex; flex: none; align-items: center; gap: .35rem; padding: .3rem .8rem .3rem .55rem;
  border: 1px solid var(--hx-accent); border-radius: var(--t-r-pill); background: var(--hx-tint);
  color: var(--hx-accent); font: 600 .82rem var(--t-ui); cursor: pointer;
}
.hx-play svg { width: 14px; height: 14px; }
.hx-play.is-playing { background: var(--hx-accent); color: var(--t-white); }
.hx-play:disabled { opacity: .5; cursor: default; }
.hx-play.is-playing:disabled { opacity: 1; }
.hx-noaudio { margin: 0; }
.hx-noaudio summary { cursor: pointer; color: var(--hx-accent); font-weight: 500; }

.hx-hint { margin: .2rem 0 .6rem; color: var(--t-muted); font-size: .88rem; line-height: 1.5; }
.hx-text, .hx-statement { margin: 0; font-size: 1.18rem; line-height: 1.85; }
.hx-statement { flex: 1 1 16rem; }
.hx-lines .hx-text + .hx-text { margin-top: .1rem; }
.hx-ask { margin: .35rem 0 .2rem; font-size: 1.15rem; line-height: 1.75; }
.hx-ask.is-prompt { margin-top: .3rem; font-size: 1.1rem; }
.hx-preview { margin: .1rem 0 0; color: var(--t-ink-2); font-size: 1.02rem; line-height: 1.6; }
.hx-preview::before { content: "→ "; color: var(--t-faint); font-family: var(--t-ui); }

/* the true-or-false brackets: （ √ × ） */
.hx-tf { display: inline-flex; flex: none; align-items: center; gap: .3rem; margin-left: auto; color: var(--t-ink-2); font: 400 1.2rem var(--hx-song); }
.hx-tf .hx-bub { font: 600 1.15rem var(--t-ui); }

/* bubbles: a letter (a picture, a reply, a word) or √ / × */
.hx-bubs { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.hx-bub {
  display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0;
  border: 1.5px solid var(--t-line); border-radius: 50%; background: var(--t-white);
  color: var(--t-ink-2); font: 600 .95rem var(--t-ui); cursor: pointer; transition: border-color .12s ease, background .12s ease;
}
.hx-bub:hover:not(:disabled) { border-color: var(--hx-accent); color: var(--hx-accent); }
.hx-bub.is-picked { border-color: var(--t-selected); background: var(--t-selected); color: var(--t-white); }
.hx-bub.is-right { border-color: var(--t-correct-mark); background: var(--t-correct-tint); color: var(--t-correct-ink); }
.hx-bub.is-right.is-picked { background: var(--t-correct-mark); color: var(--t-white); }
.hx-bub.is-wrong { border-color: var(--t-wrong-mark); background: var(--t-wrong-mark); color: var(--t-white); }
.hx-bub:disabled { cursor: default; }

/* the options of a question: all in one row when they fit, two by two, or one under another — the script measures
   (hsk-exam.js columns) and the column gap here is the 1rem it counts with */
.hx-opts { display: grid; gap: .1rem 1rem; margin: .2rem 0 0; }
.hx-opts.is-c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hx-opts.is-c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hx-opts.is-c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hx-opts.is-c1 { grid-template-columns: minmax(0, 1fr); }
.hx-opt {
  display: flex; align-items: flex-start; gap: .55rem; width: 100%; min-height: 2.5rem; padding: .3rem .5rem; text-align: left;
  border: 0; border-radius: var(--t-r-sm); background: none; color: var(--t-ink); font: 400 1.15rem/1.6 var(--hx-song); cursor: pointer;
}
.hx-opt i {
  display: inline-grid; flex: none; place-items: center; width: 1.8rem; height: 1.8rem; margin-top: .02rem;
  border: 1.5px solid var(--t-line); border-radius: 50%; color: var(--t-ink-2); font: 600 .85rem var(--t-ui); font-style: normal;
}
.hx-opt span { padding-top: .08rem; }
.hx-opt:hover:not(:disabled) { background: var(--t-sand); }
.hx-opt:hover:not(:disabled) i { border-color: var(--hx-accent); color: var(--hx-accent); }
.hx-opt.is-picked { background: var(--t-selected-tint); }
.hx-opt.is-picked i { border-color: var(--t-selected); background: var(--t-selected); color: var(--t-white); }
.hx-opt.is-right { background: var(--t-correct-tint); }
.hx-opt.is-right i { border-color: var(--t-correct-mark); color: var(--t-correct-ink); }
.hx-opt.is-right.is-picked i { background: var(--t-correct-mark); color: var(--t-white); }
.hx-opt.is-wrong { background: var(--t-wrong-tint); }
.hx-opt.is-wrong i { border-color: var(--t-wrong-mark); background: var(--t-wrong-mark); color: var(--t-white); }
.hx-opt:disabled { cursor: default; }

.hx-verdict { margin: .5rem 0 0; font-weight: 600; font-size: .95rem; }
.hx-verdict.is-right { color: var(--t-correct-ink); }
.hx-verdict.is-wrong { color: var(--t-wrong-ink); }
.hx-verdict.is-none { color: var(--t-muted); }
.hx-verdict [lang="zh-CN"] { font-weight: 500; }

/* the listening script, shown after Check / in review */
.hx-script { margin: .7rem 0 0; padding: .75rem 1rem; border-radius: var(--t-r-md); background: var(--t-sand); font-size: 1.05rem; line-height: 1.75; }
.hx-script p { margin: 0; }
.hx-script p + p { margin-top: .2rem; }
.hx-script b { color: var(--t-muted); font-weight: 500; }
.hx-script .is-saying { color: var(--hx-accent); }
.hx-grp + .hx-script { margin: 0 0 .5rem; }

/* the explanation (答案解析), under the answer once it shows: English, the Chinese it quotes in the Chinese font.
   The theme's info colours, so it never reads as the red of a wrong answer. */
.hx-why {
  margin: .7rem 0 0; padding: .7rem 1rem .8rem; border-left: 3px solid var(--t-info-mark);
  border-radius: 0 var(--t-r-md) var(--t-r-md) 0; background: var(--t-info-tint);
}
.hx-why-label { margin: 0 0 .2rem; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--t-info-ink); }
.hx-why-text { margin: 0; color: var(--t-ink-2); font-size: 1rem; line-height: 1.7; }
.hx-why-text [lang="zh-CN"] { color: var(--t-ink); font-size: 1.06em; }

/* pictures (HSK 3 listening part 1): framed, the letter beside each, as the paper prints them */
.hx-pics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.25rem; margin: .3rem 0 .8rem; }
@media (max-width: 640px) { .hx-pics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .6rem; } }
.hx-pic { position: relative; display: grid; grid-template-columns: 1.15rem minmax(0, 1fr); gap: .3rem; margin: 0; }
.hx-pic-id { padding-top: .1rem; font: 700 1rem var(--t-ui); }
.hx-pic-frame { overflow: hidden; aspect-ratio: 3 / 2; padding: 3px; border: 1px solid var(--hx-rule); background: var(--t-white); }
.hx-pic-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hx-pic figcaption {
  position: absolute; right: .4rem; bottom: .4rem; padding: .12rem .5rem; border-radius: var(--t-r-pill);
  background: rgba(22, 33, 28, .78); color: var(--t-white); font-size: .74rem;
}
.hx-pic.is-example .hx-pic-frame { opacity: .55; }
.hx-pic.is-used .hx-pic-frame { border-color: var(--t-selected); box-shadow: 0 0 0 2px var(--t-selected); }
.hx-pic-text { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: .5rem .6rem; overflow: auto; background: var(--t-sand); color: var(--t-ink-2); font-size: .82rem; line-height: 1.45; }
.hx-pic-text svg { flex: none; width: 20px; height: 20px; color: var(--t-muted); }

/* the replies to match (HSK 3 reading part 1) and the word bank, ruled like the paper's */
.hx-list { margin: .3rem 0 .7rem; padding: 0; list-style: none; }
.hx-list li { display: flex; gap: .8rem; padding: .12rem 0; font-size: 1.15rem; line-height: 1.75; }
.hx-list b { flex: none; width: 1.2rem; padding-top: .18rem; font: 700 1rem var(--t-ui); }
.hx-bank {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(5.75rem, 1fr)); gap: 1px; margin: .3rem 0 .8rem;
  border: 1px solid var(--hx-rule); background: var(--hx-rule);
}
.hx-chip { display: flex; justify-content: center; align-items: baseline; gap: .45rem; padding: .4rem .5rem; background: var(--t-white); font-size: 1.12rem; }
.hx-chip b { font: 700 .85rem var(--t-ui); }
.hx-chip.is-used { color: var(--t-faint); }
.hx-blank { display: inline-block; min-width: 3.5em; padding: 0 .3em; text-align: center; color: var(--t-selected); }

/* the words of an essay (HSK 5 writing part 2) */
.hx-words { display: flex; flex-wrap: wrap; gap: .45rem; margin: .5rem 0 .3rem; }
.hx-words .hx-chip { padding: .25rem .75rem; border: 1px solid var(--t-line); border-radius: var(--t-r-sm); }
.hx-words .hx-chip.is-ok { border-color: var(--t-correct-edge); background: var(--t-correct-tint); color: var(--t-correct-ink); }

/* passages */
.hx-passage { margin: .15rem 0 .45rem; font-size: 1.15rem; line-height: 1.95; }
.hx-passage p { margin: 0; text-indent: 2em; }
.hx-passage p + p { margin-top: .35rem; }
.hx-q-main > .hx-passage:first-child p:first-child { text-indent: 0; }
.hx-gap {
  display: inline-flex; align-items: baseline; gap: .25em; min-width: 3.2em; margin: 0 .1em; padding: 0 .4em;
  border-bottom: 1.5px solid var(--hx-rule); color: var(--t-selected); text-decoration: none; text-indent: 0;
}
.hx-gap i { font: 600 .75em var(--t-ui); font-style: normal; color: var(--t-muted); }
.hx-gap.is-right { border-color: var(--t-correct-mark); color: var(--t-correct-ink); }
.hx-gap.is-wrong { border-color: var(--t-wrong-mark); color: var(--t-wrong-ink); }

/* HSK 6 (2026-10-31). The sentence a question asks about, underlined as the paper underlines it */
.hx-u { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .32em; }
/* words for the blanks (reading part 2): each blank a line, the words of the set chosen written on it */
.hx-fill {
  display: inline-block; min-width: 3.6em; margin: 0 .15em; padding: 0 .3em; border-bottom: 1.5px solid var(--hx-rule);
  line-height: 1.45; text-align: center; text-indent: 0; color: var(--t-selected);
}
.hx-fill.is-right { border-color: var(--t-correct-mark); color: var(--t-correct-ink); }
.hx-fill.is-wrong { border-color: var(--t-wrong-mark); color: var(--t-wrong-ink); }
/* sentences for the blanks (reading part 3): a sentence in its blank runs on with the line */
.hx-gap.is-sent { display: inline; padding: 0 .3em .1em; }
.hx-gap.is-sent i { margin-right: .3em; }
.hx-sents li.is-used { color: var(--t-faint); }
.hx-sents small { margin-left: auto; padding: .2rem 0 0 .6rem; font: 600 .8rem var(--t-ui); color: var(--t-selected); }
/* the summary (writing): the story to read, then the paper to write on */
.hx-sum-how { margin: .15rem 0 .7rem; }
.hx-story { margin: 0 0 1.1rem; }
.hx-story-box { margin: 0 0 .9rem; }
.hx-story-box summary { cursor: pointer; color: var(--hx-accent); font-weight: 500; }
.hx-story-box .hx-story { margin-top: .5rem; }
.hx-ref .hx-ref-title { text-align: center; font-weight: 600; }
.hx-self-guide { display: block; margin-top: .3rem; color: var(--t-muted); }
.hx-t-error .hx-q > .hx-no, .hx-t-fill .hx-q > .hx-no { padding-top: .35rem; }

/* sentence order (HSK 4 reading part 2) */
.hx-cards { display: grid; gap: .15rem; }
.hx-card-s {
  position: relative; display: flex; align-items: flex-start; gap: .6rem; width: 100%; padding: .3rem 2.6rem .3rem .5rem; text-align: left;
  border: 0; border-radius: var(--t-r-sm); background: none; color: var(--t-ink); font: 400 1.15rem/1.65 var(--hx-song); cursor: pointer;
}
.hx-card-s b { flex: none; width: 1.2rem; padding-top: .12rem; font: 700 1rem var(--t-ui); }
.hx-card-s:hover:not(:disabled) { background: var(--t-sand); }
.hx-card-s.is-picked { background: var(--t-selected-tint); }
.hx-card-s:disabled { cursor: default; }
.hx-pos {
  position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--t-selected); color: var(--t-white); font: 700 .85rem var(--t-ui); font-style: normal;
}
.hx-built { min-height: 2.2rem; margin: .45rem 0 0; padding: .2rem .5rem .25rem; border-bottom: 1.5px solid var(--hx-rule); color: var(--t-ink-2); font-size: 1.05rem; line-height: 1.7; }
.hx-built b { margin-right: .35rem; font: 700 .95rem var(--t-ui); color: var(--t-ink); }

/* build the sentence (writing part 1): the words, then the line to write on */
.hx-pool { display: flex; flex-wrap: wrap; gap: .4rem .55rem; margin: .1rem 0 .55rem; }
.hx-word {
  padding: .3rem .75rem; border: 1px solid var(--t-line); border-radius: var(--t-r-sm); background: var(--t-white);
  color: var(--t-ink); font: 400 1.18rem/1.4 var(--hx-song); cursor: pointer;
}
.hx-word:hover:not(:disabled) { border-color: var(--hx-accent); }
.hx-word.is-in { border-color: var(--t-selected); background: var(--t-selected-tint); }
.hx-word.is-gone { border-style: dashed; color: var(--t-faint); cursor: default; }
.hx-word:disabled { cursor: default; }
.hx-line {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .35rem; min-height: 3rem; margin: 0 0 .3rem; padding: .3rem .2rem .35rem;
  border-bottom: 1.5px solid var(--hx-rule);
}
.hx-line.is-right { border-color: var(--t-correct-mark); background: var(--t-correct-tint); }
.hx-line.is-wrong { border-color: var(--t-wrong-mark); background: var(--t-wrong-tint); }
.hx-line-empty { align-self: center; color: var(--t-faint); font: 400 .88rem var(--t-ui); }
.hx-stop { font: 400 1.25rem var(--hx-song); }

/* write the character (HSK 3 writing part 2): the pinyin over the brackets, as on the paper */
.hx-charline { line-height: 2.7; }
.hx-char { display: inline-flex; flex-direction: column; align-items: center; margin: 0 .1rem; line-height: 1.15; vertical-align: bottom; }
.hx-char i { font: 500 .85rem var(--t-ui); font-style: normal; color: var(--t-ink-2); }
.hx-char input {
  width: 2.5rem; height: 2.3rem; padding: 0; text-align: center; border: 0; border-bottom: 2px solid var(--hx-rule); border-radius: 0;
  background: var(--t-sand); color: var(--t-selected); font: 400 1.4rem/1 var(--hx-zh);
}
.hx-char.is-right input { border-color: var(--t-correct-mark); background: var(--t-correct-tint); color: var(--t-correct-ink); }
.hx-char.is-wrong input { border-color: var(--t-wrong-mark); background: var(--t-wrong-tint); color: var(--t-wrong-ink); }

/* writing part 2: a sentence or a short essay, written on ruled lines */
.hx-write-grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .hx-write-grid { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } }
.hx-write-pic { display: block; width: 100%; max-width: 420px; aspect-ratio: 3 / 2; object-fit: cover; padding: 3px; border: 1px solid var(--hx-rule); background: var(--t-white); }
.hx-write-pic.is-wide { max-width: 460px; margin: .4rem 0 .8rem; }
.hx-keyword { display: inline-block; margin: 0 0 .5rem; padding: 0 .15rem; border-bottom: 2px solid var(--t-line); font-size: 1.35rem; line-height: 1.6; }
.hx-keyword.is-used { border-color: var(--t-correct-mark); color: var(--t-correct-ink); }
.hx-input {
  display: block; width: 100%; padding: 0 .35rem; border: 0; border-top: 1px solid var(--t-line); border-radius: 0;
  color: var(--t-ink); font: 400 1.15rem/2.2rem var(--hx-zh); resize: vertical;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(2.2rem - 1px), var(--t-line) calc(2.2rem - 1px), var(--t-line) 2.2rem) local, var(--t-white);
}
.hx-input:focus { outline: none; }
.hx-main .hx-input:focus-visible { outline: 2px solid var(--hx-accent); outline-offset: 3px; }
.hx-count { margin: .4rem 0 0; color: var(--t-muted); font-size: .85rem; }
.hx-count.is-ok { color: var(--t-correct-ink); }
.hx-ref { margin: 1rem 0 0; padding: .9rem 1.1rem; border-radius: var(--t-r-md); background: var(--t-correct-tint); line-height: 1.85; font-size: 1.08rem; }
.hx-ref p { margin: 0; }
.hx-ref p + p { margin-top: .4rem; }
.hx-ref-label { margin: 0 0 .35rem !important; font: 600 .75rem var(--t-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--t-correct-ink); }
.hx-self { margin: .9rem 0 0; padding: .8rem 1rem; border: 1px solid var(--t-line-soft); border-radius: var(--t-r-md); }
.hx-self p { margin: 0 0 .6rem; font-size: .92rem; }

/* under each part (practice): Check; once checked, how it went */
.hx-part-end { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1rem 0 0; padding: .9rem 0 0; border-top: 1px dashed var(--t-line); }
.hx-part-end .hx-hint { margin: 0; }
.hx-part-end.is-done p { margin: 0; color: var(--t-ink-2); font-size: .95rem; font-weight: 600; }

/* the foot of the sheet: on to the next section, or the end */
.hx-doc-end { margin: 3rem 0 0; padding: 1.5rem 0 0; border-top: 1px solid var(--t-line-soft); text-align: center; }
.hx-doc-end p { margin: 0 0 .9rem; color: var(--t-muted); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.hx-doc-end .hx-row-btns { justify-content: center; }

/* ── Answer sheet ────────────────────────────────────────────────────────── */
.hx-sheet {
  position: fixed; right: 0; top: 0; bottom: 0; z-index: 1200; width: min(380px, 92vw); overflow-y: auto;
  padding: 1.1rem 1.1rem 2rem; background: var(--t-white); box-shadow: var(--t-sh-4);
}
.hx-sheet[hidden] { display: none; }
.hx-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.hx-sheet-head b { font-family: var(--t-display); font-size: 1.2rem; }
.hx-x { width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: var(--t-sand); font-size: 1.3rem; cursor: pointer; }
.hx-sheet h3 { margin: 1.1rem 0 .5rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--t-muted); }
.hx-sheet-key { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; margin: .6rem 0 0; color: var(--t-muted); font-size: .8rem; }
.hx-sheet-key i { display: inline-block; width: .8rem; height: .8rem; margin-right: .25rem; border-radius: 3px; vertical-align: -1px; background: var(--t-sand); border: 1px solid var(--t-line); }
.hx-sheet-key i.is-answered { background: var(--t-selected-tint); border-color: var(--t-selected); }
.hx-sheet-key i.is-flagged { background: var(--t-warning-tint); border-color: var(--t-warning-mark); }
.hx-sheet-key i.is-right { background: var(--t-correct-tint); border-color: var(--t-correct-edge); }
.hx-sheet-key i.is-wrong { background: var(--t-wrong-tint); border-color: var(--t-wrong-edge); }
.hx-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .35rem; }
.hx-grid.is-wide { grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); }
.hx-cell {
  position: relative; height: 2.3rem; border: 1px solid var(--t-line); border-radius: var(--t-r-sm); background: var(--t-white);
  font: 500 .82rem var(--t-ui); color: var(--t-ink-2); cursor: pointer; font-variant-numeric: tabular-nums;
}
.hx-cell.is-answered { border-color: var(--t-selected); background: var(--t-selected-tint); }
.hx-cell.is-flagged::after { content: ""; position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--t-warning-mark); }
.hx-cell.is-right { border-color: var(--t-correct-edge); background: var(--t-correct-tint); color: var(--t-correct-ink); }
.hx-cell.is-wrong { border-color: var(--t-wrong-edge); background: var(--t-wrong-tint); color: var(--t-wrong-ink); }
.hx-cell.is-empty { background: var(--t-sand); color: var(--t-muted); }
.hx-cell:disabled { opacity: .4; cursor: default; }
body.hx-sheet-open::after { content: ""; position: fixed; inset: 0; z-index: 1100; background: rgba(22, 33, 28, .25); }

/* ── Dialog and toast ────────────────────────────────────────────────────── */
.hx-modal { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; padding: 1rem; background: rgba(22, 33, 28, .45); }
.hx-modal[hidden] { display: none; }
.hx-modal-box { width: min(440px, 100%); padding: 1.5rem; border-radius: var(--t-r-lg); background: var(--t-white); box-shadow: var(--t-sh-4); }
.hx-modal-box h2 { margin: 0 0 .5rem; font-family: var(--t-display); font-size: 1.35rem; }
.hx-modal-box p { margin: 0 0 1.2rem; color: var(--t-ink-2); line-height: 1.6; }
.hx-toast {
  position: fixed; left: 50%; bottom: 5.5rem; z-index: 1250; transform: translateX(-50%); max-width: min(520px, 92vw);
  padding: .75rem 1.1rem; border-radius: var(--t-r-md); background: var(--t-ink); color: var(--t-white); box-shadow: var(--t-sh-3); font-size: .95rem;
}
.hx-toast[hidden] { display: none; }

/* ── Score ───────────────────────────────────────────────────────────────── */
.hx-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin: 1rem 0 0; }
.hx-total b { font-family: var(--t-display); font-size: 4rem; line-height: 1; }
.hx-total span { color: var(--t-muted); font-size: 1.3rem; }
.hx-total em { flex-basis: 100%; font-style: normal; font-weight: 600; }
.hx-total em.is-pass { color: var(--t-correct-ink); }
.hx-total em.is-fail { color: var(--t-wrong-ink); }
.hx-sec-scores { display: grid; gap: .75rem; margin: 1.5rem 0 0; }
@media (min-width: 640px) { .hx-sec-scores { grid-template-columns: repeat(3, 1fr); } }
.hx-sec-score { padding: 1rem; border-radius: var(--t-r-md); background: var(--t-sand); }
.hx-sec-score p { margin: 0; color: var(--t-muted); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.hx-sec-score b { display: block; margin: .25rem 0 .5rem; font-family: var(--t-display); font-size: 2rem; }
.hx-sec-score b small { font-family: var(--t-ui); font-size: .9rem; color: var(--t-muted); }
.hx-sec-score span { color: var(--t-muted); font-size: .85rem; }
.hx-meter { height: .45rem; margin: 0 0 .5rem; border-radius: var(--t-r-pill); background: var(--t-track); overflow: hidden; }
.hx-meter i { display: block; height: 100%; border-radius: inherit; background: var(--hx-mark); }
.hx-result .hx-row-btns { margin: 1.5rem 0 0; }
.hx-table-wrap { overflow-x: auto; }
.hx-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.hx-table th, .hx-table td { padding: .55rem .6rem; border-bottom: 1px solid var(--t-line-soft); text-align: left; }
.hx-table th { color: var(--t-muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.hx-table td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* the paper prints as a paper */
@media print {
  .hx-bar, .hx-sheet, .hx-modal, .hx-toast, .hx-flag, .hx-play, .hx-part-end, .hx-doc-end, .hx-doc-note { display: none !important; }
  .hx-doc { max-width: none; padding: 0; border: 0; box-shadow: none; }
}

/* ── The lists of mock tests: hsk-old-mock-tests.html (and hsk-new-mock-tests.html, once it has some) ── */
.hx-hub { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 720px) { .hx-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); } }    /* four levels: two by two */
.hx-level { padding: 1.4rem 1.25rem; border: 1px solid var(--t-line-soft); border-radius: var(--t-r-md); background: var(--t-white); }
.hx-level header h3 { margin: 0; font-family: var(--t-display); font-size: 1.5rem; }
.hx-level header p { margin: .3rem 0 0; color: var(--t-muted); font-size: .9rem; }
.hx-papers { display: grid; gap: .45rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.hx-paper a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name go" "state go";
  gap: .1rem .75rem; align-items: center; padding: .7rem .9rem; border: 1px solid var(--t-line-soft);
  border-radius: var(--t-r-sm); background: var(--t-white); color: var(--t-ink); text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.hx-paper a:hover { border-color: var(--t-area-hsk-ink); background: var(--t-area-hsk-tint); }
.hx-paper b { grid-area: name; font-weight: 600; }
.hx-paper-state { grid-area: state; color: var(--t-muted); font-size: .82rem; }
.hx-paper-go { grid-area: go; color: var(--t-area-hsk-ink); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.hx-paper.is-going .hx-paper-state { color: var(--t-selected); }
.hx-paper.is-pass .hx-paper-state { color: var(--t-correct-ink); }
/* A paper closed to this visitor (assets/access.js, 2026-11-02: the test list only, except the free sample): the lock
   takes the place of "Start"; the row stays a link, and a click opens the sign-in card. */
.hx-paper a.mw-locked .hx-paper-go { display: none; }
.hx-paper a.mw-locked.mw-card::after, .hx-paper a.mw-locked:not(.mw-card)::after {
  position: static !important; grid-area: go; justify-self: end; width: 16px !important; height: 16px !important; margin: 0 !important;
}
.hx-level-note { margin: .8rem 0 0; color: var(--t-muted); font-size: .82rem; line-height: 1.5; }
.hx-hub-note { max-width: 46rem; margin-top: 1.5rem; }
/* A level with no mock tests yet (HSK 1 and 2 of the old HSK, 2026-11-02): its card stays, dashed, saying so. */
.hx-level.is-empty { border-style: dashed; background: transparent; }
.hx-level-empty { margin: .9rem 0 0; color: var(--t-muted); font-size: .9rem; }
