/* Text-first novel reader for The Story Glitch */
.novel-body { --novel-bg:#f5f3ed; --novel-paper:#fbfaf6; --novel-ink:#282722; --novel-muted:#77756d; --novel-line:#dedbd1; background:var(--novel-bg); color:var(--novel-ink); min-height:100vh; transition:background .2s,color .2s; }
.novel-body[data-theme="sepia"] { --novel-bg:#eee3cf; --novel-paper:#f6ecd9; --novel-ink:#3c3023; --novel-muted:#7e6d57; --novel-line:#d6c6ac; }
.novel-body[data-theme="dark"] { --novel-bg:#171717; --novel-paper:#20201e; --novel-ink:#e9e6dd; --novel-muted:#aaa69a; --novel-line:#393832; }
.novel-header { min-height:66px; padding:0 26px; position:sticky; top:0; z-index:30; display:grid; grid-template-columns:1fr 1fr 1fr; align-items:center; gap:18px; background:color-mix(in srgb,var(--novel-bg) 94%,transparent); backdrop-filter:blur(14px); border-bottom:1px solid var(--novel-line); }
.novel-header-center { display:flex; justify-content:center; gap:10px; white-space:nowrap; color:var(--novel-muted); font-size:11px; }
.novel-header-center b { color:var(--novel-ink); }
.novel-tools { display:flex; justify-content:flex-end; align-items:center; gap:9px; }
.novel-tool { width:34px; height:34px; border:1px solid var(--novel-line); border-radius:4px; background:transparent; color:var(--novel-ink); cursor:pointer; font-weight:700; }
.novel-exit { color:var(--novel-muted); font-size:11px; }
.novel-progress { position:sticky; top:66px; z-index:29; height:2px; background:var(--novel-line); }
.novel-progress span { display:block; height:100%; width:0; background:#a8bf36; }
.novel-main { width:min(780px,calc(100% - 48px)); margin:0 auto; padding:62px 0 90px; }
.novel-kicker { font-size:9px; font-weight:800; letter-spacing:2px; color:var(--novel-muted); text-align:center; }
.novel-main h1 { margin:15px 0 8px; text-align:center; font-family:var(--serif); font-weight:500; font-size:clamp(34px,5vw,48px); letter-spacing:-1px; }
.novel-reading-note { margin:0 0 42px; text-align:center; color:var(--novel-muted); font-size:10px; }
.novel-content { background:var(--novel-paper); border:1px solid var(--novel-line); border-radius:3px; padding:clamp(24px,6vw,68px); box-shadow:0 14px 45px rgba(40,35,25,.045); font-family:Georgia,'Times New Roman',serif; font-size:19px; line-height:1.95; }
.novel-content p { margin:0 0 1.45em; white-space:normal; }
.novel-content p:last-child { margin-bottom:0; }
.novel-illustration { margin:2.2em auto; text-align:center; }
.novel-illustration img { display:block; max-width:100%; max-height:720px; width:auto; height:auto; margin:0 auto; border-radius:2px; }
.novel-illustration figcaption { margin-top:8px; color:var(--novel-muted); font:9px var(--sans); letter-spacing:1px; }
.novel-bottom-nav { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:34px; }
.novel-nav-link,.novel-nav-home { font-size:11px; font-weight:750; padding:12px 15px; border:1px solid var(--novel-line); border-radius:3px; }
.novel-nav-home { background:var(--novel-ink); color:var(--novel-bg); }
.novel-nav-link.disabled { opacity:.3; pointer-events:none; }
.novel-settings { position:fixed; right:24px; top:76px; z-index:50; width:min(340px,calc(100vw - 32px)); padding:18px; color:var(--novel-ink); background:var(--novel-paper); border:1px solid var(--novel-line); box-shadow:0 12px 35px rgba(0,0,0,.14); border-radius:6px; }
.novel-settings[hidden] { display:none; }
.setting-row { display:flex; justify-content:space-between; gap:12px; align-items:center; margin:8px 0; font:11px var(--sans); }
.setting-row button { border:1px solid var(--novel-line); color:var(--novel-ink); background:transparent; border-radius:4px; padding:8px 10px; margin-left:5px; cursor:pointer; }
.setting-row button[aria-pressed="true"] { background:var(--novel-ink); color:var(--novel-bg); }
.novel-body.novel-focus .novel-header,.novel-body.novel-focus .novel-progress,.novel-body.novel-focus .novel-reading-note,.novel-body.novel-focus .novel-bottom-nav { display:none!important; }
.novel-body.novel-focus .novel-main { width:min(900px,calc(100% - 36px)); padding-top:36px; }
.novel-body.novel-focus .novel-content { font-size:var(--novel-font-size,19px); }
@media(min-width:1100px) { .novel-content { padding-inline:76px; } }
@media(max-width:640px) { .novel-header { min-height:58px; padding:0 12px; grid-template-columns:auto 1fr auto; gap:8px; } .novel-header .wordmark { font-size:12px; } .novel-header-center { font-size:8px; gap:5px; } .novel-tools { gap:5px; } .novel-tool { width:29px;height:29px;font-size:12px; } .novel-exit { display:none; } .novel-progress { top:58px; } .novel-main { width:100%; padding:38px 0 56px; } .novel-main h1 { font-size:35px; } .novel-reading-note { margin-bottom:25px; } .novel-content { border-left:0;border-right:0;border-radius:0;padding:25px 23px;font-size:18px;line-height:1.85; } .novel-illustration img { max-height:560px; } .novel-bottom-nav { padding:0 12px; } .novel-nav-link,.novel-nav-home { padding:10px 9px;font-size:10px; } .novel-settings { top:66px;right:10px; } }
