/* 正式报告页（report-page.js，/research/reports/{id}，main > .doc-page.report-doc）的样式：第 4 轮 Part R，规格 23.59–23.68。
   沿用第 1 轮报告版式（formal-theme.css 的 .report-split / .report-actions / .report-section / .report-sources），这里只补正式报告特有的部分：
     页头 —— 宋体标题、说明行里的专题链接、“返回专题”文字链接；报告区在 ≥1101px 贴边（右栏通高，同深度研究报告页签）；
     吸顶工具条改为白纸底色（文档页整页为白纸）；工具条第 2 行的说明（本版证据、较新的 AI 草稿、没有可发布版本）；
     阅读视图 —— 核心节首段为宋体主结论、段距、研究判断标签，图文编排的关键发现编号（没有强度条，编号由本文件给出）与章节段距；
     编辑区 —— 正文编辑框、按钮行、已发布提示与错误提示；右栏来源 —— 沿用第 1 轮来源卡片，只补标题按钮（打开原文）；
     导出面板 —— “打印正文”入口（同 A4 入口的样式），译文组件在面板内去掉外框；对话框（发布、AI 起草、检查引用、放弃修改）；
     读取中的骨架、报告不存在页；打印只留标题、核对声明、正文与“来源与证据”清单；强制配色与 480px 以下的 44px 触控高度。
   颜色只用 var(--ss-*) 令牌（深色主题由令牌切换），不用绿色；不写内联样式。加载顺序在 formal-theme.css 与 pages.css 之后。
   第 4 轮整合：摘要类引用（.is-abs）的虚线框、图文编排章节的隐式行高（min-content）与数值图卡片的底边距已改在共享样式里修正
   （formal-theme.css 与 report-presentation.css，深度研究报告页签同样受益），本文件不再重复这三条。 */

/* ── 页头：宋体标题（≤800 为 24，≤480 为 20），标题行与右侧操作垂直居中 ─────────────── */
.report-doc>.page-head.report-head .page-title-row{align-items:center}
.report-doc>.page-head.report-head .page-title h1{font-family:var(--ss-font-serif);font-size:28px;line-height:1.4;font-weight:700;letter-spacing:0;color:var(--ss-ink)}
.report-doc>.page-head.report-head .page-meta{margin:0;color:var(--ss-muted);font-size:var(--ss-text-sm);line-height:1.6}
/* 说明行里的专题名是链接：正文次级墨色加浅下划线，悬停为声纳青（链接色） */
.report-doc .page-meta .report-meta-topic{color:var(--ss-ink-2);text-decoration:underline;text-decoration-color:var(--ss-line);text-underline-offset:3px}
.report-doc .page-meta .report-meta-topic:hover{color:var(--ss-accent-text);text-decoration-color:currentColor}
/* 种类、保存时间、发布版本各自不断行（专题名允许换行） */
.report-doc .page-meta .report-meta-item{white-space:nowrap}
/* “返回专题”：主色文字链接 + 左向箭头，与 32px 按钮同高 */
.report-doc .report-back{display:inline-flex;align-items:center;gap:4px;min-height:32px;padding:0 6px 0 2px;color:var(--ss-primary-text);font-size:var(--ss-text-sm);line-height:1.5;font-weight:500;text-decoration:none;white-space:nowrap}
.report-doc .report-back:hover{color:var(--ss-accent-text);text-decoration:underline;text-underline-offset:3px}
.report-back-icon{flex:none;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* ── 报告区：≥1101px 左右贴边、上接页头细线、下到页面底部，右栏通高（同 .report-tab 的做法）；以下为单列 ─────────────── */
@media(min-width:1101px){.report-doc>.report-split{margin:-20px calc(-1 * var(--mx)) calc(-1 * var(--my))}}
/* 吸顶工具条：文档页为白纸，工具条底色同纸面（formal-theme 为页面灰底） */
.report-doc .report-split .report-actions{background:var(--ss-surface)}
.report-doc .report-split .report-actions[hidden]{display:none}

/* ── 工具条第 2 行的说明：本版证据、较新的 AI 草稿、没有可发布版本（12px 说明色，按钮为文字按钮） ─────────────── */
.report-doc .report-notes{display:grid;gap:2px;margin:4px 0 2px}
.report-doc .report-notes>p{margin:0;color:var(--ss-muted);font-size:var(--ss-text-xs);line-height:1.7}
.report-doc .report-notes>p[hidden]{display:none}
.report-doc .report-notes button.btn-link{min-height:24px;margin-left:6px;padding:0 2px;font-size:inherit;vertical-align:baseline}
.report-doc .report-notes .report-admin-details{margin-top:4px}

/* ── 阅读视图（章节标签栏由 formal-theme 给出）：核心节首段为宋体主结论，段距 8px；研究判断标签与正文首行对齐 ─────────────── */
.report-doc .report-split .report-body .report-section-body>.answer+.answer{margin-top:8px}
.report-doc .report-split .report-body .report-section-body>.answer.report-lead{font:600 18px/1.65 var(--ss-font-serif);color:var(--ss-ink)}
.report-doc .report-split .report-body .report-section-body>.answer>.ss-tag{margin-right:2px;vertical-align:1px}
.report-doc .report-section-body>.hint{margin:0}
.report-doc .report-reading>.empty{margin:16px 0;color:var(--ss-muted)}
/* 图文编排：概览首段为宋体主结论；关键发现没有强度条，编号由 li 的 finding 计数给出（宋体主色数字，与正文首行同高） */
.report-doc .report-split .report-presentation>.presentation-overview>.answer{font:600 18px/1.65 var(--ss-font-serif);color:var(--ss-ink)}
.report-doc .report-split .presentation-key-findings .presentation-findings>li{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:start}
.report-doc .report-split .presentation-key-findings .presentation-findings>li::before{content:counter(finding);grid-column:1;grid-row:1/span 4;color:var(--ss-primary-text);font:700 var(--ss-text-lg)/26px var(--ss-font-serif);font-variant-numeric:tabular-nums lining-nums}
.report-doc .report-split .presentation-key-findings .presentation-findings>li>:not(.report-para){grid-column:2;min-width:0;margin-left:0}
.report-doc .report-split .presentation-key-findings .presentation-findings>li>.answer+*{margin-top:2px}
/* 图文编排的章节段距同正文 8px；节内的小标题为 h4.report-subhead；图文模块沿用 report-presentation.css 的卡片（同深度研究报告页签） */
.report-doc .report-split .report-presentation>section>.answer+.answer{margin-top:8px}
.report-doc .report-split .report-presentation>section>h4.report-subhead{margin:12px 0 4px}

/* ── 编辑区：正文编辑框（约 60% 视口高）、底栏（说明、错误提示、按钮行：插入原文证据在左，取消与保存新版本在右）、已发布提示 ─────────────── */
.report-doc .report-editor-pane{display:grid;gap:10px;padding:12px 0 24px}
.report-doc .report-editor-pane[hidden]{display:none}
.report-doc .report-editor-pane p{margin:0}
/* 底栏在宽屏吸在视口底部（纸面底色 + 上细线），长正文编辑时“保存新版本”始终可见；窄屏随正文排在编辑框下 */
.report-doc .report-editor-foot{display:grid;gap:6px;min-width:0}
@media(min-width:801px){.report-doc .report-editor-foot{position:sticky;bottom:0;z-index:2;margin:0 0 -24px;padding:10px 0 14px;border-top:1px solid var(--ss-line-2);background:var(--ss-surface)}}
.report-doc textarea.report-editor{display:block;width:100%;min-height:min(60vh,560px);margin:0;padding:12px 14px;border:1px solid var(--ss-line);border-radius:var(--ss-radius-control);background:var(--ss-surface);color:var(--ss-ink);font:15px/1.8 var(--ss-font);resize:vertical}
.report-doc textarea.report-editor:hover{border-color:var(--ss-faint)}
.report-doc textarea.report-editor:disabled{background:var(--ss-surface-2);color:var(--ss-ink-2)}
.report-doc .report-editor-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0}
.report-doc .report-editor-actions>button{min-height:32px;padding:5px 14px;font-size:var(--ss-text-sm)}
.report-doc .report-editor-spacer{flex:1 1 auto}
.report-doc .report-editor-published{padding:6px 12px;border-left:2px solid var(--ss-warn-text);background:var(--ss-warn-softer);color:var(--ss-ink-2);font-size:var(--ss-text-sm);line-height:1.6}
.report-doc .report-editor-note{color:var(--ss-muted);font-size:var(--ss-text-xs)}
.report-doc .report-editor-note:empty,.report-doc .report-editor-alert:empty{display:none}
.report-doc .report-editor-alert{color:var(--ss-danger-text);font-size:var(--ss-text-sm);line-height:1.6}

/* ── 右栏“来源与证据”：条目沿用第 1 轮的来源卡片（workbench.css / formal-theme.css）；这里只补标题按钮——点按在本栏展开原文 ─────────────── */
.report-doc .report-split .report-sources>.report-sources-note{margin:10px 0 0}
.report-doc .report-sources button.source-open{display:block;width:100%;min-height:24px;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:var(--ss-ink);font:inherit;text-align:left;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
.report-doc .report-sources button.source-open:hover{color:var(--ss-accent-text);text-decoration:underline;text-underline-offset:3px}

/* ── 导出面板：第一项“打印正文”（与 A4 入口同为主色细框按钮 + 一行说明，下方细线），译文组件在面板内不再套框 ─────────────── */
.report-exports>.report-print-entry{display:grid;gap:4px;margin:0 0 12px;padding:0 0 12px;border-bottom:1px solid var(--ss-line-2)}
.report-doc .report-split .report-actions .report-print-entry>.report-print-button{justify-self:start;min-height:32px;padding:5px 12px;border:1px solid var(--ss-primary-text);border-radius:var(--ss-radius-control);background:var(--ss-surface);color:var(--ss-primary-text);font-size:var(--ss-text-sm);line-height:1.5;font-weight:600;white-space:normal;text-align:left;box-shadow:none}
.report-doc .report-split .report-actions .report-print-entry>.report-print-button:hover{background:var(--ss-primary-softer)}
.report-print-hint{margin:0;color:var(--ss-muted);font-size:var(--ss-text-xs);line-height:1.6}
.report-doc .report-exports .report-translation{padding:0;border:0;border-radius:0;background:none}

/* ── 对话框（#modal 内）：发布正式报告、AI 起草新版本、检查引用、放弃未保存的修改；确认类对话框收窄到 600px ─────────────── */
#modal:has(> #modal-body > :is(.report-publish,.report-confirm,.report-check)){width:min(600px,calc(100vw - 32px))}
.report-publish,.report-confirm,.report-check{display:grid;gap:12px;min-width:0;color:var(--ss-ink-2);font-size:var(--ss-text-md);line-height:1.7}
.report-publish p,.report-confirm p,.report-check p{margin:0}
.report-publish-target{color:var(--ss-ink);font-weight:600}
.report-publish-notice{padding:6px 12px;border-left:2px solid var(--ss-primary-text);background:var(--ss-primary-softer);font-size:var(--ss-text-sm)}
.report-publish-checks{display:grid;gap:4px;font-size:var(--ss-text-sm)}
.report-publish-check,.report-check-summary{color:var(--ss-ink)}
.report-publish-errors,.report-check-errors{display:grid;gap:2px;margin:0;padding-left:20px;font-size:var(--ss-text-sm)}
.report-publish-body{font-size:var(--ss-text-sm)}
.report-publish-confirm{display:flex;align-items:flex-start;gap:10px;margin:0;color:var(--ss-ink);font-size:var(--ss-text-sm);line-height:1.6;cursor:pointer}
.report-publish-confirm>input{flex:none;width:16px;height:16px;margin:3px 0 0}
.report-publish-alert,.report-confirm-alert{display:grid;gap:4px;color:var(--ss-danger-text);font-size:var(--ss-text-sm)}
.report-publish-alert:empty,.report-confirm-alert:empty{display:none}
.report-publish-actions,.report-confirm-actions{justify-content:flex-end;gap:8px;margin:4px 0 0}

/* ── 读取中的骨架与“报告不存在” ─────────────── */
.report-skeleton-line{display:block;height:12px;margin:10px 0;border-radius:3px;background:var(--ss-line-2)}
.report-skeleton-line.is-title{width:min(520px,70%);height:26px;margin:4px 0 8px}
.report-skeleton-line.is-meta{width:min(320px,50%)}
.report-skeleton-line.is-short{width:60%}
.report-skeleton-body{display:block;max-width:42rem;padding:12px 0}
.report-doc.is-loading>.report-skeleton-body{padding:12px 0 0}
.report-missing-link{color:var(--ss-primary-text);font-size:var(--ss-text-sm);text-decoration:underline;text-underline-offset:3px}
.report-missing-link:hover{color:var(--ss-accent-text)}

/* ── 断点 ─────────────── */
@media(max-width:800px){
  .report-doc>.page-head.report-head .page-title h1{font-size:24px}
}
@media(max-width:480px){
  .report-doc>.page-head.report-head .page-title h1{font-size:20px}
  /* 页头操作一行：“返回专题”按内容宽度，主按钮占其余宽度；均为 44px 触控高度 */
  .report-doc>.page-head.report-head .page-actions>.report-back{flex:0 0 auto;min-height:44px;padding-right:8px}
  .report-doc .report-notes button.btn-link{min-height:32px}
  .report-doc .report-editor-actions>button{min-height:44px}
  .report-doc .report-editor-actions>.report-insert-evidence{flex:1 0 100%}
  .report-doc .report-editor-actions>.report-editor-spacer{display:none}
  .report-doc .report-editor-actions>button:not(.report-insert-evidence){flex:1 1 0}
  .report-doc .report-split .report-actions .report-print-entry>.report-print-button{justify-self:stretch;min-height:44px;text-align:center}
  .report-publish-actions>button,.report-confirm-actions>button{flex:1 1 0;min-height:44px}
  .report-publish-confirm{min-height:44px;align-items:center}
  .report-missing-link{display:inline-flex;align-items:center;min-height:44px}
}

/* ── 强制配色：链接用系统链接色，提示左线与编辑框用前景色，选中的来源卡片用高亮外框 ─────────────── */
@media(forced-colors:active){
  .report-doc .report-back,.report-doc .page-meta .report-meta-topic,.report-missing-link{color:LinkText}
  .report-doc .report-split .report-sources>.evidence-card.selected{outline:2px solid Highlight;outline-offset:-2px}
  .report-doc .report-editor-published,.report-publish-notice{border-left-color:CanvasText}
  .report-doc textarea.report-editor{border-color:CanvasText}
  .report-skeleton-line{background:GrayText}
}

/* ── 打印：只留标题、核对声明、正文与“来源与证据”清单（编号与正文一致，列出标题、类型、日期与来源说明） ─────────────── */
@media print{
  .report-doc>.report-split{margin:0}
  .report-doc>.page-head.report-head{margin:0 0 8px;padding:0 0 8px;border-bottom:1px solid var(--ss-ink)}
  .report-doc>.page-head.report-head .page-actions,.report-doc>.page-head.report-head .page-meta-row,.report-doc>.page-head.report-head .page-title>.ss-tag{display:none}
  .report-doc .report-split .report-actions,.report-doc .report-notes,.report-doc .report-editor-pane,.report-doc .report-split .mobile-evidence{display:none}
  .report-doc .report-reading[hidden]{display:block}
  .report-doc .report-split .report-body{padding:0}
  .report-doc .report-split aside.report-sources{display:block;position:static;max-height:none;overflow:visible;margin:20px 0 0;padding:12px 0 0;border-top:1px solid var(--ss-ink);background:none}
  /* 清单条目沿用屏幕上的排法（标题在前，类型 · 覆盖 · 日期一行，来源说明一行），去掉卡片外框，以细线分隔 */
  .report-doc .report-split aside.report-sources>.evidence-card{padding:6px 0 6px 30px;border:0;border-bottom:1px solid var(--ss-line);border-radius:0;background:none;box-shadow:none;break-inside:avoid}
  .report-doc .report-split aside.report-sources>.evidence-card .source-num{top:7px;left:0}
  .report-doc .report-split aside.report-sources>.evidence-card>.evidence-meta{display:flex;flex-wrap:wrap;gap:0 12px}
  .report-doc .report-split aside.report-sources>.evidence-card>:is(.quote,.actions){display:none}
  .report-doc .report-sources button.source-open{display:inline!important;color:var(--ss-ink)}
}
