/* GEO 工具页深色主题（/ai_inclusion/ · /ai_visibility/ · /ai_panorama/）
 * 触发方式：geo-iframe-theme.js 给 <html> 加 .dark（随 vben 后台白天/黑夜切换）。
 * 只覆盖「外壳 UI」；检测报告正文（.av-report / .panorama-report / #reportWrap iframe）保持浅色纸张，
 * 以免影响阅读与 PDF 导出。
 * 注意：本文件须在内页 <style> 之后引入；同分选择器靠后生效，跨分则按下述显式选择器处理
 *      （html.dark button 会压过 button.pri，所以 pri/pur 必须显式重写）。 */

html.dark {
  --bg: #141414;
  --card: #1d1e1f;
  --line: #2e3033;
  --txt: #e5e7eb;
  --sub: #9ca3af;
  --pri: #60a5fa;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --pur: #a78bfa;
  --cyan: #22d3ee;
  color-scheme: dark;
}

html.dark body { background: var(--bg); color: var(--txt); }
html.dark header { background: var(--card); border-bottom-color: var(--line); }

/* 页签 */
html.dark .tabs { background: var(--card); border-bottom-color: var(--line); }
html.dark .tabs button { background: transparent; color: var(--sub); }
html.dark .tabs button:hover { color: var(--pri); }
html.dark .tabs button.on { color: var(--pri); border-bottom-color: var(--pri); }

/* 表单控件 */
html.dark select,
html.dark input[type=text],
html.dark input[type=number],
html.dark textarea { background: #1d1e1f; color: var(--txt); border-color: var(--line); }
html.dark input::placeholder,
html.dark textarea::placeholder { color: #6b7280; }
html.dark button { background: #1d1e1f; color: var(--txt); }
html.dark button:hover { border-color: var(--pri); color: var(--pri); }
html.dark button.pri,
html.dark button.pri:hover { background: var(--pri); border-color: var(--pri); color: #0b1220; }
html.dark button.pur,
html.dark button.pur:hover { background: var(--pur); border-color: var(--pur); color: #0b1220; }

/* 容器 */
html.dark .card { background: var(--card); border-color: var(--line); }
html.dark .qa-item { border-color: var(--line); }
html.dark .chip { background: #242628; border-color: var(--line); }
html.dark .modal { background: rgba(0, 0, 0, .6); }
html.dark .modal .box { background: #1d1e1f; }
html.dark .sys .s { background: #242628; border-color: var(--line); }
html.dark .progress { background: #2a2c2f; }
html.dark #reportWrap { background: #1d1e1f; box-shadow: 0 12px 48px rgba(0, 0, 0, .6); }
html.dark #reportBar { border-bottom-color: var(--line); }
html.dark #mask { background: rgba(0, 0, 0, .6); }
html.dark #toast { background: #e5e7eb; color: #111827; }
html.dark #toast.bad { background: var(--err); color: #111827; }

/* 表格 */
html.dark th { background: #242628; color: var(--sub); }
html.dark th, html.dark td { border-bottom-color: var(--line); }

/* 五项指标卡 / 标签 */
html.dark .metric { background: linear-gradient(180deg, #22252a, #1d1e1f); border-color: var(--line); }
html.dark .metric .tag,
html.dark .lay-tag { background: rgba(99, 102, 241, .22); color: #c7d2fe; }

/* 提示框 */
html.dark .warnbox { color: #fcd34d; background: rgba(217, 119, 6, .14); border-color: rgba(217, 119, 6, .4); }
html.dark .tipbox { color: #93c5fd; background: rgba(37, 99, 235, .16); border-color: rgba(37, 99, 235, .4); }
html.dark .errbox { color: #fca5a5; background: rgba(220, 38, 38, .14); border-color: rgba(220, 38, 38, .4); }
html.dark .quotabox { color: #5eead4; background: rgba(13, 148, 136, .16); border-color: rgba(13, 148, 136, .4); }

/* 状态 / 等级徽标 */
html.dark .b-ok { background: rgba(22, 163, 74, .2); color: #4ade80; }
html.dark .b-run { background: rgba(37, 99, 235, .22); color: #93c5fd; }
html.dark .b-fail { background: rgba(220, 38, 38, .2); color: #fca5a5; }
html.dark .b-pend { background: #2a2c2f; color: var(--sub); }
html.dark .b-warn { background: rgba(217, 119, 6, .22); color: #fcd34d; }
html.dark .b-pur { background: rgba(124, 58, 237, .22); color: #c4b5fd; }
html.dark .g-S { background: rgba(22, 163, 74, .2); color: #4ade80; }
html.dark .g-A { background: rgba(37, 99, 235, .22); color: #93c5fd; }
html.dark .g-B { background: rgba(99, 102, 241, .22); color: #a5b4fc; }
html.dark .g-C { background: rgba(217, 119, 6, .22); color: #fcd34d; }
html.dark .g-D { background: rgba(220, 38, 38, .2); color: #fca5a5; }
html.dark .g-none { background: #2a2c2f; color: var(--sub); }

/* 检测报告正文：白纸 + 深字，内层变量也一并复位，避免 var(--txt) 变浅色导致白底白字 */
html.dark #reportBox .av-report {
  --bg: #fff; --card: #fff; --line: #e5e9f0; --txt: #1f2937; --sub: #6b7280;
  background: #fff; color: #1f2937; border-color: #e5e9f0;
}
html.dark #reportBox .av-report .av-adv { background: #fff; border-color: #e5e9f0; }

/* ---- /geo/ 设置页专有 ---- */
html.dark .badge { background: rgba(37, 99, 235, .18); color: #93c5fd; }
html.dark .badge.b2 { background: rgba(22, 163, 74, .18); color: #4ade80; }
html.dark .item { border-color: var(--line); }
html.dark .sw i { background: #3a3d40; }
html.dark .sw i:before { background: #e5e7eb; }
html.dark #modal { background: #1d1e1f; }
html.dark .hint { background: rgba(217, 119, 6, .14); border-color: rgba(217, 119, 6, .4); color: #fcd34d; }
html.dark .faqrow, html.dark .tpl-sec { background: #202124; }
html.dark .tplrow { background: #1d1e1f; }
html.dark .geo-we,
html.dark .geo-we .w-e-toolbar,
html.dark .geo-we .w-e-bar,
html.dark .geo-we .w-e-text-container { background: #1d1e1f; color: var(--txt); }
html.dark .geo-we .w-e-text-container [data-slate-editor] { color: var(--txt); }
html.dark .geo-we .w-e-bar-item button:hover { background: #2a2c2f; }
html.dark #ogPreview,
html.dark #llmsPreview,
html.dark #robotsPreview { background: #202124 !important; color: var(--txt) !important; border-color: var(--line) !important; }
html.dark #ctPoiMode { background: #1d1e1f !important; color: var(--txt); border-color: var(--line) !important; }

/* ---- /audit/ 专有 ---- */
html.dark .tab { background: #1d1e1f; color: var(--sub); }
html.dark .tab.on { background: rgba(37, 99, 235, .16); border-color: var(--pri); color: var(--pri); }

/* ---- /geo_check/ 企业GEO一键检测 专有（v121 深色修复） ----
 * 现场问题：整改方案页 .plan-item 硬编码 background:#fff，深色下白底+浅字不可读。
 * 注意：上面 /geo/ 段的 html.dark .badge 与 html.dark .g-S 等同特异性(0,2,1)，
 *      源序靠后者胜 ⇒ 徽标被误刷成蓝色；这里用 .badge.g-X(0,3,1) 抬回正确配色。 */
html.dark .plan-item { background: #1d1e1f; border-color: var(--line); }
html.dark .plan-item .pdesc { color: var(--txt); }
html.dark .plan-item .pmeta,
html.dark .plan-item .kv { color: var(--sub); }
html.dark .plan-item .kv b { color: var(--txt); }
html.dark .jmp { background: rgba(37, 99, 235, .18); border-color: rgba(96, 165, 250, .45); color: #93c5fd; }
html.dark .jmp:hover { background: rgba(37, 99, 235, .32); }
html.dark .jmp.out { background: rgba(217, 119, 6, .16); border-color: rgba(251, 191, 36, .45); color: #fcd34d; }
html.dark .jmp.out:hover { background: rgba(217, 119, 6, .3); }
html.dark .stagebar .stage { background: #242628; border-color: var(--line); color: var(--sub); }
html.dark .stagebar .stage.on { background: rgba(37, 99, 235, .16); border-color: rgba(96, 165, 250, .55); color: #93c5fd; }
html.dark .stagebar .stage.done { background: rgba(22, 163, 74, .14); border-color: rgba(52, 211, 153, .5); color: #4ade80; }
html.dark .stagebar .stage .dot { background: #3a3d40; }
html.dark .modrow { background: #202124; border-color: var(--line); }
html.dark .modrow .mscore .bar { background: #2a2c2f; }
html.dark .sysbox .s { background: #242628; border-color: var(--line); }
html.dark .phase { border-left-color: var(--pri); }
/* 优先级徽标（.p-P0/.p-P1/.p-P2 无 .badge 前缀时也要盖过通用 .badge 规则） */
html.dark .p-P0, html.dark .badge.p-P0 { background: rgba(220, 38, 38, .2); color: #fca5a5; }
html.dark .p-P1, html.dark .badge.p-P1 { background: rgba(217, 119, 6, .22); color: #fcd34d; }
html.dark .p-P2, html.dark .badge.p-P2 { background: #2a2c2f; color: var(--sub); }
/* 等级徽标：修正被 html.dark .badge 源序覆盖的问题（geo_check / ai_panorama 共用） */
html.dark .badge.g-S { background: rgba(22, 163, 74, .2); color: #4ade80; }
html.dark .badge.g-A { background: rgba(37, 99, 235, .22); color: #93c5fd; }
html.dark .badge.g-B { background: rgba(99, 102, 241, .22); color: #a5b4fc; }
html.dark .badge.g-C { background: rgba(217, 119, 6, .22); color: #fcd34d; }
html.dark .badge.g-D { background: rgba(220, 38, 38, .2); color: #fca5a5; }
html.dark .badge.g-none { background: #2a2c2f; color: var(--sub); }
/* 检测中错误条：内联浅色样式，深色必须 !important 压过 */
html.dark #runErr {
  background: rgba(220, 38, 38, .14) !important;
  border-color: rgba(220, 38, 38, .4) !important;
  color: #fca5a5 !important;
}
