* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
  color: #3b2414;
  background:
    radial-gradient(circle at top, #fff7df 0%, #e7c995 45%, #6e431f 100%);
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 248, 225, 0.9);
  border: 2px solid #9b6b35;
  border-radius: 20px;
  padding: 18px 26px;
  margin-bottom: 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.topbar h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 6px;
  color: #4a2612;
}

.topbar p {
  margin: 8px 0 0;
  color: #7b4a22;
  font-size: 17px;
}

#installBtn {
  border: none;
  border-radius: 999px;
  background: #7b4a22;
  color: #fff8dc;
  padding: 11px 20px;
  font-size: 16px;
  cursor: pointer;
}

#installBtn:hover {
  background: #4a2612;
}

.book {
  position: relative;
  min-height: 720px;
  perspective: 1600px;
}

.page {
  display: none;
  min-height: 720px;
  padding: 36px;
  text-align: center;
  border: 8px double #9b6b35;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 252, 240, 0.94), rgba(255, 240, 205, 0.94));
  box-shadow:
    0 26px 65px rgba(0, 0, 0, 0.35),
    inset 0 0 45px rgba(130, 80, 30, 0.18);
  animation: pageFlip 0.65s ease;
}

.page.active {
  display: block;
}

.page h2 {
  margin: 0 0 24px;
  font-size: 42px;
  letter-spacing: 8px;
  color: #4a2612;
}

.page img {
  display: block;
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
  margin: 0 auto 24px;
  border-radius: 14px;
  background: #fffaf0;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.page p {
  max-width: 880px;
  margin: 0 auto;
  font-size: 22px;
  line-height: 1.9;
}

.cover h2 {
  font-size: 56px;
}

.subtitle {
  margin-bottom: 20px !important;
  font-size: 24px !important;
  color: #8a5a2b;
}

.caption {
  margin-top: 18px !important;
  font-weight: bold;
  letter-spacing: 4px;
}

.controls {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.controls button {
  border: none;
  border-radius: 999px;
  background: #4a2612;
  color: #fff8dc;
  padding: 13px 30px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  transition: 0.25s;
}

.controls button:hover {
  transform: translateY(-2px);
  background: #7b4a22;
}

#pageInfo {
  background: rgba(255, 248, 225, 0.9);
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: bold;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 11px;
  margin-top: 18px;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #d8b47a;
  cursor: pointer;
  transition: 0.25s;
}

.dot.active {
  background: #4a2612;
  transform: scale(1.35);
}

@keyframes pageFlip {
  from {
    opacity: 0;
    transform: rotateY(-18deg) translateX(45px);
  }

  to {
    opacity: 1;
    transform: rotateY(0) translateX(0);
  }
}

@media (max-width: 760px) {
  .app {
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .topbar h1 {
    font-size: 25px;
    letter-spacing: 3px;
  }

  .book {
    min-height: 590px;
  }

  .page {
    min-height: 590px;
    padding: 22px;
  }

  .page h2 {
    font-size: 30px;
    letter-spacing: 4px;
  }

  .cover h2 {
    font-size: 36px;
  }

  .page p {
    font-size: 18px;
  }

  .controls button {
    padding: 11px 18px;
    font-size: 16px;
  }
}