/* 页面背景与居中 */
body {
  margin: 0;
  height: 100vh;
  background-image: url('/images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 书本本体 */
.book {
  position: relative;
  width: 1040px;
  height: 780px;
  border-radius: 20px;
  opacity: 0.97;
  overflow: visible;
  perspective: 1000px;
  z-index: 1;
  transition: filter 1s ease;
}

/* 🌟 打开后的外发光 */
.book.opened {
  filter:
    drop-shadow(0 0 40px rgba(255, 230, 180, 0.45))
    drop-shadow(0 0 80px rgba(255, 240, 200, 0.35));
}

/* 封面 */
#cover {
  position: absolute;
  left: 260px;
  top: 0;
  width: 520px;
  height: 780px;
  object-fit: cover;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: url('/images/cursor2.cur'), pointer;
  z-index: 3;
  filter: drop-shadow(0 0 25px rgba(255, 230, 180, 0.4))
          drop-shadow(0 0 60px rgba(255, 240, 200, 0.3));
}

/* 封面轻微摆动 */
@keyframes swing-loop {
  0%   { transform: rotateY(0deg); }
  25%  { transform: rotateY(1.2deg); }
  50%  { transform: rotateY(-1.2deg); }
  75%  { transform: rotateY(0.7deg); }
  100% { transform: rotateY(0deg); }
}
#cover:hover { animation: swing-loop 2s ease-in-out infinite; }

/* turn.js 容器 */
#flipbook {
  position: relative;
  width: 1040px;
  height: 780px;
  overflow: visible;
  z-index: 2;
}
#flipbook .page {
  width: 520px;
  height: 780px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 30px rgba(255, 230, 180, 0.35))
          drop-shadow(0 0 70px rgba(255, 240, 200, 0.25));
}
#flipbook .page.hard {
  background-color: #3b2414;
  box-shadow:
    inset 0 0 24px rgba(0,0,0,.35),
    0 6px 12px rgba(0,0,0,.25),
    0 0 40px rgba(255, 230, 180, 0.3);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* 右页 */
.answer-page {
  position: relative;
  filter: drop-shadow(0 0 35px rgba(255, 220, 160, 0.4))
          drop-shadow(0 0 75px rgba(255, 240, 200, 0.35));
}
#message {
  width: 400px;
  padding: 40px 20px;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -70%);
  text-align: center;
  font-size: 1.5em;
  line-height: 1.6;
  font-family: 'Noto Serif SC', 'Yu Mincho', serif;
  color: rgba(39, 19, 6, 0.801);
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(255, 187, 0, 0.596);
  z-index: 2;
  animation: fadeInText 5.2s ease-out both;
}
#page {
  position: absolute;
  right: 20px;
  bottom: 20px;
  font-size: 0.9em;
  color: rgba(39, 19, 6, 0.753);
  font-family: 'Noto Serif SC', 'Yu Mincho', serif;
  letter-spacing: 0.05em;
  z-index: 2;
  animation: fadeInText 5.2s ease-out both;
}
@keyframes fadeInText { from { opacity: 0; } to { opacity: 1; } }

/* 星按钮 */
.star-trigger {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  transition: filter 0.3s ease;
  z-index: 999;
  cursor: url('/images/cursor3.cur'), pointer;
}
.star-trigger:hover {
  filter: drop-shadow(0 0 8px #f7e894) brightness(1.5);
}

/* 卷轴 */
.overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0.2vh 4vw 0 0;
  box-sizing: border-box;
  z-index: 1000;
}
.scroll-box {
  position: relative;
  width: 420px;
  animation: slideDown 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(-100px);
}
.scroll-image {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.85;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.15));
}
.scroll-text {
  position: absolute;
  top: 33%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  font-size: 1.08rem;
  font-family: 'Noto Serif JP', serif;
  color: rgba(32, 16, 4, 0.904);
  text-align: center;
  pointer-events: none;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-shadow: 0 0 5px #f0e6c0e0;
}
.scroll-title {
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 0 8px #f0e6c0, 0 0 12px #f5dfa0;
  color: #5b3e14;
  letter-spacing: 0.08em;
  display: inline-block;
  margin-bottom: 0.5em;
}
@keyframes slideDown { to { opacity: 1; transform: translateY(0); } }

/* 光标 */
body, * { cursor: url('/images/cursor.cur'), auto; }
