/* ===== Pro 深色主题（作用域化版）：全部规则限定在 html[data-theme="dark"] 下 =====
   浅色为默认（theme-pro.css 无条件生效）；切换由 html[data-theme] 控制，localStorage 持久化。
   生成方式：脚本把原始选择器逐条加前缀（:root → html[data-theme="dark"]）。
   备份：theme-pro-dark.css.bak-scope */

/* ===== Pro 企业级主题 · 深色模式 =====
   设计依据（取自 Ant Design 5.29 的 dark 主题源码，非凭印象）：
     antd/es/theme/themes/dark/colors.js ——
       colorText rgba(255,255,255,.85) / Secondary .65 / Tertiary .45 / Quaternary .25
       colorFill rgba(255,255,255,.18) / .12 / .08 / .04
       colorBgLayout #000000   colorBgContainer #141414   colorBgElevated #1F1F1F   colorBgSpotlight #424242
       colorBorder #424242     colorBorderSecondary #303030
     darkAlgorithm 下的色板（@ant-design/colors theme:dark）——
       blue #1668DC（hover #3C89E8 / active #1554AD）、green #49AA19、gold #D89614、
       red #DC4446、purple #854ECA、orange #D87A16
   用法：在 css/theme-pro.css **之后**引用即可整页切换为深色；只覆盖变量与少量深色专属修正。
   关键点：深色下的"大厂灰"同样是透明度体系，方向与浅色相反（黑→白）。 */

html[data-theme="dark"]{
  /* 主色（dark 色板） */
  --c-primary:#1668DC;--c-primary-h:#3C89E8;--c-primary-a:#1554AD;
  --c-primary-bg:rgba(22,104,220,.16);--c-primary-bd:#15325B;--c-primary-ring:rgba(22,104,220,.28);
  /* 语义色（dark 色板 + 半透明底） */
  --c-success:#49AA19;--c-success-bg:rgba(73,170,25,.14);--c-success-bd:#274916;
  --c-warning:#D89614;--c-warning-bg:rgba(216,150,20,.14);--c-warning-bd:#594214;
  --c-error:#DC4446;--c-error-bg:rgba(220,68,70,.14);--c-error-bd:#5A1F1F;
  --c-purple:#854ECA;--c-purple-bg:rgba(133,78,202,.14);--c-purple-bd:#3C2A55;
  --c-cyan:#13C2C2;--c-cyan-bg:rgba(19,194,194,.14);--c-cyan-bd:#10464B;
  --c-orange:#D87A16;--c-orange-bg:rgba(216,122,22,.14);--c-orange-bd:#593815;
  /* 中性色（AntD dark 真实值） */
  --t-1:rgba(255,255,255,.85);--t-2:rgba(255,255,255,.65);--t-3:rgba(255,255,255,.45);--t-4:rgba(255,255,255,.25);
  --f-1:rgba(255,255,255,.18);--f-2:rgba(255,255,255,.12);--f-3:rgba(255,255,255,.08);--f-4:rgba(255,255,255,.04);
  --bg-layout:#000000;--bg-container:#141414;--bg-elevated:#1F1F1F;--bg-spotlight:#424242;
  --bd:#424242;--bd-2:#303030;
  /* 派生变量（浅色下为浅底，深色下改为略亮于容器） */
  --table-head-bg:#1D1D1D;--table-row-hover:#1D1D1D;--bg-subtle:#1D1D1D;
  --tag-blue-text:#3C89E8;--tag-green-text:#49AA19;--tag-red-text:#DC4446;--tag-orange-text:#D87A16;
  --btn-shadow:none;--btn-primary-shadow:0 2px 0 rgba(0,0,0,.2);
  --seg-shadow:0 1px 2px rgba(0,0,0,.3);--seg-active-bg:#424242;
  --topbar-shadow:0 1px 2px rgba(0,0,0,.3);--mask-bg:rgba(0,0,0,.65);
  --sh-1:0 1px 2px 0 rgba(0,0,0,.35),0 1px 6px -1px rgba(0,0,0,.25),0 2px 4px 0 rgba(0,0,0,.2);
  --sh-2:0 6px 16px 0 rgba(0,0,0,.5),0 3px 6px -4px rgba(0,0,0,.4),0 9px 28px 8px rgba(0,0,0,.25);
  --sh-3:0 6px 16px 0 rgba(0,0,0,.5),0 3px 6px -4px rgba(0,0,0,.4),0 9px 28px 8px rgba(0,0,0,.25);
  --select-arrow:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 4.6L6 8l3.4-3.4' fill='none' stroke='rgba(255,255,255,.45)' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- 画布与卡片 ---------- */
html[data-theme="dark"] body{background:var(--bg-layout);color:var(--t-1)}
html[data-theme="dark"] .content{background:var(--bg-layout)}
html[data-theme="dark"] .card{background:var(--bg-container);border-color:var(--bd-2)}

/* ---------- 统计卡 ---------- */
html[data-theme="dark"] .pro-stat{background:var(--bg-container);border-color:var(--bd-2)}
html[data-theme="dark"] .pro-stat:hover{box-shadow:var(--sh-2)}
html[data-theme="dark"] .pro-stat-desc{color:var(--t-3)}

/* ---------- 提示条 ---------- */
html[data-theme="dark"] .pro-alert{background:var(--c-primary-bg);border-color:var(--c-primary-bd);color:var(--t-2)}
html[data-theme="dark"] .pro-alert b{color:var(--t-1)}

/* ---------- 筛选组件 ---------- */
html[data-theme="dark"] .pro-filter-label{color:var(--t-3)}
html[data-theme="dark"] .pro-seg{background:var(--f-3)}
html[data-theme="dark"] .pro-seg button{color:var(--t-2)}
html[data-theme="dark"] .pro-seg button:hover{color:var(--t-1)}
html[data-theme="dark"] .pro-seg button.active{background:var(--seg-active-bg);color:var(--t-1)}
html[data-theme="dark"] .pro-chip{background:transparent;border-color:var(--bd);color:var(--t-2)}
html[data-theme="dark"] .pro-chip:hover{background:var(--c-primary-bg);border-color:var(--c-primary-bd);color:var(--c-primary-h)}
html[data-theme="dark"] .pro-chip.active{background:var(--c-primary-bg);border-color:var(--c-primary);color:var(--c-primary-h)}

/* ---------- 表格 ---------- */
html[data-theme="dark"] .tbl th{background:var(--table-head-bg);color:var(--t-1);border-bottom-color:var(--bd-2)}
html[data-theme="dark"] .tbl td{border-bottom-color:var(--bd-2);color:var(--t-1)}
html[data-theme="dark"] .tbl tbody tr:hover{background:var(--table-row-hover)}
html[data-theme="dark"] .tbl .num{color:var(--t-2)}
html[data-theme="dark"] .tbl .idf,
html[data-theme="dark"] .tbl code{background:var(--c-primary-bg);color:var(--c-primary-h);border-color:var(--c-primary-bd)}

/* ---------- 控件 ---------- */
html[data-theme="dark"] .input,.select{background:var(--bg-container);border-color:var(--bd);color:var(--t-1)}
html[data-theme="dark"] .input::placeholder{color:var(--t-4)}
html[data-theme="dark"] .input:hover,.select:hover{border-color:var(--c-primary-h)}
html[data-theme="dark"] .input:focus,
html[data-theme="dark"] .select:focus{border-color:var(--c-primary);box-shadow:0 0 0 2px var(--c-primary-ring)}
html[data-theme="dark"] .input[readonly]{background:var(--f-3);color:var(--t-2)}
html[data-theme="dark"] .select option{background:var(--bg-elevated);color:var(--t-1)}
html[data-theme="dark"] .btn{background:var(--bg-container);border-color:var(--bd);color:var(--t-1)}
html[data-theme="dark"] .btn:hover{color:var(--c-primary-h);border-color:var(--c-primary);background:var(--bg-container)}
html[data-theme="dark"] .btn-primary{background:var(--c-primary);border-color:var(--c-primary);color:#fff}
html[data-theme="dark"] .btn-primary:hover{background:var(--c-primary-h);border-color:var(--c-primary-h)}
html[data-theme="dark"] .btn[disabled],.btn[disabled]:hover{background:var(--f-3);border-color:var(--bd);color:var(--t-4)}
html[data-theme="dark"] .btn-danger{color:var(--c-error);border-color:var(--c-error-bd)}
html[data-theme="dark"] .btn-danger:hover{background:var(--c-error);border-color:var(--c-error);color:#fff}
html[data-theme="dark"] .link{color:var(--c-primary-h)}
html[data-theme="dark"] .link:hover{color:var(--c-primary)}
html[data-theme="dark"] .link.danger{color:var(--c-error)}
html[data-theme="dark"] .link.danger:hover{color:#FF7875}

/* ---------- 标签 ---------- */
html[data-theme="dark"] .tag-gray{background:var(--f-3);color:var(--t-2);border-color:var(--bd)}
html[data-theme="dark"] .chip{background:var(--f-3);color:var(--t-2);border-color:var(--bd)}

/* ---------- 弹窗 ---------- */
html[data-theme="dark"] .mask{background:var(--mask-bg)}
html[data-theme="dark"] .dialog{background:var(--bg-elevated)}
html[data-theme="dark"] .dialog-head{border-bottom-color:var(--bd-2);color:var(--t-1)}
html[data-theme="dark"] .dialog-close{color:var(--t-3)}
html[data-theme="dark"] .dialog-close:hover{background:var(--f-2);color:var(--t-1)}
html[data-theme="dark"] .dialog-foot{border-top-color:var(--bd-2);background:var(--f-4)}
html[data-theme="dark"] .form-row label{color:var(--t-1)}
html[data-theme="dark"] .std-card{background:var(--f-4);border-color:var(--bd-2)}
html[data-theme="dark"] .std-kv{color:var(--t-2)}
html[data-theme="dark"] .std-kv .k{color:var(--t-3)}

/* ---------- 顶栏 ---------- */
html[data-theme="dark"] .topbar{background:var(--bg-container);border-bottom-color:var(--bd-2);box-shadow:var(--topbar-shadow)}
html[data-theme="dark"] .crumb{color:var(--t-3)}
html[data-theme="dark"] .crumb b{color:var(--t-1)}
html[data-theme="dark"] .top-right .proj{background:var(--f-3);border-color:var(--bd-2);color:var(--t-2)}
html[data-theme="dark"] .top-right .noti{color:var(--t-2)}
html[data-theme="dark"] .top-right .noti:hover{background:var(--f-3);color:var(--t-1)}
html[data-theme="dark"] .top-right .noti-badge{box-shadow:0 0 0 1.5px var(--bg-container)}
html[data-theme="dark"] .top-right .user{color:var(--t-2)}
html[data-theme="dark"] .top-right .user:hover{background:var(--f-3)}

/* ---------- 侧栏（深色） ---------- */
html[data-theme="dark"] .sidebar{background:var(--bg-container);border-right-color:var(--bd-2)}
html[data-theme="dark"] .sidebar .brand{background:var(--bg-container);border-bottom-color:var(--bd-2)}
html[data-theme="dark"] .sidebar .brand .name{color:var(--t-1)}
html[data-theme="dark"] .sidebar .brand .name small{color:var(--t-3)}
/* 品牌 logo 换用深底版本 */
html[data-theme="dark"] .sidebar .brand img{content:url("../logo-bevone-dark.png")}
html[data-theme="dark"] .sidebar .nav-title{color:var(--t-3)!important}
html[data-theme="dark"] .sidebar .nav-item{color:var(--t-2)!important}
html[data-theme="dark"] .sidebar .nav-item:hover{background:var(--f-3)!important;color:var(--t-1)!important}
html[data-theme="dark"] .sidebar .nav-item.active{background:var(--c-primary-bg)!important;color:var(--c-primary-h)!important}
html[data-theme="dark"] .sidebar .nav-item.active::before{background:var(--c-primary-h)}
html[data-theme="dark"] .sidebar #aswBtn{background:var(--f-3)!important;border-color:var(--bd-2)!important}
html[data-theme="dark"] .sidebar #aswBtn:hover{background:var(--f-2)!important;border-color:var(--bd)!important}
html[data-theme="dark"] .sidebar #aswBtn b{color:var(--t-1)!important}
html[data-theme="dark"] .sidebar #aswBtn span{color:var(--t-3)!important}
html[data-theme="dark"] .sidebar #aswBtn > span:last-child{color:var(--t-4)!important}
html[data-theme="dark"] .sidebar .asw-cur-ico{background:var(--c-primary-bg);color:var(--c-primary-h)}
html[data-theme="dark"] .sidebar .asw-item-ico{background:var(--f-3);color:var(--t-2)}
html[data-theme="dark"] .sidebar #aswMenu{background:var(--bg-elevated)!important;border-color:var(--bd-2)!important}
html[data-theme="dark"] .sidebar .asw-dir{color:var(--t-3)!important}
html[data-theme="dark"] .sidebar .asw-dir:hover{color:var(--t-1)!important}
html[data-theme="dark"] .sidebar .asw-arrow{color:var(--t-4)!important}
html[data-theme="dark"] .sidebar #rbacIdSel{background:var(--f-3)!important;border-color:var(--bd)!important;color:var(--t-1)!important}
html[data-theme="dark"] .sidebar #rbacIdSel:hover{border-color:var(--c-primary-h)!important}
html[data-theme="dark"] .sidebar #rbacIdSel:focus{border-color:var(--c-primary)!important;box-shadow:0 0 0 2px var(--c-primary-ring)!important}
html[data-theme="dark"] .sidebar #rbacIdSel option,.sidebar select option{background:var(--bg-elevated);color:var(--t-1)}

/* ---------- 滚动条 ---------- */
html[data-theme="dark"] .content::-webkit-scrollbar-thumb{background:var(--f-1)}
html[data-theme="dark"] .content::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.25)}
html[data-theme="dark"] .sidebar .nav::-webkit-scrollbar-thumb{background:var(--f-1)}

/* ---------- 空态 ---------- */
html[data-theme="dark"] .empty{color:var(--t-3)}

/* ---------- 主题切换按钮（深色） ---------- */
html[data-theme="dark"] .theme-toggle{background:var(--bg-elevated);border-color:var(--bd);color:var(--t-2)}
html[data-theme="dark"] .theme-toggle:hover{color:var(--c-primary-h);border-color:var(--c-primary-bd);background:rgba(22,104,220,.12)}

/* ---------- 顶栏返回按钮（浅色主题下是白底，深色下改为容器色） ---------- */
html[data-theme="dark"] .btn-back{background:var(--bg-elevated);border-color:var(--bd);color:var(--t-2)}
html[data-theme="dark"] .btn-back:hover{color:var(--c-primary-h);border-color:var(--c-primary-bd)}

/* ===== 按钮可读性修正（2026-10-08）：与 theme-pro.css 同步 =====
   主按钮 hover/active 改用更深蓝（白字对比度约 6.4）；禁用按钮提高文字对比度。 */
html[data-theme="dark"] .btn-primary:hover{background:#1554AD;border-color:#1554AD;color:#fff}
html[data-theme="dark"] .btn-primary:active{background:#0F3E82;border-color:#0F3E82;color:#fff}
html[data-theme="dark"] .btn[disabled],html[data-theme="dark"] .btn[disabled]:hover{opacity:1;color:rgba(255,255,255,.62);background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.22)}
