@charset "UTF-8";

:root {
  color-scheme: dark;
  --bg: #151814;
  --text: #e2e5dc;
  --muted: #98a18f;
  --accent: #dbbd94;
  --border: #ffffff0d;
  font: 14px -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #10120f; color: var(--text); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; border: 0; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon.small { width: 17px; height: 17px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 9px; background: transparent; color: #b4beaa; }
.icon-button:hover { background: #ffffff07; color: var(--accent); }
.app-shell { height: 100vh; height: 100dvh; max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; overflow: hidden; padding-top: env(safe-area-inset-top); background: var(--bg); border-inline: 1px solid var(--border); }
.topbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 8px; padding: 14px 12px 13px 21px; border-bottom: 1px solid var(--border); }
.book-heading { flex: 1; min-width: 0; }
.book-heading h1 { margin: 0 0 5px; font-size: 17px; font-weight: 500; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chapter-label { display: block; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; align-items: center; flex-shrink: 0; gap: 2px; }
.header-button { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 4px; border-radius: 7px; background: transparent; color: #b4beaa; }
.header-button:hover { background: #ffffff07; color: var(--accent); }
.header-button > .icon { width: 22px; height: 22px; }
.chapter-entry { position: relative; }
.font-menu { position: relative; }
.size-icon { display: block; height: 22px; font-size: 19px; line-height: 22px; }
.font-popup { position: absolute; z-index: 8; top: calc(100% + 8px); right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 170px; padding: 8px; border: 1px solid #ffffff1a; border-radius: 9px; background: #242b20; box-shadow: 0 8px 28px #0007; }
.font-popup .text-button { min-width: 44px; font-size: 18px; }
#font-size-label { min-width: 30px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
select option { background: #252b20; color: var(--text); }
.count { position: absolute; right: 2px; top: 0; min-width: 15px; padding: 1px 3px; border-radius: 8px; background: #404b34; color: var(--accent); font-size: 9px; }
.listening-view { position: relative; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.toc-part { display: block; width: 100%; padding: 10px 15px 10px 28px; min-height: 44px; background: transparent; color: var(--accent); text-align: left; font-size: 11px; }
.toc-part:hover { background: #ffffff05; }
.follow-button { position: absolute; right: 19px; bottom: 12px; display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 12px; border: 1px solid #dbbd9430; border-radius: 7px; background: #242b20f5; color: var(--accent); font-size: 11px; box-shadow: 0 3px 15px #0005; }
.transcript { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 11px 45px; font-size: var(--reader-size, 20px); scrollbar-width: thin; scrollbar-color: #56644755 transparent; }
.reading-paragraph { margin: 0 0 14px; padding: 0 10px; color: #b7beaf; font-family: "Songti SC", "STSong", "Noto Serif CJK SC", SimSun, serif; font-size: inherit; line-height: 1.6; letter-spacing: .2px; overflow-wrap: anywhere; }
.sentence { display: inline; margin: 0; padding: 0; border: 0; border-radius: 2px; background: transparent; color: inherit; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sentence:hover { background: #ffffff03; }
.sentence.active { background: #dbbd941c; color: #f2d5ad; }
.sentence.selected { background: #ffffff09; outline: 1px solid #dbbd9445; }
.reader-notice { padding: 25px 12px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.player { flex-shrink: 0; padding: 7px 22px calc(13px + env(safe-area-inset-bottom)); background: #1b2018; border-top: 1px solid var(--border); }
.seek-row { display: flex; align-items: center; gap: 10px; height: 30px; }
.seek-row time { min-width: 33px; font-size: 10px; font-variant-numeric: tabular-nums; color: #9ba88e; }
.seek-row time:last-child { text-align: right; }
input[type="range"] { appearance: none; -webkit-appearance: none; min-width: 0; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, #cfb18a var(--progress, 0%), #ffffff15 var(--progress, 0%)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, #cfb18a var(--progress, 0%), #ffffff15 var(--progress, 0%)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: var(--accent); border: 0; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 0; }
.transport-buttons { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 390px; margin: 3px auto 0; }
.text-controls { display: flex; align-items: center; justify-content: space-between; max-width: 390px; margin: 0 auto; }
.text-controls .text-button { min-width: 64px; }
.transport-buttons .icon-button { width: 48px; height: 48px; }
.transport-buttons .icon-button .icon { width: 25px; height: 25px; }
.speed-label { width: 49px; display: flex; justify-content: center; }
#speed { min-height: 44px; max-width: 58px; padding: 0; border: 0; background: transparent; color: #bac5af; font-size: 12px; }
.play-button { display: grid; place-items: center; flex-shrink: 0; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #222b1d; }
.play-button:hover { background: #ecd1ad; }
.play-button .icon { width: 25px; height: 25px; stroke-width: 2.3; }
.play-button [href="#i-play"] { fill: currentColor; stroke: none; }
.status-banner { display: flex; align-items: center; gap: 10px; flex-shrink: 0; max-height: 130px; overflow-y: auto; padding: 10px 16px; color: #e0c39a; background: #6a472528; font-size: 11px; line-height: 1.6; border-bottom: 1px solid #dabb9220; }
.status-banner > span { flex: 1; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 5px; background: transparent; color: var(--accent); font-size: 11px; white-space: nowrap; }
dialog { color: var(--text); background: #1c2219; border: 1px solid #ffffff15; padding: 0; border-radius: 12px; box-shadow: 0 20px 80px #0008; max-height: 85vh; max-height: 85dvh; }
dialog::backdrop { background: #080c0bce; }
.drawer { width: min(560px, calc(100% - 24px)); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 15px 13px 5px 21px; gap: 15px; }
.dialog-heading h2 { font-size: 19px; font-weight: 500; margin: 0; }
.dialog-heading h2 > span { margin-left: 5px; color: var(--muted); font-size: 12px; }
.navigation-tabs { display: flex; gap: 12px; margin: 0 20px 14px; border-bottom: 1px solid var(--border); }
.navigation-tabs > button { flex: 1; min-height: 44px; padding: 8px; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; }
.navigation-tabs > button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--accent); }
#dialog-bookmark-count { margin-left: 4px; font-size: 10px; }
.dialog-description { margin: 4px 21px 17px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.bookmarks-list { padding: 0 13px 15px; }
.bookmark-item { margin-top: 10px; padding: 15px; border: 1px solid var(--border); border-radius: 7px; }
.bookmark-locator { display: flex; justify-content: space-between; gap: 10px; color: #a4af99; font-size: 10px; }
.bookmark-quote { font-family: "Songti SC", SimSun, serif; color: #e3d3b9; font-size: 18px; line-height: 1.8; margin: 13px 0; user-select: text; }
.bookmark-note { width: 100%; min-height: 42px; max-height: 150px; padding: 9px; border: 1px solid #ffffff13; border-radius: 5px; background: #12180e66; color: #c1c9b8; font-size: 16px; resize: vertical; }
.bookmark-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.bookmark-actions .delete-bookmark { margin-left: auto; color: #b2a08c; }
.bookmarks-empty { text-align: center; padding: 25px 20px 35px; color: var(--muted); }
.bookmarks-empty > .icon { color: #bda27b77; width: 30px; height: 30px; }
.bookmarks-empty h3 { font-size: 15px; font-weight: 400; }
.bookmarks-empty p { font-size: 11px; line-height: 1.8; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 20px; border-top: 1px solid var(--border); font-size: 9px; color: var(--muted); }
.book-list { padding: 0 13px 18px; }
.library-book { display: flex; align-items: center; gap: 15px; width: 100%; min-height: 68px; padding: 12px; border-radius: 6px; text-align: left; background: transparent; }
.library-book > div { min-width: 0; }
.library-book strong { overflow-wrap: anywhere; }
.toc-list { padding: 0 12px 18px; max-height: 65vh; max-height: 65dvh; overflow-y: auto; }
.toc-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 49px; padding: 12px 12px 12px calc(12px + var(--depth, 0) * 14px); border-bottom: 1px solid var(--border); text-align: left; background: transparent; }
.toc-title { flex: 1; font-size: 13px; line-height: 1.6; }
.toc-status { flex-shrink: 0; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.toc-row:disabled { opacity: 1; color: #89917e; cursor: default; }
.toc-row:disabled .toc-status { color: #727d67; }
.toc-row.current { color: var(--accent); background: #dbbd940d; }
.toc-row:not(:disabled):hover { background: #ffffff06; }
.empty-state .primary-button { max-width: 240px; margin: 25px auto 0; justify-content: center; }
.library-book.active, .library-book:hover { background: #ffffff05; }
.library-book .icon { color: var(--accent); }
.library-book strong { font-size: 14px; font-weight: 400; }
.library-book small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.toast { position: fixed; z-index: 20; bottom: calc(128px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 11px 18px; border: 1px solid #dabb922d; border-radius: 8px; background: #303928f5; color: #ead3b2; box-shadow: 0 5px 30px #0005; font-size: 12px; text-align: center; line-height: 1.6; }
.empty-state { flex: 1; padding: 45px 24px; text-align: center; }
.empty-state h2 { font-size: 19px; font-weight: 400; }
.empty-state p { color: var(--muted); font-size: 12px; line-height: 1.9; }
.empty-state code { display: block; margin-top: 24px; font-size: 11px; color: var(--accent); overflow-wrap: anywhere; }
.login-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: min(350px, 100%); }
.login-card h1 { font-size: 23px; font-weight: 500; }
.muted { color: var(--muted); font-size: 12px; }
.login-card label { display: block; margin: 25px 0 9px; font-size: 12px; color: var(--muted); }
.login-card input { width: 100%; padding: 12px; border: 1px solid #ffffff22; border-radius: 6px; background: #11170e; color: var(--text); font-size: 16px; }
.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 6px; background: var(--accent); color: #25301d; }
.error-text { min-height: 16px; color: #e0ae89; font-size: 12px; }
.noscript { padding: 25px; color: var(--accent); }
.clipboard-helper { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 360px) {
  .topbar { padding-left: 16px; }
  .transcript { padding-inline: 6px; }
  .player { padding-inline: 15px; }
  .transport-buttons { gap: 6px; }
  .transcript { font-size: var(--reader-size, 19px); }
}
@media (min-width: 701px) {
  .topbar { padding: 20px 23px 18px 30px; }
  .book-heading h1 { font-size: 20px; }
  .transcript { padding-inline: 20px; }
  .transcript { font-size: var(--reader-size, 22px); }
  .reading-paragraph { padding-inline: 12px; }
  .player { padding-inline: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
