:root {
  color-scheme: light;
  --reader-bg: var(--qmf-color-background, #fbfbfa);
  --reader-surface: var(--qmf-color-surface, #ffffff);
  --reader-surface-soft: var(--qmf-color-surface-secondary, #f4f4f2);
  --reader-text: var(--qmf-color-text-primary, #1f2328);
  --reader-muted: var(--qmf-color-text-secondary, #667085);
  --reader-faint: var(--qmf-color-text-tertiary, #98a2b3);
  --reader-border: var(--qmf-color-border, #e5e7eb);
  --reader-accent: var(--qmf-color-primary, #465fff);
  --reader-accent-soft: color-mix(in srgb, var(--reader-accent) 10%, transparent);
  --reader-active: #b42318;
  --reader-serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --reader-sans: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --reader-toolbar-height: 58px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --reader-bg: #111315;
  --reader-surface: #181b1f;
  --reader-surface-soft: #20242a;
  --reader-text: #f2f4f7;
  --reader-muted: #a4acb9;
  --reader-faint: #747d8c;
  --reader-border: #2c323a;
  --reader-accent: #8fa2ff;
  --reader-accent-soft: rgba(143, 162, 255, 0.12);
  --reader-active: #ff8a80;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--reader-bg);
  color: var(--reader-text);
  font-family: var(--reader-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--reader-accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reader-site-header {
  position: relative;
  z-index: 80;
}

.reader-shell {
  min-height: 100vh;
  padding-bottom: 96px;
}

.reader-hero {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 34px;
  overflow: hidden;
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    padding 240ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    margin 240ms ease;
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 34px;
  color: var(--reader-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.reader-back:hover {
  color: var(--reader-text);
}

.reader-cover-wrap {
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid var(--reader-border);
  border-radius: 16px;
  aspect-ratio: 16 / 8;
  background: var(--reader-surface-soft);
}

.reader-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-kicker {
  margin-bottom: 10px;
  color: var(--reader-accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reader-hero h1 {
  max-width: 680px;
  margin: 0;
  font-family: var(--reader-serif);
  font-size: clamp(29px, 4vw, 43px);
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.28;
}

.reader-title-vi {
  margin: 12px 0 0;
  color: var(--reader-muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.45;
}

.reader-description {
  max-width: 660px;
  margin: 16px 0 0;
  color: var(--reader-muted);
  font-size: 16px;
  line-height: 1.75;
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  color: var(--reader-faint);
  font-size: 13px;
}

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: var(--reader-toolbar-height);
  border-block: 1px solid var(--reader-border);
  background: color-mix(in srgb, var(--reader-bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
}

.reader-toolbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(740px, calc(100% - 32px));
  min-height: var(--reader-toolbar-height);
  margin: 0 auto;
  padding: 8px 0;
}

.reader-toolbar__cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--reader-border);
  border-radius: 14px;
  background: var(--reader-surface);
  overflow-x: auto;
  scrollbar-width: none;
}

.reader-toolbar__cluster::-webkit-scrollbar {
  display: none;
}

.reader-segment,
.reader-toolbar__group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.reader-segment {
  padding: 2px;
  border-radius: 10px;
  background: var(--reader-surface-soft);
}

.reader-toolbar__divider {
  flex: 0 0 1px;
  align-self: stretch;
  width: 1px;
  margin: 6px 2px;
  background: var(--reader-border);
}

.reader-segment__button,
.reader-toggle,
.reader-action {
  border: 0;
  color: var(--reader-muted);
  background: transparent;
  cursor: pointer;
}

.reader-segment__button,
.reader-toggle,
.reader-action {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
}

.reader-segment__button.is-active {
  color: var(--reader-text);
  background: var(--reader-surface);
}

.reader-toggle:hover,
.reader-action:hover,
.reader-segment__button:hover {
  color: var(--reader-text);
  background: var(--reader-surface-soft);
}

.reader-toggle.is-active {
  color: var(--reader-accent);
  background: var(--reader-accent-soft);
}

.reader-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.reader-quiz {
  --quiz-face: #e21b3c;
  --quiz-edge: #b0152f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 34px;
  padding: 0 14px 4px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  background:
    linear-gradient(180deg, color-mix(in srgb, #ffffff 18%, transparent), transparent 42%),
    var(--quiz-face);
  box-shadow:
    0 4px 0 var(--quiz-edge),
    0 6px 10px rgba(15, 23, 42, 0.16);
  transform: translateY(0);
  transition:
    transform 90ms ease,
    box-shadow 90ms ease,
    background-color 180ms ease,
    filter 120ms ease;
}

.reader-quiz:hover {
  filter: brightness(1.05);
}

.reader-quiz:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 var(--quiz-edge),
    0 2px 4px rgba(15, 23, 42, 0.14);
}

.reader-quiz[data-quiz-tone="0"] {
  --quiz-face: #e21b3c;
  --quiz-edge: #b0152f;
}

.reader-quiz[data-quiz-tone="1"] {
  --quiz-face: #1368ce;
  --quiz-edge: #0f4fa0;
}

.reader-quiz[data-quiz-tone="2"] {
  --quiz-face: #d89e00;
  --quiz-edge: #a87800;
}

.reader-quiz[data-quiz-tone="3"] {
  --quiz-face: #26890c;
  --quiz-edge: #1c6809;
}

.reader-quiz[data-quiz-tone="4"] {
  --quiz-face: #864cbd;
  --quiz-edge: #663694;
}

.reader-quiz__compact {
  display: none;
}

.reader-action.is-playing,
.reader-action.is-active {
  color: var(--reader-accent);
  background: var(--reader-accent-soft);
}

.reader-action--icon {
  width: 34px;
  padding-inline: 0;
  justify-content: center;
}

.reader-toolbar__group--actions {
  margin-left: auto;
}

.reader-shell[data-mode="presentation"] .reader-hero {
  max-height: 0;
  margin: 0 auto;
  padding-block: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  visibility: hidden;
}

.reader-shell[data-mode="presentation"] .reader-site-header,
body[data-reading-mode="presentation"] .reader-site-header {
  display: none;
}

.reader-shell[data-mode="presentation"] {
  height: 100dvh;
  min-height: 0;
  padding-bottom: 0;
}

.reader-shell[data-mode="presentation"] .reader-toolbar {
  border-top: 0;
  position: sticky;
  top: 0;
}

.reader-shell[data-mode="presentation"] .reader-toolbar__inner {
  width: min(1100px, calc(100% - 24px));
}

.reader-shell[data-mode="presentation"] [data-reading-only] {
  display: none;
}

.reader-shell [data-presentation-only].presentation-controls {
  display: none;
}

.reader-shell[data-mode="presentation"] [data-presentation-only].presentation-controls {
  display: flex;
}

.reader-shell[data-mode="presentation"] .reader-toolbar__group--actions {
  margin-left: auto;
}

body[data-reading-mode="presentation"] {
  padding-top: 0 !important;
  overflow: hidden;
}

.reader-shell[data-mode="presentation"] .presentation {
  height: calc(100dvh - var(--reader-toolbar-height));
  min-height: 0;
}

.reader-shell[data-mode="presentation"] .presentation-stage {
  width: min(1100px, calc(100% - 24px));
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  border-top: 0;
  border-radius: 0 0 20px 20px;
}

.reader-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 280px;
  color: var(--reader-muted);
  font-size: 14px;
}

.reader-loading__mark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--reader-border);
  border-top-color: var(--reader-accent);
  border-radius: 50%;
  animation: reader-spin 0.7s linear infinite;
}

@keyframes reader-spin {
  to { transform: rotate(360deg); }
}

.reader-document {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.reader-document,
.presentation {
  view-transition-name: reader-content;
  opacity: 1;
  transform: translateY(0);
}

.reader-document.mode-enter,
.presentation.mode-enter {
  animation: reader-mode-enter 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes reader-mode-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

::view-transition-old(reader-content) {
  animation: reader-mode-out 150ms ease both;
}

::view-transition-new(reader-content) {
  animation: reader-mode-enter 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes reader-mode-out {
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.reader-prose {
  width: min(740px, 100%);
  margin: 0 auto;
  padding: 56px 0 70px;
}

.reader-paragraph {
  margin: 0 0 42px;
}

.reader-sentence {
  position: relative;
  margin: 0 -18px 8px;
  padding: 14px 18px 16px;
  border-radius: 10px;
  transition: background-color 180ms ease, transform 180ms ease;
  scroll-margin-top: calc(var(--reader-toolbar-height) + 24px);
}

.reader-sentence:hover {
  background: var(--reader-surface-soft);
}

.reader-sentence.is-active {
  background: var(--reader-accent-soft);
}

.reader-sentence__play {
  position: absolute;
  top: 20px;
  left: -34px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--reader-faint);
  background: transparent;
  opacity: 0;
  cursor: pointer;
  transition: opacity 160ms ease, color 160ms ease;
}

.reader-sentence:hover .reader-sentence__play,
.reader-sentence.is-active .reader-sentence__play,
.reader-sentence__play:focus-visible {
  opacity: 1;
}

.reader-sentence__play:hover {
  color: var(--reader-accent);
}

.reader-hanzi {
  font-family: var(--reader-serif);
  font-size: clamp(24px, 3.1vw, 31px);
  line-height: 1.7;
  letter-spacing: 0.02em;
}

.reader-word {
  display: inline;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  color: inherit;
  font: inherit;
  background: transparent;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.reader-word:hover {
  color: var(--reader-accent);
  border-bottom-color: currentColor;
}

.reader-word.is-speaking {
  color: var(--reader-active);
}

.reader-pinyin {
  margin-top: 4px;
  color: var(--reader-muted);
  font-size: 15px;
  line-height: 1.65;
}

.reader-translation {
  margin-top: 7px;
  color: var(--reader-muted);
  font-size: 16px;
  line-height: 1.65;
}

.reader-shell[data-show-hanzi="false"] .reader-hanzi,
.reader-shell[data-show-pinyin="false"] .reader-pinyin,
.reader-shell[data-show-translation="false"] .reader-translation {
  display: none;
}

.reader-vocabulary {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 70px 0;
  border-top: 1px solid var(--reader-border);
}

.reader-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.reader-section-heading h2,
.reader-complete h2 {
  margin: 0;
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: -0.025em;
}

.reader-search input {
  width: 210px;
  padding: 9px 12px;
  border: 1px solid var(--reader-border);
  border-radius: 9px;
  color: var(--reader-text);
  background: var(--reader-surface);
}

.reader-vocabulary-list {
  border-top: 1px solid var(--reader-border);
}

.reader-vocabulary-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) minmax(120px, 0.8fr) minmax(180px, 1.6fr) auto;
  gap: 20px;
  align-items: center;
  width: 100%;
  padding: 18px 4px;
  border: 0;
  border-bottom: 1px solid var(--reader-border);
  color: var(--reader-text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.reader-vocabulary-row:hover {
  background: var(--reader-surface-soft);
}

.reader-vocabulary-row__hanzi {
  font-family: var(--reader-serif);
  font-size: 21px;
  font-weight: 650;
}

.reader-vocabulary-row__pinyin,
.reader-vocabulary-row__meaning {
  color: var(--reader-muted);
  font-size: 14px;
}

.reader-vocabulary-row__hsk {
  color: var(--reader-faint);
  font-size: 12px;
  font-weight: 700;
}

.reader-complete {
  width: min(740px, 100%);
  margin: 0 auto;
  padding: 76px 0 20px;
  border-top: 1px solid var(--reader-border);
  text-align: center;
}

.reader-complete p {
  margin: 14px 0 26px;
  color: var(--reader-muted);
}

.reader-primary-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 17px;
  border-radius: 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  background: var(--reader-accent);
}

.presentation {
  min-height: calc(100vh - var(--reader-toolbar-height));
}

.presentation-stage {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  width: min(1100px, calc(100% - 40px));
  min-height: min(660px, calc(100vh - var(--reader-toolbar-height) - 32px));
  margin: 16px auto 0;
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid var(--reader-border);
  border-radius: 20px;
  background: var(--reader-surface);
}

.presentation-focus {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  color: var(--reader-muted);
  background: var(--reader-surface-soft);
  cursor: pointer;
}

.presentation-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  text-align: center;
}

.presentation-count {
  margin-bottom: 32px;
  color: var(--reader-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.presentation-hanzi {
  min-height: 1.5em;
  max-width: 900px;
  font-family: var(--reader-serif);
  font-size: clamp(28px, 3.8vw, 46px);
  font-weight: 620;
  line-height: 1.48;
  letter-spacing: 0.02em;
}

.presentation-token {
  display: inline-block;
  opacity: 0;
  transform: translateY(4px);
  filter: blur(2px);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 180ms ease,
    color 120ms ease;
}

.presentation-token.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.presentation-token.is-speaking {
  color: var(--reader-active);
}

.presentation-pinyin,
.presentation-translation {
  max-width: 760px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 240ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.presentation-pinyin.is-visible,
.presentation-translation.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.presentation-pinyin {
  margin-top: 22px;
  color: var(--reader-muted);
  font-size: clamp(17px, 2.4vw, 23px);
}

.presentation-translation {
  margin-top: 12px;
  color: var(--reader-muted);
  font-size: clamp(16px, 2vw, 20px);
}

.presentation-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 35px;
  margin-top: 26px;
}

.presentation-word {
  padding: 7px 11px;
  border: 1px solid var(--reader-border);
  border-radius: 999px;
  color: var(--reader-muted);
  font-size: 13px;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 200ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.presentation-word.is-visible {
  opacity: 1;
  transform: scale(1);
}

.presentation-timeline {
  height: 3px;
  margin: 18px 0 22px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--reader-border);
}

.presentation-timeline span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--reader-accent);
  transition: width 80ms linear;
}

.presentation-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.presentation-controls button,
.presentation-speed select {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--reader-border);
  border-radius: 10px;
  color: var(--reader-text);
  background: var(--reader-surface);
  cursor: pointer;
}

.presentation-controls .presentation-play {
  min-width: 38px;
  height: 38px;
  border-color: var(--reader-accent);
  color: #ffffff;
  background: var(--reader-accent);
}

.presentation-speed {
  margin-left: 2px;
}

.dictionary-backdrop {
  position: fixed;
  inset: 0;
  z-index: 89;
  background: rgba(0, 0, 0, 0.24);
  opacity: 0;
  transition: opacity 200ms ease;
}

.dictionary-backdrop.is-open {
  opacity: 1;
}

.dictionary-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(420px, 100%);
  height: 100dvh;
  border-left: 1px solid var(--reader-border);
  color: var(--reader-text);
  background: var(--reader-surface);
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dictionary-drawer.is-open {
  transform: translateX(0);
}

.dictionary-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 22px;
  border-bottom: 1px solid var(--reader-border);
  font-size: 13px;
  font-weight: 700;
}

.dictionary-drawer__header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: var(--reader-muted);
  font-size: 24px;
  background: transparent;
  cursor: pointer;
}

.dictionary-drawer__body {
  height: calc(100dvh - 58px);
  padding: 34px 26px;
  overflow: auto;
}

.dictionary-word {
  margin: 0;
  font-family: var(--reader-serif);
  font-size: 48px;
  line-height: 1.2;
}

.dictionary-traditional,
.dictionary-pinyin {
  margin-top: 8px;
  color: var(--reader-muted);
}

.dictionary-pinyin {
  font-size: 18px;
}

.dictionary-meaning {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--reader-border);
  font-size: 17px;
  line-height: 1.65;
}

.dictionary-example {
  margin-top: 24px;
  padding: 16px;
  border-radius: 10px;
  color: var(--reader-muted);
  line-height: 1.65;
  background: var(--reader-surface-soft);
}

.dictionary-actions {
  display: flex;
  gap: 8px;
  margin-top: 28px;
}

.dictionary-actions button {
  padding: 10px 14px;
  border: 1px solid var(--reader-border);
  border-radius: 9px;
  color: var(--reader-text);
  font-weight: 650;
  background: var(--reader-surface);
  cursor: pointer;
}

.dictionary-actions button:first-child {
  border-color: var(--reader-accent);
  color: #ffffff;
  background: var(--reader-accent);
}

.reader-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  max-width: 340px;
  padding: 12px 16px;
  border: 1px solid var(--reader-border);
  border-radius: 10px;
  color: var(--reader-text);
  font-size: 14px;
  background: var(--reader-surface);
}

body.reader-focus .reader-site-header,
body.reader-focus .reader-hero,
body.reader-focus .reader-toolbar {
  display: none;
}

body.reader-focus .reader-shell {
  padding: 0;
}

body.reader-focus .presentation-stage {
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
}

@media (max-width: 760px) {
  body[data-reading-mode="presentation"] {
    --reader-toolbar-height: 100px;
  }

  .reader-shell[data-mode="presentation"] .reader-toolbar__inner {
    width: calc(100% - 12px);
    min-height: var(--reader-toolbar-height);
    padding: 6px 0;
  }

  .reader-shell[data-mode="presentation"] .reader-toolbar__cluster {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 34px 40px;
    gap: 4px 8px;
    overflow: visible;
  }

  .reader-shell[data-mode="presentation"] .reader-segment {
    grid-column: 1;
    grid-row: 1;
  }

  .reader-shell[data-mode="presentation"] .presentation-controls {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
  }

  .reader-shell[data-mode="presentation"] .reader-toolbar__group--actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
  }

  .reader-shell[data-mode="presentation"] .reader-toolbar__divider {
    display: none;
  }

  .reader-hero {
    width: min(100% - 32px, 760px);
    padding: 20px 0 24px;
  }

  .reader-back {
    margin-bottom: 24px;
  }

  .reader-toolbar__inner {
    width: min(100% - 20px, 740px);
    min-height: 52px;
    padding: 8px 0;
  }

  .reader-toolbar__cluster {
    gap: 6px;
    padding: 3px;
  }

  .reader-segment__button,
  .reader-toggle,
  .reader-action {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .reader-action__label {
    display: none;
  }

  .reader-quiz__label {
    display: none;
  }

  .reader-quiz__compact {
    display: inline;
  }

  .reader-quiz {
    min-width: 36px;
    min-height: 32px;
    padding: 0 10px 3px;
    font-size: 12px;
  }

  .reader-action--icon,
  .reader-action {
    width: 32px;
    padding-inline: 0;
    justify-content: center;
  }

  .reader-document {
    width: min(100% - 32px, 1120px);
  }

  .reader-prose {
    padding-top: 38px;
  }

  .reader-sentence {
    margin-inline: -8px;
    padding-inline: 8px;
  }

  .reader-sentence__play {
    display: none;
  }

  .reader-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .reader-search input {
    width: 100%;
  }

  .reader-vocabulary-row {
    grid-template-columns: 0.8fr 1fr;
    gap: 8px 14px;
  }

  .reader-vocabulary-row__meaning {
    grid-column: 1 / -1;
  }

  .presentation-stage {
    width: 100%;
    height: calc(100dvh - var(--reader-toolbar-height));
    min-height: 0;
    margin: 0;
    padding: 0;
    border-inline: 0;
    border-radius: 0;
  }

  .presentation-card {
    min-height: 0;
    padding: 40px 18px 12px;
  }

  .presentation-count {
    margin-bottom: 18px;
  }

  .presentation-hanzi {
    max-width: 100%;
    font-size: clamp(25px, 8vw, 36px);
    line-height: 1.42;
  }

  .presentation-pinyin {
    margin-top: 16px;
    font-size: clamp(15px, 4.8vw, 19px);
  }

  .presentation-translation {
    margin-top: 8px;
    font-size: clamp(14px, 4.3vw, 17px);
  }

  .presentation-words {
    margin-top: 18px;
  }

  .presentation-controls {
    gap: 7px;
  }

  .presentation-speed {
    margin-left: 4px;
  }
}

@media (max-width: 430px) {
  .reader-toolbar__divider {
    display: none;
  }

  .reader-toggle[data-layer="hanzi"] {
    display: none;
  }

  .reader-toolbar__group--actions {
    margin-left: 0;
  }

  .presentation-controls button,
  .presentation-speed select {
    min-width: 32px;
    height: 32px;
    padding-inline: 7px;
  }

  .presentation-controls .presentation-play {
    min-width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
