/* ============================================================
   通玄 TONGXUAN · 全站打印样式 print.css（2026-08-05 新建）

   为什么独立成表、且以 media="print" **最后**链入：
   每页的加载顺序都是 base.css → 页面表 → theme-xiu.css，写进 base.css 就会输掉
   每一场同权重之争，被迫满篇 !important；而 media="print" 不阻塞屏幕渲染。

   本表解决的四件事（前三件此前全站皆无）：
   ① **.reveal 打印成白纸** —— 全站最大的打印缺陷。base.css 的 .reveal 初始 opacity:0，
      靠 IntersectionObserver 加 .in 点亮；而打印不滚动，**首屏以下的块从未被点亮**，
      于是六爻页 13 个 .reveal 块、奇门 8 个，整片印成空白纸。
   ② 站点外壳（导航/抽屉/浮标/吸顶快导/浮层）上纸——读者要的是盘面，不是按钮。
   ③ 深墨底转纸底。附带一类隐形字：.page-hero-title 那种 background-clip:text +
      -webkit-text-fill-color:transparent 的渐变标题，打印时**整行看不见**，必须显式还原。
   ④ 五行色/四化色是**语义**不是装饰，不能被浏览器省墨模式抹掉 → print-color-adjust: exact。

   @page 从 report.css 迁来（保持全仓唯一，可被 G11 守卫）。
   ============================================================ */

@page {
  size: A4;
  margin: 16mm 14mm 18mm;
  /* 页脚页码：Chromium ≥131 支持 @page 边距盒，Firefox/Safari 无害忽略（无页码而已）。
     字体用字面栈——边距盒内 var() 求值不保证；颜色同报告纸面辅金。 */
  @bottom-center {
    content: "第 " counter(page) " 页 · 共 " counter(pages) " 页";
    font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
    font-size: 9pt;
    color: #8a6a2a;
  }
}

/* ---------- ① 入场动效基态强制可见：不点亮就是白纸 ---------- */
.reveal,
.reveal.in {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
/* 一切入场动画就地停在终态（backwards 的 fill 在打印时同样会让首帧留白） */
*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* 靠动画显形的正文：本表上面把 animation 全停了，基态 opacity:0 的元素就再也不会亮，
   与 .reveal 同一类病，只是藏法不同（.reveal 靠 JS 加类，这些靠动画 fill）。
   名单由 G11f 按源码实时核对——新写的「基态透明 + 动画显形」会被抓出来。 */
.ty-in,
.hc-core {
  opacity: 1 !important;
  transform: none !important;
}

/* ---------- ② 站点外壳不上纸 ---------- */
.site-nav,
.nav-drawer,
.nav-burger,
.nav-cta,
.site-footer,
.qnav-fab,
.qnav-veil,
.qnav-pop,
.home-entry,
.csl-veil,
.csl-modal,
/* 三检 B1 补漏（2026-08-19 全量盘点）：曾漏网的 fixed/sticky 九件——
   弹层/罩（开着打印会印成整页遮罩）、吸顶件（逐页重复盖字）、离屏台面 */
.arch-modal,
.hx-pop,
.pr-qr-mask,
.tx-geo-dropdown,
.hp-plea,
.zw-shot-stage,
.zxc-nav,
.reader-toc,
.me-tabs,
.tx-toast,
.tx-tip,
.ty-tip,
.rite-disc,
.bzc-nav,
.zwc-nav,
.qmc-nav,
.lyc-nav,
.lrc-nav,
.qzc-nav,
.ty-nav,
.btn-cast,
.form-actions,
.rp-bar,
.rp-toc,
.rp-actions,
.rp-return,
.rp-live,
.rp-cursor,
.rp-demo,
/* 就卷追问整块（2026-08-21 八卷 PDF 导出实证）：此前只列了子件 .rp-ask-form/.rp-ask-err，
   漏了容器 .rp-ask —— 每份用户存下来的 PDF 末页都印着「就 卷 追 问 / 追问每问 10 积分 ·
   余额 20000」，把交互提示与账户余额落到了纸上。子件保留在名单里无害，也更看得出意图。 */
.rp-ask,
.rp-ask-form,
.rp-error,
.rp-ask-err,
.rp-lens,
/* 皮肤切换扫场、北斗开幕与主题幕布的全屏罩（theme-xiu.css 里全部 position:fixed inset:0）——
   屏幕上一闪而过，纸上会印成一整页遮罩。类名逐个照源码核对过：
   .op-veil/.op-stage 是**不存在的**（我先前凭印象写错），真正的容器是 .astral-opening。 */
.xiu-sweep,
.astral-sweep,
.astral-opening,
.theme-veil,
.skin-switch,
/* 开幕罩内的北斗与字幕：CSS 里写成了不带容器前缀的独立规则，
   光隐容器不足以让守卫确认它们安全，索性一并具名（也更看得出意图）。 */
.op-dipper,
.op-line,
.op-star,
.op-cap,
.op-hint {
  display: none !important;
}

/* ---------- ③ 深墨底转纸底 ---------- */
html,
body {
  background: #fff !important;
  color: #1c1a16 !important;
}
.page-hero,
.hero,
.paper-section,
.section,
.container {
  background: transparent !important;
  box-shadow: none !important;
}
/* 渐变字：屏幕上靠 background-clip:text + -webkit-text-fill-color:transparent 上色，
   **打印时整个字是隐形的**。全站 30 个这类选择器逐个还原成实色。
   别小看这条：.pillar-gan 是四柱盘的天干大字、.dayun-gz 是当前大运干支、
   .qm-door 是奇门八门、.ly-gua-name 是卦名 —— 都是盘面正文，
   漏掉就等于把命盘最关键的那几个字从纸上抹掉，而屏幕上一切正常。
   （名单由 test/css-guard.test.mjs 的 G11e 按源码实时核对，新增渐变字会被抓出来。） */
.bazi-hero-title,
.dayun-chip.current .dayun-gz,
.engine-creed-cn,
.footer-brand .logo-zh,
.hero-title,
.hp-gauge-score,
.lr-chuan-zhi,
.lr-ke-top,
.ly-gua-name,
.ly-hero-title,
.nav-drawer .nav-flag,
.nav-links .nav-flag,
.nav-logo .logo-zh,
.op-cap,
.page-hero-title,
.pillar-gan,
.pwa-title em,
.qm-door,
.qz-mingdu-value,
/* ⚠ G11e/G11g 互锁：`.ss-hero-title` 只存在于尚未入库的 assets/css/sansheng.css。
   两半必须同批入库——谁先进来谁带上另一半，否则 G11g「空选择器」闸必红。
   三生合盘落地时，把这一行连同 sansheng.css 一并加回来。 */
.qzc-limit-chip.is-now .qzc-limit-palace,
.rashi-center-title,
.rp-bar-title b,
.skin-char,
.stat-num,
.sweep-emblem .emblem-text,
.text-gold,
.today-num,
.ty-title,
.wsp-title,
[style*="-webkit-text-fill-color"] {
  -webkit-text-fill-color: currentColor !important;
  background: none !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  color: #1c1a16 !important;
}

/* ---------- ④ 语义色不许被省墨抹掉 ---------- */
* {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* ---------- 征象快照：屏幕上折叠，纸上要展开 ----------
   ⚠ 折叠的 <details> **撬不开靠 `details > *:not(summary){display:…}`**：浏览器不是用
   display 藏内容的，而是给内部 slot 加 content-visibility。实测那条写法完全无效
   （打印样式下 details 高度仍只有摘要行 28px），得走 ::details-content。
   不支持该伪元素的浏览器由 common.js 的 beforeprint 回退（临时置 open，打印后还原）。 */
details { display: block !important; }
details > summary { list-style: none; }
details::details-content {
  content-visibility: visible !important;
  block-size: auto !important;
  height: auto !important;
}
.xj-snapshot-body,
.xj-snapshot-text {
  max-height: none !important;
  overflow: visible !important;
}

/* ---------- 分页纪律 ---------- */
h1, h2, h3, h4, h5, h6,
.bzc-panel-title,
.zwc-panel-title,
.rp-h4, .rp-h5 {
  break-after: avoid-page;
  break-inside: avoid;
}
table, figure, blockquote,
.bzc-panel,
.bzc-pillars,
.zwc-root,
.qmc-root,
.lyc-board,
.lrc-plate-grid,
.hp-chip,
.md-quote {
  break-inside: avoid;
}
thead { display: table-header-group; }
tr, img, svg { break-inside: avoid; }
p, li { orphans: 3; widows: 3; }

/* ---------- 盘面尺寸收进纸面 ---------- */
img, svg, canvas {
  max-width: 100% !important;
  height: auto;
}
/* 屏幕上靠横向滚动看的宽表，纸上要缩到能整幅印下 */
.bzc-root,
.zwc-root,
.qmc-root,
.lyc-root,
.lrc-root,
.qzc-root {
  max-width: none !important;
  overflow: visible !important;
}
[style*="overflow-x"],
.bzc-nav-inner,
.reading-body {
  overflow: visible !important;
  max-height: none !important;
}

/* ---------- 紫微方盘：纸上恒为 4×4 ----------
   A4 页区 ≈688px < 720 断点：不钉死的话**所有人**打印紫微都会印出手机 2 列堆叠盘。
   十二宫方位本身就是语义，堆叠上纸是 bug 不是选项。12 枚区位逐宫钉死。 */
.zw-board {
  grid-template-areas:
    "si   wu     wei    shen"
    "chen center center you"
    "mao  center center xu"
    "yin  chou   zi     hai" !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(4, minmax(108px, auto)) !important;
  grid-auto-rows: auto !important;
  overflow: visible !important;
  box-shadow: none !important;
  break-inside: avoid;
}
.gong-si { grid-area: si !important; }   .gong-wu { grid-area: wu !important; }
.gong-wei { grid-area: wei !important; } .gong-shen { grid-area: shen !important; }
.gong-chen { grid-area: chen !important; } .gong-you { grid-area: you !important; }
.gong-mao { grid-area: mao !important; }  .gong-xu { grid-area: xu !important; }
.gong-yin { grid-area: yin !important; }  .gong-chou { grid-area: chou !important; }
.gong-zi { grid-area: zi !important; }    .gong-hai { grid-area: hai !important; }
.gong-center, .zw-center { grid-area: center !important; grid-column: auto !important; order: 0 !important; }
.zw-lines, .zw-sanfang-bar, .zw-view-toggle, .zw-school { display: none !important; }

/* 链接不印出 URL 尾巴（本站内部链接印出来只是噪声） */
a { text-decoration: none !important; color: inherit !important; }

/* 白话词条（报告页 .rp-gloss）：纸上还原纯文字——虚线是屏幕点按提示，上纸即噪声 */
.rp-gloss { border-bottom: none !important; }
