/* =====================================================================
   报告型文章样式（TIDE 风格设计系统）
   来源：《TIDE论文总结.html》<style> 块（经作用域收紧与 DoIt 隔离改造）
   结构：① #report-root 隔离块（ID 锚定，战胜 DoIt `.single .content *`）
        ② .report 前缀组件样式（与主题无冲突，来源行号见各段注释）
   作用域：#report-root（单篇报告页）/ .report-scope（模块页嵌板）
   ===================================================================== */

/* ---------- ① DoIt 隔离 + 设计变量（TIDE 源 10–35 行，作用域收紧） ---------- */
#report-root, .report-scope, .papers-layout, #report-page {
  --primary: #1a5276;
  --primary-light: #2980b9;
  --accent: #00897b;
  --accent-light: #4db6ac;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #d5d8dc;
  --text: #2c3e50;
  --text-muted: #6c7a89;
  --code-bg: #f4f6f7;
  --highlight: #fef9e7;
  --danger: #c0392b;
  --success: #27ae60;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --max-width: 1080px;
  /* 悬浮高亮：蓝色马卡龙（覆盖 DoIt 默认 --single-link-hover-color: #ef3982 的红色） */
  --hover-blue: #4e9bc9;
  --single-link-hover-color: var(--hover-blue);
}

#report-root, .report-scope {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
}

/* 单篇报告页布局（TIDE 源 60–65 行 main 规则） */
#report-root {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 60px;
  border-radius: var(--radius);
}

/* 通用排版覆盖（ID 锚定：DoIt 编译规则 .single .content p 等特异度 (0,2,1) 必败） */
#report-root p { margin: 0 0 14px; }
#report-root h2, #report-root h3, #report-root h4, #report-root h5, #report-root h6 { margin-top: 0; }
#report-root strong { color: var(--primary); }
#report-root em { color: var(--accent); font-style: normal; font-weight: 600; }
#report-root sub, #report-root sup { font-size: 0.72em; }
#report-root table { display: table; width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 0.88rem; overflow: hidden; border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); }
#report-root code { font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, "Courier New", monospace; font-size: 0.88em; }
#report-root p code, #report-root li code { background: var(--code-bg); color: var(--primary); padding: 2px 6px; border-radius: 3px; border: 1px solid var(--border); }

/* 报告页放宽文章区并随窗口缩放（小窗口收窄、大窗口最高 1080px） */
#report-page { max-width: 1080px; width: auto; }

/* 窄屏：章节内边距收紧、宽表格/演示板在卡片内横向滚动、条形图标签收窄 */
@media (max-width: 640px) {
  #report-root { padding: 20px 12px 40px; }
  .report section { padding: 22px 16px; overflow-x: auto; }
  .report .report-header { padding: 24px 18px; }
  .report .toc { padding: 18px 16px; }
  .report .bar-row .lbl { flex-basis: 110px; }
}

/* 报告页：站点头部让位给常驻固定导航（导航自始至终保持不动，对应 TIDE 原版全宽导航） */
body:has(#report-page) > header { display: none; }
#report-page section[id] { scroll-margin-top: 64px; }

/* ---------- ② 组件样式（TIDE 源 37–58：常驻锚点导航） ---------- */
.report nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  padding: 0 20px;
  overflow-x: auto;
  white-space: nowrap;
}
.report nav .nav-inner {
  display: flex; align-items: center; gap: 4px;
  max-width: var(--max-width); margin: 0 auto;
  padding: 10px 0;
}
.report nav a {
  color: #d6eaf8; text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  padding: 6px 12px; border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.report nav a:hover { background: var(--primary-light); color: #fff; }

/* ---------- 报告头部（TIDE 源 67–98） ---------- */
.report .report-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, var(--accent) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px 36px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}
.report .report-header .tag {
  display: inline-block; background: rgba(255, 255, 255, 0.2);
  color: #e8f6f3; font-size: 0.78rem; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; margin-bottom: 16px;
  letter-spacing: 0.5px;
}
.report .report-header h1 {
  font-size: 1.7rem; line-height: 1.4; margin-bottom: 12px;
  font-weight: 700;
}
.report .report-header h1 .zh {
  display: block; font-size: 1.05rem; font-weight: 500;
  color: #d6eaf8; margin-top: 6px;
}
.report .report-header .meta {
  font-size: 0.9rem; color: #d6eaf8; line-height: 1.7;
}
.report .report-header .meta strong { color: #fff; }
.report .report-header .one-liner {
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 1.05rem; font-style: italic; color: #fefefe;
  margin-bottom: 0;
}

/* ---------- 章节通用白卡片（TIDE 源 100–130） ---------- */
.report section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.report section h2 {
  font-size: 1.35rem; color: var(--primary);
  border-left: 4px solid var(--accent);
  padding-left: 14px;
  margin-bottom: 20px;
  font-weight: 700;
}
.report section h3 {
  font-size: 1.08rem; color: var(--primary-light);
  margin: 24px 0 12px;
  font-weight: 600;
}
.report section h4 {
  font-size: 0.98rem; color: var(--text);
  margin: 16px 0 8px; font-weight: 600;
}
.report section p { margin-bottom: 14px; }
.report section ul, .report section ol { margin: 0 0 16px 22px; }
.report section li { margin-bottom: 6px; }
.report section strong { color: var(--primary); }
.report section em { color: var(--accent); font-style: normal; font-weight: 600; }

/* ---------- 代码与术语（TIDE 源 133–153；p code/li code 已入隔离块） ---------- */
.report code, .report .mono {
  font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 0.88em;
}
.report .term {
  background: var(--highlight); padding: 1px 4px;
  border-radius: 3px; font-weight: 600; color: var(--text);
  border-bottom: 2px solid var(--accent-light);
}
.report .formula {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin: 12px 0;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 0.88rem; color: var(--primary);
  overflow-x: auto; line-height: 1.9;
}

/* ---------- 表格（TIDE 源 155–179，基础三件套已入隔离块） ---------- */
.report thead { background: var(--primary); color: #fff; }
.report th {
  padding: 10px 12px; text-align: left;
  font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.3px;
}
.report td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.report tbody tr:nth-child(even) { background: #f8f9fb; }
.report tbody tr:hover { background: #eaf2f8; }
.report td strong { color: var(--primary); }
.report td.hl { background: #eafaf1; font-weight: 700; color: var(--accent); }
.report td .ok { color: var(--success); font-weight: 700; }
.report td .no { color: var(--danger); font-weight: 700; }
.report .tbl-cap { font-size: 0.8rem; color: var(--text-muted); margin: -14px 0 20px; }

/* ---------- 指标卡片（TIDE 源 181–209） ---------- */
.report .metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.report .metric-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.report .metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.report .metric-card .value {
  font-size: 1.6rem; font-weight: 700;
  color: var(--primary); line-height: 1.2;
  font-family: "Cascadia Code", Consolas, monospace;
}
.report .metric-card .label {
  font-size: 0.82rem; color: var(--text-muted);
  margin-top: 6px; line-height: 1.4;
}

/* ---------- 对比框（TIDE 源 211–232） ---------- */
.report .compare-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.report .compare-box .col {
  border-radius: var(--radius); padding: 18px 22px;
  border: 1px solid var(--border);
}
.report .compare-box .col h4 {
  margin: 0 0 10px; font-size: 0.95rem;
  padding-bottom: 8px; border-bottom: 2px solid;
}
.report .compare-box .stock { border-top: 4px solid var(--danger); }
.report .compare-box .stock h4 { color: var(--danger); border-color: var(--danger); }
.report .compare-box .tide { border-top: 4px solid var(--success); }
.report .compare-box .tide h4 { color: var(--success); border-color: var(--success); }
@media (max-width: 600px) {
  .report .compare-box { grid-template-columns: 1fr; }
}

/* ---------- 引用框（TIDE 源 234–246） ---------- */
.report .callout {
  background: var(--highlight);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.95rem;
}
.report .callout .callout-title {
  font-weight: 700; color: var(--primary);
  margin-bottom: 6px; font-size: 0.9rem;
}

/* ---------- 优劣势分析（TIDE 源 248–272） ---------- */
.report .pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px; margin: 20px 0;
}
.report .pros-cons .col {
  border-radius: var(--radius); padding: 18px 22px;
}
.report .pros-cons .pros {
  background: #f0faf4;
  border: 1px solid #abebc6;
}
.report .pros-cons .cons {
  background: #fdf4f3;
  border: 1px solid #f5b7b1;
}
.report .pros-cons .col h4 {
  margin: 0 0 10px; font-size: 0.95rem;
}
.report .pros-cons .pros h4 { color: var(--success); }
.report .pros-cons .cons h4 { color: var(--danger); }
@media (max-width: 600px) {
  .report .pros-cons { grid-template-columns: 1fr; }
}

/* ---------- 流程示意（TIDE 源 274–287） ---------- */
.report .flow {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px;
  margin: 16px 0;
}
.report .flow .step {
  flex: 1 1 170px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 12px; font-size: 0.82rem; line-height: 1.55;
}
.report .flow .step b { display: block; color: var(--accent); font-size: 0.85rem; margin-bottom: 3px; }
.report .flow .arrow { align-self: center; color: var(--accent); font-weight: 700; font-size: 1.1rem; flex: 0 0 auto; }

/* ---------- 条形图（TIDE 源 289–296） ---------- */
.report .bars { margin: 12px 0; }
.report .bar-row { display: flex; align-items: center; margin-bottom: 7px; font-size: 0.85rem; }
.report .bar-row .lbl { flex: 0 0 180px; color: var(--text-muted); }
.report .bar-row .track { position: relative; flex: 1; height: 18px; background: #eef2f6; border-radius: 4px; overflow: hidden; }
.report .bar-row .fill { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; }
.report .bar-row b { flex: 0 0 52px; text-align: right; font-size: 0.83rem; color: var(--primary); }
.report .bar-row.grouphead { margin-top: 12px; font-weight: 700; color: var(--text); font-size: 0.9rem; }

/* ---------- 动画演示板壳（TIDE 源 298–341；论文专属尺寸进 report-<slug>.css） ---------- */
.report .board {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin: 16px 0; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.report .board .bhead {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--code-bg);
}
.report .board .bhead b { color: var(--primary); font-size: 0.92rem; }
.report .board .badge {
  font-size: 0.78rem; color: var(--primary);
  background: var(--highlight); border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.report .board .stage { position: relative; padding: 14px; overflow-x: auto; }
.report .step-desc { padding: 10px 16px 2px; font-size: 0.88rem; color: var(--text); min-height: 44px; }
.report .step-desc::before { content: "▸ "; color: var(--accent); font-weight: 700; }
.report .legend { font-size: 0.78rem; color: var(--text-muted); padding: 0 16px 8px; }
.report .controls {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--border); background: var(--code-bg);
}
.report .btn {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 6px; padding: 5px 14px; cursor: pointer;
  font-size: 0.85rem; color: var(--text); font-family: inherit;
}
.report .btn:hover { border-color: var(--primary); color: var(--primary); }
.report .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.report .btn.primary:hover { background: #154360; color: #fff; }
.report .btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.report .flyer {
  position: absolute; z-index: 30; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  display: flex; align-items: center; justify-content: center;
}
.report .flyer span { color: #fff; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

/* ---------- 流水线时间轴（TIDE 源 496–509） ---------- */
.report .pipe { margin: 14px 0; }
.report .pipe-row { display: flex; align-items: center; margin-bottom: 10px; }
.report .pipe-lbl { flex: 0 0 96px; font-size: 0.83rem; font-weight: 700; color: var(--primary); }
.report .pipe-track { position: relative; flex: 1; height: 54px; background: #eef2f6; border-radius: 8px; overflow: hidden; }
.report .sp {
  position: absolute; top: 8px; bottom: 8px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: #fff; overflow: hidden; white-space: nowrap;
}
.report .sp-c { background: #2c3e50; } .report .sp-ag { background: #2980b9; } .report .sp-rd { background: #8e44ad; }
.report .sp-net { background: #00897b; } .report .sp-copy { background: #d35400; }
.report .pipe-legend { font-size: 0.8rem; color: var(--text-muted); margin: 6px 0 14px; }
.report .pipe-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin: 0 4px 0 12px; vertical-align: -1px; }

/* ---------- 目录（TIDE 源 511–531） ---------- */
.report .toc {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 30px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.report .toc h3 {
  color: var(--primary); margin-bottom: 14px;
  font-size: 1rem; border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}
.report .toc ol {
  margin-left: 22px; columns: 2; gap: 24px;
}
.report .toc li { margin-bottom: 5px; font-size: 0.88rem; }
.report .toc a { color: var(--primary-light); text-decoration: none; }
.report .toc a:hover { text-decoration: underline; }
@media (max-width: 600px) { .report .toc ol { columns: 1; } }

/* ---------- 页脚（TIDE 源 533–539） ---------- */
.report footer {
  text-align: center; padding: 32px 24px 0;
  color: var(--text-muted); font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ---------- 返回目录链接（报告页顶部，颜色随主题） ---------- */
.report-back { font-size: 0.85rem; margin: 0 0 12px; }