/* A quiet Chinese ebook, using the site's existing palette and reading measure. */
.tools-label{font-size:var(--font-small);color:var(--muted);margin-bottom:16px}
.view-books{max-width:none;padding:32px 32px 110px;font-variant-numeric:tabular-nums}
.book-home{padding-top:48px}.book-home-label{font-size:11px;letter-spacing:.15em;color:var(--faint);margin-bottom:16px}
.book-home h1{font-size:32px;font-weight:500;margin-bottom:48px}
.book-reader-bar{display:flex;align-items:center;gap:20px;font-size:12px;color:var(--muted);margin-bottom:54px}
.book-reader-bar>a{text-decoration:none;white-space:nowrap}.book-reader-bar>span{flex:1;text-align:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.book-reader-bar>button{font-size:12px;color:var(--muted);padding:5px 0 5px 16px;white-space:nowrap}.book-reader-bar button:hover,.book-reader-bar a:hover{color:var(--fg)}
.book-reading-container{min-width:0}
.book-reader{max-width:var(--measure);font-size:var(--font-body);line-height:var(--leading-body);overflow-wrap:break-word}
.book-reader-head{margin-bottom:38px}.book-chapter{font-size:13px;color:var(--muted);margin-bottom:12px}
.book-reader h1{font-size:32px;line-height:1.5;font-weight:500;letter-spacing:-.025em;text-wrap:pretty}
.book-reader h1{scroll-margin-top:88px}.book-reader h1:focus{outline:none}
.book-block{scroll-margin-top:88px;min-width:0;margin-bottom:1.35em}.book-title-anchor{margin:0}
.book-block:focus{outline:0}.book-block:focus-visible{outline:1px solid var(--line);outline-offset:8px}
.book-language>*+*{margin-top:1em}.book-language p{margin-bottom:1em}.book-language p:last-child{margin-bottom:0}
.book-language h1,.book-language h2{font-size:22px;font-weight:500;line-height:1.6;margin:36px 0 18px}
.book-language h3,.book-language h4,.book-language h5{font-size:18px;font-weight:500;line-height:1.7;margin:28px 0 16px}
.book-language ul,.book-language ol{padding-left:1.5em}.book-language li+li{margin-top:.45em}
.book-language img{display:block;max-width:100%;height:auto;cursor:zoom-in;background:#fff;margin:28px auto}
.book-language img.book-image-error,.reader-popover img.book-image-error{min-height:80px;background:var(--surface);color:var(--muted);font-size:13px;padding:12px}
.book-language figure{margin:28px 0}.book-language figcaption{font-size:12px;color:var(--muted)}
/* Daily Dose: each source page is a labelled stretch of the lesson (role on the left, its original on the right). */
.dd-lesson{margin-top:20px}
.dd-reading-page{min-width:0}
.dd-reading-page+.dd-reading-page{margin-top:40px}
.dd-panel-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px;padding-bottom:10px;margin-bottom:18px;border-bottom:1px solid var(--line)}
.dd-panel-head .book-page-chip{grid-column:2;grid-row:1}
.dd-role-label{font-size:12px;font-weight:600;color:var(--muted);letter-spacing:.04em}
.dd-reading-page[data-page-role="question"] .dd-role-label,.dd-reading-page[data-page-role="answer"] .dd-role-label{color:var(--accent)}
.book-language .dd-page-heading{grid-column:1/-1;font-size:18px;line-height:1.5;color:var(--fg);margin:0;font-weight:600}
.dd-panel-body>p{line-height:1.9}
.dd-panel-body>:first-child{margin-top:0}
.dd-panel-body>:last-child{margin-bottom:0}
.dd-visual-context{background:var(--surface);border:1px solid var(--line);border-radius:7px;overflow:hidden;margin:0 0 24px}
.dd-visual-copy{padding:16px 20px;border-top:1px solid var(--line);font-size:15px;line-height:1.85}
.dd-visual-context .dd-visual-copy:only-child{border-top:0}
.dd-answer-summary{padding:16px 20px;background:var(--accent-soft);border-left:3px solid var(--accent);border-radius:0 5px 5px 0;margin-bottom:20px}
.dd-answer-summary>p:first-child{font-size:13px;color:var(--accent);margin-bottom:8px}
.dd-explanation-summary{margin-bottom:24px}
.book-language .dd-source-page{margin:18px 0}
.book-language .dd-source-page img{width:100%;height:auto;margin:0}
.dd-source-page figcaption{margin-top:8px}
.book-language .dd-book-figure{max-width:540px;margin:20px auto}
.book-language .dd-book-figure img{max-height:440px;width:auto;max-width:100%;object-fit:contain;margin:0 auto}
.book-language .dd-figure-compact .dd-book-figure{max-width:360px}
.book-language .dd-figure-compact .dd-book-figure img{max-height:300px}
.book-language .dd-visual-context .dd-source-page{margin:0}
.dd-visual-context .dd-source-page figcaption{padding:0 16px 12px}
.book-language .dd-visual-context .dd-book-figure{padding:16px;margin:0 auto}
/* Options are the practice page's buttons; the answer pages wait until the reader answers. */
.book-language .dd-options{margin:20px 0 0}
.book-language .dd-options .option{align-items:flex-start;font-size:15px;line-height:1.7}
.book-language .dd-options kbd{flex-shrink:0;min-width:22px;margin-top:2px;padding:2px 0;text-align:center;font-size:12px;color:var(--muted)}
.book-language .dd-options p{margin:0}
.dd-reveal{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;font-size:13px;color:var(--muted)}
.dd-lesson[data-dd-quiz]:not(.is-revealed) .dd-reading-page:not([data-page-role="question"]),
.dd-lesson[data-dd-quiz]:not(.is-revealed) .dd-gated,.dd-lesson.is-revealed .dd-reveal{display:none}
.book-language .book-page-source{margin-top:20px;font-size:13px;color:var(--muted)}
.book-page-source summary{cursor:pointer;padding:8px 0}
.dd-figure-values summary{cursor:pointer;color:var(--muted);font-size:13px}
.book-language .dd-reading-page table{min-width:0}
.book-chapter-note{margin:10px 0 0;font-size:13px;color:var(--muted)}
@media(max-width:600px){
  .book-language .dd-page-heading{font-size:17px}
  .dd-visual-copy{padding:14px}
  .book-language .dd-visual-context .dd-book-figure{padding:8px}
}
.book-table-scroll{max-width:100%;overflow-x:auto;margin:28px 0;overscroll-behavior-inline:contain}
.book-language table{width:100%;min-width:520px;border-collapse:collapse;font-size:14px;line-height:1.65;margin:0}
.book-language th,.book-language td{border:1px solid var(--line);padding:10px 12px;min-width:68px;text-align:left}
.book-language th{background:var(--surface);font-weight:500}
.book-language blockquote{margin:28px 0;padding:0 20px;border-left:2px solid var(--line);color:var(--muted)}
.book-language pre{max-width:100%;overflow:auto;font-size:13px;padding:16px;background:var(--surface);border-radius:4px}
.book-language .katex-display{max-width:100%;overflow-x:auto;overflow-y:hidden;padding:4px 0;margin:1.5em 0}
.book-language .katex{font-size:1.08em}.book-language a{color:var(--accent)}
.book-formula-terms{font-size:13px;color:var(--muted);line-height:1.85}
.book-missing{font-size:13px;color:var(--muted);line-height:1.85;margin:0 0 24px}
.book-message{padding:28px 0;line-height:1.9;color:var(--muted)}.book-message .btn,.book-message .link{margin:18px 16px 0 0}
.book-pagination{display:flex;justify-content:space-between;gap:24px;border-top:1px solid var(--line);padding-top:24px;margin-top:56px;font-size:13px;color:var(--muted)}
.book-pagination a{text-decoration:none}.book-pagination a:hover{color:var(--accent)}
.book-toc-dialog{position:fixed;inset:0 auto 0 0;margin:0;width:min(88vw,360px);height:100dvh;max-height:100dvh;max-width:none;border:0;border-right:1px solid var(--line);padding:24px;background:var(--bg);color:var(--fg);overscroll-behavior:contain}
.book-toc-dialog::backdrop,.reader-popover::backdrop{background:rgb(0 0 0 / .5)}
.book-drawer-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px;position:sticky;top:-24px;background:var(--bg);padding:12px 0;z-index:1;font-size:14px}.book-drawer-head strong{font-weight:500}
.book-toc-title{font-size:15px;font-weight:500;margin-bottom:24px}.book-toc details{margin:8px 0}
.book-toc summary{cursor:pointer;color:var(--muted);font-size:13px;padding:8px 0;line-height:1.6;overflow-wrap:anywhere}.book-toc summary::marker{color:var(--faint)}
.book-toc ol{list-style:none;padding:0;margin:0 0 18px}.book-toc li{margin:2px 0}
.book-toc a{display:block;text-decoration:none;padding:8px 12px;border-radius:4px;font-size:13px;line-height:1.7;color:var(--muted);overflow-wrap:anywhere}
.book-toc a:hover{background:var(--surface)}.book-toc a[aria-current="page"]{background:var(--accent-soft);color:var(--accent)}
.book-toc summary>a{display:inline;padding:2px 0;border-radius:0;font:inherit;color:inherit}
.book-toc summary>a[aria-current="page"]{background:none;color:var(--accent)}
.book-toc summary>a:hover{background:none;color:var(--accent)}
.reader-popover{position:fixed;inset:var(--popover-top,80px) auto auto var(--popover-left,16px);margin:0;width:320px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 48px);padding:0;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--fg);box-shadow:0 20px 80px rgb(0 0 0 / .25);overflow:auto;overscroll-behavior:contain}
.reader-popover-header{display:flex;gap:16px;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--surface);z-index:1}
.reader-popover-title{font-size:14px;font-weight:500;line-height:1.6}.reader-popover-close{flex-shrink:0;font-size:12px}
.reader-popover-zoom{margin-left:auto;flex-shrink:0;font-size:12px;white-space:nowrap}.reader-popover-zoom[hidden]{display:none}
.reader-popover-body{padding:18px;font-size:14px;line-height:1.85;overflow:auto;white-space:pre-wrap}
.reader-popover--wide{inset:24px 0 auto;margin:0 auto;width:min(1100px,calc(100vw - 48px));max-width:calc(100vw - 48px)}
.reader-popover--wide .reader-popover-body{white-space:normal;max-height:calc(100dvh - 125px);padding:16px}
.reader-popover img{display:block;max-width:100%;max-height:calc(100dvh - 170px);width:auto;height:auto;object-fit:contain;background:#fff;cursor:zoom-in;margin:0 auto}
.reader-popover img[data-zoom="actual"]{max-width:none;max-height:none;width:auto;cursor:zoom-out}
@media(max-width:600px){
  .bar{gap:10px;padding-inline:12px}.bar nav{gap:0}.bar nav a{padding:5px 9px;font-size:13px}.logo{font-size:13px;gap:4px;white-space:nowrap}.theme-toggle{flex-shrink:0;width:28px;height:30px}.bar .logo i{display:none}
  .view-books{padding:24px 22px calc(100px + env(safe-area-inset-bottom))}
  .book-home{padding-top:26px}.book-home h1{font-size:28px;margin-bottom:32px}
  .book-reader-bar{gap:14px;margin-bottom:38px;font-size:11px}.book-reader-bar>button{font-size:12px;padding-left:8px}
  .book-reader{font-size:16px;line-height:1.95}.book-reader h1{font-size:27px}.book-reader-head{margin-bottom:30px}.book-chapter{font-size:12px}
  .book-language h2{font-size:21px}.book-pagination{margin-top:44px}
  .reader-popover{inset:auto 0 0;width:100%;max-width:100%;max-height:85dvh;border-radius:12px 12px 0 0;padding-bottom:env(safe-area-inset-bottom)}
  .reader-popover--wide{inset:12px 0 auto;width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 24px);border-radius:8px}
  .reader-popover-body{padding:14px}.reader-popover-header{padding:12px 14px}
}

/* Shelf: three books as covers */
.book-shelf{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:40px 32px}
.book-card{display:flex;flex-direction:column;gap:16px;text-decoration:none;color:var(--fg)}
.book-cover{position:relative;display:flex;flex-direction:column;aspect-ratio:2/3;max-width:100%;padding:28px 22px 22px 30px;border-radius:4px 10px 10px 4px;overflow:hidden;color:#fff;
  background:linear-gradient(160deg,hsl(var(--hue) 55% 34%),hsl(var(--hue) 50% 14%));box-shadow:0 1px 0 rgb(255 255 255 / .06) inset,0 14px 30px -18px rgb(0 0 0 / .7);transition:transform .2s}
.book-cover::before{content:'';position:absolute;inset:0 auto 0 0;width:10px;background:linear-gradient(90deg,rgb(0 0 0 / .35),rgb(255 255 255 / .08),rgb(0 0 0 / .1))}
.book-card:hover .book-cover{transform:translateY(-3px)}
.book-cover-title{font-size:26px;font-weight:500;line-height:1.35;letter-spacing:-.02em;text-wrap:balance}
.book-cover-en{margin-top:10px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:rgb(255 255 255 / .72)}
.book-cover-by{margin-top:auto;font-size:12px;color:rgb(255 255 255 / .8)}
.book-card-text h2{font-size:17px;font-weight:500;line-height:1.5}
.book-card:hover h2{color:var(--accent)}
.book-card-text p{font-size:13.5px;color:var(--muted);line-height:1.7;margin-top:4px}
.book-card-meta{display:block;margin-top:8px;font-size:12.5px;color:var(--faint)}

/* Book reader, same docs-site frame as the articles (after Starlight): the chapters are a fixed pane
   flush with the left edge, the current chapter's sections a fixed pane on the right, the text centred between.
   Narrow screens drop both panes and keep the 目录 drawer. */
.view-books>:not(.book-layout):not(dialog){max-width:960px;margin-inline:auto}
#app:has(.book-layout) .bar{padding-inline:24px}
main.view-books:has(.book-layout){max-width:none;margin:0;padding:0}
.book-side{position:fixed;top:56px;bottom:0;left:0;z-index:3;width:var(--side-width);overflow-y:auto;overscroll-behavior:contain;padding:16px 12px 40px;
  background:var(--surface);border-right:1px solid var(--line);scrollbar-width:thin}
.book-main{min-width:0;margin-left:var(--side-width);padding:32px 48px 96px}
.book-layout.has-outline .book-main{margin-right:var(--toc-width)}
.book-reading-container>*{max-width:var(--measure);margin-inline:auto}
.book-reader-bar{display:none}
.book-outline{position:fixed;top:56px;bottom:0;right:0;width:var(--toc-width);overflow-y:auto;padding:24px 20px;border-left:1px solid var(--line);scrollbar-width:thin}
.book-side-back{display:block;font-size:12.5px;color:var(--muted);text-decoration:none;padding:4px 10px}
.book-side-back:hover{color:var(--accent)}
.book-side-title{font-size:14px;font-weight:600;padding:6px 10px 10px;line-height:1.5}
.book-side-chapters{list-style:none;padding:0;margin:0}
.book-side-chapter{display:block;font-size:13px;line-height:1.55;color:var(--muted);text-decoration:none;padding:6px 10px;border-radius:4px}
.book-side-chapter:hover{color:var(--fg);background:var(--surface-2)}
.book-side-chapter[aria-current]{color:var(--accent);font-weight:500;background:var(--accent-soft)}
.book-nav-root,.book-nav-children,.book-nav-sections{list-style:none;padding:0;margin:0}
.book-nav-group{margin:10px 0}
.book-nav-group>summary,.book-nav-chapter>summary{display:flex;align-items:baseline;gap:8px;list-style:none;cursor:pointer;padding:9px 10px;font-size:13px;line-height:1.65;color:var(--fg);border-radius:4px}
.book-nav-group>summary{font-weight:600}
.book-nav-group>summary::-webkit-details-marker,.book-nav-chapter>summary::-webkit-details-marker{display:none}
.book-nav-group>summary::before,.book-nav-chapter>summary::before{content:'›';flex:0 0 8px;color:var(--faint);font-weight:400;transform-origin:center;transition:transform .15s}
.book-nav-group[open]>summary::before,.book-nav-chapter[open]>summary::before{transform:rotate(90deg)}
.book-nav-group>summary>span,.book-nav-chapter>summary>span{flex:1;min-width:0}
.book-nav-group>summary>small{font-size:11px;font-weight:400;white-space:nowrap;color:var(--faint)}
.book-nav-group>summary:hover,.book-nav-chapter>summary:hover{background:var(--surface-2)}
.book-nav-group>summary:focus-visible,.book-nav-chapter>summary:focus-visible,.book-side-chapter:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.book-nav-group>.book-nav-children{margin:2px 0 8px 14px;padding-left:8px;border-left:1px solid var(--line)}
.book-toc .book-nav-root{margin:0}.book-toc .book-nav-children{margin:2px 0 8px 12px;padding-left:8px}
.book-toc .book-nav-sections{margin:0 0 10px 18px;border-left:1px solid var(--line)}
.book-toc .book-nav-sections a{padding:7px 10px}
.book-toc .book-nav-chapter{margin:2px 0}
.book-toc .book-nav-chapter>summary{font-weight:400;padding:8px 6px}
.book-toc .book-nav-chapter[data-book-active="true"]>summary{color:var(--accent)}
.book-toc .book-nav-group>summary{color:var(--fg);padding:10px 4px}
.book-outline-title{font-size:12px;color:var(--faint);margin-bottom:8px}
.book-outline ol{list-style:none;padding:0;margin:0;border-left:1px solid var(--line)}
.book-outline a{display:block;font-size:12.5px;line-height:1.55;color:var(--muted);text-decoration:none;padding:5px 10px;margin-left:-1px;border-left:2px solid transparent}
.book-outline a:hover{color:var(--fg)}
.book-outline a[aria-current]{color:var(--accent);border-left-color:var(--accent)}
@media(max-width:1180px){
  .book-outline{display:none}
  .book-layout.has-outline .book-main{margin-right:0}
  .book-reader-bar{display:flex;position:sticky;top:56px;z-index:2;background:var(--bg);padding:12px 0;margin-bottom:28px;border-bottom:1px solid var(--line)}
  .book-reader :is(.book-part,.book-block,.book-part-title,h1){scroll-margin-top:128px}
}
@media(max-width:900px){
  #app:has(.book-layout) .bar{padding-inline:16px}
  main.view-books:has(.book-layout){padding:22px 16px 96px}
  .book-side{display:none}
  .book-main{margin-left:0;padding:0}
  .book-reader-bar{display:flex}
}

/* A chapter page: each section is a subheading */
.book-part{scroll-margin-top:84px}
.book-part+.book-part{margin-top:44px}
.book-part-title{font-size:24px;font-weight:500;line-height:1.5;margin-bottom:24px;scroll-margin-top:84px}
.book-part-title:focus{outline:none}
.book-pagination a{display:grid;gap:4px;max-width:46%}.book-pagination a.next{text-align:right}
.book-pagination small{font-size:12px;color:var(--faint)}.book-pagination span{font-size:14px;color:var(--fg)}
@media(max-width:600px){.book-shelf{grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 16px}.book-cover{padding:18px 14px 14px 20px}.book-cover-title{font-size:19px}.book-part-title{font-size:21px}}
