/* ========================================
   dark.css - 深色主题（Glassmorphism风格）
   ======================================== */

[data-theme="dark"],
html:not([data-theme]) body:not([data-theme="light"]) {
    --bg-color: #0F0F1A;
    --bg-secondary: #1a1a2e;
    --bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);

    --text-color: #F1F5F9;
    --text-secondary: #C7D2FE;
    --text-muted: #A5B4FC;

    /* Surface 层级系统 */
    --surface-1: rgba(30, 32, 60, 0.8);
    --surface-2: rgba(30, 32, 60, 0.6);
    --surface-3: rgba(22, 22, 45, 0.5);

    --card-bg: rgba(30, 32, 60, 0.6);
    --card-border: rgba(129, 140, 248, 0.2);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --card-hover-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);

    --primary-color: #818CF8;
    --primary-hover: #6366F1;
    --primary-light: rgba(129, 140, 248, 0.2);
    --primary-glow: rgba(129, 140, 248, 0.4);

    --success-color: #34D399;
    --danger-color: #F87171;
    --warning-color: #FBBF24;
    --info-color: #60A5FA;
    --cta-color: #34D399;

    /* 语义 Surface */
    --success-surface: rgba(52, 211, 153, 0.12);
    --danger-surface: rgba(248, 113, 113, 0.12);
    --warning-surface: rgba(251, 191, 36, 0.12);
    --info-surface: rgba(96, 165, 250, 0.12);

    --input-bg: rgba(30, 32, 60, 0.6);
    --input-border: rgba(129, 140, 248, 0.25);
    --input-focus: #818CF8;
    --nav-bg: rgba(15, 15, 30, 0.6);
    --sidebar-bg: rgba(22, 22, 45, 0.6);

    /* Shadow Scale (深色) */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.5);
}

/* 深色特殊样式 */
[data-theme="dark"] body {
    background: var(--bg-gradient);
}

/* 深色模式装饰光球（更明显） */
[data-theme="dark"] body::before {
    background: radial-gradient(circle, rgba(129, 140, 248, 0.35) 0%, transparent 70%);
    opacity: 0.8;
}
[data-theme="dark"] body::after {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 70%);
    opacity: 0.7;
}

[data-theme="dark"] .card {
    background: rgba(30, 32, 60, 0.6);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .navbar {
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-bottom: 1px solid rgba(129, 140, 248, 0.15);
}

[data-theme="dark"] .mobile-tab {
    background: rgba(15, 15, 30, 0.7);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-top: 1px solid rgba(129, 140, 248, 0.15);
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.85) 0%, rgba(88, 28, 135, 0.85) 50%, rgba(126, 34, 206, 0.85) 100%);
    border-color: rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .quick-item {
    background: rgba(30, 32, 60, 0.6);
    border-color: rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .quick-item:hover {
    background: rgba(40, 42, 75, 0.7);
}

[data-theme="dark"] .mat-card {
    background: rgba(30, 32, 60, 0.6);
    border-color: rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .mat-card:hover {
    background: rgba(40, 42, 75, 0.7);
    border-color: rgba(129, 140, 248, 0.35);
}

[data-theme="dark"] .auth-card {
    background: rgba(30, 32, 60, 0.6);
    border-color: rgba(129, 140, 248, 0.25);
}

[data-theme="dark"] .auth-tabs {
    background: rgba(20, 22, 50, 0.6);
    border-color: rgba(129, 140, 248, 0.15);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] select,
[data-theme="dark"] textarea,
html body:not([data-theme="light"]) input[type="text"],
html body:not([data-theme="light"]) input[type="password"],
html body:not([data-theme="light"]) input[type="email"],
html body:not([data-theme="light"]) input[type="number"],
html body:not([data-theme="light"]) input[type="url"],
html body:not([data-theme="light"]) input[type="tel"],
html body:not([data-theme="light"]) select,
html body:not([data-theme="light"]) textarea {
    background: rgba(30, 32, 60, 0.6);
    color: #EEF0F6;
    border-color: rgba(129, 140, 248, 0.25);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
html body:not([data-theme="light"]) input:focus {
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.25);
    background: rgba(40, 42, 75, 0.7);
    border-color: #818CF8;
}

[data-theme="dark"] .btn-outline,
html body:not([data-theme="light"]) .btn-outline {
    border-color: rgba(129, 140, 248, 0.45);
    color: #C7D2FE;
}

[data-theme="dark"] .btn-outline:hover {
    background: rgba(129, 140, 248, 0.2) !important;
    border-color: #818CF8;
    color: #fff !important;
}

[data-theme="dark"] .badge-success { background: rgba(52, 211, 153, 0.2); color: #34D399; border-color: rgba(52, 211, 153, 0.3); }
[data-theme="dark"] .badge-danger  { background: rgba(248, 113, 113, 0.2); color: #F87171; border-color: rgba(248, 113, 113, 0.3); }
[data-theme="dark"] .badge-warning { background: rgba(251, 191, 36, 0.2); color: #FBBF24; border-color: rgba(251, 191, 36, 0.3); }
[data-theme="dark"] .badge-info    { background: rgba(129, 140, 248, 0.2); color: #A5B4FC; border-color: rgba(129, 140, 248, 0.3); }

[data-theme="dark"] .stats-pill {
    background: rgba(129, 140, 248, 0.15);
    color: #C7D2FE;
    border-color: rgba(129, 140, 248, 0.25);
}

[data-theme="dark"] .theme-toggle {
    background: rgba(30, 32, 60, 0.6);
    border-color: rgba(129, 140, 248, 0.25);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(50, 52, 90, 0.7);
}

/* 深色滚动条 */
[data-theme="dark"] ::-webkit-scrollbar,
html body:not([data-theme="light"]) ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
[data-theme="dark"] ::-webkit-scrollbar-track,
html body:not([data-theme="light"]) ::-webkit-scrollbar-track {
    background: rgba(129, 140, 248, 0.05);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb,
html body:not([data-theme="light"]) ::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.2);
    border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover,
html body:not([data-theme="light"]) ::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 140, 248, 0.35);
}

/* ===== 深色缺失覆盖补全 ===== */

/* 深色 Surface 层级组件 */
[data-theme="dark"] .card { background: var(--surface-1); }
[data-theme="dark"] .stat-card { background: var(--surface-1); }
[data-theme="dark"] .mat-card { background: var(--surface-1); }
[data-theme="dark"] .quick-item { background: var(--surface-2); }
[data-theme="dark"] .info-item { background: var(--surface-2); }

/* 深色导航品牌 */
[data-theme="dark"] .navbar-brand { color: #F1F5F9; text-shadow: none; }
[data-theme="dark"] .navbar-brand i {
    background: linear-gradient(135deg, #818CF8, #6366F1);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .navbar-brand span {
    background: linear-gradient(135deg, #F1F5F9, #C7D2FE);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* 深色导航链接 */
[data-theme="dark"] .navbar-links a { color: #A5B4FC; }
[data-theme="dark"] .navbar-links a:hover { color: #fff; background: rgba(129, 140, 248, 0.15); }
[data-theme="dark"] .navbar-links a.active { color: #fff; background: rgba(129, 140, 248, 0.25); }

/* 深色用户信息 */
[data-theme="dark"] .navbar-user {
    color: #C7D2FE;
    background: rgba(129, 140, 248, 0.1);
    border-color: rgba(129, 140, 248, 0.2);
}
[data-theme="dark"] .navbar-user a { color: #818CF8; }

/* 深色移动端Tab */
[data-theme="dark"] .mobile-tab a { color: #A5B4FC; }
[data-theme="dark"] .mobile-tab a.active,
[data-theme="dark"] .mobile-tab a:hover { color: #fff; }
[data-theme="dark"] .mobile-tab a.active::before { background: #818CF8; box-shadow: 0 2px 8px rgba(129, 140, 248, 0.4); }

/* 深色页头 */
[data-theme="dark"] .page-header h2 { color: #F1F5F9; text-shadow: none; }
[data-theme="dark"] .page-header h2 i {
    background: linear-gradient(135deg, #818CF8, #6366F1);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .page-header { border-bottom-color: rgba(129, 140, 248, 0.15); }

/* 深色素材标题/描述 */
[data-theme="dark"] .mat-card .mat-title { color: #F1F5F9; text-shadow: none; }
[data-theme="dark"] .mat-card .mat-desc { color: #A5B4FC; }
[data-theme="dark"] .mat-card .mat-time { color: #A5B4FC; }
[data-theme="dark"] .mat-card .mat-footer { border-top-color: rgba(129, 140, 248, 0.15); }
[data-theme="dark"] .mat-thumb {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(129, 140, 248, 0.15);
    color: #818CF8;
}

/* 深色统计卡片 */
[data-theme="dark"] .stat-card .stat-value { color: #F1F5F9; text-shadow: none; }
[data-theme="dark"] .stat-card .stat-label { color: #A5B4FC; }

/* 深色快捷入口图标 */
[data-theme="dark"] .quick-item i {
    background: linear-gradient(135deg, #818CF8, #6366F1);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* 深色公告 */
[data-theme="dark"] .announcement-card { border-left-color: rgba(129, 140, 248, 0.5); }
[data-theme="dark"] .announcement-card:hover { border-left-color: rgba(139, 92, 246, 0.7); }
[data-theme="dark"] .announcement-card .ann-title { color: #F1F5F9; }
[data-theme="dark"] .announcement-card .ann-content { color: #A5B4FC; }
[data-theme="dark"] .announcement-card .ann-time { color: #94A3B8; }

/* 深色认证Tab */
[data-theme="dark"] .auth-tab { color: #A5B4FC; }
[data-theme="dark"] .auth-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #818CF8, #6366F1);
}

/* 深色分割线 */
[data-theme="dark"] .divider {
    background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.2), transparent);
}

/* 深色信息网格 */
[data-theme="dark"] .info-label { color: #A5B4FC; }
[data-theme="dark"] .info-value { color: #F1F5F9; }

/* 深色标签 */
[data-theme="dark"] label { color: #C7D2FE; text-shadow: none; }

/* 深色历史记录 */
[data-theme="dark"] .history-item .his-title { color: #F1F5F9; }
[data-theme="dark"] .history-item .his-meta { color: #A5B4FC; }

/* 深色提现记录 */
[data-theme="dark"] .wd-record .wd-amount {
    background: linear-gradient(135deg, #F1F5F9, #C7D2FE);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .wd-record .wd-meta { color: #A5B4FC; }

/* 深色分页 */
[data-theme="dark"] .pagination button {
    background: rgba(30, 32, 60, 0.6);
    border-color: rgba(129, 140, 248, 0.2);
    color: #C7D2FE;
}
[data-theme="dark"] .pagination button:hover:not(:disabled) {
    background: rgba(129, 140, 248, 0.15);
    color: #fff;
}
[data-theme="dark"] .pagination .page-info { color: #A5B4FC; }

/* 深色表单输入图标 */
[data-theme="dark"] .input-icon-wrap i { color: #818CF8; opacity: 0.6; }
[data-theme="dark"] .input-icon-wrap:focus-within i { color: #818CF8; opacity: 1; }

/* 深色 Toast */
[data-theme="dark"] .toast-fixed {
    background: rgba(30, 32, 60, 0.85);
    border-color: rgba(129, 140, 248, 0.2);
    color: #F1F5F9;
}

/* 深色骨架屏 */
[data-theme="dark"] .skeleton-card {
    background: rgba(30, 32, 60, 0.5);
    border-color: rgba(129, 140, 248, 0.12);
}
[data-theme="dark"] .skeleton-img,
[data-theme="dark"] .skeleton-line {
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.05) 25%, rgba(129, 140, 248, 0.1) 50%, rgba(129, 140, 248, 0.05) 75%);
    background-size: 200% 100%;
}

/* 深色错误状态 */
[data-theme="dark"] .error-state {
    background: rgba(30, 32, 60, 0.5);
    border-color: rgba(129, 140, 248, 0.15);
}
[data-theme="dark"] .error-state h3 { color: #F1F5F9; }
[data-theme="dark"] .error-state p { color: #A5B4FC; }

/* 深色空状态 */
[data-theme="dark"] .empty-state i {
    background: linear-gradient(135deg, #818CF8, #6366F1);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .empty-state p { color: #A5B4FC; }

/* 深色模态框 */
[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.6); }
[data-theme="dark"] .modal-content {
    background: rgba(30, 32, 60, 0.85);
    border-color: rgba(129, 140, 248, 0.25);
    color: #F1F5F9;
}

/* 深色消息提示 */
[data-theme="dark"] .msg-success { background: var(--success-surface); color: #34D399; border-color: rgba(52, 211, 153, 0.3); }
[data-theme="dark"] .msg-error { background: var(--danger-surface); color: #F87171; border-color: rgba(248, 113, 113, 0.3); }

/* 深色链接 */
[data-theme="dark"] a { color: #C7D2FE; }
[data-theme="dark"] a:hover { color: #818CF8; }

/* 深色 CTA 按钮 */
[data-theme="dark"] .btn-cta {
    background: linear-gradient(135deg, #34D399, #059669) !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.25);
}

/* 深色 Ripple 涟漪 */
[data-theme="dark"] .ripple { background: rgba(129, 140, 248, 0.25); }

/* 深色 focus-visible */
[data-theme="dark"] :focus-visible { outline-color: #818CF8; }
[data-theme="dark"] .btn:focus-visible,
[data-theme="dark"] button:focus-visible { box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.25); }

/* ===== 后台深色主题覆盖 ===== */

/* 深色侧边栏 */
[data-theme="dark"] .admin-sidebar {
    background: rgba(15, 15, 30, 0.85);
    border-right-color: rgba(129, 140, 248, 0.1);
}
[data-theme="dark"] .admin-sidebar .sidebar-logo { color: #818CF8; border-bottom-color: rgba(129, 140, 248, 0.1); }
[data-theme="dark"] .admin-sidebar .nav-item { color: #C7D2FE; }
[data-theme="dark"] .admin-sidebar .nav-item:hover { color: #818CF8; background: rgba(129, 140, 248, 0.1); }
[data-theme="dark"] .admin-sidebar .nav-item.active {
    background: linear-gradient(135deg, #818CF8, #6366F1);
    color: #fff;
}

/* 深色顶栏 */
[data-theme="dark"] .admin-topbar {
    background: rgba(15, 15, 30, 0.8);
    border-bottom-color: rgba(129, 140, 248, 0.1);
}
[data-theme="dark"] .admin-topbar .topbar-title { color: #F1F5F9; }
[data-theme="dark"] .admin-topbar .admin-info {
    background: rgba(129, 140, 248, 0.08);
    color: #C7D2FE;
}
[data-theme="dark"] .admin-topbar .admin-avatar { color: #818CF8; background: rgba(129, 140, 248, 0.12); }

/* 深色表格 */
[data-theme="dark"] .table-wrap {
    background: rgba(30, 32, 60, 0.6);
    border-color: rgba(129, 140, 248, 0.15);
}
[data-theme="dark"] .table-wrap th {
    background: rgba(129, 140, 248, 0.1);
    color: #C7D2FE;
}
[data-theme="dark"] .table-wrap td { border-bottom-color: rgba(129, 140, 248, 0.1); }
[data-theme="dark"] .table-wrap tr:nth-child(even) td { background: rgba(129, 140, 248, 0.04); }
[data-theme="dark"] .table-wrap tr:hover td { background: rgba(129, 140, 248, 0.08); }

/* 深色后台表单输入 */
[data-theme="dark"] .admin-main input[type="text"],
[data-theme="dark"] .admin-main input[type="password"],
[data-theme="dark"] .admin-main input[type="email"],
[data-theme="dark"] .admin-main input[type="number"],
[data-theme="dark"] .admin-main input[type="url"],
[data-theme="dark"] .admin-main select,
[data-theme="dark"] .admin-main textarea {
    background: rgba(30, 32, 60, 0.6) !important;
    border-color: rgba(129, 140, 248, 0.2) !important;
    color: #F1F5F9;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.1);
}
[data-theme="dark"] .admin-main input:focus,
[data-theme="dark"] .admin-main select:focus,
[data-theme="dark"] .admin-main textarea:focus {
    background: rgba(40, 42, 75, 0.7) !important;
    border-color: #818CF8 !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15) !important;
}

/* 深色仪表盘统计 */
[data-theme="dark"] .dash-stat .stat-number { color: #F1F5F9; }
[data-theme="dark"] .dash-stat .stat-label { color: #A5B4FC; }

/* 深色 Section 标题 */
[data-theme="dark"] .section-title,
[data-theme="dark"] .edit-container .section-title { color: #818CF8; }

/* 深色提示框 */
[data-theme="dark"] .alert-danger { background: var(--danger-surface); border-color: rgba(248, 113, 113, 0.2); }
[data-theme="dark"] .alert-success { background: var(--success-surface); border-color: rgba(52, 211, 153, 0.2); }

/* 深色简版表格 */
[data-theme="dark"] .data-table thead th { background: #818CF8; }
[data-theme="dark"] .data-table tbody tr:nth-child(even) td { background: rgba(129, 140, 248, 0.04); }
[data-theme="dark"] .data-table tbody tr:hover td { background: rgba(129, 140, 248, 0.08); }
