:root {
  --bg: #fff6e4;
  --bg-deep: #ffe7c2;
  --paper: #ffffff;
  --ink: #3a2418;
  --muted: #8a5a3c;
  --line: #f3d4ae;
  --coral: #ff7a3d;
  --coral-deep: #e2551c;
  --teal: #1db8a4;
  --sky: #4ec3f7;
  --lemon: #ffe27a;
  --grape: #8b6cff;
  --shadow: 0 10px 0 rgba(240, 186, 130, 0.45), 0 16px 28px rgba(90, 40, 10, 0.08);
  --radius: 26px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --player-h: 0px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; color: var(--ink); }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  overscroll-behavior-y: none;
  background:
    radial-gradient(circle at 10% 6%, #ffe27a 0 16px, transparent 17px),
    radial-gradient(circle at 92% 10%, #8be7d8 0 12px, transparent 13px),
    radial-gradient(circle at 86% 94%, #ffb7d0 0 18px, transparent 19px),
    linear-gradient(180deg, #fff8ea 0%, #ffe9c8 100%);
  background-attachment: fixed;
}
button, a { color: inherit; }
button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
a { text-decoration: none; }

#app {
  min-height: 100dvh;
  padding: calc(16px + var(--safe-top)) 16px calc(24px + var(--safe-bottom) + var(--player-h));
}

.page { max-width: 560px; margin: 0 auto; }

.page-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 246, 228, 0.94);
  backdrop-filter: blur(14px);
  margin: calc(-16px - var(--safe-top)) -16px 16px;
  padding: calc(10px + var(--safe-top)) 16px 12px;
  box-shadow: 0 10px 18px rgba(255, 246, 228, 0.9);
}
.page-head.has-video { padding-bottom: 12px; }
.page-head .topbar { margin-bottom: 0; }
.page-head .play-video {
  margin: 10px 0 0;
  border-radius: 20px;
  overflow: hidden;
  background: #111;
  box-shadow: var(--shadow);
}
.page-head .play-video video {
  width: 100%;
  max-height: 34vh;
  object-fit: contain;
  vertical-align: middle;
  background: #000;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.back {
  min-width: 72px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--paper);
  border: 2px solid #ffe0b8;
  box-shadow: 0 4px 0 #f0c49a;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
}
.back:active { transform: translateY(2px); box-shadow: 0 2px 0 #f0c49a; }
.crumbs { min-width: 0; }
.crumbs .kicker {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.crumbs h1 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1.2;
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 26px 22px 28px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255,255,255,.35) 0 28px, transparent 29px),
    linear-gradient(145deg, #ffc36a 0%, #ff9440 48%, #ff6f2f 100%);
  color: #3a1608;
  box-shadow: 0 12px 0 #e9843a, 0 18px 32px rgba(226, 85, 28, 0.22);
  margin-bottom: 22px;
  border: 3px solid #fff3c8;
}
.hero .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.3;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.42);
}
.hero h1 {
  margin: 16px 0 8px;
  font-size: 36px;
  letter-spacing: 0.01em;
  color: #2a1006;
  text-shadow: 0 2px 0 rgba(255,255,255,.28);
}
.hero p { margin: 0; font-size: 16px; color: #5a2610; font-weight: 700; }
.deer {
  position: absolute;
  right: 8px;
  bottom: -4px;
  width: 118px;
  height: 118px;
  filter: drop-shadow(0 6px 0 rgba(180, 80, 20, 0.12));
}

.section-title {
  margin: 6px 6px 14px;
  font-size: 16px;
  color: var(--muted);
  font-weight: 800;
}

.card-list, .track-list { display: grid; gap: 14px; }
.track-section {
  margin: 16px 6px 2px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff3c8;
  color: #9a5a18;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 3px 0 #f0d48a;
}

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 16px 14px;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 2px solid #ffe7c8;
}
.card:active { transform: translateY(3px); box-shadow: 0 7px 0 rgba(240, 186, 130, 0.45); }
.card .emoji,
.book-cover {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 30px;
  flex: none;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.05);
}
.card .meta { min-width: 0; flex: 1; }
.card h2, .card h3 {
  margin: 0 0 4px;
  font-size: 20px;
  color: var(--ink);
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.card .go {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ffe27a;
  display: grid;
  place-items: center;
  color: #9a4a10;
  flex: none;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 0 #f0c44a;
}
.feature-card .emoji { background: #ffe0d0; }
.soon {
  opacity: 0.78;
  box-shadow: none;
  border-style: dashed;
}
.soon .emoji { background: #e8f6f3; }

.book-card[data-book="dianfan"] .book-cover { background: #ffe0d0; }
.book-card[data-book="xinsiwei"] .book-cover { background: #d4f4ef; }
.book-card[data-book="yilin"] .book-cover { background: #ebe4ff; }
.book-card[data-book="dianfan"] { border-color: #ffd0b0; }
.book-card[data-book="xinsiwei"] { border-color: #b8ebe3; }
.book-card[data-book="yilin"] { border-color: #d8cffc; }

.continue-card {
  background: linear-gradient(135deg, #fff4cc, #ffe27a);
  border-color: #ffd45a;
}
.continue-card .emoji { background: #fff; }
.continue-card .go { background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-deep); }
.playall-card .emoji { background: #e8fbf6; }
.playall-card .go { background: #c8f4ea; color: #0d7a6c; box-shadow: 0 4px 0 #8ed9cb; }

.track {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 10px;
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 2px solid #ffe7c8;
  text-align: left;
  width: 100%;
}
.track:active { transform: translateY(3px); box-shadow: 0 7px 0 rgba(240, 186, 130, 0.45); }
.track .idx {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #ffd4be;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--coral-deep);
  border: 3px solid #fff;
  box-shadow: 0 4px 0 #f0c9a0;
}
.track-list > a.track:nth-of-type(5n+2) .idx { background: #c8f3ea; color: #0d7a6c; box-shadow: 0 4px 0 #8ed9cb; }
.track-list > a.track:nth-of-type(5n+3) .idx { background: #cceeff; color: #1a7ab8; box-shadow: 0 4px 0 #8ec8e8; }
.track-list > a.track:nth-of-type(5n+4) .idx { background: #e4dcff; color: #5b3db8; box-shadow: 0 4px 0 #c3b6f0; }
.track-list > a.track:nth-of-type(5n+5) .idx { background: #ffe27a; color: #9a5a10; box-shadow: 0 4px 0 #f0c44a; }
.track .name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}
.track .kind {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff1d8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.pill.heard { background: #ffe27a; color: #9a4a10; }
.pill.video { background: #ebe4ff; color: #5b3db8; }
.play-dot {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #fff4cc;
  color: var(--coral-deep);
  display: grid;
  place-items: center;
  font-size: 14px;
  box-shadow: 0 3px 0 #f0d48a;
}
.track.active {
  background: #fff7e8;
  border-color: #ffb27a;
}
.track.active .idx {
  background: linear-gradient(180deg, #ffb36a, #ff7a3d);
  color: #fff;
  box-shadow: 0 4px 0 #e2551c;
}
.track.active .play-dot {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 3px 0 var(--coral-deep);
}

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(92, 52, 20, 0.1);
}
.player-inner { max-width: 560px; margin: 0 auto; }
.video-wrap {
  display: none;
  border-radius: 16px;
  overflow: hidden;
  background: #1c120c;
  margin-bottom: 10px;
}
.video-wrap.show { display: block; }
.video-wrap video {
  width: 100%;
  max-height: 42vh;
  vertical-align: middle;
  background: #000;
}
.now {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}
.now strong { font-size: 15px; }
.now span { color: var(--muted); font-size: 13px; white-space: nowrap; font-weight: 800; }
.seek {
  width: 100%;
  accent-color: var(--coral);
  height: 22px;
}
.times {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  font-weight: 800;
}
.times [data-time-cur] {
  justify-self: start;
  color: var(--coral-deep);
}
.times-sep {
  padding: 0 10px;
  color: #d4b08a;
}
.times [data-time-dur] { justify-self: end; }
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.ctrl {
  min-width: 48px;
  height: 44px;
  padding: 0 10px;
  border-radius: 16px;
  background: #fff1d8;
  color: #3a1608;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 4px 0 #f0d4a8;
}
.ctrl:active { transform: translateY(2px); box-shadow: 0 2px 0 #f0d4a8; }
.ctrl.primary {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb07a, #e2551c);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 8px 0 #c24616, 0 12px 20px rgba(226, 85, 28, 0.28);
}
.ctrl.primary:active { box-shadow: 0 4px 0 #c24616; }
.ctrl.on { background: var(--teal); color: #fff; box-shadow: 0 4px 0 #128f7f; }

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 16px;
}

.play-page .cues {
  display: grid;
  gap: 12px;
  padding-bottom: min(44vh, 340px);
}
.cue-hint {
  margin: 0 4px 12px;
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff3c8;
  color: #9a5a18;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 3px 0 #f0d48a;
}
.cue-line {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: var(--paper);
  border: 2px solid #ffe7c8;
  border-radius: 22px;
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.7;
  word-break: break-word;
}
.cue-line:active { transform: translateY(3px); box-shadow: 0 7px 0 rgba(240, 186, 130, 0.45); }
.cue-line.on {
  border-color: #ffb27a;
  background: #fff6e4;
  box-shadow: 0 10px 0 rgba(255, 178, 122, 0.35), 0 16px 28px rgba(90, 40, 10, 0.08);
}
.word {
  display: inline;
  padding: 0 2px;
  border-radius: 6px;
  color: inherit;
  font: inherit;
}
.word.on {
  background: #ffe27a;
  color: #b33a10;
  box-shadow: inset 0 -4px 0 var(--coral);
}
.play-video { margin-bottom: 12px; }
.play-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 12px 12px calc(12px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-top: 2px solid #ffe7c8;
  box-shadow: 0 -10px 28px rgba(92, 52, 20, 0.08);
}
.play-dock .now,
.play-dock .seek,
.play-dock .times,
.play-dock .controls {
  max-width: 560px;
  width: min(560px, 100%);
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 720px) {
  #app { padding-top: 28px; }
}
