/* ==========================================================================
   DUAL-MODE CINEMA STAGE & VERTICAL ILLUSTRATED NOVEL READER
   Obsidian & Antique Champagne Gold · Desktop + Mobile Portrait + Landscape
   ========================================================================== */

/* ---- Cinema Full-Viewport Lock (Zero Outer Bounce / Zero Pull-to-Refresh) ---- */
html:has(body.in-cinema-reader),
body.in-cinema-reader {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

body.in-cinema-reader .main-stage {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.in-cinema-reader #readerView.active {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* ---- Top Bar (Unified across Cinema & Scroll modes) ---- */
.reader-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
  background: var(--bg-reader-bar);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transition: transform 0.25s var(--ease-cinema), opacity 0.25s ease;
}

.reader-sticky-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 9px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reader-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.reader-brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 4px 3px 2px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: opacity 0.18s ease, transform 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.reader-brand-btn:hover {
  opacity: 0.9;
}

.reader-brand-btn:active {
  transform: scale(0.95);
}

.reader-brand-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(226, 186, 109, 0.2);
}

.reader-brand-text {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1;
}

.reader-left-divider {
  width: 1px;
  height: 16px;
  background: var(--border-medium);
  flex-shrink: 0;
}

.reader-ep-crumb {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.18s ease, color 0.18s ease;
}

.reader-ep-crumb:hover {
  background: var(--bg-segment);
  color: var(--text-primary);
}

.reader-ep-crumb strong {
  color: var(--text-primary);
  font-weight: 600;
}

.reader-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* 2026 Unified Segmented Controls & Switches */
.segmented-control {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-sm);
  background: var(--bg-segment);
  border: 1px solid var(--border-subtle);
}

.segmented-control.compact {
  padding: 2px;
  border-radius: 9px;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn:active {
  transform: scale(0.96);
}

.seg-btn.on {
  background: var(--bg-segment-active);
  color: var(--gold-primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--border-gold-soft);
}

.theme-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(128, 128, 128, 0.35);
}

.theme-dot.dark { background: #101522; }
.theme-dot.sepia { background: #eadbc2; }
.theme-dot.light { background: #f8fafc; }

.reader-typo-inline {
  display: inline-flex;
}

.reader-settings-btn {
  display: inline-flex;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.reader-bgm-top.on,
.dock-bgm-btn.on {
  color: var(--gold-primary) !important;
  border-color: var(--border-gold) !important;
  background: var(--gold-glow) !important;
}

.reader-autoplay-top.playing,
.dock-autoplay-btn.playing {
  background: rgba(229, 190, 112, 0.2) !important;
  border-color: var(--border-gold) !important;
  color: var(--gold-primary) !important;
  box-shadow: 0 0 18px rgba(229, 190, 112, 0.18);
}

.reader-mode-group {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-sm);
  background: var(--bg-segment);
  border: 1px solid var(--border-subtle);
}

.reader-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.reader-mode-pill:hover {
  color: var(--text-primary);
}

.reader-mode-pill.on {
  background: var(--bg-segment-active);
  color: var(--gold-primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--border-gold-soft);
}

.reader-mode-pill .rm-short {
  display: none;
}

.scroll-progress-line {
  width: 100%;
  height: 2px;
  background: var(--border-subtle);
}

.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold-primary));
  transition: width 0.2s var(--ease-cinema);
}

/* Unified Reader Settings Popover (Desktop) / Native Bottom Sheet (Mobile) */
.settings-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 62;
  background: rgba(4, 6, 12, 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.rsp-sheet-handle,
.rsp-mob-only-row,
.rsp-close-mob {
  display: none;
}

.reader-settings-popover {
  display: none;
  position: fixed;
  top: 56px;
  right: 18px;
  z-index: 65;
  width: 364px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 76px);
  overflow-y: auto;
  padding: 16px 18px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-popover);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-gold-soft);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
  flex-direction: column;
  gap: 11px;
}

.reader-settings-popover.open {
  display: flex;
  animation: fadeInCinema 0.2s var(--ease-cinema) forwards;
}

.rsp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.rsp-sheet-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}

.rsp-sheet-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-segment);
  border: 1px solid var(--border-subtle);
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.rsp-sheet-close:hover {
  color: var(--text-primary);
  border-color: var(--border-gold-soft);
  background: var(--gold-glow);
}

.rsp-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-top: 2px;
}

.rsp-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 2px 0;
}

.rsp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

.rsp-row.rsp-mob-only-row {
  display: none;
}

.rsp-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Font Size Stepper with Live Percentage Readout */
.font-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-segment);
  border: 1px solid var(--border-subtle);
}

.stepper-btn {
  min-width: 38px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.stepper-btn:hover:not(:disabled) {
  background: var(--gold-glow);
  color: var(--gold-primary);
}

.stepper-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper-readout {
  min-width: 46px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-primary);
  font-variant-numeric: tabular-nums;
}

/* iOS / macOS 2026 Toggle Switch */
.ui-switch {
  position: relative;
  width: 44px;
  height: 25px;
  border-radius: var(--radius-pill);
  background: var(--bg-switch-off);
  border: 1px solid var(--border-subtle);
  padding: 2px;
  flex-shrink: 0;
  transition: background 0.22s var(--ease-cinema), border-color 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.ui-switch-knob {
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--switch-knob);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  transform: translateX(0);
  transition: transform 0.24s var(--ease-spring);
}

.ui-switch.on,
.ui-switch[aria-checked='true'] {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
}

.ui-switch.on .ui-switch-knob,
.ui-switch[aria-checked='true'] .ui-switch-knob {
  transform: translateX(19px);
  background: #141008;
}

/* BGM Volume Slider */
.rsp-volume-row {
  transition: opacity 0.2s ease;
}

.rsp-volume-row.muted {
  opacity: 0.45;
}

.rsp-slider-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 180px;
}

.rsp-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--bg-switch-off);
  outline: none;
  cursor: pointer;
}

.rsp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-primary);
  border: 2px solid var(--bg-popover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.14s ease;
}

.rsp-range::-webkit-slider-thumb:hover {
  transform: scale(1.14);
}

.rsp-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-primary);
  border: 2px solid var(--bg-popover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.rsp-range-val {
  min-width: 34px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   FIXED CINEMA STAGE MODE (1 SENTENCE = 1 STATIC-FRAME ANIMATED STAGE)
   ========================================================================== */

.cinema-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Dynamic Ambient Cinema Color Bleed (Apple TV+ / YouTube Ambient Mode) */
.cinema-ambient-bg {
  position: absolute;
  inset: -12%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(68px) saturate(1.45) brightness(0.56);
  opacity: 0.28;
  pointer-events: none;
  transition: opacity 0.45s ease;
  transform: translate3d(0, 0, 0);
}

html[data-theme='sepia'] .cinema-ambient-bg,
html[data-theme='light'] .cinema-ambient-bg {
  opacity: 0.09;
  filter: blur(72px) saturate(1.25) brightness(1.05);
}

.cinema-body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 24px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
}

/* ---- Fixed 16:9 Artwork Viewport ---- */
.cinema-visual-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.cinema-frame {
  position: relative;
  width: min(100%, 920px, calc((100dvh - 318px) * 16 / 9));
  min-width: min(100%, 340px);
  aspect-ratio: 16 / 9;
  border-radius: 15px;
  overflow: hidden;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(226, 186, 109, 0.08);
  touch-action: none;
}

/* Dual-buffer crossfade layers (Zero flash!) */
@keyframes cinemaKenBurns {
  from {
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.042) translate3d(-0.55%, -0.35%, 0);
  }
}

.cinema-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  will-change: opacity, transform;
  transition: opacity 0.36s var(--ease-cinema);
}

.cinema-img.under {
  opacity: 1;
  z-index: 1;
}

.cinema-img.active {
  opacity: 1;
  z-index: 2;
}

.cinema-img.ken-burns {
  animation: cinemaKenBurns 18s ease-out forwards;
}

/* Invisible-to-eye Decoy Watermark Layer (Read clean · Save/Copy yields full CineTale watermark) */
.cinema-decoy-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.cinema-decoy-img.ready {
  opacity: 0.004;
  pointer-events: auto;
}

/* Top-left subtle chapter ribbon pill */
.cinema-chapter-pill {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 6;
  max-width: calc(100% - 28px);
  padding: 4px 11px;
  border-radius: 99px;
  background: rgba(8, 11, 18, 0.64);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 186, 109, 0.24);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #efe2c4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0.92;
  transition: opacity 0.35s ease;
}

.cinema-chapter-pill.subtle {
  opacity: 0.56;
}

/* Desktop Glassmorphic SMS Overlay */
.cinema-sms-overlay {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 8;
  max-width: min(370px, calc(100% - 28px));
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(106, 211, 232, 0.38);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.6);
  animation: fadeInCinema 0.35s var(--ease-cinema) forwards;
}

.cinema-sms-overlay.overwrite {
  border-color: rgba(217, 107, 118, 0.48);
  background: rgba(22, 12, 24, 0.88);
}

.cinema-sms-overlay .inline-sms-top {
  margin-bottom: 5px;
  font-size: 10.5px;
}

.cinema-sms-overlay .inline-sms-zh {
  font-size: 15px;
  line-height: 1.48;
}

.cinema-sms-overlay .inline-sms-vi {
  font-size: 12px;
  margin-top: 4px;
}

.cinema-sms-close {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cinema-sms-close:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Left / Right Edge Tap Zones on the Image Frame */
.cinema-tap-zone {
  position: absolute;
  top: 0;
  bottom: 34px;
  width: 24%;
  z-index: 5;
  display: flex;
  align-items: center;
  background: transparent;
  padding: 0 14px;
  -webkit-tap-highlight-color: transparent;
}

.cinema-tap-zone.left {
  left: 0;
  justify-content: flex-start;
}

.cinema-tap-zone.right {
  right: 0;
  justify-content: flex-end;
}

.cinema-tap-zone .tap-chevron {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(8, 11, 18, 0.56);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f6eedf;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.22s ease, transform 0.22s ease, border-color 0.2s ease;
}

.cinema-frame:hover .cinema-tap-zone:not(:disabled) .tap-chevron {
  opacity: 0.72;
  transform: scale(1);
}

.cinema-frame:hover .cinema-tap-zone:not(:disabled):hover .tap-chevron {
  opacity: 1;
  transform: scale(1.06);
  border-color: rgba(226, 186, 109, 0.56);
  color: var(--gold-primary);
}

.cinema-tap-zone:disabled {
  cursor: default;
}

/* Bottom-left subtle brand watermark inside 16:9 cinema frame */
.cinema-brand-mark {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 8;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(246, 238, 223, 0.62);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  user-select: none;
}

.cinema-brand-mark span {
  color: rgba(235, 198, 122, 0.78);
}

/* Bottom-right subtle frame badge inside frame (no caption obscuring artwork) */
.cinema-frame-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 8;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.cinema-frame-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(6, 9, 17, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #f3d289;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

/* Top-right floating quick action pills in Movie Mode */
.cinema-movie-quickbar {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 9;
  align-items: center;
  gap: 6px;
}

body.reader-movie-mode .cinema-movie-quickbar {
  display: inline-flex;
}

.movie-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 99px;
  background: rgba(8, 11, 18, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11.5px;
  font-weight: 500;
  color: #eef2f9;
  opacity: 0.82;
  transition: opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.movie-quick-btn:hover {
  opacity: 1;
  background: rgba(12, 16, 28, 0.9);
  border-color: rgba(226, 186, 109, 0.48);
  color: #f6d998;
}

.movie-quick-btn.saved {
  opacity: 1;
  color: #f6d998;
  border-color: rgba(226, 186, 109, 0.52);
  background: rgba(226, 186, 109, 0.2);
}

.movie-quick-btn.saved svg {
  fill: #f6d998;
}

/* Movie Theater Subtitle Overlay (Tiếng Hoa + Pinyin + Nghĩa Việt ON artwork frame) */
.cinema-movie-sub {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  max-height: 58%;
  padding: 46px 96px 14px;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background: linear-gradient(
    180deg,
    rgba(4, 6, 12, 0) 0%,
    rgba(4, 6, 12, 0.44) 28%,
    rgba(4, 6, 12, 0.84) 70%,
    rgba(4, 6, 12, 0.94) 100%
  );
  pointer-events: none;
}

body.reader-movie-mode .cinema-movie-sub {
  display: flex;
}

.cinema-movie-sub-inner {
  pointer-events: auto;
  max-width: min(94%, 860px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  text-align: center;
  padding: 2px 8px 2px;
  user-select: text;
  -webkit-user-select: text;
  scrollbar-width: thin;
}

.movie-speaker-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(8, 11, 18, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--speaker-color, #f5d58c);
}

.movie-speaker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--speaker-color, #f5d58c);
  box-shadow: 0 0 8px var(--speaker-color, transparent);
}

.cinema-movie-sub-inner .prose-zh {
  font-size: calc(var(--reader-zh-size, 19.5px) * 0.96);
  line-height: 1.5;
  font-weight: 500;
  color: #fffdf8;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.96),
    0 0 18px rgba(0, 0, 0, 0.88);
}

.cinema-movie-sub-inner .prose-pinyin {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.42;
  color: #f5d58c;
  opacity: 0.98;
  text-shadow:
    0 1px 5px rgba(0, 0, 0, 0.96),
    0 0 14px rgba(0, 0, 0, 0.86);
}

.cinema-movie-sub-inner .prose-vi {
  margin-top: 4px;
  font-size: calc(var(--reader-vi-size, 14.5px) * 1.02);
  line-height: 1.48;
  color: #eef3fb;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.96),
    0 0 16px rgba(0, 0, 0, 0.88);
}

.reader-hide-zh .cinema-movie-sub-inner .prose-vi {
  color: #fffdf8;
}

.cinema-movie-sub-inner .vocab-word {
  border-bottom-color: rgba(245, 213, 140, 0.56);
}

/* Expand Cinema Frame in Movie Subtitle Mode (dialogue box below is hidden) */
body.reader-movie-mode .cinema-dialogue-panel {
  display: none !important;
}

body.reader-movie-mode .cinema-body {
  max-width: 1260px;
}

body.reader-movie-mode .cinema-frame {
  width: min(100%, 1180px, calc((100dvh - 148px) * 16 / 9));
}

body.reader-movie-mode .cinema-sms-overlay {
  top: 50px;
}

body.cinema-immersive.reader-movie-mode .cinema-body {
  max-width: 1380px;
}

body.cinema-immersive.reader-movie-mode .cinema-frame {
  width: min(100%, 1340px, calc((100dvh - 28px) * 16 / 9));
}

/* First-time floating gesture hint */
.cinema-gesture-hint {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  z-index: 7;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(8, 11, 18, 0.84);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 186, 109, 0.36);
  font-size: 11.5px;
  color: #f3e4c3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  animation: fadeInCinema 0.35s var(--ease-cinema) forwards;
}

/* ---- Fixed Bilingual Dialogue / Prose Panel ---- */
.cinema-dialogue-panel {
  position: relative;
  width: min(100%, 920px);
  flex: 1;
  min-height: 138px;
  max-height: 270px;
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  background: var(--bg-dialogue);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.cinema-dialogue-panel.is-dialogue {
  box-shadow:
    inset 3px 0 0 var(--speaker-color, var(--gold-soft)),
    0 16px 40px rgba(0, 0, 0, 0.18);
  border-color: var(--border-medium);
}

.cinema-speaker-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 8px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.cinema-speaker-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cinema-speaker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--speaker-color, var(--text-muted));
  box-shadow: 0 0 10px var(--speaker-color, transparent);
  flex-shrink: 0;
}

.cinema-speaker-name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--speaker-color, var(--text-secondary));
  white-space: nowrap;
}

.cinema-speaker-zh {
  font-family: var(--font-zh);
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.cinema-speaker-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cinema-speak-btn,
.cinema-bookmark-btn {
  opacity: 0.85 !important;
}

.cinema-bookmark-btn.saved {
  color: var(--gold-primary);
  background: rgba(226, 186, 109, 0.14);
  opacity: 1 !important;
}

.cinema-bookmark-btn.saved svg {
  fill: var(--gold-primary);
}

.cinema-prose-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 20px 16px;
  user-select: text;
  -webkit-user-select: text;
}

.cinema-prose-inner {
  will-change: transform, opacity;
  transition: transform 0.16s ease-out;
}

@keyframes cinemaTextNext {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.cinema-prose-inner.anim-next {
  animation: cinemaTextNext 0.24s var(--ease-cinema) forwards;
}

.cinema-prose-inner.anim-prev {
  animation: cinemaTextPrev 0.24s var(--ease-cinema) forwards;
}

/* Inline Scene Keywords Strip (1-tap bilingual lookup & pronunciation) */
.cinema-vocab-strip {
  display: none;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 18px 11px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-glass-subtle);
}

.cinema-vocab-strip.has-items {
  display: flex;
}

.scene-vocab-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-right: 2px;
}

.scene-vocab-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-segment);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.scene-vocab-chip:hover {
  border-color: var(--border-gold);
  background: var(--gold-glow);
  color: var(--text-primary);
}

.scene-vocab-chip:active {
  transform: scale(0.96);
}

.scene-vocab-chip .svc-zh {
  font-family: var(--font-zh);
  font-weight: 600;
  color: var(--gold-primary);
}

.scene-vocab-chip .svc-mean {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Overflow scroll hint for the ~5% extra-long sentences */
.cinema-overflow-cue {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px 5px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--gold-primary);
  background: var(--bg-overflow-fade);
  pointer-events: none;
}

.cinema-dialogue-panel.has-overflow-bottom .cinema-overflow-cue {
  display: block;
}

/* Immersive Fullscreen / Focus Reading Mode */
.cinema-immersive-exit {
  display: none;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  z-index: 80;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  color: #f6eedf;
  background: rgba(8, 11, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 186, 109, 0.36);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.cinema-immersive-exit:hover {
  background: rgba(16, 22, 36, 0.92);
  color: #fff;
}

body.cinema-immersive .reader-sticky-bar,
body.cinema-immersive .cinema-dock {
  display: none !important;
}

body.cinema-immersive .cinema-immersive-exit {
  display: inline-flex;
}

body.cinema-immersive .cinema-body {
  max-width: 1160px;
  padding: 10px 20px max(12px, env(safe-area-inset-bottom));
}

body.cinema-immersive .cinema-frame {
  width: min(100%, 1080px, calc((100dvh - 208px) * 16 / 9));
}

body.cinema-immersive .cinema-dialogue-panel {
  width: min(100%, 1080px);
  max-height: 210px;
}

/* Mobile inline SMS inside dialogue box (shown on phones so artwork stays 100% clear) */
.cinema-inline-sms {
  display: none;
  margin: 0 0 11px;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(11, 17, 31, 0.9);
  border: 1px solid rgba(106, 211, 232, 0.34);
}

.cinema-inline-sms.overwrite {
  border-color: rgba(217, 107, 118, 0.44);
  background: rgba(24, 13, 26, 0.88);
}

.cinema-inline-sms .inline-sms-top {
  font-size: 10px;
  margin-bottom: 4px;
}

.cinema-inline-sms .inline-sms-zh {
  font-size: 15px;
}

.cinema-inline-sms .inline-sms-vi {
  font-size: 12.5px;
  margin-top: 3px;
}

/* ---- Chapter Ending Stage (Final Step) ---- */
.cinema-end-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: fadeInCinema 0.32s var(--ease-cinema) forwards;
}

.cinema-end-stage .chapter-end-card {
  margin-top: 0;
  max-width: 640px;
  width: 100%;
}

.cinema-end-thumb {
  width: 220px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 14px;
  border: 1px solid rgba(226, 186, 109, 0.28);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

/* ---- Bottom Timeline Scrubber & Thumb Dock ---- */
.cinema-dock {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  width: 100%;
  background: var(--bg-reader-bar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding: 4px 20px max(10px, env(safe-area-inset-bottom));
}

.cinema-scrubber {
  position: relative;
  max-width: 920px;
  margin: 0 auto 4px;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.scrubber-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: var(--border-medium);
  overflow: visible;
  transition: height 0.15s ease;
}

.cinema-scrubber:hover .scrubber-track,
.cinema-scrubber.scrubbing .scrubber-track {
  height: 6px;
}

.scrubber-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #b98b3e, var(--gold-primary));
  transition: width 0.16s linear;
}

.cinema-scrubber.scrubbing .scrubber-fill {
  transition: none;
}

.scrubber-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fbf3df;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 12px rgba(226, 186, 109, 0.6);
  transform: translate(-50%, -50%) scale(0.82);
  transition: transform 0.15s ease, left 0.16s linear;
}

.cinema-scrubber:hover .scrubber-thumb,
.cinema-scrubber.scrubbing .scrubber-thumb {
  transform: translate(-50%, -50%) scale(1.12);
}

.cinema-scrubber.scrubbing .scrubber-thumb {
  transition: transform 0.15s ease;
}

.scrubber-tooltip {
  position: absolute;
  bottom: 24px;
  left: 0%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--bg-popover);
  border: 1px solid var(--border-gold);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-primary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.cinema-scrubber.scrubbing .scrubber-tooltip,
.cinema-scrubber.hovering .scrubber-tooltip {
  opacity: 1;
}

.cinema-dock-row {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dock-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 86px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-glass-subtle);
  border: 1px solid var(--border-medium);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.dock-nav-btn:hover:not(:disabled) {
  background: var(--gold-glow);
  border-color: var(--border-gold);
}

.dock-nav-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.dock-nav-btn.primary {
  background: var(--gold-glow);
  border-color: var(--border-gold);
  color: var(--text-primary);
  font-weight: 600;
}

.dock-nav-btn.primary:hover:not(:disabled) {
  border-color: var(--gold-primary);
}

.dock-nav-btn:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

.dock-center-tools {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dock-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-segment);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.dock-pill-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-gold);
}

.dock-pill-btn:active {
  transform: scale(0.96);
}

.dock-pill-btn.speaking,
.dock-pill-btn.on {
  color: var(--gold-primary);
  border-color: var(--border-gold);
  background: var(--gold-glow);
}

.dock-voice-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan-time);
  flex-shrink: 0;
}

.dock-voice-btn.on .dock-voice-dot {
  background: var(--gold-primary);
}

.dock-bgm-btn {
  width: 34px;
  padding: 0;
}

.dock-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  min-width: 54px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   CLASSIC VERTICAL SCROLL MODE (TOGGLED OPTION)
   ========================================================================== */

.chapter-article {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 28px 84px;
}

/* Editorial Chapter Header */
.chapter-hero-head {
  text-align: center;
  padding-bottom: 32px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-subtle);
}

.chapter-eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 10px;
}

.chapter-main-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.chapter-zh-sub {
  font-family: var(--font-zh-serif);
  font-size: 17px;
  letter-spacing: 0.14em;
  color: var(--text-pinyin);
  opacity: 0.9;
}

.chapter-meta-pills {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Continuous Illustrated Story Stream */
.story-scene {
  margin-bottom: 30px;
  animation: fadeInCinema 0.45s var(--ease-cinema) forwards;
}

.scene-figure {
  margin: 0 0 10px;
}

.scene-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.scene-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 1.2s var(--ease-cinema);
}

.scene-frame img.scene-clean-img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.scene-frame img.scene-decoy-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: none;
  -webkit-user-drag: none;
}

.scene-frame img.scene-decoy-img.ready {
  opacity: 0.004;
  pointer-events: auto;
}

.scene-frame:hover img.scene-clean-img {
  transform: scale(1.022);
}

.scene-caption {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.025em;
  padding: 0 4px;
}

.scene-frame-num {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px;
  color: rgba(226, 186, 109, 0.72);
  letter-spacing: 0.06em;
}

/* Sleek In-Story SMS / Sword Letter Card */
.inline-sms-card {
  margin: -6px 0 22px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(11, 17, 31, 0.85);
  border: 1px solid rgba(106, 211, 232, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.inline-sms-card.overwrite {
  border-color: rgba(217, 107, 118, 0.42);
  background: rgba(20, 13, 24, 0.82);
}

.inline-sms-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cyan-time);
  margin-bottom: 8px;
}

.inline-sms-card.overwrite .inline-sms-top,
.cinema-sms-overlay.overwrite .inline-sms-top,
.cinema-inline-sms.overwrite .inline-sms-top {
  color: #f09aa3;
}

.inline-sms-zh {
  font-family: var(--font-zh);
  font-size: 18px;
  font-weight: 500;
  color: #f2fafe;
  line-height: 1.55;
}

.inline-sms-vi {
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Shared Literary Typography (Used in BOTH Cinema & Scroll modes) */
.prose-stack {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--bg-card-soft);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
}

.prose-block {
  position: relative;
  padding: 16px 22px 16px 24px;
  background: transparent;
  border-top: 1px solid var(--border-subtle);
  transition: background 0.2s ease;
}

.prose-block:first-child {
  border-top: none;
}

.prose-block.continuation {
  border-top: none;
  padding-top: 4px;
}

.prose-block:hover {
  background: var(--bg-glass-subtle);
}

.prose-block.dialogue {
  box-shadow: inset 2.5px 0 0 var(--speaker-color, var(--gold-soft));
  background: var(--bg-glass-subtle);
}

.prose-block.dialogue:hover {
  background: var(--gold-glow);
}

.prose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.prose-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.prose-bookmark-btn.saved {
  color: var(--gold-primary);
  background: var(--gold-glow);
  opacity: 1 !important;
}

.prose-bookmark-btn.saved svg {
  fill: var(--gold-primary);
}

.prose-block.continuation .prose-head {
  margin-bottom: 2px;
}

.prose-speaker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--speaker-color, var(--text-muted));
}

.prose-speaker-zh {
  font-family: var(--font-zh);
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11.5px;
}

.prose-speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  opacity: 0.86;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.12s ease;
}

.prose-block:hover .prose-speak-btn,
.prose-speak-btn.speaking {
  opacity: 1;
}

.prose-speak-btn:hover,
.prose-speak-btn.speaking {
  color: var(--gold-primary);
  background: var(--gold-glow);
}

.prose-zh {
  font-family: var(--font-zh);
  font-size: var(--reader-zh-size, 19.5px);
  line-height: 1.72;
  color: var(--text-prose-zh);
  letter-spacing: 0.02em;
}

.prose-zh.has-open-quote {
  text-indent: -0.46em;
}

.prose-pinyin {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-pinyin);
  opacity: 0.94;
}

.prose-vi {
  margin-top: 8px;
  font-size: var(--reader-vi-size, 14.5px);
  line-height: 1.68;
  color: var(--text-prose-vi);
}

.prose-continuation-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.prose-note-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

body.reader-movie-mode .prose-continuation-note {
  margin-top: 8px;
  padding-top: 7px;
  border-top-color: rgba(255, 255, 255, 0.14);
}

body.reader-movie-mode .prose-note-label {
  color: #f5d58c;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.92);
}

.reader-hide-zh .prose-zh,
.reader-hide-zh .cinema-vocab-strip,
.reader-hide-pinyin .prose-pinyin,
.reader-hide-vi .prose-vi {
  display: none !important;
}

.reader-hide-zh .prose-vi {
  margin-top: 0;
  font-size: calc(var(--reader-vi-size, 14.5px) + 2px);
  color: var(--text-prose-zh);
}

/* Chapter Footer Navigation */
.chapter-end-card {
  margin-top: 52px;
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  background: var(--bg-card-grad);
  border: 1px solid var(--border-gold-soft);
  text-align: center;
}

.chapter-end-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.chapter-end-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.chapter-end-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.chapter-end-card .btn-ghost-luxury {
  color: var(--text-primary);
  background: var(--bg-glass-subtle);
  border-color: var(--border-medium);
}

.chapter-end-card .btn-ghost-luxury:hover {
  border-color: var(--border-gold);
  background: var(--gold-glow);
}

.chapter-end-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Chapter List Item inside Drawer */
.toc-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-glass-subtle);
  border: 1px solid var(--border-subtle);
  text-align: left;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.toc-item:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
}

.toc-item.current {
  border-color: var(--gold-primary);
  background: var(--gold-glow);
}

.toc-thumb {
  width: 68px;
  aspect-ratio: 16 / 10;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE: TABLET & MOBILE PORTRAIT (ONE-HANDED THUMB CINEMA)
   ========================================================================== */

@media (max-width: 1180px) {
  .reader-typo-inline {
    display: none;
  }
}

@media (max-width: 980px) {
  .reader-sticky-inner {
    padding: 8px 12px;
    gap: 8px;
  }
  .reader-bgm-top .btn-label-desktop {
    display: none;
  }
  .chapter-article {
    padding: 24px 16px 64px;
  }
  .chapter-main-title {
    font-size: 28px;
  }
  .prose-block {
    padding: 12px 14px;
  }
}

@media (max-width: 768px) {
  /* Single sleek, uncrowded topbar on phones */
  .btn-label-desktop,
  .reader-typo-inline,
  .reader-bgm-top,
  #toggleFullscreenBtn {
    display: none !important;
  }

  .reader-settings-btn {
    display: inline-flex;
  }

  .reader-brand-btn {
    width: 36px;
    height: 36px;
    justify-content: center;
    padding: 0;
  }

  .reader-back-btn,
  .reader-drawer-btn,
  .reader-settings-btn {
    height: 38px;
    min-width: 38px;
    padding: 0 10px;
    font-size: 12.5px;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  .reader-mode-group {
    height: 38px;
    padding: 3px;
  }

  .reader-mode-pill {
    height: 100%;
    padding: 0 9px;
    font-size: 12px;
  }

  .reader-ep-crumb {
    font-size: 12.5px;
    padding: 6px 4px;
  }

  .reader-ep-crumb .crumb-ep {
    color: var(--gold-primary);
    font-weight: 600;
  }

  /* ---- NATIVE BOTTOM SHEET FOR READER SETTINGS ---- */
  .settings-backdrop {
    display: block;
  }

  .settings-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .reader-settings-popover {
    display: flex;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    max-height: 89dvh;
    overflow-y: auto;
    border-radius: 22px 22px 0 0;
    border: none;
    border-top: 1px solid var(--border-medium);
    padding: 0 18px calc(20px + env(safe-area-inset-bottom));
    gap: 9px;
    box-shadow: 0 -20px 52px rgba(0, 0, 0, 0.55);
    visibility: hidden;
    transform: translateY(105%);
    pointer-events: none;
    transition: transform 0.32s var(--ease-cinema), visibility 0s linear 0.32s;
  }

  .reader-settings-popover.open {
    animation: none;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: transform 0.32s var(--ease-cinema), visibility 0s linear 0s;
  }

  .rsp-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
    flex-shrink: 0;
    touch-action: none;
  }

  .rsp-sheet-handle span {
    width: 38px;
    height: 4px;
    border-radius: 99px;
    background: var(--border-medium);
  }

  .rsp-sheet-title {
    font-size: 15px;
  }

  .rsp-close-mob {
    display: inline;
  }

  .rsp-close-desk {
    display: none;
  }

  .rsp-sheet-close {
    width: auto;
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gold-primary);
    border-color: var(--border-gold-soft);
  }

  .rsp-row.rsp-mob-only-row {
    display: flex;
  }

  .rsp-row {
    min-height: 36px;
  }

  .rsp-label {
    font-size: 13px;
  }

  .reader-settings-popover .seg-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  /* Edge-to-edge 16:9 image pinned cleanly at top, spacious prose below */
  .cinema-body {
    padding: 0;
    gap: 0;
    justify-content: flex-start;
  }

  .cinema-visual-wrap {
    background: #04060c;
  }

  body.reader-movie-mode .cinema-visual-wrap {
    flex: 1;
    width: 100%;
    padding: 0;
    overflow: hidden;
    flex-direction: column;
    justify-content: center;
    background: #04060c;
  }

  .cinema-frame {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.52);
    transition: transform 0.2s var(--ease-cinema);
  }

  .cinema-movie-sub-inner {
    transition: transform 0.2s var(--ease-cinema);
  }

  body.reader-movie-mode .cinema-frame {
    width: 100%;
    border-top: none;
    border-bottom: none;
    box-shadow: none;
  }

  .cinema-chapter-pill {
    top: 8px;
    left: 10px;
    font-size: 10.5px;
    padding: 3px 9px;
  }

  body.reader-movie-mode .cinema-chapter-pill {
    max-width: calc(100% - 168px);
  }

  .cinema-gesture-hint {
    max-width: calc(100% - 24px);
    white-space: normal;
    text-align: center;
    font-size: 11px;
    padding: 5px 12px;
  }

  /* On portrait phone, SMS renders inline inside dialogue box instead of covering artwork (except in Movie Mode where dialogue box is hidden) */
  body:not(.reader-movie-mode) .cinema-sms-overlay {
    display: none !important;
  }

  body.reader-movie-mode .cinema-sms-overlay {
    top: 44px;
    right: 8px;
    max-width: min(250px, calc(100% - 16px));
    padding: 8px 10px;
  }

  .cinema-inline-sms {
    display: block;
  }

  .cinema-frame-bar {
    padding: 6px 10px;
  }

  body.reader-movie-mode .cinema-frame-bar {
    display: none;
  }

  .cinema-movie-quickbar {
    top: 8px;
    right: 8px;
    gap: 5px;
  }

  .movie-quick-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .movie-speaker-tag {
    font-size: 11px;
    padding: 2px 9px;
    margin-bottom: 5px;
  }

  .cinema-tap-zone .tap-chevron {
    display: none;
  }

  .cinema-tap-zone:active:not(:disabled) {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 72%);
  }

  .cinema-dialogue-panel {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    max-height: none;
    flex: 1;
    border-radius: 0;
    border: none;
    background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: none;
  }

  body.cinema-immersive .cinema-body {
    padding: 0;
  }

  body.cinema-immersive .cinema-frame {
    width: 100%;
    border-radius: 0;
  }

  body.cinema-immersive .cinema-dialogue-panel {
    width: 100%;
    max-height: none;
  }

  .cinema-action-label-hide-mob {
    display: none;
  }

  .cinema-dialogue-panel.is-dialogue {
    box-shadow: inset 3px 0 0 var(--speaker-color, var(--gold-soft));
  }

  .cinema-speaker-bar {
    padding: 10px 12px 10px 15px;
    gap: 8px;
  }

  .cinema-speaker-info {
    overflow: hidden;
    flex: 1;
    min-width: 0;
  }

  .cinema-speaker-name {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cinema-speaker-actions {
    flex-shrink: 0;
    gap: 6px;
  }

  /* Generous 36–38px touch pills on mobile dialogue header */
  .cinema-speaker-actions .prose-speak-btn {
    min-height: 36px;
    min-width: 36px;
    padding: 0 10px;
    justify-content: center;
    background: var(--bg-segment);
    border: 1px solid var(--border-subtle);
    font-size: 12px;
    opacity: 1 !important;
  }

  .cinema-prose-scroll {
    padding: 18px 18px 20px;
  }

  .cinema-vocab-strip {
    padding: 10px 16px 12px;
    gap: 7px;
  }

  .scene-vocab-chip {
    min-height: 34px;
    padding: 4px 11px;
    font-size: 12.5px;
  }

  .cinema-dock {
    padding: 2px 12px max(10px, env(safe-area-inset-bottom));
  }

  /* Bigger thumb-friendly timeline scrubber hit zone on mobile */
  .cinema-scrubber {
    height: 28px;
    margin: 0 auto 3px;
  }

  .scrubber-thumb {
    width: 15px;
    height: 15px;
  }

  .cinema-dock-row {
    gap: 6px;
    width: 100%;
  }

  /* Hide duplicate Speak & Counter on narrow mobile dock so every button fits 100% cleanly inside 390px */
  .dock-speak-btn,
  .dock-counter {
    display: none !important;
  }

  .dock-nav-btn {
    min-width: 0;
    height: 42px;
    padding: 0 13px;
    font-size: 13px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .dock-center-tools {
    flex: 1;
    min-width: 0;
    justify-content: center;
    gap: 6px;
  }

  .dock-tool-label {
    display: none;
  }

  .dock-pill-btn {
    height: 40px;
    padding: 0 12px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .dock-bgm-btn {
    width: 40px;
    padding: 0;
  }

  .cinema-end-stage {
    padding: 16px;
    align-items: flex-start;
  }

  .cinema-end-stage .chapter-end-card {
    padding: 22px 16px;
    margin: auto 0;
  }

  .cinema-end-thumb {
    width: 180px;
  }

  .chapter-end-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chapter-end-actions .btn-primary-luxury {
    order: -1;
    justify-content: center;
    height: 44px;
  }

  .chapter-end-actions .btn-ghost-luxury,
  .chapter-end-actions .quiet-btn,
  .chapter-end-actions .nav-link-quiet {
    justify-content: center;
    min-height: 40px;
  }

  /* Classic Vertical Scroll Mode mobile polish */
  .chapter-article {
    padding: 18px 14px calc(72px + env(safe-area-inset-bottom));
  }

  .chapter-hero-head {
    padding-bottom: 20px;
    margin-bottom: 24px;
  }

  .chapter-main-title {
    font-size: 25px;
  }

  .scene-frame {
    border-radius: 11px;
  }

  .prose-stack {
    border-radius: 11px;
  }
}

@media (max-width: 1120px) {
  .reader-brand-text,
  .reader-left-divider {
    display: none;
  }
}

@media (max-width: 520px) {
  .reader-brand-icon {
    width: 24px;
    height: 24px;
  }
  .reader-left {
    gap: 5px;
  }
  .reader-back-btn {
    min-width: 36px;
    padding: 0 7px;
  }
  .reader-mode-pill .rm-full {
    display: none;
  }
  .reader-mode-pill .rm-short {
    display: inline;
  }
  .reader-mode-pill {
    padding: 0 8px;
    font-size: 11.5px;
  }
  .reader-sticky-inner {
    padding: 6px 10px;
    gap: 6px;
  }
  .reader-controls {
    gap: 4px;
  }
  .cinema-speaker-zh {
    display: none;
  }
  .cinema-brand-mark {
    left: 10px;
    bottom: 7px;
    font-size: 11.5px;
  }
}

@media (max-width: 440px) {
  .dock-prev-label {
    display: none;
  }
  #cinemaPrevBtn {
    width: 42px;
    padding: 0;
  }
  #cinemaNextBtn {
    padding: 0 13px;
  }
  .dock-pill-btn {
    padding: 0 10px;
    font-size: 12px;
  }
}

/* Portrait phone Movie Mode: unobstructed 16:9 frame + clean dark cinema letterbox subtitles below */
@media (max-width: 768px) and (orientation: portrait) {
  body.reader-movie-mode .cinema-frame {
    aspect-ratio: auto;
    overflow: hidden;
    background: #04060c;
    display: flex;
    flex-direction: column;
  }

  body.reader-movie-mode .cinema-frame::before {
    content: '';
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    background: #060911;
  }

  body.reader-movie-mode .cinema-frame .cinema-img,
  body.reader-movie-mode .cinema-frame .cinema-motion-canvas,
  body.reader-movie-mode .cinema-frame .cinema-light-pulse,
  body.reader-movie-mode .cinema-frame .cinema-decoy-img {
    height: auto;
    bottom: auto;
    aspect-ratio: 16 / 9;
  }

  body.reader-movie-mode .cinema-tap-zone {
    bottom: auto;
    height: 56.25vw;
  }

  body.reader-movie-mode .cinema-brand-mark {
    bottom: auto;
    top: calc(56.25vw - 22px);
  }

  body.reader-movie-mode .cinema-movie-sub {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 7;
    max-height: none;
    padding: 18px 16px 14px;
    background: #04060c;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: auto;
  }

  body.reader-movie-mode .cinema-movie-sub-inner {
    max-width: 100%;
    max-height: 44dvh;
    padding: 2px 4px;
  }

  body.reader-movie-mode .cinema-movie-sub-inner .prose-zh {
    font-size: calc(var(--reader-zh-size, 19.5px) * 0.94);
    line-height: 1.56;
  }

  body.reader-movie-mode .cinema-movie-sub-inner .prose-pinyin {
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.44;
  }

  body.reader-movie-mode .cinema-movie-sub-inner .prose-vi {
    margin-top: 6px;
    font-size: calc(var(--reader-vi-size, 14.5px) * 1.0);
    line-height: 1.54;
  }
}

/* ==========================================================================
   RESPONSIVE: MOBILE LANDSCAPE (2-COLUMN VISUAL NOVEL SPLIT)
   ========================================================================== */

@media (max-height: 540px) and (orientation: landscape) {
  .reader-sticky-inner {
    padding: 5px 14px;
  }

  .cinema-body {
    flex-direction: row;
    align-items: stretch;
    padding: 8px 14px 6px;
    gap: 12px;
  }

  body.reader-movie-mode .cinema-body {
    justify-content: center;
  }

  .cinema-visual-wrap {
    flex: 0 0 56%;
    min-width: 0;
    background: transparent;
  }

  body.reader-movie-mode .cinema-visual-wrap {
    flex: 1 1 auto;
  }

  .cinema-frame {
    width: min(100%, calc((100dvh - 110px) * 16 / 9));
    min-width: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
  }

  body.reader-movie-mode .cinema-frame {
    width: min(100%, calc((100dvh - 102px) * 16 / 9));
  }

  body.reader-movie-mode .cinema-sms-overlay {
    top: 44px;
    right: 10px;
  }

  body.reader-movie-mode .cinema-movie-sub {
    padding: 26px 46px 10px;
  }

  body.reader-movie-mode .cinema-movie-sub-inner .prose-zh {
    font-size: 15px;
    line-height: 1.42;
  }

  body.reader-movie-mode .cinema-movie-sub-inner .prose-pinyin {
    font-size: 11.5px;
  }

  body.reader-movie-mode .cinema-movie-sub-inner .prose-vi {
    font-size: 13px;
  }

  .cinema-dialogue-panel {
    flex: 1;
    min-width: 0;
    max-height: none;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .cinema-sms-overlay {
    display: none !important;
  }

  .cinema-inline-sms {
    display: block;
  }

  .cinema-speaker-bar {
    padding: 7px 12px 6px 14px;
  }

  .cinema-prose-scroll {
    padding: 8px 13px 12px;
  }

  .cinema-dock {
    padding: 2px 14px max(6px, env(safe-area-inset-bottom));
  }

  .cinema-scrubber {
    height: 16px;
    margin-bottom: 2px;
  }

  .dock-nav-btn {
    height: 30px;
    font-size: 12px;
  }

  .dock-pill-btn {
    height: 29px;
  }
}
