/* ---------- 阅读控制坞 ---------- */
.reader-dock {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 70;
  animation: dock-in .5s cubic-bezier(.2, 1.1, .3, 1) both;
}
.dock-inner {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 20px;
  background: var(--surface); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line); box-shadow: var(--shadow); white-space: nowrap;
}
.dock-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 10px;
  font-family: var(--sans); font-size: 12px; color: var(--ink-soft);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.dock-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); transform: translateY(-2px); }
.dock-btn:disabled { opacity: .32; pointer-events: none; }
.dock-sep { width: 1px; height: 24px; background: var(--line); }
.dock-play {
  width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--surface-solid); box-shadow: 0 6px 16px var(--accent-soft);
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1);
}
.dock-play:hover { transform: scale(1.1); }
.dock-play svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
.dock-play .ico-play { display: none; }
.dock-play.paused .ico-play { display: block; }
.dock-play.paused .ico-pause { display: none; }
.dock-speed { width: 168px; display: flex; flex-direction: column; gap: 5px; }
.dock-speed-head { display: flex; justify-content: space-between; font-family: var(--sans); font-size: 10px; color: var(--ink-faint); }
.dock-speed-head output { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.dock-skip { color: var(--accent); }

/* ---------- 抽屉通用 ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 88; background: rgba(24, 20, 16, .32); backdrop-filter: blur(3px); animation: fade-in .25s ease both; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(400px, 100vw);
  display: flex; flex-direction: column; background: var(--surface-solid);
  border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(0,0,0,.14);
  animation: drawer-in .38s cubic-bezier(.2, .9, .25, 1) both;
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: .08em; }
.drawer-head p { margin: 5px 0 0; font-family: var(--sans); font-size: 11.5px; color: var(--ink-faint); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.setting-group { padding: 20px 0; border-bottom: 1px dashed var(--line); }
.setting-group:last-child { border-bottom: 0; }
.setting-group h3 { margin: 0 0 15px; font-family: var(--sans); font-size: 11px; letter-spacing: .2em; color: var(--accent); font-weight: 700; }
.setting-group .field { margin-bottom: 13px; }
.setting-group .field:last-child { margin-bottom: 0; }
.range-field > span { margin-bottom: 3px; }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 16px; }
.theme-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); text-align: left;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.theme-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-swatch { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; border: 2px solid rgba(255,255,255,.65); box-shadow: 0 2px 6px rgba(0,0,0,.16); }
.theme-card b { display: block; font-size: 13px; font-weight: 600; }
.theme-card small { display: block; font-family: var(--sans); font-size: 9.5px; color: var(--ink-faint); margin-top: 2px; }
.hint { font-family: var(--sans); font-size: 11px; color: var(--ink-faint); margin: -4px 0 12px; }
.cache-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--sans); font-size: 11.5px; color: var(--ink-soft); }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-top: 1px solid var(--line); }
.save-hint { font-family: var(--sans); font-size: 10.5px; color: var(--ink-faint); }

/* ---------- 章节目录侧栏 ---------- */
.chapter-panel {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 95; width: min(340px, 100vw);
  display: flex; flex-direction: column; background: var(--surface-solid);
  border-right: 1px solid var(--line); box-shadow: 20px 0 60px rgba(0,0,0,.14);
  animation: panel-in .35s cubic-bezier(.2, .9, .25, 1) both;
}
@keyframes panel-in { from { transform: translateX(-100%); } to { transform: none; } }
.chapter-panel .drawer-head { flex: 0 0 auto; }
.chapter-panel-list { flex: 1; overflow-y: auto; padding: 12px 16px 24px; }
.chapter-panel-list button {
  display: block; width: 100%; text-align: left; padding: 11px 13px; border-radius: 10px;
  font-size: 13.5px; color: var(--ink-soft); border: 1px solid transparent;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.chapter-panel-list button:hover { background: var(--surface-2); transform: translateX(4px); }
.chapter-panel-list button.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 700; }
.chapter-panel-list .panel-volume { font-family: var(--sans); font-size: 10px; letter-spacing: .2em; color: var(--ink-faint); margin: 18px 6px 8px; }

/* ---------- 分享工具 ---------- */
.share-bar {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 105;
  display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 999px;
  background: var(--surface); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: toast-in .3s ease both;
}
.share-tip { font-family: var(--sans); font-size: 11.5px; color: var(--ink-faint); padding: 0 6px; }
.selection-toolbar {
  position: fixed; z-index: 106; display: flex; gap: 4px; padding: 5px; border-radius: 11px;
  background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: fade-in .18s ease both;
}
.selection-toolbar button { padding: 7px 11px; border-radius: 7px; font-family: var(--sans); font-size: 11.5px; color: var(--ink-soft); }
.selection-toolbar button:hover { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 900px) {
  .dock-inner { gap: 6px; padding: 9px 10px; border-radius: 16px; }
  .dock-btn span, .dock-speed-head span, .dock-skip, .dock-sep { display: none; }
  .dock-speed { width: 100px; }
  .share-tip { display: none; }
}
@media (max-width: 560px) {
  .reader-dock { bottom: 10px; }
  .dock-speed { width: 76px; }
  .chapter-panel { width: 88vw; }
}
