/* ============================================================
   Dark Theme Overrides  –  dp-dark-mode
   Applied when <html class="dark"> is set
   ============================================================ */

html.dark {
    color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────── */
html.dark body {
    background-color: #0d1421 !important;
    color: #c9d1e0 !important;
}

/* ── Scrollbar ────────────────────────────────────────────── */
html.dark ::-webkit-scrollbar-track { background: transparent !important; }
html.dark ::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.35) !important; }

/* ══════════════════════════════════════════════════════════
   MEMBER.HTML – 主壳
   ══════════════════════════════════════════════════════════ */

/* 侧边栏 */
html.dark .new-sidebar {
    background: #151c2d !important;
    border-right-color: #1e2a45 !important;
    box-shadow: 2px 0 12px rgba(0,0,0,0.3) !important;
}
html.dark .sidebar-brand {
    border-bottom-color: #1e2a45 !important;
}
html.dark .sidebar-brand-name { color: #e2e8f0 !important; }
html.dark .sidebar-brand-version {
    color: #818cf8 !important;
    background: #1e2638 !important;
}
html.dark .sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(99,102,241,0.25) !important;
}
html.dark .menu-group-title { color: #4a5778 !important; }
html.dark .menu-item { color: #7c8db5 !important; text-decoration: none !important; }
html.dark .menu-item:hover {
    background: #1e2535 !important;
    color: #c9d1e0 !important;
}
html.dark .menu-item.active { color: #818cf8 !important; }
html.dark .menu-icon-wrap { background: #1e2535 !important; }
html.dark .menu-item:hover .menu-icon-wrap { background: #252f4a !important; }

/* 侧边栏系统切换 */
html.dark .sidebar-sys-switch {
    background: #151c2d !important;
    border-top-color: #1e2a45 !important;
}
html.dark .sidebar-sys-tabs { background: #1e2535 !important; }
html.dark .sidebar-sys-tab { color: #7c8db5 !important; }
html.dark .sidebar-sys-tab:not(.active):hover { color: #c9d1e0 !important; }
html.dark .sidebar-sys-tab.active {
    background: #252f4a !important;
    color: #818cf8 !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.35) !important;
}

/* 顶部导航栏 */
html.dark .new-header {
    background: #151c2d !important;
    border-bottom-color: #1e2a45 !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.25) !important;
}
html.dark .header-breadcrumb-root { color: #4a5778 !important; }
html.dark .header-breadcrumb-sep  { color: #2d3554 !important; }
html.dark .header-breadcrumb-cur  { color: #e2e8f0 !important; }
html.dark .header-breadcrumb-refresh { color: #7c8db5 !important; }
html.dark .header-breadcrumb-refresh:hover { background: #1e2535 !important; color: #818cf8 !important; }
html.dark .header-btn { color: #7c8db5 !important; }
html.dark .header-btn:hover { background: #1e2535 !important; color: #818cf8 !important; }
html.dark .header-btn.fullscreen-active { background: #1e2638 !important; color: #818cf8 !important; border-color: #3a4270 !important; }

/* 系统切换标签 */
html.dark .sys-tabs { background: #1e2535 !important; }
html.dark .sys-tab  { color: #7c8db5 !important; }
html.dark .sys-tab.active {
    background: #252f4a !important;
    color: #818cf8 !important;
    box-shadow: 0 1px 6px rgba(0,0,0,0.3) !important;
}

/* 用户区 */
html.dark .header-user:hover { background: #1e2535 !important; }
html.dark .header-user-name  { color: #e2e8f0 !important; }
html.dark .header-user-role  { color: #818cf8 !important; background: #1e2638 !important; }
html.dark .header-user-chevron { color: #7c8db5 !important; }

/* 用户下拉菜单 */
html.dark .user-dropdown {
    background: #1a2236 !important;
    border-color: #1e2a45 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.45) !important;
}
html.dark .user-dropdown-header  { border-bottom-color: #1e2a45 !important; }
html.dark .user-dropdown-name    { color: #e2e8f0 !important; }
html.dark .user-dropdown-role    { color: #7c8db5 !important; }
html.dark .user-dropdown-item    { color: #9ca3af !important; }
html.dark .user-dropdown-item:hover { background: #252f4a !important; color: #e2e8f0 !important; }
html.dark .user-dropdown-item.danger:hover { background: rgba(239,68,68,0.12) !important; }
html.dark .user-dropdown-divider { background: #1e2a45 !important; }

/* 内容区 */
html.dark .content-area   { background: #0d1421 !important; }
html.dark .content-iframe { background: #111c30 !important; }
html.dark #page-loader,
html.dark #iframe-loader  { background: #0d1421 !important; }
html.dark .loader-bar     { background: #1e2535 !important; }
html.dark .loader-text, html.dark .iframe-loader-text { color: #4a5778 !important; }

/* 底部栏 */
html.dark .footer-bar { background: #0d1421 !important; }
html.dark .footer-copy { color: #4a5778 !important; }
html.dark .footer-divider { background: #1e2a45 !important; }

/* 弹窗 */
html.dark .modal-box {
    background: #1a2236 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}
html.dark .modal-header { border-bottom-color: #1e2a45 !important; }
html.dark .modal-header h3 { color: #e2e8f0 !important; }
html.dark .modal-close { color: #7c8db5 !important; }
html.dark .modal-close:hover { color: #e2e8f0 !important; }
html.dark .modal-body p { color: #9ca3af !important; }
html.dark .btn-cancel {
    background: #1e2535 !important;
    border-color: #1e2a45 !important;
    color: #9ca3af !important;
}
html.dark .btn-cancel:hover { background: #252f4a !important; }

/* Toast */
html.dark .order-notify-content {
    background: #1a2236 !important;
    color: #e2e8f0 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.45) !important;
}

/* ══════════════════════════════════════════════════════════
   子页通用组件（Glass 主题页面）
   ══════════════════════════════════════════════════════════ */

/* 卡片 */
html.dark .card,
html.dark .stat-card,
html.dark .chart-card {
    background: #1a2236 !important;
    border-color: #1e2a45 !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.25) !important;
}

/* 统计数值 */
html.dark .stat-value { color: #e2e8f0 !important; }
html.dark .stat-label { color: #7c8db5 !important; }
html.dark .stat-sub   { color: #7c8db5 !important; }

/* 输入框 */
html.dark .form-input {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #e2e8f0 !important;
}
html.dark .form-input:focus {
    background: #252f4a !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}
html.dark .form-input::placeholder { color: #4a5778 !important; }
html.dark select.form-input option { background: #1a2236 !important; color: #e2e8f0 !important; }

/* 幽灵按钮 */
html.dark .btn-ghost {
    background: #1e2535 !important;
    color: #9ca3af !important;
    border-color: #2d3554 !important;
}
html.dark .btn-ghost:hover {
    background: #252f4a !important;
    color: #818cf8 !important;
    border-color: #6366f1 !important;
}

/* 危险按钮（danger）已是红色，保持不变 */

/* 数据表格 */
html.dark .data-table th {
    background: #151c2d !important;
    border-bottom-color: #1e2a45 !important;
    color: #7c8db5 !important;
}
html.dark .data-table td {
    color: #c9d1e0 !important;
    border-bottom-color: #1e2a45 !important;
}
html.dark .data-table tr:hover td { background: #1e2535 !important; }

/* 分页 */
html.dark .page-link {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #7c8db5 !important;
}
html.dark .page-link:hover:not(.active):not(.disabled) {
    background: #252f4a !important;
    color: #818cf8 !important;
    border-color: #6366f1 !important;
}

/* 徽章 */
html.dark .badge-gray {
    background: #1e2535 !important;
    color: #9ca3af !important;
    border-color: #2d3554 !important;
}
html.dark .badge-blue   { background: rgba(59,130,246,0.12) !important; border-color: rgba(59,130,246,0.25) !important; }
html.dark .badge-green  { background: rgba(16,185,129,0.12) !important; border-color: rgba(16,185,129,0.25) !important; }
html.dark .badge-red    { background: rgba(239,68,68,0.12) !important;  border-color: rgba(239,68,68,0.25) !important;  }
html.dark .badge-orange { background: rgba(245,158,11,0.12) !important; border-color: rgba(245,158,11,0.25) !important; }

/* 操作按钮 */
html.dark .action-btn-blue    { background: rgba(59,130,246,0.12) !important; }
html.dark .action-btn-emerald { background: rgba(16,185,129,0.12) !important; }
html.dark .action-btn-red     { background: rgba(239,68,68,0.12) !important; }
html.dark .action-btn-orange  { background: rgba(245,158,11,0.12) !important; }

/* ── 通用文字颜色 ─────────────────────────────────────────── */
html.dark .text-slate-700,
html.dark .text-gray-700  { color: #c9d1e0 !important; }
html.dark .text-slate-500,
html.dark .text-gray-500  { color: #7c8db5 !important; }
html.dark .text-slate-400,
html.dark .text-gray-400  { color: #4a5778 !important; }

/* ── 通用背景 ─────────────────────────────────────────────── */
html.dark .bg-white      { background-color: #1a2236 !important; }
html.dark .bg-gray-50,
html.dark .bg-slate-50   { background-color: #151c2d !important; }
html.dark .bg-gray-100,
html.dark .bg-slate-100  { background-color: #1e2535 !important; }

/* ── 通用边框 ─────────────────────────────────────────────── */
html.dark .border-gray-200,
html.dark .border-slate-200 { border-color: #1e2a45 !important; }

/* ══════════════════════════════════════════════════════════
   游戏通道表单（game_view/*.html）Glass 输入组件
   ══════════════════════════════════════════════════════════ */
html.dark .glass-input {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #e2e8f0 !important;
}
html.dark .glass-input:focus {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(99,102,241,0.6) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}
html.dark .glass-input::placeholder { color: #4a5778 !important; }

html.dark .glass-section {
    background: rgba(255,255,255,0.03) !important;
    border-color: rgba(255,255,255,0.08) !important;
}
html.dark .glass-label  { color: #9ca3af !important; }
html.dark .glass-hint   { color: #4a5778 !important; }

/* ══════════════════════════════════════════════════════════
   Layui 组件暗色覆盖（用于旧页面兼容）
   ══════════════════════════════════════════════════════════ */
html.dark .layui-fluid { background: transparent !important; }

html.dark .layui-card {
    background-color: #1a2236 !important;
    border-color: #1e2a45 !important;
    box-shadow: none !important;
}
html.dark .layui-card-header {
    background: #151c2d !important;
    border-bottom-color: #1e2a45 !important;
    color: #e2e8f0 !important;
}
html.dark .layui-card-body { color: #c9d1e0 !important; }

html.dark .layui-form-label,
html.dark label.layui-form-label { color: #9ca3af !important; }
html.dark .layui-word-aux { color: #4a5778 !important; }

html.dark .layui-input,
html.dark .layui-textarea {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #e2e8f0 !important;
}
html.dark .layui-input::placeholder,
html.dark .layui-textarea::placeholder { color: #4a5778 !important; }

html.dark .layui-form-select .layui-input { background: #1e2535 !important; }
html.dark .layui-form-select dl {
    background: #1a2236 !important;
    border-color: #1e2a45 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
html.dark .layui-form-select dl dt { color: #7c8db5 !important; }
html.dark .layui-form-select dl dd { color: #c9d1e0 !important; }
html.dark .layui-form-select dl dd:hover,
html.dark .layui-form-select dl dd.layui-this { background: #252f4a !important; color: #e2e8f0 !important; }

html.dark .form-group-bottom {
    background-color: #1a2236 !important;
    box-shadow: 0 -1px 4px rgba(0,0,0,0.4) !important;
}

/* Layui 表格 */
html.dark .layui-table-box { background: #1a2236 !important; }
html.dark .layui-table th,
html.dark .layui-table-view .layui-table th {
    background-color: #151c2d !important;
    color: #7c8db5 !important;
    border-color: #1e2a45 !important;
}
html.dark .layui-table td,
html.dark .layui-table-view .layui-table td {
    background-color: #1a2236 !important;
    color: #c9d1e0 !important;
    border-color: #1e2a45 !important;
}
html.dark .layui-table-view .layui-table tr:hover td { background-color: #1e2535 !important; }
html.dark .layui-table-view .layui-table-header,
html.dark .layui-table-view .layui-table-footer {
    background: #151c2d !important;
    border-color: #1e2a45 !important;
}
html.dark .layui-table-view { border-color: #1e2a45 !important; }
html.dark .layui-table-cell  { background: inherit !important; }

/* Layui 分页 */
html.dark .layui-laypage a,
html.dark .layui-laypage span { background: #1e2535 !important; border-color: #2d3554 !important; color: #7c8db5 !important; }
html.dark .layui-laypage .layui-laypage-curr em:last-child {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #fff !important;
}
html.dark .layui-laypage a:hover { background: #252f4a !important; color: #818cf8 !important; }

/* Layui 按钮保持原色，仅调整禁用态 */
html.dark .layui-btn-primary {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #9ca3af !important;
}

/* Glass 确认弹窗（Layui 页面中混用的） */
html.dark .glass-confirm-content {
    background: #1a2236 !important;
    border-color: #1e2a45 !important;
}
html.dark .glass-confirm-title   { color: #e2e8f0 !important; }
html.dark .glass-confirm-message { color: #9ca3af !important; }
html.dark .glass-confirm-btn-cancel {
    background: #1e2535 !important;
    color: #9ca3af !important;
}
html.dark .glass-confirm-btn-cancel:hover { background: #252f4a !important; }

/* ══════════════════════════════════════════════════════════
   Tailwind 工具类覆盖（直接用在 HTML 标签中的类名）
   ══════════════════════════════════════════════════════════ */

/* ── 文字颜色 ─────────────────────────────────────────────── */
html.dark .text-gray-900 { color: #f1f5f9 !important; }
html.dark .text-gray-800 { color: #e2e8f0 !important; }
html.dark .text-gray-700 { color: #d4dae8 !important; }
html.dark .text-gray-600 { color: #b0bac9 !important; }
html.dark .text-gray-500 { color: #7c8db5 !important; }
html.dark .text-gray-400 { color: #4a5778 !important; }
html.dark .text-gray-300 { color: #3a4a6b !important; }

html.dark .text-slate-900 { color: #f1f5f9 !important; }
html.dark .text-slate-800 { color: #e2e8f0 !important; }
html.dark .text-slate-700 { color: #d4dae8 !important; }
html.dark .text-slate-600 { color: #b0bac9 !important; }
html.dark .text-slate-500 { color: #7c8db5 !important; }
html.dark .text-slate-400 { color: #4a5778 !important; }

/* ── 背景颜色 ─────────────────────────────────────────────── */
html.dark .bg-white       { background-color: #1a2236 !important; }
html.dark .bg-gray-50     { background-color: #151c2d !important; }
html.dark .bg-gray-100    { background-color: #1e2535 !important; }
html.dark .bg-gray-200    { background-color: #252f4a !important; }
html.dark .bg-slate-50    { background-color: #151c2d !important; }
html.dark .bg-slate-100   { background-color: #1e2535 !important; }
html.dark .bg-slate-200   { background-color: #252f4a !important; }
html.dark .bg-zinc-100    { background-color: #1e2535 !important; }

/* 浅色品牌背景（图标容器用）→ 保留色相，降低亮度 */
html.dark .bg-blue-50     { background-color: rgba(59,130,246,0.12) !important; }
html.dark .bg-blue-100    { background-color: rgba(59,130,246,0.18) !important; }
html.dark .bg-indigo-50   { background-color: rgba(99,102,241,0.12) !important; }
html.dark .bg-indigo-100  { background-color: rgba(99,102,241,0.18) !important; }
html.dark .bg-purple-50   { background-color: rgba(139,92,246,0.12) !important; }
html.dark .bg-violet-50   { background-color: rgba(139,92,246,0.12) !important; }
html.dark .bg-rose-50     { background-color: rgba(244,63,94,0.12) !important; }
html.dark .bg-red-50      { background-color: rgba(239,68,68,0.12) !important; }
html.dark .bg-red-100     { background-color: rgba(239,68,68,0.18) !important; }
html.dark .bg-green-50    { background-color: rgba(16,185,129,0.12) !important; }
html.dark .bg-green-100   { background-color: rgba(16,185,129,0.18) !important; }
html.dark .bg-emerald-50  { background-color: rgba(16,185,129,0.12) !important; }
html.dark .bg-teal-50     { background-color: rgba(20,184,166,0.12) !important; }
html.dark .bg-amber-50    { background-color: rgba(245,158,11,0.12) !important; }
html.dark .bg-yellow-50   { background-color: rgba(234,179,8,0.12) !important; }
html.dark .bg-sky-50      { background-color: rgba(14,165,233,0.12) !important; }
html.dark .bg-orange-50   { background-color: rgba(249,115,22,0.12) !important; }
html.dark .bg-cyan-50     { background-color: rgba(6,182,212,0.12) !important; }
html.dark .bg-fuchsia-50  { background-color: rgba(217,70,239,0.12) !important; }
html.dark .bg-pink-50     { background-color: rgba(236,72,153,0.12) !important; }

/* ── 边框颜色 ─────────────────────────────────────────────── */
html.dark .border-gray-100  { border-color: #1e2a45 !important; }
html.dark .border-gray-200  { border-color: #2d3554 !important; }
html.dark .border-gray-300  { border-color: #3a4a6b !important; }
html.dark .border-slate-100 { border-color: #1e2a45 !important; }
html.dark .border-slate-200 { border-color: #2d3554 !important; }

/* ── Tailwind 带透明度变体（如 bg-emerald-50/30）─────────── */
html.dark [class*="bg-emerald-50/"] { background-color: rgba(16,185,129,0.05) !important; }
html.dark [class*="bg-rose-50/"]    { background-color: rgba(239,68,68,0.05) !important;  }
html.dark [class*="bg-blue-50/"]    { background-color: rgba(59,130,246,0.05) !important;  }
html.dark [class*="bg-gray-50/"]    { background-color: rgba(30,37,53,0.3) !important;    }
html.dark [class*="bg-indigo-50/"]  { background-color: rgba(99,102,241,0.05) !important;  }
html.dark [class*="bg-purple-50/"]  { background-color: rgba(139,92,246,0.05) !important;  }
html.dark [class*="bg-amber-50/"]   { background-color: rgba(245,158,11,0.05) !important;  }
html.dark [class*="bg-red-50/"]     { background-color: rgba(239,68,68,0.05) !important;   }
html.dark [class*="bg-teal-50/"]    { background-color: rgba(20,184,166,0.05) !important;  }
html.dark [class*="bg-orange-50/"]  { background-color: rgba(249,115,22,0.05) !important;  }
html.dark [class*="bg-green-50/"]   { background-color: rgba(16,185,129,0.05) !important;  }
html.dark [class*="bg-sky-50/"]     { background-color: rgba(14,165,233,0.05) !important;  }
html.dark [class*="bg-yellow-50/"]  { background-color: rgba(234,179,8,0.05) !important;   }

/* ── Tailwind hover 透明度变体 ───────────────────────────── */
html.dark [class*="hover:bg-gray-50"]:hover  { background-color: rgba(30,37,53,0.5) !important; }
html.dark [class*="hover:bg-gray-100"]:hover { background-color: #252f4a !important; }
html.dark [class*="hover:bg-gray-200"]:hover { background-color: #2d3554 !important; }

/* ── Ring / focus 颜色已由 Tailwind 处理，无需覆盖 ─────────── */

/* ══════════════════════════════════════════════════════════
   子页面专用组件（各页 <style> 里定义的类）
   ══════════════════════════════════════════════════════════ */

/* 弹窗 modal-box / modal-close（子页版本）*/
html.dark .modal-box {
    background: #1a2236 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}
html.dark .modal-close {
    background: #252f4a !important;
    color: #7c8db5 !important;
}
html.dark .modal-close:hover { background: #2d3554 !important; color: #e2e8f0 !important; }

/* Toast 通知 */
html.dark .toast-item {
    background: #1a2236 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

/* Tab 切换按钮（admin/home.html 等） */
html.dark .tab-btn { color: #7c8db5 !important; }
html.dark .tab-btn:hover { color: #c9d1e0 !important; background-color: #1e2535 !important; }
html.dark .tab-btn.active { background-color: #252f4a !important; box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important; }

/* 通道卡片（game/list.html） */
html.dark .channel-card {
    background: #1a2236 !important;
    border-color: #1e2a45 !important;
}
html.dark .channel-card:hover {
    box-shadow: 0 8px 24px rgba(99,102,241,0.2) !important;
    border-color: #3a4270 !important;
}

/* 公告卡片（index/home.html） */
html.dark .notice-card {
    background: #1a2236 !important;
    border-color: #1e2a45 !important;
}
html.dark .notice-card p,
html.dark .notice-card span,
html.dark .notice-card div { color: #c9d1e0 !important; }

/* 图表标题（index/home.html） */
html.dark .chart-title  { color: #e2e8f0 !important; }
html.dark .chart-sub    { color: #7c8db5 !important; }
html.dark .chart-header-icon { /* 保持彩色背景 */ }

/* 自定义复选框 */
html.dark .custom-checkbox {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
}
html.dark .custom-checkbox:hover { border-color: #6366f1 !important; }

/* 开关 toggle-switch */
html.dark .toggle-slider { background: #2d3554 !important; }
html.dark .toggle-slider:before { background: #7c8db5 !important; }
html.dark input:checked + .toggle-slider { background: #10b981 !important; }
html.dark input:checked + .toggle-slider:before { background: #fff !important; }

/* 危险按钮 - 深色下更柔和 */
html.dark .btn-danger {
    background: rgba(239,68,68,0.12) !important;
    border-color: rgba(239,68,68,0.3) !important;
    color: #f87171 !important;
}
html.dark .btn-danger:hover { background: rgba(239,68,68,0.2) !important; }

/* 紫色 / 琥珀色 / 绿色 操作按钮 */
html.dark .action-btn-purple { background: rgba(139,92,246,0.12) !important; }
html.dark .action-btn-amber  { background: rgba(245,158,11,0.12) !important; }
html.dark .action-btn-green  { background: rgba(16,185,129,0.12) !important; }

/* 表单行内 label 文字 */
html.dark label.block { color: #9ca3af !important; }

/* ══════════════════════════════════════════════════════════
   登录 / 注册 页
   ══════════════════════════════════════════════════════════ */
html.dark .login-card,
html.dark .reg-card {
    background: rgba(26,34,54,0.95) !important;
    border-color: #1e2a45 !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}
html.dark .login-title,
html.dark .reg-title { color: #e2e8f0 !important; }
html.dark .login-subtitle,
html.dark .reg-subtitle { color: #7c8db5 !important; }
html.dark .login-input-wrap input,
html.dark .reg-input-wrap input {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #e2e8f0 !important;
}
html.dark .login-input-wrap input:focus,
html.dark .reg-input-wrap input:focus {
    border-color: #6366f1 !important;
    background: #252f4a !important;
}
html.dark .login-left { background: #151c2d !important; }

/* ══════════════════════════════════════════════════════════
   跨页面通用表单组件（login / reg / info / 各子页）
   ══════════════════════════════════════════════════════════ */

/* 登录/注册右侧白色面板 */
html.dark .login-right,
html.dark .reg-right {
    background: #151c2d !important;
    color: #c9d1e0 !important;
}
html.dark .login-form-header h2,
html.dark .reg-form-header h2,
html.dark .login-form-header h1,
html.dark .reg-form-header h1 {
    color: #e2e8f0 !important;
}
html.dark .login-form-header p,
html.dark .reg-form-header p { color: #7c8db5 !important; }

/* 通用表单 input/label */
html.dark .form-label   { color: #9ca3af !important; }
html.dark .form-input   {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #e2e8f0 !important;
}
html.dark .form-input:focus {
    background: #252f4a !important;
    border-color: #6366f1 !important;
}
html.dark .form-input::placeholder { color: #4a5778 !important; }
html.dark .form-input-icon { color: #4a5778 !important; }

/* 验证码输入框 */
html.dark .code-input {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #e2e8f0 !important;
}
html.dark .code-input:focus {
    background: #252f4a !important;
    border-color: #6366f1 !important;
}

/* 密钥展示框 */
html.dark .secret-box {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #e2e8f0 !important;
}
html.dark .secret-box:hover { border-color: #6366f1 !important; }

/* Tab 栏（info.html 版本） */
html.dark .tab-bar {
    background: #151c2d !important;
    border-bottom-color: #1e2a45 !important;
}
/* tab-btn 各子页版本统一处理 */
html.dark .tab-btn { color: #7c8db5 !important; }
html.dark .tab-btn:hover { color: #c9d1e0 !important; background-color: #1e2535 !important; }
html.dark .tab-btn.active {
    color: #818cf8 !important;
    background-color: #252f4a !important;
    border-bottom-color: #818cf8 !important;
    box-shadow: none !important;
}

/* card-header */
html.dark .card-header {
    border-bottom-color: #1e2a45 !important;
    background: transparent !important;
}
html.dark .card-header h3 { color: #e2e8f0 !important; }

/* 通用 btn-ghost（info.html 等子页） */
html.dark .btn-ghost {
    background: #1e2535 !important;
    color: #9ca3af !important;
    border-color: #2d3554 !important;
}
html.dark .btn-ghost:hover { background: #252f4a !important; color: #e2e8f0 !important; }

/* 二维码白底 → 深色背景加白色二维码需要反转 */
html.dark .qr-wrap canvas,
html.dark #qrcode canvas,
html.dark #qrcode img {
    filter: invert(1) !important;
    border-radius: 4px !important;
}

/* ══════════════════════════════════════════════════════════
   特殊 inline style 无法用选择器覆盖，用后代选择器兜底
   ══════════════════════════════════════════════════════════ */

/* 弹窗内层（有些页用内联 style="background:#fff" 的 div） */
html.dark .modal-overlay > div[style*="background"] {
    background: #1a2236 !important;
}
html.dark [x-show][style*="background:#fff"],
html.dark [x-show][style*="background: #fff"] {
    background: #1a2236 !important;
}

/* ══════════════════════════════════════════════════════════
   Chart.js Canvas 背景修复
   ══════════════════════════════════════════════════════════ */
html.dark canvas {
    /* Canvas 内容由 JS 控制，此处只确保容器背景不刺眼 */
    background: transparent !important;
}

/* ══════════════════════════════════════════════════════════
   其他通用文本 / 分割线
   ══════════════════════════════════════════════════════════ */
html.dark hr,
html.dark .divider { border-color: #1e2a45 !important; }

/* 通用 p/span 文字（仅在 dark 卡片内） */
html.dark .card p,
html.dark .stat-card p,
html.dark .chart-card p {
    color: #c9d1e0 !important;
}
html.dark .card h3,
html.dark .card h4 { color: #e2e8f0 !important; }

/* 徽章兜底：确保 badge-indigo 等也有 dark 效果 */
html.dark .badge-indigo { background: rgba(99,102,241,0.12) !important; border-color: rgba(99,102,241,0.25) !important; }
html.dark .badge-purple { background: rgba(139,92,246,0.12) !important; border-color: rgba(139,92,246,0.25) !important; }
html.dark .badge-teal   { background: rgba(20,184,166,0.12) !important;  border-color: rgba(20,184,166,0.25) !important;  }
html.dark .badge-amber  { background: rgba(245,158,11,0.12) !important;  border-color: rgba(245,158,11,0.25) !important;  }
html.dark .badge-yellow { background: rgba(234,179,8,0.12) !important;   border-color: rgba(234,179,8,0.25) !important;   }

/* 搜索按钮（悬停放大图标） */
html.dark button.absolute { color: #7c8db5 !important; }
html.dark button.absolute:hover { background-color: rgba(99,102,241,0.12) !important; color: #818cf8 !important; }

/* 表格内分隔线 */
html.dark .data-table th:first-child { border-radius: 9px 0 0 0 !important; }
html.dark .data-table th:last-child  { border-radius: 0 9px 0 0 !important; }

/* 进度条等轻量组件 */
html.dark .progress-bar-bg { background: #1e2535 !important; }

/* 空状态提示 */
html.dark .empty-state { color: #4a5778 !important; }
html.dark .empty-state i { opacity: 0.3 !important; }

/* 数字/金额高亮色保持不变，只覆盖白色文字 */
html.dark .text-white { color: #fff !important; }

/* 强制覆盖 Tailwind 的 text-[颜色] 工具类中所有深色文字 */
html.dark [class*="text-gray-8"],
html.dark [class*="text-gray-9"] { color: #e2e8f0 !important; }
html.dark [class*="text-slate-8"],
html.dark [class*="text-slate-9"] { color: #e2e8f0 !important; }

/* ══════════════════════════════════════════════════════════
   admin/home.html 专项修复
   ══════════════════════════════════════════════════════════ */

/* 表格内联 style="background:#fff" 的 thead */
html.dark thead { background-color: #151c2d !important; }
html.dark thead tr { background-color: #151c2d !important; }
html.dark thead th { background-color: transparent !important; color: #9ca3af !important; border-color: #1e2a45 !important; }

/* 置顶固定 thead 在深色模式下的背景 */
html.dark thead[style*="background"] { background: #151c2d !important; }
html.dark th[style*="background:#fff"],
html.dark td[style*="background:#fff"] { background: #151c2d !important; }

/* 表格行 hover */
html.dark tbody tr:hover { background-color: rgba(30,37,53,0.6) !important; }
html.dark tbody tr:hover td { background-color: inherit !important; }
html.dark .data-table tbody tr:hover td { background-color: #1e2535 !important; }

/* 表格边框 */
html.dark td.border-b { border-bottom-color: #1e2a45 !important; }
html.dark [class*="border-gray-50"] { border-color: #1e2a45 !important; }

/* 排名徽章（颜色保留，背景改为深色版本） */
html.dark .bg-yellow-100 { background-color: rgba(234,179,8,0.15) !important; }
html.dark .bg-orange-100 { background-color: rgba(249,115,22,0.15) !important; }
html.dark .bg-gray-200   { background-color: #252f4a !important; }
html.dark .text-yellow-600 { color: #fbbf24 !important; }
html.dark .text-orange-600 { color: #fb923c !important; }
html.dark .text-gray-600   { color: #9ca3af !important; }

/* 排名列表 border-gray-50 分隔线 */
html.dark .border-gray-50 { border-color: #1e2a45 !important; }

/* 通道图片容器 */
html.dark .bg-gray-50.border-gray-100 { background-color: #1e2535 !important; border-color: #2d3554 !important; }

/* 图表 point 白色圆点 → 改为深色背景色 */
html.dark canvas { background: transparent !important; }

/* ══════════════════════════════════════════════════════════
   table 通用深色修复（覆盖 inline style 和 sticky 行）
   ══════════════════════════════════════════════════════════ */
html.dark table { color: #c9d1e0 !important; }
html.dark table thead th[class*="bg-white"] { background-color: #151c2d !important; }
html.dark table thead th[class*="bg-emerald-50"] { background-color: rgba(16,185,129,0.08) !important; }
html.dark table thead th[class*="bg-rose-50"] { background-color: rgba(239,68,68,0.08) !important; }
html.dark table thead th[class*="bg-blue-50"] { background-color: rgba(59,130,246,0.08) !important; }
html.dark table th[class*="text-gray-400"]  { color: #4a5778 !important; }
html.dark table th[class*="text-emerald-6"] { color: #34d399 !important; }
html.dark table th[class*="text-rose-5"]    { color: #fb7185 !important; }
html.dark table th[class*="text-blue-5"]    { color: #60a5fa !important; }
html.dark table td { color: #c9d1e0 !important; }
html.dark table td[class*="text-gray-7"] { color: #d4dae8 !important; }
html.dark table td[class*="text-gray-5"] { color: #7c8db5 !important; }
html.dark table td[class*="text-gray-4"] { color: #4a5778 !important; }

/* sticky 表头有 inline z-index/position style 时必须覆盖背景 */
html.dark tr[style*="sticky"] th,
html.dark tr[style*="sticky"] td { background-color: #151c2d !important; }

/* 选择框（select in dark card） */
html.dark select.text-xs,
html.dark select.text-sm { background-color: #1e2535 !important; border-color: #2d3554 !important; color: #9ca3af !important; }
html.dark select option { background: #1a2236 !important; }

/* ══════════════════════════════════════════════════════════
   通用组件补充（未被上面覆盖的自定义类）
   ══════════════════════════════════════════════════════════ */

/* 搜索框 / 通用 select 选择框 */
html.dark .search-input,
html.dark .form-select,
html.dark .info-input {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #c9d1e0 !important;
}
html.dark .search-input::placeholder,
html.dark .form-select::placeholder,
html.dark .info-input::placeholder { color: #4a5778 !important; }
html.dark .search-input-icon { color: #4a5778 !important; }
html.dark .search-input:focus,
html.dark .info-input:hover { border-color: #818cf8 !important; }

/* 开关滑块（toggle switch slider） */
html.dark .slider { background: #2d3554 !important; }
html.dark .slider:before { background: #c9d1e0 !important; }

/* ══════════════════════════════════════════════════════════
   api_index.html 专项
   ══════════════════════════════════════════════════════════ */

/* 标签页导航条 */
html.dark .tab-nav {
    background: #111c30 !important;
    border-bottom-color: #1e2a45 !important;
    border-radius: 14px 14px 0 0;
}
html.dark .tab-btn { color: #7c8db5 !important; background: none !important; }
html.dark .tab-btn:hover { color: #c9d1e0 !important; }
html.dark .tab-btn.active {
    color: #818cf8 !important;
    border-bottom-color: #818cf8 !important;
    background: rgba(99,102,241,0.08) !important;
}

/* 卡片标题 */
html.dark .card-header { border-bottom-color: #1e2a45 !important; }
html.dark .card-header h3 { color: #d4dae8 !important; }

/* API URL 盒子 */
html.dark .api-url-box {
    background: #1e2535 !important;
    border-color: #2d3554 !important;
    color: #c9d1e0 !important;
}

/* 文档表格 */
html.dark .doc-table th {
    background: #151c2d !important;
    color: #7c8db5 !important;
    border-bottom-color: #1e2a45 !important;
}
html.dark .doc-table td { border-bottom-color: #1e2a45 !important; color: #c9d1e0 !important; }
html.dark .doc-table tr:hover td { background: rgba(30,37,53,0.5) !important; }

/* 章节标题 */
html.dark .section-title { color: #d4dae8 !important; }

/* 标签 tag */
html.dark .tag-gray   { background: #1e2535 !important;            color: #7c8db5 !important; }
html.dark .tag-blue   { background: rgba(99,102,241,0.15) !important; color: #818cf8 !important; }
html.dark .tag-green  { background: rgba(16,185,129,0.12) !important; color: #34d399 !important; }
html.dark .tag-red    { background: rgba(239,68,68,0.12) !important;  color: #f87171 !important; }
html.dark .tag-amber  { background: rgba(245,158,11,0.12) !important; color: #fbbf24 !important; }

/* 接口测试输入区 bg-slate-50 背景 */
html.dark .bg-slate-50 { background-color: #111c30 !important; }
html.dark .bg-slate-100 { background-color: #1e2535 !important; }
html.dark .border-slate-100 { border-color: #1e2a45 !important; }
html.dark .border-slate-200 { border-color: #2d3554 !important; }
html.dark .text-slate-500 { color: #7c8db5 !important; }
html.dark .text-slate-400 { color: #4a5778 !important; }

/* 接口测试切换按钮（Alpine class binding 中的 bg-white） */
html.dark .rounded-lg.flex .bg-white { background: #1e2535 !important; }

/* QR 码容器内联样式 */
html.dark [style*="background:#f8fafc"][style*="border-radius:12px"] { background: #1e2535 !important; border-color: #2d3554 !important; }
html.dark [style*="background:#f8fafc"][style*="border:1px solid #e2e8f0"] { background: #1e2535 !important; border-color: #2d3554 !important; }

/* 代码提示盒（紫色/青色背景区域） */
html.dark [style*="background:#f5f3ff"][style*="border:1px solid #ddd6fe"] { background: rgba(99,102,241,0.08) !important; border-color: rgba(99,102,241,0.25) !important; }
html.dark [style*="background:#f0fdfa"][style*="border:1px solid #ccfbf1"] { background: rgba(20,184,166,0.08) !important; border-color: rgba(20,184,166,0.25) !important; }
html.dark [style*="color:#5b21b6"] { color: #a78bfa !important; }
html.dark [style*="color:#0f766e"] { color: #34d399 !important; }

/* ══════════════════════════════════════════════════════════
   settings.html 专项
   ══════════════════════════════════════════════════════════ */

/* 顶部选项卡 */
html.dark .nav-tab { color: #7c8db5 !important; }
html.dark .nav-tab:hover { color: #c9d1e0 !important; }
html.dark .nav-tab.active { color: #60a5fa !important; border-bottom-color: #60a5fa !important; }

/* 功能开关卡片 */
html.dark .switch-card {
    background: #111c30 !important;
    border-color: #1e2a45 !important;
}
html.dark .switch-card.border-red-200 { border-color: rgba(239,68,68,0.3) !important; }

/* 代理配置区块（bg-gray-50/30、bg-gray-50/50） */
html.dark [class*="bg-gray-50/"] { background-color: rgba(17,28,48,0.5) !important; }

/* 代理连通性测试结果（动态 class） */
html.dark .bg-green-50.border-green-200 { background: rgba(16,185,129,0.08) !important; border-color: rgba(16,185,129,0.3) !important; color: #34d399 !important; }
html.dark .bg-red-50.border-red-200     { background: rgba(239,68,68,0.08) !important;  border-color: rgba(239,68,68,0.3) !important;  color: #f87171 !important; }

/* settings form-helper 辅助文字 */
html.dark .form-helper { color: #4a5778 !important; }

/* ══════════════════════════════════════════════════════════
   mash_list.html 专项
   ══════════════════════════════════════════════════════════ */

/* 空柱形图内联 background:#e2e8f0 */
html.dark [style*="background:#e2e8f0"] { background: #1e2a45 !important; }

/* 进度条背景（inline style） */
html.dark [style*="height:4px"][style*="background:#e2e8f0"] { background: #1e2a45 !important; }

/* 额度显示信息框 */
html.dark [style*="background:#f8fafc"][style*="border:1px solid #e2e8f0"] { background: #111c30 !important; border-color: #1e2a45 !important; }
html.dark [style*="background:#f8fafc"][style*="border-radius:9px"][style*="border:1px solid #e2e8f0"] { background: #111c30 !important; border-color: #1e2a45 !important; }

/* ══════════════════════════════════════════════════════════
   index/home.html 商户首页专项修复
   stat-icon / chart-header-icon 使用内联浅色背景，需精准覆盖
   ══════════════════════════════════════════════════════════ */

/* 统计卡片 */
html.dark .stat-card,
html.dark .chart-card,
html.dark .notice-card { background: #111c30 !important; border-color: #1e2d4a !important; }

/* 统计卡片文字 */
html.dark .stat-value { color: #e2e8f0 !important; }
html.dark .stat-label { color: #5a6a8a !important; }
html.dark .stat-sub   { color: #4a5778 !important; }

/* stat-icon / chart-header-icon：按内联背景颜色区分，替换为深色半透明版本 */
html.dark .stat-icon[style*="eff6ff"],
html.dark .chart-header-icon[style*="eff6ff"] { background: rgba(59,130,246,0.15) !important; }

html.dark .stat-icon[style*="f5f3ff"],
html.dark .chart-header-icon[style*="f5f3ff"] { background: rgba(139,92,246,0.15) !important; }

html.dark .stat-icon[style*="fff7ed"],
html.dark .chart-header-icon[style*="fff7ed"] { background: rgba(249,115,22,0.15) !important; }

html.dark .stat-icon[style*="f0fdf4"],
html.dark .chart-header-icon[style*="f0fdf4"] { background: rgba(16,185,129,0.15) !important; }

html.dark .stat-icon[style*="fdf4ff"],
html.dark .chart-header-icon[style*="fdf4ff"] { background: rgba(217,70,239,0.15) !important; }

html.dark .stat-icon[style*="fef3c7"],
html.dark .chart-header-icon[style*="fef3c7"] { background: rgba(245,158,11,0.15) !important; }

/* 公告卡片内的内联颜色 */
html.dark [style*="color:#1a2035"],
html.dark [style*="color: #1a2035"],
html.dark [style*="color:#1e293b"],
html.dark [style*="color: #1e293b"] { color: #e2e8f0 !important; }

/* 公告 badge 背景（inline style） */
html.dark [style*="background:#eff6ff"] { background: rgba(59,130,246,0.12) !important; }
html.dark [style*="background:#f0fdf4"] { background: rgba(16,185,129,0.12) !important; }
html.dark [style*="background:#fff7ed"] { background: rgba(249,115,22,0.12) !important; }
html.dark [style*="background:#f5f3ff"] { background: rgba(139,92,246,0.12) !important; }
html.dark [style*="background:#fef3c7"] { background: rgba(245,158,11,0.12) !important; }
html.dark [style*="background:#fdf4ff"] { background: rgba(217,70,239,0.12) !important; }
html.dark [style*="background:#fee2e2"] { background: rgba(239,68,68,0.12) !important; }
html.dark [style*="background:#dbeafe"] { background: rgba(59,130,246,0.12) !important; }

/* 公告文字 (inline color:#64748b) */
html.dark [style*="color:#64748b"] { color: #7c8db5 !important; }

/* 环形图中心文字 */
html.dark #typeTotalCount,
html.dark #stateSuccessRate { color: #e2e8f0 !important; }

/* chart-title / chart-sub */
html.dark .chart-title { color: #d4dae8 !important; }
html.dark .chart-sub   { color: #4a5778 !important; }

/* 图例文字（Chart.js 渲染 inline style color:#475569） */
html.dark [style*="color:#475569"] { color: #7c8db5 !important; }
