/* A paper book in the study; the native dialog owns focus and Escape. */
body:not(.study-dev) #view-rail{display:none}
body:not(.study-dev) .ui-mode .ui-orbit::after{content:'书房序章'}
body:not(.study-dev) .ui-mode .ui-orbit{font-size:0}
body:not(.study-dev) .ui-mode .ui-orbit::after{font-size:19px}
.study-actions{display:flex;align-items:center;gap:10px}
.study-actions #read-antique{color:#efd2a5}
.study-actions #study-next[hidden],.study-actions #walk[hidden]{display:none}
.study-task{position:fixed;left:46px;bottom:87px;z-index:60;max-width:min(470px,55vw);pointer-events:none;text-shadow:0 2px 8px #000}
.study-task small{display:block;font:12px var(--dsh-serif);letter-spacing:3px;color:#c3a987;margin-bottom:8px}
.study-task p{font:20px/1.5 var(--dsh-serif);letter-spacing:2px;margin:0;color:#eedbbb}
body:not(.study-dev) .dsh-foot{display:none}
body.book-reading .study-task,body.book-reading #crosshair,body.book-reading #walk-tip,body.book-reading .dsh-actions,body.book-reading #touch-walk{visibility:hidden}
#antique-reader{box-sizing:border-box;width:min(1120px,calc(100vw - 48px));max-width:none;max-height:calc(100dvh - 38px);padding:0;border:0;overflow:auto;color:#433327;background:transparent;font-family:var(--dsh-serif);box-shadow:none}
#antique-reader::backdrop{background:#0b111bdd;backdrop-filter:blur(5px)}
#book-art[hidden],#book-blank[hidden]{display:none}
.book-scale-row{display:flex;align-items:center;justify-content:center;gap:12px;color:#d6c19e;font:13px var(--dsh-serif);margin:0 0 16px}
.book-scale-row[hidden]{display:none}
.book-scale-row input{width:150px;accent-color:#d0b184}
.book-scale-row span{font-size:12px;color:#ae9b7e}
#antique-reader[open]{animation:book-arrive .5s ease both}
.book-toolbar{display:flex;justify-content:space-between;align-items:center;color:#e4d0ad;padding:0 5px 17px;gap:15px}
.book-toolbar h2{font:24px var(--dsh-serif);letter-spacing:6px;margin:0}
.book-toolbar span{font-size:12px;letter-spacing:2px;color:#baaa91}
.book-tools{display:flex;gap:8px;align-items:center}
.book-tools button,.book-bottom button{font:14px var(--dsh-serif);letter-spacing:1px;color:#e6d4b3;background:#242622;border:1px solid #b69a6c55;padding:9px 15px;cursor:pointer}
.book-tools button:hover,.book-bottom button:hover{border-color:#e6c592;background:#343429}
.book-tools #book-close{font-size:23px;line-height:1;padding:8px 13px}
.book-spread{display:grid;grid-template-columns:1fr 1fr;position:relative;perspective:1500px;isolation:isolate;box-shadow:0 18px 60px #0008,0 0 0 6px #333b44;min-height:430px;background:#e5d0ab;border-radius:3px 8px 8px 3px}
.book-spread::after{content:'';position:absolute;left:50%;top:0;bottom:0;width:26px;transform:translateX(-50%);background:linear-gradient(90deg,#57442800,#69543725,#55432630,#6e573524,#57442800);pointer-events:none;z-index:3}
.book-page{position:relative;box-sizing:border-box;padding:30px 34px 32px;min-width:0;background:radial-gradient(ellipse at 80% 5%,#fff9e9aa,transparent 60%),repeating-linear-gradient(97deg,#90795205 0 1px,transparent 1px 4px),#eeddbe;box-shadow:inset 0 0 30px #a3824320;display:flex;flex-direction:column}
.book-page--picture{border-radius:3px 0 0 3px;padding-right:30px}
.book-page--text{border-radius:0 8px 8px 0;padding-left:42px}
.book-leaf-title{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #7f624c44;padding-bottom:12px;margin:0 0 19px;font-size:15px;letter-spacing:3px;color:#75553c}
.book-seal{font-size:11px;letter-spacing:1px;background:#9e4638;color:#efd4ad;padding:5px 4px;writing-mode:vertical-rl;line-height:1.25}
.book-figure{margin:0;flex:1;display:flex;flex-direction:column;justify-content:center;min-height:0}
.book-figure img{display:block;width:100%;max-height:305px;object-fit:contain;mix-blend-mode:multiply}
.book-figure figcaption{font:12px/1.5 var(--dsh-serif);text-align:center;letter-spacing:2px;margin-top:16px;color:#88684e}
.book-page--text .book-kicker{font-size:12px;letter-spacing:3px;color:#93634b;margin:0 0 15px}
.book-page--text h3{font:26px/1.5 var(--dsh-serif);letter-spacing:2px;margin:0 0 17px;color:#3d2e21}
.book-copy p{font:18px/1.9 var(--dsh-serif);letter-spacing:.6px;margin:0 0 14px}
.book-quote{font:19px/1.6 var(--dsh-serif);color:#9a4937;border-left:2px solid #a25842;margin:0 0 17px;padding-left:15px}
.book-notes{list-style:none;padding:12px 0 0;margin:auto 0 14px;border-top:1px solid #80624830;display:flex;flex-wrap:wrap;gap:9px 16px;font:13px/1.5 var(--dsh-serif);color:#86684c}
.book-page-no{font:11px Georgia,serif;color:#9e8566;text-align:center;display:block;margin-top:10px;letter-spacing:3px}
.book-blank{border:1px solid #92724a38;margin:14px 8px;min-height:230px;display:grid;place-content:center;text-align:center;flex:1;background:linear-gradient(135deg,#fff4d626,transparent)}
.book-blank svg{width:170px;height:95px;stroke:#99744966;stroke-width:1.25;fill:none;margin:0 auto 16px}
.book-blank p{font:18px/1.9 var(--dsh-serif);letter-spacing:4px;color:#94714e;margin:0}
.book-bottom{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:18px;color:#dbc7a8}
.book-page-nav{display:flex;align-items:center;gap:8px}
.book-page-nav button{border-color:transparent;background:transparent;color:#baa98e;padding:9px 12px}
.book-page-nav button[aria-current=page]{color:#f2d5a3;border-bottom:1px solid #d5b47a}
.book-bottom .book-next{background:#d0b184;color:#29271f;border-color:#d0b184}
.book-bottom button:disabled{opacity:.35;cursor:default}
#book-announcement{font:12px/1.7 var(--dsh-serif);margin:12px 0 0;text-align:center;color:#baa98c;letter-spacing:1px}
.book-spread.turn-forward .book-page--text{animation:leaf-next .32s ease}
.book-spread.turn-back .book-page--picture{animation:leaf-back .32s ease}
#antique-reader.is-zoomed .book-page--picture{display:none}
#antique-reader.is-zoomed .book-spread{grid-template-columns:1fr}
#antique-reader.is-zoomed .book-page--text{padding:36px max(45px,10%)}
#antique-reader.is-zoomed .book-spread::after{display:none}
#antique-reader.is-zoomed .book-copy p{font-size:24px}
#antique-reader.is-zoomed .book-page--text h3{font-size:30px}
#antique-reader.is-zoomed .book-notes{font-size:16px}
#antique-reader .book-illustration-view{display:none}
#antique-reader.is-art-zoomed .book-page--text{display:none}
#antique-reader.is-art-zoomed .book-spread{grid-template-columns:1fr}
#antique-reader.is-art-zoomed .book-spread::after{display:none}
#antique-reader.is-art-zoomed .book-figure img{max-height:min(460px,60dvh)}
#antique-reader.is-art-zoomed .book-page--picture{padding:24px 40px}
#antique-reader.is-art-zoomed .book-figure{display:block;overflow:auto;height:min(420px,calc(100dvh - 300px));min-height:180px;scrollbar-color:#a68860 #dbc5a0;overscroll-behavior:contain}
#antique-reader.is-art-zoomed .book-figure img{width:calc(100% * var(--art-scale,1.5));max-width:none;max-height:none;height:auto;object-fit:contain}
#antique-reader.is-art-zoomed .book-figure figcaption{display:none}
.book-figure img[src*="illustration"]{mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent),linear-gradient(transparent,#000 3%,#000 97%,transparent);mask-composite:intersect}
@keyframes book-arrive{from{opacity:0;transform:translateY(18px) scale(.96)}to{opacity:1;transform:none}}
@keyframes leaf-next{from{transform:rotateY(-70deg);filter:brightness(.75);transform-origin:left}to{transform:rotateY(0);filter:none;transform-origin:left}}
@keyframes leaf-back{from{transform:rotateY(70deg);filter:brightness(.75);transform-origin:right}to{transform:rotateY(0);filter:none;transform-origin:right}}
@media(max-width:800px){#antique-reader{width:calc(100vw - 26px);max-height:calc(100dvh - 26px)}.book-page{padding:24px 23px}.book-page--text{padding-left:29px}.book-page--text h3{font-size:22px}.book-copy p{font-size:16px}.book-bottom{gap:6px}.book-page-nav{gap:0}.book-page-nav button{padding:9px}.book-toolbar span{display:none}.study-task{left:23px;bottom:110px;max-width:calc(100vw - 46px)}.study-task p{font-size:17px}.study-actions{right:20px;bottom:28px}.study-actions .dsh-btn{font-size:12px;padding:10px}}
@media(max-width:600px){.book-toolbar{padding:0 0 12px}.book-toolbar h2{font-size:21px;letter-spacing:3px}.book-tools{gap:4px}.book-tools button{font-size:12px;padding:8px}.book-spread{grid-template-columns:1fr;min-height:0}.book-spread::after{display:none}.book-page--picture{padding:18px 22px 16px;border-radius:3px 3px 0 0}.book-leaf-title{margin-bottom:8px;padding-bottom:8px;font-size:13px}.book-figure img{max-height:180px}.book-figure figcaption{font-size:11px;margin-top:8px}.book-page--picture .book-page-no{display:none}.book-page--text{padding:20px 24px;border-top:1px solid #bba17a55;border-radius:0 0 3px 3px}.book-page--text .book-kicker{display:none}.book-page--text h3{font-size:22px;margin-bottom:13px}.book-copy p{font-size:17px;line-height:1.85}.book-quote{font-size:18px;margin-bottom:13px}.book-notes{font-size:12px;margin-bottom:0}.book-bottom{flex-wrap:wrap;justify-content:center;margin-top:15px}.book-page-nav{order:3;width:100%;justify-content:center}.book-bottom button{font-size:13px;padding:8px 13px}.book-blank{min-height:175px;margin:5px 0}.book-blank svg{height:60px;margin-bottom:10px}.book-blank p{font-size:16px}.study-actions{gap:7px}.study-actions #walk{font-size:11px;padding:10px}.study-task{bottom:104px}#antique-reader.is-zoomed .book-page--text{padding:25px}#antique-reader.is-zoomed .book-copy p{font-size:23px}#antique-reader.is-art-zoomed .book-page--picture{padding:20px}}
@media(prefers-reduced-motion:reduce){#antique-reader[open],.book-spread.turn-forward .book-page--text,.book-spread.turn-back .book-page--picture{animation:none}}
/* 手机横屏（矮屏）：工具栏、正文、图注整体收一档，配合 fitAntiqueReader() 的自动缩放，
   让一章完整显示、不需要上下滚动。 */
@media(max-height:600px){
 .book-spread{min-height:0;grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr)}
 .book-toolbar{padding:0 4px 8px;gap:8px}
 .book-toolbar h2{font-size:16px;letter-spacing:3px}
 .book-toolbar span{display:none}
 .book-tools{gap:5px}
 .book-tools button,.book-bottom button{font-size:11px;padding:6px 10px}
 .book-tools #book-close{font-size:16px;padding:4px 8px}
 .book-bottom{margin-top:8px;gap:8px}
 .book-page-nav{gap:2px}
 .book-page-nav button{padding:6px 8px;font-size:11px}
 #book-announcement{margin:6px 0 0;font-size:11px}
 .book-page{padding:14px 16px 12px}
 .book-page--text{padding-left:20px}
 .book-page--picture{padding-right:16px}
 .book-leaf-title{margin-bottom:9px;padding-bottom:7px;font-size:12px;letter-spacing:2px}
 .book-seal{font-size:9px;padding:3px}
 .book-page--text .book-kicker{font-size:10px;margin-bottom:7px;letter-spacing:2px}
 .book-page--text h3{font-size:18px;margin-bottom:8px}
 .book-quote{font-size:12.5px;margin-bottom:8px;padding-left:9px}
 .book-copy p{font-size:12.5px;line-height:1.72;margin-bottom:7px}
 .book-notes{font-size:10.5px;gap:5px 10px;padding-top:7px;margin-bottom:6px}
 .book-figure img{max-height:100%}
 .book-figure figcaption{font-size:10px;margin-top:7px}
 .book-blank{margin:6px 0;min-height:0}
 .book-blank svg{width:130px;height:74px;margin-bottom:8px}
 .book-blank p{font-size:14px;letter-spacing:3px}
 .book-page-no{font-size:10px;margin-top:5px}
 .book-scale-row{margin:0 0 8px;font-size:12px}
}
@media(pointer:coarse){.book-scale-row input{width:min(240px,62vw);height:28px}.book-scale-row{gap:14px}}
