/* 张卓老师中文水平智能测试系统 — student app (mobile first) */
:root {
  --red: #a61d24; --red-deep: #7e1418; --red-hi: #c2333a; --red-soft: #f6e3df;
  --gold: #c9a04a; --gold-deep: #a47e2c; --gold-ink: #7d5f1c; --gold-lt: #f2d58a; --gold-on-red: #f7e6be; --gold-pale: #fbf1d8;
  --cream: #fff8ec; --paper: #fffdf7; --sunk: #f3e9d4; --sunk-2: #ede0c6; --line: #e8d9bf; --line-soft: #f0e6d2;
  --ink: #2a2422; --muted: #6f625a; --jade: #2e7d6e; --jade-soft: #dcede8; --navy: #1d3557; --bad: #b23a3a; --bad-soft: #f7e0dd;
  --r-sm: 12px; --r: 16px; --r-lg: 22px;
  --sh-1: 0 1px 2px rgba(110, 70, 20, 0.08);
  --sh-2: 0 1px 2px rgba(110, 70, 20, 0.07), 0 8px 22px rgba(110, 70, 20, 0.09);
  --sh-3: 0 2px 4px rgba(110, 70, 20, 0.08), 0 18px 40px rgba(110, 70, 20, 0.16);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1); --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --paper-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .12 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --f-display: "Kanit", "IBM Plex Sans Thai Looped", "Noto Sans Thai", "Leelawadee UI", Thonburi, system-ui, sans-serif;
  --f-body: "IBM Plex Sans Thai Looped", "IBM Plex Sans", "Noto Sans Thai", "Leelawadee UI", Thonburi, system-ui, sans-serif;
  --f-han: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --f-serif-han: "Noto Serif SC", "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --f-py: "IBM Plex Sans", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --col: 560px;
  --gut: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.no-scroll { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--cream);
  background-image: var(--paper-tex);
  color: var(--ink);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
p { margin: 0 0 0.8em; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: var(--red); }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.input:focus-visible { outline: none; }

/* ------------------------------------------------------------------ layout */
.page {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 max(var(--gut), env(safe-area-inset-left)) 0 max(var(--gut), env(safe-area-inset-right));
}
.screen { animation: fade 0.3s ease backwards; }
.page { animation: screen-in 0.36s var(--ease) backwards; }
.boot-page { min-height: 70vh; display: grid; place-items: center; }

.h1 { font: 600 26px/1.3 var(--f-display); margin: 0 0 6px; color: var(--ink); letter-spacing: -0.005em; }
.h2 { display: flex; align-items: center; gap: 8px; font: 600 19px/1.35 var(--f-display); margin: 0 0 8px; color: var(--ink); }
.h2 svg { color: var(--gold-deep); }
.sub { color: var(--muted); font-size: 15.5px; margin: 0 0 20px; }
.lead { font-size: 16.5px; line-height: 1.65; margin: 0 2px 6px; }
.minor { color: var(--muted); font-size: 14px; }
.minor svg { vertical-align: -3px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 20px;
  border-radius: 14px; border: 1.5px solid transparent;
  font: 500 17px/1.2 var(--f-display);
  text-decoration: none; text-align: center;
  transition: transform 0.12s var(--ease), box-shadow 0.2s, background-color 0.2s, opacity 0.2s;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; }
.btn-primary {
  background: linear-gradient(180deg, var(--red-hi), var(--red) 70%);
  border-color: var(--red-deep);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px rgba(166, 29, 36, 0.26);
}
.btn-primary:disabled { box-shadow: none; }
.btn-primary .spin { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--ink); box-shadow: var(--sh-1); }
.btn-text { background: none; color: var(--muted); min-height: 48px; text-decoration: underline; text-underline-offset: 4px; font-family: var(--f-body); font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; font-size: 15.5px; padding: 0 14px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 4px;
  background: none; border: none;
  color: var(--gold-ink); font: 500 15px var(--f-body);
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:disabled { opacity: 0.4; text-decoration: none; }

.cta-bar {
  position: sticky; bottom: 0; z-index: 5;
  margin: 18px calc(var(--gut) * -1) 0;
  padding: 14px var(--gut) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--cream) 62%, rgba(255, 248, 236, 0));
}
.cta-split { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.cta-stack { display: grid; gap: 4px; }

.spin {
  display: inline-block; flex: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(166, 29, 36, 0.18);
  border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
}
.spin-light { width: 22px; height: 22px; border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  margin: 14px 0 18px;
  padding: 28px 22px 26px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 210, 160, 0.22), transparent 60%),
    linear-gradient(170deg, #b0232a 0%, var(--red) 40%, var(--red-deep) 100%);
  color: var(--gold-on-red);
  text-align: center;
  box-shadow: var(--sh-3);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1;
  background-image: var(--paper-tex); opacity: 0.9; mix-blend-mode: soft-light;
}
.hero-frame { position: absolute; top: 7px; right: 7px; bottom: 7px; left: 7px; border: 1px solid rgba(242, 213, 138, 0.6); border-radius: 17px; pointer-events: none; }
.hero-frame::after { content: ""; position: absolute; top: 3px; right: 3px; bottom: 3px; left: 3px; border: 1px solid rgba(242, 213, 138, 0.22); border-radius: 14px; }
.orn { position: absolute; color: var(--gold-lt); opacity: 0.85; pointer-events: none; }
.orn-tl { top: 14px; left: 14px; width: 60px; height: auto; }
.orn-tr { top: 14px; right: 14px; width: 60px; height: auto; }
.orn-bl { bottom: 14px; left: 15px; width: 18px; height: 18px; }
.orn-br { bottom: 14px; right: 15px; width: 18px; height: 18px; }
.ring {
  position: relative;
  width: 148px; height: 148px;
  margin: 2px auto 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #fffdf7 0 52%, #f8ecd0 100%);
  box-shadow:
    0 0 0 3px var(--gold),
    0 0 0 4px rgba(126, 20, 24, 0.5),
    0 0 0 7px rgba(242, 213, 138, 0.28),
    0 12px 26px rgba(40, 5, 5, 0.42);
}
.ring img {
  position: absolute; left: 50%; top: 10px;
  width: 172px; height: auto; max-width: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 4px rgba(60, 10, 10, 0.25));
}
.hero-th { font: 600 24px/1.35 var(--f-display); color: #fff3d9; margin: 0 auto 6px; max-width: 18em; text-wrap: balance; }
.hero-zh { font: 500 16px/1.5 var(--f-serif-han); color: var(--gold-lt); letter-spacing: 0.14em; margin: 0; }

/* ------------------------------------------------------------------ welcome */
.points { list-style: none; margin: 14px 0 0; padding: 0; }
.points li {
  display: grid; grid-template-columns: 18px 1fr; gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 15.5px; line-height: 1.6;
}
.points li:last-child { border-bottom: none; }
.points-dot { width: 16px; height: 16px; margin-top: 4px; color: var(--gold-deep); }
.points-tight li { padding: 8px 0; font-size: 15px; }

.ticket {
  display: flex; align-items: center; gap: 14px;
  margin: 16px 0 6px; padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-2);
}
.ticket-seal, .trail-seal {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 10px;
  background: var(--red); color: var(--gold-on-red);
  font: 700 24px/1 var(--f-serif-han);
  box-shadow: inset 0 0 0 2px rgba(247, 230, 190, 0.55), 0 3px 8px rgba(126, 20, 24, 0.22);
  transform: rotate(-4deg);
}
.ticket-title { font: 600 18px/1.35 var(--f-display); margin: 0; }
.ticket-meta { margin: 2px 0 0; color: var(--red-deep); font-weight: 600; font-size: 15px; }

.card {
  margin: 14px 0;
  padding: 18px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.card-text { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.card-quiet { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.card-warn { background: #fbefe9; border-color: #ecc9c1; }
.card-warn p { margin: 0 0 6px; }
.card-title { display: flex; align-items: center; gap: 8px; font: 600 17px/1.4 var(--f-display); color: var(--bad); }
.card-contact { font-size: 15px; }

.foot { text-align: center; color: var(--muted); font-size: 14px; padding: 26px 0 calc(28px + env(safe-area-inset-bottom)); }
.foot-name { margin: 0 0 2px; }
.foot-note { margin: 10px auto 0; max-width: 30em; font-size: 12.5px; line-height: 1.6; opacity: .85; }
.phones { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; vertical-align: middle; }
.phone { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; color: var(--red); font: 600 15.5px var(--f-py); text-decoration: none; white-space: nowrap; }
.phone:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ steps + form */
.steps { display: flex; gap: 6px; margin: 22px 0 14px; }
.step { height: 5px; width: 26px; border-radius: 3px; background: var(--sunk-2); transition: width 0.3s var(--ease); }
.step.on { width: 44px; background: var(--red); }
.step.past { background: var(--gold); }

.form { margin-top: 8px; }
.field { margin: 0 0 22px; padding: 0; border: none; min-width: 0; }
fieldset.field { margin-inline: 0; }
.field-label { display: block; padding: 0; margin: 0 0 6px; font: 500 16.5px/1.4 var(--f-display); color: var(--ink); }
.field-hint { margin: -2px 0 8px; font-size: 14px; color: var(--muted); }
.field-err { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--bad); font-size: 14.5px; font-weight: 500; }
.field-err svg { flex: none; }
.input {
  width: 100%; height: 54px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px var(--f-body);
  box-shadow: inset 0 1px 2px rgba(110, 70, 20, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: #a39283; }
.input:focus { border-color: var(--gold-deep); box-shadow: 0 0 0 4px rgba(201, 160, 74, 0.25); }
.has-err .input { border-color: var(--bad); }
.has-err .input:focus { box-shadow: 0 0 0 4px rgba(178, 58, 58, 0.18); }

.chips { display: grid; gap: 8px; }
.chips-2 { grid-template-columns: 1fr 1fr; }
.chips-hsk { grid-template-columns: repeat(3, 1fr); }
.chips-hsk .chip:first-child { grid-column: 1 / -1; }
.chip {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-size: 15.5px; line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.chip input { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #d6c3a0; background: var(--paper); transition: all 0.15s; }
.chip.on { border-color: var(--red); background: var(--red-soft); color: var(--red-deep); }
.chip.on .chip-dot { border-color: var(--red); background: radial-gradient(circle, var(--red) 0 4.5px, var(--paper) 5.5px); }
.chip input:focus-visible ~ .chip-dot { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--navy); }
.has-err .chip { border-color: #e2b7b0; }
.chips-hsk .chip { justify-content: center; }
.chips-hsk .chip:first-child { justify-content: flex-start; }

.privacy {
  margin: 6px 0 18px; padding: 16px;
  border-radius: var(--r);
  background: var(--gold-pale);
  border: 1px solid #ecdcae;
  font-size: 14.5px; line-height: 1.65; color: #4a3f33;
}
.privacy p { margin: 0 0 8px; }
.privacy-h { display: flex; align-items: center; gap: 8px; font: 600 16px/1.4 var(--f-display); color: var(--gold-ink); }
.privacy-more summary { display: inline-flex; align-items: center; min-height: 40px; color: var(--gold-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.privacy-more summary::-webkit-details-marker { display: none; }
.privacy-more { margin: -4px 0 6px; }
.privacy-more p { margin: 2px 0 0; }
.privacy-more .phones { justify-content: flex-start; }
.privacy-minor { padding-top: 8px; border-top: 1px dashed #e3cf98; margin: 0 !important; }

.consent {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  font-size: 15.5px; line-height: 1.5; cursor: pointer;
}
.consent input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; top: 14px; left: 14px; cursor: pointer; }
.consent-box { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; border: 2px solid #ccb68e; background: var(--paper); color: transparent; transition: all 0.15s; }
.consent.on { border-color: var(--red); background: var(--red-soft); }
.consent.on .consent-box { background: var(--red); border-color: var(--red); color: #fff; }
.consent input:focus-visible + .consent-box { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--navy); }
.has-err .consent { border-color: var(--bad); }

/* ------------------------------------------------------------------ audio */
.aud {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 76px;
  margin: 2px 0 14px; padding: 12px 14px;
  border-radius: 16px;
  border: 1.5px solid #ead7a4;
  background: linear-gradient(180deg, #fff9ea, var(--gold-pale));
  color: var(--ink); text-align: left;
  box-shadow: var(--sh-1);
}
.aud-btn {
  flex: none; display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--red-hi), var(--red) 58%, var(--red-deep));
  color: #fff;
  box-shadow: inset 0 0 0 2px rgba(242, 213, 138, 0.65), 0 4px 10px rgba(166, 29, 36, 0.28);
}
.aud-btn svg { margin-left: 2px; }
.aud-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.aud-label { font: 500 16.5px/1.35 var(--f-display); }
.aud-bar { display: block; height: 5px; border-radius: 3px; background: rgba(164, 126, 44, 0.2); overflow: hidden; }
.aud-bar i { display: block; height: 100%; background: var(--red); transform-origin: left center; transform: scaleX(0); transition: transform 0.25s linear; }
.aud-sub { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.aud-pip { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--gold-deep); }
.aud-pip.used { background: var(--gold-deep); }
.aud-pip:last-of-type { margin-right: 4px; }
.aud-playing .aud-btn { animation: pulse 1.8s ease-in-out infinite; }
.aud-done { background: var(--sunk); border-color: var(--line); box-shadow: none; }
.aud-done .aud-btn { background: var(--sunk-2); color: var(--gold-ink); box-shadow: none; }
.aud-done .aud-bar i { background: var(--gold); }
.aud-done .aud-label { color: var(--gold-ink); }
.aud-error { background: #fbefe9; border-color: #ecc9c1; }
.aud-error .aud-btn { background: var(--paper); color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); }
.aud-error .aud-label { color: var(--bad); font-size: 15.5px; }
.aud-check { margin: 4px 0 0; }
.aud-played .aud-bar i { background: var(--jade); }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.eq i { width: 4px; height: 100%; border-radius: 2px; background: #fff; transform-origin: bottom; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
.eq i:nth-child(4) { animation-delay: -0.15s; }

/* ------------------------------------------------------------------ test: header */
.tbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 253, 247, 0.95);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.tbar-in { max-width: var(--col); margin: 0 auto; padding: 10px var(--gut) 10px; }
.tbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tbar-pos { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; margin: 0; }
.tbar-block { font: 600 17px/1.3 var(--f-display); color: var(--red); }
.tbar-q { font: 500 15px/1.3 var(--f-display); color: var(--muted); }
.timer {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--sunk); color: var(--ink);
  font-size: 13.5px; line-height: 1.2;
}
.timer svg { color: var(--gold-deep); }
.timer-v { font: 600 16px/1.2 var(--f-py); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.timer.low { background: var(--bad-soft); color: var(--bad); }
.timer.low svg { color: var(--bad); }
.tbar-prog { height: 3px; background: var(--line-soft); overflow: hidden; }
.tbar-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); transform-origin: left center; transition: transform 0.45s var(--ease); }

.pal { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pal-track {
  position: relative; flex: 1; min-width: 0;
  display: flex; justify-content: space-between; gap: 4px;
  list-style: none; margin: 0; padding: 4px 2px;
}
.pal-track::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: 50%; height: 2px; margin-top: -1px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 5px, transparent 5px 10px);
  opacity: 0.55;
}
.pal-track li { flex: 0 1 42px; min-width: 34px; display: flex; justify-content: center; }
.pal-b {
  position: relative; z-index: 1;
  width: 40px; height: 40px; padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font: 600 15px/1 var(--f-py);
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s var(--spring), box-shadow 0.2s;
}
.pal-b.ans { background: var(--red); border-color: var(--red); color: #fff; }
.pal-b.cur { transform: scale(1.08); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--gold-deep); border-color: var(--gold-deep); color: var(--ink); }
.pal-b.cur.ans { color: #fff; border-color: var(--red); }
.pal-flag {
  position: absolute; top: -4px; right: -4px;
  display: grid; place-items: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--gold-deep); color: #fff;
  border: 2px solid var(--paper);
}
.pal-flag svg { margin-left: 1px; }
.pal-many .pal-track {
  justify-content: flex-start; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 8px 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.pal-many .pal-track::-webkit-scrollbar { display: none; }
.pal-many .pal-track::before { display: none; }
.pal-many .pal-track li { flex: none; scroll-snap-align: center; }
.pal-all {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--gold-ink);
}

.offline {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: var(--col); margin: 0 auto;
  padding: 10px var(--gut);
  background: var(--navy); color: #f3f1ea;
  font-size: 14px; line-height: 1.5;
}
.tbar .offline { max-width: none; }
.offline svg { flex: none; margin-top: 1px; color: var(--gold-lt); }
.between-wrap > .offline { max-width: none; }

/* ------------------------------------------------------------------ test: body */
.tbody {
  max-width: var(--col); margin: 0 auto;
  padding: 14px var(--gut) calc(100px + env(safe-area-inset-bottom));
}
.q {
  position: relative;
  padding: 16px 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
.q.from-r { animation: q-in-r 0.28s var(--ease) both; }
.q.from-l { animation: q-in-l 0.28s var(--ease) both; }
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -2px 0 12px; }
.skill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  background: var(--gold-pale); border: 1px solid #ecdcae;
  color: var(--gold-ink);
  font: 500 14px/1.3 var(--f-display);
}
.flag {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 10px; margin-right: -6px;
  border-radius: 10px; border: 1px solid transparent;
  background: none; color: var(--muted);
  font-size: 14px;
}
.flag.on { background: var(--gold-pale); border-color: #ecdcae; color: var(--gold-ink); }
.flag.on svg { color: var(--gold-deep); }
.ins { font: 500 16px/1.6 var(--f-body); color: #3d3430; margin: 0 0 12px; }
.ins-big { font: 600 19px/1.5 var(--f-display); color: var(--ink); margin-bottom: 16px; }
.q-pic {
  display: flex; justify-content: center;
  margin: 4px 0 12px; padding: 14px;
  background: var(--cream);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.q-pic img { width: auto; height: 128px; max-width: 100%; object-fit: contain; }
@media (min-width: 420px) { .q-pic img { height: 150px; } }
.stem-box { margin: 6px 0 4px; }
.py { font: 400 17px/1.4 var(--f-py); color: var(--gold-ink); letter-spacing: 0.02em; margin: 0 0 2px; }
.stem {
  margin: 0;
  font: 500 24px/1.7 var(--f-han);
  color: var(--ink);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.blank {
  display: inline-block; width: 2.6em; height: 1.1em;
  margin: 0 0.12em; vertical-align: -0.2em;
  border-bottom: 2.5px solid var(--red);
  background: linear-gradient(to top, rgba(166, 29, 36, 0.07), transparent 60%);
}
.stem-long { font-size: 21px; line-height: 1.75; }
.nowrap { white-space: nowrap; }
.stem-th { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

.answer { margin-top: 18px; }
.hint { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.hint svg { color: var(--gold-deep); flex: none; }
.ans-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.ans-tools .hint { margin: 0; display: block; }
.hint-count { white-space: nowrap; color: var(--gold-ink); font-weight: 500; }
.clear-btn { margin-top: 8px; color: var(--muted); font-size: 14px; }

.t-han { font: 400 21px/1.5 var(--f-han); }
.t-py { font: 500 19px/1.4 var(--f-py); }
.t-th { font: 400 17px/1.5 var(--f-body); }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 60px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  text-align: left;
  box-shadow: var(--sh-1);
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s var(--ease);
}
.opt:active { transform: scale(0.985); }
.opt-k {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold-pale); border: 1px solid #e8d49f;
  color: var(--gold-ink);
  font: 600 15px/1 var(--f-py);
  transition: all 0.15s;
}
.opt-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt-img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.opt.sel { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.opt.sel .opt-k { background: var(--red); border-color: var(--red); color: #fff; }
.opt-chk { position: relative; border-radius: 9px; }
.opt-tick {
  position: absolute; right: -6px; bottom: -6px;
  display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid #d6c3a0; color: transparent;
  transition: all 0.15s;
}
.opt.sel .opt-tick { background: var(--red-deep); border-color: var(--paper); color: #fff; animation: pop 0.25s var(--spring); }

.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 112px;
  border: 1.5px solid var(--line); border-radius: 18px;
  background: var(--paper);
  font: 600 21px/1.2 var(--f-display);
  box-shadow: var(--sh-1);
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s var(--ease);
}
.tf-btn:active { transform: scale(0.98); }
.tf-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; transition: all 0.15s; }
.tf-T .tf-ic { color: var(--jade); background: var(--jade-soft); }
.tf-F .tf-ic { color: var(--bad); background: var(--bad-soft); }
.tf-btn.sel { border-color: var(--red); background: var(--red-soft); color: var(--red-deep); box-shadow: inset 0 0 0 1px var(--red); }
.tf-btn.sel .tf-ic { background: var(--red); color: #fff; }

.pics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pic {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 136px; aspect-ratio: 1 / 1;
  padding: 18px;
  border: 1.5px solid var(--line); border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--sh-1);
  transition: border-color 0.15s, background-color 0.15s, transform 0.12s var(--ease);
}
.pic:active { transform: scale(0.98); }
.pic img { width: 76%; height: 76%; object-fit: contain; }
.pic .opt-t { flex: none; text-align: center; font-size: 17px; }
.pic-k {
  position: absolute; top: 8px; left: 8px;
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-pale); border: 1px solid #e8d49f;
  color: var(--gold-ink); font: 600 14px/1 var(--f-py);
}
.pic.sel { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red); }
.pic.sel .pic-k { background: var(--red); border-color: var(--red); color: #fff; }
.pic-tick {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--red); color: #fff;
  animation: pop 0.3s var(--spring);
}

.ord-tray {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  min-height: 76px; padding: 12px;
  border: 1.5px dashed var(--gold);
  border-radius: 14px;
  background: var(--cream);
  transition: border-color 0.2s, background-color 0.2s;
}
.ord-tray.full { border-style: solid; border-color: var(--gold-deep); background: var(--gold-pale); }
.ord-ph { color: #9a8a7b; font-size: 14.5px; padding-left: 4px; }
.ord-last { display: inline-flex; align-items: flex-end; gap: 2px; }
.ord-end { align-self: flex-end; font: 400 22px/1 var(--f-han); color: var(--ink, #2b2118); padding: 0 2px 8px 0; }
.ord-bank { display: flex; flex-wrap: wrap; gap: 10px; min-height: 58px; margin-top: 14px; }
.ord-done { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-ink); font-size: 14.5px; }
.seg {
  min-height: 52px; padding: 8px 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--paper);
  font: 400 21px/1.3 var(--f-han);
  box-shadow: 0 2px 0 var(--line), var(--sh-1);
  transition: transform 0.12s var(--ease);
}
.seg:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.seg-in {
  min-height: 48px; padding: 6px 14px;
  background: var(--red); color: #fff;
  border-color: var(--red-deep);
  box-shadow: 0 2px 0 var(--red-deep);
  animation: pop 0.25s var(--spring);
}

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mt-col { display: grid; gap: 8px; align-content: start; }
.mt {
  display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 8px 10px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--paper);
  text-align: left;
  box-shadow: var(--sh-1);
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s var(--ease);
}
.mt-n {
  flex: none; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--sunk); color: var(--muted);
  font: 600 13px/1 var(--f-py);
}
.mt-col:last-child .mt:not(.paired) .mt-n { background: transparent; border: 1.5px dashed #d6c3a0; }
.mt-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mt .t-han { font-size: 19px; line-height: 1.4; }
.mt .t-th { font-size: 15.5px; line-height: 1.4; }
.mt .t-py { font-size: 17px; }
.mt.sel { border-color: var(--gold-deep); background: var(--gold-pale); box-shadow: 0 0 0 3px rgba(201, 160, 74, 0.35); transform: translateY(-1px); }
.mt.sel .mt-n { background: var(--gold-deep); color: #fff; border: none; }
.mt.paired { border-color: var(--pc); background: var(--pcs); }
.mt.paired .mt-n { background: var(--pc); color: #fff; border: none; animation: pop 0.25s var(--spring); }
.pc0 { --pc: #a61d24; --pcs: #f8e7e3; }
.pc1 { --pc: #1d3557; --pcs: #e4e9f1; }
.pc2 { --pc: #2e7d6e; --pcs: #e0efea; }
.pc3 { --pc: #8a5a12; --pcs: #f6ead0; }
.pc4 { --pc: #6b3f7a; --pcs: #efe5f3; }

/* passage */
.psg {
  margin-bottom: 14px;
  background: #fffbf1;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.psg-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 14px; background: var(--sunk); border-bottom: 1px solid var(--line); }
.psg.closed .psg-h { border-bottom: none; }
.psg-t { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; font: 500 15px/1.3 var(--f-display); color: var(--gold-ink); }
.psg-range { font: 400 13.5px var(--f-body); color: var(--muted); }
.psg-tg { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px; background: none; border: none; color: var(--gold-ink); font-size: 14.5px; font-weight: 500; }
.psg-chev { transition: transform 0.2s var(--ease); transform: rotate(90deg); }
.psg-chev.open { transform: rotate(-90deg); }
.psg-body { padding: 12px 16px 6px; font: 400 19px/1.9 var(--f-han); color: var(--ink); }
.psg-body p { margin: 0 0 0.6em; text-indent: 2em; }
.psg-body p.psg-short { text-indent: 0; }
.psg.long .psg-body {
  max-height: 40vh; overflow-y: auto; overscroll-behavior: contain;
  background:
    linear-gradient(#fffbf1 30%, rgba(255, 251, 241, 0)) center top,
    linear-gradient(rgba(255, 251, 241, 0), #fffbf1 70%) center bottom,
    radial-gradient(farthest-side at 50% 0, rgba(110, 70, 20, 0.16), transparent) center top,
    radial-gradient(farthest-side at 50% 100%, rgba(110, 70, 20, 0.16), transparent) center bottom;
  background-repeat: no-repeat;
  background-size: 100% 30px, 100% 30px, 100% 10px, 100% 10px;
  background-attachment: local, local, scroll, scroll;
}

/* footer */
.tfoot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 247, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tfoot-in { position: relative; display: flex; gap: 10px; max-width: var(--col); margin: 0 auto; padding: 0 var(--gut); }
.tfoot .btn { flex: 1; min-width: 0; padding: 0 12px; }
.tfoot .btn-ghost { flex: 0.8; }
.tfoot-save {
  position: absolute; right: var(--gut); top: -40px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
  pointer-events: none;
}
.tfoot-save:empty { display: none; }
.btn-seal { background: linear-gradient(180deg, var(--red), var(--red-deep)); box-shadow: inset 0 0 0 2px rgba(242, 213, 138, 0.45), 0 6px 16px rgba(126, 20, 24, 0.3); }

/* wide screens: passage beside the question */
@media (min-width: 960px) {
  .test.has-psg .tbar-in, .test.has-psg .tbody, .test.has-psg .tfoot-in { max-width: 1160px; }
  .test.has-psg .tbody { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 28px; align-items: start; }
  .test.has-psg .tcol-psg { position: sticky; top: 132px; }
  .test.has-psg .psg-tg { display: none; }
  .test.has-psg .psg.long .psg-body, .test.has-psg .psg-body { max-height: calc(100vh - 270px); overflow-y: auto; }
  .test.has-psg .tfoot-in { justify-content: flex-end; }
  .test.has-psg .tfoot .btn { flex: 0 0 auto; min-width: 210px; }
}

/* ------------------------------------------------------------------ sheet / toast / overlay */
.sheet-wrap {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(42, 36, 34, 0.46);
  animation: fade 0.2s ease both;
}
.sheet {
  width: 100%; max-width: var(--col); max-height: 90vh; overflow: auto;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  background-color: var(--paper);
  background-image: var(--paper-tex);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--sh-3);
  animation: sheet-up 0.3s var(--ease) both;
}
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.sheet-title { font: 600 21px/1.4 var(--f-display); margin: 0 0 10px; color: var(--ink); text-wrap: balance; }
.sheet-body { font-size: 16px; }
.sheet-body > p { margin: 0 0 10px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; padding: 0 12px; }
.warn-line {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--bad-soft); color: #8c2b2b;
  font-weight: 500; line-height: 1.5;
}
.warn-line svg { flex: none; margin-top: 1px; }
.wait-net { line-height: 1.6; }
.wait-net svg { margin-right: 4px; }
.wait-net .link-btn { min-height: 0; padding: 0; margin-left: 6px; font-size: 14px; }
.grid-pal { list-style: none; margin: 14px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 10px; }
.grid-pal .pal-b { width: 100%; height: 48px; border-radius: 12px; }
.grid-pal .pal-b.cur { transform: none; }
.grid-sum { color: var(--muted); font-size: 14.5px; text-align: center; margin: 4px 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--muted); }
.lg { display: inline-block; width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); }
.lg-ans { background: var(--red); border-color: var(--red); }
.lg-flg { background: var(--gold-deep); border-color: var(--gold-deep); }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-width: 480px; border-radius: 24px; padding-bottom: 22px; }
  .sheet-grip { display: none; }
  .sheet-title { margin-top: 8px; }
}

.toast {
  position: fixed; left: 0; right: 0; top: calc(14px + env(safe-area-inset-top)); z-index: 60;
  display: flex; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font: 500 15.5px/1.3 var(--f-display);
  box-shadow: var(--sh-3);
  animation: toast-in 0.4s var(--spring) both;
}
.toast svg { flex: none; }
.toast-warn { background: var(--bad); }

.overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 70;
  display: grid; place-items: center; padding: 16px;
  background: rgba(42, 36, 34, 0.55);
  animation: fade 0.2s ease both;
}
.overlay-card {
  display: grid; justify-items: center; gap: 14px;
  width: 100%; max-width: 360px; padding: 28px 22px;
  background: var(--paper); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); text-align: center; color: var(--red);
}
.overlay-h { margin: 0; font: 600 20px/1.45 var(--f-display); color: var(--ink); }
.overlay-card .minor { margin: 0; }

/* ------------------------------------------------------------------ between + done */
.between { display: flex; flex-direction: column; justify-content: center; min-height: 78vh; text-align: center; padding-top: 24px; }
.between-sub { text-wrap: balance; }
.trail { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 28px; }
.trail-seal { width: 50px; height: 50px; animation: stamp 0.5s var(--spring) both; animation-delay: calc(var(--i) * 90ms); }
.trail-seal:nth-child(even) { transform: rotate(3deg); }
.trail-next {
  display: grid; place-items: center; width: 50px; height: 50px;
  border: 2px dashed var(--gold); border-radius: 10px;
  color: var(--gold-deep); font: 700 24px/1 var(--f-serif-han);
  animation: breathe 2.2s ease-in-out infinite;
}
.between-h { font-size: 27px; color: var(--red-deep); }
.between .timer { margin: 2px auto 0; }
.between .cta-bar { position: static; background: none; margin-top: 28px; }

.done { text-align: center; padding-top: 18px; }
.seal-stage { position: relative; display: grid; place-items: center; height: 230px; }
.seal {
  position: relative; display: grid; place-items: center;
  width: 164px; height: 164px; border-radius: 50%;
  background: conic-gradient(from 210deg, #f7e6be, #c9a04a, #8e6a22, #e8c779, #c9a04a, #a47e2c, #f7e6be);
  box-shadow: 0 0 0 1px rgba(126, 95, 28, 0.4), var(--sh-3);
  animation: stamp 0.7s var(--spring) 0.15s both;
}
.seal-ring { position: absolute; top: 9px; right: 9px; bottom: 9px; left: 9px; border-radius: 50%; border: 1.5px dashed rgba(90, 60, 10, 0.55); }
.seal-core {
  position: relative; display: grid; place-items: center;
  width: 116px; height: 116px; border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, var(--red-hi), var(--red) 55%, var(--red-deep));
  color: var(--gold-on-red);
  font: 700 36px/1 var(--f-serif-han); letter-spacing: 0.08em;
  box-shadow: inset 0 0 0 3px rgba(247, 230, 190, 0.55), inset 0 -6px 14px rgba(0, 0, 0, 0.18);
}
.done-h { margin: 6px auto 12px; max-width: 16em; font: 600 27px/1.35 var(--f-display); color: var(--red-deep); text-wrap: balance; }
.done-p { max-width: 30em; margin: 0 auto 12px; font-size: 16.5px; line-height: 1.7; }
.done-cheer { font: 500 17.5px/1.5 var(--f-display); color: var(--gold-ink); }
.done-cheer span { font-family: var(--f-serif-han); font-weight: 700; color: var(--red); }
.done-contact { margin: 24px 0 0; padding: 14px 16px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
.done-contact p { margin: 0; color: var(--muted); font-size: 14.5px; }
.confetti { position: absolute; left: -16px; right: -16px; top: -30px; height: 320px; overflow: hidden; pointer-events: none; }
.cf { position: absolute; top: -14px; opacity: 0; animation: fall var(--t) cubic-bezier(0.3, 0.6, 0.4, 1) var(--d) forwards; }
.cf-0 { border-radius: 2px; }
.cf-1 { border-radius: 50%; }
.cf-2 { border-radius: 1px; height: 4px !important; }

/* ------------------------------------------------------------------ misc */
.nojs { max-width: 480px; margin: 48px auto; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; text-align: center; font-size: 16px; }

@media (min-width: 600px) {
  .hero { padding: 34px 28px 30px; margin-top: 28px; }
  .hero-th { font-size: 27px; }
  .stem { font-size: 26px; }
  .stem.stem-long { font-size: 22px; }
}
@media (max-width: 400px) {
  .tbody { padding-left: 12px; padding-right: 12px; }
  .q { padding: 14px 14px 18px; }
  .opt { gap: 10px; padding: 10px 12px; }
}
@media (max-width: 359px) {
  :root { --gut: 12px; }
  .timer-l { display: none; }
  .hero-th { font-size: 21px; }
  .tfoot .btn { font-size: 16px; }
}

/* ------------------------------------------------------------------ motion */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes q-in-r { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes q-in-l { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { box-shadow: inset 0 0 0 2px rgba(242, 213, 138, 0.65), 0 0 0 0 rgba(166, 29, 36, 0.35); } 50% { box-shadow: inset 0 0 0 2px rgba(242, 213, 138, 0.65), 0 0 0 9px rgba(166, 29, 36, 0); } }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.7) rotate(-14deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(-4deg); } }
@keyframes breathe { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes fall {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(300px) rotate(var(--r)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .confetti { display: none; }
}

/* pinyin above the characters (HSK 1 items) */
ruby { ruby-position: over; ruby-align: center; margin: 0 0.07em; }
rt { font: 500 0.5em/1.15 var(--f-py); color: var(--gold-ink); letter-spacing: 0; padding-bottom: 1px; }
.has-ruby { line-height: 2.25; }
.stem.has-ruby { line-height: 2.3; }
.opt-t.has-ruby, .mt-t.has-ruby { line-height: 2.1; }
.seg.has-ruby { line-height: 1.9; padding-top: 4px; padding-bottom: 4px; }
.seg.has-ruby rt { color: inherit; opacity: 0.85; }
.psg-body p.has-ruby { line-height: 2.35; }
