/* Classical-poetry variant: a night-ink reading surface built on lesson-shell-v2. */
body[data-lesson-shell="v2"][data-lesson-type="classical-poetry"] {
  --lesson-bg: #0b1424;
  --lesson-paper: #f4efe5;
  --lesson-ink: #182238;
  --lesson-muted: #626879;
  --lesson-accent: #a44c35;
  --lesson-accent-soft: #eadbc7;
  --lesson-gold: #e5a94b;
  --lesson-deep: #13233b;
  --lesson-line: rgba(24, 34, 56, .18);
  --lesson-shadow: 0 26px 90px rgba(1, 7, 17, .34);
  background:
    radial-gradient(circle at 86% 12%, rgba(229, 169, 75, .12), transparent 22rem),
    linear-gradient(180deg, #0b1424 0, #111f34 42rem, #d7d0c5 68rem, #e8e1d4 100%);
}

body[data-lesson-type="classical-poetry"] .lesson-topbar {
  background: rgba(7, 16, 29, .94);
  border-bottom-color: rgba(229, 169, 75, .2);
}

body[data-lesson-type="classical-poetry"] .return-link::before {
  border-color: rgba(229, 169, 75, .68);
}

body[data-lesson-type="classical-poetry"] .lesson-hero {
  min-height: 620px;
  color: #f4efe5;
  background: #111c30;
  border-color: rgba(229, 169, 75, .25);
  box-shadow: 0 30px 100px rgba(0, 4, 12, .48);
}

body[data-lesson-type="classical-poetry"] .hero-copy {
  position: relative;
  isolation: isolate;
  padding-inline: clamp(34px, 7vw, 82px);
  background:
    radial-gradient(circle at 18% 18%, rgba(229, 169, 75, .1), transparent 16rem),
    linear-gradient(145deg, #101c31, #172740);
}

body[data-lesson-type="classical-poetry"] .hero-copy::after {
  content: "";
  position: absolute;
  inset: 26px;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(232, 225, 212, .12);
  border-radius: 18px 18px 54px;
}

body[data-lesson-type="classical-poetry"] .lesson-mark,
body[data-lesson-type="classical-poetry"] .section-kicker {
  color: #8c3f2f;
}

body[data-lesson-type="classical-poetry"] .hero-copy .lesson-mark {
  color: #e5a94b;
}

body[data-lesson-type="classical-poetry"] .hero-copy h1 {
  margin-block: 18px 12px;
  color: #f8f3e8;
  font-size: clamp(58px, 8vw, 96px);
  font-weight: 650;
  letter-spacing: .12em;
  white-space: nowrap;
}

.poem-author {
  margin: 0 0 22px;
  color: #d9c9b2;
  font-family: var(--lesson-serif);
  font-size: 19px;
  letter-spacing: .12em;
}

body[data-lesson-type="classical-poetry"] .hero-lead {
  color: rgba(244, 239, 229, .74);
}

body[data-lesson-type="classical-poetry"] .learning-path li {
  color: #f2e5cf;
  background: rgba(229, 169, 75, .13);
  border: 1px solid rgba(229, 169, 75, .22);
}

body[data-lesson-type="classical-poetry"] .hero-visual {
  min-height: 620px;
  background: #0b1424;
}

body[data-lesson-type="classical-poetry"] .hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(17, 28, 48, .32), transparent 30% 72%, rgba(3, 8, 16, .18));
}

body[data-lesson-type="classical-poetry"] .hero-visual img {
  object-position: 50% 63%;
  filter: saturate(.82) contrast(1.04);
  animation: night-breathe 14s ease-in-out infinite alternate;
}

body[data-lesson-type="classical-poetry"] .hero-visual figcaption {
  z-index: 1;
  color: #f5ead8;
  background: rgba(8, 16, 29, .86);
  border: 1px solid rgba(229, 169, 75, .28);
}

@keyframes night-breathe {
  from { transform: scale(1); }
  to { transform: scale(1.025); }
}

body[data-lesson-type="classical-poetry"] .reader-dock {
  background: rgba(9, 20, 36, .96);
  border-color: rgba(229, 169, 75, .24);
  box-shadow: 0 18px 44px rgba(1, 7, 17, .36);
}

body[data-lesson-type="classical-poetry"] .mode-switch button[aria-pressed="true"],
body[data-lesson-type="classical-poetry"] .reader-actions button {
  color: #13233b;
  background: #f4efe5;
}

body[data-lesson-type="classical-poetry"] .lesson-section {
  background:
    linear-gradient(90deg, rgba(164, 76, 53, .035) 1px, transparent 1px),
    rgba(244, 239, 229, .97);
  background-size: 32px 100%;
  box-shadow: 0 14px 48px rgba(4, 12, 24, .12);
}

.poem-original-card {
  padding-block: clamp(34px, 6vw, 62px);
  text-align: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(229, 169, 75, .11), transparent 18rem),
    #faf6ed;
}

.poem-original-card::before {
  content: "原诗";
  background: #13233b;
}

.poem-original-card [data-testid="textbook-original"] {
  font-size: clamp(25px, 3.8vw, 40px);
  font-weight: 620;
  letter-spacing: .1em;
  line-height: 2.15;
}

.poem-line {
  display: block;
}

.couplet-controls {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.couplet-button {
  min-height: 52px;
  padding: 10px 16px;
  color: #f7f0e3;
  cursor: pointer;
  background: #172740;
  border: 1px solid rgba(229, 169, 75, .42);
  border-radius: 12px;
  font-weight: 850;
}

.couplet-button:hover {
  background: #203653;
}

.poem-notes {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.poem-notes .word-note strong {
  font-family: var(--lesson-serif);
  font-size: 24px;
}

.poem-arc {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  counter-reset: poem-stage;
}

.poem-stage {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #f4efe5;
  background: #101b2d;
  border: 1px solid rgba(229, 169, 75, .2);
  border-radius: 14px;
  counter-increment: poem-stage;
}

.poem-stage::before {
  content: "0" counter(poem-stage);
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #f4efe5;
  background: rgba(7, 16, 29, .82);
  border: 1px solid rgba(229, 169, 75, .45);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.poem-stage img {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: block;
  object-fit: cover;
  object-position: 50% 68%;
  transition: transform .5s ease, filter .5s ease;
}

.poem-stage:hover img {
  transform: scale(1.025);
  filter: brightness(1.06);
}

.poem-stage figcaption {
  min-height: 96px;
  padding: 12px;
  color: rgba(244, 239, 229, .72);
  font-size: 13px;
  line-height: 1.55;
}

.poem-stage b {
  display: block;
  margin-bottom: 3px;
  color: #e5a94b;
  font-family: var(--lesson-serif);
  font-size: 16px;
}

.feeling-turn {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(19, 35, 59, .15);
  border-radius: 16px;
}

.feeling-side {
  padding: clamp(20px, 4vw, 32px);
}

.feeling-side strong {
  display: block;
  margin-bottom: 7px;
  font-family: var(--lesson-serif);
  font-size: 22px;
}

.feeling-cold {
  color: #eef1f5;
  background: #172740;
}

.feeling-warm {
  color: #4b2b1a;
  background: #e7c78f;
}

.poem-recitation .recite-prompt,
.poem-recitation .recite-answer {
  white-space: pre-line;
}

body[data-lesson-type="classical-poetry"] .recite-panel {
  color: #f4efe5;
  background:
    radial-gradient(circle at 85% 15%, rgba(229, 169, 75, .2), transparent 22rem),
    #13233b;
}

body[data-lesson-type="classical-poetry"] .video-card video {
  max-height: 620px;
  background: #08111f;
}

body[data-lesson-type="classical-poetry"] .disclosure,
body[data-lesson-type="classical-poetry"] .lesson-footer {
  color: #465062;
}

@media (max-width: 980px) {
  body[data-lesson-type="classical-poetry"] .lesson-hero {
    min-height: 540px;
    grid-template-columns: minmax(0, .9fr) minmax(280px, 1.1fr);
  }

  body[data-lesson-type="classical-poetry"] .hero-visual {
    min-height: 540px;
  }

  body[data-lesson-type="classical-poetry"] .hero-copy h1 {
    font-size: clamp(42px, 6vw, 62px);
    letter-spacing: .04em;
  }

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

  .poem-stage:nth-child(4),
  .poem-stage:nth-child(5) {
    grid-column: span 1;
  }
}

@media (max-width: 680px) {
  body[data-lesson-type="classical-poetry"] .lesson-hero {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  body[data-lesson-type="classical-poetry"] .hero-copy::after {
    inset: 14px;
  }

  body[data-lesson-type="classical-poetry"] .hero-copy h1 {
    margin-top: 14px;
    font-size: clamp(48px, 14vw, 58px);
    letter-spacing: .07em;
  }

  body[data-lesson-type="classical-poetry"] .hero-visual {
    min-height: 360px;
    max-height: 390px;
  }

  .poem-original-card [data-testid="textbook-original"] {
    font-size: clamp(21px, 6.1vw, 27px);
    letter-spacing: .04em;
    line-height: 2.05;
  }

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

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

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

  .poem-stage:last-child {
    grid-column: 1 / -1;
  }

  .poem-stage:last-child img {
    aspect-ratio: 5 / 4;
    object-position: 50% 75%;
  }

  .feeling-turn {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .couplet-controls {
    grid-template-columns: 1fr;
  }

  .poem-stage figcaption {
    min-height: 110px;
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-lesson-type="classical-poetry"] .hero-visual img {
    animation: none;
  }
}
