/* handout.css — 紙本講義。畫面上看起來像一張 A4 紙，印出來是乾淨的黑白學習單。 */

.ho-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 16px; }
.ho-toolbar select { font: inherit; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }

.ho-paper {
  /* 紙張一律用淺色，深色模式下也像真的紙 */
  --ink: #111; --muted: #444; --line: #bbb; --card: #fff; --paper: #fff; --brand: #173c93; --brand-soft: #eef2fb;
  width: min(210mm, 100% - 24px); margin: 0 auto 48px; padding: 14mm; background: #fff; color: #111;
  box-shadow: 0 10px 40px -12px rgb(0 0 0 / 35%); border-radius: 4px; font-size: 12pt; line-height: 1.6;
}
.ho-paper h1, .ho-paper h2, .ho-paper h3 { color: #111; }

.ho-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8mm; align-items: start; border-bottom: 2.5pt solid #111; padding-bottom: 4mm; }
.ho-eyebrow { margin: 0; font-size: 10pt; font-weight: 700; letter-spacing: .05em; color: #444; }
.ho-head h1 { font-size: 22pt; margin: 1mm 0 2mm; line-height: 1.25; }
.ho-lead { margin: 0 0 3mm; color: #333; }
.ho-fields { display: flex; flex-wrap: wrap; gap: 4mm 8mm; margin: 0; font-weight: 700; }
.ho-fields i { display: inline-block; width: 28mm; border-bottom: 1pt solid #111; }
.ho-qr { margin: 0; width: 26mm; text-align: center; }
.ho-qr svg { width: 26mm; height: 26mm; display: block; }
.ho-qr figcaption { font-size: 8.5pt; line-height: 1.35; margin-top: 1.5mm; color: #444; }

.ho-sec { margin-top: 6mm; }
.ho-h { display: flex; align-items: center; gap: 2.5mm; font-size: 14.5pt; margin: 0 0 3mm; padding-bottom: 1.5mm; border-bottom: 1pt solid #111; break-after: avoid; }
.ho-num { font-size: 15.5pt; }

.ho-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.5mm; }
.ho-check li { position: relative; padding-left: 7mm; break-inside: avoid; }
.ho-check li::before { content: ""; position: absolute; left: 0; top: .3em; width: 3.6mm; height: 3.6mm; border: 1pt solid #111; border-radius: 1mm; }
.ho-phases { margin: 2.5mm 0 0; font-size: 10.5pt; color: #444; }

.ho-points { margin: 0; padding-left: 6mm; display: grid; gap: 2.5mm; }
.ho-points li { break-inside: avoid; }
.ho-points b { display: block; }
.ho-points span { color: #333; }
.ho-points table, .ho-steps { width: 100%; border-collapse: collapse; margin-top: 2mm; font-size: 10.5pt; }
.ho-points th, .ho-points td, .ho-steps th, .ho-steps td { border: .75pt solid #999; padding: 1.2mm 2mm; text-align: left; vertical-align: top; }
.ho-paper table th { background: #eee !important; color: #111 !important; }
.ho-paper table td { background: none !important; color: #111 !important; }
.ho-points code { font-size: 10pt; }

.ho-terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2mm 6mm; margin: 0; }
.ho-terms div { break-inside: avoid; }
.ho-terms dt { font-weight: 800; }
.ho-terms dd { margin: 0; font-size: 10.5pt; color: #333; }

.ho-block { break-inside: avoid; margin-bottom: 3mm; }
.ho-block h3 { font-size: 12.5pt; margin: 0 0 1.5mm; }
.ho-block p { margin: 0 0 1.5mm; }
.ho-block .card, .ho-paper .card { background: none; box-shadow: none; border: 0; padding: 0; }

.ho-steps tr { break-inside: avoid; }
.ho-steps td:first-child { white-space: nowrap; width: 18mm; }
.ho-steps .ho-note { width: 45mm; background: repeating-linear-gradient(transparent 0 6mm, #ccc 6mm calc(6mm + .5pt)); }

.ho-quiz .print-q { break-inside: avoid; margin-bottom: 2.5mm; }
.ho-quiz ol { list-style: upper-alpha; margin: 1mm 0 0; padding-left: 7mm; }

.ho-teacher-badge { display: inline-block; margin-left: 2mm; padding: .3mm 2mm; border: 1pt solid #111; border-radius: 1mm; font-size: 9pt; }
.ho-quiz li.ho-correct { font-weight: 800; }
.ho-quiz li.ho-correct::after { content: "　✔ 答案"; }
.ho-why { margin: 1mm 0 0; padding-left: 7mm; font-size: 10.5pt; color: #333; }
.ho-toolbar [data-ho-teacher] { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--teacher); }
/* 整本手冊：封面、目錄，每個單元從新的一頁開始 */
.ho-unit + .ho-unit, .ho-cover + .ho-unit { break-before: page; margin-top: 16mm; padding-top: 12mm; border-top: 1px dashed #bbb; }
.ho-cover { position: relative; }
.ho-cover h1 { font-size: 32pt; line-height: 1.2; margin: 4mm 0 5mm; }
.ho-cover h1 small { display: block; font-size: 20pt; font-weight: 700; color: #444; }
.ho-cover .ho-lead { font-size: 13pt; max-width: 32em; }
.ho-cover .ho-fields { margin: 8mm 0 12mm; }
.ho-toc { list-style: none; padding: 0; margin: 0; display: grid; gap: 2.5mm; }
.ho-toc li { display: grid; grid-template-columns: 22mm minmax(0, 1fr); gap: 4mm; align-items: baseline; border-bottom: .75pt dotted #999; padding-bottom: 1.5mm; }
.ho-toc span { font-size: 10pt; color: #555; }
.ho-qr-cover { position: absolute; top: 0; right: 0; }
.ho-gate { text-align: center; padding: 20mm 0; }

@media (max-width: 600px) { .ho-paper { padding: 16px; } .ho-terms { grid-template-columns: 1fr; } .ho-head { grid-template-columns: 1fr; } }

@media print {
  @page { size: A4; margin: 12mm 13mm 14mm; }
  body { background: #fff !important; background-image: none !important; }
  .ho-paper { width: auto; margin: 0; padding: 0; box-shadow: none; border-radius: 0; }
  .ho-toolbar { display: none !important; }
  .ho-unit + .ho-unit, .ho-cover + .ho-unit { margin-top: 0; padding-top: 0; border-top: 0; }
}

/* 部分單元的手冊：封面上要印出來，不能只有螢幕上看得到 */
.ho-partial { margin-top: 10mm; padding: 4mm 5mm; border: 1.2pt solid #b86e0b; border-radius: 3mm; color: #7a5510; font-weight: 700; font-size: 11pt; }
