/* ==================================================================
   鸿服系统 · 多主题与视力适配样式（2026-11-05）
   ------------------------------------------------------------------
   原则：①系统默认配色零改动（不设 data-theme 或 =default 时不生效）
        ②每套主题统一语义变量，正文对比度 ≥4.5:1（AA），高对比档 ≥7:1（AAA）
        ③单屏竖屏单列 / 大横屏多栏，自动适配
        ④年龄与视力：字号四档、对比增强、色觉友好（不单靠颜色传达）
        ⑤悬浮控件 position:fixed，两形态通用
   依据：WCAG 2.2 SC 1.4.3 / 1.4.6 / 1.4.1 / 1.4.4 / 1.4.11
   对外文案：形态统一称「单屏竖屏 / 大横屏」，禁用设备类高费用敏感词。
   ================================================================== */

/* ---------- 语义变量：仅在显示层生效，不动数据与业务逻辑 ---------- */
html[data-theme="xt2"]{
  --bg:#0b0910; --surface:#1e1728; --surface-2:#171220;
  --ink:#f5f0e8; --ink-2:#e2d9cc; --ink-3:#bfb2ce;
  --accent:#f0d27a; --accent-ink:#14101c; --accent-solid:#c9a961;
  --line:rgba(201,169,97,.30); --focus:#f0d27a;
  --up:#ff8a82; --dn:#5fd8a4; --danger:#ff8a82; --ok:#5fd8a4; --info:#a9c2ff;
  --btn-a:#3d2a54; --btn-b:#6b4f8f;
  color-scheme:dark;
}
html[data-theme="hicontrast"]{
  --bg:#ffffff; --surface:#ffffff; --surface-2:#f0f0f0;
  --ink:#000000; --ink-2:#141414; --ink-3:#2b2b2b;
  --accent:#00327a; --accent-ink:#ffffff; --accent-solid:#00327a;
  --line:#5a5a5a; --focus:#00327a;
  --up:#a80000; --dn:#005a28; --danger:#a80000; --ok:#005a28; --info:#00327a;
  --btn-a:#00327a; --btn-b:#0050b8;
  color-scheme:light;
}
html[data-theme="ocean"]{
  --bg:#eef3f7; --surface:#ffffff; --surface-2:#e3ecf3;
  --ink:#0d2136; --ink-2:#2c4257; --ink-3:#465e74;
  --accent:#0b4f92; --accent-ink:#ffffff; --accent-solid:#0b4f92;
  --line:#b6c9d9; --focus:#0b4f92;
  --up:#b81f1f; --dn:#0d6b46; --danger:#b81f1f; --ok:#0d6b46; --info:#0b4f92;
  --btn-a:#0b4f92; --btn-b:#175a99;
  color-scheme:light;
}
html[data-theme="vivid"]{
  --bg:#f6f2ff; --surface:rgba(255,255,255,.96); --surface-2:#f0eaff;
  --ink:#1a1d29; --ink-2:#3c4152; --ink-3:#5a6076;
  --accent:#7038c4; --accent-ink:#ffffff; --accent-solid:#7038c4;
  --line:rgba(90,60,150,.22); --focus:#7038c4;
  --up:#c92a2a; --dn:#0a7f58; --danger:#c92a2a; --ok:#0a7f58; --info:#2b5fd9;
  --btn-a:#b83a22; --btn-b:#5f31c4;
  color-scheme:light;
}

/* ---------- 主题底色与文字（原 xt2 主题同时兼容旧开关） ---------- */
html[data-theme="xt2"] body,
html[data-xt2="on"] body{
  background:
    radial-gradient(700px 380px at 12% 0%,rgba(61,42,84,.32),transparent 70%),
    linear-gradient(165deg,#0b0910,#100c16 55%,#0b0910)!important;
  background-attachment:fixed!important;
  color:var(--ink)!important;
}
html[data-theme="hicontrast"] body,
html[data-theme="ocean"] body,
html[data-theme="vivid"] body{
  background:var(--bg)!important;color:var(--ink)!important;
}
html[data-theme="vivid"] body{
  background:linear-gradient(135deg,#ffd9c9,#e9d8ff 45%,#d6e2ff)!important;
  background-attachment:fixed!important;
}

/* ---------- 通用组件层：所有非默认主题共用，变量驱动 ---------- */
html[data-theme]:not([data-theme="default"]) body,
html[data-xt2="on"] body{color:var(--ink)}
html[data-theme]:not([data-theme="default"]) .card,
html[data-theme]:not([data-theme="default"]) .stat,
html[data-theme]:not([data-theme="default"]) .tabs,
html[data-theme]:not([data-theme="default"]) .datebar,
html[data-theme]:not([data-theme="default"]) .dec,
html[data-theme]:not([data-theme="default"]) details,
html[data-theme]:not([data-theme="default"]) .pitem,
html[data-theme]:not([data-theme="default"]) .kpi>div,
html[data-xt2="on"] .card,
html[data-xt2="on"] .stat,
html[data-xt2="on"] .tabs,
html[data-xt2="on"] .datebar,
html[data-xt2="on"] .dec,
html[data-xt2="on"] details,
html[data-xt2="on"] .pitem,
html[data-xt2="on"] .kpi>div{
  background:var(--surface)!important;border-color:var(--line)!important;
  color:var(--ink)!important;
}
html[data-theme]:not([data-theme="default"]) h1,
html[data-theme]:not([data-theme="default"]) h2,
html[data-theme]:not([data-theme="default"]) h3,
html[data-theme]:not([data-theme="default"]) .card h3{color:var(--accent)!important}
html[data-theme]:not([data-theme="default"]) .hint,
html[data-theme]:not([data-theme="default"]) .cm,
html[data-theme]:not([data-theme="default"]) .sub,
html[data-theme]:not([data-theme="default"]) th,
html[data-theme]:not([data-theme="default"]) .field label,
html[data-theme]:not([data-theme="default"]) .stat .lab,
html[data-theme]:not([data-theme="default"]) .tab,
html[data-theme]:not([data-theme="default"]) footer{color:var(--ink-3)!important}
html[data-theme]:not([data-theme="default"]) td,
html[data-theme]:not([data-theme="default"]) .rec,
html[data-theme]:not([data-theme="default"]) p,
html[data-theme]:not([data-theme="default"]) li,
html[data-theme]:not([data-theme="default"]) label{color:var(--ink-2)!important}
html[data-theme]:not([data-theme="default"]) .field input,
html[data-theme]:not([data-theme="default"]) .field select,
html[data-theme]:not([data-theme="default"]) .field textarea,
html[data-theme]:not([data-theme="default"]) textarea,
html[data-theme]:not([data-theme="default"]) .datebar input{
  background:var(--surface-2)!important;color:var(--ink)!important;
  border-color:var(--line)!important;
}
html[data-theme]:not([data-theme="default"]) .field input::placeholder,
html[data-theme]:not([data-theme="default"]) textarea::placeholder{color:var(--ink-3)!important;opacity:1}
html[data-theme]:not([data-theme="default"]) .btn{
  background:linear-gradient(135deg,var(--btn-a),var(--btn-b))!important;
  color:#ffffff!important;border-color:transparent!important;
}
html[data-theme="hicontrast"] .btn,
html[data-theme="ocean"] .btn,
html[data-theme="vivid"] .btn{color:#ffffff!important}
html[data-theme]:not([data-theme="default"]) .btn.gold,
html[data-theme]:not([data-theme="default"]) .bd,
html[data-theme]:not([data-theme="default"]) .opt[aria-pressed=true]{
  background:var(--accent-solid)!important;color:var(--accent-ink)!important;
}
html[data-theme="xt2"] .btn.gold,
html[data-theme="xt2"] .bd,
html[data-theme="xt2"] .opt[aria-pressed=true]{color:#14101c!important}
html[data-theme]:not([data-theme="default"]) .btn.ghost,
html[data-theme]:not([data-theme="default"]) .opt{
  background:transparent!important;color:var(--accent)!important;
  border-color:var(--accent)!important;
}
html[data-theme]:not([data-theme="default"]) .tab.on,
html[data-theme]:not([data-theme="default"]) .calc{color:var(--accent)!important}
html[data-theme]:not([data-theme="default"]) .calc{
  background:var(--surface-2)!important;border-color:var(--line)!important;
}
html[data-theme]:not([data-theme="default"]) .warn{
  background:var(--surface-2)!important;color:var(--danger)!important;
  border-left:3px solid var(--danger)!important;
}
html[data-theme]:not([data-theme="default"]) .up,
html[data-theme]:not([data-theme="default"]) .stat .num.red{color:var(--up)!important}
html[data-theme]:not([data-theme="default"]) .dn,
html[data-theme]:not([data-theme="default"]) .stat .num.green{color:var(--dn)!important}
html[data-theme]:not([data-theme="default"]) table,
html[data-theme]:not([data-theme="default"]) td,
html[data-theme]:not([data-theme="default"]) tr{border-color:var(--line)!important}
html[data-theme]:not([data-theme="default"]) .header{
  background:var(--surface-2)!important;border-bottom:1px solid var(--line)!important;
  color:var(--ink)!important;
}
html[data-theme]:not([data-theme="default"]) .header *{color:var(--ink)!important}
html[data-theme]:not([data-theme="default"]) footer{background:var(--bg)!important;border-color:var(--line)!important}
html[data-theme]:not([data-theme="default"]) a{color:var(--info)!important}
html[data-theme]:not([data-theme="default"]) :focus-visible{
  outline:3px solid var(--focus)!important;outline-offset:2px;
}

/* ---------- 字号四档（按年龄/视力自选；仅显示层缩放） ---------- */
html[data-font="s"] body{zoom:.94}
html[data-font="m"] body{zoom:1}
html[data-font="l"] body{zoom:1.15}
html[data-font="xl"] body{zoom:1.30}
@media (min-width:1024px){
  html[data-font="xl"] body{zoom:1.18}
  html[data-font="l"] body{zoom:1.10}
}
html[data-font="l"] body,
html[data-font="xl"] body{letter-spacing:.2px}

/* ---------- 对比增强档（AAA 取向：去半透明、加字重、加深弱文字） ---------- */
html[data-contrast="high"] body,
html[data-contrast="high"] .card,
html[data-contrast="high"] .stat,
html[data-contrast="high"] .tabs,
html[data-contrast="high"] .dec{
  background-image:none!important;
}
html[data-contrast="high"] *{text-shadow:none!important}
html[data-contrast="high"] .hint,
html[data-contrast="high"] .cm,
html[data-contrast="high"] .sub,
html[data-contrast="high"] th,
html[data-contrast="high"] footer,
html[data-contrast="high"] .tab,
html[data-contrast="high"] .stat .lab{color:var(--ink-2)!important;font-weight:600!important}
html[data-contrast="high"] p,
html[data-contrast="high"] td,
html[data-contrast="high"] li,
html[data-contrast="high"] label{font-weight:500!important}
html[data-contrast="high"] .card,
html[data-contrast="high"] .stat{border-width:2px!important}

/* ---------- 色觉友好（不单靠颜色传达，WCAG 1.4.1） ---------- */
html[data-cb="on"]{
  --up:#1f6feb; --dn:#c97600; --danger:#1f6feb; --ok:#c97600;
}
/* 暗底主题下的色觉友好色：提亮以维持 ≥4.5:1 */
html[data-theme="xt2"][data-cb="on"]{
  --up:#7cb0ff; --dn:#ffbe5c; --danger:#7cb0ff; --ok:#ffbe5c;
}
html[data-cb="on"] .up::before,
html[data-cb="on"] .stat .num.red::before{content:"▲ ";font-size:.85em}
html[data-cb="on"] .dn::before,
html[data-cb="on"] .stat .num.green::before{content:"▼ ";font-size:.85em}
html[data-cb="on"] .warn::before{content:"! ";font-weight:800}

/* ---------- 双形态：单屏竖屏单列 / 大横屏多栏（自动选择） ---------- */
html[data-theme]:not([data-theme="default"]) .grid,
html[data-theme]:not([data-theme="default"]) .cards,
html[data-theme]:not([data-theme="default"]) .stat-cards{display:grid;grid-template-columns:1fr;gap:12px}
@media (min-width:1024px){
  html[data-theme]:not([data-theme="default"]) .page{max-width:1440px;margin:0 auto}
  html[data-theme]:not([data-theme="default"]) .grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  html[data-theme]:not([data-theme="default"]) .cards{grid-template-columns:repeat(3,minmax(0,1fr))}
  html[data-theme]:not([data-theme="default"]) .grid3,
  html[data-theme]:not([data-theme="default"]) .stat-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (max-width:420px){
  html[data-theme]:not([data-theme="default"]) .card{padding:12px}
  html[data-theme]:not([data-theme="default"]) table{font-size:13px}
}
@media (prefers-reduced-motion:reduce){
  html[data-theme] *{animation-duration:.001ms!important;transition-duration:.001ms!important}
}
@media print{
  html[data-theme] body{background:#fff!important;color:#000!important;zoom:1!important}
  html[data-theme] .card,html[data-theme] .stat{background:#fff!important;color:#000!important;border-color:#999!important}
  #__pref_bar,#__pref_toast{display:none!important}
}


/* ==== 自动生成的全量兜底覆盖（2026-11-05 对比度修复）==== */
/* 浅色底块 → 暗色面，消除「浅底＋浅字」不可见 */
html[data-theme="xt2"] .field input:focus{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .field select:focus{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .field textarea:focus{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .rec{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .evtline{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .dist-acc{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .dist-acc summary{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .dept-tab tr.gray td{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .evtline.ok{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #zoom_panel{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #zoom_panel button{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .fake-sel{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .fake-sel:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #casc_sheet{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #casc_back{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #casc_close{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .casc-area:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .casc-proj:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .casc-sub{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .casc-sub:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #done_full{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #done_full .df-no{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #done_full .df-card{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #confirm_full{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #confirm_full .cf-card{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .mtodo .mt_cnt{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .mtodo .mt_it{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .sk-card{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .msg-row.overdue{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .drill-dist{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .drill-row{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] details.why{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] details.why.redb{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] details.pitem{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .gfold-head{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .gfold-head:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .fold-dist{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .fold-dist.abn{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .fold-head{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .fold-head:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .fold-dist.abn .fold-head{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .fold-bdg.y{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .fold-proj{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .dockbtn{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .dockbtn:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #prio_list .pitem{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #prio_list .pitem:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #prio_list .pchip{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #prio_list .pchip.ok{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #nav5{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #p0_search{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #more_panel{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #more_hd input{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #more_close{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #more_grid .mg{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #ck_panel{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] #ck_close{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .ck_card{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"] .rec .kv,
html[data-theme="xt2"] .rec .kv b,
html[data-theme="xt2"] .evtline,
html[data-theme="xt2"] .hb-fold summary,
html[data-theme="xt2"] #zoom_panel button,
html[data-theme="xt2"] .fake-sel .ph,
html[data-theme="xt2"] .fake-sel .arw,
html[data-theme="xt2"] #casc_head .ct,
html[data-theme="xt2"] #casc_back,
html[data-theme="xt2"] #casc_close,
html[data-theme="xt2"] .casc-area,
html[data-theme="xt2"] .casc-area .cs{color:var(--ink-2)!important}
html[data-theme="xt2"] .casc-proj .pn,
html[data-theme="xt2"] .casc-proj .pm,
html[data-theme="xt2"] .casc-proj .ck,
html[data-theme="xt2"] .casc-sub .pn,
html[data-theme="xt2"] .casc-sub .pm,
html[data-theme="xt2"] .casc-title,
html[data-theme="xt2"] #done_full .df-t1,
html[data-theme="xt2"] #done_full .df-t2,
html[data-theme="xt2"] #done_full .df-no .nv,
html[data-theme="xt2"] #done_full .df-card,
html[data-theme="xt2"] #confirm_full .cf-t1,
html[data-theme="xt2"] #confirm_full .cf-t2{color:var(--ink-2)!important}
html[data-theme="xt2"] #confirm_full .cf-card,
html[data-theme="xt2"] #confirm_full .cf-card td.v,
html[data-theme="xt2"] .mtodo .mt_panel,
html[data-theme="xt2"] .mtodo .mt_it .t,
html[data-theme="xt2"] .drill-row .rd,
html[data-theme="xt2"] details.why .wbody,
html[data-theme="xt2"] .g29zone.proj>h4,
html[data-theme="xt2"] .fold-proj .rd,
html[data-theme="xt2"] .fold-proj .rd b,
html[data-theme="xt2"] #prio_list .ptitle,
html[data-theme="xt2"] #prio_list .pmeta2,
html[data-theme="xt2"] #prio_list .pchip{color:var(--ink-2)!important}
html[data-theme="xt2"] #prio_list .pchip.ok,
html[data-theme="xt2"] #nav5 .nv,
html[data-theme="xt2"] #more_close,
html[data-theme="xt2"] #more_grid .mg span,
html[data-theme="xt2"] #ck_close,
html[data-theme="xt2"] .ck_sec,
html[data-theme="xt2"] .ck_card .vl,
html[data-theme="xt2"] .ck_card .sb,
html[data-theme="xt2"] .ck_card.ck_warn .vl,
html[data-theme="xt2"] .ck_card.ck_ok .vl,
html[data-theme="xt2"] .ck_up,
html[data-theme="xt2"] .ck_dn{color:var(--ink-2)!important}
html[data-theme="xt2"] .dist-acc summary::before,
html[data-theme="xt2"] .fold-head .fn .arr{color:var(--info)!important}
html[data-theme="xt2"] .dept-tab td.redtxt,
html[data-theme="xt2"] .msg-row .od{color:var(--danger)!important}
html[data-theme="xt2"] #done_full .df-ok,
html[data-theme="xt2"] .msg-row .od.ok{color:var(--ok)!important}
html[data-theme="xt2"] #done_full .df-no .nl,
html[data-theme="xt2"] #confirm_full .cf-card td.k,
html[data-theme="xt2"] details.why summary,
html[data-theme="xt2"] .fold-bdg.y{color:var(--accent)!important}
/* 旧开关兼容：与 xt2 主题同等兜底 */
/* ==== 自动生成的全量兜底覆盖（2026-11-05 对比度修复）==== */
/* 浅色底块 → 暗色面，消除「浅底＋浅字」不可见 */
html[data-xt2="on"] .field input:focus{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .field select:focus{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .field textarea:focus{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .rec{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .evtline{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .dist-acc{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .dist-acc summary{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .dept-tab tr.gray td{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .evtline.ok{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #zoom_panel{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #zoom_panel button{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .fake-sel{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .fake-sel:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #casc_sheet{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #casc_back{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #casc_close{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .casc-area:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .casc-proj:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .casc-sub{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .casc-sub:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #done_full{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #done_full .df-no{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #done_full .df-card{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #confirm_full{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #confirm_full .cf-card{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .mtodo .mt_cnt{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .mtodo .mt_it{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .sk-card{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .msg-row.overdue{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .drill-dist{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .drill-row{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] details.why{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] details.why.redb{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] details.pitem{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .gfold-head{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .gfold-head:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .fold-dist{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .fold-dist.abn{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .fold-head{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .fold-head:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .fold-dist.abn .fold-head{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .fold-bdg.y{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .fold-proj{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .dockbtn{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .dockbtn:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #prio_list .pitem{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #prio_list .pitem:active{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #prio_list .pchip{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #prio_list .pchip.ok{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #nav5{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #p0_search{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #more_panel{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #more_hd input{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #more_close{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #more_grid .mg{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #ck_panel{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] #ck_close{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .ck_card{background:var(--surface)!important;color:var(--ink)!important}
html[data-xt2="on"] .rec .kv,
html[data-xt2="on"] .rec .kv b,
html[data-xt2="on"] .evtline,
html[data-xt2="on"] .hb-fold summary,
html[data-xt2="on"] #zoom_panel button,
html[data-xt2="on"] .fake-sel .ph,
html[data-xt2="on"] .fake-sel .arw,
html[data-xt2="on"] #casc_head .ct,
html[data-xt2="on"] #casc_back,
html[data-xt2="on"] #casc_close,
html[data-xt2="on"] .casc-area,
html[data-xt2="on"] .casc-area .cs{color:var(--ink-2)!important}
html[data-xt2="on"] .casc-proj .pn,
html[data-xt2="on"] .casc-proj .pm,
html[data-xt2="on"] .casc-proj .ck,
html[data-xt2="on"] .casc-sub .pn,
html[data-xt2="on"] .casc-sub .pm,
html[data-xt2="on"] .casc-title,
html[data-xt2="on"] #done_full .df-t1,
html[data-xt2="on"] #done_full .df-t2,
html[data-xt2="on"] #done_full .df-no .nv,
html[data-xt2="on"] #done_full .df-card,
html[data-xt2="on"] #confirm_full .cf-t1,
html[data-xt2="on"] #confirm_full .cf-t2{color:var(--ink-2)!important}
html[data-xt2="on"] #confirm_full .cf-card,
html[data-xt2="on"] #confirm_full .cf-card td.v,
html[data-xt2="on"] .mtodo .mt_panel,
html[data-xt2="on"] .mtodo .mt_it .t,
html[data-xt2="on"] .drill-row .rd,
html[data-xt2="on"] details.why .wbody,
html[data-xt2="on"] .g29zone.proj>h4,
html[data-xt2="on"] .fold-proj .rd,
html[data-xt2="on"] .fold-proj .rd b,
html[data-xt2="on"] #prio_list .ptitle,
html[data-xt2="on"] #prio_list .pmeta2,
html[data-xt2="on"] #prio_list .pchip{color:var(--ink-2)!important}
html[data-xt2="on"] #prio_list .pchip.ok,
html[data-xt2="on"] #nav5 .nv,
html[data-xt2="on"] #more_close,
html[data-xt2="on"] #more_grid .mg span,
html[data-xt2="on"] #ck_close,
html[data-xt2="on"] .ck_sec,
html[data-xt2="on"] .ck_card .vl,
html[data-xt2="on"] .ck_card .sb,
html[data-xt2="on"] .ck_card.ck_warn .vl,
html[data-xt2="on"] .ck_card.ck_ok .vl,
html[data-xt2="on"] .ck_up,
html[data-xt2="on"] .ck_dn{color:var(--ink-2)!important}
html[data-xt2="on"] .dist-acc summary::before,
html[data-xt2="on"] .fold-head .fn .arr{color:var(--info)!important}
html[data-xt2="on"] .dept-tab td.redtxt,
html[data-xt2="on"] .msg-row .od{color:var(--danger)!important}
html[data-xt2="on"] #done_full .df-ok,
html[data-xt2="on"] .msg-row .od.ok{color:var(--ok)!important}
html[data-xt2="on"] #done_full .df-no .nl,
html[data-xt2="on"] #confirm_full .cf-card td.k,
html[data-xt2="on"] details.why summary,
html[data-xt2="on"] .fold-bdg.y{color:var(--accent)!important}

/* ==== 2026-11-05 二次修复：内联样式/ID 级浅底残留（浏览器计算样式反查）==== */
html[data-theme="xt2"], html[data-xt2="on"] #mt_panel{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #findkey_box{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #wb_car_state{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #xg_guide{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #dl_tip{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #rng_lab{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #ppt_quota_bar{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #wb_hqd_note{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #push_curfew_tip{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #goal_form_tag{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #goal_import_tag{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #goal_pending_tag{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #pv_body{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #comp_ym{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #ck_card{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #casc_head{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #casc_panel{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #zoom_panel{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #done_full{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #confirm_full{background:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] div[style*="background"], html[data-theme="xt2"], html[data-xt2="on"] span[style*="background"], html[data-theme="xt2"], html[data-xt2="on"] section[style*="background"]{background-color:var(--surface)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] button:not(.btn):not(#__pref_set){background:var(--surface-2)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="xt2"], html[data-xt2="on"] input:not([type="checkbox"]):not([type="radio"]){background:var(--surface-2)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] .mt_panel, html[data-theme="xt2"], html[data-xt2="on"] .rnglab, html[data-theme="xt2"], html[data-xt2="on"] .tag.d, html[data-theme="xt2"], html[data-xt2="on"] .ck_card{background:var(--surface-2)!important;color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #__pref_panel, html[data-theme="xt2"], html[data-xt2="on"] #__pref_panel *{color:#1c1c22!important}

/* ==== 三次修复：通配兜底（解决内联 style 与未登记选择器的深色字）==== */
html[data-theme="xt2"], html[data-xt2="on"] body *{color:var(--ink)!important}
html[data-theme="xt2"], html[data-xt2="on"] #__pref_bar, html[data-theme="xt2"], html[data-xt2="on"] #__pref_bar *{color:#1c1c22!important}
html[data-theme="xt2"], html[data-xt2="on"] #__pref_bar button{color:#ffffff!important}
html[data-theme="xt2"], html[data-xt2="on"] #__pref_bar button.ghost{color:#222222!important}
html[data-theme="xt2"], html[data-xt2="on"] h1, html[data-theme="xt2"], html[data-xt2="on"] h2, html[data-theme="xt2"], html[data-xt2="on"] h3, html[data-theme="xt2"], html[data-xt2="on"] .card h3, html[data-theme="xt2"], html[data-xt2="on"] .tab.on, html[data-theme="xt2"], html[data-xt2="on"] .opt, html[data-theme="xt2"], html[data-xt2="on"] .btn.ghost, html[data-theme="xt2"], html[data-xt2="on"] .calc, html[data-theme="xt2"], html[data-xt2="on"] .stat .num, html[data-theme="xt2"], html[data-xt2="on"] .gold, html[data-theme="xt2"], html[data-xt2="on"] .accent, html[data-theme="xt2"], html[data-xt2="on"] .tag.y, html[data-theme="xt2"], html[data-xt2="on"] .num.gold, html[data-theme="xt2"], html[data-xt2="on"] .fold-bdg.y, html[data-theme="xt2"], html[data-xt2="on"] #casc_head .ct, html[data-theme="xt2"], html[data-xt2="on"] .df-t1, html[data-theme="xt2"], html[data-xt2="on"] .cf-t1{color:var(--accent)!important}
html[data-theme="xt2"], html[data-xt2="on"] .hint, html[data-theme="xt2"], html[data-xt2="on"] .cm, html[data-theme="xt2"], html[data-xt2="on"] .sub, html[data-theme="xt2"], html[data-xt2="on"] th, html[data-theme="xt2"], html[data-xt2="on"] .stat .lab, html[data-theme="xt2"], html[data-xt2="on"] .tab, html[data-theme="xt2"], html[data-xt2="on"] footer, html[data-theme="xt2"], html[data-xt2="on"] .field label, html[data-theme="xt2"], html[data-xt2="on"] .muted, html[data-theme="xt2"], html[data-xt2="on"] .gray, html[data-theme="xt2"], html[data-xt2="on"] .kv, html[data-theme="xt2"], html[data-xt2="on"] .arw, html[data-theme="xt2"], html[data-xt2="on"] .pn, html[data-theme="xt2"], html[data-xt2="on"] .pm, html[data-theme="xt2"], html[data-xt2="on"] .t2, html[data-theme="xt2"], html[data-xt2="on"] .note, html[data-theme="xt2"], html[data-xt2="on"] .small, html[data-theme="xt2"], html[data-xt2="on"] .lab{color:var(--ink-3)!important}
html[data-theme="xt2"], html[data-xt2="on"] .up, html[data-theme="xt2"], html[data-xt2="on"] .stat .num.red, html[data-theme="xt2"], html[data-xt2="on"] .warn, html[data-theme="xt2"], html[data-xt2="on"] .req, html[data-theme="xt2"], html[data-xt2="on"] .red, html[data-theme="xt2"], html[data-xt2="on"] .redtxt, html[data-theme="xt2"], html[data-xt2="on"] .bad, html[data-theme="xt2"], html[data-xt2="on"] .err, html[data-theme="xt2"], html[data-xt2="on"] .danger, html[data-theme="xt2"], html[data-xt2="on"] .over, html[data-theme="xt2"], html[data-xt2="on"] .overdue, html[data-theme="xt2"], html[data-xt2="on"] .nl, html[data-theme="xt2"], html[data-xt2="on"] .nv, html[data-theme="xt2"], html[data-xt2="on"] .df-no .nv, html[data-theme="xt2"], html[data-xt2="on"] .tag.d, html[data-theme="xt2"], html[data-xt2="on"] .rnglab{color:var(--danger)!important}
html[data-theme="xt2"], html[data-xt2="on"] .dn, html[data-theme="xt2"], html[data-xt2="on"] .stat .num.green, html[data-theme="xt2"], html[data-xt2="on"] .green, html[data-theme="xt2"], html[data-xt2="on"] .ok, html[data-theme="xt2"], html[data-xt2="on"] .good, html[data-theme="xt2"], html[data-xt2="on"] .done, html[data-theme="xt2"], html[data-xt2="on"] .df-ok, html[data-theme="xt2"], html[data-xt2="on"] .od.ok, html[data-theme="xt2"], html[data-xt2="on"] .tag.g{color:var(--dn)!important}
html[data-theme="xt2"], html[data-xt2="on"] a, html[data-theme="xt2"], html[data-xt2="on"] .info, html[data-theme="xt2"], html[data-xt2="on"] .link, html[data-theme="xt2"], html[data-xt2="on"] .blue, html[data-theme="xt2"], html[data-xt2="on"] .cs, html[data-theme="xt2"], html[data-xt2="on"] .ct{color:var(--info)!important}
html[data-theme="xt2"], html[data-xt2="on"] .btn, html[data-theme="xt2"], html[data-xt2="on"] .btn:not(.gold){color:#ffffff!important}
html[data-theme="xt2"], html[data-xt2="on"] .btn.gold, html[data-theme="xt2"], html[data-xt2="on"] .bd, html[data-theme="xt2"], html[data-xt2="on"] .opt[aria-pressed="true"]{color:#14101c!important}
