:root { --ink:#3a2c27; --bar:#f6ecdd; --rasp:#9c1f52; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.reader-body { background: #1f4a42; color: var(--ink); font-family: Alegreya, system-ui, sans-serif; overflow: hidden; }
.reader { position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; grid-template-columns: minmax(0,1fr); }
.reader-bar, .reader-foot { display: flex; align-items: center; gap: 12px; padding: 10px calc(14px + env(safe-area-inset-left)); background: var(--bar); }
.reader-title { flex: 1; min-width: 0; font-family: Fraunces, serif; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-title em { font-weight: 500; opacity: .6; }
.reader-btn { flex: none; font-size: 1.3rem; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #eadbc7; color: var(--ink); display: grid; place-items: center; text-decoration: none; cursor: pointer; }
.stage { position: relative; display: flex; justify-content: center; align-items: center; gap: 0; padding: 16px; overflow: hidden; touch-action: pan-y; }
.pg { display: none; aspect-ratio: 2 / 3; width: min(calc(100vw - 32px), calc((100dvh - 150px) * 2 / 3)); min-width: 0; flex: none; background: #efe4de; overflow: hidden; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.35); text-align: center; align-items: center; justify-content: center; animation: pgin .35s ease; }
.pg.show { display: flex; }
.spread .pg.show { width: min(calc((100vw - 140px) / 2), calc((100dvh - 150px) * 2 / 3)); }
.spread .pg.show.left { border-radius: 10px 0 0 10px; }
.spread .pg.show.right { border-radius: 0 10px 10px 0; }
@keyframes pgin { from { opacity: .3; transform: scale(.985); } to { opacity: 1; transform: none; } }
.pg h1, .pg h2 { line-height: 1.1; margin: .3em 0; }
.pg h1 { font-size: clamp(1.6rem, 5vh, 3rem); }
.pg h2 { font-size: clamp(1.2rem, 3.6vh, 2.2rem); }
.pg p { font-size: clamp(.95rem, 2.4vh, 1.35rem); }
.pg-art { font-size: clamp(3rem, 12vh, 7rem); display: block; }
.p1 { background: #ffe066; } .p2 { background: #ffd6e8; } .p3 { background: #c8f2e6; }
.p4 { background: #d9ccff; } .p5 { background: #ffd8b0; } .p6 { background: #19a7a0; color: #fff; }
.end-btn { display: inline-block; margin-top: 12px; padding: 12px 22px; border-radius: 99px; background: #fff; color: #e6007e; font-weight: 800; text-decoration: none; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,250,242,.9); font-size: 2rem; line-height: 1; cursor: pointer; color: var(--ink); }
.nav.prev { left: 10px; } .nav.next { right: 10px; }
.nav:disabled { opacity: .25; cursor: default; }
.reader-foot input { flex: 1; accent-color: #e6007e; }
.reader-foot span { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; font-weight: 700; }
@media (hover: none) and (max-width: 700px) { .nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .pg { animation: none; } }
.pg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-end { padding: 8%; background: #9c1f52 !important; color: #fff; }
.pg h1, .pg h2 { font-family: Fraunces, serif; }
.end-btn { color: #9c1f52; }
.reader-foot input { accent-color: #9c1f52; }
