:root {
  color-scheme: dark;
  --night: #0b111c;
  --navy: #111d30;
  --navy-light: #1c2c45;
  --gold: #caa86a;
  --gold-bright: #e2c78f;
  --paper: #e9dfc9;
  --paper-deep: #d8c9aa;
  --ink: #28303a;
  --muted: #8d96a5;
  --font-book:
    "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Noto Serif SC", serif;
  --font-display:
    "Iowan Old Style", "Baskerville", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-ui:
    "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --book-w: clamp(238px, 36vw, 322px);
  --book-h: calc(var(--book-w) * 1.42);
  font-family: var(--font-book);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% 32%, #1e2b40 0%, #101827 42%, var(--night) 75%);
  color: #f3ead8;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

.ambient,
.grain,
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.forest-backdrop,
.fireflies,
.firefly {
  position: fixed;
  pointer-events: none;
}

.forest-backdrop {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 520ms ease;
}

.fireflies {
  inset: 0;
  overflow: hidden;
}

.firefly {
  width: clamp(42px, 7vw, 82px);
  height: clamp(42px, 7vw, 82px);
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 420ms ease;
}

.glow {
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.18;
}

.glow-one {
  width: 46vw;
  height: 46vw;
  inset: -18vw auto auto -12vw;
  background: #6d87ac;
}

.glow-two {
  width: 38vw;
  height: 38vw;
  inset: auto -12vw -18vw auto;
  background: #7a5934;
}

.grain {
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 100svh;
  padding:
    max(22px, env(safe-area-inset-top))
    max(24px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(24px, env(safe-area-inset-left));
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1080px);
  margin: 0 auto;
}

.masthead-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.eyebrow {
  margin: 0;
  color: rgba(226, 199, 143, 0.68);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.32em;
  white-space: nowrap;
}

.sound-button,
.theme-button,
.guide-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.012);
  color: rgba(243, 234, 216, 0.55);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.08em;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.guide-button {
  opacity: 0.72;
}

.guide-button:hover,
.guide-button:focus-visible,
.sound-button:hover,
.sound-button:focus-visible {
  border-color: rgba(226, 199, 143, 0.25);
  background: rgba(226, 199, 143, 0.045);
  color: rgba(243, 234, 216, 0.82);
  outline: none;
  opacity: 1;
}

.control-icon {
  display: block;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  background: currentColor;
  mask: var(--control-icon) center / contain no-repeat;
  -webkit-mask: var(--control-icon) center / contain no-repeat;
}

.control-icon-guide {
  --control-icon: url("/assets/guide-icons/book-2.svg");
}

.control-icon-theme {
  --control-icon: url("/assets/guide-icons/leaf.svg");
}

.control-icon-sound {
  --control-icon: url("/assets/guide-icons/volume.svg");
}

.sound-button[aria-pressed="false"] .control-icon-sound {
  --control-icon: url("/assets/guide-icons/volume-off.svg");
}

.guide-entry {
  position: relative;
  z-index: 5;
  display: inline-flex;
}

.guide-replay-hint {
  position: absolute;
  z-index: 2;
  top: calc(100% + 16px);
  left: 50%;
  display: inline-flex;
  width: 190px;
  align-items: center;
  justify-content: center;
  padding: 10px 13px;
  border: 1px solid rgba(226, 199, 143, 0.28);
  border-radius: 10px;
  background: rgba(10, 17, 28, 0.94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
  color: rgba(243, 234, 216, 0.72);
  cursor: pointer;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-align: center;
  visibility: hidden;
  opacity: 0;
  backdrop-filter: blur(16px);
  transform: translate(-50%, -5px);
  transition:
    opacity 200ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 220ms;
}

.guide-replay-hint[hidden] {
  display: none;
}

.guide-replay-hint.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.guide-replay-hint:hover,
.guide-replay-hint:focus-visible {
  border-color: rgba(226, 199, 143, 0.54);
  outline: none;
  color: #efdfbd;
}

.guide-replay-arrow {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 18px;
  height: 18px;
  background: rgba(226, 199, 143, 0.88);
  filter: drop-shadow(0 0 7px rgba(202, 168, 106, 0.24));
  mask: url("/assets/guide-icons/arrow-up.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/guide-icons/arrow-up.svg") center / contain no-repeat;
  transform: translateX(-50%);
}

.theme-button {
  border: 1px solid rgba(202, 168, 106, 0.2);
  color: rgba(232, 212, 170, 0.56);
  letter-spacing: 0.08em;
  transition:
    border-color 220ms ease,
    background 220ms ease,
    color 220ms ease;
}

.theme-button:hover,
.theme-button:focus-visible {
  border-color: rgba(226, 199, 143, 0.55);
  outline: none;
}

.book-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  perspective: 1600px;
}

.book-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  min-width: 0;
}

.entry-mode-hint {
  display: flex;
  max-width: min(330px, calc(100vw - 36px));
  align-items: center;
  gap: 9px;
  margin-top: -9px;
  padding: 9px 13px;
  border: 1px solid rgba(226, 199, 143, 0.22);
  border-radius: 999px;
  color: rgba(243, 234, 216, 0.72);
  background: rgba(8, 14, 23, 0.76);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  backdrop-filter: blur(14px);
  transition:
    opacity 220ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.entry-mode-hint[hidden] {
  display: none;
}

.entry-mode-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.browse-mode-hint-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  color: rgba(226, 199, 143, 0.9);
  background: currentColor;
  mask: url("/assets/guide-icons/swipe-left.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/guide-icons/swipe-left.svg") center / contain no-repeat;
  animation: browse-mode-swipe 1.9s ease-in-out infinite;
}

.random-mode-hint-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  color: rgba(226, 199, 143, 0.9);
  background: currentColor;
  mask: url("/assets/guide-icons/hand-click.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/guide-icons/hand-click.svg") center / contain no-repeat;
  animation: random-mode-tap 1.65s ease-in-out infinite;
}

@keyframes browse-mode-swipe {
  45%,
  70% {
    transform: translateX(-5px);
  }
}

@keyframes random-mode-tap {
  45% {
    transform: scale(0.86);
    opacity: 0.72;
  }
}

.book-shadow {
  position: absolute;
  top: 69%;
  left: 50%;
  width: min(76vw, 680px);
  height: 76px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.56);
  filter: blur(30px);
  opacity: 0.72;
  transform: translate(-50%, -50%) scaleX(0.55);
  transition:
    opacity 720ms ease,
    transform 780ms cubic-bezier(0.42, 0, 0.2, 1);
}

.book-scene:has(.book[data-state="opening"]) .book-shadow,
.book-scene:has(.book[data-state="open"]) .book-shadow {
  opacity: 0.78;
  transform: translate(-50%, -50%) scaleX(1);
}

.book {
  --closed-scale-x: 0.85;
  --closed-scale-y: 0.94;
  position: relative;
  width: min(88vw, 760px);
  height: min(58vw, 488px);
  min-height: 320px;
  transform-style: preserve-3d;
  transition: transform 820ms cubic-bezier(0.42, 0, 0.2, 1);
}

.book[data-state="closed"] {
  animation: book-breathe 5s ease-in-out infinite;
}

.book[data-state="open"] {
  transform: translateY(4px);
}

.book[data-state="opening"] {
  animation: book-open-settle 900ms cubic-bezier(0.42, 0, 0.2, 1) both;
}

.book[data-state="closing"] {
  animation: book-close-settle 720ms cubic-bezier(0.42, 0, 0.2, 1) both;
}

@keyframes book-open-settle {
  0% {
    transform: scale(var(--closed-scale-x), var(--closed-scale-y))
      translateY(0) rotateX(3deg) rotateY(-3deg);
  }
  18% {
    transform: scale(var(--closed-scale-x), var(--closed-scale-y))
      translateY(-5px) rotateX(2deg) rotateY(-1.5deg);
  }
  78% {
    transform: translateY(5px) rotateX(1deg) rotateY(0deg);
  }
  100% {
    transform: translateY(4px) rotateX(0deg) rotateY(0deg);
  }
}

@keyframes book-close-settle {
  0% {
    transform: translateY(4px) rotateX(0deg) rotateY(0deg);
  }
  82% {
    transform: scale(var(--closed-scale-x), var(--closed-scale-y))
      translateY(-2px) rotateX(2deg) rotateY(-2deg);
  }
  100% {
    transform: scale(var(--closed-scale-x), var(--closed-scale-y))
      translateY(0) rotateX(3deg) rotateY(-4deg);
  }
}

@keyframes book-breathe {
  0%,
  100% {
    transform: scale(var(--closed-scale-x), var(--closed-scale-y))
      translateY(0) rotateX(3deg) rotateY(-4deg);
  }
  50% {
    transform: scale(var(--closed-scale-x), var(--closed-scale-y))
      translateY(-7px) rotateX(1deg) rotateY(-2deg);
  }
}

.closed-book,
.cover-leaf,
.front-cover,
.cover-inside,
.page-block {
  position: absolute;
  inset: 0;
  border-radius: 5px 14px 14px 5px;
}

.closed-book {
  left: 50%;
  width: 50%;
  transform-style: preserve-3d;
  filter: drop-shadow(0 24px 24px rgba(0, 0, 0, 0.34));
  z-index: 12;
}

.cover-leaf {
  transform: rotateY(0deg) translateZ(5px);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 820ms cubic-bezier(0.42, 0, 0.2, 1);
  will-change: transform;
}

.page-block {
  inset: 8px -7px -7px 7px;
  background:
    repeating-linear-gradient(
      to bottom,
      #d8cbae 0,
      #d8cbae 2px,
      #bbaa88 3px,
      #efe5d0 4px
    );
  box-shadow: 8px 8px 18px rgba(0, 0, 0, 0.42);
  transform: translateZ(-8px);
  transition: opacity 220ms ease 110ms;
}

.front-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(118deg, transparent 42%, rgba(255, 255, 255, 0.08) 49%, transparent 56%),
    radial-gradient(circle at 46% 32%, #243957 0%, #15253b 46%, #0d1828 100%);
  box-shadow:
    inset 10px 0 20px rgba(255, 255, 255, 0.025),
    inset -10px 0 28px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(226, 199, 143, 0.18);
  cursor: pointer;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  touch-action: pan-y;
  transform: translateZ(3px);
  transition:
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 180ms ease;
}

.cover-inside {
  display: flex;
  align-items: flex-end;
  padding: 7%;
  border-radius: 14px 5px 5px 14px;
  background:
    linear-gradient(270deg, rgba(67, 46, 23, 0.18), transparent 16%),
    linear-gradient(90deg, #d3c3a4 0%, var(--paper) 7%, #eee5d2 100%);
  box-shadow:
    inset 0 0 45px rgba(92, 66, 30, 0.09),
    0 7px 16px rgba(31, 22, 13, 0.16);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  color: rgba(86, 67, 39, 0.45);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.12em;
  transform: rotateY(180deg) translateZ(3px);
}

.inside-mark {
  position: relative;
  z-index: 2;
}

.front-cover::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 17px;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(255, 255, 255, 0.035), transparent);
}

.cover-border {
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(202, 168, 106, 0.55);
  border-radius: 2px 9px 9px 2px;
}

.cover-border-outer {
  inset: 15px;
}

.cover-border-inner {
  inset: 21px;
  opacity: 0.45;
}

.corner {
  position: absolute;
  width: 33px;
  height: 33px;
  border-color: var(--gold);
  opacity: 0.7;
}

.corner-tl {
  top: 29px;
  left: 29px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.corner-tr {
  top: 29px;
  right: 29px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.corner-bl {
  bottom: 29px;
  left: 29px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.corner-br {
  right: 29px;
  bottom: 29px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.cover-star {
  margin-bottom: 24px;
  color: var(--gold-bright);
  font-size: 27px;
  text-shadow: 0 0 20px rgba(226, 199, 143, 0.35);
}

.cover-kicker {
  margin-bottom: 10px;
  color: rgba(226, 199, 143, 0.78);
  font-family: "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: 0.34em;
}

.cover-title {
  color: #e8d4aa;
  font-size: clamp(31px, 4.5vw, 42px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-shadow:
    0 1px 0 #765e35,
    0 0 22px rgba(226, 199, 143, 0.15);
}

.cover-rule {
  width: 50px;
  height: 1px;
  margin-top: 29px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.book[data-state="opening"] .closed-book,
.book[data-state="open"] .closed-book,
.book[data-state="closing"] .closed-book {
  pointer-events: none;
}

.book[data-state="opening"] .cover-leaf,
.book[data-state="open"] .cover-leaf {
  transform: rotateY(-180deg) translateZ(5px);
}

.book[data-state="opening"] .page-block,
.book[data-state="open"] .page-block {
  opacity: 0;
}

.open-book {
  --left-stack-depth: 6px;
  --right-stack-depth: 12px;
  --block-depth: 20px;
  --block-half-depth: 10px;
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  filter: drop-shadow(0 27px 24px rgba(0, 0, 0, 0.38));
  transform: translateX(-25%);
  transform-style: preserve-3d;
  touch-action: pan-y;
  user-select: none;
  transition: transform 820ms cubic-bezier(0.42, 0, 0.2, 1);
}

.open-book::before {
  position: absolute;
  z-index: 0;
  inset: 5px -7px -11px;
  border-radius: 13px 15px 14px 13px;
  background: linear-gradient(105deg, #0b1727, #1b2e49 48%, #0b1727);
  box-shadow:
    0 12px 18px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(202, 168, 106, 0.22);
  content: "";
  opacity: 0;
  transform: translateZ(-18px);
  transition: opacity 260ms ease 160ms;
}

.book[data-state="opening"] .open-book,
.book[data-state="open"] .open-book {
  transform: translateX(0);
}

.book[data-state="opening"] .open-book::before,
.book[data-state="open"] .open-book::before {
  opacity: 1;
}

.paper {
  position: relative;
  z-index: 3;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(108, 84, 49, 0.12), transparent 12%),
    var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 45px rgba(92, 66, 30, 0.09);
}

.page-stack {
  position: absolute;
  z-index: 1;
  top: 4px;
  width: 50%;
  overflow: hidden;
  border: 1px solid rgba(119, 91, 52, 0.22);
  background:
    repeating-linear-gradient(
      to bottom,
      #e6dbc3 0,
      #e6dbc3 1px,
      #c8b794 1.5px,
      #f1e7d3 2.7px
    );
  box-shadow:
    inset 0 0 12px rgba(83, 56, 27, 0.15),
    0 7px 12px rgba(31, 22, 13, 0.14);
  pointer-events: none;
  transition:
    opacity 220ms ease,
    bottom 520ms cubic-bezier(0.22, 1, 0.36, 1),
    width 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-stack::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(76, 48, 20, 0.16),
    transparent 10%,
    transparent 88%,
    rgba(76, 48, 20, 0.13)
  );
  content: "";
}

.page-stack-left {
  right: 50%;
  bottom: calc(var(--left-stack-depth) * -1);
  width: calc(50% + var(--left-stack-depth) * 0.35);
  border-radius: 11px 2px 2px 9px;
  transform: translateX(calc(var(--left-stack-depth) * 0.15))
    translateZ(calc(var(--left-stack-depth) * -1));
  opacity: 0;
}

.page-stack-right {
  bottom: calc(var(--right-stack-depth) * -1);
  left: 50%;
  width: calc(50% + var(--right-stack-depth) * 0.35);
  border-radius: 2px 12px 10px 2px;
  transform: translateX(calc(var(--right-stack-depth) * -0.15))
    translateZ(calc(var(--right-stack-depth) * -1));
}

.left-paper {
  opacity: 0;
  border-radius: 12px 3px 3px 10px;
  background:
    linear-gradient(270deg, rgba(88, 63, 32, 0.18), transparent 11%),
    linear-gradient(90deg, #d3c3a4 0%, var(--paper) 7%, #eee5d2 100%);
  transition: opacity 200ms ease 120ms;
}

.right-paper {
  border-radius: 3px 12px 10px 3px;
  background:
    linear-gradient(90deg, rgba(88, 63, 32, 0.17), transparent 10%),
    linear-gradient(270deg, #d3c3a4 0%, var(--paper) 7%, #eee5d2 100%);
}

.paper-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='.14'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.28;
  pointer-events: none;
}

.book-spine {
  position: absolute;
  z-index: 9;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 24px;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(51, 35, 18, 0.12) 26%,
      rgba(255, 255, 255, 0.22) 50%,
      rgba(51, 35, 18, 0.16) 74%,
      transparent
    );
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 220ms ease 360ms;
}

.book[data-state="opening"] .left-paper,
.book[data-state="open"] .left-paper,
.book[data-state="opening"] .book-spine,
.book[data-state="open"] .book-spine {
  opacity: 1;
}

.book[data-state="open"] .page-stack-left {
  opacity: 1;
}

.book[data-state="closing"] .left-paper,
.book[data-state="closing"] .book-spine {
  transition-delay: 0ms;
}

.book[data-state="open"] .closed-book {
  z-index: 1;
}

.left-content,
.answer-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 13%;
  text-align: center;
}

.small-star {
  color: #967744;
  font-size: clamp(16px, 2vw, 22px);
}

.question-label {
  margin: 22px 0 10px;
  color: #6d604b;
  font-size: clamp(12px, 1.7vw, 18px);
  letter-spacing: 0.16em;
}

.question-copy {
  max-width: 12em;
  margin: 0;
  color: #8b7c63;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: clamp(9px, 1.1vw, 13px);
  line-height: 1.8;
}

.ornament {
  margin-top: 26px;
  color: #9e8355;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.answer-text {
  max-width: 12em;
  margin: 0;
  font-size: clamp(20px, 3.15vw, 35px);
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0.08em;
  text-wrap: balance;
}

.answer-rule {
  width: 42px;
  height: 1px;
  margin: 28px 0 16px;
  background: #aa8c59;
}

.answer-number {
  margin: 0;
  color: #917c59;
  font-family: "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: 0.22em;
}

.paper-page {
  position: absolute;
  right: 7%;
  bottom: 5%;
  color: rgba(86, 67, 39, 0.45);
  font-family: "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.left-paper .paper-page {
  right: auto;
  left: 7%;
}

.turning-sheet {
  position: absolute;
  z-index: 8;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 50%;
  border-radius: 3px 12px 10px 3px;
  opacity: 0;
  pointer-events: none;
  transform: rotateY(0deg) translateZ(2px);
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
}

.turning-sheet.is-active {
  opacity: 1;
}

.turning-sheet.is-curling .sheet-face {
  animation: leaf-surface-breathe var(--leaf-duration, 420ms) ease-in-out both;
}

.turning-sheet.is-curling .page-curl-light {
  animation: leaf-highlight-travel var(--leaf-duration, 420ms) ease-in-out both;
}

.turning-sheet[data-direction="backward"] {
  right: 50%;
  left: 0;
  border-radius: 12px 3px 3px 10px;
  transform-origin: right center;
}

.sheet-face {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(67, 46, 23, 0.18), transparent 16%),
    linear-gradient(270deg, #d3c3a4 0%, var(--paper) 7%, #eee5d2 100%);
  color: var(--ink);
  box-shadow:
    inset 0 0 45px rgba(92, 66, 30, 0.09),
    -12px 1px calc(10px + var(--flip-shadow, 0) * 28px)
      rgba(38, 27, 16, calc(0.08 + var(--flip-shadow, 0) * 0.22));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.sheet-back {
  background:
    linear-gradient(270deg, rgba(67, 46, 23, 0.2), transparent 17%),
    linear-gradient(90deg, #d3c3a4 0%, var(--paper) 7%, #eee5d2 100%);
  transform: rotateY(180deg);
}

.sheet-answer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 13%;
  text-align: center;
}

.sheet-whisper {
  display: none;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  color: #8b7c63;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: clamp(9px, 1.1vw, 13px);
  letter-spacing: 0.12em;
}

.turning-sheet[data-direction="forward"] .sheet-back .sheet-answer,
.turning-sheet[data-direction="backward"] .sheet-front .sheet-answer {
  display: none;
}

.turning-sheet[data-direction="forward"] .sheet-back .sheet-whisper,
.turning-sheet[data-direction="backward"] .sheet-front .sheet-whisper {
  display: flex;
}

.page-curl-light {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  width: 32%;
  background: linear-gradient(
    90deg,
    rgba(255, 250, 230, calc(var(--flip-shadow, 0) * 0.42)),
    rgba(79, 54, 25, calc(var(--flip-shadow, 0) * 0.12)),
    transparent
  );
  opacity: min(1, calc(var(--flip-shadow, 0) * 1.6));
  pointer-events: none;
  transform: translateZ(3px);
}

.turning-sheet[data-direction="backward"] .page-curl-light {
  right: 0;
  left: auto;
  background: linear-gradient(
    270deg,
    rgba(255, 250, 230, calc(var(--flip-shadow, 0) * 0.42)),
    rgba(79, 54, 25, calc(var(--flip-shadow, 0) * 0.12)),
    transparent
  );
}

.thick-page-block {
  position: absolute;
  z-index: 10;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 50%;
  border-radius: 3px 12px 10px 3px;
  opacity: 0;
  pointer-events: none;
  transform: rotateY(0deg) translateZ(4px);
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
}

.thick-page-block.is-active {
  opacity: 1;
}

.thick-page-block.is-bending .thick-block-face {
  opacity: 0.14;
}

.thick-page-block.is-bending .block-bend-surface,
.thick-page-block.is-bending .block-lag-pages {
  opacity: 1;
}

.thick-page-block[data-direction="backward"] {
  right: 50%;
  left: 0;
  border-radius: 12px 3px 3px 10px;
  transform-origin: right center;
}

.thick-block-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.2), transparent 48%),
    linear-gradient(90deg, #d2c19f, #eee4cf 8%, #e9dfc9 100%);
  box-shadow:
    inset 0 0 42px rgba(86, 59, 26, 0.1),
    -18px 3px 30px rgba(34, 23, 12, 0.24);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: opacity 150ms ease;
}

.thick-block-front {
  transform: translateZ(var(--block-half-depth));
}

.thick-block-back {
  background:
    linear-gradient(270deg, #d2c19f, #eee4cf 8%, #e9dfc9 100%);
  transform: rotateY(180deg) translateZ(var(--block-half-depth));
}

.thick-block-edge {
  position: absolute;
  top: 2px;
  right: calc(var(--block-depth) * -0.5);
  bottom: calc(var(--block-depth) * -0.3);
  width: var(--block-depth);
  background:
    repeating-linear-gradient(
      to bottom,
      #e9dfc8 0,
      #e9dfc8 1px,
      #bda981 1.6px,
      #f2e8d2 2.8px
    );
  box-shadow:
    inset 0 0 8px rgba(77, 50, 22, 0.24),
    5px 5px 13px rgba(30, 19, 10, 0.22);
  transform: rotateY(90deg);
  transform-origin: left center;
}

.thick-page-block[data-direction="backward"] .thick-block-edge {
  right: auto;
  left: calc(var(--block-depth) * -0.5);
  transform: rotateY(-90deg);
  transform-origin: right center;
}

.thick-block-bottom {
  position: absolute;
  right: 0;
  bottom: calc(var(--block-depth) * -0.5);
  left: 0;
  height: var(--block-depth);
  background:
    repeating-linear-gradient(
      90deg,
      #d7c7a7 0,
      #efe4cd 3px,
      #bda984 4px,
      #efe4cd 5px
    );
  transform: rotateX(90deg);
  transform-origin: top center;
}

.thick-block-mark {
  color: rgba(151, 119, 68, 0.45);
  font-size: clamp(18px, 2.4vw, 26px);
  transform: translateZ(2px);
}

.block-bend-surface,
.block-lag-pages {
  position: absolute;
  z-index: 4;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform-style: preserve-3d;
}

.block-bend-slice {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(104, 72, 35, 0.12),
      rgba(255, 255, 255, 0.12) 48%,
      rgba(91, 61, 29, 0.08)
    ),
    #e8dec8;
  box-shadow:
    inset 1px 0 rgba(255, 255, 255, 0.18),
    inset -1px 0 rgba(111, 78, 39, 0.1);
  backface-visibility: visible;
  transform: rotateY(0deg) translateZ(var(--block-half-depth));
  transform-style: preserve-3d;
  will-change: transform;
}

.block-bend-slice:nth-child(1) {
  clip-path: inset(0 87.5% 0 0);
  transform-origin: 0% 50%;
}

.block-bend-slice:nth-child(2) {
  clip-path: inset(0 75% 0 12.5%);
  transform-origin: 12.5% 50%;
}

.block-bend-slice:nth-child(3) {
  clip-path: inset(0 62.5% 0 25%);
  transform-origin: 25% 50%;
}

.block-bend-slice:nth-child(4) {
  clip-path: inset(0 50% 0 37.5%);
  transform-origin: 37.5% 50%;
}

.block-bend-slice:nth-child(5) {
  clip-path: inset(0 37.5% 0 50%);
  transform-origin: 50% 50%;
}

.block-bend-slice:nth-child(6) {
  clip-path: inset(0 25% 0 62.5%);
  transform-origin: 62.5% 50%;
}

.block-bend-slice:nth-child(7) {
  clip-path: inset(0 12.5% 0 75%);
  transform-origin: 75% 50%;
}

.block-bend-slice:nth-child(8) {
  clip-path: inset(0 0 0 87.5%);
  transform-origin: 87.5% 50%;
}

.block-lag-page {
  position: absolute;
  inset: 2px 1px 2px 2px;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(107, 76, 38, 0.12), transparent 12%),
    #e7ddc7;
  box-shadow:
    -7px 0 15px rgba(54, 37, 19, 0.11),
    inset 0 0 22px rgba(96, 66, 31, 0.07);
  opacity: 0.82;
  transform: rotateY(0deg) translateZ(-2px);
  transform-origin: inherit;
  will-change: transform;
}

.block-lag-page:nth-child(2) {
  inset: 3px 2px 3px 3px;
  opacity: 0.62;
  transform: rotateY(0deg) translateZ(-5px);
}

.block-lag-page:nth-child(3) {
  inset: 4px 3px 4px 4px;
  opacity: 0.42;
  transform: rotateY(0deg) translateZ(-8px);
}

.thick-page-block[data-direction="forward"] .block-lag-page {
  transform-origin: left center;
}

.thick-page-block[data-direction="backward"] .block-lag-page {
  transform-origin: right center;
}

.thick-page-block[data-direction="backward"] .block-bend-slice,
.thick-page-block[data-direction="backward"] .block-lag-page {
  background:
    linear-gradient(270deg, rgba(104, 72, 35, 0.12), transparent 14%),
    #e7ddc7;
}

.open-book.is-block-turning .book-spine {
  width: calc(24px + var(--block-depth) * 0.28);
  filter: contrast(0.92);
}

@keyframes leaf-surface-breathe {
  0%,
  100% {
    filter: brightness(1);
  }
  48% {
    filter: brightness(0.94) contrast(1.03);
  }
  72% {
    filter: brightness(1.035);
  }
}

@keyframes leaf-highlight-travel {
  0% {
    opacity: 0;
    transform: translateX(-38%) translateZ(3px);
  }
  42% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(160%) translateZ(3px);
  }
}

.book[data-state="opening"] .answer-content {
  opacity: 0;
  filter: blur(6px);
}

.left-content {
  transition:
    opacity 260ms ease,
    filter 260ms ease;
}

.book[data-state="opening"] .left-content,
.book[data-state="closing"] .left-content,
.book[data-state="closing"] .answer-content {
  opacity: 0;
  filter: blur(4px);
}

.open-book.is-page-swipe-ready {
  cursor: grabbing;
}

.open-book.is-seeking .answer-content,
.open-book.is-seeking .sheet-answer {
  opacity: 0;
  filter: blur(5px);
}

.answer-content.answer-change,
.answer-content.answer-reveal {
  animation: answer-fade-in 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes answer-fade-in {
  0% {
    opacity: 0;
    filter: blur(7px);
  }
  48% {
    opacity: 0.42;
  }
  100% {
    opacity: 1;
    filter: none;
  }
}

.front-cover.is-swipe-ready {
  filter: brightness(1.06);
  transform: translateX(-11px) rotateY(-5deg) translateZ(5px);
}

.page-navigator {
  width: min(76vw, 560px);
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 260ms ease,
    visibility 0s linear 260ms;
}

.page-navigator.is-visible {
  visibility: visible;
  opacity: 1;
  transition-delay: 0ms;
}

.page-track {
  position: relative;
  width: 100%;
  height: 30px;
  cursor: pointer;
  touch-action: none;
}

.page-track:focus-visible {
  outline: none;
}

.page-track:focus-visible .page-track-line {
  box-shadow:
    0 0 0 3px rgba(202, 168, 106, 0.13),
    0 0 18px rgba(202, 168, 106, 0.18);
}

.page-track-line,
.page-track-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 2px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.page-track-line {
  right: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(232, 212, 170, 0.22) 0,
      rgba(232, 212, 170, 0.22) 1px,
      transparent 1px,
      transparent 7px
    );
}

.page-track-fill {
  width: var(--page-position, 0%);
  background: linear-gradient(90deg, rgba(202, 168, 106, 0.28), var(--gold-bright));
  box-shadow: 0 0 13px rgba(202, 168, 106, 0.25);
}

.page-track-thumb {
  position: absolute;
  top: 50%;
  left: var(--page-position, 0%);
  width: 15px;
  height: 15px;
  border: 1px solid rgba(235, 216, 174, 0.9);
  border-radius: 50%;
  background: #17253a;
  box-shadow:
    0 0 0 4px rgba(202, 168, 106, 0.08),
    0 0 18px rgba(202, 168, 106, 0.35);
  transform: translate(-50%, -50%);
  transition: box-shadow 180ms ease;
}

.page-navigator.is-scrubbing .page-track-thumb {
  box-shadow:
    0 0 0 7px rgba(202, 168, 106, 0.12),
    0 0 24px rgba(226, 199, 143, 0.52);
}

.page-track-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 3px;
  color: rgba(232, 212, 170, 0.32);
  font-family: "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.page-track-meta > :last-child {
  text-align: right;
}

.page-track-instruction {
  color: rgba(243, 234, 216, 0.44);
  font-family: "Microsoft YaHei", sans-serif;
  letter-spacing: 0.08em;
  text-align: center;
}

.page-navigator.is-turning .page-track-instruction {
  color: rgba(226, 199, 143, 0.7);
}

.mode-picker {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  width: min(90vw, 510px);
  padding: 26px;
  border: 1px solid rgba(226, 199, 143, 0.22);
  border-radius: 18px;
  background: rgba(10, 17, 28, 0.91);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
  opacity: 0;
  backdrop-filter: blur(18px);
  transform: translate(-50%, -45%) scale(0.94);
  transition:
    opacity 220ms ease,
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-picker.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.mode-intro {
  margin: 0 0 18px;
  color: rgba(243, 234, 216, 0.72);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-align: center;
}

.mode-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-card {
  display: flex;
  min-height: 154px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 15px;
  border: 1px solid rgba(202, 168, 106, 0.19);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.mode-card:hover,
.mode-card:focus-visible {
  border-color: rgba(226, 199, 143, 0.62);
  outline: none;
  background: rgba(202, 168, 106, 0.07);
  transform: translateY(-3px);
}

.mode-icon {
  height: 35px;
  color: var(--gold-bright);
  font-size: 23px;
}

.mode-pages {
  font-size: 31px;
  line-height: 0.8;
  transform: rotate(-6deg);
}

.mode-name {
  margin: 10px 0 7px;
  color: #f1dfba;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.mode-description {
  color: rgba(243, 234, 216, 0.48);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 11px;
  line-height: 1.6;
}

.mode-cancel {
  display: block;
  margin: 18px auto 0;
  border: 0;
  background: transparent;
  color: rgba(243, 234, 216, 0.38);
  cursor: pointer;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 11px;
}

.controls {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
}

.status {
  margin: 0;
  color: rgba(243, 234, 216, 0.48);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: center;
}

.open-actions {
  align-items: center;
  gap: 15px;
  opacity: 0;
  transition: opacity 220ms ease;
}

.open-actions.is-visible {
  opacity: 1;
}

.text-button {
  border: 0;
  background: transparent;
  color: rgba(232, 212, 170, 0.7);
  cursor: pointer;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.action-separator {
  width: 1px;
  height: 11px;
  background: rgba(232, 212, 170, 0.24);
}

.loading-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  background: var(--night);
  color: rgba(232, 212, 170, 0.65);
  text-align: center;
  transition:
    opacity 500ms ease,
    visibility 500ms ease;
}

.loading-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loading-star {
  color: var(--gold-bright);
  font-size: 23px;
  animation: loading-pulse 1.8s ease-in-out infinite;
}

.loading-screen p {
  margin: 15px 0 0;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.guide-layer {
  position: fixed;
  z-index: 90;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    visibility 0s linear 180ms;
}

.guide-layer.is-visible {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.guide-focus {
  position: fixed;
  z-index: 0;
  border: 1px dashed rgba(226, 199, 143, 0.82);
  box-shadow:
    0 0 0 9999px rgba(3, 7, 13, 0.55),
    0 0 0 5px rgba(202, 168, 106, 0.06),
    0 0 28px rgba(226, 199, 143, 0.2);
  transition:
    top 320ms cubic-bezier(0.22, 1, 0.36, 1),
    left 320ms cubic-bezier(0.22, 1, 0.36, 1),
    width 320ms cubic-bezier(0.22, 1, 0.36, 1),
    height 320ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 320ms ease;
}

.guide-card {
  position: fixed;
  z-index: 1;
  padding: 18px 19px 15px;
  border: 1px solid rgba(226, 199, 143, 0.3);
  border-radius: 14px;
  background: rgba(10, 17, 28, 0.9);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.38),
    inset 0 0 24px rgba(202, 168, 106, 0.025);
  pointer-events: auto;
  backdrop-filter: blur(18px);
  transition:
    top 320ms cubic-bezier(0.22, 1, 0.36, 1),
    left 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.guide-layer:not(.is-visible) .guide-focus,
.guide-layer:not(.is-visible) .guide-card {
  transition: none;
}

.guide-step {
  margin: 0 0 8px;
  color: rgba(226, 199, 143, 0.52);
  font-family: "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: 0.2em;
}

.guide-title {
  margin: 0;
  color: #ead9b6;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.guide-copy {
  margin: 10px 0 0;
  color: rgba(243, 234, 216, 0.68);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 11px;
  line-height: 1.85;
  letter-spacing: 0.04em;
}

.guide-visual {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin-top: 14px;
  padding: 11px 10px 10px;
  border: 1px solid rgba(226, 199, 143, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
}

.guide-cue {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  color: rgba(226, 199, 143, 0.82);
  text-align: center;
  transition:
    color 180ms ease,
    opacity 180ms ease;
}

.guide-cue.is-complete {
  color: #d9c27e;
}

.guide-cue.is-complete .guide-cue-icon {
  filter: drop-shadow(0 0 7px rgba(226, 199, 143, 0.35));
}

.guide-cue.is-complete .guide-cue-label {
  color: rgba(243, 234, 216, 0.82);
}

.guide-cue.is-complete .guide-cue-label::before {
  content: "✓ ";
  color: #d9c27e;
}

.guide-cue.needs-attention {
  animation: guide-cue-attention 520ms ease;
}

.guide-cue-icon {
  display: block;
  width: 29px;
  height: 29px;
  background: currentColor;
  mask: var(--guide-icon) center / contain no-repeat;
  -webkit-mask: var(--guide-icon) center / contain no-repeat;
  transform-origin: center;
}

.guide-cue-icon[data-icon="hand-click"] {
  --guide-icon: url("/assets/guide-icons/hand-click.svg");
}

.guide-cue-icon[data-icon="hand-move"] {
  --guide-icon: url("/assets/guide-icons/hand-move.svg");
}

.guide-cue-icon[data-icon="swipe-left"] {
  --guide-icon: url("/assets/guide-icons/swipe-left.svg");
}

.guide-cue-icon[data-icon="swipe-right"] {
  --guide-icon: url("/assets/guide-icons/swipe-right.svg");
}

.guide-cue-label {
  color: rgba(243, 234, 216, 0.5);
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 9px;
  line-height: 1.45;
  white-space: nowrap;
}

.guide-cue-separator {
  width: 1px;
  background: rgba(226, 199, 143, 0.12);
}

.guide-card[data-guide-step="0"] .guide-cue-secondary .guide-cue-icon,
.guide-card[data-guide-step="1"] .guide-cue-primary .guide-cue-icon {
  animation: guide-cue-left 2.2s cubic-bezier(0.42, 0, 0.2, 1) infinite;
}

.guide-card[data-guide-step="1"] .guide-cue-secondary .guide-cue-icon {
  animation: guide-cue-right 2.2s cubic-bezier(0.42, 0, 0.2, 1) infinite;
}

.guide-card[data-guide-step="2"] .guide-cue-primary:not(.is-complete) .guide-cue-icon {
  animation: guide-cue-track 2.8s cubic-bezier(0.42, 0, 0.2, 1) infinite;
}

.guide-card[data-guide-phase="close"][data-guide-path="full"] .guide-cue-secondary:not(.is-complete) .guide-cue-icon,
.guide-card[data-guide-phase="close"][data-guide-path="quick"] .guide-cue-primary:not(.is-complete) .guide-cue-icon {
  animation: guide-cue-tap 1.65s ease-in-out infinite;
}

@keyframes guide-cue-left {
  45%,
  70% {
    transform: translateX(-8px);
  }
}

@keyframes guide-cue-right {
  45%,
  70% {
    transform: translateX(8px);
  }
}

@keyframes guide-cue-track {
  35% {
    transform: translateX(-7px);
  }
  70% {
    transform: translateX(7px);
  }
}

@keyframes guide-cue-attention {
  35% {
    transform: translateY(-2px);
    color: #f0ddb6;
  }
}

@keyframes guide-cue-tap {
  45% {
    transform: scale(0.86);
    opacity: 0.7;
  }
}

.guide-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 27px;
  margin-top: 12px;
}

.guide-skip,
.guide-continue {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.guide-skip {
  padding: 5px 0;
  color: rgba(243, 234, 216, 0.38);
}

.guide-continue {
  padding: 5px 0 5px 12px;
  color: rgba(226, 199, 143, 0.82);
}

.guide-skip:hover,
.guide-skip:focus-visible,
.guide-continue:hover,
.guide-continue:focus-visible {
  color: #f0ddb6;
  outline: none;
}

@keyframes loading-pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.82);
  }
}

.error-toast {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  max-width: min(88vw, 420px);
  padding: 13px 16px;
  border: 1px solid rgba(255, 173, 153, 0.25);
  border-radius: 10px;
  background: rgba(67, 24, 25, 0.9);
  color: #ffd8ce;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 12px;
}

html[data-theme="forest"] {
  --night: #03100c;
  --navy: #0a1c14;
  --navy-light: #143323;
  --gold: #bd9551;
  --gold-bright: #d7b56d;
  --paper: #dfcfab;
  --paper-deep: #c8b184;
  --ink: #26392e;
  --muted: #879589;
}

html[data-theme="forest"] body {
  background:
    radial-gradient(circle at 50% 43%, rgba(35, 77, 50, 0.42), transparent 36%),
    #03100c;
}

html[data-theme="forest"] .forest-backdrop {
  opacity: 0.88;
}

html[data-theme="forest"] .glow-one {
  background: #26543a;
  opacity: 0.16;
}

html[data-theme="forest"] .glow-two {
  background: #80602c;
  opacity: 0.12;
}

html[data-theme="forest"] .grain {
  opacity: 0.09;
}

html[data-theme="forest"] .firefly {
  width: var(--fly-size, clamp(64px, 9vw, 112px));
  height: var(--fly-size, clamp(64px, 9vw, 112px));
  filter:
    brightness(1.45)
    saturate(1.18)
    drop-shadow(0 0 7px rgba(255, 212, 104, 0.7));
  animation:
    forest-firefly-drift var(--drift-time, 10s) ease-in-out infinite,
    forest-firefly-breathe var(--glow-time, 5.4s) ease-in-out infinite;
}

.firefly:nth-child(1) {
  top: 15%;
  left: 7%;
  --fly-size: clamp(70px, 10vw, 118px);
  animation-delay: -1.2s, -0.8s !important;
}

.firefly:nth-child(2) {
  top: 29%;
  right: 8%;
  --fly-size: clamp(86px, 12vw, 132px);
  --glow-time: 6.3s;
  animation-delay: -4.7s, -2.5s !important;
}

.firefly:nth-child(3) {
  top: 55%;
  left: 4%;
  --fly-size: clamp(60px, 8vw, 92px);
  animation-delay: -7.1s, -1.7s !important;
}

.firefly:nth-child(4) {
  right: 12%;
  bottom: 20%;
  --fly-size: clamp(76px, 11vw, 124px);
  animation-delay: -2.4s, -3.6s !important;
}

.firefly:nth-child(5) {
  right: 30%;
  bottom: 8%;
  --fly-size: clamp(58px, 7vw, 88px);
  animation-delay: -5.6s, -1.1s !important;
}

.firefly:nth-child(6) {
  top: 9%;
  right: 29%;
  --fly-size: clamp(66px, 9vw, 106px);
  animation-delay: -8.2s, -4.2s !important;
}

.firefly:nth-child(7) {
  bottom: 11%;
  left: 22%;
  --fly-size: clamp(82px, 12vw, 134px);
  --glow-time: 7.1s;
  animation-delay: -3.5s, -2.2s !important;
}

.firefly:nth-child(8) {
  top: 42%;
  right: 2%;
  --fly-size: clamp(56px, 7vw, 84px);
  animation-delay: -6.4s, -0.3s !important;
}

.firefly:nth-child(9) {
  top: 35%;
  left: 19%;
  --fly-size: clamp(62px, 8vw, 98px);
  animation-delay: -0.9s, -3.1s !important;
}

.firefly:nth-child(10) {
  top: 20%;
  left: 43%;
  --fly-size: clamp(54px, 7vw, 82px);
  --drift-time: 12s;
  animation-delay: -6.8s, -0.5s !important;
}

.firefly:nth-child(11) {
  top: 68%;
  right: 7%;
  --fly-size: clamp(82px, 11vw, 126px);
  --glow-time: 6.8s;
  animation-delay: -3.1s, -4.9s !important;
}

.firefly:nth-child(12) {
  bottom: 4%;
  left: 9%;
  --fly-size: clamp(62px, 8vw, 96px);
  animation-delay: -9.4s, -2.1s !important;
}

.firefly:nth-child(13) {
  top: 7%;
  left: 25%;
  --fly-size: clamp(48px, 6vw, 74px);
  animation-delay: -5.2s, -3.7s !important;
}

.firefly:nth-child(14) {
  top: 47%;
  left: 7%;
  --fly-size: clamp(76px, 10vw, 116px);
  --glow-time: 7.4s;
  animation-delay: -7.7s, -1.4s !important;
}

.firefly:nth-child(15) {
  right: 20%;
  bottom: 3%;
  --fly-size: clamp(52px, 7vw, 86px);
  animation-delay: -2.7s, -5.8s !important;
}

@keyframes forest-firefly-drift {
  0%,
  100% {
    transform: translate3d(-8px, 9px, 0) scale(0.82);
  }
  42% {
    transform: translate3d(12px, -15px, 0) scale(1.05);
  }
  72% {
    transform: translate3d(19px, 3px, 0) scale(0.92);
  }
}

@keyframes forest-firefly-breathe {
  0%,
  100% {
    opacity: 0.2;
  }
  48% {
    opacity: 0.92;
  }
  72% {
    opacity: 0.38;
  }
}

html[data-theme="forest"] .theme-button {
  border-color: rgba(215, 181, 109, 0.48);
  background: rgba(189, 149, 81, 0.08);
  color: rgba(228, 201, 145, 0.86);
  box-shadow: 0 0 18px rgba(163, 118, 46, 0.08);
}

html[data-theme="forest"] .eyebrow,
html[data-theme="forest"] .sound-button,
html[data-theme="forest"] .guide-button,
html[data-theme="forest"] .status,
html[data-theme="forest"] .text-button {
  color: rgba(225, 197, 138, 0.68);
}

html[data-theme="forest"] .guide-button,
html[data-theme="forest"] .sound-button {
  border-color: rgba(215, 181, 109, 0.13);
  background: rgba(189, 149, 81, 0.025);
}

html[data-theme="forest"] .cover-title,
html[data-theme="forest"] .question-label,
html[data-theme="forest"] .question-copy,
html[data-theme="forest"] .answer-text,
html[data-theme="forest"] .sheet-answer,
html[data-theme="forest"] .guide-title {
  font-family: var(--font-book);
}

html[data-theme="forest"] .eyebrow,
html[data-theme="forest"] .cover-kicker,
html[data-theme="forest"] .answer-number,
html[data-theme="forest"] .paper-page,
html[data-theme="forest"] .page-track-meta {
  font-family: var(--font-display);
}

html[data-theme="forest"] .cover-title {
  font-weight: 600;
  letter-spacing: 0.15em;
  text-shadow:
    0 1px 0 rgba(91, 57, 18, 0.92),
    0 0 24px rgba(224, 188, 106, 0.18);
}

html[data-theme="forest"] .answer-text {
  color: #342c20;
  font-weight: 600;
  line-height: 1.72;
  letter-spacing: 0.065em;
  text-shadow: none;
}

html[data-theme="forest"] .question-copy {
  color: #726047;
  line-height: 1.95;
  letter-spacing: 0.07em;
}

html[data-theme="forest"] .question-label {
  color: #493c2b;
}

html[data-theme="forest"] .answer-number,
html[data-theme="forest"] .paper-page {
  color: rgba(82, 63, 36, 0.58);
}

html[data-theme="forest"] .control-icon {
  filter: drop-shadow(0 0 6px rgba(215, 181, 109, 0.12));
}

html[data-theme="forest"] .guide-replay-hint {
  border-color: rgba(215, 181, 109, 0.32);
  background: rgba(4, 18, 12, 0.95);
  color: rgba(232, 215, 180, 0.74);
}

html[data-theme="forest"] .guide-replay-arrow {
  background: rgba(224, 188, 106, 0.94);
  filter: drop-shadow(0 0 8px rgba(225, 177, 70, 0.34));
}

html[data-theme="forest"] .guide-focus {
  border-color: rgba(224, 188, 106, 0.9);
  box-shadow:
    0 0 0 9999px rgba(1, 9, 6, 0.58),
    0 0 0 5px rgba(189, 149, 81, 0.08),
    0 0 30px rgba(222, 177, 78, 0.26);
}

html[data-theme="forest"] .guide-card {
  border-color: rgba(215, 181, 109, 0.34);
  background: rgba(4, 18, 12, 0.92);
  box-shadow:
    0 20px 54px rgba(0, 0, 0, 0.46),
    inset 0 0 28px rgba(189, 149, 81, 0.035);
}

html[data-theme="forest"] .guide-title {
  color: #e2c58b;
}

html[data-theme="forest"] .guide-copy {
  color: rgba(232, 215, 180, 0.7);
}

html[data-theme="forest"] .guide-visual {
  border-color: rgba(215, 181, 109, 0.16);
  background: rgba(189, 149, 81, 0.03);
}

html[data-theme="forest"] .guide-cue {
  color: rgba(224, 188, 106, 0.92);
}

html[data-theme="forest"] .guide-cue-label {
  color: rgba(232, 215, 180, 0.56);
}

html[data-theme="forest"] .guide-continue {
  color: rgba(224, 188, 106, 0.9);
}

html[data-theme="forest"] .front-cover {
  justify-content: flex-start;
  padding: 20% 12% 10%;
  background-color: #071b12;
  background-image: url("/assets/forest-cover-art-v5.webp");
  background-position: center;
  background-size: 100% 100%;
  box-shadow:
    inset 12px 0 24px rgba(255, 244, 210, 0.025),
    inset -14px 0 32px rgba(0, 0, 0, 0.36),
    0 0 0 1px rgba(215, 181, 109, 0.34),
    0 22px 42px rgba(0, 0, 0, 0.46);
}

html[data-theme="forest"] .front-cover::after {
  display: none;
}

html[data-theme="forest"] .front-cover > span {
  z-index: 1;
}

html[data-theme="forest"] .cover-border,
html[data-theme="forest"] .corner,
html[data-theme="forest"] .cover-star {
  display: none;
}

html[data-theme="forest"] .cover-kicker {
  margin-bottom: 13px;
  color: rgba(220, 188, 122, 0.76);
  font-size: 8px;
  letter-spacing: 0.38em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
}

html[data-theme="forest"] .cover-title {
  color: #dfc184;
  font-size: clamp(28px, 4vw, 39px);
  text-shadow:
    0 1px 0 #503416,
    0 0 16px rgba(225, 177, 70, 0.15),
    0 2px 9px rgba(0, 0, 0, 0.78);
}

html[data-theme="forest"] .cover-rule {
  width: 64px;
  margin-top: 18px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(220, 180, 103, 0.86),
    transparent
  );
}

html[data-theme="forest"] .open-book::before {
  inset: -7px -15px -21px;
  border-radius: 18px 20px 19px 18px;
  background: linear-gradient(105deg, #04120d, #173c28 48%, #04120d);
  box-shadow:
    0 17px 30px rgba(0, 0, 0, 0.52),
    inset 0 0 0 2px rgba(215, 181, 109, 0.38),
    inset 0 0 26px rgba(0, 0, 0, 0.7);
}

html[data-theme="forest"] .paper,
html[data-theme="forest"] .sheet-face,
html[data-theme="forest"] .thick-block-face,
html[data-theme="forest"] .cover-inside {
  color: var(--ink);
  background-color: #dfcda7;
  background-image: url("/assets/forest-page-right-v3.webp");
  background-position: center;
  background-size: 100% 100%;
  box-shadow:
    inset 0 0 62px rgba(75, 45, 17, 0.18),
    inset 0 0 0 1px rgba(155, 117, 58, 0.16);
}

html[data-theme="forest"] .left-paper {
  background-image:
    linear-gradient(270deg, rgba(57, 35, 14, 0.25), transparent 15%),
    url("/assets/forest-page-left-v3.webp");
  background-position: center;
  background-size: 100% 100%, 100% 100%;
}

html[data-theme="forest"] .cover-inside {
  background-image:
    linear-gradient(270deg, rgba(57, 35, 14, 0.25), transparent 15%),
    url("/assets/forest-page-left-v3.webp");
  background-position: center;
  background-size: 100% 100%, 100% 100%;
}

html[data-theme="forest"] .right-paper {
  background-image:
    linear-gradient(90deg, rgba(57, 35, 14, 0.24), transparent 15%),
    url("/assets/forest-page-right-v3.webp");
  background-position: center;
  background-size: 100% 100%, 100% 100%;
}

html[data-theme="forest"] .sheet-front {
  background-color: #dfcda7;
  background-image:
    linear-gradient(90deg, rgba(57, 35, 14, 0.24), transparent 15%),
    url("/assets/forest-page-right-v3.webp");
  background-position: center;
  background-size: 100% 100%, 100% 100%;
}

html[data-theme="forest"] .sheet-back {
  background-color: #dfcda7;
  background-image:
    linear-gradient(270deg, rgba(57, 35, 14, 0.25), transparent 16%),
    url("/assets/forest-page-left-v3.webp");
  background-position: center;
  background-size: 100% 100%, 100% 100%;
}

html[data-theme="forest"]
  .turning-sheet[data-direction="backward"]
  .sheet-front {
  background-image:
    linear-gradient(270deg, rgba(57, 35, 14, 0.25), transparent 16%),
    url("/assets/forest-page-left-v3.webp");
}

html[data-theme="forest"]
  .turning-sheet[data-direction="backward"]
  .sheet-back {
  background-image:
    linear-gradient(90deg, rgba(57, 35, 14, 0.24), transparent 15%),
    url("/assets/forest-page-right-v3.webp");
}

html[data-theme="forest"] .thick-block-front {
  background-image:
    linear-gradient(90deg, rgba(57, 35, 14, 0.24), transparent 15%),
    url("/assets/forest-page-right-v3.webp");
}

html[data-theme="forest"] .thick-block-back {
  background-image:
    linear-gradient(270deg, rgba(57, 35, 14, 0.25), transparent 16%),
    url("/assets/forest-page-left-v3.webp");
}

html[data-theme="forest"]
  .thick-page-block[data-direction="backward"]
  .thick-block-front {
  background-image:
    linear-gradient(270deg, rgba(57, 35, 14, 0.25), transparent 16%),
    url("/assets/forest-page-left-v3.webp");
}

html[data-theme="forest"]
  .thick-page-block[data-direction="backward"]
  .thick-block-back {
  background-image:
    linear-gradient(90deg, rgba(57, 35, 14, 0.24), transparent 15%),
    url("/assets/forest-page-right-v3.webp");
}

html[data-theme="forest"] .block-bend-slice,
html[data-theme="forest"] .block-lag-page {
  background-color: #dfcda7;
  background-image:
    linear-gradient(
      90deg,
      rgba(85, 54, 23, 0.14),
      rgba(255, 244, 214, 0.08) 48%,
      rgba(72, 44, 18, 0.11)
    ),
    url("/assets/forest-page-right-v3.webp");
  background-position: center;
  background-size: 100% 100%, 100% 100%;
}

html[data-theme="forest"]
  .thick-page-block[data-direction="backward"]
  .block-bend-slice,
html[data-theme="forest"]
  .thick-page-block[data-direction="backward"]
  .block-lag-page {
  background-color: #dfcda7;
  background-image:
    linear-gradient(270deg, rgba(85, 54, 23, 0.16), transparent 15%),
    url("/assets/forest-page-left-v3.webp");
  background-position: center;
  background-size: 100% 100%, 100% 100%;
}

html[data-theme="forest"] .thick-block-edge {
  background:
    repeating-linear-gradient(
      to bottom,
      #d7c399 0,
      #d7c399 1px,
      #9f7e4c 1.6px,
      #e7d2a8 2.8px
    );
}

html[data-theme="forest"] .thick-block-bottom {
  background:
    repeating-linear-gradient(
      90deg,
      #c9ad79 0,
      #e2cea5 3px,
      #9e7e4e 4px,
      #e2cea5 5px
    );
}

html[data-theme="forest"] .page-curl-light {
  background: linear-gradient(
    90deg,
    rgba(255, 238, 192, calc(var(--flip-shadow, 0) * 0.34)),
    rgba(72, 43, 18, calc(var(--flip-shadow, 0) * 0.15)),
    transparent
  );
}

html[data-theme="forest"]
  .turning-sheet[data-direction="backward"]
  .page-curl-light {
  background: linear-gradient(
    270deg,
    rgba(255, 238, 192, calc(var(--flip-shadow, 0) * 0.34)),
    rgba(72, 43, 18, calc(var(--flip-shadow, 0) * 0.15)),
    transparent
  );
}

html[data-theme="forest"] .page-stack,
html[data-theme="forest"] .page-block {
  border-color: rgba(111, 76, 35, 0.28);
  background:
    repeating-linear-gradient(
      to bottom,
      #d7c39e 0,
      #d7c39e 1px,
      #aa8c5d 1.5px,
      #e6d4b1 2.8px
    );
}

html[data-theme="forest"] .paper-noise {
  opacity: 0.16;
}

html[data-theme="forest"] .book-spine {
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(54, 31, 12, 0.2) 27%,
      rgba(255, 246, 218, 0.19) 50%,
      rgba(54, 31, 12, 0.24) 73%,
      transparent
    );
}

html[data-theme="forest"] .page-track-thumb {
  border-color: rgba(229, 199, 137, 0.94);
  background: #0b2a1c;
  box-shadow:
    0 0 0 4px rgba(189, 149, 81, 0.1),
    0 0 20px rgba(207, 157, 63, 0.32);
}

html[data-theme="forest"] .page-track-instruction {
  color: rgba(224, 204, 164, 0.48);
}

@media (max-width: 700px) {
  :root {
    --book-w: min(64vw, 272px);
  }

  .app {
    padding-right: 17px;
    padding-left: 17px;
  }

  .eyebrow {
    font-size: 8px;
    letter-spacing: 0.24em;
  }

  .masthead-actions {
    gap: 9px;
  }

  .guide-button {
    padding: 5px 7px;
    font-size: 9px;
  }

  .guide-replay-hint {
    width: 174px;
    padding: 9px 11px;
    font-size: 9px;
  }

  .theme-button {
    padding: 5px 7px;
    font-size: 9px;
  }

  .sound-button {
    padding: 5px 7px;
    font-size: 9px;
  }

  .control-icon {
    width: 14px;
    height: 14px;
  }

  .masthead-actions .guide-button > span:last-child,
  .masthead-actions .theme-button > span:last-child,
  .masthead-actions .sound-button > span:last-child {
    display: none;
  }

  .sound-button,
  .theme-button,
  .guide-button {
    width: 31px;
    height: 31px;
    justify-content: center;
    padding: 0;
  }

  .book {
    --closed-scale-x: 1.35;
    --closed-scale-y: 1.25;
    width: min(95vw, 600px);
    height: clamp(284px, 69vw, 390px);
    min-height: 0;
  }

  .book-stage {
    gap: 22px;
  }

  .page-navigator {
    width: min(86vw, 420px);
  }

  .answer-text {
    font-size: clamp(17px, 5.2vw, 26px);
    line-height: 1.58;
  }

  .question-label {
    font-size: clamp(10px, 3.4vw, 14px);
  }

  .question-copy {
    font-size: clamp(8px, 2.5vw, 11px);
  }

  .mode-picker {
    padding: 19px;
  }

  .mode-card {
    min-height: 138px;
    padding: 16px 9px;
  }

  .mode-name {
    font-size: 14px;
  }

  .mode-description {
    font-size: 10px;
  }

  .guide-card {
    padding: 16px 17px 13px;
  }

  .guide-title {
    font-size: 15px;
  }

  .guide-copy {
    font-size: 10px;
    line-height: 1.8;
  }

  .guide-visual {
    gap: 8px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .guide-cue-icon {
    width: 27px;
    height: 27px;
  }

  .guide-cue-label {
    font-size: 8px;
  }

}

@media (max-height: 670px) {
  :root {
    --book-w: min(49vh, 250px);
  }

  .app {
    padding-top: max(13px, env(safe-area-inset-top));
    padding-bottom: max(13px, env(safe-area-inset-bottom));
  }

  .book {
    --closed-scale-x: 0.81;
    --closed-scale-y: 1.01;
    width: min(80vw, 620px);
    height: min(53vw, 350px);
    min-height: 250px;
  }

  .book-stage {
    gap: 14px;
  }

  .page-track {
    height: 24px;
  }

  .page-track-meta {
    margin-top: 0;
  }

}

@media (max-width: 700px) and (max-height: 670px) {
  .book {
    --closed-scale-x: 1.58;
    --closed-scale-y: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  html[data-theme="forest"] .firefly {
    animation: none !important;
    opacity: 0.58;
  }

  .guide-cue-icon {
    animation: none !important;
  }

}
