/* ============================================================
   睡愈力 · 内容详情页公共样式
   双主题：.theme-paper（文章·暖白纸感）/ .theme-night（视频音频·月夜沉浸）
   所有组件类引用主题变量，切换主题只需换 body 上的类名。
   设计 token 取自主站既有色系，不发明新颜色。
   ============================================================ */

/* ── 共享字体（两套主题一致）── */
.detail-root,
.detail-root * { font-family: var(--d-font-body); }
.detail-root .d-serif,
.detail-root h1,
.detail-root h2 { font-family: var(--d-font-display); }

/* ============================================================
   主题变量
   ============================================================ */
.theme-paper {
  --d-bg:        #f7f5f0;   /* 纸 */
  --d-surface:   #efe9dd;   /* 暖纸（卡片底）*/
  --d-text:      #1a1a18;   /* 墨 */
  --d-muted:     #8a8780;
  --d-faint:     #c4c0b8;
  --d-border:    #e0dbd2;
  --d-gold:      #b8935a;
  --d-gold-dark: #8b6d3f;
  --d-gold-pale: #e8d5b0;
  --d-glow:      rgba(184,147,90,0.18);
  --d-topbar-bg: rgba(247,245,240,0.85);
  --d-sel:       rgba(184,147,90,0.22);
  --d-on-gold:   #ffffff;   /* 金按钮上的字色 */
  --d-shadow:    0 1px 0 rgba(0,0,0,0.04);
  --d-font-display: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", serif;
  --d-font-body: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, sans-serif;
}

.theme-night {
  --d-bg:        #0b0d13;   /* 月夜（沿用主站）*/
  --d-surface:   #181b23;
  --d-text:      #e6e3db;
  --d-muted:     #96938b;
  --d-faint:     #5c5a53;
  --d-border:    #252830;
  --d-gold:      #c4a265;
  --d-gold-dark: #8a7040;
  --d-gold-pale: #e8d5b0;
  --d-glow:      rgba(196,162,101,0.18);
  --d-topbar-bg: rgba(11,13,19,0.85);
  --d-sel:       rgba(196,162,101,0.30);
  --d-on-gold:   #1a1814;   /* 深色主题金按钮用深字，对比更强 */
  --d-shadow:    0 1px 0 rgba(255,255,255,0.04);
  --d-font-display: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", "KaiTi", serif;
  --d-font-body: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, sans-serif;
}

/* ============================================================
   基础 reset（详情页作用域，避免污染主站）
   ============================================================ */
.detail-root { box-sizing: border-box; margin: 0; padding: 0; }
.detail-root *, .detail-root *::before, .detail-root *::after { box-sizing: border-box; }
body.detail-root {
  background: var(--d-bg);
  color: var(--d-text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
/* 深色沉浸：极淡径向金晕 + 冷晕，打破平铺纯色的简陋感 */
body.detail-root.theme-night {
  background:
    radial-gradient(1100px 620px at 50% -10%, rgba(196,162,101,0.11), transparent 68%),
    radial-gradient(820px 480px at 88% 115%, rgba(90,106,122,0.07), transparent 70%),
    var(--d-bg);
  background-attachment: fixed;
}
.detail-root ::selection { background: var(--d-sel); color: var(--d-text); }
.detail-root a { color: inherit; text-decoration: none; }
.detail-root button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.detail-root img { max-width: 100%; display: block; }

/* ============================================================
   顶栏：返回 + 阅读进度条
   ============================================================ */
.d-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 56px; display: flex; align-items: center; padding: 0 16px;
  background: var(--d-topbar-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--d-border);
}
.d-topbar__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--d-muted); transition: color 0.2s;
}
.d-topbar__back:hover { color: var(--d-gold); }
.d-topbar__brand {
  margin-left: auto; font-family: var(--d-font-display);
  font-size: 14px; letter-spacing: 0.18em; color: var(--d-gold); opacity: 0.7;
}
.d-topbar__progress {
  position: absolute; bottom: 0; left: 0; height: 2px; width: 0;
  background: var(--d-gold); transition: width 0.15s linear;
}

/* ============================================================
   主容器
   ============================================================ */
.d-wrap { max-width: 720px; margin: 0 auto; padding: 88px 24px 64px; position: relative; z-index: 1; }
.d-wrap--wide { max-width: 960px; }   /* 视频页 */
.d-wrap--narrow { max-width: 560px; } /* 音频页 */

/* ============================================================
   头部：类型标签 / 标题 / meta
   ============================================================ */
.d-head { margin-bottom: 36px; }
.d-head__type {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.15em; color: var(--d-gold-dark); text-transform: uppercase;
  margin-bottom: 16px; padding: 3px 10px; border-radius: 3px;
  background: var(--d-glow); border: 1px solid var(--d-border);
}
.d-head__title {
  font-size: clamp(24px, 4.5vw, 38px); font-weight: 700;
  line-height: 1.3; letter-spacing: 0.01em; margin-bottom: 18px;
  text-wrap: pretty;
}
.d-head__meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--d-muted);
}
.d-head__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--d-faint); }
.d-head__pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 9999px;
  background: var(--d-glow); color: var(--d-gold-dark); font-size: 12px;
}

/* ============================================================
   封面
   ============================================================ */
.d-cover {
  margin-bottom: 36px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--d-border); box-shadow: var(--d-shadow);
}
.d-cover img { width: 100%; }

/* ============================================================
   文章正文
   ============================================================ */
.d-body { font-size: 17px; line-height: 2; }
.d-body h2 { font-size: 22px; font-weight: 700; margin: 48px 0 16px; }
.d-body h3 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; }
.d-body p { margin-bottom: 20px; }
.d-body blockquote {
  margin: 28px 0; padding: 16px 20px;
  border-left: 3px solid var(--d-gold);
  background: var(--d-glow); border-radius: 0 6px 6px 0;
  font-style: italic; color: var(--d-muted);
}
.d-body ul, .d-body ol { margin: 16px 0 20px 22px; }
.d-body li { margin-bottom: 8px; }
.d-body strong { color: var(--d-text); font-weight: 700; }
.d-body img { border-radius: 6px; margin: 24px 0; }

/* ============================================================
   视频/音频简介
   ============================================================ */
.d-desc {
  font-size: 15px; line-height: 1.9; color: var(--d-muted);
  padding: 20px; border-radius: 8px; background: var(--d-surface);
  border: 1px solid var(--d-border); margin-bottom: 36px;
}

/* ============================================================
   视频播放器
   ============================================================ */
.d-video {
  width: 100%; aspect-ratio: 16/9; background: #000;
  border-radius: 10px; overflow: hidden; margin-bottom: 36px;
  border: 1px solid var(--d-border);
  box-shadow: 0 0 0 1px rgba(196,162,101,0.06), 0 22px 60px rgba(0,0,0,0.55), 0 0 90px rgba(196,162,101,0.07);
}
.d-video video { width: 100%; height: 100%; object-fit: contain; display: block; }
.d-video__ph {
  aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
  color: var(--d-muted); font-size: 15px; letter-spacing: 0.04em;
}

/* ============================================================
   音频播放器卡片
   ============================================================ */
.d-player {
  width: 100%; text-align: center; padding: 44px 32px 36px;
  border-radius: 16px; background: var(--d-surface);
  border: 1px solid var(--d-border); margin-bottom: 32px;
  box-shadow: 0 0 0 1px rgba(196,162,101,0.05), 0 16px 48px rgba(0,0,0,0.4);
}
.d-player__art {
  width: 200px; height: 200px; border-radius: 50%; overflow: hidden;
  margin: 0 auto 28px; border: 3px solid var(--d-glow);
  box-shadow: 0 0 60px var(--d-glow); transition: box-shadow 0.4s;
}
.d-player__art.is-playing { box-shadow: 0 0 80px var(--d-glow); }
.d-player__art img { width: 100%; height: 100%; object-fit: cover; }
.d-player__art-ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--d-font-display); font-size: 64px; color: var(--d-gold);
}
.d-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.d-progress__time {
  font-size: 11px; color: var(--d-muted); min-width: 38px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.d-progress__track { flex: 1; height: 4px; border-radius: 2px; background: var(--d-border); cursor: pointer; position: relative; }
.d-progress__bar { position: absolute; left: 0; top: 0; height: 100%; border-radius: 2px; background: var(--d-gold); width: 0; transition: width 0.1s linear; }
.d-progress__thumb { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--d-gold); transform: translate(-50%, -50%); box-shadow: 0 0 8px var(--d-glow); }
.d-ctrls { display: flex; align-items: center; justify-content: center; gap: 24px; }
.d-ctrl {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--d-border);
  background: transparent; display: flex; align-items: center; justify-content: center;
  color: var(--d-muted); transition: all 0.2s;
}
.d-ctrl:hover { color: var(--d-text); border-color: var(--d-gold); }
.d-ctrl--play {
  width: 56px; height: 56px; background: var(--d-gold); color: var(--d-on-gold);
  border: none; font-size: 20px; box-shadow: 0 4px 16px var(--d-glow);
}
.d-ctrl--play:hover { background: var(--d-gold-dark); color: var(--d-on-gold); }

/* ============================================================
   付费锁 / 加载 / 空态
   ============================================================ */
.d-locked { text-align: center; padding: 72px 24px; }
.d-locked__icon { font-size: 48px; margin-bottom: 14px; opacity: 0.45; }
.d-locked__title { font-size: 24px; margin-bottom: 8px; }
.d-locked__desc { color: var(--d-muted); margin-bottom: 26px; font-size: 15px; }

.d-loading { text-align: center; padding: 120px 0; color: var(--d-muted); font-size: 14px; }

/* ============================================================
   按钮
   ============================================================ */
.btn-gold {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 6px;
  background: var(--d-gold); color: var(--d-on-gold); font-weight: 600;
  font-size: 15px; transition: background 0.2s, transform 0.2s;
}
.btn-gold:hover { background: var(--d-gold-dark); transform: translateY(-1px); }

/* ============================================================
   页脚
   ============================================================ */
.d-foot {
  text-align: center; padding: 40px 0; border-top: 1px solid var(--d-border);
  margin-top: 48px;
}
.d-foot__copy { font-size: 12px; color: var(--d-faint); letter-spacing: 0.05em; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 640px) {
  .d-wrap { padding: 76px 16px 48px; }
  .d-body { font-size: 16px; line-height: 1.9; }
  .d-head__title { font-size: 22px; }
  .d-player { padding: 32px 20px 28px; }
  .d-player__art { width: 160px; height: 160px; }
  .d-ctrl--play { width: 48px; height: 48px; }
  .d-ctrl { width: 36px; height: 36px; }
}
