/* AI客服系统 - 深色主题 */

:root[data-theme="dark"] {
    /* 主题标识 */
    --theme-name: "深色主题";
    --theme-description: "护眼的深色主题，适合夜间使用";
    
    /* 背景和文本 */
    --background: linear-gradient(135deg, #0d1117 0%, #161b22 25%, #21262d 50%, #30363d 75%, #484f58 100%);
    --text-color: #ffffff;
    --text-color-secondary: #b3b3b3;
    --text-color-muted: #808080;
    
    /* 卡片和容器 */
    --card-background: rgba(45, 45, 45, 0.95);
    --card-background-hover: rgba(55, 55, 55, 0.98);
    --card-background-light: rgba(40, 40, 40, 0.85);
    --card-background-chat: rgba(45, 45, 45, 0.95);
    --card-background-header: rgba(50, 50, 50, 0.9);
    --card-background-input: rgba(50, 50, 50, 0.9);
    --card-background-content: rgba(40, 40, 40, 0.8);
    
    /* 边框颜色 */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-hover: rgba(255, 255, 255, 0.2);
    --border-color-input: rgba(255, 255, 255, 0.2);
    --border-color-focus: #00A86B;
    --border-color-divider: rgba(255, 255, 255, 0.1);
    
    /* 毛玻璃效果 */
    --backdrop-filter: blur(20px);
    --backdrop-filter-light: blur(10px);
    --backdrop-filter-mini: blur(3px);
    
    /* 阴影效果 */
    --shadow-card: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --shadow-button: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --shadow-button-hover: 
        0 6px 16px rgba(0, 168, 107, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --shadow-input: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-input-focus: 0 0 0 3px rgba(0, 168, 107, 0.2);
    --shadow-avatar: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-ai-avatar: 0 2px 8px rgba(76, 175, 80, 0.4);
    --shadow-user-message: 0 2px 8px rgba(0, 168, 107, 0.3);
    --shadow-notification: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-user-info: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.3);
    
    /* 按钮样式 - 德勤宝石绿 */
    --button-primary-bg: linear-gradient(135deg, #00A86B, #008B5A);
    --button-primary-color: white;
    --button-primary-hover: linear-gradient(135deg, #008B5A, #006B4A);
    --button-secondary-bg: rgba(60, 60, 60, 0.9);
    --button-secondary-color: #ffffff;
    --button-secondary-hover: rgba(70, 70, 70, 0.9);
    --button-danger-bg: #ff3b30;
    --button-danger-hover: #d70015;
    
    /* 输入框样式 */
    --input-background: rgba(60, 60, 60, 0.9);
    --input-background-focus: rgba(70, 70, 70, 0.9);
    --input-border: rgba(255, 255, 255, 0.2);
    --input-border-focus: #007AFF;
    --input-placeholder: #808080;
    
    /* 状态颜色 */
    --status-online: #30d158;
    --status-offline: #ff453a;
    --status-reconnecting: #ff9f0a;
    --status-error: #ff453a;
    
    /* 用户头像渐变 - 德勤宝石绿 */
    --avatar-gradient: linear-gradient(135deg, #00A86B, #008B5A, #006B4A);
    --avatar-shadow: 0 2px 8px rgba(0, 168, 107, 0.4);
    
    /* AI头像渐变 - 德勤宝石绿变种 */
    --ai-avatar-gradient: linear-gradient(135deg, #4CAF50, #2E7D32, #1B5E20);
    --ai-avatar-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
    
    /* 消息气泡样式 - 德勤宝石绿 */
    --user-message-bg: linear-gradient(135deg, #00A86B, #008B5A);
    --user-message-color: white;
    --user-message-shadow: 0 2px 8px rgba(0, 168, 107, 0.3);
    --ai-message-bg: transparent;
    --ai-message-color: var(--text-color);
    
    /* 通知样式 */
    --notification-bg: rgba(45, 45, 45, 0.95);
    --notification-border: rgba(255, 255, 255, 0.1);
    --notification-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --notification-success-border: #30d158;
    --notification-error-border: #ff453a;
    --notification-info-border: #007AFF;
    
    /* 加载动画 */
    --loading-bg: rgba(255, 255, 255, 0.1);
    --loading-border: rgba(255, 255, 255, 0.1);
    --loading-text: rgba(255, 255, 255, 0.7);
    --loading-spinner-border: rgba(255, 255, 255, 0.3);
    --loading-spinner-border-top: rgba(255, 255, 255, 0.8);
    
    /* 错误和成功消息 */
    --error-bg: rgba(255, 69, 58, 0.2);
    --error-border: rgba(255, 69, 58, 0.3);
    --error-color: #ff453a;
    --success-bg: rgba(48, 209, 88, 0.2);
    --success-border: rgba(48, 209, 88, 0.3);
    --success-color: #30d158;
    
    /* 思考动画 */
    --thinking-color: #00A86B;
    
    /* 背景动画 - 深色主题使用静态背景 */
    --background-animation: none;
}

/* 直接覆盖body样式 */
body[data-theme="dark"] {
    background: linear-gradient(135deg, 
        #1a1a2e 0%, 
        #16213e 25%, 
        #0f3460 50%, 
        #533483 75%, 
        #7209b7 100%) !important;
    color: #ffffff !important;
}

body[data-theme="dark"] .center-card {
    background: rgba(45, 45, 45, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="dark"] .action-button.login-btn {
    background: linear-gradient(135deg, #00A86B, #008B5A);
    color: white;
}

body[data-theme="dark"] .action-button.login-btn:hover {
    background: linear-gradient(135deg, #008B5A, #006B4A);
}

body[data-theme="dark"] .action-button.register-btn {
    background: rgba(60, 60, 60, 0.9);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body[data-theme="dark"] .action-button.register-btn:hover {
    background: rgba(80, 80, 80, 0.9);
}

/* 主题切换器样式 */
body[data-theme="dark"] .theme-switcher {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 10000 !important;
}

body[data-theme="dark"] .theme-toggle-btn {
    background: rgba(40, 40, 40, 0.9) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
}

body[data-theme="dark"] .theme-dropdown {
    background: rgba(40, 40, 40, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
}

body[data-theme="dark"] .theme-dropdown-header h3 {
    color: #ffffff !important;
}

body[data-theme="dark"] .theme-dropdown-close {
    color: #cccccc !important;
}

body[data-theme="dark"] .theme-item {
    color: #ffffff !important;
}

body[data-theme="dark"] .theme-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

body[data-theme="dark"] .theme-item.active {
    background: linear-gradient(135deg, #00A86B, #008B5A) !important;
    color: white !important;
}

body[data-theme="dark"] .theme-item-name {
    color: inherit !important;
}

body[data-theme="dark"] .theme-item-description {
    color: inherit !important;
}

/* 箭头按钮样式 */
body[data-theme="dark"] .arrow-button {
    background: rgba(255, 255, 255, 0.1);
    color: #cccccc;
}

body[data-theme="dark"] .arrow-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}


/* 登录页面样式 */
body[data-theme="dark"] .login-card {
    background: var(--card-background);
    backdrop-filter: var(--backdrop-filter);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

body[data-theme="dark"] .page-title {
    color: var(--text-color);
    text-shadow: var(--shadow-sm);
}

body[data-theme="dark"] .page-subtitle {
    color: var(--text-color-secondary);
}

/* 注册页面样式 */
body[data-theme="dark"] .register-card {
    background: var(--card-background);
    backdrop-filter: var(--backdrop-filter);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

/* 聊天页面样式 */
body[data-theme="dark"] .chat-card {
    background: var(--card-background);
    backdrop-filter: var(--backdrop-filter);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

body[data-theme="dark"] .chat-header {
    background: var(--card-background-header);
    border-bottom: 1px solid var(--border-color-divider);
}

body[data-theme="dark"] .chat-title {
    color: var(--text-color);
}

body[data-theme="dark"] .chat-messages {
    background: var(--card-background-content);
}

body[data-theme="dark"] .message-text {
    color: var(--text-color);
}

body[data-theme="dark"] .user-message .message-content {
    background: var(--user-message-bg);
    color: var(--user-message-color);
    box-shadow: var(--user-message-shadow);
    border-radius: 18px 18px 4px 18px;
    padding: 16px 20px;
}

body[data-theme="dark"] .ai-message {
    background: none;
    color: var(--text-color);
    border: none;
    padding: 12px 0;
    box-shadow: none;
}

body[data-theme="dark"] .chat-input {
    background: var(--input-background);
    border: 1px solid var(--input-border);
    color: var(--text-color);
}

body[data-theme="dark"] .chat-input:focus {
    border-color: var(--input-border-focus);
    box-shadow: var(--shadow-input-focus);
}

body[data-theme="dark"] .send-button {
    background: var(--button-primary-bg);
    color: var(--button-primary-color);
}

body[data-theme="dark"] .send-button:hover {
    background: var(--button-primary-hover);
}

body[data-theme="dark"] .form-input {
    background: var(--input-background);
    border: 1px solid var(--input-border);
    color: var(--text-color);
}

body[data-theme="dark"] .form-input:focus {
    border-color: var(--input-border-focus);
    box-shadow: var(--shadow-input-focus);
}

body[data-theme="dark"] .form-label {
    color: var(--text-color);
}

body[data-theme="dark"] .submit-btn {
    background: var(--button-primary-bg);
    color: var(--button-primary-color);
}

body[data-theme="dark"] .submit-btn:hover {
    background: var(--button-primary-hover);
}

body[data-theme="dark"] .back-btn {
    background: var(--button-secondary-bg);
    color: var(--button-secondary-color);
    border: 1px solid var(--border-color);
}

body[data-theme="dark"] .back-btn:hover {
    background: var(--button-secondary-hover);
}

body[data-theme="dark"] .logout-btn {
    background: var(--button-danger-bg);
    color: white;
}

body[data-theme="dark"] .logout-btn:hover {
    background: var(--button-danger-hover);
}

/* 强制设置body背景 */
html[data-theme="dark"] body {
    background: var(--background) !important;
}