:root {
  --ink: #17233c;
  --muted: #677188;
  --paper: #f7f3ea;
  --panel: #fffdf8;
  --line: #ded8cb;
  --soft-line: #ece7dd;
  --accent: #e96853;
  --accent-deep: #b83f31;
  --accent-soft: #fae5dc;
  --accent-faint: #fff4ee;
  --teal: #217d78;
  --gold: #c48620;
  --shadow: 0 18px 55px rgba(34, 42, 60, 0.09);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(233, 104, 83, 0.11), transparent 25rem),
    radial-gradient(circle at 94% 34%, rgba(33, 125, 120, 0.09), transparent 26rem),
    var(--paper);
}

body[data-theme="teal"] {
  --accent: #278680;
  --accent-deep: #17605c;
  --accent-soft: #dcefeb;
  --accent-faint: #f0faf7;
}

body[data-theme="gold"] {
  --accent: #cf8b23;
  --accent-deep: #94600f;
  --accent-soft: #f6e8c8;
  --accent-faint: #fffaee;
}

body[data-theme="blue"] {
  --accent: #5578c6;
  --accent-deep: #315496;
  --accent-soft: #e4eafa;
  --accent-faint: #f2f5fc;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select,
input[type="range"] {
  touch-action: manipulation;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(39, 134, 128, 0.38);
  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;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.topbar {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(23, 35, 60, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fffdf8;
  background: var(--ink);
  border-radius: 13px 13px 13px 4px;
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.14em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.75);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--accent);
}

.icon-button[aria-pressed="false"] {
  color: #9e9ba4;
  background: #eeeae2;
}

.course-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 46px;
  padding: 42px 0 70px;
}

.course-rail {
  align-self: start;
  position: sticky;
  top: 22px;
}

.rail-kicker {
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.rail-intro h1 {
  margin: 12px 0 16px;
  font-family: "Songti SC", STSong, Georgia, serif;
  font-size: clamp(31px, 3.1vw, 43px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.rail-intro p {
  margin: 0;
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.lesson-list {
  display: grid;
  gap: 10px;
  margin: 28px 0 20px;
}

.lesson-nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.lesson-nav-item:hover {
  background: rgba(255, 253, 248, 0.65);
  transform: translateX(2px);
}

.lesson-nav-item.active {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 8px 30px rgba(36, 45, 67, 0.06);
}

.lesson-nav-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
}

.lesson-nav-item.active .lesson-nav-number {
  color: #fff;
  background: var(--accent);
}

.lesson-nav-copy strong,
.lesson-nav-copy small {
  display: block;
}

.lesson-nav-copy strong {
  font-size: 13px;
  line-height: 1.4;
}

.lesson-nav-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.lesson-nav-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: transparent;
  font-size: 11px;
}

.lesson-nav-item.complete .lesson-nav-check {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.rail-tip {
  display: flex;
  gap: 11px;
  padding: 16px;
  border: 1px dashed #d4c9b6;
  border-radius: 16px;
  background: rgba(255, 250, 239, 0.5);
}

.tip-icon {
  color: var(--accent);
  font-size: 18px;
}

.rail-tip strong {
  display: block;
  font-size: 12px;
}

.rail-tip p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.overall-progress {
  margin-top: 20px;
}

.overall-progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.overall-progress-label strong {
  color: var(--ink);
}

.progress-track {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2ddd3;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 280ms ease;
}

.course-main {
  min-width: 0;
}

.lesson-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 30px;
  align-items: end;
  margin-bottom: 26px;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.subject-pill {
  padding: 5px 10px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
}

.meta-separator {
  opacity: 0.45;
}

.lesson-heading h2 {
  margin: 18px 0 6px;
  max-width: 800px;
  font-family: "Songti SC", STSong, Georgia, serif;
  font-size: clamp(34px, 4.1vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.lesson-heading > div > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.goal-card {
  position: relative;
  padding: 18px 20px 18px 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.8);
}

.goal-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}

.goal-card span,
.goal-card strong {
  display: block;
}

.goal-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.goal-card strong {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.6;
  text-wrap: balance;
}

.step-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 2px;
}

.step-copy {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.step-copy strong {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 22px;
  letter-spacing: 0;
}

.step-dots {
  flex: 1;
  display: flex;
  gap: 7px;
}

.step-dot {
  flex: 1;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #ddd8cf;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.step-dot:hover {
  transform: scaleY(1.8);
}

.step-dot.visited {
  background: #a9a096;
}

.step-dot.active {
  background: var(--accent);
}

.text-button {
  padding: 7px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.lesson-stage {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stage-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}

.eyebrow {
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.stage-title-row h3 {
  margin: 6px 0 0;
  font-size: clamp(21px, 2.1vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.hint-button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.hint-button:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.hint-panel {
  margin: -5px 0 16px;
  padding: 11px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: var(--accent-deep);
  background: var(--accent-faint);
  font-size: 12px;
  line-height: 1.65;
}

.visual-root {
  min-height: 380px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 22px;
  background:
    linear-gradient(rgba(23, 35, 60, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 35, 60, 0.035) 1px, transparent 1px),
    #fbf9f3;
  background-size: 24px 24px;
}

.interaction-root {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.interaction-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.interaction-prompt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.slider-group {
  flex: 1 1 220px;
  display: grid;
  grid-template-columns: 54px 1fr 42px;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.slider-group label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.slider-value {
  padding: 4px 7px;
  border-radius: 7px;
  text-align: center;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice-row .choice-button,
.quiz-options .choice-button {
  animation: choice-in 380ms cubic-bezier(0.18, 0.78, 0.24, 1) both;
}

.choice-row .choice-button:nth-child(2),
.quiz-options .choice-button:nth-child(2) {
  animation-delay: 55ms;
}

.choice-row .choice-button:nth-child(3),
.quiz-options .choice-button:nth-child(3) {
  animation-delay: 110ms;
}

.choice-row .choice-button:nth-child(4),
.quiz-options .choice-button:nth-child(4) {
  animation-delay: 165ms;
}

@keyframes choice-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.choice-button {
  min-width: 100px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.choice-button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.choice-button.correct {
  border-color: #2c927a;
  background: #e6f7f1;
  color: #17675b;
}

.choice-button.wrong {
  border-color: #d46b5c;
  background: #fff0ec;
  color: #9e3428;
}

.choice-button:disabled {
  cursor: default;
}

.action-button {
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.action-button:hover {
  background: var(--accent-deep);
}

.feedback {
  padding: 11px 14px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.65;
  animation: feedback-in 220ms ease both;
}

.feedback.neutral {
  color: #495369;
  background: #f0ede6;
}

.feedback.good {
  color: #14695d;
  background: #e5f6f1;
}

.feedback.try {
  color: #944034;
  background: #fff0ec;
}

.interaction-row > .feedback {
  color: var(--ink);
  background: var(--accent-faint);
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.narration-panel {
  margin-top: 16px;
  padding: 14px 16px 11px;
  border: 1px solid var(--soft-line);
  border-radius: 17px;
  background: #fcfaf5;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 11px;
}

.play-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding-left: 2px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
}

.play-button:hover {
  background: var(--accent-deep);
}

.waveform {
  height: 22px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.waveform i {
  width: 2px;
  height: 5px;
  border-radius: 99px;
  background: #c3bbb0;
  transition: background 150ms ease;
}

.waveform i:nth-child(2n) {
  height: 12px;
}

.waveform i:nth-child(3n) {
  height: 18px;
}

.waveform i:nth-child(5n) {
  height: 9px;
}

body.audio-playing .waveform i {
  background: var(--accent);
  animation: wave 760ms ease-in-out infinite alternate;
}

body.audio-playing .waveform i:nth-child(2n) {
  animation-delay: -200ms;
}

body.audio-playing .waveform i:nth-child(3n) {
  animation-delay: -420ms;
}

@keyframes wave {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1.35); }
}

.small-control,
.speed-control select {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  cursor: pointer;
}

.audio-time {
  margin-left: auto;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.subtitle-box {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 13px;
  min-height: 42px;
}

.cc-label {
  padding: 4px 5px;
  border-radius: 5px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.subtitle-box p {
  margin: 0;
  font-size: 13px;
  font-weight: 520;
  line-height: 1.75;
}

.audio-track {
  height: 3px;
  margin: 10px 0 0 42px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e1d7;
}

.audio-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.audio-warning {
  margin: 10px 0 0 42px;
  color: #986b20;
  font-size: 10px;
}

.transcript-panel {
  margin-top: 13px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fff;
}

.transcript-panel span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.transcript-panel p {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.85;
}

.lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 4px 0;
}

.primary-button,
.secondary-button {
  min-height: 43px;
  padding: 0 19px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
}

.primary-button:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.75);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--accent);
}

.footer-tip {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.completion-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #bcded4;
  border-radius: 17px;
  background: #eef9f4;
}

.completion-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: #26856f;
  font-size: 18px;
}

.completion-banner > div {
  flex: 1;
}

.completion-banner strong {
  font-size: 13px;
}

.completion-banner p {
  margin: 3px 0 0;
  color: #4f776d;
  font-size: 11px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 11px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 10px 36px rgba(24, 38, 63, 0.24);
  font-size: 12px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  margin: 30px;
  padding: 20px;
  color: #9e3428;
  background: #fff0ec;
}

/* Visual: difference of squares */
.visual-svg {
  display: block;
  width: min(100%, 760px);
  height: auto;
  min-height: 300px;
  max-height: 470px;
}

.svg-label {
  fill: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-weight: 650;
}

.svg-small-label {
  fill: #6c7487;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
}

.svg-formula {
  fill: var(--ink);
  font-family: Georgia, "Songti SC", serif;
  font-size: 21px;
  font-weight: 700;
}

.square-area {
  fill: var(--accent);
  opacity: 0.92;
  transition: fill 180ms ease;
}

.square-hole {
  fill: #f1eadf;
  stroke: #a9a196;
  stroke-width: 2;
}

.square-outline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
}

.cut-piece {
  fill: var(--accent);
  opacity: 0.94;
  transform-box: fill-box;
  transform-origin: center;
  animation: piece-arrive 380ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.cut-piece.second {
  animation-delay: 80ms;
}

@keyframes piece-arrive {
  from {
    opacity: 0.2;
    transform: translate(-35px, 12px);
  }
  to {
    opacity: 0.94;
    transform: translate(0, 0);
  }
}

.cut-arrow {
  fill: none;
  stroke: #a79f92;
  stroke-width: 2.2;
  stroke-dasharray: 7 6;
}

.equation-chip {
  fill: #fffdf8;
  stroke: #dfd6c7;
  stroke-width: 1.5;
}

/* Visual: similarity */
.similarity-fill {
  fill: var(--accent);
  fill-opacity: 0.2;
  stroke: var(--accent);
  stroke-width: 3.2;
}

.similarity-small {
  fill: #2e7c9a;
  fill-opacity: 0.17;
  stroke: #2e7c9a;
  stroke-width: 2.8;
}

.similarity-grid-line {
  stroke: rgba(23, 35, 60, 0.15);
  stroke-width: 1;
}

.measure-line {
  stroke: #7c8493;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.measure-line.accent {
  stroke: var(--accent-deep);
}

.area-block {
  transition: x 220ms ease, y 220ms ease, width 220ms ease, height 220ms ease;
}

/* Visual: cycle */
.cycle-card {
  fill: #fff;
  stroke: #ddd5c7;
  stroke-width: 2;
  transition: fill 170ms ease, stroke 170ms ease, transform 170ms ease;
}

.cycle-card.active {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 3;
  filter: drop-shadow(0 8px 8px rgba(180, 109, 20, 0.12));
}

.cycle-digit {
  fill: var(--ink);
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 700;
}

.cycle-ordinal {
  fill: #7b8190;
  font-family: "PingFang SC", sans-serif;
  font-size: 11px;
}

.cycle-arrow {
  fill: none;
  stroke: #aaa297;
  stroke-width: 2;
  marker-end: url("#cycle-arrowhead");
}

.cycle-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 7 7;
  opacity: 0.65;
}

.bignum {
  fill: var(--ink);
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 700;
}

.bignum sup {
  font-size: 20px;
}

.formula-visual {
  width: min(100%, 780px);
  display: grid;
  gap: 22px;
  padding: 30px;
}

.formula-main {
  text-align: center;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.formula-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.formula-step {
  position: relative;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.formula-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -14px;
  color: var(--accent);
  transform: translateY(-50%);
}

.formula-step span,
.formula-step strong {
  display: block;
}

.formula-step span {
  color: var(--muted);
  font-size: 10px;
}

.formula-step strong {
  margin-top: 7px;
  font-family: Georgia, serif;
  font-size: 20px;
}

.summary-visual {
  width: min(100%, 780px);
  padding: 34px;
  text-align: center;
}

.summary-symbol {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 25px;
  box-shadow: 0 0 0 11px var(--accent-soft);
}

.summary-equation {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 700;
}

.summary-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.summary-points li {
  padding: 13px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  line-height: 1.6;
}

.quiz-card {
  width: min(100%, 680px);
  padding: 30px;
  text-align: center;
}

.quiz-label {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quiz-question {
  margin: 20px auto;
  max-width: 560px;
  font-family: "Songti SC", STSong, serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.4;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
}

.ratio-visual {
  width: min(100%, 680px);
  padding: 20px;
}

.ratio-bars {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.ratio-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 90px;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.ratio-bar-track {
  height: 24px;
  overflow: hidden;
  border-radius: 8px;
  background: #e9e4da;
}

.ratio-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.ratio-bar-fill.secondary {
  background: #6d8ea7;
}

.ratio-equation {
  margin: 18px 0 0;
  text-align: center;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
}

.cycle-summary {
  display: grid;
  grid-template-columns: repeat(4, auto);
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.cycle-summary span {
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}

.cycle-summary b {
  color: var(--muted);
}

/* Motion system: scene transitions, narration beats and interactive reveals */
.lesson-stage.scene-enter .stage-title-row {
  animation: scene-copy-in 430ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.lesson-stage.scene-enter .visual-root {
  animation: scene-visual-in 620ms cubic-bezier(0.16, 0.75, 0.22, 1) both;
}

.lesson-stage.scene-enter .interaction-root,
.lesson-stage.scene-enter .narration-panel {
  animation: scene-copy-in 520ms 90ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

@keyframes scene-copy-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scene-visual-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.auto-continue {
  min-width: 66px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.auto-continue.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.cue-count {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  white-space: nowrap;
}

.subtitle-box p.cue-in {
  animation: subtitle-in 260ms ease both;
}

@keyframes subtitle-in {
  from {
    opacity: 0.15;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.square-enter {
  transform-box: fill-box;
  transform-origin: center;
  animation: square-grow 620ms cubic-bezier(0.18, 0.76, 0.24, 1) both;
}

/* Guided square-cut animation for square-difference lesson */
.square-hole-mask {
  transform-box: fill-box;
  transform-origin: 100% 100%;
  transform: scale(0);
  transition: transform 820ms 220ms cubic-bezier(0.2, 0.78, 0.22, 1);
}

.square-demo-svg.hole-open .square-hole-mask {
  transform: scale(1);
}

.cut-away-piece {
  transform-box: fill-box;
  transform-origin: center;
  transition:
    transform 720ms 260ms cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 520ms 330ms ease;
}

.square-demo-svg.hole-open .cut-away-piece {
  opacity: 0;
  transform: translate(38px, -43px) rotate(8deg) scale(0.95);
}

.square-cut-line {
  fill: none;
  stroke: #fffaf1;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 310;
  stroke-dashoffset: 310;
  opacity: 0;
  transition:
    stroke-dashoffset 520ms ease,
    opacity 120ms ease;
}

.square-demo-svg.hole-open .square-cut-line {
  opacity: 1;
  stroke-dashoffset: 0;
}

.scissors-cue {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 180ms ease;
}

.square-demo-svg.hole-open .scissors-cue {
  opacity: 1;
  animation: scissors-travel 760ms 80ms ease-in-out both;
}

@keyframes scissors-travel {
  0% {
    opacity: 0;
    transform: translate(-19px, 7px) rotate(-8deg);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(91px, 7px) rotate(8deg);
  }
}

.square-question-cards {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 360ms ease,
    transform 440ms cubic-bezier(0.18, 0.78, 0.24, 1);
}

.square-demo-svg.cards-open .square-question-cards {
  opacity: 1;
  transform: translateY(0);
}

.assembly-guide {
  opacity: 0.52;
  transition: opacity 350ms ease;
}

.assembly-guide rect {
  fill: rgba(255, 253, 248, 0.45);
  stroke: #cfc6b8;
  stroke-width: 1.8;
  stroke-dasharray: 7 6;
}

.original-square-shell > rect:first-child {
  fill: none;
  stroke: #17233c;
  stroke-width: 2.3;
}

.orange-piece {
  filter: drop-shadow(0 7px 8px rgba(35, 42, 59, 0.08));
  transition: transform 1120ms cubic-bezier(0.2, 0.76, 0.18, 1);
  will-change: transform;
}

.piece-label {
  fill: #fffdf8;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.side-piece-label {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 1120ms cubic-bezier(0.2, 0.76, 0.18, 1);
}

.square-demo-svg.pieces-separated .piece-top {
  transform: translateY(-12px);
}

.square-demo-svg.pieces-separated .piece-side {
  transform: translateX(-12px);
}

.square-demo-svg.pieces-assembled .piece-top {
  transform: translate(var(--top-tx), var(--top-ty));
}

.square-demo-svg.pieces-assembled .piece-side {
  transform: translate(var(--side-tx), var(--side-ty)) rotate(-90deg);
}

.square-demo-svg.pieces-assembled .side-piece-label {
  transform: rotate(90deg);
}

.assembly-arrow {
  fill: none;
  stroke: #b4a999;
  stroke-width: 2.2;
  stroke-dasharray: 7 7;
  opacity: 0;
  transition: opacity 280ms ease;
}

.square-demo-svg.pieces-separated .assembly-arrow,
.square-demo-svg.pieces-assembled .assembly-arrow {
  opacity: 1;
}

.rotation-chip {
  opacity: 0;
  transition: opacity 300ms ease;
}

.square-demo-svg.pieces-separated .rotation-chip {
  opacity: 1;
}

.assembled-guide {
  opacity: 0;
  transform: translateY(7px);
  transition:
    opacity 320ms 820ms ease,
    transform 420ms 820ms cubic-bezier(0.18, 0.78, 0.24, 1);
}

.square-demo-svg.pieces-assembled .assembly-guide {
  opacity: 0.14;
}

.square-demo-svg.pieces-assembled .assembled-guide {
  opacity: 1;
  transform: translateY(0);
}

.square-formula-card {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 340ms ease,
    transform 420ms cubic-bezier(0.18, 0.78, 0.24, 1);
}

.square-formula-card.card-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes square-grow {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.beat-pop {
  transform-box: fill-box;
  transform-origin: center;
  animation: beat-pop 420ms cubic-bezier(0.18, 0.78, 0.24, 1) both;
}

.delayed-pop {
  animation-delay: 120ms;
}

@keyframes beat-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.triangle-enter {
  transform-box: fill-box;
  transform-origin: bottom left;
  animation: triangle-enter 620ms cubic-bezier(0.16, 0.78, 0.25, 1) both;
}

.similarity-scale-group {
  transition: transform 900ms cubic-bezier(0.18, 0.78, 0.24, 1);
}

@keyframes triangle-enter {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.grid-cell {
  transform-box: fill-box;
  transform-origin: center;
  animation: grid-cell-in 360ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

@keyframes grid-cell-in {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.measure-draw {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: draw-measure 680ms 120ms ease-out forwards;
}

.measure-draw.delayed {
  animation-delay: 260ms;
}

@keyframes draw-measure {
  to {
    stroke-dashoffset: 0;
  }
}

.cycle-stage-enter {
  transform-box: fill-box;
  transform-origin: center;
  animation: cycle-stage-in 480ms ease both;
}

.cycle-stage-hidden {
  opacity: 0;
}

.cycle-card-group {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: cycle-card-in 460ms cubic-bezier(0.18, 0.78, 0.25, 1) both;
  animation-delay: calc(var(--card-index) * 70ms);
}

.cycle-card.active {
  animation: cycle-pulse 1500ms ease-in-out infinite;
}

@keyframes cycle-stage-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cycle-card-in {
  from {
    opacity: 0;
    transform: translateY(17px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cycle-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.bar-animate {
  transform-origin: left center;
  animation: bar-grow 620ms cubic-bezier(0.18, 0.76, 0.24, 1) both;
}

@keyframes bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.summary-orbit {
  animation: summary-orbit 3200ms ease-in-out infinite;
}

@keyframes summary-orbit {
  0%, 100% { transform: rotate(0deg) scale(1); }
  45% { transform: rotate(7deg) scale(1.04); }
  70% { transform: rotate(-5deg) scale(0.98); }
}

.question-enter {
  animation: question-in 520ms cubic-bezier(0.18, 0.76, 0.24, 1) both;
}

@keyframes question-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Recurrence and states */
.rec-stair-path {
  fill: none;
  stroke: #b9c3d8;
  stroke-width: 2.5;
  stroke-dasharray: 8 8;
  animation: rec-route-flow 1.5s linear infinite;
}

@keyframes rec-route-flow {
  to { stroke-dashoffset: -32; }
}

.rec-pad-group {
  transform-box: fill-box;
  transform-origin: center;
  animation: rec-pad-in 430ms cubic-bezier(0.18, 0.78, 0.24, 1) both;
  animation-delay: calc(var(--pad-index) * 65ms);
}

.rec-pad-circle {
  fill: var(--accent-faint);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.rec-pad-label {
  fill: var(--accent-deep);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
}

@keyframes rec-pad-in {
  from {
    opacity: 0;
    transform: translateY(13px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.rec-frog-group {
  transform-box: fill-box;
  transform-origin: center;
  animation: rec-frog-float 1900ms ease-in-out infinite;
}

@keyframes rec-frog-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

.rec-route-samples {
  opacity: 0;
  transform: translateY(9px);
  transition:
    opacity 300ms ease,
    transform 420ms cubic-bezier(0.18, 0.78, 0.24, 1);
}

.rec-svg.route-samples-open .rec-route-samples {
  opacity: 1;
  transform: translateY(0);
}

.rec-state-card,
.rec-target-card {
  transition:
    opacity 380ms ease,
    transform 520ms cubic-bezier(0.18, 0.78, 0.24, 1);
}

.rec-state-card rect,
.rec-target-card rect {
  fill: #fff;
  stroke: #d8d1c5;
  stroke-width: 1.7;
}

.rec-target-card rect {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 2.4;
}

.rec-source-one,
.rec-source-two {
  opacity: 0;
  transform: translateX(-22px);
}

.rec-last-step-svg.show-source-one .rec-source-one,
.rec-last-step-svg.show-source-two .rec-source-two {
  opacity: 1;
  transform: translateX(0);
}

.rec-last-step-svg.show-source-two .rec-target-card {
  animation: rec-target-pulse 1600ms ease-in-out infinite;
}

.rec-edge-one,
.rec-edge-two,
.rec-formula-card {
  opacity: 0;
  transition: opacity 300ms ease;
}

.rec-last-step-svg.show-source-one .rec-edge-one,
.rec-last-step-svg.show-source-two .rec-edge-two,
.rec-last-step-svg.show-formula .rec-formula-card {
  opacity: 1;
}

.rec-edge-one > path,
.rec-edge-two > path,
.rec-table-relation path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  transition: stroke-dashoffset 750ms cubic-bezier(0.2, 0.76, 0.18, 1);
}

.rec-last-step-svg.show-source-one .rec-edge-one > path,
.rec-last-step-svg.show-source-two .rec-edge-two > path,
.rec-table-svg.relation-open .rec-table-relation path {
  stroke-dashoffset: 0;
}

.rec-moving-token {
  fill: var(--accent);
}

.rec-moving-token.second {
  fill: #7c94cf;
}

.rec-edge-label {
  fill: var(--muted);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 650;
}

@keyframes rec-target-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.rec-table-cell rect {
  fill: #fff;
  stroke: #ded8cf;
  stroke-width: 1.5;
  transition:
    fill 260ms ease,
    stroke 260ms ease,
    filter 260ms ease;
}

.rec-table-cell.revealed rect {
  fill: var(--accent-faint);
  stroke: #bcc8e4;
}

.rec-table-cell.highlight rect {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 2.5;
  filter: drop-shadow(0 7px 8px rgba(69, 100, 170, 0.16));
}

.rec-table-value {
  fill: #99a0ae;
  font-family: Georgia, serif;
  font-size: 35px;
  font-weight: 700;
  transition: fill 220ms ease;
}

.rec-table-cell.revealed .rec-table-value {
  fill: var(--accent-deep);
}

.rec-table-relation {
  opacity: 0;
  transition: opacity 300ms ease;
}

.rec-table-svg.relation-open .rec-table-relation {
  opacity: 1;
}

.rec-base-card {
  transition: opacity 300ms ease;
}

.rec-sequence-row {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 330ms ease,
    transform 460ms cubic-bezier(0.18, 0.78, 0.24, 1);
}

.rec-worked-svg.sequence-open .rec-sequence-row {
  opacity: 1;
  transform: translateY(0);
}

.rec-sequence-row > g {
  transform-box: fill-box;
  transform-origin: center;
  animation: rec-mini-in 420ms cubic-bezier(0.18, 0.78, 0.24, 1) both;
  animation-delay: calc(var(--seq-index) * 80ms);
}

.rec-mini-state {
  fill: var(--accent-faint);
  stroke: #c6d0e8;
  stroke-width: 1.8;
}

.rec-mini-value {
  fill: var(--accent-deep);
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 700;
}

@keyframes rec-mini-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rec-split-state,
.rec-join-symbol,
.rec-result-card {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 350ms ease,
    transform 520ms cubic-bezier(0.18, 0.78, 0.24, 1);
}

.rec-worked-svg.split-open .rec-split-state,
.rec-worked-svg.split-open .rec-join-symbol,
.rec-worked-svg.split-open .rec-result-card {
  opacity: 1;
  transform: translateY(0);
}

.rec-worked-svg.split-open .rec-split-state.first {
  transform: translateX(35px);
}

.rec-worked-svg.split-open .rec-split-state.second {
  transform: translateX(-35px);
}

.rec-split-state rect {
  fill: #fff;
  stroke: #ccd5e8;
  stroke-width: 1.7;
}

.rec-split-state.first rect {
  fill: var(--accent-faint);
}

.rec-split-state.second rect {
  fill: #fff8eb;
  stroke: #ead3a5;
}

.rec-plus {
  fill: var(--accent);
  font-family: Georgia, serif;
  font-size: 36px;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .course-shell {
    grid-template-columns: 238px minmax(0, 1fr);
    gap: 28px;
  }

  .lesson-heading {
    grid-template-columns: 1fr;
  }

  .goal-card {
    max-width: 440px;
  }

  .rail-intro h1 {
    font-size: 33px;
  }
}

@media (max-width: 820px) {
  .topbar,
  .course-shell {
    width: min(100% - 28px, 720px);
  }

  .topbar-note {
    display: none;
  }

  .course-shell {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

  .course-rail {
    position: static;
  }

  .rail-intro h1 {
    max-width: 540px;
    margin-bottom: 10px;
  }

  .rail-intro p {
    max-width: 580px;
  }

  .lesson-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 20px 0 14px;
  }

  .lesson-nav-item {
    grid-template-columns: 32px 1fr;
    align-items: start;
    padding: 11px;
  }

  .lesson-nav-number {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 14px;
  }

  .lesson-nav-check {
    display: none;
  }

  .lesson-nav-copy small {
    font-size: 10px;
  }

  .rail-tip,
  .overall-progress {
    display: none;
  }

  .lesson-heading {
    margin-bottom: 18px;
  }

  .lesson-heading h2 {
    font-size: clamp(34px, 9vw, 50px);
  }

  .lesson-stage {
    padding: 18px;
    border-radius: 23px;
  }

  .visual-root {
    min-height: 310px;
  }

  .visual-svg {
    min-height: 250px;
  }

  .formula-steps,
  .summary-points {
    grid-template-columns: 1fr;
  }

  .formula-step:not(:last-child)::after {
    content: "↓";
    top: auto;
    right: 50%;
    bottom: -17px;
    transform: translateX(50%);
  }

  .footer-tip {
    display: none;
  }
}

@media (max-width: 540px) {
  .topbar {
    min-height: 70px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .lesson-list {
    gap: 6px;
  }

  .lesson-nav-item {
    display: block;
    padding: 8px;
  }

  .lesson-nav-number {
    margin-bottom: 8px;
  }

  .lesson-nav-copy strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .lesson-nav-copy small {
    display: none;
  }

  .lesson-meta {
    flex-wrap: wrap;
  }

  .step-strip {
    gap: 10px;
  }

  .step-dots {
    gap: 4px;
  }

  .lesson-stage {
    padding: 14px;
  }

  .stage-title-row {
    gap: 8px;
  }

  .hint-button {
    padding: 7px 9px;
    font-size: 10px;
  }

  .visual-root {
    min-height: 260px;
    border-radius: 16px;
  }

  .audio-controls {
    gap: 7px;
  }

  .waveform {
    display: none;
  }

  .small-control,
  .speed-control select {
    font-size: 9px;
  }

  .subtitle-box {
    grid-template-columns: 28px 1fr;
    gap: 8px;
  }

  .subtitle-box p {
    font-size: 12px;
  }

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

  .ratio-bar-row {
    grid-template-columns: 80px 1fr 60px;
    gap: 7px;
    font-size: 10px;
  }

  .cycle-summary {
    grid-template-columns: auto auto;
  }

  .cycle-summary b:nth-of-type(2),
  .cycle-summary b:nth-of-type(3) {
    display: none;
  }

  .lesson-footer {
    gap: 10px;
  }

  .primary-button,
  .secondary-button {
    padding: 0 14px;
  }

  .completion-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

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