* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper: #FFF8E7;
  --ink: #4A3F35;
  --orange: #ff8a3d;
  --blue: #54A0FF;
  --green: #2ED573;
  --frame: #FFE0A3;
}

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
}

/* 顶部栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.title-wrap { text-align: center; line-height: 1.3; }
.book-title { display: block; font-size: 17px; font-weight: 700; }
.page-indicator { display: block; font-size: 12px; opacity: 0.9; }

.nav-btn {
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #fff; font-size: 26px; line-height: 1;
  cursor: pointer;
}
.nav-btn:active { background: rgba(255,255,255,0.45); }
.nav-btn:disabled { opacity: 0.35; cursor: default; }

/* 舞台 */
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 18px 16px; }

.page-frame {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 16 / 9;
  background: #fff;
  border: 6px solid var(--frame);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  touch-action: manipulation;
}
.page-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hotspot-layer { position: absolute; inset: 0; }

.hotspot {
  position: absolute;
  border: 3px dashed var(--blue);
  border-radius: 14px;
  background: rgba(84,160,255,0.10);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.1s;
}
.hotspot::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 0 rgba(84,160,255,0.6);
  animation: pulse 1.6s infinite;
}
.hotspot:active { transform: scale(0.97); background: rgba(84,160,255,0.25); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(84,160,255,0.55); }
  70%  { box-shadow: 0 0 0 16px rgba(84,160,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(84,160,255,0); }
}

.hotspot.playing { border-color: var(--green); background: rgba(46,213,115,0.22); }
.hotspot.playing::after { background: var(--green); animation: none; }

body.zones-hidden .hotspot { border-color: transparent; background: transparent; }
body.zones-hidden .hotspot::after { display: none; }

.hint { margin-top: 14px; font-size: 13px; color: #9b8f7e; text-align: center; }

/* 底部控制 */
.controls {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  flex-wrap: wrap;
  padding: 16px; background: #fff;
  border-top: 1px solid #f0e6d2;
}
.ctrl-btn {
  border: none; border-radius: 26px;
  padding: 12px 22px; min-height: 46px; font-size: 16px; font-weight: 700;
  cursor: pointer; color: #fff; background: var(--green);
  box-shadow: 0 3px 0 #22a85b;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.ctrl-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #22a85b; }
.ctrl-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #22a85b; }

.switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #7a6e5c; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--orange); }

/* 阅读器：整页文案 */
.caption {
  margin-top: 12px; max-width: 440px; width: 100%;
  font-size: 15px; line-height: 1.5; color: var(--ink);
  background: #fff; border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.nav-mini { background: var(--orange); box-shadow: 0 3px 0 #e08a2e; font-size: 15px; padding: 12px 16px; }
.nav-ghost { background: transparent; box-shadow: none; pointer-events: none; }

/* ============ 书架 ============ */
.shelf { flex: 1; padding: 16px 16px 28px; }
.shelf-lead {
  font-size: 13px; color: #8a7c68; line-height: 1.6;
  margin: 4px 2px 16px; text-align: center;
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.book-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  transition: transform 0.12s, box-shadow 0.12s;
}
.book-card:active { transform: scale(0.97); }
.book-cover {
  position: relative; aspect-ratio: 3 / 4; background: #ffe9c7; overflow: hidden;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vip-badge {
  position: absolute; top: 8px; right: 8px;
  background: #ff5e7e; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}
.book-meta { padding: 10px 12px 12px; }
.book-name { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.book-en { font-size: 11px; color: #b3a690; margin-top: 1px; }
.book-desc { font-size: 12px; color: #8a7c68; margin-top: 6px; line-height: 1.4; }
.book-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.book-tags .tag {
  font-size: 11px; color: var(--orange);
  background: #fff3e0; border-radius: 8px; padding: 2px 8px;
}
.book-enter {
  margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--orange);
  text-align: right;
}
