:root {
  --green: #129a55;
  --deep: #0b3b28;
  --bg: #f4f5f3;
  --surface: #ffffff;
  --text: #16181a;
  --sub: #6b7075;
  --weak: #9aa0a6;
  --line: rgba(0, 0, 0, 0.08);
  --link: #0f8a4b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1112;
    --surface: #1a1d1f;
    --text: #eceeef;
    --sub: #a3a9ae;
    --weak: #6f767c;
    --line: rgba(255, 255, 255, 0.1);
    --link: #3fc27f;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1112;
  --surface: #1a1d1f;
  --text: #eceeef;
  --sub: #a3a9ae;
  --weak: #6f767c;
  --line: rgba(255, 255, 255, 0.1);
  --link: #3fc27f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ 单集页头部：封面模糊做底，和 App 播放页一致 */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--deep);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -60px;
  background: var(--cover) center / cover no-repeat;
  filter: blur(40px) saturate(1.3);
  transform: scale(1.15);
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.42) 55%, rgba(0, 0, 0, 0.62) 100%);
  z-index: -1;
}
.hero-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(36px + env(safe-area-inset-top)) 24px 28px;
  text-align: center;
}
.cover {
  display: block;
  width: min(240px, 64vw);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0 auto 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}
.show { margin: 0 0 6px; font-size: 14px; opacity: 0.78; }
.title { margin: 0; font-size: 22px; line-height: 1.38; font-weight: 700; letter-spacing: 0.01em; }
.title-en { margin: 8px 0 0; font-size: 13px; line-height: 1.45; opacity: 0.6; }
.meta { margin: 10px 0 0; font-size: 13px; opacity: 0.6; }

/* 播放器 */
.player { margin: 26px 0 6px; }
.bar { padding: 8px 0; }
#seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 2px;
  background: linear-gradient(to right, #fff var(--p, 0%), rgba(255, 255, 255, 0.25) var(--p, 0%));
  outline: none;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
#seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.times { display: flex; justify-content: space-between; font-size: 12px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.ctl { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; opacity: 0.92; }
.ctl svg { width: 30px; height: 30px; fill: #fff; }
.ctl svg text { fill: #fff; font-family: -apple-system, sans-serif; }
.ctl:active { background: rgba(255, 255, 255, 0.12); }
.speed { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.play {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease;
}
.play:active { transform: scale(0.94); }
.play svg { width: 30px; height: 30px; fill: var(--deep); }
.play .i-pause { display: none; }
.playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.loading .play { opacity: 0.7; }

.cta {
  display: block;
  margin: 22px auto 0;
  max-width: 320px;
  padding: 14px 20px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 6px 18px rgba(18, 154, 85, 0.35);
}
.cta:active { filter: brightness(0.94); }
.hint { margin: 10px 0 0; font-size: 12px; opacity: 0.6; }

/* ------------------------------------------------------------ 正文 */
.content { max-width: 640px; margin: 0 auto; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); }
.notes {
  margin-top: 16px;
  padding: 20px 20px 8px;
  background: var(--surface);
  border-radius: 16px;
}
.notes h2, .list-head { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.notes-body { position: relative; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.notes-body p { margin: 0 0 12px; }
.notes-body h3 { margin: 18px 0 8px; font-size: 15px; font-weight: 700; }
.notes-body ul { margin: 0 0 12px; padding-left: 1.2em; }
.notes-body li { margin: 0 0 6px; }
.notes-body .chapter { display: flex; gap: 12px; margin: 0 0 8px; }
.notes-body .ts {
  flex: none; min-width: 58px;
  color: var(--green); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; text-align: left;
}
.notes-body.collapsed { max-height: 340px; overflow: hidden; }
.notes-body.collapsed::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 88px;
  background: linear-gradient(to bottom, transparent, var(--surface));
}
.more { display: block; width: 100%; padding: 12px 0 14px; color: var(--link); font-size: 15px; font-weight: 600; }

.foot { margin: 28px 0 4px; text-align: center; font-size: 12px; color: var(--weak); }
.foot a { color: var(--weak); }

/* ------------------------------------------------------------ 首页 / 404 */
.home-head {
  text-align: center;
  padding: calc(48px + env(safe-area-inset-top)) 24px 28px;
  background: linear-gradient(180deg, var(--deep), #0e4a32);
  color: #fff;
}
.home-head img { border-radius: 18px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3); }
.home-head h1 { margin: 14px 0 0; font-size: 22px; }
.home-head .sub { margin: 6px 0 0; font-size: 14px; opacity: 0.7; }
.list-head { margin: 20px 4px 4px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows a { display: flex; gap: 14px; align-items: center; padding: 12px 4px; color: var(--text); }
.rows img { flex: none; width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--line); }
.rows p { margin: 0; }
.row-show { font-size: 12px; color: var(--sub); }
.row-title {
  font-size: 16px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.row-meta { font-size: 12px; color: var(--weak); margin-top: 2px; }

/* ------------------------------------------------------------ 微信里打开的提示 */
.wx-tip {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(0, 0, 0, 0.72);
  color: #fff; text-align: right;
  padding: calc(12px + env(safe-area-inset-top)) 28px 0 0;
}
.wx-arrow { font-size: 44px; line-height: 1; margin-right: -6px; }
.wx-tip p { margin: 8px 0 0; font-size: 17px; line-height: 1.7; }
