/* =========================================================
   全局浅色主题覆盖 —— 在各页面 </head> 前最后引入，
   统一将系统由深色科技风切换为清爽浅色风格。
   使用 !important 压过各页面内嵌的深色硬编码样式。
   ========================================================= */

/* CSS 变量整体翻转为浅色（变量名保持不变，所有引用处自动生效） */
:root {
    --dark-bg: #f5f7fb;
    --dark-card: #ffffff;
    --dark-hover: #eef2f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e5eaf2;
    --shadow: rgba(15, 23, 42, 0.08);
    --glass: rgba(255, 255, 255, 0.92);
}

body {
    background-color: #f5f7fb !important;
    color: #1e293b !important;
}

/* 去掉深色科技背景（网格 + 光球） */
.tech-bg {
    display: none !important;
}

/* ===== 卡片 / 模态框 / 面板 ===== */
.main-card,
.game-card,
.modal-content,
.stat-card,
.chart-card {
    background: #ffffff !important;
    border: 1px solid #e5eaf2 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
    backdrop-filter: none !important;
}

.main-card:hover,
.game-card:hover {
    border-color: #c3d0f5 !important;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12) !important;
}

.modal-header {
    border-bottom: 1px solid #e5eaf2 !important;
}

/* ===== 表单控件 ===== */
.form-control,
.form-select,
.form-textarea,
.link-input,
.date-display,
.notification-btn,
.menu-toggle,
.search-input-wrap .form-control {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e5eaf2 !important;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus,
.search-input-wrap .form-control:focus {
    background: #ffffff !important;
    color: #1e293b !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15) !important;
}

.form-control::placeholder,
.form-select::placeholder,
.form-textarea::placeholder {
    color: #94a3b8 !important;
}

.form-text {
    color: #94a3b8 !important;
}

.text-muted {
    color: #94a3b8 !important;
}

/* ===== 侧边栏（片段样式在 body 内，用 body 前缀提高优先级） ===== */
body .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e5eaf2 !important;
    backdrop-filter: none !important;
}

body .sidebar .logo {
    border-bottom: 1px solid #e5eaf2 !important;
}

body .sidebar .logo-text h2 {
    color: #1e293b !important;
}

body .sidebar .nav-link {
    color: #64748b !important;
}

body .sidebar .nav-link:hover {
    background: #eef3fe !important;
    color: #4f46e5 !important;
}

body .sidebar .nav-link.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
}

body .sidebar .user-profile {
    border-top: 1px solid #e5eaf2 !important;
}

body .sidebar .user-details h4 {
    color: #1e293b !important;
}

body .sidebar .user-details p {
    color: #64748b !important;
}

body .sidebar .logout-btn {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    border: 1px solid #fecaca !important;
}

body .sidebar .logout-btn:hover {
    background: #fee2e2 !important;
}

body .sidebar .menu-toggle {
    background: #ffffff !important;
    border: 1px solid #e5eaf2 !important;
    color: #1e293b !important;
}

/* ===== 按钮 ===== */
.btn-outline {
    background: transparent !important;
    color: #475569 !important;
    border: 1px solid #d7dfeb !important;
}

.btn-outline:hover {
    background: #eef3fe !important;
    border-color: #6366f1 !important;
    color: #4f46e5 !important;
}

/* ===== 提示 / 徽章（半透明色在白底上对比度足够，仅文字微调） ===== */
.badge-success {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #0d9668 !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

/* ===== 通知链接块（游戏卡内的监测链接） ===== */
.notify-links {
    background: #f8fafc !important;
    border: 1px solid #eef2f8;
}

/* 游戏卡统计区分隔线 */
.game-stats {
    border-top: 1px solid #eef2f8 !important;
}

/* 回传记录等页面的 JSON/代码预览块 */
.modal-body pre,
pre.code-block {
    background: #f8fafc !important;
    color: #334155 !important;
    border: 1px solid #eef2f8;
}

.empty-icon {
    background: #eef3fe !important;
    color: #6366f1 !important;
}

/* ===== 通用表格 ===== */
.table {
    color: #1e293b !important;
}

.table > :not(caption) > * > * {
    background-color: transparent !important;
    color: #1e293b !important;
    border-bottom-color: #e5eaf2 !important;
}

/* ===== 各页面自定义深色组件 ===== */
/* 数据表格（实时数据/回传记录/流量主查询/游戏用户管理） */
.data-table {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #eef2f8 !important;
}

.data-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #e5eaf2 !important;
}

.data-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #eef2f8 !important;
}

.data-table tbody tr:hover td {
    background: #fafbff !important;
}

/* 过滤区（游戏用户管理） */
.filter-container {
    background: #f8fafc !important;
    border: 1px solid #eef2f8 !important;
}

.filter-select {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e5eaf2 !important;
}

.filter-select:focus {
    background: #ffffff !important;
    color: #1e293b !important;
    border-color: #6366f1 !important;
}

/* 数据导出页 */
.export-card {
    background: #ffffff !important;
    border: 1px solid #e5eaf2 !important;
}

.feature-item {
    background: #f8fafc !important;
    border: 1px solid #eef2f8;
}

.progress {
    background: #eef2f9 !important;
}

/* 游戏编辑页 eCPM 数据块 */
.ecpm-data {
    background: #f8fafc !important;
    border: 1px solid #eef2f8 !important;
}

/* 分页按钮（回传记录） */
.pagination button {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #e5eaf2 !important;
}

.pagination button:hover {
    background: #eef3fe !important;
    color: #4f46e5 !important;
    border-color: #6366f1 !important;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3dbe7; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b9c5d6; }
