:root{--red:#c71920;--ink:#f4f6f8;--muted:#9aa3ad;--panel:#171c24;--bg:#0d1117;--line:#2b3441}
*{box-sizing:border-box}html,body{height:100%;margin:0}body{background:radial-gradient(circle at 50% 25%,#313947 0,#171c24 40%,#0d1117 100%);color:var(--ink);font-family:Inter,Segoe UI,Arial,sans-serif;overflow:hidden}
button,a{font:inherit}.toolbar{height:72px;display:flex;align-items:center;justify-content:space-between;padding:0 22px;background:rgba(13,17,23,.92);border-bottom:1px solid var(--line);backdrop-filter:blur(12px);position:relative;z-index:20}.brand{display:flex;align-items:center;gap:12px;min-width:0}.brand-mark{display:grid;place-items:center;width:38px;height:38px;background:var(--red);font-weight:900;font-size:23px;clip-path:polygon(0 0,100% 0,83% 100%,17% 100%)}.brand div{display:flex;flex-direction:column;min-width:0}.brand strong{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.brand small{color:var(--muted);font-size:11px;margin-top:3px}.toolbar nav{display:flex;gap:6px}.toolbar button,.tool-link{width:40px;height:40px;border:1px solid var(--line);border-radius:10px;background:#202732;color:#fff;display:grid;place-items:center;text-decoration:none;cursor:pointer;font-size:22px;transition:.2s}.toolbar button:hover,.tool-link:hover{background:var(--red);border-color:var(--red)}
.reader{height:calc(100% - 122px);display:grid;grid-template-columns:58px minmax(0,1fr) 58px;align-items:center;gap:14px;padding:18px 24px}.stage{height:100%;max-height:calc(100vh - 158px);aspect-ratio:596/842;margin:auto;position:relative;perspective:1800px;touch-action:pan-y;filter:drop-shadow(0 24px 30px rgba(0,0,0,.45))}.stage>img,.flip-layer{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;border-radius:3px;background:#fff}.stage>img{user-select:none}.paper-shadow{position:absolute;inset:1% -1.5% -1%;background:#05070a;border-radius:8px;filter:blur(12px);opacity:.65}.flip-layer{z-index:4;transform-origin:left center;backface-visibility:hidden;display:none;overflow:hidden}.flip-layer img{width:100%;height:100%;object-fit:contain}.flip-layer.forward{display:block;animation:flipForward .46s ease-in both}.flip-layer.backward{display:block;transform-origin:right center;animation:flipBackward .46s ease-in both}@keyframes flipForward{0%{transform:rotateY(0);filter:brightness(1)}100%{transform:rotateY(-92deg);filter:brightness(.55)}}@keyframes flipBackward{0%{transform:rotateY(92deg);filter:brightness(.55)}100%{transform:rotateY(0);filter:brightness(1)}}
.tap-zone{position:absolute;z-index:6;top:0;bottom:0;width:28%;border:0;background:transparent;cursor:pointer}.tap-zone.left{left:0}.tap-zone.right{right:0}.turn{width:50px;height:64px;border:1px solid #3b4656;border-radius:16px;background:rgba(23,28,36,.86);color:#fff;font-size:42px;line-height:1;cursor:pointer;transition:.2s}.turn:hover:not(:disabled){background:var(--red);border-color:var(--red);transform:scale(1.06)}.turn:disabled{opacity:.25;cursor:default}
.statusbar{height:50px;background:rgba(13,17,23,.94);border-top:1px solid var(--line);display:grid;grid-template-columns:65px minmax(120px,420px) auto;justify-content:center;align-items:center;gap:16px;padding:0 20px;color:var(--muted);font-size:12px;position:relative;z-index:20}.statusbar input{accent-color:var(--red);width:100%}.hint{white-space:nowrap}
.thumb-panel{position:fixed;z-index:40;left:0;top:0;bottom:0;width:min(390px,90vw);background:#121821;border-right:1px solid var(--line);transform:translateX(-102%);transition:transform .28s ease;box-shadow:20px 0 50px rgba(0,0,0,.35)}.thumb-panel.open{transform:none}.thumb-head{height:64px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;border-bottom:1px solid var(--line)}.thumb-head button,.zoom-dialog>button{border:0;background:transparent;color:white;font-size:30px;cursor:pointer}.thumb-grid{height:calc(100% - 64px);overflow:auto;padding:14px;display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.thumb{border:2px solid transparent;border-radius:6px;background:#242c38;padding:4px;color:#bbb;cursor:pointer}.thumb.active{border-color:var(--red);color:white}.thumb img{width:100%;display:block;border-radius:2px}.thumb span{display:block;text-align:center;font-size:11px;padding-top:5px}
.zoom-dialog{border:0;padding:0;background:rgba(7,9,13,.96);width:100vw;height:100vh;max-width:none;max-height:none}.zoom-dialog::backdrop{background:#05070a}.zoom-dialog img{display:block;max-width:94vw;max-height:94vh;margin:3vh auto;object-fit:contain}.zoom-dialog>button{position:fixed;right:20px;top:14px;z-index:3;width:44px;height:44px;background:#222a35;border-radius:50%}
@media(max-width:700px){.toolbar{height:60px;padding:0 10px}.brand small{display:none}.brand strong{font-size:13px}.brand-mark{width:32px;height:32px}.toolbar button,.tool-link{width:35px;height:35px}.reader{height:calc(100% - 108px);grid-template-columns:1fr;padding:10px}.turn{display:none}.stage{max-width:100%;max-height:calc(100vh - 128px)}.statusbar{height:48px;grid-template-columns:52px 1fr;padding:0 14px;gap:10px}.hint{display:none}.thumb-grid{grid-template-columns:repeat(2,1fr)}}
@media(prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}
