.art-book-page{--ink:#444;--paper:#444;--sheet:#fff;--accent:#555;--line:#bbb;color-scheme:light;background:#d6d6d6;color:#444;overflow-x:clip}
.art-book-page::before{display:none}.art-book-page .site-header{height:84px;border:0;gap:28px;margin:0 4vw}.art-book-page .page-links{margin:0;gap:28px}.art-book-page .page-links a{color:#717171}.art-book-page .page-links a[aria-current="page"]{color:#333}.art-book-page .page-links a[aria-current="page"]::before{background:#555}.contents-toggle{margin-left:auto;min-height:44px;min-width:44px;font-size:21px;color:#555}.skip-link{position:fixed;top:-80px;left:20px;z-index:20;background:#fff;color:#333;padding:12px}.skip-link:focus{top:12px}
.art-book-page main{min-height:calc(100svh - 84px);display:flex;flex-direction:column}.art-book-page .book-intro{display:flex;justify-content:center!important;align-items:center;width:auto;margin:26px 20px 0!important}.chapter-switch{display:flex;gap:28px}.chapter-switch button{font-size:12px;color:#777;min-height:44px;padding:10px 0;border-bottom:1px solid transparent}.chapter-switch button[aria-pressed="true"]{color:#333;border-color:#777}
.reading-room{width:100%;position:relative;flex:1;display:flex;flex-direction:column;justify-content:center}.art-book-page .book-stage{position:relative;width:min(1340px,100%);margin:auto;padding:0!important;perspective:none}.book{position:relative;width:100%;height:clamp(440px,calc(100svh - 260px),760px);outline-offset:-20px!important;touch-action:pan-y;transform:none}.book:focus{outline:none}.book:focus-visible{outline:1px solid #777}.book canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.book #shadow-canvas{z-index:0}.book #book-canvas{z-index:1}.spread{position:absolute;left:50%;top:50%;width:52%;height:72%;transform:translate(-50%,-50%);display:flex;z-index:2;gap:0}.spread>button{display:block;flex:1;min-width:0;padding:0;opacity:0;cursor:zoom-in}.spread>button img{width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none;-webkit-user-drag:none}.spread>button:focus-visible{opacity:1;background:#fff}.book.is-turning .spread{pointer-events:none}.book.is-dragging{cursor:grabbing}.book-fallback #book-canvas,.book-fallback #shadow-canvas{display:none}.book-fallback .spread>button{opacity:1;background:#fff;box-shadow:16px 24px 15px #b5b5b5}.book-fallback .spread{width:75%;height:70%}
.book-controls{display:flex;align-items:center;justify-content:center;gap:20px;margin:0 auto 14px;position:relative;z-index:3}.book-controls>button{height:44px;width:44px;border-radius:50%;background:#e7e7e7;color:#555;font-size:22px;border:1px solid #c6c6c6;transition:background .15s}.book-controls>button:hover:not(:disabled){background:#f3f3f3}.book-controls>button:disabled{opacity:.3}.page-progress{display:flex;gap:0;align-items:center;height:44px}.page-progress button{width:22px;height:44px;padding:19px 8px}.page-progress button::after{content:"";display:block;width:5px;height:5px;border-radius:50%;background:#a9a9a9}.page-progress button[aria-current="true"]::after{background:#555}.art-book-page .book-colophon{display:flex;justify-content:flex-end;margin:0 4vw;padding:8px 0 16px;border:0}.book-colophon button{min-width:44px;min-height:44px;color:#777;font-size:18px}
.art-dialog{background:#e6e6e6;color:#444;border:1px solid #bdbdbd;border-radius:8px;padding:24px;box-shadow:20px 30px 60px #9996;max-height:90svh}.art-dialog::backdrop{background:#b5b5b5b3;backdrop-filter:blur(8px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}.dialog-heading h2{font-size:18px;font-weight:400;margin:0}.dialog-close{height:44px;width:44px;border:1px solid #bdbdbd;border-radius:50%;font-size:26px;flex-shrink:0}.contents-group h3{font-size:12px;font-weight:400;color:#686868;margin:20px 0 16px}.contents-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.contents-item{padding:0;min-width:0;background:white;border-radius:3px;overflow:hidden}.contents-item img{width:100%;height:190px;object-fit:contain;padding:8px;display:block}.image-dialog{width:min(1260px,calc(100% - 32px));padding:16px}.image-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:20px;margin-bottom:14px}.image-toolbar #zoom-toggle{min-height:44px;font-size:12px}.image-viewport{overflow:auto;max-height:71svh;background:#fff;overscroll-behavior:contain}.image-viewport img{display:block;margin:auto;max-width:100%;max-height:71svh;width:auto;height:auto;object-fit:contain}.image-viewport.zoomed img{max-width:none;max-height:none;width:1500px;height:auto;margin:0}.image-caption{display:flex;justify-content:flex-end;margin-top:8px;font-size:11px;color:#686868}.image-caption a{min-height:36px;display:flex;align-items:center}.noscript{padding:24px}
@media(max-width:699px){.art-book-page .site-header{height:76px;min-height:76px;flex-wrap:nowrap;margin:0 22px;padding:0;gap:14px}.art-book-page .page-links{order:0;flex-basis:auto;gap:25px;font-size:11px}.art-book-page .contents-toggle{order:1}.art-book-page main{min-height:calc(100svh - 76px)}.art-book-page .book-intro{margin:19px 20px 0!important}.chapter-switch{gap:28px}.chapter-switch button{font-size:11px}.book{height:clamp(350px,100vw,510px)}.spread{width:72%;height:65%}.book-controls{gap:10px;margin-bottom:25px}.page-progress button{width:21px;padding-inline:8px}.art-book-page .book-colophon{margin:0 20px}.art-dialog{padding:18px}.contents-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.contents-item img{height:155px}.image-dialog{padding:12px}.image-viewport,.image-viewport img{max-height:68svh}}

/* Q弹开合 */
.boing-open{animation:book-boing-open .9s cubic-bezier(.3,1.5,.5,1) both}
.boing-close{animation:book-boing-close .8s cubic-bezier(.3,1.5,.5,1) both}
@keyframes book-boing-open{0%{transform:scale(.92,1.05)}30%{transform:scale(1.06,.95)}55%{transform:scale(.98,1.02)}78%{transform:scale(1.01,.995)}100%{transform:none}}
@keyframes book-boing-close{0%{transform:scale(1.04,.96)}35%{transform:scale(.95,1.04)}65%{transform:scale(1.02,.99)}100%{transform:none}}
@media (prefers-reduced-motion:reduce){.boing-open,.boing-close{animation:none}}
/* black night, white books, grey shadows, stars behind */
.art-book-page{background:#000;color:#ccc;color-scheme:dark}
.art-book-page .page-links a{color:#8a8a8a}.art-book-page .page-links a[aria-current="page"]{color:#eee}.art-book-page .page-links a[aria-current="page"]::before{background:#ddd}
.art-book-page .social-links a,.contents-toggle,.book-colophon button{color:#bbb}
.chapter-switch button{color:#8a8a8a}.chapter-switch button[aria-pressed="true"]{color:#f2f2f2;border-color:#bbb}
.book-controls>button{background:#151515;color:#ddd;border-color:#333}.book-controls>button:hover:not(:disabled){background:#222}
.page-progress button::after{background:#555}.page-progress button[aria-current="true"]::after{background:#eee}
.art-dialog{background:#111;color:#ddd;border-color:#333;box-shadow:20px 30px 60px #0009}
.art-book-page main,.art-book-page .site-header{position:relative;z-index:1}
/* pages are viewed on the book itself, no zoom */
.spread>span{display:block;flex:1;min-width:0;opacity:0}.spread>span img{width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none}
/* shelf: every chapter is its own closed book */
/* the two books, about 1.4x the old size. --sam-room is how far the floating Sam reaches in from the right (his height and right edge from .float-sam,
   555 x 900 image, plus 24px air): the row stays centred while it clears him, and moves left only as far as it has to. */
.book-shelf{--tw:clamp(120px,min(18.2vw,68svh - 204px),266px);--ww:clamp(170px,min(29.4vw,107svh - 322px),420px);--g:clamp(22px,4vw,56px);--sam-room:calc(.6167 * clamp(256px,min(46vh,150vw - 720px),459px) + clamp(10px,3vw,48px) + 24px);
 display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:var(--g);padding:40px max(4vw,calc(4vw + var(--tw) + var(--g) + var(--ww) + 2 * var(--sam-room) - 100vw)) 30px 4vw;min-height:clamp(440px,calc(100svh - 260px),760px);align-content:center}
.book-shelf[hidden]{display:none}
.shelf-book{display:grid;justify-items:center;gap:12px;padding:0;color:#ddd;cursor:pointer}
.shelf-cover{display:grid;place-items:center;width:var(--tw);aspect-ratio:.68;padding:10%;background:#fbfbfa;border-radius:2px 12px 12px 2px;box-shadow:inset 6px 0 0 #ececea,inset 7px 0 0 #dcdcda,10px 14px 0 rgba(170,170,170,.2),18px 26px 30px rgba(170,170,170,.09);transform:rotate(-2deg);transition:transform .25s cubic-bezier(.3,1.6,.5,1)}
.shelf-book:nth-child(even) .shelf-cover{transform:rotate(1.5deg)}
.shelf-cover img{width:100%;height:100%;object-fit:contain;pointer-events:none}
.shelf-book:hover .shelf-cover,.shelf-book:focus-visible .shelf-cover{transform:translateY(-8px) rotate(0)}
@media(max-width:699px){.book-shelf{row-gap:26px;min-height:0}}

/* book switch sits at the front of the chapter row */
.chapter-switch #book-toggle{display:grid;place-items:center;min-width:28px;color:#bbb;border-bottom-color:transparent!important}.chapter-switch #book-toggle:hover{color:#fff}
@media(max-width:650px){.chapter-switch{flex-wrap:wrap;justify-content:center;gap:0 18px}}
/* Sam on a little stool, floating in the bottom right corner. On the shelf he is big. With a book open he steps back so he never covers the book,
   its page buttons or the page dots: on a wide screen into the corner beside and under the book, on a phone onto the → button, his stool over it.
   --sam-h is his height; book-open is set by art-book.js (not on-shelf alone, so he does not move while the page loads). */
.float-sam{--sam-h:clamp(256px,min(46vh,150vw - 720px),459px);--sam-move:.6s cubic-bezier(.3,1.25,.5,1);position:fixed;right:clamp(10px,3vw,48px);bottom:clamp(6px,2.5vh,30px);height:var(--sam-h);width:auto;z-index:5;pointer-events:none;user-select:none;filter:drop-shadow(0 18px 30px #000b);animation:float-sam 7s ease-in-out infinite;transition:height var(--sam-move),right var(--sam-move),bottom var(--sam-move)}
@keyframes float-sam{0%,100%{transform:translateY(0) rotate(-1.5deg)}50%{transform:translateY(-16px) rotate(1deg)}}
body.book-open .float-sam{--sam-h:clamp(110px,min(21vw - 70px,30vh),340px);right:16px;bottom:6px}
/* phones: on the shelf he sits on the bottom edge of the screen, his stool below it; with a book open he moves up and his stool stands over the → button
   (16px in from the right, 36px wide, its row 25px up and 44px high), small enough to stay under the book and its shadow */
@media(max-width:650px){.float-sam{--sam-h:min(176px,100svh - 412px);right:calc(-.113 * var(--sam-h));bottom:calc(-.273 * var(--sam-h))}
 body.book-open .float-sam{--sam-h:clamp(80px,50svh - 112px - max(91px,26vw),165px);right:calc(34px - .208 * var(--sam-h));bottom:71px}}
/* with a book open he passes under the page arrows while he moves, instead of over them */
body.book-open .float-sam{z-index:2}
@media(prefers-reduced-motion:reduce){.float-sam{animation:none;transition:none}}
/* two books: 竖版 stands upright, 横版 is a landscape book */
.shelf-book.is-wide .shelf-cover{width:var(--ww);aspect-ratio:4/3;padding:7%}
/* phones: Sam sits under the books, so the two share the whole width inside the 16px gutters */
@media(max-width:650px){.book-shelf{--g:16px;--tw:min(200px,(100vw - 48px) * .45);--ww:min(244px,(100vw - 48px) * .55);padding-inline:16px}}
/* the shelf is the way into a book, the book icon only the way back out */
body.on-shelf #book-toggle{visibility:hidden}
@media(max-width:699px){ .book-controls{max-width:calc(100% - 32px)}.book-controls>div{min-width:0}.page-progress button{flex:0 1 21px;min-width:0;padding-inline:0}.page-progress button::after{margin-inline:auto}}

/* Sam's line-drawn speech bubble, in the same white line as the stool: above-left of his head on the shelf, gone while a book is open.
   It repeats the shelf values of .float-sam's size and place (--sam-h, right, bottom) so it follows him on every screen. */
.sam-says{--sam-h:clamp(256px,min(46vh,150vw - 720px),459px);--sam-r:clamp(10px,3vw,48px);--sam-b:clamp(6px,2.5vh,30px);--say-w:clamp(200px,calc(.62 * var(--sam-h)),270px);position:fixed;z-index:5;width:var(--say-w);right:calc(var(--sam-r) + .259 * var(--sam-h) - .464 * var(--say-w));bottom:calc(var(--sam-b) + var(--sam-h) + 4px);pointer-events:none;user-select:none;animation:float-sam 7s ease-in-out infinite;transition:opacity .3s,visibility .3s}
.sam-says svg{display:block;width:100%;height:auto;overflow:visible}
/* desktop: the bubble sits right over his head, tail straight down; phones: up and to the left, tail down to him */
.sam-says .tail-side{display:none}
.sam-says path{fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.sam-says p{position:absolute;inset:7% 10% 31% 8%;margin:0;display:flex;align-items:center;justify-content:center;text-align:center;color:#fff;font-size:clamp(13.5px,calc(.04 * var(--sam-h)),17px);line-height:1.4;font-weight:500;letter-spacing:.02em;text-wrap:balance}
body.book-open .sam-says{opacity:0;visibility:hidden}
@media(max-width:650px){.sam-says{--sam-h:min(176px,100svh - 412px);--sam-r:calc(-.113 * var(--sam-h));--sam-b:calc(-.273 * var(--sam-h));width:178px;right:calc(var(--sam-r) + .46 * var(--sam-h));bottom:calc(var(--sam-b) + .9 * var(--sam-h))}.sam-says p{font-size:13.5px}html[lang="en"] .sam-says p{font-size:12.5px;line-height:1.3;inset:9% 9% 31% 8%}.sam-says .tail-down{display:none}.sam-says .tail-side{display:inline}}
@media(prefers-reduced-motion:reduce){.sam-says{animation:none}}
