/* 夜問 · 深探報告 — premium editorial layout */

/* `node.hidden = true` must actually hide. Author `display` rules outrank the
   UA stylesheet's [hidden] { display: none }, which is why .coupon-panel
   (display: grid) stayed open on the paywall regardless of its hidden state. */
[hidden] {
  display: none !important;
}

/* Tarot artwork that failed to load — show the card's name in a gold frame
   rather than the browser's broken-image icon. See lib/image.js. */
img.card-image-missing {
  position: relative;
  min-height: 96px;
  background: linear-gradient(160deg, rgba(58, 30, 88, 0.7), rgba(20, 8, 29, 0.9));
  border: 1px solid rgba(244, 214, 160, 0.28);
  border-radius: 12px;
  color: transparent;
  object-fit: cover;
}
img.card-image-missing::after {
  content: attr(data-card-name);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: rgba(255, 242, 218, 0.86);
  background: inherit;
  border-radius: inherit;
}

:root {
  --ink: #fff2da;
  --ink-soft: rgba(255, 242, 218, 0.82);
  --ink-mute: rgba(255, 242, 218, 0.58);
  --gold: #f4d6a0;
  --gold-deep: #ca8e47;
  --gold-line: rgba(244, 214, 160, 0.22);
  --gold-line-soft: rgba(244, 214, 160, 0.12);
  --violet-0: #08040f;
  --violet-1: #14081d;
  --violet-2: #25103f;
  --violet-3: #3a1a5a;
  --serif: "Noto Serif TC", "Cormorant Garamond", "Baskerville", "Times New Roman", serif;
  --sans: "PingFang TC", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --reading-width: 640px;
  --measure: 620px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

.report-body {
  background: radial-gradient(ellipse at top, var(--violet-2) 0%, var(--violet-1) 55%, var(--violet-0) 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(244, 214, 160, 0.32);
  color: #14081d;
}

/* Loading state */
.report-loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 24px;
  z-index: 100;
  transition: opacity 0.5s ease;
}
.report-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.report-loading p {
  color: var(--ink-soft);
  letter-spacing: 0.3em;
  font-size: 12px;
  text-transform: uppercase;
}
.loading-halo {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(244, 214, 160, 0.28) 0%, rgba(244, 214, 160, 0.02) 60%, transparent 100%);
  border: 1px solid var(--gold-line);
  animation: halo 2.4s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* ==========================================================================
   COVER
   ========================================================================== */
.report-cover {
  position: relative;
  min-height: 100vh;
  padding: 40px 32px 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cover-ambient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(244, 214, 160, 0.22), transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(122, 78, 196, 0.18), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(202, 142, 71, 0.14), transparent 55%);
  pointer-events: none;
}

.cover-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 22%, rgba(255,241,212,0.9), transparent 60%),
    radial-gradient(1px 1px at 72% 14%, rgba(255,241,212,0.7), transparent 60%),
    radial-gradient(1.8px 1.8px at 64% 38%, rgba(255,223,168,0.9), transparent 60%),
    radial-gradient(1px 1px at 26% 68%, rgba(255,241,212,0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 54%, rgba(255,241,212,0.7), transparent 60%),
    radial-gradient(1px 1px at 48% 82%, rgba(255,241,212,0.5), transparent 60%),
    radial-gradient(1.6px 1.6px at 8% 44%, rgba(255,223,168,0.75), transparent 60%),
    radial-gradient(1px 1px at 38% 12%, rgba(255,241,212,0.5), transparent 60%);
  background-size: 100% 100%;
  pointer-events: none;
}

.cover-inner {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  display: grid;
  gap: 42px;
  justify-items: center;
  text-align: center;
}

.cover-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
  opacity: 0.9;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  font-size: 18px;
}
.cover-brand-copy {
  text-align: left;
  line-height: 1.15;
}
.cover-brand-copy strong {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.02em;
  display: block;
}
.cover-brand-copy small {
  display: block;
  color: var(--ink-mute);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Three drawn cards on cover */
.cover-cards {
  position: relative;
  width: min(520px, 94vw);
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-card {
  position: absolute;
  width: 180px;
  aspect-ratio: 3 / 5;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 30px 70px -20px rgba(0,0,0,0.7),
    0 0 0 1px rgba(244,214,160,0.22),
    0 0 60px -10px rgba(244,214,160,0.28);
  background: #0a050f;
  transition: transform 0.6s ease;
}
.cover-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-card.pos-0 { transform: translateX(-150px) rotate(-8deg); }
.cover-card.pos-1 { transform: translateY(-14px) scale(1.06); z-index: 2; }
.cover-card.pos-2 { transform: translateX(150px) rotate(8deg); }

.cover-heading {
  display: grid;
  gap: 18px;
  max-width: 760px;
}
.cover-eyebrow {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}
.cover-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.08;
  margin: 0;
  background: linear-gradient(180deg, var(--ink) 0%, #f4dfb5 55%, var(--gold-deep) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
}
.cover-subtitle {
  color: var(--ink-soft);
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.7;
  margin: 0;
  max-width: 620px;
  margin-inline: auto;
}
.cover-mood {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(255,255,255,0.03);
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: none;
}

.cover-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  width: min(780px, 100%);
  margin: 0;
  padding: 22px 22px;
  border-radius: 22px;
  border: 1px solid var(--gold-line);
  background: rgba(8,4,14,0.6);
  backdrop-filter: blur(8px);
}
.cover-meta > div {
  display: grid;
  gap: 6px;
  text-align: center;
  min-width: 0;
}
.cover-meta dt {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}
.cover-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  font-family: var(--serif);
  word-break: break-word;
}

.cover-scroll {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-mute);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-top: 24px;
  animation: bob 2.4s ease-in-out infinite;
}
.cover-scroll svg {
  width: 18px;
  height: 18px;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ==========================================================================
   TOC
   ========================================================================== */
.report-toc {
  padding: 48px 32px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--gold-line-soft);
  border-bottom: 1px solid var(--gold-line-soft);
  background: rgba(8,4,14,0.35);
}
.toc-inner {
  width: min(720px, 100%);
}
.toc-eyebrow {
  display: block;
  text-align: center;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  display: grid;
  gap: 2px;
}
.toc-list li {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gold-line-soft);
  cursor: pointer;
  transition: 0.28s ease;
}
.toc-list li:hover {
  padding-left: 10px;
  border-bottom-color: var(--gold);
}
.toc-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--gold);
  min-width: 50px;
}
.toc-text {
  flex: 1;
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
}
.toc-dots {
  flex: 1;
  border-bottom: 1px dotted var(--gold-line);
  margin: 0 12px;
  transform: translateY(-4px);
}
.toc-chars {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   CHAPTER
   ========================================================================== */
.report-chapter {
  padding: 120px 32px;
  position: relative;
  border-bottom: 1px solid var(--gold-line-soft);
}

.report-chapter::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 1px;
  height: 56px;
  background: linear-gradient(180deg, transparent, var(--gold-line), transparent);
}

.chapter-hero {
  width: min(1100px, 100%);
  margin: 0 auto 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 60px;
  align-items: center;
}
.chapter-hero.right {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
}
.chapter-hero.right .chapter-header { order: 2; text-align: right; }
.chapter-hero.right .chapter-art { order: 1; }

.chapter-art {
  position: relative;
  aspect-ratio: 3 / 5;
  max-height: 560px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 40px 90px -20px rgba(0,0,0,0.75),
    0 0 0 1px rgba(244,214,160,0.18),
    0 0 100px -10px rgba(244,214,160,0.3);
  background: #0a050f;
}
.chapter-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.1);
}
.chapter-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8,4,14,0.5) 100%);
  pointer-events: none;
}

.chapter-header {
  display: grid;
  gap: 18px;
  align-content: center;
}
.chapter-number {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
}
.chapter-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.1;
  margin: 0;
  background: linear-gradient(180deg, var(--ink) 0%, #f4dfb5 60%, var(--gold-deep) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.01em;
}
.chapter-epigraph {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0;
  padding-left: 18px;
  border-left: 2px solid var(--gold);
}
.chapter-hero.right .chapter-epigraph {
  padding-left: 0;
  padding-right: 18px;
  border-left: none;
  border-right: 2px solid var(--gold);
}

.chapter-body {
  width: min(var(--reading-width), 100%);
  margin: 0 auto;
  display: grid;
  gap: 26px;
}
.chapter-body p {
  margin: 0;
  font-size: 18px;
  line-height: 1.95;
  color: var(--ink-soft);
  text-align: justify;
  text-justify: inter-ideograph;
  hyphens: auto;
}
.chapter-body p:first-child::first-letter {
  font-family: var(--serif);
  font-size: 62px;
  line-height: 0.86;
  float: left;
  padding: 10px 12px 0 0;
  color: var(--gold);
  font-weight: 600;
}

/* Chapter 2 — card triptych (Star / Moon / Sun deep dives) */
.card-triptych {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 80px;
}
.card-section {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 50px;
  align-items: start;
}
.card-section-art {
  position: relative;
  aspect-ratio: 3 / 5;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.7),
    0 0 0 1px rgba(244,214,160,0.18),
    0 0 80px -10px rgba(244,214,160,0.22);
  position: sticky;
  top: 60px;
}
.card-section-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-section-body {
  display: grid;
  gap: 20px;
}
.card-section-slot {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
}
.card-section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 38px;
  line-height: 1.12;
  margin: 0 0 8px;
  color: var(--ink);
}
.card-section-body p {
  margin: 0;
  font-size: 17px;
  line-height: 1.92;
  color: var(--ink-soft);
  text-align: justify;
  text-justify: inter-ideograph;
}

/* ==========================================================================
   CLOSING LETTER
   ========================================================================== */
.report-letter {
  padding: 56px 32px 56px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(122,78,196,0.22), transparent 60%),
    rgba(8,4,14,0.35);
  border-top: 1px solid var(--gold-line-soft);
}
.letter-frame {
  width: min(620px, 100%);
  padding: 40px 40px;
  background: linear-gradient(180deg, rgba(20,8,29,0.85), rgba(8,4,14,0.92));
  border: 1px solid var(--gold-line);
  border-radius: 22px;
  box-shadow: 0 40px 120px -30px rgba(0,0,0,0.8), 0 0 80px -20px rgba(244,214,160,0.16);
  position: relative;
  text-align: center;
}
.letter-wax {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #14081d;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 12px 40px -10px rgba(244,214,160,0.4);
}
.letter-eyebrow {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 14px;
}
.letter-title {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.15;
  margin: 18px 0 22px;
  color: var(--ink);
}
.letter-epigraph {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-mute);
  margin: 0 0 32px;
  line-height: 1.7;
}
.letter-body {
  display: grid;
  gap: 22px;
  text-align: left;
}
.letter-body p {
  margin: 0;
  font-size: 17px;
  line-height: 1.92;
  color: var(--ink-soft);
}
.letter-signature {
  margin: 36px 0 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.report-footer {
  padding: 80px 32px 120px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 18px;
}
.footer-tag {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin: 0;
}
.footer-note {
  color: var(--ink-mute);
  max-width: 480px;
  margin: 0;
  font-size: 14px;
}
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}
.report-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: 0.22s ease;
}
.report-btn:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: rgba(244,214,160,0.06);
}
.report-btn.primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #14081d;
  border-color: transparent;
}
.footer-fineprint {
  color: var(--ink-mute);
  font-size: 11px;
  letter-spacing: 0.14em;
  margin-top: 24px;
}

/* ==========================================================================
   SIDE NAV (desktop)
   ========================================================================== */
.report-sidenav {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  display: grid;
  gap: 8px;
  padding: 16px 10px;
  border: 1px solid var(--gold-line-soft);
  border-radius: 999px;
  background: rgba(8,4,14,0.55);
  backdrop-filter: blur(10px);
  z-index: 20;
}
.sidenav-dot {
  display: block;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink-mute);
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  text-decoration: none;
  transition: 0.2s ease;
  cursor: pointer;
}
.sidenav-dot:hover,
.sidenav-dot.is-active {
  color: var(--gold);
  background: rgba(244,214,160,0.08);
}

/* Progress rail (top) */
.report-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 30;
  pointer-events: none;
}
.report-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, var(--gold-deep));
  transition: width 0.1s linear;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 960px) {
  .report-chapter { padding: 80px 20px; }
  .chapter-hero {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
  .chapter-hero.right .chapter-header { text-align: center; }
  .chapter-hero.right .chapter-epigraph,
  .chapter-epigraph {
    padding: 0 16px;
    border: none;
    border-top: 1px solid var(--gold-line);
    border-bottom: 1px solid var(--gold-line);
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .chapter-art {
    max-width: 280px;
    max-height: 460px;
    margin-inline: auto;
  }
  .chapter-hero.right .chapter-header,
  .chapter-hero.right .chapter-art {
    order: unset;
  }

  .card-section {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .card-section-art {
    position: static;
    max-width: 220px;
    margin-inline: auto;
  }
  .card-section-body p {
    text-align: left;
  }

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

  .report-sidenav {
    display: none;
  }
}

@media (max-width: 720px) {
  .report-body { font-size: 16px; }
  .report-cover { padding: 36px 20px 100px; }
  .cover-cards { height: 300px; }
  .cover-card { width: 140px; }
  .cover-card.pos-0 { transform: translateX(-110px) rotate(-8deg); }
  .cover-card.pos-2 { transform: translateX(110px) rotate(8deg); }
  .cover-title { font-size: clamp(36px, 11vw, 52px); }
  .cover-meta {
    padding: 18px 16px;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .cover-meta dd { font-size: 13px; }

  .report-toc { padding: 56px 20px; }
  .toc-num, .toc-text { font-size: 18px; }
  .toc-dots { display: none; }

  .chapter-body p { font-size: 16px; line-height: 1.92; }
  .chapter-body p:first-child::first-letter {
    font-size: 50px;
    padding: 6px 10px 0 0;
  }

  .letter-frame { padding: 44px 28px; }
  .letter-title { font-size: 30px; }

  .report-footer { padding: 60px 20px 100px; }
}

/* ==========================================================================
   PREVIEW MODE — locked chapters, letter teaser, paywall CTA
   ========================================================================== */

/* Notice banner under the cover meta block */
.preview-note {
  margin-top: 18px;
  padding: 14px 22px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(244, 214, 160, 0.24);
  background: rgba(244, 214, 160, 0.05);
  border-radius: 999px;
  color: rgba(251, 242, 223, 0.78);
  font-size: 12.5px;
  line-height: 1.7;
  max-width: 620px;
  text-align: left;
}
.preview-note strong {
  color: var(--gold);
}
.preview-note-dot {
  color: var(--gold);
  font-size: 14px;
}

/* TOC: locked rows dimmed with 待解鎖 label */
.toc-list li.is-locked {
  opacity: 0.62;
  cursor: default;
}
.toc-list li.is-locked:hover {
  padding-left: 0;
  border-bottom-color: var(--gold-line-soft);
}
.toc-list li.is-locked .toc-text { color: var(--ink-mute); }
.toc-list li.is-locked .toc-chars {
  color: var(--gold);
  font-style: italic;
}

/* Locked chapter: real text behind a blur veil + fade gradient + lock label */
.chapter-locked {
  position: relative;
  overflow: hidden;
  min-height: 560px;
}
.chapter-locked .chapter-hero {
  /* header stays fully visible so user sees the title + epigraph */
}
.chapter-locked .locked-body {
  filter: blur(10px);
  opacity: 0.55;
  user-select: none;
  pointer-events: none;
  transform: scale(1.02);
}
.chapter-locked .locked-body p {
  margin-bottom: 20px;
}
.chapter-locked::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(180deg, transparent 0%, rgba(8, 4, 14, 0.55) 40%, rgba(8, 4, 14, 0.98) 100%);
  pointer-events: none;
}

.chapter-lock-veil {
  position: absolute;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: 0.18em;
  z-index: 3;
  text-align: center;
}
.chapter-lock-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(244, 214, 160, 0.38);
  background: rgba(8, 4, 14, 0.6);
  font-size: 16px;
  margin-bottom: 4px;
}
.chapter-lock-text {
  font-size: 13px;
}

/* Letter teaser: blurred body + lock overlay centered */
.report-letter-locked .letter-frame {
  position: relative;
}
.letter-body-locked {
  filter: blur(14px);
  opacity: 0.5;
  user-select: none;
  pointer-events: none;
}
.letter-lock-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 10%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 34px;
  border-radius: 22px;
  background: radial-gradient(ellipse at center, rgba(8, 4, 14, 0.92), rgba(8, 4, 14, 0.75));
  border: 1px solid var(--gold-line);
  color: var(--ink);
  max-width: 380px;
  text-align: center;
}
.letter-lock-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #14081d;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}
.letter-lock-overlay p {
  margin: 2px 0;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--gold);
}
.letter-lock-overlay small {
  color: var(--ink-mute);
  font-size: 12.5px;
  line-height: 1.7;
}

/* Paywall section at the bottom of the preview */
.report-paywall {
  padding: 60px 32px 56px;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(244, 214, 160, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(20, 8, 29, 0.9), rgba(8, 4, 14, 0.98));
  border-top: 1px solid var(--gold-line);
}
.paywall-inner {
  width: min(640px, 100%);
  text-align: center;
  display: grid;
  gap: 22px;
  justify-items: center;
}
.paywall-eyebrow {
  color: var(--gold);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  padding: 6px 18px;
  border: 1px solid rgba(244, 214, 160, 0.28);
  border-radius: 999px;
  background: rgba(244, 214, 160, 0.04);
}
.paywall-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 4.4vw, 52px);
  margin: 0;
  background: linear-gradient(180deg, var(--ink) 0%, #f4dfb5 55%, var(--gold-deep) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.paywall-body {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.95;
  max-width: 560px;
}
.paywall-bullets {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 520px;
  text-align: left;
}
/* Two flex items only: the ✦ marker and ONE element wrapping the whole sentence.
   Previously the copy sat in the <li> as bare text nodes around a <strong>, and
   flex turned each run into its own item — four columns with a 12px gap between
   them, which scrambled the sentence into unreadable fragments on a 390px phone
   ("八章共約 / 9,000 – 10,000 字 / 的深探長讀" side by side). Keeping the text in
   a single .paywall-bullet-text element lets it wrap as normal inline copy. */
.paywall-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.7;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(8, 4, 14, 0.55);
  border: 1px solid var(--gold-line-soft);
}
.paywall-bullets li .paywall-bullet-mark {
  flex: none;
  color: var(--gold);
  font-size: 12px;
  padding-top: 6px;
}
.paywall-bullets li .paywall-bullet-text {
  flex: 1 1 auto;
  min-width: 0;
}
.paywall-bullets strong { color: var(--gold); font-weight: 600; }

.paywall-actions {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  justify-items: center;
  width: 100%;
}
.paywall-cta {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 24px;
  padding: 22px 52px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #14081d;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow:
    0 24px 60px -12px rgba(244, 214, 160, 0.4),
    0 0 0 1px rgba(244, 214, 160, 0.4);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.paywall-cta:hover {
  transform: translateY(-2px);
  box-shadow:
    0 32px 80px -12px rgba(244, 214, 160, 0.5),
    0 0 0 1px rgba(244, 214, 160, 0.6);
}
.paywall-cta-label {
  font-family: var(--serif);
}
.paywall-cta-price {
  font-family: "Cormorant Garamond", var(--serif);
  font-style: italic;
  font-size: 22px;
  padding-left: 24px;
  border-left: 1px solid rgba(20, 8, 29, 0.25);
}
/* Coupon redemption panel — minimal, lives below the main CTA. Hidden behind
   a "有兌換碼？" link so it doesn't compete with the primary purchase path. */
.paywall-coupon {
  margin-top: 18px;
  text-align: center;
}

.paywall-coupon .ghost-link {
  background: none;
  border: none;
  padding: 6px 4px;
  color: var(--ink-mute);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(244, 214, 160, 0.28);
  text-underline-offset: 4px;
  font-family: inherit;
}

.paywall-coupon .ghost-link:hover {
  color: var(--ink);
  text-decoration-color: var(--gold);
}

.coupon-panel {
  display: grid;
  gap: 10px;
  max-width: 420px;
  margin: 12px auto 0;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(244, 214, 160, 0.22);
  background: rgba(244, 214, 160, 0.06);
}

.coupon-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.coupon-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(244, 214, 160, 0.32);
  background: rgba(8, 4, 14, 0.6);
  color: var(--ink);
  font-size: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: auto;
}

.coupon-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}

.coupon-panel .soft-button {
  padding: 10px 18px;
  font-size: 13px;
  white-space: nowrap;
}

.coupon-message {
  margin: 0;
  font-size: 13px;
  color: #ffb0a0;
  text-align: left;
  line-height: 1.55;
}

@media (max-width: 520px) {
  .coupon-row { flex-direction: column; }
  .coupon-panel .soft-button { width: 100%; }
}

.paywall-fineprint {
  color: var(--ink-mute);
  font-size: 12px;
  line-height: 1.75;
  margin: 0;
  max-width: 420px;
}

/* Locked chapters — compact grid version (replaces 7 full-height locked chapters).
   Each card ~130px tall × 2 columns → all 7 fit in ~540px vs ~4000px previously.
   Keeps the narrative tease (title + epigraph) but removes scroll fatigue so
   the paywall lands sooner. */
.locked-chapters-section {
  max-width: 920px;
  margin: 64px auto 0;
  padding: 0 24px;
}

.locked-chapters-header {
  text-align: center;
  margin-bottom: 32px;
}

.locked-chapters-eyebrow {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.24em;
  color: var(--gold);
  margin-bottom: 12px;
}

.locked-chapters-title {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.35;
  color: var(--ink);
  margin: 0 0 10px;
  font-weight: 500;
}

.locked-chapters-copy {
  color: var(--ink-mute);
  font-size: 14px;
  line-height: 1.75;
  max-width: 540px;
  margin: 0 auto;
}

.locked-chapters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.locked-chapter-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(244, 214, 160, 0.16);
  background:
    linear-gradient(180deg, rgba(38, 18, 64, 0.55), rgba(14, 8, 22, 0.72));
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.locked-chapter-card:hover {
  border-color: rgba(244, 214, 160, 0.32);
  transform: translateY(-1px);
}

.locked-chapter-art {
  margin: 0;
  width: 96px;
  height: 144px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(244, 214, 160, 0.22);
  background: rgba(0, 0, 0, 0.2);
  filter: saturate(0.9) brightness(0.82);
}

.locked-chapter-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.locked-chapter-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.locked-chapter-number {
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
}

.locked-chapter-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
  font-weight: 500;
}

.locked-chapter-epigraph {
  margin: 0;
  color: var(--ink-mute);
  font-size: 12.5px;
  line-height: 1.55;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.locked-chapter-lock {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(244, 214, 160, 0.12);
  border: 1px solid rgba(244, 214, 160, 0.28);
  color: var(--gold);
  font-size: 10px;
  z-index: 2;
}

@media (max-width: 720px) {
  .preview-note { margin-inline: 14px; font-size: 12px; }
  .letter-lock-overlay { padding: 22px 24px; max-width: 300px; }
  .paywall-cta { flex-direction: column; gap: 4px; padding: 18px 32px; }
  .paywall-cta-price { padding-left: 0; border: none; }

  /* Compact grid: single column on small screens but keep the landscape-ish
     card layout (art + text side by side) so each card stays ~140px tall. */
  .locked-chapters-section { padding: 0 14px; margin-top: 44px; }
  .locked-chapters-title { font-size: 24px; }
  .locked-chapters-grid { grid-template-columns: 1fr; gap: 10px; }
  .locked-chapter-card { padding: 10px; gap: 12px; }
  .locked-chapter-art { width: 80px; height: 120px; }
  .locked-chapter-title { font-size: 15px; }
}

/* ==========================================================================
   PRINT — optimized for Chrome/Safari print-to-PDF
   ==========================================================================
   Problem we are fixing: Chrome's print engine does not reliably resolve
   `aspect-ratio` inside grid `fr` columns, so any image sized by aspect-ratio
   collapses to 0×0 and disappears. Everything that must render in PDF gets
   explicit pixel dimensions here.
   ========================================================================== */
@media print {
  @page {
    margin: 18mm 16mm 22mm;
  }

  html, body, .report-body {
    background: #ffffff !important;
    color: #14081d !important;
    font-size: 11.5pt;
    line-height: 1.75;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-loading,
  .report-sidenav,
  .report-progress,
  .footer-actions,
  .cover-scroll,
  .cover-ambient,
  .cover-stars {
    display: none !important;
  }

  /* ---------- COVER (page 1) ---------- */
  .report-cover {
    min-height: auto;
    padding: 0 0 24px;
    /* No forced page break here — the cover-cards + title + meta fit on page 1
       naturally, and the .report-toc's break-before rule takes care of moving
       the TOC onto page 2 without creating an empty page between them. */
  }
  .cover-inner { gap: 18px; padding-top: 10px; }
  .cover-brand { color: #8a5a20; }
  .cover-brand-copy strong { color: #14081d; }
  .cover-brand-copy small { color: #6a4418; }

  .cover-cards {
    width: 480px;
    height: 300px;
  }
  .cover-card {
    width: 160px !important;
    height: 266px !important;
    aspect-ratio: auto !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
    border: 1px solid #d9c69a;
  }
  .cover-card img {
    width: 160px !important;
    height: 266px !important;
    object-fit: cover !important;
    display: block !important;
  }

  .cover-title,
  .chapter-title,
  .letter-title,
  .cover-subtitle {
    -webkit-text-fill-color: #14081d !important;
    background: none !important;
    color: #14081d !important;
  }
  .cover-title { font-size: 40pt; }
  .cover-eyebrow, .cover-mood { color: #8a5a20 !important; }
  .cover-mood {
    border-color: #c9a256;
    background: #fdf6e6;
  }
  .cover-meta {
    border-color: #d9c69a;
    background: #fdf8ec;
    backdrop-filter: none;
  }
  .cover-meta dt { color: #6a4418 !important; }
  .cover-meta dd { color: #14081d !important; }

  /* ---------- TOC (page 2) ---------- */
  /* Break BEFORE the TOC so it starts on page 2, but NOT after — the next
     chapter's own `break-before: page` handles the jump to page 3. Previously
     we had both rules firing which produced an empty page. */
  .report-toc {
    padding: 20px 0;
    background: none;
    border: none;
    break-before: page;
  }
  .toc-eyebrow { color: #8a5a20 !important; }
  .toc-list li {
    border-bottom-color: #c9a256;
    break-inside: avoid;
  }
  .toc-num, .toc-text { color: #14081d !important; }
  .toc-chars { color: #6a4418 !important; }
  .toc-dots { border-bottom-color: #c9a256; }

  /* ---------- CHAPTER ---------- */
  .report-chapter {
    padding: 20px 0 24px;
    border-bottom: none;
    break-before: page;
    break-inside: auto;
  }
  .report-chapter::before { display: none; }

  /* Collapse the two-column hero into a single block with a floated card.
     Fixed pixel sizes so the print engine doesn't depend on aspect-ratio. */
  .chapter-hero {
    display: block !important;
    grid-template-columns: none !important;
    margin: 0 0 18px !important;
    gap: 0 !important;
    break-inside: avoid;
  }
  .chapter-hero.right .chapter-header { order: unset; text-align: left; }

  .chapter-art {
    float: left;
    width: 140px !important;
    height: 234px !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    margin: 4px 22px 10px 0 !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2) !important;
    border: 1px solid #d9c69a;
    background: #f5eddf;
  }
  .chapter-art img {
    display: block !important;
    width: 140px !important;
    height: 234px !important;
    object-fit: cover !important;
    filter: none !important;
  }
  .chapter-art::after { display: none !important; }

  .chapter-header {
    display: block;
    padding-top: 6px;
  }
  .chapter-number {
    color: #8a5a20 !important;
    font-size: 10pt;
    margin-bottom: 6px;
  }
  .chapter-title {
    font-size: 28pt !important;
    line-height: 1.12 !important;
    margin: 0 0 10px !important;
  }
  .chapter-epigraph {
    color: #5a4030 !important;
    font-size: 10.5pt;
    padding: 0 0 0 14px !important;
    border: none !important;
    border-left: 2px solid #ca8e47 !important;
  }
  .chapter-hero.right .chapter-epigraph {
    padding-right: 0 !important;
    border-right: none !important;
  }

  .chapter-body {
    clear: both;
    width: 100%;
    max-width: none;
  }
  .chapter-body p {
    color: #1a0a2a !important;
    font-size: 11.5pt;
    line-height: 1.78;
    orphans: 3;
    widows: 3;
  }
  .chapter-body p:first-child::first-letter {
    color: #ca8e47 !important;
    font-size: 44pt;
  }

  /* ---------- CARD TRIPTYCH (Chapter II) ---------- */
  .card-triptych {
    display: block;
    gap: 0;
  }
  .card-section {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    margin: 18px 0 !important;
    break-inside: avoid;
    clear: both;
  }
  .card-section-art {
    float: left;
    width: 120px !important;
    height: 200px !important;
    aspect-ratio: auto !important;
    max-height: none !important;
    position: static !important;
    margin: 4px 20px 10px 0 !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2) !important;
    border: 1px solid #d9c69a;
  }
  .card-section-art img {
    display: block !important;
    width: 120px !important;
    height: 200px !important;
    object-fit: cover !important;
  }
  .card-section-body { display: block; }
  .card-section-slot { color: #8a5a20 !important; font-size: 9pt; }
  .card-section-title {
    color: #14081d !important;
    font-size: 20pt;
    margin: 2px 0 8px;
  }
  .card-section-body p {
    color: #1a0a2a !important;
    font-size: 11.5pt;
    line-height: 1.76;
  }

  /* ---------- LETTER ---------- */
  .report-letter {
    padding: 20px 0 10px;
    background: none;
    border-top: none;
    break-before: page;
  }
  .letter-frame {
    padding: 30px 24px;
    border: 1px solid #ca8e47 !important;
    background: #fdf8ec !important;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08) !important;
    break-inside: avoid;
  }
  .letter-wax {
    background: linear-gradient(135deg, #ca8e47, #8a5a20) !important;
    color: #fdf8ec !important;
    box-shadow: none !important;
  }
  .letter-eyebrow { color: #8a5a20 !important; }
  .letter-title { font-size: 22pt; }
  .letter-epigraph { color: #6a4418 !important; }
  .letter-body p { color: #1a0a2a !important; font-size: 11.5pt; line-height: 1.76; }
  .letter-signature { color: #8a5a20 !important; }

  /* ---------- FOOTER ---------- */
  .report-footer { padding: 16px 0 4px; break-inside: avoid; }
  .footer-tag { color: #8a5a20 !important; }
  .footer-note, .footer-fineprint { color: #6a4418 !important; }
}
