html {
  height: auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
  background: #f4eee6;
}

body.page-listening-story {
  display: block;
  height: auto;
  min-height: 100dvh;
  margin: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(230, 0, 18, 0.07), transparent 58%),
    #f4eee6;
  font-family: var(--font);
}

.ls-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: calc(0.85rem + var(--safe-top)) 0 0.7rem;
}

.ls-back {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
}

.ls-back svg {
  width: 1.1rem;
  height: 1.1rem;
}

.ls-topbar-copy {
  flex: 1;
  min-width: 0;
}

.ls-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ls-topbar h1 {
  margin: 0.1rem 0 0;
  font-size: 1.15rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.ls-demo-pill {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  color: #8a3b00;
  background: #ffe8c7;
  font-size: 0.68rem;
  font-weight: 800;
}

.ls-steps {
  display: flex;
  gap: 0.35rem;
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto 1rem;
  padding: 0;
  list-style: none;
}

.ls-steps[hidden] {
  display: none;
}

.ls-steps li {
  flex: 1;
  min-width: 0;
}

.ls-steps button {
  width: 100%;
  min-height: 2rem;
  padding: 0.42rem 0.3rem;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 750;
  text-align: center;
  cursor: pointer;
}

.ls-steps button.is-current {
  color: #fff;
  background: var(--accent);
}

.ls-steps button.is-done {
  color: var(--success);
  background: #e7f6ec;
}

.ls-steps button:hover:not(.is-current) {
  color: var(--ink);
  background: #fff;
}

.ls-main {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: calc(2rem + var(--safe-bottom));
}

.ls-catalog {
  display: grid;
  gap: 0.9rem;
}

.ls-loading,
.ls-error {
  padding: 1.4rem 0;
  color: var(--muted);
}

.ls-card {
  padding: 1.15rem 1.15rem 1.2rem;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: #fffefb;
  box-shadow: 0 12px 32px rgba(20, 16, 16, 0.06);
}

.ls-card h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.ls-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
}

.ls-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  color: var(--text-secondary);
  background: #f4eee6;
  font-size: 0.72rem;
  font-weight: 700;
}

.ls-lead {
  margin: 0.8rem 0 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.ls-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.ls-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.ls-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ls-btn-ghost {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border-soft);
}

.ls-btn-tiny {
  min-height: 2rem;
  padding: 0 0.7rem;
  font-size: 0.78rem;
}

.ls-word-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.ls-word {
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fff;
}

.ls-word strong {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  font-size: 0.98rem;
}

.ls-word .ls-pos {
  margin-left: 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.ls-word .ls-phon {
  display: block;
  margin: 0.15rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.ls-word .ls-zh {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.ls-toggle {
  margin: 0.85rem 0 0;
  color: var(--accent);
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
}

.ls-player {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.3rem;
}

.ls-wave {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.ls-play {
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
}

.ls-progress {
  flex: 1;
  height: 0.42rem;
  overflow: hidden;
  border-radius: 999px;
  background: #efe6db;
  appearance: none;
}

.ls-progress::-webkit-slider-thumb {
  appearance: none;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
}

.ls-time {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.ls-rate {
  display: flex;
  gap: 0.4rem;
}

.ls-rate button.is-on,
.ls-mode button.is-on {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.ls-blind-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.ls-quiz {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.ls-quiz button {
  min-height: 2.7rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ls-quiz button.is-right {
  border-color: #86efac;
  background: #f0fdf4;
}

.ls-quiz button.is-wrong {
  border-color: #fca5a5;
  background: #fef2f2;
}

.ls-sentence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.ls-sentence-head strong {
  font-size: 0.95rem;
}

.ls-bank,
.ls-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 3.2rem;
}

.ls-answer {
  margin-bottom: 0.9rem;
  padding: 0.7rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: #fffaf4;
}

.ls-chunk {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 2.3rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.ls-chunk.has-target {
  border-color: #f3c4c8;
  background: #fff5f6;
}

.ls-chunk.is-used {
  opacity: 0.35;
}

.ls-chunk.is-misplaced {
  border-color: #f87171;
  background: #fef2f2;
}

.ls-feedback {
  margin-top: 0.8rem;
  padding: 0.8rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.ls-feedback.is-ok {
  color: #14532d;
  background: #f0fdf4;
}

.ls-feedback.is-bad {
  color: #7f1d1d;
  background: #fef2f2;
}

.ls-target {
  padding: 0 0.08em;
  border-radius: 0.2em;
  background: #ffe3e6;
}

.ls-lines {
  display: grid;
  gap: 0.7rem;
}

.ls-line {
  width: 100%;
  padding: 0.8rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 14px;
  color: inherit;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.ls-line.is-active {
  border-color: #f3c4c8;
  background: #fff8f8;
}

.ls-line .ls-en {
  display: block;
  font-size: 0.95rem;
  line-height: 1.55;
}

.ls-line .ls-zh {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.ls-speaker {
  display: inline-block;
  margin-bottom: 0.2rem;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.ls-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}

.ls-stat {
  padding: 0.75rem 0.7rem;
  border-radius: 14px;
  background: #fff;
}

.ls-stat b {
  display: block;
  font-size: 1.2rem;
}

.ls-stat span {
  color: var(--muted);
  font-size: 0.72rem;
}

.ls-popover {
  position: fixed;
  z-index: 40;
  width: min(320px, calc(100vw - 2rem));
  padding: 0.9rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 16, 16, 0.16);
}

.ls-popover[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .ls-word-grid,
  .ls-stats {
    grid-template-columns: 1fr 1fr;
  }
  .ls-steps button {
    font-size: 0.62rem;
  }
}
