:root{font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:#172f3c;background:#f3f5f8;font-size:16px}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a.button{cursor:pointer;border:1px solid #d5dee6;background:white;border-radius:8px;padding:9px 14px;color:#233d4e;text-decoration:none}button:hover{background:#edf4f8}button:disabled{opacity:.5;cursor:default}.primary{background:#193e55!important;color:white!important;border-color:#193e55!important}input,select{border:1px solid #ced9e2;padding:10px;border-radius:7px;background:white;max-width:100%}input:focus{outline:2px solid #91b6cd}h1,h2,p{margin-top:0}h1{font-size:24px}h2{font-size:20px}.top{height:76px;background:#fff;border-bottom:1px solid #dde4e9;padding:0 32px;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{font-size:21px;font-weight:700}.layout{display:grid;grid-template-columns:220px 1fr;min-height:calc(100vh - 76px)}aside{background:#fff;border-right:1px solid #dde4e9;padding:24px 16px}.folder{display:block;width:100%;text-align:left;border:0;margin-bottom:8px}.folder.active{background:#e7eff5;font-weight:600}main{padding:30px;min-width:0}.toolbar{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:24px;flex-wrap:wrap}.muted{color:#667987;font-size:14px}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(245px,1fr));gap:22px}.card{background:white;border:1px solid #e0e7ed;border-radius:12px;overflow:hidden;box-shadow:0 3px 12px #19384f06}.cover{height:180px;background:#e9eef3;display:flex;align-items:center;justify-content:center;overflow:hidden}.cover img{height:100%;width:100%;object-fit:contain}.cardbody{padding:18px}.card h2{font-size:17px;overflow-wrap:anywhere;line-height:1.5;margin-bottom:10px}.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.actions button,.actions a{font-size:14px;padding:7px 10px}.status{display:inline-block;border-radius:4px;font-size:12px;padding:3px 7px;background:#edf1f5;margin-right:8px}.status.published{background:#e5f4ec;color:#247344}.empty{padding:80px 20px;text-align:center;background:#fff;border:1px dashed #cedbe4;border-radius:12px}.login{width:min(400px,calc(100% - 40px));margin:12vh auto;background:white;border:1px solid #dbe4eb;border-radius:16px;padding:36px}.login label,.field{display:block;margin:20px 0 8px}.login input{width:100%;margin-top:8px}.login button{margin-top:24px;width:100%}.error{color:#ba3838;line-height:1.5;font-size:14px;margin:12px 0}dialog{border:1px solid #d6e0e8;border-radius:14px;width:min(500px,calc(100% - 24px));padding:28px;color:#172f3c}dialog::backdrop{background:#0f293e88}dialog input:not([type=checkbox]),dialog select{width:100%;margin:8px 0 12px}dialog footer{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}.check{display:block;margin:18px 0}#qr img,#qr svg{width:240px;height:240px;display:block;margin:16px auto}.notice{padding:14px 18px;background:#e6eff5;margin-bottom:18px;border-radius:8px}.hidden{display:none!important}.bookreader{background:#e8edf2;min-height:100vh}.readerbar{background:white;display:flex;gap:9px;padding:12px;align-items:center;justify-content:center;flex-wrap:wrap;position:sticky;top:0;z-index:10;border-bottom:1px solid #d4dfe7}.readerbar input{width:64px;text-align:center;padding:8px}.readerhead{padding:18px 24px;background:#193e55;color:white;display:flex;justify-content:space-between;gap:12px}.readerhead h1{font-size:18px;margin:0}.stage{display:flex;justify-content:center;overflow:auto;padding:24px 12px;min-height:60vh}.page{background:white;overflow:hidden}.page img{display:block;width:100%;height:100%;object-fit:contain}.page.loading{display:flex;align-items:center;justify-content:center;color:#8996a0}.thumbs{display:flex;gap:14px;overflow:auto;padding:16px 24px;background:#dce4eb}.thumbs button{flex:0 0 90px;padding:5px}.thumbs img{width:80px;height:90px;object-fit:contain}.readstatus{text-align:center;padding:12px;color:#526a7a;font-size:14px}.reading{max-width:1500px;margin:auto}#plaincanvas{max-width:none;background:white;box-shadow:0 4px 16px #142f4322}.sr{position:absolute;left:-10000px}progress{width:100%;margin:15px 0}#flash{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#193e55;color:white;padding:12px 22px;border-radius:10px;z-index:200;max-width:90%}@media(max-width:700px){.top{padding:0 18px;height:65px}.brand{font-size:18px}.layout{grid-template-columns:1fr}aside{display:flex;overflow:auto;padding:12px;border-right:0;gap:6px}.folder{width:auto;white-space:nowrap;margin:0}.layout main{padding:20px 14px}.grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}.readerbar{gap:6px;padding:8px}.readerbar button,.readerbar a{font-size:14px;padding:8px}.readerhead{padding:14px 16px}.stage{padding:12px 0}.toolbar input{width:100%}}
.pagecontent{position:relative;width:100%;height:100%}.pagecontent img{width:100%;height:100%;display:block;object-fit:contain}
.toolicon{display:block;width:var(--button-size,22px);height:var(--button-size,22px);background:var(--reader-icons,#fff);mask-size:contain;mask-repeat:no-repeat;mask-position:center;flex-shrink:0}
.toollabel{display:none;color:var(--reader-icons,#fff);font-size:12px;white-space:nowrap}
.buttons-text .toolicon{display:none}.buttons-text .toollabel{display:block}.buttons-both .toollabel{display:block}.buttons-both .bottom button,.buttons-both .bottom a{flex-direction:column;gap:3px;width:auto;min-width:48px;height:52px;padding:5px 8px}
.buttons-both .bottom{height:56px;min-height:56px;flex-basis:56px}
.buttons-text .bottom button,.buttons-text .bottom a{width:auto;min-width:42px;padding:5px 8px}
#pageinput{color:var(--reader-pagecolor,#333)}
#searchquery{color:var(--reader-icons,#fff)}
.slidebook{display:flex;align-items:center;justify-content:center;flex-shrink:0}
.slidebook .page{display:none;position:relative;flex-shrink:0}.slidebook .page.slideshow{display:block}
.slide-enter .page.slideshow{animation:slide-book-enter .3s ease-out}
@keyframes slide-book-enter{from{opacity:.6;transform:translateX(15px)}to{opacity:1;transform:translateX(0)}}
.bottom button:not(.hidden),.bottom a:not(.hidden){color:var(--reader-icons,#fff)}
@media(max-width:650px){.bottom #auto:not(.hidden),.bottom #first:not(.hidden),.bottom #last:not(.hidden),.bottom #sound:not(.hidden){display:flex}.bottom .toolgroup{min-width:0}.bottom button,.bottom a{width:26px;padding:3px}.bottom input{width:39px}.buttons-text .bottom{flex-wrap:wrap;height:auto;min-height:48px}.buttons-both .bottom{flex-wrap:wrap;height:auto;min-height:56px}}
#loadingcover{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;background:#323232;color:#ddd;text-align:center}
#loadingcontent{max-width:90%;max-height:95%;display:flex;flex-direction:column;align-items:center;gap:18px}
#loadingpicture{max-width:80vw;object-fit:contain}#loadingcaption{margin:0}
.loadspinner{width:42px;height:42px;border:2px solid #ffffff30;border-top-color:currentColor;border-radius:50%;animation:loadspin 1s linear infinite}
@keyframes loadspin{to{transform:rotate(360deg)}}
#loadingvideo{max-height:75vh;max-width:90vw;width:auto}#skiploading{position:fixed;right:24px;top:24px;color:white;background:#0008;border:1px solid #ffffff80;padding:10px 22px;border-radius:6px}
#book .page{background:var(--page-background,#fff);border:var(--page-border,0)}
.thickbook #book{box-shadow:3px 3px 0 #e9e9e5,5px 5px 0 #ccc,7px 7px 0 #e6e6e1,9px 9px 8px #0003}
.right-to-left #edgeprev{left:auto;right:6px}.right-to-left #edgenext{right:auto;left:6px}
.right-to-left .slidebook{flex-direction:row-reverse}
.verticalslide .slide-enter .page.slideshow{animation-name:slide-book-vertical;animation-duration:var(--slide-duration,650ms)}
.slide-enter .page.slideshow{animation-duration:var(--slide-duration,650ms)}
@keyframes slide-book-vertical{from{opacity:.6;transform:translateY(35px)}to{opacity:1;transform:translateY(0)}}
.newicon{font-size:20px;color:var(--reader-icons,#fff);line-height:1}
.bookmarkrow{display:flex;align-items:center}.bookmarkrow .item{flex:1}.bookmarkrow>button:last-child{background:transparent;border:0}
#bookmarktabs{position:fixed;right:0;top:25%;z-index:6;display:flex;flex-direction:column;gap:6px;max-height:55vh;overflow:auto}
#bookmarktabs button{writing-mode:vertical-rl;max-height:150px;overflow:hidden;font-size:12px;padding:10px 7px;border:0;border-radius:5px 0 0 5px;box-shadow:-1px 1px 4px #0002}
#bookmarktabs button.textured{background-image:repeating-linear-gradient(45deg,#fff1,#fff1 2px,#0001 2px,#0001 4px)!important}
#bookstage{justify-content:safe center;align-items:safe center}
@media(max-width:650px){.bottom button,.bottom a{width:23px!important;min-width:0!important}.bottom input{width:34px}.toolicon{max-width:19px;max-height:19px}.bottom .toollabel{font-size:10px}.newicon{font-size:17px}.bottom .pagetools{margin:0}.buttons-both .bottom,.buttons-text .bottom{flex-wrap:wrap;justify-content:space-between}}
body.right-to-left #edgeprev{left:auto;right:6px}body.right-to-left #edgenext{right:auto;left:6px}
body.right-to-left #next .toolicon,body.right-to-left #prev .toolicon,body.right-to-left #first .toolicon,body.right-to-left #last .toolicon{transform:scaleX(-1)}
body.right-to-left .slidebook{flex-direction:row-reverse}
#moreitems{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.moreitem{min-height:44px;font-size:15px}
button.danger{color:#b43e38;border-color:#e5c5c2;background:#fff}button.danger:hover{background:#fff1ef}
/* Paper curvature remains visible while the open book is at rest. */
#book .pagecontent::after{content:"";position:absolute;top:0;bottom:0;pointer-events:none;z-index:4;opacity:0}
.spine-shading #book.spread-open .page.--left .pagecontent::after{
right:0;width:var(--spine-width,20%);opacity:1;background:linear-gradient(to left,rgba(0,0,0,var(--spine-strength,.32)) 0%,rgba(0,0,0,calc(var(--spine-strength,.32)*.66)) 16%,rgba(0,0,0,calc(var(--spine-strength,.32)*.20)) 56%,transparent 100%)}
.spine-shading #book.spread-open .page.--right .pagecontent::after{
left:0;width:calc(var(--spine-width,20%)*.67);opacity:1;background:linear-gradient(to right,rgba(0,0,0,calc(var(--spine-strength,.32)*.82)) 0%,rgba(0,0,0,calc(var(--spine-strength,.32)*.45)) 13%,rgba(0,0,0,calc(var(--spine-strength,.32)*.1)) 60%,transparent 100%)}
#book{filter:none}
.book-drop-shadow #book{filter:drop-shadow(0 1px 3px #0006) drop-shadow(0 3px 8px #0002)}
.thickbook #book{box-shadow:none}
.thickbook #book.spread-open::after{content:"";position:absolute;left:100%;top:2px;bottom:-1px;width:var(--paper-thickness,12px);z-index:-1;background:repeating-linear-gradient(to right,#fafaf6 0px,#fafaf6 1px,#c9c9c3 1px,#e4e4df 2px,#eeeeea 3px);border-radius:0 65% 65% 0 / 0 8px 8px 0;box-shadow:3px 1px 4px #0002;pointer-events:none}
.thickbook #book.spread-open::before{content:"";position:absolute;left:1px;right:-2px;top:100%;height:3px;z-index:-1;background:repeating-linear-gradient(to bottom,#fff 0 1px,#bbb 1px 2px);pointer-events:none}

/* Phone tap-to-read: keep page geometry stable when the chrome disappears. */
.phone-reader .readertop,.phone-reader .bottom{transition:transform .22s ease,opacity .22s ease;z-index:18}
.phone-reader.reader-chrome-hidden .readertop{transform:translateY(-100%);opacity:0;visibility:hidden;pointer-events:none}
.phone-reader.reader-chrome-hidden .bottom{transform:translateY(100%);opacity:0;visibility:hidden;pointer-events:none}
@media(prefers-reduced-motion:reduce){.phone-reader .readertop,.phone-reader .bottom{transition:none}}

.readerpanel button.toc-reader-row{display:flex;gap:9px;align-items:center}.toc-reader-title{flex:1;min-width:0}.toc-reader-page{color:#5b6770;font-variant-numeric:tabular-nums}.toc-doc-icon{color:#506780}

.toc-branch summary{display:flex;align-items:center;cursor:pointer}.toc-branch summary::before{content:"▸";color:#6c7c8e}.toc-branch[open]>summary::before{content:"▾"}.toc-branch summary button{flex:1;min-width:0}.toc-children{padding-left:15px}

.toc-doc-icon{font-size:0!important;display:inline-block;width:18px;height:22px;flex:0 0 18px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28' fill='none' stroke='%23506780' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='M8 2h9l5 5v17H8zM17 2v6h5M5 7H2v19h15M11 12h8M11 16h8M11 20h6'/%3E%3C/svg%3E") center/contain no-repeat}
