/* ═══════════════════════════════════════════════════════════════════════
   ElecSimHub — Configurator 深色主题覆盖（与 Hub 首页配色统一）

   原理：配置器是浅色主题（:root --bg:#f4f6fa / --navy:#0B2545 / 大量内联 #fff），
        这里**只在被 Hub 外壳包住时**（html.hub-shelled）重定义变量 + 覆盖内联样式，
        不改配置器任何逻辑与结构；删掉引用即可完全回滚。
   配色取自 Hub 首页 site.css：bg #0A1220 / bg2 #0B1424 / card #0D1726 /
        primary #FFC933 / blue #5AA0F2 / green #4CD4A0 / red #F0645F
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. 变量重定义（配置器自己的 :root 变量）── */
html.hub-shelled {
  --navy: #0A1220;
  --blue: #5AA0F2;
  --blue-dark: #3E7FBF;
  --gold: #FFC933;
  --gold-hover: #FFD65C;
  --bg: #0A1220;
  --line: rgba(255, 255, 255, .09);
  --text: #EEF3F8;
  --muted: #9CB0C2;
  --ok: #4CD4A0;
  --warn: #FFC933;
  --err: #F0645F;
}

html.hub-shelled body {
  background: #0A1220 !important;
  color: #EEF3F8 !important;
}

/* ── 2. 内联浅色背景 → Hub 深色 ── */
html.hub-shelled [style*="background:#fff"],
html.hub-shelled [style*="background: #fff"],
html.hub-shelled [style*="background:#ffffff"],
html.hub-shelled [style*="background: #ffffff"],
html.hub-shelled [style*="background:white"],
html.hub-shelled [style*="background: white"] {
  background: #0D1726 !important;
}

html.hub-shelled [style*="background:#f8fafc"],
html.hub-shelled [style*="background: #f8fafc"],
html.hub-shelled [style*="background:#f9fafb"] {
  background: #0B1424 !important;
}

html.hub-shelled [style*="background:#eef2f7"],
html.hub-shelled [style*="background:#eff6ff"],
html.hub-shelled [style*="background:#f1f5f9"],
html.hub-shelled [style*="background:#e2e8f0"] {
  background: #122032 !important;
}

html.hub-shelled [style*="background:#0B2545"],
html.hub-shelled [style*="background: #0B2545"] {
  background: #101C30 !important;
}

/* 浅黄/浅绿/浅红提示条 → 对应深色半透明 */
html.hub-shelled [style*="background:#fef3c7"] { background: rgba(255, 201, 51, .10) !important; }
html.hub-shelled [style*="background:#fef2f2"] { background: rgba(240, 100, 95, .10) !important; }
html.hub-shelled [style*="background:#ecfdf5"] { background: rgba(76, 212, 160, .10) !important; }
html.hub-shelled [style*="background:#dbeafe"] { background: rgba(90, 160, 242, .12) !important; }

/* ── 3. 深色文字 → Hub 浅色 ── */
html.hub-shelled [style*="color:#0B2545"],
html.hub-shelled [style*="color:#1f2937"],
html.hub-shelled [style*="color:#1e293b"],
html.hub-shelled [style*="color:#0f172a"],
html.hub-shelled [style*="color:#111827"],
html.hub-shelled [style*="color:#334155"],
html.hub-shelled [style*="color:#1d4ed8"] {
  color: #EEF3F8 !important;
}

html.hub-shelled [style*="color:#64748b"],
html.hub-shelled [style*="color:#475569"],
html.hub-shelled [style*="color:#6b7280"],
html.hub-shelled [style*="color:#94a3b8"],
html.hub-shelled [style*="color:#8A94A2"],
html.hub-shelled [style*="color:#5b6b7f"] {
  color: #9CB0C2 !important;
}

/* 主色文字（原深蓝/深金）→ Hub 主色 */
html.hub-shelled [style*="color:#1565C0"],
html.hub-shelled [style*="color:#0D47A1"] { color: #5AA0F2 !important; }
html.hub-shelled [style*="color:#C4960C"] { color: #FFC933 !important; }

/* ── 4. 边框 / 分隔线 ── */
html.hub-shelled [style*="#e2e8f0"],
html.hub-shelled [style*="#cbd5e1"],
html.hub-shelled [style*="#cbd5e1"] {
  border-color: rgba(255, 255, 255, .12) !important;
}

/* ── 5. 配置器自有类名（面板 / 表格 / KPI / 步骤条）── */
html.hub-shelled .idx3-block,
html.hub-shelled .idx3-adv,
html.hub-shelled .idx3-advbody,
html.hub-shelled .idx3-acc,
html.hub-shelled .idx3-card,
html.hub-shelled .idx3-panel,
html.hub-shelled .idx3-doc,
html.hub-shelled .idx3-field,
html.hub-shelled .idx3-bg-card,
html.hub-shelled .kpi,
html.hub-shelled .rdv-pane,
html.hub-shelled .rdv-tbl,
html.hub-shelled .rdv-tip,
html.hub-shelled .page,
html.hub-shelled .note {
  background: #0D1726 !important;
  color: #EEF3F8 !important;
  border-color: rgba(255, 255, 255, .09) !important;
}

html.hub-shelled .rdv-hd,
html.hub-shelled .sec-title {
  color: #EEF3F8 !important;
}

html.hub-shelled .rdv-k,
html.hub-shelled .rdv-note,
html.hub-shelled .note,
html.hub-shelled .kv {
  color: #9CB0C2 !important;
}

html.hub-shelled table,
html.hub-shelled .bom,
html.hub-shelled .rdv-tbl { color: #EEF3F8 !important; }
html.hub-shelled thead th {
  background: #122032 !important;
  color: #9CB0C2 !important;
  border-color: rgba(255, 255, 255, .10) !important;
}
html.hub-shelled tbody td { border-color: rgba(255, 255, 255, .06) !important; }
html.hub-shelled tbody tr:nth-child(even) { background: rgba(255, 255, 255, .02) !important; }

/* 步骤条 / 芯片 / 徽章 */
html.hub-shelled .idx3-step { background: #0B1424 !important; border-color: rgba(255, 255, 255, .10) !important; color: #9CB0C2 !important; }
html.hub-shelled .idx3-step.on { background: rgba(255, 201, 51, .14) !important; color: #FFC933 !important; border-color: rgba(255, 201, 51, .35) !important; }
html.hub-shelled .idx3-chip { background: #122032 !important; color: #9CB0C2 !important; border-color: rgba(255, 255, 255, .10) !important; }
html.hub-shelled .idx3-chip.on { background: rgba(255, 201, 51, .14) !important; color: #FFC933 !important; }
html.hub-shelled .idx3-badge { background: #122032 !important; color: #9CB0C2 !important; }

/* 输入控件 */
html.hub-shelled input,
html.hub-shelled select,
html.hub-shelled textarea {
  background: #101C30 !important;
  color: #EEF3F8 !important;
  border-color: rgba(255, 255, 255, .14) !important;
}
html.hub-shelled option { background: #101C30 !important; color: #EEF3F8 !important; }

/* 主按钮：原深蓝/深金 → Hub 金黄（深色字） */
html.hub-shelled .idx3-next,
html.hub-shelled .idx3-autobtn,
html.hub-shelled .idx3-bg-btn {
  background: #FFC933 !important;
  color: #0A1220 !important;
  border-color: #FFC933 !important;
}

/* 图纸 / SVG 容器：浅底图纸保持浅色（工程图纸习惯白底），只加深外框 */
html.hub-shelled .rdv-svg,
html.hub-shelled [style*="background:#fff"] svg {
  background: #FFFFFF !important;
}

/* 滚动条 */


/* ═══ 按配置器自身样式表自动补全（浅底 → Hub 深色，含近白 #fbfdff 系列）═══ */
html.hub-shelled #cfg-ux-presetbar button.preset,
html.hub-shelled #cfg-ux-presetbar button.reset,
html.hub-shelled .idx3-adv,
html.hub-shelled .idx3-bg-card,
html.hub-shelled .idx3-bg-img,
html.hub-shelled .idx3-block { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled .idx3-btoggle,
html.hub-shelled .idx3-btoggle .cb,
html.hub-shelled .idx3-btoggle.na,
html.hub-shelled .idx3-cat,
html.hub-shelled .idx3-chip,
html.hub-shelled .idx3-fixbtn { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled .idx3-flow-panel,
html.hub-shelled .idx3-geoitem,
html.hub-shelled .idx3-gtools .btn,
html.hub-shelled .idx3-kit-item,
html.hub-shelled .idx3-lang button,
html.hub-shelled .idx3-langsel { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled .idx3-lb .box,
html.hub-shelled .idx3-main,
html.hub-shelled .idx3-mapbox .panel,
html.hub-shelled .idx3-mapconfirm,
html.hub-shelled .idx3-mixbar,
html.hub-shelled .idx3-q { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled .idx3-scene,
html.hub-shelled .idx3-scene-ro .idx3-ro,
html.hub-shelled .idx3-scene2,
html.hub-shelled .idx3-sec,
html.hub-shelled .idx3-sec .badge.n,
html.hub-shelled .idx3-step { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled .idx3-step .n,
html.hub-shelled .idx3-stepper,
html.hub-shelled .idx3-stepper button,
html.hub-shelled .idx3-tab-bar,
html.hub-shelled .idx3-tab-content,
html.hub-shelled .idx3-tag { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled .idx3-tg,
html.hub-shelled .idx3-thumb,
html.hub-shelled .idx3-val,
html.hub-shelled .idx3-vblock,
html.hub-shelled .idx3-wire { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled .qdtb-dd,
html.hub-shelled /* ===== 分段按钮 Segmented（flex 均分，不 wrap 成不对称）===== */ .idx3-seg,
html.hub-shelled /* ===== 场景卡（STEP 1 圈选 + 紧凑 chips + 选中对号）===== */ .idx3-scenes,
html.hub-shelled /* ===== 步骤进度条 ===== */ .idx3-steps,
html.hub-shelled /* ===== 画廊 ===== */ .idx3-gallery,
html.hub-shelled /* ===== 结果 ===== */ .idx3-result { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled /* ===== 配比条 ===== */ .idx3-mix,
html.hub-shelled /* ============ P1-7: 耗时估算标签 ============ */ #idx3-app .idx3-min-est,
html.hub-shelled /* ============ 一键预设条 & 完成度 & 重置（挂在 header 下） ============ */ #cfg-ux-presetbar,
html.hub-shelled /* TAB 式样场景选择器（父分类 tab + 子场景包在选中 tab 下） */ .idx3-tabs,
html.hub-shelled /* 自动计算按钮（蓝主题，替代淡黄药丸，避免像色块） */ .idx3-autobtn,
html.hub-shelled table.bom tr.total td { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled table.ckt th { background: #0D1726 !important; color: #EEF3F8 !important; }
html.hub-shelled .idx3-adv summary:hover,
html.hub-shelled .idx3-cat.on,
html.hub-shelled .idx3-cat:hover,
html.hub-shelled .idx3-geoitem:hover,
html.hub-shelled .idx3-step.on .n,
html.hub-shelled .idx3-stepper button:hover { background: rgba(255,201,51,.14) !important; color: #FFC933 !important; }
html.hub-shelled .idx3-val.jumpable:hover,
html.hub-shelled .qdtb-dd a:hover,
html.hub-shelled .qdtb-nav .dd>a:hover,
html.hub-shelled .qdtb-nav>a:hover { background: rgba(255,201,51,.14) !important; color: #FFC933 !important; }
html.hub-shelled .idx3-input,
html.hub-shelled .idx3-mixrow input[type=range],
html.hub-shelled .idx3-numin input[type=number],
html.hub-shelled .idx3-select,
html.hub-shelled .idx3-slider .idx3-numrow input[type=number] { background: #101C30 !important; color: #EEF3F8 !important; border-color: rgba(255,255,255,.14) !important; }
html.hub-shelled .idx3-slider-row input[type=number] { background: #101C30 !important; color: #EEF3F8 !important; border-color: rgba(255,255,255,.14) !important; }

/* ═══ 实时演示区（rd- 系列）：节点卡原来是 linear-gradient 浅底，纯色规则盖不到 ═══ */
html.hub-shelled .rd-wrap { background: #0B1424 !important; border-color: rgba(255,255,255,.10) !important; }
html.hub-shelled .rd-node,
html.hub-shelled .rd-node.src,
html.hub-shelled .rd-node.load,
html.hub-shelled .rd-kpi,
html.hub-shelled .rd-topo,
html.hub-shelled .rd-btn,
html.hub-shelled .rd-tag {
  background: #0D1726 !important;
  background-image: none !important;
  color: #EEF3F8 !important;
  border-color: rgba(255,255,255,.14) !important;
}
html.hub-shelled .rd-node .rn-nm { color: #EEF3F8 !important; }
html.hub-shelled .rd-node .rn-v { color: #5AA0F2 !important; }
html.hub-shelled .rd-node .rn-u,
html.hub-shelled .rd-node .rn-v small { color: #9CB0C2 !important; }
html.hub-shelled .rd-node .rn-badge { background: rgba(90,160,242,.18) !important; color: #5AA0F2 !important; }
html.hub-shelled .rd-no { background: #122032 !important; color: #EEF3F8 !important; }
html.hub-shelled .rd-wire,
html.hub-shelled .rd-bwire { background: rgba(255,255,255,.20) !important; }
html.hub-shelled .rd-note { background: rgba(255,201,51,.10) !important; color: #FFC933 !important; border-left-color: #FFC933 !important; }
html.hub-shelled .rd-alert { background: rgba(240,100,95,.10) !important; color: #F0645F !important; border-left-color: #F0645F !important; }
html.hub-shelled .rd-topo-n { background: #122032 !important; color: #9CB0C2 !important; }

/* 兜底：内联浅色渐变 → 深色（只针对含 #fff 的渐变，不动设计性渐变） */
html.hub-shelled [style*="linear-gradient"][style*="#fff"],
html.hub-shelled [style*="linear-gradient"][style*="#FFF"] {
  background-image: none !important;
  background: #0D1726 !important;
}

/* ═══ 按钮统一（2026-09-27）═══ */
/* 白底按钮（导出/次要操作）→ 深色描边按钮 */
html.hub-shelled button[style*="background:#fff"],
html.hub-shelled button[style*="background: #fff"],
html.hub-shelled .idx3-docbtn,
html.hub-shelled .rd-btn,
html.hub-shelled .idx3-fixbtn {
  background: #122032 !important;
  color: #EEF3F8 !important;
  border: 1px solid rgba(255,255,255,.16) !important;
}
/* 蓝色主按钮/选中态 → Hub 金黄 + 深字 */
html.hub-shelled button[style*="background:#1565C0"],
html.hub-shelled button[style*="background: #1565C0"],
html.hub-shelled button[style*="background:#0D47A1"],
html.hub-shelled .idx3-cat.on,
html.hub-shelled .idx3-tab.on {
  background: #FFC933 !important;
  color: #0A1220 !important;
  border-color: #FFC933 !important;
}
/* 蓝色描边选中（IEC/GB/NEC 那类）→ 金黄描边 */
html.hub-shelled [style*="border:2px solid #1565C0"],
html.hub-shelled [style*="border: 2px solid #1565C0"] {
  border-color: #FFC933 !important;
  background: rgba(255,201,51,.12) !important;
  color: #FFC933 !important;
}
/* 状态条语义色（绿/黄/红）保持但改深色半透明底 */
html.hub-shelled [style*="background:#ecfdf5"] { background: rgba(76,212,160,.12) !important; color: #4CD4A0 !important; }
html.hub-shelled [style*="background:#fef3c7"],
html.hub-shelled [style*="background:#fffbeb"] { background: rgba(255,201,51,.10) !important; color: #FFC933 !important; }
html.hub-shelled [style*="background:#fef2f2"] { background: rgba(240,100,95,.10) !important; color: #F0645F !important; }
