/* Shared typography for the library, book reader and travel journal. */
:root {
  --type-ui: Arial, Helvetica, sans-serif;
  --type-reading: Georgia, 'Times New Roman', serif;
  --reading-paper: #fbfcfa;
  --reading-ink: #183227;
  --reading-muted: #53685d;
  --reading-border: #d7e2d9;
  --reading-brand: #103b2b;
  --reading-tint: #eaf2e5;
  --reading-lime: #d5f2bd;
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--type-ui); }
button, input, select { font: inherit; }
h1, h2, h3 { text-wrap: balance; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, summary):focus-visible { outline: 3px solid #4aa67b; outline-offset: 4px; }
.library-page { background: var(--reading-paper); color: var(--reading-ink); --muted: var(--reading-muted); color-scheme: light; }
.library-header {
  background: var(--reading-brand); color: #fff; border: 0; min-height: 96px;
  max-width: none; width: 100%; padding: 18px max(32px, calc((100% - 1240px)/2));
}
.author-brand { font: 700 17px/1.1 var(--type-ui); letter-spacing: 0; gap: 12px; }
.author-brand img { width: 42px; height: 34px; object-fit: contain; }
.author-brand small { font: 400 9px/1.4 var(--type-ui); letter-spacing: .3em; margin-top: 9px; }
.library-header nav { gap: 26px; font-size: 15px; }
.library-header nav a { color: #e2eedf; }
.library-header nav [aria-current] { color: #fff; border-color: var(--reading-lime); }
.library-wrap { width: min(1240px, calc(100% - 64px)); max-width: none; }
.library-hero { grid-template-columns: 1.2fr 1fr; gap: 48px; padding: 60px 0; }
.library-hero .eyebrow, .eyebrow { font: 700 13px/1.5 var(--type-ui); letter-spacing: .1em; }
.library-hero .eyebrow { color: #376649; }
.library-hero h1 { font: 800 clamp(38px, 4.5vw, 62px)/1.12 var(--type-ui); letter-spacing: -.035em; }
.library-intro { font-size: 21px; line-height: 1.65; color: var(--reading-muted); }
.author-photo { border-radius: 12px; min-height: 300px; }
.author-photo figcaption { font-size: 13px; line-height: 1.5; color: white; }
.library-section-heading h2 { font: 700 34px/1.2 var(--type-ui); letter-spacing: -.025em; }
.library-search { background: #fff; border-color: #bdcfc0; border-radius: 6px; min-height: 50px; color: var(--reading-ink); }
.library-search input { color: var(--reading-ink); }
.library-search input::placeholder { color: var(--reading-muted); }
.library-tabs { gap: 8px; }
.library-tabs button { color: var(--reading-muted); border-radius: 6px; padding: 12px 16px; min-height: 46px; font-size: 15px; }
.library-tabs button[aria-pressed=true] { background: var(--reading-brand); color: #fff; }
.language-label { color: var(--reading-muted); font-size: 14px; }
.language-label select { color: var(--reading-ink); background-color: #fff; border-color: #bdcfc0; min-height: 46px; border-radius: 6px; }
#book-count { font-size: 14px; margin-top: 22px; }
.book-grid { gap: 26px; margin-top: 24px; }
.book-card { background: #fff; border: 1px solid var(--reading-border); border-radius: 11px; overflow: hidden; }
.book-cover { height: 340px; border-radius: 0; background: #dfe8de; }
.book-cover > img { filter: none; }
.cover-jacket { padding: 70px 24px 26px; }
.cover-jacket small { font: 700 11px/1.6 var(--type-ui); letter-spacing: .08em; }
.cover-jacket strong { font: 700 30px/1.16 var(--type-ui); letter-spacing: -.025em; }
.book-language { font-size: 12px; color: #fff; background: #103b2be8; }
.book-info { padding: 25px; }
.book-author, .book-meta { font-size: 14px; line-height: 1.6; color: var(--reading-muted); }
.book-card h3 { font: 700 28px/1.2 var(--type-ui); letter-spacing: -.025em; }
.book-description { font-size: 16px; line-height: 1.65; color: var(--reading-muted); }
.library-read, .continue-reading > a { background: var(--reading-brand); color: #fff; border-radius: 6px; padding: 13px 22px; min-height: 48px; font-size: 15px; }
.continue-reading { background: var(--reading-tint); border: 1px solid var(--reading-border); border-radius: 12px; }
.continue-reading .eyebrow { color: #376649; font-size: 12px; }
.continue-reading h2 { font: 700 26px/1.2 var(--type-ui); letter-spacing: -.025em; }
.continue-reading p:last-child { color: var(--reading-muted); font-size: 14px; }
.book-progress { background: var(--reading-border); }
.book-progress span { background: #2c7756; }
.book-progress-label { color: #376649; font-size: 13px; }
.empty-state { border-color: #a7bcad; }
.empty-state h3 { font: 700 26px/1.25 var(--type-ui); }
.empty-state button { background: var(--reading-brand); color: #fff; border-radius: 6px; }
.reading-note { border-color: var(--reading-border); color: var(--reading-muted); }
.reading-note h2 { font: 700 26px/1.25 var(--type-ui); color: var(--reading-ink); }
.reading-note p { font-size: 16px; line-height: 1.75; }
.reading-note > svg { color: #376649; }
.library-footer { color: var(--reading-muted); border-color: var(--reading-border); width: min(1240px, calc(100% - 64px)); font-size: 14px; }
.reader-page {
  --paper: var(--reading-paper); --ink: var(--reading-ink); --muted: var(--reading-muted);
  --surface: #f0f5ed; --border: var(--reading-border); --accent: var(--reading-brand);
  --highlight: #dcefd2; --reading-size: 21px; --reading-line: 1.8; --reading-width: 720px;
  color-scheme: light;
}
.reader-header { gap: 20px; }
.reader-library { font-size: 15px; }
.reader-library svg { color: var(--accent); }
.reader-book-title strong { font: 700 15px/1.4 var(--type-ui); }
.reader-book-title > span { font-size: 13px; line-height: 1.5; }
.reader-tools button { min-width: 44px; min-height: 44px; }
.reader-main { padding-top: 126px; }
.chapter-heading h1 { font: 800 clamp(32px, 3.3vw, 46px)/1.16 var(--type-ui); letter-spacing: -.025em; overflow-wrap: break-word; }
.chapter-heading .muted { font-size: 14px; line-height: 1.6; }
.chapter-content, .reading { font-family: var(--type-reading); font-size: 21px; line-height: 1.8; letter-spacing: 0; overflow-wrap: break-word; word-break: normal; }
.chapter-content { font-size: var(--reading-size); line-height: var(--reading-line); }
.reader-page[data-font=sans] .chapter-content { font-family: var(--type-ui); }
.chapter-content:lang(zh) { font-family: 'Songti SC', 'Noto Serif CJK SC', SimSun, serif; line-break: strict; hyphens: none; }
.reader-page[data-font=sans] .chapter-content:lang(zh) { font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; }
.chapter-content p, .reading p { margin: 0 0 1.2em; text-align: start; }
.chapter-content p:empty { display: none; }
.chapter-content h2, .chapter-content h3, .chapter-content h4 { font-family: var(--type-ui); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; margin: 1.8em 0 .85em; }
.chapter-content h2 { font-size: 1.4em; }
.chapter-content h3 { font-size: 1.2em; }
.chapter-content h4 { font-size: 1.1em; }
.chapter-content blockquote { border-left: 3px solid var(--accent); padding: 1em 1.2em; margin: 1.5em 0; background: var(--surface); font-style: normal; }
.chapter-content figcaption { font: 14px/1.65 var(--type-ui); }
.chapter-content img { border-radius: 8px; }
.chapter-contents { font: 15px/1.6 var(--type-ui); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; margin: 1.5em 0 2em; padding: 16px 20px; }
.chapter-contents summary { font-weight: 700; cursor: pointer; padding: 4px 0; min-height: 32px; }
.chapter-contents ol { padding-left: 1.4em; margin: 18px 0 4px; }
.chapter-contents li { margin-bottom: 10px; }
.chapter-end { font-size: 15px; }
.chapter-end > a { font-size: 14px; }
.reader-primary { border-radius: 6px; min-height: 48px; font-size: 15px; }
.reading-navigation button { font-size: 14px; min-height: 44px; }
.progress-row output { font-size: 13px; }
.toc-list button, .toc-subsections button { font-size: 15px; line-height: 1.55; }
.toc-list button small, .toc-section { font-size: 12px; }
.search-result strong, .bookmark-jump strong { font-size: 15px; }
.search-result span, .bookmark-jump span { font: 16px/1.65 var(--type-reading); }
.settings-note, .search-summary, .panel-search label { font-size: 14px; line-height: 1.6; }
.setting-options button { min-height: 48px; }
.reading-layout { grid-template-columns: minmax(180px, 240px) minmax(0, 720px); gap: 56px; }
.reading h2 { font-family: var(--type-ui); font-size: 30px; line-height: 1.25; }
.reading p { line-height: 1.8; }
.reading .source { font-size: 15px; }
@media (max-width: 1000px) {
  .reading-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 32px; }
  .library-hero { gap: 32px; }
}
@media (max-width: 760px) {
  .library-header { display: block; padding: 22px 18px; }
  .library-header nav { margin-top: 23px; gap: 22px; font-size: 14px; flex-wrap: wrap; }
  .library-header nav a { padding: 5px 0; }
  .library-header nav a:last-child { display: block; }
  .library-wrap, .library-footer { width: calc(100% - 36px); }
  .library-hero { display: block; padding: 35px 0 40px; }
  .library-hero h1 { font-size: clamp(38px, 7vw, 50px); }
  .library-hero .eyebrow { font-size: 12px; }
  .library-intro { font-size: 20px; }
  .author-photo { margin-top: 28px; min-height: 0; height: 230px; border-radius: 12px; }
  .library-section-heading h2 { font-size: 30px; }
  .library-tabs { flex-wrap: wrap; white-space: normal; overflow: visible; gap: 4px; }
  .library-tabs button { font-size: 14px; padding: 10px 12px; }
  .book-grid { grid-template-columns: 1fr; gap: 24px; }
  .book-card { display: flex; padding: 0; gap: 0; }
  .book-cover { width: 100%; height: 290px; align-self: stretch; border-radius: 0; }
  .book-cover > img { height: 100%; width: 100%; }
  .cover-jacket { padding: 65px 24px 24px; }
  .cover-jacket small { font-size: 11px; }
  .cover-jacket strong { font-size: 29px; line-height: 1.16; }
  .book-language { font-size: 12px; top: 14px; right: 14px; padding: 4px 10px; }
  .book-info { padding: 24px; }
  .book-author, .book-meta { font-size: 14px; }
  .book-card h3 { font-size: 28px; line-height: 1.2; }
  .book-description { font-size: 16px; line-height: 1.65; -webkit-line-clamp: 4; }
  .library-read { font-size: 15px; padding: 13px 22px; }
  .continue-reading h2 { font-size: 24px; }
  .continue-reading .eyebrow { font-size: 12px; }
  .reading-note h2 { font-size: 25px; }
  .reading-note p { font-size: 16px; }
  .library-footer { font-size: 14px; }
  .reading-layout { display: block; }
  .reading { font-size: 20px; }
  .reading h2 { font-size: 28px; }
}
@media (max-width: 600px) {
  .reader-header { height: 72px; padding: 0 14px; gap: 8px; }
  .reader-book-title { max-width: none; min-width: 0; padding: 4px; }
  .reader-book-title strong { font-size: 13px; line-height: 1.4; }
  .reader-book-title > span { font-size: 11px; line-height: 1.4; }
  .reader-tools { gap: 2px; }
  .reader-tools button { min-width: 36px; min-height: 44px; }
  .reader-main { padding: 108px 22px 175px; }
  .chapter-heading h1 { font-size: clamp(30px, 7vw, 36px); line-height: 1.2; }
  .chapter-heading .eyebrow { font-size: 12px; }
  .chapter-heading .muted { font-size: 13px; }
  .chapter-content { font-size: var(--reading-size); }
  .chapter-content blockquote { padding: .8em 1em; }
  .reading-navigation button { font-size: 12px; min-height: 44px; }
  .reading-navigation button:first-child span, .reading-navigation button:last-child span { max-width: 86px; line-height: 1.4; }
  #reader-panel { top: 72px; height: calc(100dvh - 72px); }
}
@media print {
  .library-header, .library-footer, .reader-header, .reader-bottom, #reader-panel { display: none; }
  .reader-main { max-width: none; padding: 0; }
  .chapter-content { font-size: 12pt; line-height: 1.55; }
}
