body { background: #3b3f46; overflow: hidden; height: 100dvh; display: flex; flex-direction: column; }
.reader { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #fff; border-bottom: 1px solid #ccc; flex-wrap: wrap; justify-content: center; }
.toolbar button { min-width: 38px; height: 38px; border: 1px solid #ccc; border-radius: 8px; background: #fff; font-size: 17px; cursor: pointer; padding: 0 9px; touch-action: manipulation; }
.toolbar button:hover { background: #f0f0f0; }
.toolbar button.on, #drawbtn.on, #eraser.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.toolbar .sep { width: 1px; height: 26px; background: #ddd; margin: 0 4px; }
.pgbox { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; }
.pgbox input { width: 52px; height: 36px; border: 1px solid #ccc; border-radius: 8px; text-align: center; font-size: 16px; }
.col { width: 34px; min-width: 34px !important; padding: 0 !important; background: var(--c) !important; border: 3px solid #fff !important; box-shadow: 0 0 0 1px #aaa; border-radius: 50% !important; }
.col.on { box-shadow: 0 0 0 3px var(--blue); }
.col.hl { border-radius: 6px !important; }
#tools { display: inline-flex; gap: 5px; align-items: center; flex-wrap: wrap; }
#tools[hidden] { display: none; }
.stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#bookwrap { position: relative; }
.pg { background: #fff; overflow: hidden; }
.pg img { width: 100%; height: 100%; display: block; object-fit: contain; user-select: none; -webkit-user-drag: none; }
#ink { position: absolute; left: 0; top: 0; pointer-events: none; touch-action: none; z-index: 20; }
#ink.active { pointer-events: auto; cursor: crosshair; }
#ink.hide { visibility: hidden; }
.audiobar { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 6px 10px; background: #2b2e33; min-height: 50px; color: #fff; }
.audiobar button { background: #fff; color: var(--blue); border: 0; border-radius: 20px; padding: 7px 14px; font-weight: 700; cursor: pointer; font-size: 15px; }
.audiobar button.on { background: var(--red); color: #fff; }
.audiobar audio { height: 36px; max-width: 360px; width: 100%; margin: 0; }
.audiobar .hint { opacity: .6; font-size: 14px; }
.tocpanel { position: fixed; inset: 58px 0 0 0; background: rgba(20,22,26,.96); z-index: 60; display: flex; flex-direction: column; }
.tochead { display: flex; justify-content: space-between; align-items: center; color: #fff; padding: 12px 16px; font-size: 18px; }
.tochead button { background: #fff; border: 0; border-radius: 8px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.thumbs { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; padding: 0 16px 24px; }
.thumbs a { color: #fff; text-decoration: none; text-align: center; font-size: 13px; }
.thumbs img { width: 100%; aspect-ratio: 595/842; object-fit: cover; background: #fff; border-radius: 3px; display: block; }
.thumbs a.cur img { outline: 3px solid #ffd54a; }
.foot { display: none; }
@media (max-width: 600px) { .toolbar .lbl { display: none; } .toolbar { gap: 4px; padding: 5px; } .toolbar .sep, #fsbtn { display: none; } .toolbar button { min-width: 34px; height: 34px; font-size: 15px; padding: 0 6px; } .col { width: 30px; min-width: 30px !important; } .audiobar { min-height: 44px; padding: 4px 6px; } .audiobar audio { max-width: 220px; } }
.tocpanel[hidden] { display: none; }
