/* 雙版本講義的閱讀頁 /read/<slug>/<id>（改版之八）：只管「外殼」——精簡頂列、載入中／請先登入／請先開通／錯誤，
   以及放講義的舞台。講義本身的樣式在 Shadow DOM 裡（handout-reader.js 用 adoptedStyleSheets 套上），
   這裡的規則碰不到講義，講義的規則也碰不到這裡。
   外殼跟著網站的 ☀ 日夜切換；講義頁面維持淺色（紙本版面），只有講義四周的底色跟著換。
   （外殼的狀態訊息樣式跟重點節錄的 notes.css 一樣，複製一份過來，兩種閱讀頁各自改不會互相影響。） */

body.handout-page { padding: 0; }
body.handout-page .topbar { padding-inline: .3rem; }

/* 講義四周的底色：淺色＝講義原稿螢幕版的淺灰，夜間＝深灰綠（講義頁面本身還是白底） */
.handout-page { --stage-bg: #E8E8ED; }
:root[data-theme="dark"] .handout-page { --stage-bg: #121916; }
.handout-stage { background: var(--stage-bg); padding: 16px 0 40px; min-height: calc(100vh - var(--topbar-h)); overflow-x: clip; }
.handout-stage[hidden] { display: none; }
.handout-host { display: block; width: 100%; }

/* ── 閱讀頁外殼（載入中／請先登入／請先開通／準備中／錯誤）── */
.reader { padding: 2.5rem 1rem; max-width: 880px; }
.reader-state h1 { font-size: 1.3rem; margin: 0 0 .6rem; }
.reader-state p { margin: .4rem 0; }
.reader-state .head-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.reader[hidden], .reader-state[hidden] { display: none; }
.reader-progress { width: min(100%, 24rem); height: .6rem; accent-color: var(--green); }

/* 精簡頂列：書名・版本、切到另一版 ⇄、回書頁 */
.topbar.is-slim .slim-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: .92rem; }
.topbar.is-slim .wrap { gap: .45rem; }
@media (max-width: 719px) { .topbar.is-slim .slim-title { display: none; } }
@media (max-width: 420px) {
  .topbar.is-slim .brand span { display: none; }
  .topbar.is-slim .btn.btn-sm { padding: .2rem .7rem; }
}
