*{box-sizing:border-box}
html,body{margin:0;height:100%;background:#fff;color:#4c4c4c;font:14px/1.4 "Segoe UI",Roboto,Arial,sans-serif;overflow:hidden}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;padding:0}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#top{position:fixed;top:0;left:0;right:0;height:44px;display:flex;align-items:center;gap:14px;padding:0 14px;z-index:20;background:#fff}
#title{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw}
#pager{display:flex;align-items:center;gap:6px;font-size:13px}
#pageInput{width:58px;height:26px;border:1px solid #d6d6d6;border-radius:4px;text-align:center;font:inherit;color:inherit}
#top .spacer{flex:1}
.ib{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;color:#4c4c4c}
.ib:hover{background:#f1f1f1}
.ib:disabled{opacity:.3;cursor:default;background:none}
#stage{position:fixed;top:44px;bottom:52px;left:0;right:0;display:flex;align-items:center;justify-content:center}
#bookWrap{position:relative}
#book .page{background:#fff}
#book .page img{width:100%;height:100%;display:block;object-fit:fill;user-select:none;-webkit-user-drag:none}
.nav{position:fixed;top:50%;transform:translateY(-50%);z-index:15;width:44px;height:64px;color:#888}
.nav svg{width:28px;height:28px}
#prev{left:6px}#next{right:6px}
#bottom{position:fixed;bottom:0;left:0;right:0;height:52px;display:flex;align-items:center;justify-content:center;gap:6px;z-index:20;background:#fff}
#bottom .sep{width:1px;height:20px;background:#e3e3e3;margin:0 6px}
#loader{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:#fff;z-index:50;transition:opacity .3s}
#loader img{max-height:45vh;box-shadow:0 4px 18px rgba(0,0,0,.15)}
#loader.hide{opacity:0;pointer-events:none}
.panel{position:fixed;top:44px;bottom:52px;width:320px;max-width:92vw;background:#fff;box-shadow:0 0 18px rgba(0,0,0,.15);z-index:30;display:none;flex-direction:column}
.panel.open{display:flex}
.panel header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid #eee;font-weight:600}
#thumbs{left:0;width:360px}
#thumbGrid{overflow:auto;padding:12px;display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:12px}
#thumbGrid button{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:12px}
#thumbGrid img{width:100%;border:1px solid #e3e3e3}
#thumbGrid button.cur img{outline:2px solid #4c4c4c}
#search{right:0}
#searchBox{display:flex;gap:6px;padding:10px 12px}
#searchInput{flex:1;height:32px;border:1px solid #d6d6d6;border-radius:4px;padding:0 8px;font:inherit}
#results{overflow:auto;padding:0 12px 12px}
#results button{display:block;width:100%;text-align:left;padding:8px;border-bottom:1px solid #f0f0f0;font-size:13px}
#results button:hover{background:#f6f6f6}
#results b{display:block;font-size:12px;color:#888;font-weight:600}
#results mark{background:#ffe58a}
#zoom{position:fixed;inset:0;background:#fff;z-index:40;display:none;overflow:auto;cursor:grab}
#zoom.open{display:block}
#zoom.drag{cursor:grabbing}
#zoomInner{display:flex;margin:auto;width:max-content}
#zoomInner img{display:block;user-select:none;-webkit-user-drag:none}
#zoomBar{position:fixed;top:8px;right:12px;z-index:41;display:none;gap:4px;background:#fff;border-radius:8px;box-shadow:0 1px 8px rgba(0,0,0,.15);padding:4px}
#zoom.open + #zoomBar{display:flex}
.seo{position:absolute;left:-9999px;top:0;width:1px;height:1px;overflow:hidden}
@media (max-width:640px){#title{display:none}.nav{display:none}#thumbs{width:100vw}}
