/* ==========================================================================
   UAA 1:1 AUTHENTIC READER STYLES: IMMERSIVE TYPOGRAPHY, PROGRESS, CHROME
   ========================================================================== */

:root {
  --rcrimson: #FF3B5C;
  --rgold: #E6B873;
  --rchrome-bg: rgba(20, 20, 24, 0.88);
  --rchrome-ink: #F2F0F2;
  --rchrome-ink-2: #C7C4CE;
  --rchrome-mut: #9A98A2;
  --rchrome-line: rgba(255, 255, 255, 0.10);
  --rchrome-fill: rgba(255, 255, 255, 0.08);
  --rchrome-fill-2: rgba(255, 255, 255, 0.14);
}

/* 1:1 Progress Bar */
.reader-progress {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 3px;
  z-index: 70;
  background: rgba(128, 128, 128, 0.22);
  pointer-events: none;
}

.reader-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--rgold), var(--rcrimson));
  box-shadow: 0 0 10px rgba(255, 59, 92, 0.8), 0 0 3px rgba(255, 59, 92, 0.9);
  transition: width 0.08s ease-out;
}

/* Full Bleed Reader Surface */
#readerView {
  width: 100%;
  min-height: 100vh;
  background-color: var(--reader-bg);
  color: var(--reader-text);
  position: relative;
}

/* Header */
.reader-top {
  position: fixed;
  /* 整体放在状态栏下方，与系统时钟保持紧凑间距 */
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 50;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  background: var(--rchrome-bg);
  backdrop-filter: saturate(150%) blur(18px);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  border-bottom: 1px solid var(--rchrome-line);
  box-shadow: 0 1px 0 rgba(255, 59, 92, 0.1), 0 10px 30px -22px rgba(0, 0, 0, 0.9);
}

.reader-top__left {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-start;
  min-width: 0;
}

.reader-top__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.reader-top__title {
  flex-shrink: 0;
  max-width: min(52vw, 680px);
  font-family: "Songti SC", "SimSun", "Source Han Serif SC", "Noto Serif SC", serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--rchrome-ink-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.reader-top__title:hover {
  background: var(--rchrome-fill);
}

.reader-top__title .top-book {
  color: var(--rchrome-ink);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-top__title .top-chapter {
  color: var(--rgold);
  font-weight: 600;
  flex-shrink: 0;
}

.reader-top__title .top-prog-pct {
  font-size: 11px;
  color: var(--rchrome-mut);
  font-family: monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.reader-ic {
  height: 38px;
  padding: 0 12px;
  flex-shrink: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--rchrome-ink-2);
  background: transparent;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.reader-ic:hover {
  background: var(--rchrome-fill);
  border-color: var(--rchrome-line);
  color: var(--rcrimson);
}

.reader-ic.aa {
  font-family: serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--rgold);
}
.reader-ic.aa:hover {
  color: var(--rcrimson);
}

/* Content Area */
.reader-scroll {
  width: 100%;
  min-height: 100vh;
}

.reader-content {
  max-width: var(--reader-width, 68em);
  margin: 0 auto;
  padding: calc(84px + env(safe-area-inset-top, 0px)) 24px calc(120px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 768px) {
  .reader-content {
    padding: 72px 16px 100px;
  }
}

.reader-chapseg {
  position: relative;
}

.reader-chap {
  font-family: var(--rfont, "Songti SC", "SimSun", "Source Han Serif SC", "Noto Serif SC", serif);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--reader-text);
  margin: 20px 0 10px 0;
  overflow-wrap: anywhere;
}

.reader-meta {
  margin: 10px 0 28px;
  font-size: 13px;
  color: var(--reader-secondary);
  display: flex;
  gap: 10px;
  align-items: center;
}

.reader-meta::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--rcrimson), var(--rgold));
}

.reader-body {
  font-family: var(--rfont, "Songti SC", "SimSun", "Source Han Serif SC", "Noto Serif SC", serif);
  font-size: var(--rsize, 19px);
  line-height: var(--rlh, 1.9);
  letter-spacing: var(--rls, 0.02em);
  color: var(--reader-text);
}

.reader-body p {
  text-indent: 2em;
  margin: 0 0 1.15em;
  text-align: justify;
  word-break: break-word;
  overflow-wrap: break-word;
}

.chapter-break-divider {
  margin: 60px 0 40px 0;
  padding: 24px 0;
  border-top: 1px dashed var(--border-medium);
  border-bottom: 1px dashed var(--border-medium);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.chapter-break-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-gold);
}
.chapter-break-sub {
  font-size: 12px;
  color: var(--reader-secondary);
}

/* Fonts */
.font-serif-sc {
  font-family: "Songti SC", "SimSun", "Source Han Serif SC", "Noto Serif SC", "STSong", serif;
}
.font-sans-sc {
  font-family: -apple-system, "system-ui", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}
.font-kaiti-sc {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
}
.font-mono-sc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.reader-floating-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fab-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.fab-btn:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  background-color: var(--bg-surface-elevated);
  color: var(--accent-gold);
}

/* ==========================================================================
   AI 听书：播放条 / 当前句高亮 / 音色选择面板
   ========================================================================== */

/* 当前朗读句 */
