/* ==========================================
   主题配置系统 - 坤辰AI
   完整版：包含所有元素的颜色变量
   ========================================== */

/* ==========================================
   科技蓝主题（深海军蓝 + 霓虹光晕 - 默认）
   ----------------------------------------------------------------------------
   选择器同时匹配 dark / tech / light 三个值，因为：
     - dark 是当前对外可选项之一（在 admin UI 里叫「🌃 科技蓝」）
     - tech 和 light 是历史遗留值，UI 已下线，但 localStorage / DB 里可能还有
       让它们都走这套样式，避免老租户切到"无主题"。
   ========================================== */
[data-theme="dark"],
[data-theme="tech"],
[data-theme="light"] {
    /* 基础背景色 - 深海军蓝 */
    --bg-primary: #0A192F;
    --bg-secondary: #112240;
    --bg-tertiary: #0f2756;
    --bg-hover: #1a3268;
    --bg-active: #233e7a;

    /* 边框色 */
    --border-primary: #1f3055;
    --border-secondary: #2a4a7a;
    --border-hover: rgba(43, 124, 238, 0.5);

    /* 文字色 */
    --text-primary: #E6F1FF;
    --text-secondary: #8892B0;
    --text-tertiary: #64748b;
    --text-muted: #475569;

    /* 强调色 - 科技蓝青紫 */
    --accent-primary: #2b7cee;
    --accent-secondary: #00BFFF;
    --accent-cyan: #64FFDA;
    --accent-purple: #8A2BE2;

    /* 玻璃面板 */
    --glass-bg: rgba(17, 34, 64, 0.6);
    --glass-border: rgba(59, 69, 84, 0.5);
    --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);

    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #2b7cee 0%, #00BFFF 100%);
    --gradient-purple-blue: linear-gradient(135deg, #8A2BE2 0%, #2b7cee 100%);
    --gradient-purple-pink: linear-gradient(135deg, #8A2BE2 0%, #DA70D6 100%);
    --gradient-app-bg: radial-gradient(circle at 20% 20%, rgba(43, 124, 238, 0.15), transparent 60%),
                       radial-gradient(circle at 80% 0%, rgba(100, 255, 218, 0.08), transparent 55%),
                       linear-gradient(180deg, #0A192F 0%, #112240 50%, #0A192F 100%);

    /* 按钮 */
    --btn-bg: rgba(43, 124, 238, 0.9);
    --btn-text: #ffffff;
    --btn-border: rgba(43, 124, 238, 0.5);
    --btn-hover-bg: #1e5bb8;
    --btn-hover-border: rgba(43, 124, 238, 0.8);
    --btn-secondary-bg: rgba(17, 34, 64, 0.6);
    --btn-secondary-text: #E6F1FF;
    --btn-primary-bg: linear-gradient(135deg, #2b7cee 0%, #00BFFF 100%);
    --btn-primary-text: #ffffff;

    /* 消息气泡 */
    --message-user-bg: linear-gradient(135deg, #2b7cee 0%, #1e5bb8 100%);
    --message-user-text: #ffffff;
    --message-ai-bg: rgba(17, 34, 64, 0.7);
    --message-ai-text: #E6F1FF;
    --message-border: rgba(59, 69, 84, 0.5);

    /* 输入框 */
    --input-bg: rgba(17, 34, 64, 0.5);
    --input-border: rgba(59, 69, 84, 0.5);
    --input-focus-border: rgba(43, 124, 238, 0.8);
    --input-text: #E6F1FF;
    --input-placeholder: rgba(136, 146, 176, 0.6);

    /* 卡片 */
    --card-bg: rgba(17, 34, 64, 0.6);
    --card-border: rgba(59, 69, 84, 0.4);
    --card-hover: rgba(43, 124, 238, 0.5);

    /* 面板 */
    --panel-bg: rgba(10, 25, 47, 0.85);
    --panel-border: rgba(59, 69, 84, 0.4);
    --panel-header-border: rgba(43, 124, 238, 0.2);

    /* 表格 */
    --table-header-bg: rgba(17, 34, 64, 0.8);
    --table-row-bg: rgba(11, 31, 68, 0.5);
    --table-row-hover: rgba(43, 124, 238, 0.1);
    --table-border: rgba(59, 69, 84, 0.4);

    /* Logo和头像 */
    --logo-bg: linear-gradient(135deg, #8A2BE2 0%, #2b7cee 100%);
    --avatar-bg: linear-gradient(135deg, #2b7cee 0%, #00BFFF 100%);

    /* 状态颜色 */
    --success-bg: rgba(52, 211, 153, 0.15);
    --success-text: #34D399;
    --success-border: rgba(52, 211, 153, 0.4);
    --error-bg: rgba(239, 68, 68, 0.15);
    --error-text: #EF4444;
    --error-border: rgba(239, 68, 68, 0.4);
    --warning-bg: rgba(251, 191, 36, 0.15);
    --warning-text: #fbbf24;
    --warning-border: rgba(251, 191, 36, 0.4);

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 32px rgba(43, 124, 238, 0.3);
}

/* ==========================================
   白色主题（优雅简约风格）
   ========================================== */
[data-theme="white"] {
    /* 基础背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #fafbfc;
    --bg-tertiary: #f5f7fa;
    --bg-hover: #f0f2f5;
    --bg-active: #e8ebef;

    /* 边框色 */
    --border-primary: #e8ebef;
    --border-secondary: #dfe3e8;
    --border-hover: #c1c9d2;

    /* 文字色 */
    --text-primary: #1a1d1f;
    --text-secondary: #4e5969;
    --text-tertiary: #86909c;
    --text-muted: #c9cdd4;

    /* 强调色 */
    --accent-primary: #ff9500;
    --accent-secondary: #ff8800;

    /* 按钮 */
    --btn-bg: #667eea;
    --btn-text: #ffffff;
    --btn-border: #667eea;
    --btn-hover-bg: #5568d3;
    --btn-hover-border: #5568d3;
    --btn-secondary-bg: #f5f7fa;
    --btn-secondary-text: #4e5969;

    /* 消息气泡 */
    --message-user-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --message-user-text: #ffffff;
    --message-ai-bg: #f5f7fa;
    --message-ai-text: #1a1d1f;
    --message-border: #e8ebef;

    /* 输入框 */
    --input-bg: #fafbfc;
    --input-border: #dfe3e8;
    --input-focus-border: #667eea;
    --input-text: #1a1d1f;
    --input-placeholder: #86909c;

    /* 卡片 */
    --card-bg: #ffffff;
    --card-border: #e8ebef;
    --card-hover: #fafbfc;

    /* 面板 */
    --panel-bg: #ffffff;
    --panel-border: #e8ebef;
    --panel-header-border: #e8ebef;

    /* 玻璃面板（.glass-panel / .glass-card 用）——白主题就是纯白卡，去掉模糊滤镜 */
    /* 不设这几个变量的话，design-system.css 里的 .glass-panel 会 fallback 到深蓝色 rgba 导致整片灰色 */
    --glass-bg: #ffffff;
    --glass-border: #e8ebef;
    --glass-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);

    /* 表格 */
    --table-header-bg: #f5f7fa;
    --table-row-bg: #ffffff;
    --table-row-hover: #fafbfc;
    --table-border: #e8ebef;

    /* Logo和头像 */
    --logo-bg: #667eea;
    --avatar-bg: #f5f7fa;

    /* 状态颜色 */
    --success-bg: #c6f6d5;
    --success-text: #276749;
    --success-border: #68d391;
    --error-bg: #fed7d7;
    --error-text: #c53030;
    --error-border: #fc8181;
    --warning-bg: #feebc8;
    --warning-text: #c05621;
    --warning-border: #f6ad55;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* （此处原有 [data-theme="tech"] 块已删除——tech 主题已下线，统一走「科技蓝」=dark） */

/* ==========================================
   通用样式变量（所有主题共用）
   ========================================== */
:root {
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* 间距 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* 字体大小 */
    --font-xs: 0.75rem;
    --font-sm: 0.85rem;
    --font-base: 0.9rem;
    --font-md: 0.95rem;
    --font-lg: 1.1rem;
    --font-xl: 1.6rem;

    /* 过渡动画 */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 移除 body 的 transition，避免主题切换时闪烁 */

/* ==========================================
   主题切换按钮
   ========================================== */
.theme-toggle-btn {
    background: var(--bg-tertiary, #1f1f1f);
    border: 1px solid var(--border-primary, #2a2a2a);
    color: var(--text-primary, #ffffff);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: var(--bg-hover, #2a2a2a);
    border-color: var(--border-hover, #4a4a4a);
}

/* ============================================================================
   白色主题全局覆盖层
   ----------------------------------------------------------------------------
   背景：站内大部分页面（首页 / 子页面 / 聊天室 等）的视觉是为深色主题设计的，
        切到白色主题后这些硬编码的深色背景、亮色文字、霓虹光晕显得格格不入。
   策略：在这层做"通用的、不会破坏深色主题"的覆盖——只针对 [data-theme="white"]
        匹配，所以深色主题完全不受影响。
   优先级：用 !important 是因为很多页面在自己的 <style> 块里写了具体的 background
          /color，CSS 级联里我们这层来得晚但不一定特异性更高，必须 !important。
   ============================================================================ */

/* ---------- 1. 全局背景 & 文字色 ---------- */
[data-theme="white"] body,
[data-theme="white"] html {
    background: #ffffff !important;
    color: #1a1d1f !important;
}

/* 首页 / 子页面常见的渐变背景层 */
[data-theme="white"] .animated-bg,
[data-theme="white"] .light-dots,
[data-theme="white"] .floating-circle,
[data-theme="white"] .decor-shape,
[data-theme="white"] .starfield,
[data-theme="white"] .bg-grid {
    display: none !important;
}

/* 兜底：很多页面的根容器用了大块深色渐变 */
[data-theme="white"] .app-shell,
[data-theme="white"] .page-wrap,
[data-theme="white"] .main-container,
[data-theme="white"] .container,
[data-theme="white"] main {
    background: transparent !important;
    color: #1a1d1f !important;
}

/* ---------- 2. 顶部导航 / 侧边栏 / 页脚 ---------- */
[data-theme="white"] .topbar,
[data-theme="white"] .navbar,
[data-theme="white"] .top-nav,
[data-theme="white"] .header,
[data-theme="white"] .app-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e8ebef !important;
    color: #1a1d1f !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="white"] .sidebar,
[data-theme="white"] .side-menu,
[data-theme="white"] .nav-side {
    background: #fafbfc !important;
    border-right: 1px solid #e8ebef !important;
    color: #1a1d1f !important;
}

[data-theme="white"] .topbar a,
[data-theme="white"] .topbar-nav a,
[data-theme="white"] .nav-link,
[data-theme="white"] .side-menu-item,
[data-theme="white"] .menu-item {
    color: #4e5969 !important;
}

[data-theme="white"] .topbar a:hover,
[data-theme="white"] .topbar-nav a:hover,
[data-theme="white"] .nav-link:hover,
[data-theme="white"] .side-menu-item:hover,
[data-theme="white"] .menu-item:hover {
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.06) !important;
}

[data-theme="white"] .footer,
[data-theme="white"] .footer-bar,
[data-theme="white"] .page-footer {
    background: #fafbfc !important;
    border-top: 1px solid #e8ebef !important;
    color: #4e5969 !important;
}

/* ---------- 3. 卡片 / 面板 / 模态框 ---------- */
[data-theme="white"] .card,
[data-theme="white"] .panel,
[data-theme="white"] .glass-card,
[data-theme="white"] .info-card,
[data-theme="white"] .stat-card,
[data-theme="white"] .feature-card,
[data-theme="white"] .quick-app-card,
[data-theme="white"] .category-card,
[data-theme="white"] .agent-card,
[data-theme="white"] .agent-tile {
    background: #ffffff !important;
    border: 1px solid #e8ebef !important;
    color: #1a1d1f !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
    backdrop-filter: none !important;
}

[data-theme="white"] .card:hover,
[data-theme="white"] .panel:hover,
[data-theme="white"] .quick-app-card:hover,
[data-theme="white"] .agent-tile:hover {
    border-color: rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

[data-theme="white"] .modal-overlay,
[data-theme="white"] .modal-mask {
    background: rgba(15, 23, 42, 0.45) !important;
}

[data-theme="white"] .modal,
[data-theme="white"] .modal-content,
[data-theme="white"] .modal-body,
[data-theme="white"] .dialog,
[data-theme="white"] .popover,
[data-theme="white"] .dropdown-menu {
    background: #ffffff !important;
    color: #1a1d1f !important;
    border: 1px solid #e8ebef !important;
}

[data-theme="white"] .modal-header,
[data-theme="white"] .modal-footer,
[data-theme="white"] .panel-header {
    border-color: #e8ebef !important;
    background: #ffffff !important;
}

/* ---------- 4. 表单 ---------- */
[data-theme="white"] input,
[data-theme="white"] textarea,
[data-theme="white"] select,
[data-theme="white"] .form-input,
[data-theme="white"] .form-select,
[data-theme="white"] .form-textarea,
[data-theme="white"] .input,
[data-theme="white"] .textarea {
    background: #ffffff !important;
    color: #1a1d1f !important;
    border: 1px solid #dfe3e8 !important;
}
[data-theme="white"] input::placeholder,
[data-theme="white"] textarea::placeholder {
    color: #86909c !important;
}

[data-theme="white"] input:focus,
[data-theme="white"] textarea:focus,
[data-theme="white"] select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12) !important;
    outline: none;
}

/* ---------- 5. 按钮 ---------- */
[data-theme="white"] .btn,
[data-theme="white"] button {
    color: #1a1d1f;
}
[data-theme="white"] .btn-primary,
[data-theme="white"] button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border: none !important;
}
[data-theme="white"] .btn-secondary,
[data-theme="white"] button.secondary,
[data-theme="white"] .btn-ghost {
    background: #ffffff !important;
    color: #4e5969 !important;
    border: 1px solid #dfe3e8 !important;
}
[data-theme="white"] .btn-secondary:hover {
    background: #f5f7fa !important;
}
[data-theme="white"] .btn-danger,
[data-theme="white"] button.danger {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

/* ---------- 6. 表格 ---------- */
[data-theme="white"] table {
    background: #ffffff !important;
    color: #1a1d1f !important;
    border-color: #e8ebef !important;
}
[data-theme="white"] thead,
[data-theme="white"] thead th {
    background: #f5f7fa !important;
    color: #1a1d1f !important;
    border-color: #e8ebef !important;
}
[data-theme="white"] tbody tr {
    border-color: #e8ebef !important;
}
[data-theme="white"] tbody tr:hover {
    background: #fafbfc !important;
}
[data-theme="white"] td {
    color: #4e5969 !important;
}

/* ---------- 7. 聊天气泡 ---------- */
[data-theme="white"] .chat-message,
[data-theme="white"] .message,
[data-theme="white"] .msg {
    color: #1a1d1f !important;
}
[data-theme="white"] .message-ai,
[data-theme="white"] .msg-ai,
[data-theme="white"] .assistant-message,
[data-theme="white"] .message.assistant .bubble {
    background: #f5f7fa !important;
    color: #1a1d1f !important;
    border: 1px solid #e8ebef !important;
}
[data-theme="white"] .message-user,
[data-theme="white"] .msg-user,
[data-theme="white"] .user-message,
[data-theme="white"] .message.user .bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

/* ---------- 8. 文本辅助色 / Badge / Pill ---------- */
[data-theme="white"] .text-muted,
[data-theme="white"] .muted,
[data-theme="white"] .hint,
[data-theme="white"] .help-text,
[data-theme="white"] .desc {
    color: #86909c !important;
}

[data-theme="white"] .pill,
[data-theme="white"] .badge,
[data-theme="white"] .chip,
[data-theme="white"] .tag {
    background: #eef2ff !important;
    color: #4338ca !important;
    border: 1px solid #c7d2fe !important;
}
[data-theme="white"] .pill.warn,
[data-theme="white"] .badge.warn {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
}
[data-theme="white"] .pill.danger,
[data-theme="white"] .badge.danger {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #fecaca !important;
}

/* ---------- 9. 分割线 / 边框 ---------- */
[data-theme="white"] hr,
[data-theme="white"] .divider {
    border-color: #e8ebef !important;
}

/* ---------- 10. 滚动条（webkit）---------- */
[data-theme="white"] ::-webkit-scrollbar {
    background: transparent;
}
[data-theme="white"] ::-webkit-scrollbar-track {
    background: #f5f7fa;
}
[data-theme="white"] ::-webkit-scrollbar-thumb {
    background: #dfe3e8;
    border-radius: 4px;
}
[data-theme="white"] ::-webkit-scrollbar-thumb:hover {
    background: #c1c9d2;
}

/* ---------- 11. 代码块 / 预格式化 ---------- */
[data-theme="white"] code,
[data-theme="white"] pre {
    background: #f5f7fa !important;
    color: #1a1d1f !important;
    border: 1px solid #e8ebef !important;
}

/* ---------- 12. Toast / Alert ---------- */
[data-theme="white"] .toast,
[data-theme="white"] .alert {
    background: #ffffff !important;
    color: #1a1d1f !important;
    border: 1px solid #e8ebef !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

/* ---------- 13. Hero / Big stats / Section titles ---------- */
[data-theme="white"] .hero-title,
[data-theme="white"] .section-title,
[data-theme="white"] .page-title,
[data-theme="white"] h1, [data-theme="white"] h2, [data-theme="white"] h3 {
    color: #1a1d1f !important;
}
[data-theme="white"] .hero-stats,
[data-theme="white"] .stats-row {
    background: #fafbfc !important;
    border: 1px solid #e8ebef !important;
}
[data-theme="white"] .stat-value {
    color: #1a1d1f !important;
}
[data-theme="white"] .stat-label {
    color: #86909c !important;
}

/* ============================================================================
   5 个 AI 应用页面（creator-analysis / script-extraction / track-monitor /
                       video-generation / image-generation）的白色主题适配
   ----------------------------------------------------------------------------
   这些页面有大量硬编码深蓝/霓虹色系样式，没做主题适配。这里用 union 选择器
   覆盖所有这些页面的常见 class 名——不存在的 class 在 CSS 里就是无操作，安全。
   全部用 !important 是因为页面里的样式块用了具体的 rgba 值（特异性比 :root 高）。
   ============================================================================ */

/* ---------- 通用：顶部导航 + 品牌 ---------- */
[data-theme="white"] .topbar,
[data-theme="white"] .top-nav,
[data-theme="white"] .topbar-nav {
    background: #ffffff !important;
    border-bottom: 1px solid #e8ebef !important;
    backdrop-filter: none !important;
}
[data-theme="white"] .topbar a,
[data-theme="white"] .top-nav a,
[data-theme="white"] .topbar-nav a {
    color: #4e5969 !important;
}
[data-theme="white"] .topbar a:hover,
[data-theme="white"] .top-nav a:hover,
[data-theme="white"] .topbar-nav a:hover {
    color: #667eea !important;
    background: rgba(102, 126, 234, 0.08) !important;
}
[data-theme="white"] .topbar-nav a.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #ffffff !important;
    border: 1px solid transparent !important;
}
[data-theme="white"] .brand-mark,
[data-theme="white"] .hero-icon,
[data-theme="white"] .app-icon-circle {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.28) !important;
}

/* ---------- 通用：Hero 横幅 ---------- */
[data-theme="white"] .hero,
[data-theme="white"] .app-hero {
    background: #ffffff !important;
    border: 1px solid #e8ebef !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
}
[data-theme="white"] .hero::before,
[data-theme="white"] .hero::after {
    display: none !important;
}
[data-theme="white"] .hero-title,
[data-theme="white"] .hero h2,
[data-theme="white"] .hero-text h2,
[data-theme="white"] .app-hero h2 {
    color: #1a1d1f !important;
}
[data-theme="white"] .hero-sub,
[data-theme="white"] .hero .desc,
[data-theme="white"] .hero-text .desc {
    color: #4e5969 !important;
}
[data-theme="white"] .hero-meta {
    background: rgba(102, 126, 234, 0.10) !important;
    border-color: rgba(102, 126, 234, 0.30) !important;
    color: #4338ca !important;
}
[data-theme="white"] .hero-meta .pdot {
    background: #667eea !important;
}
/* 渐变标题文字保留为紫色系，跟 white 主题协调 */
[data-theme="white"] .hero-title .grad {
    background: linear-gradient(120deg, #667eea, #764ba2, #f093fb) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* ---------- 通用：左右栏布局 + 主面板 ---------- */
[data-theme="white"] .left-panel,
[data-theme="white"] .right-panel,
[data-theme="white"] .col-left,
[data-theme="white"] .col-mid,
[data-theme="white"] .col-right {
    background: #ffffff !important;
    border-color: #e8ebef !important;
    backdrop-filter: none !important;
}
[data-theme="white"] .left-panel,
[data-theme="white"] .col-left {
    border-right: 1px solid #e8ebef !important;
}
[data-theme="white"] .col-right {
    border-left: 1px solid #e8ebef !important;
}
[data-theme="white"] .panel,
[data-theme="white"] .summary-box {
    background: #ffffff !important;
    border: 1px solid #e8ebef !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
    backdrop-filter: none !important;
}
[data-theme="white"] .panel-title,
[data-theme="white"] .panel h3 {
    color: #1a1d1f !important;
}
[data-theme="white"] .panel-title::before {
    background: linear-gradient(180deg, #667eea, #764ba2) !important;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4) !important;
}
[data-theme="white"] .section-title {
    color: #1a1d1f !important;
    border-bottom-color: #e8ebef !important;
}
[data-theme="white"] .section-title .sub {
    color: #86909c !important;
}

/* ---------- 通用：表单字段 ---------- */
[data-theme="white"] .field input,
[data-theme="white"] .field textarea,
[data-theme="white"] .field select,
[data-theme="white"] .form-field input,
[data-theme="white"] .form-field textarea,
[data-theme="white"] .form-field select,
[data-theme="white"] .form-row input,
[data-theme="white"] .form-row textarea,
[data-theme="white"] .form-row select {
    background: #ffffff !important;
    color: #1a1d1f !important;
    border: 1px solid #dfe3e8 !important;
}
[data-theme="white"] .field input:focus,
[data-theme="white"] .field textarea:focus,
[data-theme="white"] .field select:focus,
[data-theme="white"] .form-field input:focus,
[data-theme="white"] .form-field textarea:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
}
[data-theme="white"] .field label,
[data-theme="white"] .form-field label {
    color: #4e5969 !important;
}
[data-theme="white"] .field label .req {
    color: #dc2626 !important;
}

/* ---------- creator-analysis：分析维度芯片 .dim ---------- */
[data-theme="white"] .dim {
    background: #f5f7fa !important;
    border: 1px solid #e8ebef !important;
    color: #1a1d1f !important;
}
[data-theme="white"] .dim:hover {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
}
[data-theme="white"] .dim.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.18), rgba(118, 75, 162, 0.14)) !important;
    border-color: #667eea !important;
    color: #1a1d1f !important;
}
[data-theme="white"] .dim .ck {
    background: #ffffff !important;
    border-color: #dfe3e8 !important;
}
[data-theme="white"] .dim.active .ck {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

/* ---------- 通用：按钮 ---------- */
[data-theme="white"] .btn-submit,
[data-theme="white"] .btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.32) !important;
}
[data-theme="white"] .btn-submit:hover,
[data-theme="white"] .btn-primary:hover {
    box-shadow: 0 8px 22px rgba(102, 126, 234, 0.42) !important;
}
[data-theme="white"] .btn-ghost {
    background: #ffffff !important;
    border: 1px solid #dfe3e8 !important;
    color: #4e5969 !important;
}
[data-theme="white"] .btn-ghost:hover {
    background: #f5f7fa !important;
    border-color: #c7d2fe !important;
    color: #4338ca !important;
}
[data-theme="white"] .icon-btn {
    background: #ffffff !important;
    border: 1px solid #dfe3e8 !important;
    color: #1a1d1f !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}
[data-theme="white"] .icon-btn:hover {
    background: #f5f7fa !important;
    border-color: #667eea !important;
}

/* ---------- 通用：历史记录列表 ---------- */
[data-theme="white"] .hist-item,
[data-theme="white"] .history-item {
    background: #ffffff !important;
    border: 1px solid #e8ebef !important;
}
[data-theme="white"] .hist-item:hover,
[data-theme="white"] .history-item:hover {
    background: #f5f7fa !important;
    border-color: #c7d2fe !important;
}
[data-theme="white"] .history-item.active {
    background: #eef2ff !important;
    border-color: #667eea !important;
}
[data-theme="white"] .hist-item .h-title,
[data-theme="white"] .history-item .h-title,
[data-theme="white"] .history-title {
    color: #1a1d1f !important;
}
[data-theme="white"] .hist-item .h-meta,
[data-theme="white"] .history-item .h-meta {
    color: #86909c !important;
}
[data-theme="white"] .hist-empty {
    color: #86909c !important;
}
[data-theme="white"] .history-block {
    border-top: 1px solid #e8ebef !important;
}

/* ---------- 通用：状态徽章（处理中 / 完成 / 失败 / 待中）---------- */
[data-theme="white"] .h-status.processing,
[data-theme="white"] .status-processing {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #b45309 !important;
}
[data-theme="white"] .h-status.completed,
[data-theme="white"] .status-completed {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #047857 !important;
}
[data-theme="white"] .h-status.failed,
[data-theme="white"] .status-failed {
    background: rgba(239, 68, 68, 0.10) !important;
    color: #b91c1c !important;
}
[data-theme="white"] .h-status.pending,
[data-theme="white"] .status-pending {
    background: #f5f7fa !important;
    color: #4e5969 !important;
}

/* ---------- 通用：占位状态 ---------- */
[data-theme="white"] .placeholder-card,
[data-theme="white"] .placeholder-icon,
[data-theme="white"] .result-area.placeholder {
    color: #86909c !important;
}
[data-theme="white"] .placeholder-card .t {
    color: #1a1d1f !important;
}
[data-theme="white"] .placeholder-card .d {
    color: #86909c !important;
}
[data-theme="white"] .placeholder-card .ico {
    opacity: 0.55 !important;
    filter: drop-shadow(0 0 12px rgba(102, 126, 234, 0.25)) !important;
}

/* ---------- 通用：进度条 + 时间轴 ---------- */
[data-theme="white"] .progress-bar {
    background: #eef2ff !important;
    border-color: #c7d2fe !important;
}
[data-theme="white"] .progress-bar-fill,
[data-theme="white"] .progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2) !important;
}
[data-theme="white"] .progress-log,
[data-theme="white"] .terminal {
    background: #1e293b !important; /* 终端日志保持深色，看着更像 console */
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
}
[data-theme="white"] .terminal::before {
    color: rgba(148, 163, 184, 0.6) !important;
}
[data-theme="white"] .progress-header .ph-sub,
[data-theme="white"] .progress-hint,
[data-theme="white"] .progress-msg {
    color: #4e5969 !important;
}
[data-theme="white"] .spinner {
    border-color: #e8ebef !important;
    border-top-color: #667eea !important;
    border-right-color: #764ba2 !important;
}

/* 时间轴步骤（creator-analysis）*/
[data-theme="white"] .stage:not(:last-child)::before {
    background: #e8ebef !important;
}
[data-theme="white"] .stage.done:not(:last-child)::before {
    background: linear-gradient(180deg, #667eea, rgba(102, 126, 234, 0.3)) !important;
}
[data-theme="white"] .stage-icon {
    background: #ffffff !important;
    border: 2px solid #dfe3e8 !important;
    color: #86909c !important;
}
[data-theme="white"] .stage.active .stage-icon {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}
[data-theme="white"] .stage.done .stage-icon {
    background: rgba(16, 185, 129, 0.18) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #059669 !important;
}
[data-theme="white"] .stage-title { color: #1a1d1f !important; }
[data-theme="white"] .stage.done .stage-title { color: #047857 !important; }
[data-theme="white"] .stage.pending .stage-title { color: #86909c !important; }
[data-theme="white"] .stage-desc { color: #4e5969 !important; }

/* script-extraction 步骤列表 */
[data-theme="white"] .step { color: #86909c !important; }
[data-theme="white"] .step.done { color: #047857 !important; }
[data-theme="white"] .step.active { color: #764ba2 !important; }

/* ---------- 通用：结果区 / markdown ---------- */
[data-theme="white"] .result-area,
[data-theme="white"] .result-card,
[data-theme="white"] .markdown-result,
[data-theme="white"] .markdown {
    color: #1a1d1f !important;
}
[data-theme="white"] .result-title-row h3 {
    background: linear-gradient(135deg, #1a1d1f, #4338ca) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
[data-theme="white"] .result-badge {
    background: rgba(102, 126, 234, 0.10) !important;
    color: #4338ca !important;
    border-color: rgba(102, 126, 234, 0.32) !important;
}
[data-theme="white"] .result-badge.history {
    background: rgba(168, 85, 247, 0.10) !important;
    color: #7e22ce !important;
    border-color: rgba(168, 85, 247, 0.32) !important;
}
[data-theme="white"] .markdown-result h2,
[data-theme="white"] .markdown h2 {
    border-bottom: 1px solid #e8ebef !important;
    color: #1a1d1f !important;
}
[data-theme="white"] .markdown-result h3,
[data-theme="white"] .markdown h3 {
    color: #4338ca !important;
}
[data-theme="white"] .markdown-result th,
[data-theme="white"] .markdown th {
    background: #eef2ff !important;
    color: #1a1d1f !important;
}
[data-theme="white"] .markdown-result td,
[data-theme="white"] .markdown-result th,
[data-theme="white"] .markdown td,
[data-theme="white"] .markdown th {
    border-color: #e8ebef !important;
}
[data-theme="white"] .markdown-result code,
[data-theme="white"] .markdown code {
    background: #eef2ff !important;
    color: #4338ca !important;
}
[data-theme="white"] .markdown-result blockquote {
    border-left-color: #667eea !important;
    color: #4e5969 !important;
}

/* ---------- 通用：chip / 小芯片 ---------- */
[data-theme="white"] .chip {
    background: #f5f7fa !important;
    border: 1px solid #e8ebef !important;
    color: #4e5969 !important;
}
[data-theme="white"] .chip.chip-link {
    color: #4e5969 !important;
}
[data-theme="white"] .chip.chip-link:hover {
    border-color: #667eea !important;
    color: #4338ca !important;
    background: #eef2ff !important;
}
[data-theme="white"] .chip.chip-time {
    color: #86909c !important;
}

/* ---------- track-monitor：视频卡片 + 状态行 ---------- */
[data-theme="white"] .video-card {
    background: #ffffff !important;
    border: 1px solid #e8ebef !important;
}
[data-theme="white"] .video-card:hover {
    border-color: #667eea !important;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15) !important;
}
[data-theme="white"] .video-author { color: #86909c !important; }
[data-theme="white"] .video-title { color: #1a1d1f !important; }
[data-theme="white"] .video-stats { color: #86909c !important; }
[data-theme="white"] .video-stats .s { color: #4338ca !important; }
[data-theme="white"] .video-meta { color: #86909c !important; }
[data-theme="white"] .stat-row {
    background: #f5f7fa !important;
    border: 1px solid #e8ebef !important;
    color: #4e5969 !important;
}
[data-theme="white"] .stat-row .num { color: #4338ca !important; }

/* ---------- script-extraction：选项卡 / 上传区 / meta-row ---------- */
[data-theme="white"] .tab-bar {
    background: #f5f7fa !important;
    border: 1px solid #e8ebef !important;
}
[data-theme="white"] .tab-bar .tab-btn { color: #4e5969 !important; }
[data-theme="white"] .tab-bar .tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #ffffff !important;
}
[data-theme="white"] .upload-zone {
    background: #fafbfc !important;
    border: 2px dashed #dfe3e8 !important;
    color: #4e5969 !important;
}
[data-theme="white"] .upload-zone:hover {
    background: #eef2ff !important;
    border-color: #667eea !important;
}
[data-theme="white"] .upload-zone .hint { color: #86909c !important; }
[data-theme="white"] .meta-row { border-bottom-color: #e8ebef !important; }
[data-theme="white"] .meta-row .label { color: #86909c !important; }
[data-theme="white"] .meta-row .value { color: #1a1d1f !important; }
[data-theme="white"] .status-badge.status-processing {
    background: rgba(102, 126, 234, 0.10) !important;
    color: #4338ca !important;
}

/* ---------- creator-analysis：账号资料卡 + 浮窗聊天 ---------- */
[data-theme="white"] .account-profile {
    background: #ffffff !important;
    border: 1px solid #e8ebef !important;
}
[data-theme="white"] .account-name { color: #1a1d1f !important; }
[data-theme="white"] .account-signature { color: #4e5969 !important; }
[data-theme="white"] .account-stat { color: #4e5969 !important; }
[data-theme="white"] .account-badge {
    background: #eef2ff !important;
    color: #4338ca !important;
    border-color: #c7d2fe !important;
}
[data-theme="white"] .ai-chat-window {
    background: #ffffff !important;
    border: 1px solid #e8ebef !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10) !important;
}
[data-theme="white"] .ai-chat-head { border-bottom: 1px solid #e8ebef !important; }
[data-theme="white"] .ai-chat-title { color: #1a1d1f !important; }
[data-theme="white"] .ai-chat-sub { color: #86909c !important; }
[data-theme="white"] .ai-chat-input {
    background: #f5f7fa !important;
    color: #1a1d1f !important;
    border: 1px solid #e8ebef !important;
}
[data-theme="white"] .ai-msg { color: #1a1d1f !important; }
[data-theme="white"] .ai-quick {
    background: #eef2ff !important;
    color: #4338ca !important;
    border: 1px solid #c7d2fe !important;
}
[data-theme="white"] .ai-fab,
[data-theme="white"] .ai-float-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35) !important;
}
[data-theme="white"] .ai-chat-tip {
    background: #f5f7fa !important;
    border-bottom: 1px solid #e8ebef !important;
    color: #4e5969 !important;
}
[data-theme="white"] .ai-chat-messages {
    background: #ffffff !important;
}
[data-theme="white"] .ai-face {
    background: rgba(102, 126, 234, 0.16) !important;
    color: #4338ca !important;
}

/* ---------- script-extraction：右栏对话气泡 ---------- */
[data-theme="white"] .chat-head {
    border-bottom: 1px solid #e8ebef !important;
}
[data-theme="white"] .chat-input-row {
    border-top: 1px solid #e8ebef !important;
}
[data-theme="white"] .chat-empty {
    color: #86909c !important;
}
[data-theme="white"] .bubble.user {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #ffffff !important;
}
[data-theme="white"] .bubble.ai {
    background: #f5f7fa !important;
    border: 1px solid #e8ebef !important;
    color: #1a1d1f !important;
}

/* ---------- image/video-generation：filter 选项 + 结果卡 ---------- */
[data-theme="white"] .filter {
    background: #f5f7fa !important;
    border: 1px solid #e8ebef !important;
    color: #4e5969 !important;
}
[data-theme="white"] .filter:hover {
    background: #eef2ff !important;
    color: #4338ca !important;
}
[data-theme="white"] .filter.active {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}
[data-theme="white"] .result-img-card,
[data-theme="white"] .result-vid-card {
    background: #ffffff !important;
    border: 1px solid #e8ebef !important;
}
[data-theme="white"] .lightbox {
    background: rgba(15, 23, 42, 0.85) !important; /* 灯箱保持深色看图体验 */
}

/* ---------- 关键修复：玻璃面板（同行监控/视频生成/图片生成 的右栏结果框）---------- */
/* .glass-panel / .glass-card 用 var(--glass-bg, <深蓝rgba>)；如果 var 没设就 fallback 到深色，
   叠在白底上就是「灰框」。这里强制白底覆盖。 */
[data-theme="white"] .glass-panel,
[data-theme="white"] .glass-card {
    background: #ffffff !important;
    border: 1px solid #e8ebef !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
[data-theme="white"] .glass-panel:hover,
[data-theme="white"] .glass-card:hover {
    border-color: rgba(102, 126, 234, 0.32) !important;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.12) !important;
}
/* 视频/图片生成进度面板里嵌的提示条（蓝底蓝文字） */
[data-theme="white"] .progress-bar + div,
[data-theme="white"] .glass-panel [style*="background:rgba(43,124,238"] {
    /* inline 样式很难精确选中；保留就好——白底下浅蓝信息条本身可读 */
}

/* ---------- 通用：错误横幅 ---------- */
[data-theme="white"] .error-banner {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid #fecaca !important;
}

/* ---------- 通用：滚动条 ---------- */
[data-theme="white"] .col::-webkit-scrollbar,
[data-theme="white"] .left-panel::-webkit-scrollbar,
[data-theme="white"] .right-panel::-webkit-scrollbar {
    width: 8px;
}
[data-theme="white"] .col::-webkit-scrollbar-track,
[data-theme="white"] .left-panel::-webkit-scrollbar-track,
[data-theme="white"] .right-panel::-webkit-scrollbar-track {
    background: transparent;
}
[data-theme="white"] .col::-webkit-scrollbar-thumb,
[data-theme="white"] .left-panel::-webkit-scrollbar-thumb,
[data-theme="white"] .right-panel::-webkit-scrollbar-thumb {
    background: #dfe3e8;
    border-radius: 4px;
}
