:root {
  --ink: #1a2332;
  --ink-soft: #3d4a5c;
  --paper: #f3ebe0;
  --paper-deep: #e8dcc8;
  --seal: #b54a3c;
  --gold: #c4a574;
  --mist: #8a9bb0;
  --stage: #0f1620;
  --stage-glow: #1e2d42;
  --shadow: rgba(8, 12, 20, 0.55);
  --ease-flip: cubic-bezier(0.645, 0.045, 0.355, 1);
  --page-w: 340px;
  --page-h: 480px;
  --duration: 900ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Noto Serif SC", serif;
  color: var(--paper);
  background: var(--viewer-base-color, var(--stage));
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: var(--viewer-base-color, var(--stage));
}

.atm-base,
.atm-orb,
.atm-orbit,
.atm-noise {
  position: absolute;
  inset: 0;
}

.atm-base {
  background: var(--viewer-base-color, #05080f);
}

.atm-orb,
.atm-orbit {
  opacity: 0;
}

.atm-noise {
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 2;
}

.atm-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
  display: block;
  pointer-events: none;
}

/* 漂浮动效顶层：画册之上、点击穿透（不挡翻页/圆点/按钮） */
.float-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.atm-float {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
  display: block;
  pointer-events: none;
}

/* —— 预览背景主题 —— */
body[data-viewer-bg="ink"] .atm-base {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(30, 45, 66, 0.65), transparent 55%),
    var(--viewer-base-color, #0c121a);
}

/* Canvas 高级主题：深色底 + 关闭 CSS 光晕（动效由 viewer-bg.js 绘制） */
body[data-viewer-bg="prism"] .atm-base,
body[data-viewer-bg="constellation"] .atm-base,
body[data-viewer-bg="ribbons"] .atm-base,
body[data-viewer-bg="starfield"] .atm-base,
body[data-viewer-bg="ripple"] .atm-base,
body[data-viewer-bg="aurora"] .atm-base,
body[data-viewer-bg="orbit"] .atm-base,
body[data-viewer-bg="pearl"] .atm-base,
body[data-viewer-bg="dawn"] .atm-base,
body[data-viewer-bg="sakura"] .atm-base {
  background: var(--viewer-base-color, #05080f);
}
body[data-viewer-bg="prism"] .atm-orb,
body[data-viewer-bg="constellation"] .atm-orb,
body[data-viewer-bg="ribbons"] .atm-orb,
body[data-viewer-bg="starfield"] .atm-orb,
body[data-viewer-bg="ripple"] .atm-orb,
body[data-viewer-bg="aurora"] .atm-orb,
body[data-viewer-bg="orbit"] .atm-orb,
body[data-viewer-bg="pearl"] .atm-orb,
body[data-viewer-bg="dawn"] .atm-orb,
body[data-viewer-bg="sakura"] .atm-orb,
body[data-viewer-bg="prism"] .atm-orbit,
body[data-viewer-bg="constellation"] .atm-orbit,
body[data-viewer-bg="ribbons"] .atm-orbit,
body[data-viewer-bg="starfield"] .atm-orbit,
body[data-viewer-bg="ripple"] .atm-orbit,
body[data-viewer-bg="aurora"] .atm-orbit,
body[data-viewer-bg="orbit"] .atm-orbit,
body[data-viewer-bg="pearl"] .atm-orbit,
body[data-viewer-bg="dawn"] .atm-orbit,
body[data-viewer-bg="sakura"] .atm-orbit {
  opacity: 0 !important;
  animation: none !important;
}

body[data-viewer-bg="ember"] .atm-base {
  background:
    radial-gradient(circle at 35% 40%, rgba(200, 90, 50, 0.28), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(196, 165, 116, 0.2), transparent 48%),
    var(--viewer-base-color, #1a1010);
}
body[data-viewer-bg="ember"] .atm-orb {
  opacity: 1;
  filter: blur(50px);
}
body[data-viewer-bg="ember"] .atm-orb-a {
  background: radial-gradient(circle at 35% 40%, rgba(200, 90, 50, 0.4), transparent 50%);
  animation: atm-drift-a 12s ease-in-out infinite alternate;
}
body[data-viewer-bg="ember"] .atm-orb-b {
  background: radial-gradient(circle at 70% 60%, rgba(196, 165, 116, 0.32), transparent 48%);
  animation: atm-drift-b 16s ease-in-out infinite alternate;
}

body[data-viewer-bg="mist"] {
  --paper: #1a2332;
  --mist: #5a6b7c;
  --gold: #8a6a3e;
  color: var(--paper);
}
body[data-viewer-bg="mist"] .atm-base {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255, 255, 255, 0.35), transparent 60%),
    var(--viewer-base-color, #c5d0dc);
}
body[data-viewer-bg="mist"] .atm-noise {
  opacity: 0.03;
}
body[data-viewer-bg="mist"] .brand-mark {
  color: #8a6a3e;
  border-color: #8a6a3e;
}
body[data-viewer-bg="mist"] .text-btn,
body[data-viewer-bg="mist"] .link-btn {
  color: #1a2332;
  border-color: rgba(26, 35, 50, 0.28);
}
body[data-viewer-bg="mist"] .nav-btn {
  color: #1a2332;
  border-color: rgba(26, 35, 50, 0.25);
  background: rgba(255, 255, 255, 0.45);
}

body[data-viewer-bg="solid"] .atm-base {
  background: var(--viewer-solid, var(--viewer-base-color, #152030));
}
body[data-viewer-bg="solid"] .atm-orb,
body[data-viewer-bg="solid"] .atm-orbit {
  opacity: 0;
}
body[data-viewer-bg="solid"] .atm-noise {
  opacity: 0.03;
}

@keyframes atm-drift-a {
  from { transform: translate(-4%, -2%) scale(1); }
  to { transform: translate(6%, 5%) scale(1.12); }
}
@keyframes atm-drift-b {
  from { transform: translate(3%, 4%) scale(1.05); }
  to { transform: translate(-5%, -3%) scale(1); }
}
@keyframes atm-spin {
  to { transform: rotate(360deg); }
}
@keyframes atm-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .atm-orb,
  .atm-orbit {
    animation: none !important;
  }
}

.topbar,
.stage,
.controls {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.1rem 1.5rem 0.45rem;
  gap: 0.35rem;
  text-align: center;
}

.topbar-actions {
  display: none;
}

.link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  border-color: rgba(196, 165, 116, 0.45);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-shrink: 0;
  min-width: 0;
  max-width: min(100%, 36rem);
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: "ZCOOL XiaoWei", serif;
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.brand-name {
  margin: 0;
  font-family: "ZCOOL XiaoWei", serif;
  font-size: 1.25rem;
  letter-spacing: 0.2em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-sub {
  display: none;
}

.hint {
  margin: 0;
  flex: none;
  min-width: 0;
  max-width: 100%;
  font-size: 0.8rem;
  color: var(--mist);
  letter-spacing: 0.08em;
  transition: opacity 0.4s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  perspective: 2200px;
  overflow: hidden;
}

.nav-btn {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: rgba(30, 45, 66, 0.6);
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.25s ease, border-color 0.25s ease, opacity 0.25s ease, transform 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
  background: rgba(181, 74, 60, 0.25);
  border-color: var(--seal);
  transform: scale(1.05);
}

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

.book-wrap {
  position: relative;
  width: calc(var(--page-w) * 2);
  height: var(--page-h);
  transform-style: preserve-3d;
  transition: transform 0.55s var(--ease-flip);
}

/* 封面/封底单面显示：平移半页宽让可见面居中 */
@media (min-width: 901px) {
  .book-wrap.at-start {
    transform: translateX(calc(var(--page-w) * -0.5));
  }

  .book-wrap.at-end {
    transform: translateX(calc(var(--page-w) * 0.5));
  }
}

/* 画册右侧垂直居中的页码圆点 */
.page-dots {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 3px;
  border-radius: 999px;
  background: rgba(8, 13, 20, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 6;
}

.page-dots .pdot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.55);
  background: transparent;
  cursor: pointer;
  transition:
    background 0.25s ease,
    height 0.25s ease,
    border-color 0.25s ease,
    transform 0.2s ease;
}

.page-dots .pdot:hover {
  background: rgba(196, 165, 116, 0.45);
  transform: scale(1.15);
}

.page-dots .pdot.active {
  background: var(--gold, #c4a574);
  border-color: var(--gold, #c4a574);
  height: 20px;
}

.page-dots.dense {
  gap: 6px;
}

.page-dots.dense .pdot {
  width: 6px;
  height: 6px;
}

.page-dots.dense .pdot.active {
  height: 14px;
}

/* 手机版底部翻页条：仅 ≤900px 显示（样式在下方媒体查询内） */
.m-viewer-pager {
  display: none;
}

/* 桌面：右侧圆点列底部的自动翻页按钮 */
.page-dots .pdot-play {
  width: 22px;
  height: 22px;
  margin-top: 4px;
  padding: 0;
  border: 1px solid rgba(196, 165, 116, 0.5);
  border-radius: 999px;
  background: rgba(8, 13, 20, 0.4);
  color: var(--gold, #c4a574);
  font-size: 0.56rem;
  line-height: 1;
  letter-spacing: -0.06em;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.page-dots .pdot-play:hover {
  background: rgba(196, 165, 116, 0.18);
}

.page-dots .pdot-play.playing {
  background: var(--gold, #c4a574);
  color: #10151d;
}

.book-wrap .bgm-float {
  z-index: 80;
}

/* 单页模式（手机或横版相册）：壳宽 = 一页 */
.book-wrap.is-single {
  width: var(--page-w);
}

.book-wrap.is-single .book-shadow,
.book-wrap.is-single:has(.book.closed) .book-shadow,
.book-wrap.is-single .book.closed ~ .book-shadow {
  left: 10%;
  right: 10%;
}

.book {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  cursor: pointer;
  outline: none;
}

.book:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 8px;
}

.book-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -18px;
  height: 28px;
  background: radial-gradient(ellipse, var(--shadow), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
  transition: left 0.45s ease, right 0.45s ease, opacity 0.5s ease;
}

/* Closed: shadow under the cover (right half) */
.book.closed ~ .book-shadow,
.book-wrap:has(.book.closed) .book-shadow {
  left: 52%;
  right: 8%;
}

.sheet {
  position: absolute;
  top: 0;
  width: var(--page-w);
  height: var(--page-h);
  transform-style: preserve-3d;
  transform-origin: left center;
  transition: transform var(--duration) var(--ease-flip);
  z-index: 1;
}

.sheet.flipped {
  transform: rotateY(-180deg);
}

.sheet .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.sheet .face.front {
  transform: rotateY(0deg);
}

.sheet .face.back {
  transform: rotateY(180deg);
}

/* Flat clip layer — preserve-3d parents won't clip overflow reliably */
.face-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: translateZ(0);
  transform-style: flat;
}

.face-clip > .page-scale-root,
.face-clip > .page-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: top left;
  pointer-events: none;
}

.face .el {
  pointer-events: none;
}

/* 链接热区 / 已绑事件或点击动画的元素可接收点击，空白处仍翻页 */
.face .el.hc-interactive {
  pointer-events: auto;
}

.el-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: #8a7a68;
  font-size: 18px;
  letter-spacing: 0.2em;
}

.face.cover,
.face.back-cover {
  border: 1px solid rgba(196, 165, 116, 0.35);
}

/* 横版/PPT 预览：去掉封面描边与书脊渐变，避免看成白边 */
.book.is-landscape .face.cover,
.book.is-landscape .face.back-cover,
.book.single-mode.is-landscape .face.cover,
.book.single-mode.is-landscape .face.back-cover {
  border: none;
}

.book.is-landscape .sheet .face::before,
.bookWrap.is-landscape .sheet .face::before {
  display: none;
}

.book.is-landscape .sheet .face,
.bookWrap.is-landscape .sheet .face {
  box-shadow: none;
}

.face.blank {
  background: var(--paper-deep);
}

.sheet .face::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.sheet .face.front::before {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 10%);
}

.sheet .face.back::before {
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.06), transparent 10%);
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-content: center;
  column-gap: 1.25rem;
  row-gap: 0.5rem;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 1.75rem;
  box-sizing: border-box;
}

.controls > .text-btn {
  grid-row: 1;
  justify-self: center;
}

.controls > #prevTextBtn { grid-column: 1; }
.controls > .pager { grid-column: 2; }
.controls > #nextTextBtn { grid-column: 3; }

.text-btn {
  min-width: 5.5rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid rgba(196, 165, 116, 0.55);
  background: transparent;
  color: var(--gold);
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.text-btn.primary {
  border-color: var(--gold);
  background: rgba(196, 165, 116, 0.12);
  color: var(--gold);
}

.text-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(196, 165, 116, 0.2);
  color: #e4cda0;
}

.text-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pager {
  text-align: center;
  min-width: 0;
  width: 100%;
  max-width: 12rem;
  justify-self: center;
}

#pageLabel {
  display: none !important;
}

.dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
}

.dots.is-progress {
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(196, 165, 116, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.dot.active {
  background: var(--gold);
  transform: scale(1.25);
}

.dot:hover {
  background: rgba(196, 165, 116, 0.55);
}

.pager-track {
  position: relative;
  display: block;
  width: 100%;
  max-width: 9rem;
  height: 4px;
  margin: 0 auto;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(196, 165, 116, 0.2);
  cursor: pointer;
  overflow: hidden;
}

.pager-track:hover {
  background: rgba(196, 165, 116, 0.32);
}

.pager-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.28s ease;
  pointer-events: none;
}

.pager-count {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}

/* Flipping lock cursor */
.book.busy {
  cursor: wait;
  pointer-events: none;
}

/* —— Single page mode (mobile OR landscape album) —— */
.book.single-mode {
  width: var(--page-w);
  margin: 0 auto;
}

.book.single-mode .sheet {
  left: 0 !important;
  right: auto;
  transform: none !important;
  transition: opacity 0.28s ease;
  opacity: 0;
  pointer-events: none;
}

.book.single-mode .sheet.active-sheet {
  opacity: 1;
  pointer-events: auto;
}

.book.single-mode .sheet .face {
  transform: none !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.book.single-mode .sheet .face.is-shown {
  visibility: visible;
  opacity: 1;
}

.book.single-mode .sheet .face::before {
  background: none;
}

.book.single-mode.has-spread::before,
.book.single-mode.has-spread::after,
.book.single-mode:not(.closed)::before,
.book.single-mode:not(.closed)::after {
  display: none;
}

/* —— Desktop: each face shows exactly 1 page —— */
@media (min-width: 901px) {
  /* All sheets hinged at the book center (right half) — skipped in single-mode */
  .book:not(.single-mode) .sheet {
    left: 50%;
  }

  /*
   * Left page bed only after a spread is fully open.
   * Avoid painting a full paper block on the left while the cover is turning.
   */
  .book:not(.single-mode).has-spread::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: var(--page-w);
    height: var(--page-h);
    background: var(--paper-deep);
    box-shadow:
      inset -10px 0 18px rgba(0, 0, 0, 0.06),
      0 8px 28px rgba(0, 0, 0, 0.2);
    z-index: 0;
  }

  .book:not(.single-mode).has-spread::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
    background: linear-gradient(
      180deg,
      transparent,
      rgba(0, 0, 0, 0.18),
      transparent
    );
    z-index: 40;
    pointer-events: none;
    opacity: 0.7;
  }
}

/* —— Mobile / narrow —— */
@media (max-width: 900px) {
  /* 手机端沉浸阅读：隐藏顶栏，画册全屏，四周只留小间距 */
  .topbar {
    display: none;
  }

  .hint {
    display: none !important;
  }

  .brand-name {
    font-size: 0.98rem;
    letter-spacing: 0.1em;
  }

  .brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.15rem;
  }

  .nav-btn {
    display: none;
  }

  .stage {
    perspective: none;
    padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }

  .book-wrap {
    width: var(--page-w);
    height: var(--page-h);
    margin: 0 auto;
  }

  .page-dots {
    display: none;
  }

  /* 手机版底部翻页条：左右箭头 + 中间页码圆点 */
  .m-viewer-pager {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(8, 13, 20, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 6;
  }

  .m-viewer-pager .mvp-arrow {
    width: 1.7rem;
    height: 1.7rem;
    flex: none;
    padding: 0;
    border: 1px solid rgba(196, 165, 116, 0.4);
    border-radius: 999px;
    background: transparent;
    color: var(--gold, #c4a574);
    font-size: 1.05rem;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
  }

  .m-viewer-pager .mvp-arrow:hover:not(:disabled) {
    background: rgba(196, 165, 116, 0.14);
  }

  .m-viewer-pager .mvp-arrow:disabled {
    opacity: 0.3;
    cursor: default;
  }

  .m-viewer-pager .mvp-play {
    width: 1.7rem;
    height: 1.7rem;
    flex: none;
    padding: 0;
    border: 1px solid rgba(196, 165, 116, 0.4);
    border-radius: 999px;
    background: transparent;
    color: var(--gold, #c4a574);
    font-size: 0.6rem;
    line-height: 1;
    letter-spacing: -0.06em;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
  }

  .m-viewer-pager .mvp-play:hover {
    background: rgba(196, 165, 116, 0.14);
  }

  .m-viewer-pager .mvp-play.playing {
    background: var(--gold, #c4a574);
    border-color: var(--gold, #c4a574);
    color: #10151d;
  }

  .m-viewer-pager .mvp-dots {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: min(46vw, 230px);
    overflow-x: auto;
    scrollbar-width: none;
    padding: 3px 1px;
  }

  .m-viewer-pager .mvp-dots::-webkit-scrollbar {
    display: none;
  }

  .m-viewer-pager .mvp-dots .pdot {
    flex: none;
    width: 7px;
    height: 7px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(196, 165, 116, 0.55);
    background: transparent;
    cursor: pointer;
    transition:
      background 0.25s ease,
      height 0.25s ease,
      border-color 0.25s ease;
  }

  .m-viewer-pager .mvp-dots .pdot.active {
    background: var(--gold, #c4a574);
    border-color: var(--gold, #c4a574);
    height: 16px;
  }

  .m-viewer-pager .mvp-dots.dense {
    gap: 5px;
  }

  .m-viewer-pager .mvp-dots.dense .pdot {
    width: 5px;
    height: 5px;
  }

  .m-viewer-pager .mvp-dots.dense .pdot.active {
    height: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet {
    transition-duration: 0.01ms;
  }
}

/* ===== 打开画册时的翻书 loading ===== */
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background:
    radial-gradient(90% 60% at 50% 36%, rgba(196, 165, 116, 0.1), transparent 60%),
    var(--viewer-base-color, #05080f);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.boot-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.bl-scene {
  perspective: 520px;
}

.bl-book {
  position: relative;
  width: 88px;
  height: 62px;
  transform-style: preserve-3d;
}

/* 底层封壳 */
.bl-book::before {
  content: "";
  position: absolute;
  inset: 0 1px;
  border-radius: 4px;
  background: linear-gradient(120deg, #232c3e, #1a2233);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

/* 落地的投影 */
.bl-book::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -14px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(50% 100% at 50% 0, rgba(0, 0, 0, 0.4), transparent 70%);
}

/* 左侧已翻过的书页堆 */
.bl-stack {
  position: absolute;
  left: 1px;
  top: 1px;
  bottom: 1px;
  width: 50%;
  border-radius: 4px 0 0 4px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, #efe7d3, #e2d7bb);
  box-shadow: inset -3px 0 8px rgba(0, 0, 0, 0.12);
}

/* 右侧待翻的页,逐张从右往左翻 */
.bl-page {
  position: absolute;
  left: 50%;
  top: 1px;
  bottom: 1px;
  width: calc(50% - 1px);
  transform-origin: left center;
  transform-style: preserve-3d;
  animation: blFlip 2.7s cubic-bezier(0.5, 0.05, 0.4, 0.95) infinite;
}

.bl-page::before,
.bl-page::after {
  content: "";
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.bl-page::before {
  border-radius: 0 4px 4px 0;
  background: linear-gradient(105deg, #f8f2e4 0%, #eadfc6 100%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
}

.bl-page::after {
  border-radius: 4px 0 0 4px;
  background: linear-gradient(255deg, #f1e8d2 0%, #ddd1b3 100%);
  transform: rotateY(180deg);
}

.bl-page-2 {
  animation-delay: 0.9s;
}

.bl-page-3 {
  animation-delay: 1.8s;
}

@keyframes blFlip {
  0% {
    transform: rotateY(0deg);
    opacity: 0;
  }
  4% {
    transform: rotateY(0deg);
    opacity: 1;
  }
  42% {
    transform: rotateY(-180deg);
    opacity: 1;
  }
  88% {
    transform: rotateY(-180deg);
    opacity: 1;
  }
  100% {
    transform: rotateY(-180deg);
    opacity: 0;
  }
}

/* 书脊金线 */
.bl-spine {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(180deg, rgba(196, 165, 116, 0.65), rgba(196, 165, 116, 0.2));
}

.bl-brand {
  font-family: "Noto Serif SC", "STSong", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: #e8d9b0;
  text-shadow: 0 0 22px rgba(196, 165, 116, 0.35);
}

.bl-tip {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: rgba(232, 226, 214, 0.55);
}

.bl-dot {
  width: 3px;
  height: 3px;
  margin-left: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: blDot 1.2s ease-in-out infinite;
}

.bl-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.bl-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes blDot {
  0%,
  60%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bl-page {
    animation: none;
    opacity: 1;
  }
}
