:root {
  color-scheme: light;
  --ink: #17322a;
  --muted: #607169;
  --paper: #fffdf8;
  --wash: #f3eee2;
  --line: #d9d2c4;
  --primary: #176b51;
  --primary-dark: #0e503c;
  --accent: #d77a2f;
  --danger: #a7382f;
  --focus: #1f78d1;
  --shadow: 0 18px 50px rgb(50 59 52 / 10%);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--wash);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgb(226 148 78 / 12%), transparent 30rem),
    linear-gradient(180deg, #faf7ef, var(--wash));
}

button,
input {
  font: inherit;
}

button {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.75rem 1.2rem;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

button:hover:not(:disabled) {
  border-color: var(--primary);
}

button:focus-visible,
input:focus-visible {
  outline: 4px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-button {
  background: var(--primary);
  color: white;
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-dark);
}

.danger-button {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

#app {
  min-height: 100vh;
}

.cover-screen {
  min-height: 100vh;
  padding: clamp(1rem, 3vw, 2.5rem);
  background-image:
    linear-gradient(90deg, rgb(255 253 248 / 96%) 0%, rgb(255 253 248 / 80%) 38%, rgb(255 253 248 / 8%) 68%),
    url("/assets/product-cover/life-chinese-reader-cover.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.cover-shell {
  display: grid;
  grid-template-rows: minmax(25rem, 1fr) auto;
  gap: clamp(1.5rem, 4vh, 3rem);
  width: min(1240px, 100%);
  min-height: calc(100vh - clamp(2rem, 6vw, 5rem));
  margin: 0 auto;
}

.cover-copy {
  align-self: center;
  width: min(42rem, 58%);
  padding: clamp(1rem, 2vw, 2rem) 0;
}

.cover-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.2rem;
  color: var(--primary-dark);
  font-size: 0.92rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.cover-brand::before {
  width: 1.8rem;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.cover-brand span {
  color: var(--accent);
}

.cover-copy h1 {
  max-width: 9ch;
  margin-bottom: 1.4rem;
  font-size: clamp(3.3rem, 7vw, 6.8rem);
  letter-spacing: -0.04em;
}

.cover-copy h1 span {
  display: block;
  color: var(--primary);
}

.cover-lead {
  max-width: 32em;
  margin-bottom: 1.8rem;
  color: #304b42;
  font-size: clamp(1.08rem, 1.8vw, 1.35rem);
  font-weight: 650;
  line-height: 1.85;
}

.cover-actions {
  display: flex;
  align-items: center;
  gap: 1rem 1.25rem;
  flex-wrap: wrap;
}

.cover-actions p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.cover-start {
  min-width: 10.5rem;
  min-height: 58px;
  padding-inline: 2rem;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgb(23 107 81 / 24%);
  font-size: 1.12rem;
}

.cover-guide {
  display: grid;
  grid-template-columns: minmax(10rem, 0.8fr) minmax(0, 3.2fr);
  gap: 1.5rem;
  border: 1px solid rgb(23 50 42 / 10%);
  border-radius: 26px;
  padding: clamp(1.2rem, 2.5vw, 2rem);
  background: rgb(255 253 248 / 92%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.cover-guide-heading h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.cover-guide-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.cover-guide-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-content: start;
  min-width: 0;
  padding: 0.2rem clamp(0.7rem, 1.5vw, 1.25rem);
  border-left: 1px solid var(--line);
}

.cover-step-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #e8f5ef;
  color: var(--primary-dark);
  font-weight: 900;
}

.cover-guide-list strong {
  display: block;
  margin: 0.2rem 0 0.4rem;
  color: var(--ink);
}

.cover-guide-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.app-shell {
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.app-header-tools {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.app-header-tools p {
  margin: 0;
}

.quiet-button {
  min-height: 42px;
  padding: 0.55rem 0.9rem;
  border-color: var(--line);
  background: rgb(255 253 248 / 72%);
  color: var(--primary-dark);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
}

h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.step-indicator {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  background: rgb(255 253 248 / 70%);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.step-number {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink);
  font-size: 0.95rem;
  flex: none;
}

.step-item.is-current {
  border-color: var(--primary);
  background: #e8f5ef;
  color: var(--primary-dark);
}

.step-item.is-current .step-number {
  background: var(--primary);
  color: white;
}

.step-item.is-done .step-number {
  background: var(--primary-dark);
  color: white;
}

.wizard-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem -0.25rem 0;
  padding: 0.9rem 0.25rem;
  background: var(--wash);
  box-shadow: 0 -8px 20px rgb(50 59 52 / 8%);
}

.wizard-nav button {
  min-width: 9rem;
  min-height: 56px;
  border: 2px solid var(--line);
  box-shadow: 0 6px 18px rgb(50 59 52 / 14%);
  font-size: 1.1rem;
}

.wizard-nav .primary-button {
  margin-left: auto;
  border-color: var(--primary);
  padding: 0.75rem 2.2rem;
}

.wizard-nav.is-final {
  position: static;
}

.preview-doc {
  display: grid;
  gap: 1.25rem;
  margin: 1rem 0;
}

.preview-page {
  border: 1px solid var(--line);
  border-radius: 8px 22px 22px 8px;
  padding: 1.2rem 1.4rem;
  background:
    linear-gradient(90deg, rgb(215 122 47 / 16%) 0 6px, transparent 6px),
    var(--paper);
  box-shadow: var(--shadow);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.55rem;
}

.preview-head h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.15rem;
}

.text-button {
  min-height: 0;
  border: none;
  padding: 0.25rem 0.5rem;
  background: transparent;
  color: var(--primary);
  font-size: 0.9rem;
  text-decoration: underline;
}

.preview-lines {
  display: grid;
  margin: 0;
  padding: 0 0 0 0.4rem;
  list-style: none;
  counter-reset: line;
}

.preview-line {
  counter-increment: line;
  border-bottom: 1px dashed var(--line);
}

.preview-line:last-child {
  border-bottom: none;
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 0.2rem;
  cursor: pointer;
}

.preview-label::before {
  content: counter(line);
  flex: none;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--wash);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.line-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.preview-line.is-excluded .line-text {
  color: var(--muted);
  text-decoration: line-through;
}

.preview-line.is-excluded .preview-label::before {
  background: transparent;
}

.preview-label input {
  width: 1.4rem;
  height: 1.4rem;
  margin-left: auto;
  accent-color: var(--primary);
}

.panel {
  border: 1px solid rgb(23 50 42 / 8%);
  border-radius: 24px;
  padding: clamp(1rem, 3vw, 1.75rem);
  background: rgb(255 253 248 / 88%);
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 1rem;
}

.book-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.book-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-height: 0;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.55rem 0.9rem;
  background: white;
  box-shadow: 0 2px 8px rgb(50 59 52 / 6%);
  font-weight: 700;
  line-height: 1.3;
}

.book-tab:hover:not(:disabled) {
  border-color: var(--primary);
}

.book-tab.is-active {
  border-color: var(--primary);
  background: #e8f5ef;
  box-shadow: 0 4px 14px rgb(23 107 81 / 18%);
}

.book-tab-name {
  font-size: 0.98rem;
}

.book-tab-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.book-tab.is-active .book-tab-meta {
  color: var(--primary-dark);
}

.lesson-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.1rem;
  background: white;
}

.lesson-section + .lesson-section {
  margin-top: 1.1rem;
}

.lesson-section h3 {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lesson-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: border-color 120ms, background 120ms;
}

.lesson-card:hover {
  border-color: var(--primary);
}

.lesson-card:has(input:checked) {
  border-color: var(--primary);
  background: #eef8f3;
  box-shadow: 0 4px 12px rgb(23 107 81 / 14%);
}

.lesson-card input {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--primary);
}

.lesson-title {
  min-width: 0;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.lesson-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.selection-summary {
  margin: 1rem 0 0;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  background: #f7fbf8;
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.5;
}

.mode-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.15rem;
  background: white;
  box-shadow: 0 3px 10px rgb(50 59 52 / 8%);
  text-align: left;
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
}

.mode-card:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.mode-card[aria-pressed="true"] {
  border-color: var(--primary);
  background: #e8f5ef;
  box-shadow: 0 8px 22px rgb(23 107 81 / 20%);
}

.mode-card-radio {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.15rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: white;
}

.mode-card[aria-pressed="true"] .mode-card-radio {
  border-color: var(--primary);
  background: radial-gradient(circle, var(--primary) 0 45%, white 50%);
}

.mode-card-body {
  display: grid;
  gap: 0.35rem;
}

.mode-card-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.mode-card-desc {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
}

.pace-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.pace-card {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 1rem 0.8rem;
  background: white;
  box-shadow: 0 3px 10px rgb(50 59 52 / 8%);
  transition: border-color 120ms, box-shadow 120ms;
}

.pace-card:hover:not(:disabled) {
  border-color: var(--primary);
}

.pace-card[aria-pressed="true"] {
  border-color: var(--primary);
  background: #e8f5ef;
  box-shadow: 0 8px 22px rgb(23 107 81 / 20%);
}

.pace-name {
  font-size: 1.35rem;
  font-weight: 800;
}

.pace-dot {
  color: var(--muted);
}

.pace-time {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.pace-card[aria-pressed="true"] .pace-time {
  color: var(--primary-dark);
}

.setting-label {
  display: block;
  margin: 1rem 0 0.5rem;
  font-weight: 800;
}

.setting-hint,
.privacy-note,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.custom-time {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.75rem 0;
}

.custom-time input {
  width: 7rem;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  background: white;
  color: var(--ink);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.8rem 0;
  font-weight: 700;
}

.toggle-row input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--primary);
}

.background-picker {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.background-picker legend {
  margin-bottom: 0.2rem;
  padding: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.background-picker .setting-hint {
  margin-bottom: 0.75rem;
}

.background-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.background-choice {
  min-width: 0;
  cursor: pointer;
}

.background-choice-body {
  display: grid;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 4px 14px rgb(50 59 52 / 8%);
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
}

.background-choice:hover .background-choice-body {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
  transform: translateY(-1px);
}

.background-choice input:focus-visible + .background-choice-body {
  outline: 4px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 3px;
}

.background-choice input:checked + .background-choice-body {
  border-color: var(--primary);
  box-shadow: 0 7px 18px rgb(23 107 81 / 18%);
}

.background-choice-preview {
  display: block;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
  background-color: var(--paper);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.background-choice-random {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  background: var(--line);
}

.background-choice-random > span {
  min-width: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.background-choice-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 800;
}

.background-choice-radio {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: white;
}

.background-choice input:checked + .background-choice-body .background-choice-radio {
  border-color: var(--primary);
  background: radial-gradient(circle, var(--primary) 0 42%, white 48%);
}

.download-hero {
  display: grid;
  gap: 1rem;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.hero-download,
.hero-start {
  min-height: 84px;
  border-radius: 20px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero-download {
  border: 2px solid var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 28px rgb(23 107 81 / 28%);
}

.hero-download:not(.is-secondary):hover:not(:disabled) {
  background: var(--primary-dark);
}

.hero-download.is-secondary {
  min-height: 60px;
  border-color: var(--line);
  background: white;
  color: var(--primary-dark);
  box-shadow: none;
  font-size: 1rem;
}

.hero-download.is-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  background: #eef8f3;
}

.hero-start {
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary-dark);
}

.hero-start:not(:disabled) {
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 28px rgb(23 107 81 / 28%);
}

.hero-start:not(:disabled):hover {
  background: var(--primary-dark);
}

.status-message {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.status-message.error {
  color: var(--danger);
}

.capability-warning {
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: #fff4e7;
  color: #784118;
  font-weight: 700;
}

.failure-badge {
  margin-left: auto;
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  background: #fbe8e5;
  color: var(--danger);
  font-size: 0.78rem;
}

.failure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

progress {
  width: 100%;
  height: 1rem;
  accent-color: var(--primary);
}

.failure-list {
  margin-bottom: 0.75rem;
  color: var(--danger);
}

.reading-screen {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr;
  padding: clamp(1rem, 3vw, 2.5rem);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgb(255 253 248 / 18%), rgb(255 253 248 / 18%)),
    var(--reading-background-image, none);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 1.5rem;
  min-height: 0;
}

.reading-main {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
}

.reading-sidebar {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1rem;
  min-height: 0;
}

.queue-panel,
.sound-panel {
  border: 1px solid rgb(23 50 42 / 8%);
  border-radius: 20px;
  padding: 1rem 1.1rem;
  background: rgb(255 253 248 / 92%);
  box-shadow: var(--shadow);
}

.queue-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.queue-panel h2,
.sound-panel h2 {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.queue-list {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  min-height: 0;
}

.queue-item {
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.45;
}

.queue-item.is-done {
  color: var(--muted);
}

.queue-item.is-current {
  background: #e8f5ef;
  outline: 2px solid var(--primary);
  color: var(--primary-dark);
  font-weight: 800;
}

.queue-lesson {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sound-meter {
  overflow: hidden;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--wash);
  border: 1px solid var(--line);
}

.sound-meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--muted);
  transition: width 90ms linear;
}

.sound-meter-fill.is-voice {
  background: var(--primary);
}

.sound-meter-text {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.reading-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 700;
}

.reading-stage {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2rem;
  min-height: 55vh;
  text-align: center;
}

.reading-status {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.5rem, 4vw, 3.2rem);
  font-weight: 800;
}

.current-sentence {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(3.2rem, 10vw, 8.5rem);
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-wrap: balance;
}

.reading-error {
  color: var(--danger);
  font-size: 1.25rem;
  font-weight: 700;
}

.reading-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
}

.reading-controls button {
  min-height: 64px;
  font-size: 1.05rem;
}

.ended-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
  text-align: center;
}

.ended-screen .panel {
  width: min(560px, 100%);
}

.boot-status {
  padding: 2rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 820px) {
  .cover-copy {
    width: min(36rem, 78%);
  }

  .cover-guide {
    grid-template-columns: 1fr;
  }

  .cover-guide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 1.25rem;
  }

  .cover-guide-list li:nth-child(odd) {
    border-left: 0;
  }

  .background-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reading-layout {
    grid-template-columns: 1fr;
  }

  .reading-sidebar {
    grid-template-rows: auto auto;
  }

  .queue-list {
    max-height: 14rem;
  }

  .reading-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .cover-screen {
    padding: 0.75rem;
    background-image:
      linear-gradient(180deg, rgb(255 253 248 / 88%) 0%, rgb(255 253 248 / 72%) 48%, rgb(255 253 248 / 94%) 70%),
      url("/assets/product-cover/life-chinese-reader-cover.webp");
    background-position: 67% top;
  }

  .cover-shell {
    grid-template-rows: auto auto;
    min-height: calc(100vh - 1.5rem);
  }

  .cover-copy {
    width: 100%;
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 22px;
    background: rgb(255 253 248 / 86%);
    backdrop-filter: blur(8px);
  }

  .cover-copy h1 {
    font-size: clamp(2.8rem, 16vw, 4.2rem);
  }

  .cover-lead {
    font-size: 1rem;
    line-height: 1.7;
  }

  .cover-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cover-actions p {
    text-align: center;
  }

  .cover-guide {
    gap: 1rem;
    padding: 1.25rem;
  }

  .cover-guide-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .cover-guide-list li {
    padding: 0;
    border-left: 0;
  }

  .app-shell {
    width: min(100% - 1rem, 1160px);
    padding-top: 1rem;
  }

  .app-header,
  .wizard-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .step-indicator {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-cards,
  .pace-cards,
  .hero-actions,
  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .background-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reading-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
