/* =====================================================================
   ai-page.css —— AI 智能问答独立页面 + 条文原文弹窗 + 引用链接（V2.3.10 新增）
   ─────────────────────────────────────────────────────────────────────
   为什么独立成文件：本轮改动只在「智能问答」这一块，**不去动 theme-v3/v4/v5**
   那些已经调好的主题层 —— 想回退只需删掉 index.html 里本文件那一行。
   设计口径沿用全局：高对比、1.5px 线性图标、渐变蓝胶囊按钮、禁 emoji。
   暗色由 [data-theme="dark"] 覆盖（复用 theme-tokens 的 CSS 变量）。
   ===================================================================== */

/* ───────────────── ① 独立页面 ───────────────── */

/* 让 #view 放开限宽（与 law-wide / insp-wide 同范式）——这是「表格不用左右拖」的前提：
   抽屉时代容器只有 min(380px,94vw)，7 列表格实测 459px，必然横向溢出。
   ★ padding-bottom 归零：手机端 #view 原本留 76px 给下栏 tabbar，而本页高度是 JS
     按「视口 − 顶栏 − tabbar」精确算出来的 ⇒ 两处都留白就会溢出成外层滚动条。 */
main#view.ai-wide { max-width: none; padding-left: 18px; padding-right: 18px; padding-bottom: 0; }

.ai-page {
  display: flex; flex-direction: column;
  min-height: 340px;                 /* JS 会算出精确高度；这里只是无 JS 时的兜底 */
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow);
}

.ai-page-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; flex: none;
  background: var(--hz-brand-grad);   /* 2026-09-29 M7：原 #2563eb→#06b6d4 第三条渐变，归并品牌渐变 */
  color: #fff;
}
.ai-page-head .aph-t { flex: 1; min-width: 0; }
.ai-page-head h3 { font-size: 15.5px; font-weight: 800; margin: 0; color: #fff; }
.ai-page-head .ai-sub { font-size: 11.5px; opacity: .9; margin-top: 2px; }
.ai-page-head .aph-r { flex: none; display: flex; gap: 8px; }
.ai-page-head .aph-btn {
  background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.28);
  border-radius: 10px; height: 30px; padding: 0 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.ai-page-head .aph-btn:hover { background: rgba(255,255,255,.26); }

/* 复用 styles.css 的 .ai-body（含其暗色规则），只补页面态所需的覆盖 */
.ai-page .ai-body {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 20px 22px; display: flex; flex-direction: column; gap: 14px;
  background: #f7f9fc; overscroll-behavior: contain;
}
.ai-page .ai-input { flex: none; display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.ai-page .ai-input textarea { flex: 1; resize: none; min-height: 46px; max-height: 150px; }
/* 页面态下回答与提问都可以更宽（阅读长文更舒服），但宽表格仍只在自身容器内滚 */
.ai-page .ai-msg .bubble { max-width: min(920px, 100%); }

/* AI 页面打开时隐藏悬浮按钮（#ai-fab 在手机上正好压在输入框上方；
   #top-fab 是「全局回到顶部」，PC 端定位 left:sidebar-w/right:0/margin:auto/bottom:26px
   ⇒ 正好落在本页输入区中央、压住输入框；且本页是 #ai-body 内部滚动，
   全局回到顶部对本页无意义 ⇒ 一并隐藏。来源：目视交付截图 ai_page_pc.png 发现） */
body.ai-page-open #ai-fab,
body.ai-page-open #top-fab,
body.ai-page-open .top-fab { display: none !important; }

/* ───────────────── ② 引用链接（四段式【规范依据】里的可点条文） ───────────────── */

.clause-link {
  color: #1d4ed8; font-weight: 700; cursor: pointer;
  border-bottom: 1.5px dashed #93b4fb; border-radius: 2px;
  text-decoration: none; transition: background .12s, border-color .12s;
  padding: 0 1px;
}
.clause-link:hover { background: #e8efff; border-bottom-color: #1d4ed8; }
.clause-link::after {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 3px;
  vertical-align: -1px; opacity: .7;
  background: no-repeat center/10px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}

/* ───────────────── ③ 引用核验一行（后端确定性比对结果） ───────────────── */

.cite-audit {
  margin-top: 10px; padding: 7px 11px; border-radius: 9px;
  font-size: 11.8px; line-height: 1.6; border: 1px solid;
}
.cite-audit.ok { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.cite-audit.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.cite-audit .ca-tip { opacity: .72; }
.cite-audit .ca-item { font-weight: 700; }

/* ───────────────── ④ 条文原文弹窗 ───────────────── */

#clause-overlay { z-index: 92; }
.clause-modal {
  position: fixed; z-index: 93;
  left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.97);
  /* ═══ ★★ V2.3.10 修（涛哥复发性报障，原话）═══
     「弹窗的页面高度太高，因为个别条文因为内容较长，特别是包含了表格的原文，
       所以整个高度远远超出了网页屏幕视图的大小，以至于用户根本无法将整个弹窗内容
       全部正常阅读，必须强制缩小页面到百分之五十才可以看完全，
       这是之前我经常提到的**弹窗溢出屏幕外的问题，又一次出现了**」

     根因（不是"内容太长"，是**少除了一次 zoom**）：
       桌面端 `body{zoom:1.35}`，而 **`vh`/`vw` 不参与 zoom 换算** ——
       `px` 参与、`vw` 参与，只有 fixed 的 `inset/100%` 会被 Chrome 按「视口/zoom」自动修正。
       于是旧的 `max-height:88vh` ⇒ 视觉高 = 88 × 1.35 = **118.8vh** ⇒ 比视口还高 18.8%，
       flex 居中后上下各切约 9.4vh（截图里正是「从顶部一直伸到屏幕下方之外」）。
       本仓同源先例（同一坑，第 3 次踩）：theme-v5.css L2315 —— V2.2.36 给 #modal-box 的
       `max-height:80vh` 在 zoom 下渲染成 108vh，V2.2.76 才反算修掉。

     ⇒ 口径钉死：**凡"想表达视觉 N vh / N px"的尺寸，一律 calc(N / var(--hz-page-zoom))**。
       高度上限取「视口 − 56px」（上下各留 28px 视觉边距）⇒ 视觉上**永不超过视口**，
       整体仍由 flex 居中；超出部分交由 `.cm-body` 的独立滚动承载（不穿透，见下）。
     ⚠ `var(--hz-page-zoom, 1)` 的兜底值不能省 —— 该变量只定义在
       `@media (min-width:821px)` 里，手机端取不到 ⇒ 无兜底会整条声明失效。 */
  width: min(calc(980px / var(--hz-page-zoom, 1)), calc(94vw / var(--hz-page-zoom, 1)));
  max-height: calc((100vh - 56px) / var(--hz-page-zoom, 1));
  display: none; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
  opacity: 0; transition: opacity .16s ease, transform .16s ease;
  overflow: hidden;
}
/* 移动端浏览器地址栏会伸缩 ⇒ 100vh 是「最大视口高」，用 dvh 才是"当前眼睛看到的"高度 */
@supports (height: 100dvh) {
  .clause-modal { max-height: calc((100dvh - 56px) / var(--hz-page-zoom, 1)); }
}
.clause-modal.show { display: flex; opacity: 1; transform: translate(-50%, -50%) scale(1); }

.clause-modal .cm-head {
  flex: none; display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px 12px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f7f9fc, #fff);
}
.clause-modal .cm-h-tx { flex: 1; min-width: 0; }
.clause-modal .cm-std { font-size: 14.5px; font-weight: 700; color: var(--hz-ink-1); line-height: 1.5; overflow-wrap: anywhere; }
.clause-modal .cm-std .cm-no { font-weight: 600; color: #475569; font-size: 12.5px; margin-left: 4px; }
.clause-modal .cm-std .cm-cno {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 20px;
  background: #e8efff; color: #1d4ed8; font-size: 12px; font-weight: 800; vertical-align: 1px;
}
.clause-modal .cm-std .cm-mand {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 20px;
  background: #fee2e2; color: #b91c1c; font-size: 11.5px; font-weight: 800; vertical-align: 1px;
}
.clause-modal .cm-path { font-size: 11.5px; color: #64748b; margin-top: 4px; }
.clause-modal .cm-x {
  flex: none; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: #475569; font-size: 14px; cursor: pointer; font-family: inherit;
}
.clause-modal .cm-x:hover { background: #eef2f7; }

/* 滚动容器：flex:1 吃掉「弹窗总高 − 头 − 脚」的剩余空间；min-height:0 是 flex 子项
   能被压缩的**必要条件**（缺它则子项按内容撑高，父级的 max-height 会被顶破，
   于是"限高"形同虚设）。overscroll-behavior:contain 保证滚到底后**不把滚动链传给背后页面**
   —— 这就是涛哥要的「不穿透的独立滚动」。 */
.clause-modal .cm-body {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 16px 20px 20px;
}
.clause-modal .cm-block { margin-bottom: 16px; }
.clause-modal .cm-block:last-child { margin-bottom: 0; }
.clause-modal .cm-tag {
  font-size: 11.5px; font-weight: 800; color: #1d4ed8; letter-spacing: .02em;
  padding-left: 9px; border-left: 3px solid #2563eb; margin-bottom: 8px;
}
.clause-modal .cm-tag .cm-src { font-weight: 500; color: #94a3b8; font-size: 11px; margin-left: 6px; }
.clause-modal .cm-text { font-size: 13.8px; line-height: 1.85; color: var(--ink-2, #334155); overflow-wrap: anywhere; }
.clause-modal .cm-text p { margin: 0 0 8px; }
.clause-modal .cm-text p:last-child { margin-bottom: 0; }
.clause-modal .cm-note { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 13px; color: #475569; }
/* 弹窗内的表格：容器足够宽，绝大多数一眼看完；极宽的仍只在自身容器内滚（不撑破弹窗） */
.clause-modal .cm-tbl { overflow-x: auto; }
.clause-modal .cm-tbl table { min-width: 0; }

.clause-modal .cm-loading { padding: 26px 0; text-align: center; font-size: 13px; color: #94a3b8; }
.clause-modal .cm-miss { padding: 22px 4px; }
.clause-modal .cm-miss-t { font-size: 15px; font-weight: 800; color: var(--hz-st-warn); margin-bottom: 8px; }
.clause-modal .cm-miss-s { font-size: 13px; line-height: 1.8; color: #64748b; }

.clause-modal .cm-foot {
  flex: none; display: flex; gap: 10px; justify-content: flex-end;
  padding: 11px 16px; border-top: 1px solid var(--line); background: #fbfcfe;
}
.clause-modal .cm-btn {
  height: 34px; padding: 0 15px; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 700; border: 1px solid var(--line); background: #fff; color: #475569;
}
.clause-modal .cm-btn:hover { background: #eef2f7; }
.clause-modal .cm-btn.primary {
  border: none; color: #fff;
  background: var(--hz-brand-grad);   /* 2026-09-29 M7：原 #2563eb→#06b6d4 第三条渐变，归并品牌渐变 */
  box-shadow: 0 6px 16px rgba(76, 125, 255, .26);   /* M7：投影色随品牌蓝 */
}
.clause-modal .cm-btn.primary:hover { filter: brightness(1.06); }

/* ── 手机端：弹窗近全屏，页面头部瘦身 ── */
@media (max-width: 820px) {
  /* 手机端 zoom=1，但口径与桌面端保持**同一写法**（同一个公式，改 zoom 不用改这里）；
     高度上限同样按「视口 − 边距」算，绝不留「内容长出屏幕」的可能。 */
  .clause-modal {
    width: calc(96vw / var(--hz-page-zoom, 1));
    max-height: calc((100vh - 32px) / var(--hz-page-zoom, 1));
    border-radius: 14px;
  }
  .clause-modal .cm-body { padding: 13px 14px 16px; }
  .clause-modal .cm-text { font-size: 13.4px; }
  .clause-modal .cm-foot { flex-wrap: wrap; }
  .clause-modal .cm-btn { flex: 1; min-width: 120px; }
  main#view.ai-wide { padding-left: 10px; padding-right: 10px; }
  .ai-page { border-radius: 14px; }
  .ai-page-head { padding: 11px 13px; }
  .ai-page-head h3 { font-size: 14.5px; }
  .ai-page .ai-body { padding: 14px 13px; }
  .ai-page .ai-input { padding: 10px 12px; }
}
/* ── 2026-09-29（涛哥反馈）：页头「今日剩余额度」灰字在品牌渐变上看不清 ──
   根因：theme-v5.css 的 `html:not([data-theme="dark"]) .ai-sub{color:#98a2b3}` 命中 #ai-usage，
   而它正挂在渐变页头上。用 **id 选择器** 精准覆盖（id 特异性最高，且不波及其它 .ai-sub 用法）。 */
#ai-usage { color: #fff !important; opacity: 1 !important; text-shadow: 0 1px 2px rgba(0, 0, 0, .22); }

@supports (height: 100dvh) {
  @media (max-width: 820px) {
    .clause-modal { max-height: calc((100dvh - 32px) / var(--hz-page-zoom, 1)); }
  }
}

/* ══ 规范原文表格区（2026-09-30 V2.3.22）═════════════════════════════════════
   问答回复里"还原原文表格样式"的容器：内容由 app-normtable.js 的 renderTable() 生成
   （与规范原文页同一套，含 colspan/rowspan 真合并），此处只负责外框与标题样式。 */
.ai-orig-tables { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--hz-line, #e5e8ef); }
.ai-orig-tables .ai-orig-h { font-size: 12px; font-weight: 700; color: var(--hz-ink-3, #667085); margin-bottom: 8px; letter-spacing: .02em; }
.ai-orig-tables .ai-orig-t { margin-bottom: 14px; overflow-x: auto; }

/* ── V2.3.23：模型抄的平表被**就地换成原文表**后的容器 ─────────────────────
   来历：Markdown 无合并单元格语义 ⇒ 模型抄出来的表必然丢 colspan/rowspan，
   与下方追加的原文表"两张表打架"。现在命中同表的整块替换成 renderTable() 输出，
   容器加 .ai-md-tbl-orig 保留原来的上下间距，视觉上与回答正文仍是一体。 */
.ai-md-tbl-orig { margin: 12px 0 14px; overflow-x: auto; }
.ai-md-tbl-orig .lib-table-cap { color: var(--hz-brand, #3b5bdb); font-weight: 700; }

/* ============================================================================
   v2.3.69 AI 页分屏：左主区 + 右来源（涛哥 2026-10-21 批准，仅此页改造）
   ---------------------------------------------------------------------------
   依据：聊天式界面在结构化任务上 SUS 57 / 图形界面 76（行业实测），
        监管场景要的是「结论 + 出处可点开核对」。故改为答案优先 + 可溯源引用：
        · PC：左主区 + 右侧 252px 来源栏，点卡片直接打开条文弹窗
        · 移动端（≤920px）：来源栏折叠为底部抽屉，收起时只露 46px 标题条
   令牌：密度/动效/引用色全部取 tokens-v2.css，不再硬编码数值。
   ============================================================================ */
.ai-page { flex-direction: row; }
.ai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.ai-src {
  width: var(--hz-src-w, 252px); flex: none; display: flex; flex-direction: column;
  border-left: 1px solid var(--line); background: var(--hz-src-bg, #fafbfc); min-height: 0;
}
.ai-src-h {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none;
}
.ai-src-h:hover { background: #f3f6fb; }
.ai-src-t { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.ai-src-n {
  font-size: 11px; color: #fff; background: var(--hz-brand, #4c7dff); border-radius: 999px;
  min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 6px;
  font-variant-numeric: tabular-nums;
}
.ai-src-caret { margin-left: auto; font-size: 10px; color: var(--ink-4); transition: transform var(--hz-dur, 150ms); }
.ai-src-list {
  flex: 1; min-height: 0; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain;
}
.ai-src-empty {
  font-size: 11.5px; line-height: 1.7; color: var(--ink-4);
  background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: 12px;
}
.ai-src-card {
  background: var(--hz-src-card, #fff); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 10px; cursor: pointer;
  transition: border-color var(--hz-dur-fast, 120ms), background var(--hz-dur-fast, 120ms), transform var(--hz-dur-fast, 120ms);
}
.ai-src-card:hover { border-color: #bfdbfe; background: var(--hz-src-card-on, #f5f9ff); transform: translateY(-1px); }
.ai-src-top { display: flex; align-items: center; gap: 6px; }
.ai-src-i {
  flex: none; width: 16px; height: 16px; border-radius: 4px;
  background: var(--hz-cite-bg, #E6F1FB); color: var(--hz-cite-ink, #185FA5);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.ai-src-std { font-size: 11.5px; font-weight: 600; color: var(--ink-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-src-no { font-size: 11px; color: var(--hz-cite-ink, #185FA5); margin-top: 3px; font-variant-numeric: tabular-nums; }
.ai-src-snip {
  font-size: 10.5px; line-height: 1.55; color: var(--ink-3); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ai-src-act { font-size: 10px; color: var(--ink-4); margin-top: 5px; }
.ai-src-card:hover .ai-src-act { color: var(--hz-brand, #4c7dff); }
.ai-src-foot { flex: none; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-4); }

/* PC：点标题栏收起右栏，把宽度让给阅读 */
.ai-page.src-fold .ai-src { display: none; }

/* 移动端：右栏 → 底部抽屉（收起态露 46px 标题条，点击上拉） */
@media (max-width: 920px) {
  .ai-page { flex-direction: column; position: relative; }
  .ai-main { padding-bottom: 46px; }         /* 给收起条让位，输入框不被压 */
  .ai-src {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; z-index: 20;
    border-left: none; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0;
    max-height: var(--hz-src-sheet-h, 46vh);
    transform: translateY(calc(100% - 46px));
    transition: transform var(--hz-dur, 150ms) var(--hz-ease-out, ease);
    box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, .35);
  }
  .ai-src.open { transform: translateY(0); }
  .ai-src.open .ai-src-caret { transform: rotate(180deg); }
  .ai-page.src-fold .ai-src { display: flex; }   /* 移动端收起靠 translate，不用 display:none */
  .ai-src-foot { display: none; }
}

/* ============================================================================
   v2.3.70 AI 页美术修正（涛哥 2026-10-21 截图逐条反馈）
   ---------------------------------------------------------------------------
   ① 蓝色表头被生硬中断 → 表头提到 .ai-page 最外层，横贯整页（含来源栏上方）
   ② 输入栏与来源栏过渡生硬 → 输入栏底色改成与来源栏同一浅灰，底部形成一条
      「横贯工具带」：左边输入、右边来源脚注，视觉上连成一片
   ③ 来源标题右侧的蓝色小圆点 → 那是计数徽标的空态（min-width:18px + 蓝底），
      `:empty` 时不显示
   ④ 收起来源后找不到入口（真 bug）→ 不再 display:none，改为缩成 30px 竖条，
      只留一个 caret 按钮，点它就能展开
   ============================================================================ */

/* ① 表头横贯 */
.ai-page { flex-direction: column; }
.ai-page-body { flex: 1; min-height: 0; display: flex; }
.ai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }

/* ② 底部工具带：输入栏与来源栏同底色，过渡自然 */
.ai-page .ai-input { background: var(--hz-src-bg, #fafbfc); border-top: 1px solid var(--line); }
.ai-page .ai-src { border-left: 1px solid var(--line); }

/* ③ 空态不显示计数徽标 */
.ai-src-n:empty { display: none; }

/* ④ 收起右栏 → 30px 竖条（保留可点入口） */
.ai-page.src-fold .ai-src { display: flex; width: 30px; }
.ai-page.src-fold .ai-src-h { justify-content: center; padding: 14px 0; border-bottom: none; }
.ai-page.src-fold .ai-src-t,
.ai-page.src-fold .ai-src-n,
.ai-page.src-fold .ai-src-list,
.ai-page.src-fold .ai-src-foot { display: none; }
.ai-page.src-fold .ai-src-caret { margin: 0; font-size: 13px; color: var(--ink-3); transform: rotate(180deg); }
.ai-page.src-fold .ai-src-h:hover { background: #eef2f8; }
.ai-page.src-fold .ai-src-h:hover .ai-src-caret { color: var(--hz-brand, #4c7dff); }

/* 移动端：表头同样横贯；来源仍是底部抽屉（窄条在手机上无意义） */
@media (max-width: 920px) {
  .ai-page { flex-direction: column; }
  .ai-page-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
  .ai-page.src-fold .ai-src { width: auto; }
}

/* ============================================================================
   v2.3.71 手机端三处修正（涛哥 2026-10-21 报障）
   ---------------------------------------------------------------------------
   报障原话：「手机端回答比网页端慢，结论没有展示在回答的最上方；
              回答后用户无法滑动查看下方内容，像是滑动操作被隔离了。」
   根因（已实测，不只是观感）：
     ① JS 侧「后台刷新整块重建 #ai-body 并跳到底部」—— 见 ai.js `_paintMsgs` 注释；
     ② 渲染侧「每 120ms 整篇重渲染」—— 见 ai.js `_mdStream` 注释；
     ③ CSS 侧（本段）：抽屉用 `transform: translateY(calc(100% - 46px))` 收起，
        元素盒子有 104~340px **伸到 .ai-page 外面**（实测 .ai-page scrollHeight 790 > clientHeight 686）。
        这些被 `overflow:hidden` 裁掉的区域在移动端 WebView 上仍可能参与命中测试/滚动链，
        表现为「手指按在正文下半屏滑动没反应」。⇒ 改成**高度动画**，盒子永不越界：
        收起 height:46px（只剩标题条）/ 展开 46vh，内部列表自己滚。
   ============================================================================ */
@media (max-width: 920px) {
  /* ③-1 抽屉改高度动画，盒子严格留在页面内 */
  .ai-page .ai-src {
    transform: none !important;
    height: 46px;                       /* 收起态：只有标题条 */
    max-height: 46vh;
    overflow: hidden;
    transition: height var(--hz-dur, 150ms) var(--hz-ease-out, ease);
    /* 故意**不加** will-change：抽屉一旦被提升为合成层，在微信 X5 / 老 Android WebView 上
       会出现「层内滚动不出层」的粘手现象，正是本次要修的症状，不能再引入。 */
  }
  .ai-page .ai-src.open { height: 46vh; transform: none !important; }
  .ai-page .ai-src-h {
    height: 46px; box-sizing: border-box;
    padding: 0 14px; display: flex; align-items: center;
  }
  .ai-page .ai-src-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  /* ③-2 收起态：抽屉本体不吃触摸（只有标题条可点），不再压住正文下半屏的滑动 */
  .ai-page .ai-src:not(.open) .ai-src-list,
  .ai-page .ai-src:not(.open) .ai-src-foot { pointer-events: none; }

  /* ③-3 桌面端「src-fold 缩成 30px 竖条」在手机上必须让位给抽屉（两者语义不同） */
  .ai-page.src-fold .ai-src { width: auto; height: 46px; display: flex; }
  .ai-page.src-fold .ai-src-h { justify-content: flex-start; padding: 0 14px; border-bottom: 1px solid var(--line); }
  .ai-page.src-fold .ai-src-t { display: inline; }
  .ai-page.src-fold .ai-src-n:not(:empty) { display: inline-block; }
  .ai-page.src-fold .ai-src-list { display: flex; }
  .ai-page.src-fold .ai-src-caret { margin-left: auto; transform: none; font-size: 11px; }
  .ai-page .ai-src.open .ai-src-caret { transform: rotate(180deg); }

  /* ③-4 正文滚动容器：显式声明纵向手势 + iOS 惯性滚动
     （缺这两条时，嵌套在 overflow:hidden 祖先里的滚动容器在 iOS/部分 WebView 上会「粘手」） */
  .ai-page .ai-body {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
}

/* ── v2.3.71 附带：模型自带的 `## 标题` 收成一级小标题（原先前端不认 #，页面上原样吐出井号）──
   与四段式手写标题（【规范依据】/【结论】）保持同一视觉层级：左侧一条品牌色竖条 + 加粗。 */.ai-msg .bubble h4.ai-md-h {
  margin: 12px 0 6px; padding-left: 9px;
  font-size: 13.6px; font-weight: 800; line-height: 1.5;
  color: var(--hz-ink-1, #1f2937);
  border-left: 3px solid var(--hz-brand, #2563eb);
}
.ai-msg .bubble h4.ai-md-h:first-child { margin-top: 0; }
.ai-msg .bubble hr.ai-md-hr {
  border: 0; height: 1px; margin: 12px 0;
  background: var(--hz-line, #e5e8ef);
}


/* ── v2.3.74：无条文号的来源卡（隐患库条目 / 整篇文件）不可点开条文 ──
   来历：这类条目 docId 与 clauseNo 都是空，点开必然弹「知识库未收录该条文」，
   纯误导（涛哥手机端截图里那条就是）。改成不可点 + 明确说明，别让用户白点一次。 */
.ai-src-card.ai-src-card-plain { cursor: default; opacity: .9; }
.ai-src-card.ai-src-card-plain:hover { transform: none; border-color: var(--line); background: #fff; }
.ai-src-card.ai-src-card-plain .ai-src-act { color: var(--ink-4); }

/* ── v2.3.75：条文取数失败的「排查信息」折叠块 ──
   目的：下次手机端再出现异常时，用户截一张图就能看到真实的 docId/clauseNo/HTTP 状态，
   不必再靠猜（本轮就是靠猜才反复）。视觉上刻意低调，不干扰正常阅读。 */
.clause-modal .cm-diag { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
.clause-modal .cm-diag summary { cursor: pointer; color: var(--ink-4); font-weight: 600; outline: none; }
.clause-modal .cm-diag[open] summary { margin-bottom: 6px; }
.clause-modal .cm-diag div { font-family: ui-monospace, Menlo, Consolas, monospace; line-height: 1.7; word-break: break-all; }
