/* ============================================================
   deck 打印样式 —— 学生 PDF（可打印、可批注）
   reveal 的 ?print-pdf 模式会给 <html> 加 class="print-pdf"。
   核心任务：把 iframe 交互页换成静态占位（spec §10.1）。
   ============================================================ */

/* --- 屏幕/打印内容切换 --- */
.print-pdf .screen-only { display: none !important; }
.print-pdf .print-only  { display: block !important; }

@media print {
  .screen-only { display: none !important; }
  .print-only  { display: block !important; }
}

/* --- 打印占位卡片 --- */
.print-only .c-demo-poster {
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  padding: 0.8em;
  text-align: center;
  background: #f8fafc;
}
.print-only .c-demo-poster img {
  max-width: 100%;
  max-height: 300px;   /* 不能用 vh：打印页与视口不是一个坐标系 */
  border-radius: 6px;
}
.print-only .c-demo-poster .c-demo-hint {
  font-size: 0.78em;
  color: #475569;
  margin: 0.5em 0 0.3em;
}

/* --- 打印时可读性调整 --- */
.print-pdf .reveal .slide-number { color: #94a3b8; }

/* 打印时展开所有折叠内容（证明思路、来源），学生复习需要看到。
   注意：展开动作由 deck-init.js 的 expandAllDetails() 完成，不是靠 CSS。
   浏览器通过 shadow DOM 的 slot 隐藏 <details> 折叠内容，纯 CSS 无法覆盖
   （display:revert !important 也无效）。这里只负责展开后的样式。 */
.print-pdf details,
.print-pdf .c-source { display: block !important; }
.print-pdf details > summary { list-style: none; font-weight: 600; }

/* 打印时给学生留批注空间：正文略收窄 */
.print-pdf .reveal .slides section { padding: 0.4em 0.6em; }

/* 放映导航不进 PDF */
.print-pdf .c-navbar,
.print-pdf .c-rail { display: none !important; }
@media print {
  .c-navbar, .c-rail { display: none !important; }
}


/* 打印时整体再收一档：折叠块被强制展开、占位图替换 iframe，高度普遍比
   屏幕模式高。reveal 的可用高度是 720×(1−2×margin) ≈ 662px，超出即分页。 */
.print-pdf .reveal { font-size: 25px; }
.print-pdf .c-block,
.print-pdf .c-insight,
.print-pdf .c-alert,
.print-pdf .c-theorem,
.print-pdf .c-recap,
.print-pdf .c-hook,
.print-pdf .c-roadmap,
.print-pdf .c-checkpoint,
.print-pdf .c-bridge,
.print-pdf .c-summary { padding: 0.4em 0.7em; margin: 0.45em 0; }
.print-pdf .reveal li { margin-bottom: 0.16em; }

/* 高密度页在打印模式下再收一档（折叠块被强制展开，比屏幕上更高）。 */
.print-pdf .c-dense .c-block,
.print-pdf .c-dense .c-insight,
.print-pdf .c-dense .c-alert,
.print-pdf .c-dense .c-theorem,
.print-pdf .c-dense .c-recap,
.print-pdf .c-dense .c-hook,
.print-pdf .c-dense .c-roadmap,
.print-pdf .c-dense .c-checkpoint,
.print-pdf .c-dense .c-bridge,
.print-pdf .c-dense .c-summary { padding: 0.3em 0.6em; margin: 0.3em 0; }
.print-pdf .c-dense p { margin: 0.28em 0; }
.print-pdf .c-dense li { margin-bottom: 0.08em; }
.print-pdf .c-dense .katex-display { margin: 0.26em 0; }
.print-pdf .reveal h2 { margin-bottom: 0.32em; }
.print-pdf .reveal .katex-display { margin: 0.38em 0; }
.print-pdf details > summary { margin-bottom: 0.2em; }

/* 六条性质页与总结页内容最密，打印时单独再收一档 */
.print-pdf section[data-src="L01-F19"] li,
.print-pdf section[data-src="new:summary"] li { margin-bottom: 0.1em; line-height: 1.45; }
.print-pdf section[data-src="L01-F19"] .katex-display { margin: 0.25em 0; }
.print-pdf section[data-src="L01-F19"] .c-theorem,
.print-pdf section[data-src="new:summary"] .c-block,
.print-pdf section[data-src="new:summary"] .c-alert,
.print-pdf section[data-src="new:summary"] .c-insight { padding: 0.32em 0.6em; margin: 0.32em 0; }

/* NFRA 案例页与六条性质页在打印时仍会溢出，单独再压。
   实测 reveal 的分页阈值比 720×(1−2×margin) 还要低一些，
   与其继续猜阈值，不如按实测结果直接把这两页压到明显安全的高度。 */
.print-pdf section[data-src="L01-F19"] { font-size: 0.9em; }
.print-pdf section[data-src="L01-F19"] .c-theorem { padding: 0.28em 0.55em; }
.print-pdf section[data-src="L01-F19"] .c-insight { padding: 0.28em 0.55em; margin-top: 0.28em; }
.print-pdf section[data-src="new:case"] .c-table { font-size: 0.82em; }
.print-pdf section[data-src="new:case"] .c-source { font-size: 0.55em; margin-top: 0.3em; }
.print-pdf section[data-src="new:case"] .c-block,
.print-pdf section[data-src="new:case"] .c-insight { padding: 0.3em 0.6em; margin: 0.3em 0; }
