:root {
  color-scheme: light;
  --bg: #eef1f0;
  --surface: #ffffff;
  --surface-soft: #f6f8f7;
  --text: #17211f;
  --muted: #66736f;
  --line: #dce3e0;
  --green: #165b4d;
  --green-dark: #0f463b;
  --green-soft: #e9f3f0;
  --coral: #dc5b42;
  --coral-soft: #fff0ec;
  --yellow: #efb83e;
  --yellow-soft: #fff7df;
  --danger: #ad3025;
  --shadow: 0 10px 28px rgba(25, 43, 38, 0.08);
  font-family: "Segoe UI", "Arial", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  color: var(--text);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}

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

button.primary {
  border-color: var(--green);
  color: #ffffff;
  background: var(--green);
}

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

button.full-width {
  width: 100%;
}

[hidden] {
  display: none !important;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.18;
}

h2 {
  margin-bottom: 8px;
  font-size: 21px;
  line-height: 1.3;
}

h3 {
  margin: 22px 0 10px;
  font-size: 17px;
}

p {
  line-height: 1.58;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  background: var(--surface);
}

.top-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 66px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  padding: 0;
  text-align: left;
  background: transparent;
}

.brand-button img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.brand-button span {
  display: grid;
}

.brand-button strong {
  font-size: 17px;
}

.brand-button small {
  color: var(--muted);
  font-size: 11px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.network-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.network-state i,
.setting-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.network-state[data-online="false"] i {
  background: var(--coral);
}

.compact-action {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.app-content {
  min-height: calc(100vh - 66px);
  padding: 24px 16px calc(96px + env(safe-area-inset-bottom));
}

.app-view {
  display: none;
  width: 100%;
}

.app-view.is-active {
  display: block;
}

.view-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.view-heading > div:first-child {
  min-width: 0;
}

.view-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.compact-heading {
  align-items: center;
}

.eyebrow {
  margin-bottom: 5px !important;
  color: var(--green) !important;
  font-size: 12px;
  font-weight: 800;
}

.today-progress {
  flex: 0 0 72px;
  display: grid;
  justify-items: end;
}

.today-progress strong {
  font-size: 30px;
  line-height: 1;
}

.today-progress span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.view-step,
.level-badge,
.lesson-time {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 750;
}

.daily-card,
.task-card,
.passage-card,
.recorder-card,
.result-section,
.install-card,
.assessment-block,
.report-panel,
.progress-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.daily-card {
  padding: 20px;
  border-top: 4px solid var(--green);
  box-shadow: var(--shadow);
}

.daily-card-topline,
.passage-heading,
.recorder-card-heading,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.daily-zh {
  margin: 22px 0 3px;
  color: var(--coral);
  font-size: 15px;
  font-weight: 750;
}

.daily-card > p:not(.daily-zh) {
  color: var(--muted);
}

.step-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.step-progress span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.step-progress i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
}

.step-progress span[data-done="true"] {
  color: var(--green-dark);
}

.step-progress span[data-done="true"] i {
  border-color: var(--green);
  background: var(--green);
}

.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.module-tile {
  display: grid;
  align-content: start;
  justify-items: start;
  min-height: 146px;
  padding: 16px;
  text-align: left;
}

.module-tile strong {
  margin-top: 20px;
  font-size: 16px;
}

.module-tile small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.module-index,
.task-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.module-index.coral,
.task-number.coral {
  background: var(--coral);
}

.module-index.yellow {
  color: #4d3900;
  background: var(--yellow);
}

.module-index.ink {
  background: #34433f;
}

.task-card {
  position: relative;
  margin-bottom: 14px;
  padding: 20px;
}

.task-card .task-number {
  margin-bottom: 18px;
}

.task-card > p {
  color: var(--muted);
}

.listen-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 90px;
  margin: 20px 0;
  border-radius: 8px;
  background: var(--green-soft);
}

.listen-visual span {
  width: 7px;
  border-radius: 4px;
  background: var(--green);
}

.listen-visual span:nth-child(1),
.listen-visual span:nth-child(7) { height: 20px; }
.listen-visual span:nth-child(2),
.listen-visual span:nth-child(6) { height: 38px; }
.listen-visual span:nth-child(3),
.listen-visual span:nth-child(5) { height: 56px; }
.listen-visual span:nth-child(4) { height: 72px; background: var(--coral); }

.listen-controls,
.record-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.listen-status,
.hint {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.question-copy {
  color: var(--text) !important;
  font-size: 17px;
  font-weight: 700;
}

.answer-options {
  display: grid;
  gap: 9px;
}

.answer-options button {
  height: auto;
  min-height: 48px;
  padding: 11px 14px;
  text-align: left;
}

.answer-options button[data-result="correct"] {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
  opacity: 1;
}

.answer-options button[data-result="incorrect"] {
  border-color: var(--coral);
  color: var(--danger);
  background: var(--coral-soft);
  opacity: 1;
}

.comprehension-feedback,
.translation-block,
.focus-block,
.low-confidence-banner,
.upload-state {
  margin-top: 14px;
  border-left: 4px solid var(--green);
  padding: 13px 14px;
  background: var(--green-soft);
}

.comprehension-feedback[data-correct="false"],
.low-confidence-banner,
.upload-state.error {
  border-left-color: var(--coral);
  color: var(--danger);
  background: var(--coral-soft);
}

.comprehension-feedback p,
.translation-block p,
.focus-block p,
.low-confidence-banner p,
.upload-state p {
  margin: 5px 0 0;
}

.next-module {
  margin-top: 6px;
}

.passage-card,
.recorder-card,
.result-section {
  margin-bottom: 14px;
  padding: 20px;
}

.passage-heading h2 {
  margin-bottom: 2px;
  font-size: 23px;
}

.passage-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.chinese-passage {
  margin: 24px 0 0;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 22px;
  line-height: 1.85;
}

.pinyin {
  color: var(--coral);
  line-height: 1.7;
}

.focus-block {
  border-left-color: var(--yellow);
  background: var(--yellow-soft);
}

.vocabulary-list,
.communication-list,
.stack,
.history-list,
.trend-list,
.comparison-list {
  display: grid;
}

.vocabulary-list article,
.communication-list article,
.comparison-list article,
.stack .info-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.vocabulary-list article:last-child,
.communication-list article:last-child,
.comparison-list article:last-child {
  border-bottom: 0;
}

.vocabulary-list span,
.communication-list span {
  display: block;
  margin-top: 3px;
  color: var(--coral);
  font-size: 13px;
}

.vocabulary-list p,
.communication-list p,
.comparison-list p,
.info-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.tag-list span {
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 700;
}

.recorder-card-heading {
  align-items: center;
}

.timer {
  flex: 0 0 auto;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0;
}

#daily-meter,
#meter {
  display: block;
  width: 100%;
  height: 82px;
  margin-top: 16px;
  border-radius: 6px;
  background: #111827;
}

.record-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.record-controls .full-width,
.record-controls #daily-submit-button {
  grid-column: 1 / -1;
}

audio {
  width: 100%;
  margin-top: 14px;
}

.score-hero {
  color: var(--green);
  font-size: 44px;
  line-height: 1;
}

.metric-grid,
.dimension-grid,
.progress-summary,
.feedback-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.metric-grid > div,
.dimension-card,
.progress-summary article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface-soft);
}

.metric-grid span,
.progress-summary span,
.progress-summary small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-grid strong,
.progress-summary strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.dimension-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
}

.dimension-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.score-bar,
.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9e7;
}

.score-bar {
  margin-top: 9px;
}

.score-bar span,
.progress-track span {
  display: block;
  height: 100%;
  background: var(--green);
}

.comparison-list {
  margin-top: 18px;
}

.technical-details,
.secondary-module {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.technical-details summary,
.secondary-module summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 750;
}

pre {
  max-height: 380px;
  overflow: auto;
  border-radius: 6px;
  padding: 13px;
  color: #d8f1e8;
  background: #17211f;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.progress-summary article {
  padding: 16px;
}

.progress-summary strong {
  font-size: 28px;
}

.progress-section {
  margin-top: 14px;
  padding: 18px;
}

.progress-section > h2,
.progress-section .section-title h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

.history-item,
.trend-item,
.breakdown-card {
  display: grid;
  gap: 8px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.history-item:last-child,
.trend-item:last-child,
.breakdown-card:last-child {
  border-bottom: 0;
}

.history-item p,
.trend-item span,
.breakdown-card p,
.breakdown-card span {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.history-item button {
  justify-self: start;
  min-height: 36px;
}

.install-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-top: 4px solid var(--green);
}

.install-card img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
}

.install-card h2,
.install-card p {
  margin-bottom: 0;
}

.install-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.install-card button {
  grid-column: 1 / -1;
}

.settings-list {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
}

.settings-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}

.settings-list article:last-child {
  border-bottom: 0;
}

.settings-list div {
  display: grid;
  gap: 3px;
}

.settings-list span {
  color: var(--muted);
  font-size: 12px;
}

.setting-value {
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--green-dark) !important;
  background: var(--green-soft);
  font-weight: 800;
}

.assessment-block,
.report-panel {
  margin-top: 14px;
  padding: 16px;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.question-layout {
  display: grid;
  gap: 12px;
}

.question-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.question-tab {
  display: grid;
  gap: 3px;
  height: auto;
  min-height: 74px;
  padding: 10px;
  text-align: left;
}

.question-tab small,
.question-tab span {
  color: var(--muted);
  font-size: 11px;
}

.question-tab[data-active="true"] {
  border-color: var(--green);
  background: var(--green-soft);
}

.question-tab[data-done="true"] {
  border-bottom: 3px solid var(--green);
}

.question-card {
  min-width: 0;
}

#question-title {
  font-size: 22px;
  line-height: 1.55;
}

.assessment-history {
  margin-top: 18px;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: calc(66px + env(safe-area-inset-bottom));
  padding: 0 6px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.tab-button {
  position: relative;
  min-width: 0;
  min-height: 64px;
  border: 0;
  border-radius: 0;
  padding: 0 3px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.tab-button::before {
  position: absolute;
  top: 0;
  left: 28%;
  width: 44%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: transparent;
  content: "";
}

.tab-button.is-active {
  color: var(--green-dark);
}

.tab-button.is-active::before {
  background: var(--green);
}

.app-toast {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  left: 16px;
  border-radius: 8px;
  padding: 13px 15px;
  color: #ffffff;
  background: #17211f;
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 13px;
}

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

@media (min-width: 720px) {
  body {
    padding: 20px 0;
  }

  .app-shell {
    width: min(100% - 40px, 760px);
    margin: 0 auto;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .top-bar {
    top: 20px;
  }

  .app-content {
    padding-right: 28px;
    padding-left: 28px;
  }

  .bottom-nav {
    right: auto;
    left: 50%;
    width: min(calc(100% - 40px), 760px);
    transform: translateX(-50%);
  }

  .module-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .feedback-columns {
    grid-template-columns: 1fr 1fr;
  }

  .question-layout {
    grid-template-columns: 190px 1fr;
  }

  .question-list {
    grid-template-columns: 1fr;
  }

  .install-card {
    grid-template-columns: 64px 1fr auto;
  }

  .install-card button {
    grid-column: auto;
  }
}

@media (max-width: 390px) {
  .network-state span,
  .brand-button small {
    display: none;
  }

  .app-content {
    padding-right: 12px;
    padding-left: 12px;
  }

  .module-grid,
  .metric-grid,
  .dimension-grid,
  .feedback-columns {
    grid-template-columns: 1fr;
  }

  .module-tile {
    min-height: 112px;
  }

  .module-tile strong {
    margin-top: 12px;
  }

  .listen-controls button {
    flex: 1 1 100%;
  }

  .passage-heading {
    display: grid;
  }
}

/* Book-based character learning */
.bookshelf-list,
.chapter-list,
.lesson-list,
.book-progress-list {
  display: grid;
  gap: 14px;
}

.current-learning-section {
  margin: 22px 0 18px;
}

.recommended-book-section {
  margin: 0 0 18px;
}

.bookshelf-section-heading h2 {
  margin: 2px 0 10px;
  font-size: 18px;
}

.current-learning-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  padding: 15px 16px;
  background: var(--surface);
}

.current-learning-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.current-learning-copy > span,
.current-learning-copy > small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.current-learning-copy h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.current-learning-copy .book-progress-line {
  margin-top: 5px;
}

.current-learning-card > button {
  min-width: 88px;
}

.recommended-book-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 2px;
}

.recommended-book-card > div {
  min-width: 0;
}

.recommended-book-card span,
.recommended-book-card p {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.recommended-book-card h3 {
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.recommended-book-card button {
  min-width: 88px;
}

.book-category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 18px 0 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  background: #edf1f0;
}

.book-category-tabs button {
  position: relative;
  display: grid;
  place-items: center;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 5px;
  padding: 6px 24px 6px 6px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.book-category-tabs button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.book-category-tabs button small {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  transform: translateY(-50%);
}

.book-category-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--green);
  box-shadow: 0 2px 6px rgba(27, 95, 78, 0.18);
}

.book-category-tabs button[aria-selected="true"] small {
  color: var(--green-dark);
}

.bookshelf-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: -10px 0 22px;
}

.bookshelf-filters label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.bookshelf-filters label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.bookshelf-filters select {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 24px 0 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 11px;
}

.bookshelf-empty {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 8px;
  text-align: center;
}

.bookshelf-empty strong {
  font-size: 16px;
}

.bookshelf-empty p {
  margin: 6px auto 0;
  color: var(--muted);
  font-size: 13px;
}

.book-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 18px;
}

.book-row:last-child {
  border-bottom: 0;
}

.prerequisite-note {
  border-left: 3px solid var(--coral);
  padding-left: 8px;
  color: var(--muted) !important;
  font-size: 11px !important;
}

.book-cover {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  width: 112px;
  min-height: 154px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  padding: 13px;
  color: #fff;
  text-align: left;
  box-shadow: 0 8px 18px rgba(25, 43, 38, 0.14);
}

.book-cover.cover-jade {
  background: #17614f;
}

.book-cover.cover-coral {
  background: #b94e3b;
}

.book-cover.cover-gold {
  color: #2d260d;
  background: #e0ad36;
}

.book-cover.cover-gold small {
  color: rgba(45, 38, 13, 0.8);
}

.book-cover.cover-gold span {
  border-color: rgba(45, 38, 13, 0.42);
}

.book-cover.cover-ink {
  background: #35433f;
}

.book-cover.cover-sky {
  background: #296b8a;
}

.book-cover span {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 10px;
}

.book-cover strong {
  max-width: 100%;
  margin-top: auto;
  overflow-wrap: anywhere;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 22px;
  line-height: 1.25;
}

.book-cover small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  line-height: 1.25;
}

.book-copy {
  min-width: 0;
}

.book-copy h2 {
  margin: 5px 0;
  font-size: 18px;
}

.book-title-line,
.book-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.sample-badge,
.sample-notice span {
  border-radius: 999px;
  padding: 3px 7px;
  color: #174a62;
  background: #dceef5;
  font-size: 10px;
  font-weight: 800;
}

.book-copy p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.book-meta {
  color: var(--coral);
  font-size: 11px;
  font-weight: 750;
}

.book-stat-row {
  margin: -3px 0 10px;
}

.book-stat-row span {
  color: var(--muted);
  font-size: 10px;
}

.book-stat-row span:not(:last-child)::after {
  margin-left: 6px;
  color: #b8c2bf;
  content: "·";
}

.book-copy .sample-note {
  margin: -5px 0 10px;
  color: #296b8a;
  font-size: 11px;
  font-weight: 700;
}

.sample-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.sample-notice p {
  margin: 0;
  color: #296b8a;
  font-size: 11px;
  font-weight: 700;
}

.book-progress-line {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4eae8;
}

.book-progress-line.large {
  height: 8px;
  margin: 18px 0 24px;
}

.book-progress-line span {
  display: block;
  height: 100%;
  background: var(--green);
}

.book-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.book-row-actions small {
  color: var(--muted);
  font-size: 11px;
}

.book-row-actions button,
.back-link {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.back-link {
  margin-bottom: 18px;
  border: 0;
  padding-left: 0;
  color: var(--green-dark);
  background: transparent;
}

.book-detail-head {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.book-detail-head > div:last-child {
  min-width: 0;
}

.book-detail-head h1 {
  overflow-wrap: anywhere;
  font-size: 24px;
}

.book-detail-head p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
}

.chapter-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.chapter-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.chapter-heading span,
.chapter-heading small {
  color: var(--muted);
  font-size: 12px;
}

.chapter-heading h2 {
  margin: 3px 0 0;
  font-size: 17px;
}

.lesson-list {
  gap: 0;
}

.lesson-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 8px 0;
  text-align: left;
}

.lesson-row:last-child {
  border-bottom: 0;
}

.lesson-row > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.lesson-row small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.lesson-row b {
  color: var(--muted);
  font-size: 22px;
}

.lesson-order {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

.lesson-order[data-completed="true"] {
  color: #fff;
  background: var(--green);
}

.lesson-toolbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.lesson-toolbar > button {
  width: 44px;
  padding: 0;
}

.lesson-toolbar > div {
  display: grid;
  min-width: 0;
}

.lesson-toolbar small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-toolbar strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-toolbar > span,
.review-count {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 32px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

.study-track {
  height: 5px;
  margin: 14px 0 8px;
  overflow: hidden;
  background: #e4eae8;
}

.study-track span {
  display: block;
  height: 100%;
  background: var(--coral);
}

.study-step-label {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.scene-stage,
.character-stage,
.quiz-stage,
.lesson-result,
.review-ready,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface);
  text-align: center;
}

.scene-mark {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.scene-chinese {
  margin: 24px auto 6px;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 25px;
  line-height: 1.6;
}

.scene-translation {
  margin: 16px 0;
  color: var(--muted);
}

.dialogue-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.dialogue-heading strong {
  font-size: 17px;
}

.dialogue-heading span {
  color: var(--muted);
  font-size: 12px;
}

.dialogue-list {
  display: grid;
  gap: 0;
  margin: 14px 0 18px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.dialogue-turn {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.dialogue-turn > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.dialogue-turn > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dialogue-turn strong {
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 17px;
}

.dialogue-turn small,
.dialogue-turn p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.dialogue-turn button {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.audio-button {
  min-width: 150px;
}

.lesson-next {
  margin-top: 14px;
}

.character-stage {
  position: relative;
  border-top: 4px solid var(--green);
}

.character-count {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.hanzi-speaker {
  position: relative;
  width: 138px;
  height: 138px;
  min-height: 0;
  border: 0;
  padding: 0;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 88px;
  font-weight: 500;
}

.hanzi-speaker.compact {
  width: 116px;
  height: 116px;
  font-size: 72px;
}

.hanzi-speaker small {
  position: absolute;
  right: 3px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--coral);
  font-size: 10px;
}

.character-pinyin {
  margin: 4px 0 20px;
  color: var(--coral);
  font-size: 24px;
  font-weight: 750;
}

.character-meanings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.character-meanings div + div {
  border-left: 1px solid var(--line);
}

.character-meanings span,
.usage-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.character-meanings strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.usage-section {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
}

.usage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  min-height: 84px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.usage-row:last-child {
  border-bottom: 0;
}

.usage-row > div {
  min-width: 0;
}

.usage-row strong,
.usage-row small {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.usage-row strong {
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 18px;
}

.usage-row small {
  color: var(--coral);
  line-height: 1.45;
}

.usage-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.usage-row > button {
  width: 44px;
  padding: 0;
  color: var(--green-dark);
}

.language-focus-stage,
.shadowing-stage {
  display: grid;
  gap: 14px;
}

.focus-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.focus-heading span {
  display: block;
  margin-bottom: 3px;
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
}

.focus-heading h2 {
  margin: 0;
  font-size: 18px;
}

.focus-heading > small {
  color: var(--muted);
  font-size: 10px;
}

.pattern-heading {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.focus-vocabulary-list,
.pattern-list,
.shadowing-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.focus-vocabulary-list article,
.shadowing-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
}

.focus-vocabulary-list article:last-child,
.pattern-list article:last-child,
.shadowing-list article:last-child {
  border-bottom: 0;
}

.focus-vocabulary-list strong,
.focus-vocabulary-list small,
.focus-vocabulary-list p,
.pattern-title strong,
.pattern-title small,
.pattern-list p,
.pattern-examples strong,
.pattern-examples small,
.pattern-examples span,
.shadowing-list strong,
.shadowing-list small,
.shadowing-list p {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
}

.focus-vocabulary-list strong,
.pattern-title strong,
.shadowing-list strong {
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 17px;
}

.focus-vocabulary-list small,
.pattern-title small,
.shadowing-list small {
  margin-top: 2px;
  color: var(--coral);
  font-size: 11px;
}

.focus-vocabulary-list p,
.pattern-list > article > p,
.shadowing-list p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.focus-vocabulary-list button,
.pattern-title button,
.shadowing-list button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  color: var(--green-dark);
}

.pattern-list article {
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.pattern-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
}

.pattern-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.pattern-examples div {
  min-width: 0;
  border-left: 3px solid var(--green-soft);
  padding: 7px 9px;
  background: #f8faf9;
}

.pattern-examples strong {
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 13px;
}

.pattern-examples small,
.pattern-examples span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.shadowing-list article {
  grid-template-columns: 28px minmax(0, 1fr) 42px;
}

.shadowing-list article > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.listening-options {
  grid-template-columns: 1fr;
}

.quiz-stage {
  padding-top: 18px;
}

.quiz-kind {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 800;
}

.quiz-hanzi {
  margin: 22px 0 12px;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 82px;
  line-height: 1.1;
}

.quiz-audio {
  display: block;
  width: 86px;
  height: 86px;
  margin: 24px auto 15px;
  border-radius: 50%;
  color: #fff;
  background: var(--coral);
  font-size: 24px;
}

.quiz-stage h2 {
  margin-bottom: 18px;
  font-size: 18px;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quiz-options button {
  height: auto;
  min-height: 54px;
  overflow-wrap: anywhere;
}

.quiz-options button[data-result="correct"] {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
  opacity: 1;
}

.quiz-options button[data-result="incorrect"] {
  border-color: var(--coral);
  color: var(--danger);
  background: var(--coral-soft);
  opacity: 1;
}

.quiz-feedback {
  margin-top: 14px;
  border-left: 4px solid var(--green);
  padding: 12px;
  background: var(--green-soft);
  text-align: left;
}

.quiz-feedback[data-correct="false"] {
  border-left-color: var(--coral);
  color: var(--danger);
  background: var(--coral-soft);
}

.quiz-next {
  margin-top: 14px;
}

.lesson-result {
  padding: 32px 22px;
}

.result-symbol {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 30px;
}

.lesson-score {
  display: block;
  margin: 18px 0;
  color: var(--green);
  font-size: 56px;
}

.lesson-score small {
  color: var(--muted);
  font-size: 16px;
}

.lesson-result > p:not(.eyebrow),
.review-ready p,
.empty-state p {
  color: var(--muted);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.empty-state,
.review-ready {
  margin-top: 18px;
}

.status-strip,
.character-status-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.status-strip span,
.character-status-summary article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.status-strip strong,
.character-status-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 22px;
}

.progress-book-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(70px, 1fr) 42px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.progress-book-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.progress-book-row > div:first-child {
  display: grid;
  min-width: 0;
}

.progress-book-row span {
  color: var(--muted);
  font-size: 11px;
}

.progress-book-row b {
  font-size: 12px;
  text-align: right;
}

.practice-list,
.recent-learning-list {
  display: grid;
  gap: 10px;
}

.practice-list > button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 84px;
  padding: 13px;
  text-align: left;
}

.practice-list > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.practice-list small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.practice-list b {
  color: var(--muted);
  font-size: 23px;
}

.practice-index {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.practice-index.coral {
  background: var(--coral);
}

.practice-index.ink {
  background: #35433f;
}

.learning-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.learning-overview article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 10px;
  background: var(--surface-soft);
}

.learning-overview span {
  display: block;
  min-height: 30px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.learning-overview strong {
  display: block;
  margin-top: 5px;
  font-size: 25px;
}

.recent-learning-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.recent-learning-list article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.recent-learning-list div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.recent-learning-list span,
.reading-history-actions {
  color: var(--muted);
  font-size: 11px;
}

.recent-learning-list b {
  flex: 0 0 auto;
  color: var(--green-dark);
  font-size: 12px;
}

.reading-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reading-history-actions strong {
  color: var(--text);
}

@media (min-width: 720px) {
  .book-row {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .book-detail-head {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .book-row > .book-cover,
  .book-detail-head > .book-cover {
    width: 132px;
    min-height: 176px;
  }

  .scene-stage,
  .character-stage,
  .quiz-stage,
  .lesson-result,
  .usage-section,
  .language-focus-stage,
  .shadowing-stage {
    width: min(100%, 580px);
    margin-right: auto;
    margin-left: auto;
  }

  .lesson-next {
    display: block;
    width: min(100%, 580px);
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 390px) {
  .settings-action {
    width: 40px;
    overflow: hidden;
    padding: 0 6px;
    font-size: 0;
  }

  .settings-action::after {
    content: "⚙";
    font-size: 18px;
  }

  .book-row {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .current-learning-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .current-learning-card > button {
    width: 100%;
  }

  .recommended-book-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .recommended-book-card button {
    width: 100%;
  }

  .book-row > .book-cover {
    width: 96px;
    min-height: 142px;
    padding: 10px;
  }

  .book-cover strong {
    font-size: 19px;
  }

  .book-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .book-row-actions {
    align-items: flex-end;
  }

  .book-row-actions button {
    padding: 0 7px;
  }

  .book-detail-head {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .book-detail-head > .book-cover {
    width: 96px;
    min-height: 142px;
  }

  .book-detail-head h1 {
    font-size: 20px;
  }

  .book-detail-head p:not(.eyebrow) {
    display: none;
  }

  .book-detail-head .sample-notice p {
    display: block;
  }

  .scene-stage,
  .character-stage,
  .quiz-stage,
  .lesson-result {
    padding-right: 16px;
    padding-left: 16px;
  }

  .quiz-options,
  .result-actions,
  .pattern-examples {
    grid-template-columns: 1fr;
  }

  .progress-book-row {
    grid-template-columns: minmax(0, 1fr) 64px 36px;
  }

  .learning-overview {
    grid-template-columns: 1fr 1fr;
  }
}
