/* Q 版主题 · 通用深色桥接层（2026-09-25）
   通过全局 00-wb-uialign.conf 的 sub_filter 注入到全部站点；
   作用域：应用页 .shell/body:has(.shell)，登录页 .login-wrap/密码表单；
   复用设计令牌，仅把浅色令牌翻为深色；不改任何结构/类名。
*/

:root {
  --q-primary: #1e3a8a;
  --q-primary-d: #2f5fd0;
  --q-primary-l: #e8eefc;
  --q-primary-grad: linear-gradient(135deg, #1e3a8a 0%, #6f93e0 100%);
}

/* —— 深色令牌（仅应用内生效；登录页仍用浅色默认值）—— */
.shell, body:has(.shell) {
  --brand-50:  #15233d;  --brand-100: #1f335a;  --brand-200: #2c4f86;
  --brand-500: #5b9bff;  --brand-600: #4a8af0;  --brand-700: #8ab4ff;  --brand-900: #cfe0ff;
  --n-0:   #161d2b;  --n-50:  #1c2536;  --n-100: #0f1420;  --n-200: #2a3447;
  --n-300: #33405a;  --n-400: #8b97ad;  --n-500: #9aa7bf;  --n-600: #b6c0d2;
  --n-700: #c4cde0;  --n-800: #e3e8f2;  --n-900: #e8edf7;
  --ok-text:#4cc38a;  --ok-bg:#0f261c;   --ok-border:#1d3f2e;
  --wa-text:#e6c34d;  --wa-bg:#272010;   --wa-border:#3d3414;
  --dn-text:#ff7a8a;  --dn-bg:#2a1417;   --dn-border:#3d1f23;
  --in-text:#6fb1ff;  --in-bg:#11233f;   --in-border:#22406e;
  --pu-text:#9bb4ff;  --pu-bg:#15203a;   --pu-border:#243560;
  --te-text:#4fd1c0;  --te-bg:#0f2a27;   --te-border:#1c4a44;
  --or-text:#f0ad57;  --or-bg:#2a1e08;   --or-border:#3d2c12;
}

/* —— 关键手法：把共享 q-theme 的**变量**在深色作用域内重定义 ——
   q-theme 大量规则形如 input{background:var(--q-field)!important} /
   .side{background:var(--q-card)!important} / color:var(--q-text)!important，
   其中 input 规则的 :not() 链特异性高达 (0,5,1)，逐个硬覆盖既脆弱又易漏。
   直接改这些变量的取值，q-theme 相关规则会**自动**翻深，一次覆盖全部引用点。 */
.shell, body:has(.shell) {
  --q-bg:  #0f1420;   --q-bg2: #131a29;
  --q-card: #161d2b;
  --q-line: #2a3447;  --q-line2: #33405a;
  --q-text: #e8edf7;  --q-muted: #9aa7bf;
  --q-field: #161d2b;
  --q-primary-l: #15233d;
}

/* —— 页面底色 + 文字色（仅含 .shell 的应用页）；覆盖共享 q-theme 的浅底与深字色 ——
   注意：q-theme 用 `body{background:…var(--q-bg)!important}`（浅色+浅色径向渐变）强制浅底，
   须用 !important 才能翻成深色；同时清掉浅色渐变（硬编码色，变量法覆盖不到）。 */
body:has(.shell) {
  background-color: var(--n-100) !important;
  background-image: none !important;
  color: var(--n-900) !important;
}
.shell, body:has(.shell) { color: var(--n-900) !important; }
.shell h1, .shell h2, .shell h3, .shell h4, .shell h5, .shell legend, .shell th { color: var(--n-900) !important; }
.shell a { color: var(--brand-500) !important; }
.shell label { color: var(--n-600) !important; }
.shell .nv { color: var(--n-700) !important; }
.shell .nv:hover { color: var(--brand-700) !important; }
.shell .lang-switch2 a, .shell .lang-switch a { color: #cdd8ef !important; }
.shell .who .lnk { color: #cfe0f5 !important; }
.shell .side .nv-child { color: var(--n-600) !important; }

/* —— 顶栏：恢复深色调（桥接层原本误改为白底，导致语言切换器白字压白底）—— */
.topbar { background: linear-gradient(90deg, #16233a, #1f3557) !important; color: #fff !important; }
.topbar .brand em { background: rgba(255,255,255,.12) !important; color: #fff !important; }
.who .tag { background: #0d4595 !important; color: #fff !important; }

/* —— 语言切换器：固定深色胶囊，白字压深底，登录浅底/应用深底都可读 —— */
.lang-switch2, .lang-switch {
  background: #1c2740 !important; border: 1px solid #34425e !important;
}
.lang-switch2 a, .lang-switch a { color: #cdd8ef !important; }
.lang-switch2 a.on, .lang-switch a.on,
.lang-switch2 a:hover, .lang-switch a:hover { color: #fff !important; }
.lang-switch2 .sep, .lang-switch .sep { color: #9aa7bf !important; }

/* —— 主要表面：卡片/侧栏/统计/表格/输入/按钮 翻深色 —— */
.shell .card, .shell .side, .shell .stat, .shell .sub-mod-card,
.shell .tbl-wrap, .shell table.grid, .shell .empty,
.shell .pager .pg, .shell .tabs a.on,
.shell input, .shell select, .shell textarea,
.shell .modal-box, .shell .panel, .shell .box, .shell .popover, .shell .toast {
  background-color: var(--n-0) !important; border-color: var(--n-200) !important;
}
.shell .side { border-right: 1px solid var(--n-200) !important; }
.shell .card, .shell .stat, .shell .sub-mod-card, .shell .tbl-wrap,
.shell table.grid, .shell .empty { box-shadow: 0 1px 3px rgba(0,0,0,.35) !important; }
.shell .sub-mod-card { color: var(--n-900) !important; }
.shell .sub-mod-card .name { color: var(--n-900) !important; }
.shell .sub-mod-card .meta { color: var(--brand-600) !important; }
.shell .sub-mod-card:hover { border-color: var(--brand-500) !important; box-shadow: 0 6px 18px rgba(0,0,0,.4) !important; }
.shell .stat .v { color: #e8edf7 !important; }
.shell .stat.gray .v { color: var(--n-700) !important; }
.shell table.grid th, .shell table.grid td { border-bottom-color: var(--n-200) !important; }
.shell table.grid thead th { background: var(--n-50) !important; color: var(--n-700) !important; border-bottom-color: var(--n-300) !important; }
/* 行悬停：排除评级行（lv-* 自带底色）；并覆盖 q-theme 的
   `table tbody tr:hover td{background:#f6f9ff!important}`（浅底 → 深色页上文字瞬盲）。 */
.shell table.grid tbody tr:not(.lv-red):not(.lv-orange):not(.lv-yellow):not(.lv-gone):hover,
.shell table.grid tbody tr:not(.lv-red):not(.lv-orange):not(.lv-yellow):not(.lv-gone):hover td { background: var(--brand-50) !important; }
.shell table.grid tfoot td { background: var(--n-50) !important; }
.shell tr.lv-red td { background: #2a1517 !important; }    .shell tr.lv-red:hover td { background: #331a1c !important; }
.shell tr.lv-orange td { background: #2a2110 !important; }
.shell tr.lv-yellow td { background: #262417 !important; }
.shell tr.lv-gone td { background: #1a2030 !important; color: var(--n-500) !important; }
.shell .input, .shell input, .shell select, .shell textarea { color: var(--n-900) !important; }
/* 焦点态：q-theme 用 input:not(…):focus{background:#fff!important}（特异性 0,6,1），
   须用同链 + .shell 前缀（达到 0,7,1）才能覆盖，避免深色页里输入框一点击就变白。 */
.shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):focus,
.shell select:focus, .shell textarea:focus {
  background-color: var(--n-0) !important;
  color: var(--n-900) !important;
  border-color: var(--brand-500) !important;
  box-shadow: 0 0 0 3px rgba(91,155,255,.22) !important;
}

/* —— 按钮 —— */
.shell .btn { background: var(--n-0) !important; color: var(--n-800) !important; border-color: var(--n-300) !important; }
.shell .btn:hover { background: var(--n-50) !important; color: var(--n-900) !important; border-color: var(--n-400) !important; }
.shell .btn.pri { background: #1d4ed8 !important; border-color: #1d4ed8 !important; color: #fff !important; }
.shell .btn.pri:hover { background: #1740b8 !important; color: #fff !important; }
.shell .btn.dan { background: #c62828 !important; border-color: #c62828 !important; color: #fff !important; }
.shell .btn.dan:hover { background: #ad2222 !important; color: #fff !important; }
.shell .btn.ok  { background: #0f7a48 !important; border-color: #0f7a48 !important; color: #fff !important; }
.shell .btn.ok:hover { background: #0d6a3e !important; color: #fff !important; }
.shell .btn.sub { background: var(--n-100) !important; border-color: var(--n-200) !important; color: var(--n-700) !important; }
.shell .btn.sub:hover { background: var(--n-50) !important; }

/* —— 分页 / 标签页 / 时间线 等细节 —— */
.shell .pager .pg { color: var(--n-700) !important; }
.shell .pager .pg:hover { background: var(--n-50) !important; border-color: var(--n-400) !important; }
.shell .pager .pg.on { background: #1d4ed8 !important; border-color: #1d4ed8 !important; color: #fff !important; }
.shell .tabs a { color: var(--n-600) !important; }
.shell .tabs a:hover { color: var(--brand-700) !important; background: var(--n-50) !important; }
.shell .tabs a.on { background: var(--n-0) !important; border-color: var(--n-200) !important; color: var(--brand-700) !important; border-bottom-color: var(--n-0) !important; }
.shell .tabs { border-bottom-color: var(--n-200) !important; }
.shell .timeline li { border-left-color: var(--n-200) !important; }
.shell .timeline li::before { box-shadow: 0 0 0 3px var(--n-0) !important; }
.shell .steps .lv-h .no { background: #1d4ed8 !important; color: #fff !important; }
.shell .nav-badge { background: #c62828 !important; color: #fff !important; }
.shell .kv dt { color: var(--n-500) !important; }
.shell .files li { border-bottom-color: var(--n-200) !important; }
.shell .files li .meta { color: var(--n-500) !important; }

/* —— 徽章：q-theme 有 `.badge{background:var(--q-primary-grad)!important}` 把**所有** .b-*
   一律刷成蓝色渐变（语义色丢失、且与文字色对比不足）。逐类用深色令牌重刷，
   顺序须在本条 `.badge` 之后、且特效度(0,2,0) > q-theme 的(0,1,0)。 —— */
.shell .badge, .shell .chip, .shell .pill, .shell .u-pill {
  background: var(--n-100) !important; color: var(--n-700) !important; border-color: var(--n-300) !important;
}
.shell .b-green  { background: var(--ok-bg) !important; color: var(--ok-text) !important; border-color: var(--ok-border) !important; }
.shell .b-blue   { background: var(--in-bg) !important; color: var(--in-text) !important; border-color: var(--in-border) !important; }
.shell .b-yellow { background: var(--wa-bg) !important; color: var(--wa-text) !important; border-color: var(--wa-border) !important; }
.shell .b-orange { background: var(--or-bg) !important; color: var(--or-text) !important; border-color: var(--or-border) !important; }
.shell .b-red    { background: var(--dn-bg) !important; color: var(--dn-text) !important; border-color: var(--dn-border) !important; }
.shell .b-gray   { background: var(--n-100) !important; color: var(--n-600) !important; border-color: var(--n-200) !important; }
.shell .b-dark   { background: var(--n-200) !important; color: var(--n-800) !important; border-color: var(--n-300) !important; }
.shell .b-purple { background: var(--pu-bg) !important; color: var(--pu-text) !important; border-color: var(--pu-border) !important; }
.shell .b-teal   { background: var(--te-bg) !important; color: var(--te-text) !important; border-color: var(--te-border) !important; }


/* ==========================================================================
   登录页深色化（覆盖全局 00-wb-uialign.conf 的浅蓝/白卡注入）
   全局注入把任何含密码框的页面强刷成 #f4f7fb 浅底 + #fff 白卡 + 深蓝按钮；
   这里在同名/同特异 !important 规则上后出，翻成深色，满足"所有界面统一深色底"。
   ========================================================================== */
.login-screen, .login-wrap, .login-box, .auth-page, body.login, #login,
.login-container, .login-card, .auth-card {
  background: #0f1420 !important;
  color: #e8edf7 !important;
  /* 重定义中性文字令牌：登录页在 .shell 作用域之外，var 文本(如 .fl)仍需翻亮 */
  --n-400: #b6c0d2; --n-500: #9aa7bf; --n-600: #c4cde0; --n-700: #dbe3f0;
  --n-800: #e8edf7; --n-900: #f2f6ff; --q-text: #e8edf7; --q-muted: #9aa7bf;
}
/* 单独成规则：避免与上面的选择器列表共享时，因个别浏览器对嵌套 :has(:has())
   解析差异导致整条规则被丢弃（曾致 .login-wrap/.login-card 背景未翻深）。 */
body:has(input[type=password]) {
  background: #0f1420 !important;
  /* ★2026-09-26 修复：此处**不再**设 color / --q-text / --n-* ——
     SPA（PCMS/SPCS/MOD）的登录表单常驻 DOM（只加 hidden、不移除），
     于是 body:has(input[type=password]) 在**登录之后依然命中**：
     --q-text 被继承成 #e8edf7 浅色，而 --q-card 仍是 #ffffff，
     结果白卡片上是浅字（实测 .card-t 仅 1.17:1，完全看不清）。
     文字浅色化已下移到上面的 .login-* 容器选择器，只作用于登录界面本身。 */
}
form:has(input[type=password]) {
  background: #161d2b !important;
  color: #e8edf7 !important;
  box-shadow: 0 14px 40px rgba(0,0,0,.55) !important;
}
.login-wrap h1, .login-box h1, .auth-page h1, body.login h1,
.login-wrap .title, .login-box .title,
form:has(input[type=password]) h1, form:has(input[type=password]) h2 {
  color: #e8edf7 !important;
}
.login-wrap .sub, .login .sub, .login-foot, .login-wrap .login-foot {
  color: #9aa7bf !important; background: transparent !important;
}
form:has(input[type=password]) input,
form:has(input[type=password]) select,
form:has(input[type=password]) textarea {
  background: #0f1420 !important; color: #e8edf7 !important;
  border-color: #2a3447 !important;
}
.login-wrap button, .login-box button, .auth-page button, body.login button,
form:has(input[type=password]) button,
form:has(input[type=password]) input[type=submit] {
  background: #1d4ed8 !important; color: #fff !important;
  border-color: #1d4ed8 !important; border-radius: 10px !important;
  padding: 12px 18px !important;
}
/* 语言切换器：登录浅底/应用深底都可读（深胶囊） */
.login-wrap .lang-switch, .login-wrap .lang-switch2,
.login-box .lang-switch, .login-box .lang-switch2 {
  background: #1c2740 !important; border: 1px solid #34425e !important;
}
.login-wrap .lang-switch a, .login-wrap .lang-switch2 a,
.login-box .lang-switch a, .login-box .lang-switch2 a { color: #cdd8ef !important; }
.login-wrap .lang-switch a.on, .login-wrap .lang-switch2 a.on,
.login-wrap .lang-switch a:hover, .login-wrap .lang-switch2 a:hover { color: #fff !important; }

/* 自定义徽章/标签类（如 stms .b2）：默认深色文字在深色底上翻亮 */
.shell .b2, .shell .tag2 { color: var(--n-800) !important; }

/* 显式兜底：次要/页脚/标签类在深色底上用亮灰（不依赖 var 继承，避免漏网） */
.shell .fl, .shell .footer, .shell .foot, .shell .muted, .shell .hint,
.shell .meta, .shell .note, .shell .desc, .shell .tip, .shell .caption,
.shell .small, .shell .help, .shell .text-muted,
.login-wrap .fl, .login-box .fl, .login-wrap .muted, .login-box .muted,
.login-wrap .hint, .login-box .hint, .login-wrap .meta, .login-box .meta,
.login-wrap .note, .login-box .note, .login-wrap .foot, .login-box .foot {
  color: #9aa7bf !important;
}
.shell .b2, .shell .tag2, .login-wrap .b2, .login-box .b2 { color: #e8edf7 !important; }

/* ==========================================================================
   残余对比度修复（q-theme / PHP 站）
   ========================================================================== */
/* energy 品牌 logo：白字压琥珀底 → 深蓝底 + 琥珀字 */
.flogo { background: #1f4e79 !important; color: #ffd27f !important; }
/* stms 登录深色：仅顶栏 .b2 在深底上翻亮；.box 内 .b2 落在白卡上须保持深字（原设计可读） */
.topbar .b2 { color: #e8edf7 !important; }
/* energy 语言分隔符：登录/落地页翻深后，.lang 须转亮（白底浅字已不可见） */
body:has(input[type=password]) .lang { color: #cdd8ef !important; }
body:has(input[type=password]) .lang-switch a.lang.active,
.box .lang-switch a.lang.active { background: #1e3a8a !important; color: #fff !important; }

/* ==========================================================================
   SPA / 自研站专用深色主题（按 body.spa-* 作用域，零侵入业务代码）
   ========================================================================== */

/* —— wechat 微信语音智能体控制台 —— */
body.spa-wechat {
  --bg: #0f1420; --card: #161d2b; --border: #2a3447;
  --text: #e8edf7; --muted: #9aa7bf; --primary: #3b82f6;
  --primary-soft: #15233d; --ok: #34d399; --warn: #f0ad57; --err: #ff7a8a;
}
body.spa-wechat { background: var(--bg) !important; color: var(--text) !important; }
body.spa-wechat .topbar { background: var(--card) !important; border-bottom-color: var(--border) !important; }
body.spa-wechat .card, body.spa-wechat .metric, body.spa-wechat .list .item,
body.spa-wechat .chatlog, body.spa-wechat .tab, body.spa-wechat .pill-dim,
body.spa-wechat .chip, body.spa-wechat code, body.spa-wechat .chatlog .bot .bubble {
  background: #161d2b !important; border-color: var(--border) !important; color: var(--text) !important;
}
body.spa-wechat .tab.active { background: var(--card) !important; color: var(--primary) !important; }
body.spa-wechat .pill { color: var(--primary) !important; }
body.spa-wechat .pill.ok { background: #0f2a22 !important; color: #34d399 !important; border-color: #1c4a3e !important; }
body.spa-wechat .pill.bad { background: #2a1417 !important; color: #ff7a8a !important; border-color: #3d1f23 !important; }
body.spa-wechat input, body.spa-wechat select, body.spa-wechat textarea {
  background: #0f1420 !important; color: var(--text) !important; border-color: var(--border) !important;
}
body.spa-wechat button.ghost { background: #1c2740 !important; color: var(--muted) !important; border-color: var(--border) !important; }
body.spa-wechat .chatlog .user .bubble { background: var(--primary-soft) !important; border-color: #2a3a5e !important; }
body.spa-wechat .chatlog .bot .bubble { background: #1c2436 !important; border-color: var(--border) !important; }
body.spa-wechat .banner { background: #2a2110 !important; color: #f0ad57 !important; border-color: #3d3414 !important; }

/* —— ssms 智能销售地图 —— */
body.spa-ssms {
  --navy: #0f2a47; --navy2: #16385f; --teal: #0d9488; --gold: #b8893b;
  --ink: #e8edf7; --muted: #9aa7bf; --line: #2a3447; --bg: #0f1420;
  --danger: #ff7a8a; --warn: #f0ad57;
}
body.spa-ssms { background: var(--bg) !important; color: var(--ink) !important; }
body.spa-ssms .panel { background: #161d2b !important; border-color: var(--line) !important; box-shadow: 0 1px 6px rgba(0,0,0,.4) !important; }
body.spa-ssms .panel .ph { background: var(--navy) !important; color: #fff !important; }
body.spa-ssms .badge-mode { background: var(--gold) !important; color: #1f2329 !important; }
body.spa-ssms .banner.demo { background: #2a2110 !important; color: #f0ad57 !important; border-bottom-color: var(--line) !important; }
body.spa-ssms .banner.gov { background: #15233d !important; color: #7fb0e8 !important; border-bottom-color: var(--line) !important; }
body.spa-ssms .btn.ghost { background: #1c2740 !important; color: var(--ink) !important; border-color: var(--line) !important; }
body.spa-ssms input, body.spa-ssms select { background: #0f1420 !important; color: var(--ink) !important; border-color: var(--line) !important; }
body.spa-ssms .note { background: #161d2b !important; border-left-color: var(--teal) !important; }
body.spa-ssms .note b { color: var(--ink) !important; }
body.spa-ssms tbody tr:nth-child(even) { background: #1a2233 !important; }
body.spa-ssms .tag.demo { background: #2a2110 !important; color: #f0ad57 !important; }
body.spa-ssms .tag.live { background: #0f2a27 !important; color: #4fd1c0 !important; }
body.spa-ssms .muted { color: var(--muted) !important; }
body.spa-ssms .kv { color: var(--muted) !important; }
body.spa-ssms .miss { color: var(--danger) !important; }
body.spa-ssms .logo { color: #06302b !important; }

/* —— hoe 酒店运营物资 —— */
body.spa-hoe {
  --navy: #0f2a47; --navy-2: #16385c; --navy-3: #22507f; --navy-4: #2f6398;
  --gold: #c3913c; --gold-2: #d8ab5c;
  --ink: #e8edf7; --ink-2: #c4cde0; --muted: #9aa7bf; --faint: #a7b3c4;
  --line: #2a3447; --line-2: #33405a; --line-3: #2a3447;
  --bg: #0f1420; --card: #161d2b; --head-bg: #1a2233;
  --teal: #0f9384; --teal-soft: #0f2a27; --danger: #ff7a8a; --danger-soft: #2a1417;
}
body.spa-hoe { background: var(--bg) !important; color: var(--ink) !important; }
body.spa-hoe .panel { background: var(--card) !important; border-color: var(--line) !important; }
body.spa-hoe .panel-hd { background: #1a2233 !important; border-bottom-color: var(--line-2) !important; }
body.spa-hoe .seg, body.spa-hoe .seg button, body.spa-hoe .tbl-wrap,
body.spa-hoe table.items, body.spa-hoe table.items tbody td,
body.spa-hoe table.items tbody tr:nth-child(even) td,
body.spa-hoe .btn-soft { background: #161d2b !important; }
body.spa-hoe .seg button.on { background: var(--navy) !important; color: #fff !important; }
body.spa-hoe .arrow { color: #c4cde0 !important; }
body.spa-hoe .en, body.spa-hoe .hd-sub, body.spa-hoe .flow-note { color: var(--muted) !important; }
body.spa-hoe .del { color: #ff9aa0 !important; }
body.spa-hoe .clr { color: #ff7a8a !important; }
body.spa-hoe table.items thead th { background: var(--head-bg) !important; color: var(--navy-3) !important; }
body.spa-hoe table.items thead th .en { color: #8aa0c0 !important; }
body.spa-hoe table.items td input { background: #0f1420 !important; color: var(--ink) !important; border-color: var(--line) !important; }
body.spa-hoe table.items td input:focus { background: #0f1420 !important; }
/* 流程条 .flow 等白色面 → 翻深；其内浅字（--ink/--muted）在深底上可读 */
body.spa-hoe .flow { background: #161d2b !important; border: 1px solid var(--line) !important; color: #e8edf7 !important; }
body.spa-hoe .btn-soft { color: #cdd8ef !important; }
body.spa-hoe .c-no, body.spa-hoe table.items th.c-no, body.spa-hoe table.items td.c-no { color: #cdd8ef !important; }

/* —— spcs 智能产品统计 —— */
body.spa-spcs {
  --bg: #0f1420; --bg2: #131a29; --card: #161d2b; --line: #2a3447; --line2: #33405a;
  --text: #e8edf7; --muted: #9aa7bf; --primary: #3b82f6; --accent-d: #34d399;
}
body.spa-spcs { background: var(--bg) !important; color: var(--text) !important; }
body.spa-spcs .login-card { background: #161d2b !important; color: var(--text) !important; }
body.spa-spcs .subtitle { color: var(--muted) !important; }
body.spa-spcs .login-card label { color: var(--muted) !important; }
body.spa-spcs .login-card input { background: #0f1420 !important; color: var(--text) !important; border-color: var(--line) !important; }
body.spa-spcs .login-logo { background: linear-gradient(150deg,#1a2740,#2a3a5e) !important; color: #e8edf7 !important; box-shadow: inset 0 0 0 3px #2a3447 !important; }
body.spa-spcs .app, body.spa-spcs .sidebar, body.spa-spcs .content { background: var(--bg) !important; color: var(--text) !important; }
body.spa-spcs .sidebar a { color: var(--muted) !important; }
body.spa-spcs .sidebar a:hover { background: #1c2740 !important; color: var(--text) !important; }
body.spa-spcs .sidebar a.active { background: linear-gradient(135deg,#1e3a8a,#3a63d6) !important; color: #fff !important; }
body.spa-spcs .kpi, body.spa-spcs .card, body.spa-spcs table { background: var(--card) !important; border-color: var(--line) !important; color: var(--text) !important; }
body.spa-spcs input, body.spa-spcs select, body.spa-spcs textarea { background: #0f1420 !important; color: var(--text) !important; border-color: var(--line) !important; }
body.spa-spcs .tag.s-done { background: #0f2a27 !important; color: #34d399 !important; }
body.spa-spcs .tag.s-wait { background: #2a2110 !important; color: #f0ad57 !important; }
body.spa-spcs .tag.s-doing { background: #15233d !important; color: #7fb0e8 !important; }
body.spa-spcs th { color: var(--muted) !important; }
body.spa-spcs tbody tr:hover td { background: #1a2233 !important; }

/* —— srs 智能报表（自带深色，仅修正白卡内的浅字/白底） —— */
body.spa-srs .card, body.spa-srs .panel, body.spa-srs .metric,
body.spa-srs .list .item, body.spa-srs .tab, body.spa-srs .pill {
  background: #161d2b !important; color: #cdd8ef !important; border-color: #2a3447 !important;
}
body.spa-srs .pill.ok { color: #34d399 !important; }
body.spa-srs .sub, body.spa-srs .mut, body.spa-srs .muted { color: #9aa7bf !important; }

/* ==========================================================================
   2026-09-30 补强（v20260929 实测后精确修复）
   说明：此前 v20260929 仅含登录块拆分 + 5 个 body.spa-* 块 + .flogo 残余；
   Edits 3/4（stms/energy、hoe .flow/.btn-soft/.c-no）当时未随部署上线，
   故本块一并补齐，并针对实测各站白卡/高特异性单元格做精确覆盖。
   ========================================================================== */

/* —— 登录/落地页 .box 卡片（energy/stms 等 PHP 站以 .box 为外层卡片：
   body 已翻深，但 .box 仍为白卡 → 其内 .lang/.b2 等浅字压白卡失效） —— */
body:has(input[type=password]) .box {
  background: #161d2b !important; color: #e8edf7 !important; border-color: #2a3447 !important;
}
body:has(input[type=password]) .box .sub,
body:has(input[type=password]) .box .sub2,
body:has(input[type=password]) .box .muted,
body:has(input[type=password]) .box .hint,
body:has(input[type=password]) .box .note,
body:has(input[type=password]) .box .brand { color: #9aa7bf !important; }

/* —— home 品牌字（透明 fill 渐变裁剪，深色下不可见）—— */
.brand-name, .brand-name * { -webkit-text-fill-color: #e8edf7 !important; color: #e8edf7 !important; }

/* —— ssms 精确修复 —— */
body.spa-ssms .topbar h1, body.spa-ssms .topbar .en { color: #fff !important; }
body.spa-ssms a { color: #7fb0e8 !important; }
body.spa-ssms .map-ph, body.spa-ssms .pb,
body.spa-ssms .card, body.spa-ssms .box, body.spa-ssms .stat,
body.spa-ssms .metric, body.spa-ssms .legend, body.spa-ssms .grid {
  background: #161d2b !important; color: #cdd8ef !important; border-color: var(--line) !important;
}
body.spa-ssms .miss { background: #2a1417 !important; color: #ff7a8a !important; }
/* 品牌按钮：白字压中彩底对比不足（teal/gold/danger），加深底或改用深字以满足 ≥4.5 */
body.spa-ssms .btn.teal { background: #0a8278 !important; color: #fff !important; }
body.spa-ssms .btn.gold { background: #b8893b !important; color: #1f2329 !important; }
body.spa-ssms .btn.danger { background: #c62828 !important; color: #fff !important; }

/* —— srs 精确修复（落地页 .wrap/.row 浅底 + 按钮深字压蓝）—— */
body.spa-srs .wrap, body.spa-srs .row { background: #161d2b !important; color: #cdd8ef !important; }
body.spa-srs .sub, body.spa-srs .mut, body.spa-srs .muted { color: #9aa7bf !important; }
body.spa-srs button, body.spa-srs .btn { color: #fff !important; }

/* —— hoe 精确修复：流程条 / 按钮 / 序号文字（此前 Edit 4 未上线，此处补齐） —— */
body.spa-hoe .flow { background: #161d2b !important; border: 1px solid var(--line) !important; color: #e8edf7 !important; }
body.spa-hoe .btn-soft { color: #cdd8ef !important; }
body.spa-hoe .c-no, body.spa-hoe .cn, body.spa-hoe .c-act, body.spa-hoe .pick { color: #cdd8ef !important; }
body.spa-hoe .body { background: #161d2b !important; color: #cdd8ef !important; }

/* hoe 表格白卡单元格：SPA 用 nth-child 高特异性 #fff 覆盖，须镜像选择器 + body.spa-hoe 前缀才能压过 */
body.spa-hoe table.items,
body.spa-hoe table.items tbody td,
body.spa-hoe table.items tbody tr:nth-child(even) td,
body.spa-hoe table.items tbody tr:nth-child(odd) td,
body.spa-hoe table.items td.n,
body.spa-hoe table.items tbody tr:nth-child(even) td.n,
body.spa-hoe table.items tbody tr:nth-child(odd) td.n,
body.spa-hoe table.items td.k,
body.spa-hoe table.items tbody tr:nth-child(even) td.k,
body.spa-hoe table.items tbody tr:nth-child(odd) td.k,
body.spa-hoe table.items td.tri,
body.spa-hoe table.items tbody tr:nth-child(even) td.tri,
body.spa-hoe table.items tbody tr:nth-child(odd) td.tri,
body.spa-hoe table.items th.c-no,
body.spa-hoe table.items td.c-no,
body.spa-hoe table.items tbody tr:nth-child(even) td.c-no,
body.spa-hoe table.items tbody tr:hover td.c-no {
  background: #161d2b !important;
}

/* ==========================================================================
   2026-09-30 补强（二）：针对 v20260930 实测残余的精确修复
   ========================================================================== */

/* —— 登录/落地页 .box 翻深后，内部文字（h1/.b1/.b2/.brand/.lang/a）须转亮 —— */
body:has(input[type=password]) .box {
  background: #161d2b !important; color: #cdd8ef !important; border-color: #2a3447 !important;
}
body:has(input[type=password]) .box h1,
body:has(input[type=password]) .box .b1,
body:has(input[type=password]) .box .b2,
body:has(input[type=password]) .box .brand,
body:has(input[type=password]) .box .sub,
body:has(input[type=password]) .box .sub2,
body:has(input[type=password]) .box .muted,
body:has(input[type=password]) .box .hint,
body:has(input[type=password]) .box .note { color: #e8edf7 !important; }
body:has(input[type=password]) .box .lang,
body:has(input[type=password]) .box .lang a { color: #cdd8ef !important; }
body:has(input[type=password]) .box .lang a.on { color: #fff !important; background: #1e3a8a !important; }
body:has(input[type=password]) .box a { color: #7fb0e8 !important; }
body:has(input[type=password]) .topbar .lang,
.topbar .lang { color: #cdd8ef !important; }

/* —— hoe：footer.panel-ft 白底 / .col-no .n 自带白底 / td.c-act 白底 / 序号文字 —— */
body.spa-hoe .panel-ft { background: #161d2b !important; color: #cdd8ef !important; border-top-color: var(--line) !important; }
body.spa-hoe .col-no .n, body.spa-hoe td.col-no .n { background: #161d2b !important; color: #cdd8ef !important; }
body.spa-hoe table.items td.c-act,
body.spa-hoe table.items tbody tr:nth-child(even) td.c-act,
body.spa-hoe table.items tbody tr:hover td.c-act { background: #161d2b !important; }
body.spa-hoe table.items th.c-act,
body.spa-hoe table.items td.c-act { color: #cdd8ef !important; }
body.spa-hoe .del { color: #ff9aa0 !important; }

/* —— ssms：功能磁贴 .wb-card/.wb-tile 白底 + 普通 table 白格 —— */
body.spa-ssms .wb-tile, body.spa-ssms .wb-card, body.spa-ssms .wb-card-accent,
body.spa-ssms .wb-tile-grid { background: #161d2b !important; color: #cdd8ef !important; border-color: var(--line) !important; }
body.spa-ssms .wb-tile-ico { background: #161d2b !important; color: #7fb0e8 !important; }
body.spa-ssms table td, body.spa-ssms table th { background: #161d2b !important; color: #cdd8ef !important; border-color: var(--line) !important; }

/* —— srs：标题深字压深底 + ghost 按钮白底白字 + 链接深字 —— */
body.spa-srs .wrap h1, body.spa-srs h1, body.spa-srs h2, body.spa-srs h3 { color: #e8edf7 !important; }
body.spa-srs a { color: #7fb0e8 !important; }
body.spa-srs button.ghost, body.spa-srs .ghost { background: #1c2740 !important; color: #cdd8ef !important; border-color: #2a3447 !important; }

/* —— home 门户落地页（浅色页）：品牌字原为透明裁剪，深底/浅底均不可见，
   门户 hero 为浅底，故品牌字改深蓝以保证可读（深色站仍走全局浅字规则） —— */
header.brand .brand-name, .wrap .brand-name { -webkit-text-fill-color: #1e3a6e !important; color: #1e3a6e !important; }

/* ==========================================================================
   2026-09-30 补强（三）：ssms 工作台 wb-* 与 hoe panel-ft 残余
   ========================================================================== */

/* —— ssms 工作台（/settings 等）深色化：容器翻深 + 内部文字转亮 ——
   注：a.wb-tile 的浅底由 SPA 运行时注入的 .wb-tile-grid a.wb-tile 以同等特异度、
   更晚的级联顺序取胜；故此处用 html body.spa-ssms 前缀 + 完整路径抬高特异度压过它。 */
html body.spa-ssms .wb-card, html body.spa-ssms .wb-card.wb-card-accent,
html body.spa-ssms .wb-tile, html body.spa-ssms .wb-tile-grid,
html body.spa-ssms .wb-tile-grid a.wb-tile, html body.spa-ssms a.wb-tile,
html body.spa-ssms .wb-tile-body, html body.spa-ssms .wb-settings-page {
  background: #161d2b !important; color: #cdd8ef !important; border-color: var(--line) !important;
}
body.spa-ssms .wb-section-title { color: #e8edf7 !important; }
body.spa-ssms .wb-section-sub { color: #9aa7bf !important; }
body.spa-ssms .wb-tile-title { color: #e8edf7 !important; }
body.spa-ssms .wb-tile-desc { color: #9aa7bf !important; }
body.spa-ssms .wb-tile-ico { background: #161d2b !important; color: #7fb0e8 !important; }
body.spa-ssms .wb-settings-page h1,
body.spa-ssms .wb-settings-page h2,
body.spa-ssms .wb-settings-page h3 { color: #e8edf7 !important; }
body.spa-ssms .wb-settings-page p { color: #cdd8ef !important; }

/* —— hoe：footer.panel-ft 内 summary（提示）与合计 b 仍为中蓝，须转亮 —— */
body.spa-hoe .panel-ft summary { color: #cdd8ef !important; }
body.spa-hoe .panel-ft b:not(.money) { color: #cdd8ef !important; }
body.spa-hoe .panel-ft b.money { color: #ff7a8a !important; }


/* ==========================================================================
   SCRS 登录页深色对齐（覆盖全局 00-wb-uialign.conf [class*=login i] 白条泄漏）
   SCRS 登录原浅底白卡设计，被桥接层把 --tx2/--tx3 调浅 + 全局白条注入，
   导致 .login-brand/.login-lang/.login-tip 白底浅字不可读；
   此处用更高特异度翻深，与 q-dark 全局"统一深色底"意图一致。
   ========================================================================== */
body.login-page,
body.login-page .login-box { background: #0f1420 !important; }
body.login-page .login-brand,
body.login-page .login-lang,
body.login-page .login-tip { background: transparent !important; }
body.login-page .login-brand h1,
body.login-page .login-brand .scrs,
body.login-page label,
body.login-page .login-lang a { color: #e8edf7 !important; }
body.login-page .login-tip,
body.login-page .login-lang span { color: #9aa7bf !important; }
body.login-page .login-lang a.on { color: #fff !important; background: transparent !important; }
body.login-page .logo-f { background: linear-gradient(135deg, #1e3a8a, #2f5fd0) !important; }

/* ==========================================================================
   ★2026-09-26 文字对比度统一整改（B 组）
   依据：本机无头 Edge + getComputedStyle + WCAG 有效背景融合 实测
   回滚：删除本注释块及其下全部规则即可。
   ========================================================================== */

/* —— 1) 深色登录卡内的“系统自有文字令牌”必须转亮 ——
   症状：PCMS 登录页 .dev-credit{color:var(--txt-3)} 实测 3.17:1
        （#5c6675 on #0f1420）。app.css 的 :root 覆盖带 !important，
        故此处亦须 !important；本文件在 </head> 末注入，源序最后 → 必胜。 */
.login-box .dev-credit, .login-card .dev-credit, .login-screen .dev-credit {
  color: #9aa7bf !important;
}

/* —— 2) STMS 登录页顶栏品牌名 ——
   症状：login.php 里 .brand .b1{color:#2f6fed}，而 q-dark 把 .topbar 刷成
        linear-gradient(90deg,#16233a,#1f3557) → 实测 2.71:1。 */
body:has(input[type=password]) .topbar .brand .b1 { color: #7fb0e8 !important; }

/* —— 3) SSMS 顶栏徽标 ——
   症状：div.logo 深绿字 #06302b 落在青绿渐变(#0d9488→#14b8a6)上 → 实测 3.83:1。 */
body.spa-ssms .topbar .logo {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(135deg, #0f766e, #115e59) !important;
}
