/* ============================================================================
   道古论今 · 研报 / 长文阅读页 暗色层
   ----------------------------------------------------------------------------
   配合 /global/design-tokens.css（令牌 + #gyThemeBtn）与 /global/theme.js（切换）
   一起使用；由 site_server.py 在响应期只注入到 /reports/ 下的 HTML。

   为什么单独一份：研报正文是「历史生成物」（400+ 个 HTML 由自动化产出，
   不可能逐篇改造），且存在两套彼此独立的皮肤——
     A) .action-bar + .report-content   （d-mast 模板，蓝色 #4f6ef7 系，94 篇）
     B) .report-header + .section       （web_style_v5，藏蓝金色系，9 篇）
   把两套模板的暗色规则集中在这里，一次覆盖全部历史页，且对新生成的报告自动生效。

   安全保证：所有规则都以 html.dark 开头 → 浅色态下逐条不匹配，视觉零变化。
   ========================================================================== */

html.dark { color-scheme: dark; }

/* ---- 通用基底 ---- */
html.dark body { background: #0f1826; color: #dde5f0; }
html.dark .report-container { background: #16223a; box-shadow: 0 4px 24px rgba(0, 0, 0, .5); }

/* ==========================================================================
   模板 A：d-mast（.action-bar / .report-content）
   ========================================================================== */

/* 顶栏 */
html.dark .action-bar { background: #0b1522; }
html.dark .action-bar a { color: #9fb0c7; }
html.dark .action-bar a:hover { color: #e6b455; }

/* 标题层级 */
html.dark .report-content .report-date,
html.dark .report-content .meta-row { color: #8194ad; }
html.dark .report-content .meta-row { border-bottom-color: #27364c; }
html.dark .report-content h1 { color: #eef3f9; }
html.dark .report-content h2 { color: #e6ecf2; border-bottom-color: #2f5fd0; }
html.dark .report-content h3 { color: #dbe4ef; }
html.dark .report-content h4 { color: #cbd8e6; }
html.dark .report-content .subtitle { color: #a8b8cb; }

/* 正文 */
html.dark .report-content p,
html.dark .report-content li { color: #c3cfdd; }
html.dark .report-content strong { color: #eef3f9; }

/* 提示框四态 */
html.dark .report-content .highlight-box { background: #17273e; }
html.dark .report-content .highlight-box.warn { background: #2c2413; }
html.dark .report-content .highlight-box.danger { background: #2e1a1c; }
html.dark .report-content .highlight-box.green { background: #132b22; }

/* 表格 */
html.dark .report-content th { background: #0e1c30; }
html.dark .report-content td { border-bottom-color: #27364c; }
html.dark .report-content tr:nth-child(even) td { background: #1a273f; }
html.dark .report-content tr:hover td { background: #20304c; }
html.dark .report-content td.up { color: #ff8a7a; }
html.dark .report-content td.down { color: #4fc47a; }

/* KPI / 标签 / 页脚 */
html.dark .report-content .kpi-card { background: #1a273f; border-color: #27364c; }
html.dark .report-content .kpi-card .kpi-num { color: #8aa4ff; }
html.dark .report-content .kpi-card .kpi-label { color: #8194ad; }
html.dark .report-content .tag { background: #1e2c52; color: #9db2ff; }
html.dark .report-content .tag.hot { background: #33270f; color: #e0a94a; }
html.dark .report-content .footer-note { color: #8194ad; border-top-color: #27364c; }
html.dark .report-content a.stock-link { color: #8aa4ff; border-bottom-color: #3b4c6b; }

/* ==========================================================================
   模板 B：web_style_v5（.report-header / .section）
   注意：这套皮肤用裸标签选择器（p / strong / ul li / table th…），
   因此必须用 html.dark 前缀把它们整体抬亮。
   ========================================================================== */

html.dark .nav-bar { background: #16223a; border-bottom-color: #27364c; }
html.dark .nav-bar a { color: #9fc0e8; }
html.dark .nav-bar .btn-print { background: #2b4a72; color: #fff !important; }

html.dark .section { border-bottom-color: #27364c; }
html.dark .section-title { color: #e6ecf2; }
html.dark .section-title .num { background: #2b4a72; }
html.dark .section-subtitle { color: #cfdcec; }

html.dark p { color: #c3cfdd; }
html.dark strong { color: #eef3f9; }
html.dark ul li,
html.dark ol li { color: #c3cfdd; }

html.dark .summary-card { background: #1a273f; }
html.dark .summary-card .label { color: #8194ad; }
html.dark .summary-card .value { color: #e6ecf2; }
html.dark .thesis-card { background: linear-gradient(135deg, #17273e, #1b2c46); }
html.dark .thesis-card h4 { color: #e6ecf2; }
html.dark .thesis-card p { color: #c3cfdd; }

html.dark .callout { background: #16283d; }
html.dark .callout p { color: #c3cfdd; }
html.dark .callout strong { color: #cfe0f2; }
html.dark .callout-warn { background: #2c2413; }

html.dark .table-wrap { border-color: #27364c; }
html.dark table thead { background: #2b4a72; }
html.dark table td { border-bottom-color: #27364c; }
html.dark table tbody tr:nth-child(even) { background: #1a273f; }
html.dark table tbody tr:hover { background: #20304c; }
html.dark table .highlight { background: #2c2413 !important; }
html.dark .source { color: #8194ad; }

html.dark .kpi-item { background: #1a273f; }
html.dark .kpi-item .label { color: #8194ad; }
html.dark .notice { background: #2c2413; color: #c3cfdd; }
html.dark .notice strong { color: #cfe0f2; }
html.dark .risk-item { border-bottom-color: #27364c; }
html.dark .risk-content h5 { color: #e6ecf2; }
html.dark .risk-content p { color: #c3cfdd; }
html.dark .chart-img { border-color: #27364c; }
html.dark .section-divider { color: #3d4f6b; }
html.dark .highlight-box { background: #2c2413; }
html.dark .highlight-box p { color: #c3cfdd; }
html.dark .conclusion-box { background: #1a273f; border-color: #27364c; }
html.dark .key-takeaway { background: #16283d; }
html.dark .key-takeaway strong { color: #cfe0f2; }
html.dark .key-takeaway p { color: #c3cfdd; }
html.dark .risk-note { background: #1a273f; color: #8194ad; }
html.dark .risk-note strong { color: #cbd8e6; }
html.dark .tag-navy { background: #2b4a72; }
html.dark .disclaimer { background: #0b1a2c; }

/* ==========================================================================
   页面内联样式块（auto-report「站点标准补齐」写入各页 <style>）
   这些类只出现在部分报告里，同样需要暗色映射。
   ========================================================================== */

html.dark .note { background: #2c2413; }
html.dark .alert-box { background: #2e1a1c; }
html.dark .callout-box { background: #132b22; }
html.dark .hook-box { background: linear-gradient(135deg, #241d12, #2c2314); }
html.dark .module-title { color: #e6ecf2; }
html.dark .watch-table th,
html.dark .watch-table td { border-color: #3a4a63; color: #c3cfdd; }
html.dark .watch-table th { background: #2b4a72; }
html.dark .report-content blockquote { background: #1a273f; }
html.dark .kpi-value { color: #ff8a7a; }
html.dark .kpi-label { color: #8194ad; }
html.dark .disclaimer-box { background: #1a273f; color: #9fb0c7; }
html.dark .footer-note,
html.dark .footer-card .footer-text { color: #8194ad; }
html.dark .footer-card { border-top-color: #27364c; }
html.dark img.chart { box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }

/* ==========================================================================
   研报库列表页（/reports/index.html）
   该页自带一套 html.dark 变量体系（--ink/--sub/--card/--chip…），此处只补它
   漏掉的项：正文里的强调红/蓝在小字场景下对比度不足（AA 需 ≥4.5:1）。
   实测：--up(#c0392b) 对暗底仅 2.8:1；--relink(#5C84B8) 约 4.1:1。
   ========================================================================== */
html.dark .kicker { color: #ff8a7a; }
html.dark .rel-card:hover,
html.dark .rel-card,
html.dark .rcard .relink { color: #7fb6f0; }
html.dark .ncard-cmt { background: #2a2616; color: #e6c97a; }

/* 分享弹窗（share.css）：跟随暗色，避免夜间白屏刺眼 */
html.dark .share-modal { background: #16223a; box-shadow: 0 18px 50px rgba(0, 0, 0, .6); }
html.dark .share-title { color: #e6ecf2; }
html.dark .share-sub,
html.dark .qr-box .tip { color: #9fb0c7; }
html.dark .share-close { color: #8194ad; }
html.dark .share-close:hover { color: #e6ecf2; }
html.dark .share-url { color: #8194ad; }
html.dark .qr-box img { border-color: #27364c; }
html.dark .wx-guide p { color: #c3cfdd; }

/* 涨跌强调（部分页面内联 .up/.down 带 !important，这里用更高特异性压过） */
html.dark .up,
html.dark .pos,
html.dark .hl-red { color: #ff8a7a !important; }
html.dark .down,
html.dark .neg { color: #4fc47a !important; }
html.dark .neutral,
html.dark .orange { color: #e0a94a !important; }
html.dark .stock-link { color: #ff9c8c; border-bottom-color: #5c3a34; }

/* ==========================================================================
   暗色下的提示框文字色（阶段3-⑨ 验收时发现，2026-10-03 补）
   ----------------------------------------------------------------------------
   部分报告页在自身 <style> 里给提示框**容器**写了显式 color，例如
   /reports/ai_hardware_timing_strategy.html 的
   `.report-content .highlight-box{ ... color:#1e293b }`。
   而本文件只把它的背景压暗成 #17273e（没有补文字色）→ 深墨蓝字压深底，
   对比度约 1.1:1，整段「核心观点」在暗色下完全看不见。

   为什么必须写在这里：容器的 color 会**继承给裸文本节点**（这些提示框里常是
   「<strong>小标题：</strong>正文…」的混排，正文没有自己的 <p>，所以
   `html.dark p{...}` 管不到）。用 html.dark 前缀 + 容器选择器 (0,3,0) 即可
   压过页面自身的 `.report-content .X` (0,2,0)。

   范围限定为**本文件已经压暗背景**的那些框 → 浅色态零影响，也不会去动
   暗色下仍保持浅底的框（如 .quote-box 仍是米黄底配深琥珀字，本就清晰）。
   ========================================================================== */
html.dark .report-content .highlight-box,
html.dark .report-content .highlight-box.warn,
html.dark .report-content .highlight-box.danger,
html.dark .report-content .highlight-box.green,
html.dark .report-content .note,
html.dark .report-content .alert-box,
html.dark .report-content .callout-box,
html.dark .report-content .hook-box,
html.dark .report-content .callout,
html.dark .report-content .key-takeaway,
html.dark .report-content .conclusion-box,
html.dark .report-content .thesis-card,
html.dark .report-content .summary-card,
html.dark .report-content .kpi-item { color: #c3cfdd; }

html.dark .report-content .highlight-box strong,
html.dark .report-content .note strong,
html.dark .report-content .alert-box strong,
html.dark .report-content .callout-box strong,
html.dark .report-content .hook-box strong,
html.dark .report-content .callout strong,
html.dark .report-content .key-takeaway strong,
html.dark .report-content .conclusion-box strong,
html.dark .report-content .thesis-card strong,
html.dark .report-content .summary-card strong { color: #eef3f9; }

/* --------------------------------------------------------------------------
   浅色态护城河：若页面被改成暗色但用户想要浅色（localStorage='light'），
   theme.js 会移除 html.dark，以上规则逐条失效，页面回到原生皮肤。
   -------------------------------------------------------------------------- */
