﻿/**
 * AI 功能样式
 * 使用主题统一的 CSS 变量，支持动态切换主题
 * 
 * @package Xuhuan
 * @since 1.5.0
 */

/* ==================== AI 搜索建议 ==================== */

.ai-search-wrapper {
    position: relative;
}

.ai-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    margin-top: var(--spacing-xs);
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.ai-suggestions.show {
    display: block;
}

.ai-suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.ai-suggestion-item:hover {
    background: var(--bg-hover);
}

.ai-suggestion-item:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.suggestion-text {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.suggestion-type {
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px var(--spacing-sm);
    border-radius: var(--radius-xs);
}

/* AI 搜索图标 */
.ai-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    opacity: 0.7;
    transition: var(--transition-fast);
}

.ai-search-wrapper:focus-within .ai-search-icon {
    opacity: 1;
}

/* ==================== AI 生成按钮 ==================== */

.ai-generate-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.ai-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.ai-generate-btn:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

.ai-generate-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ai-generate-btn.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
}

.ai-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

@keyframes ai-spin {
    to { transform: rotate(360deg); }
}

/* ==================== AI 智能客服聊天机器人 ==================== */

.tah-chatbot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: var(--z-modal);
    font-family: var(--font-primary);
}

/* 悬浮按钮 */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    color: var(--text-light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 0 0 rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    animation: robot-pulse 2s ease-in-out infinite;
    position: relative;
    overflow: visible;
}

@keyframes robot-pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5), 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(99, 102, 241, 0.5);
    animation: none;
}

.chatbot-toggle:hover .robot-eye {
    animation: robot-blink 0.3s ease;
}

.chatbot-toggle:hover .robot-mouth {
    width: 12px;
    height: 6px;
    border-radius: 0 0 6px 6px;
}

.tah-chatbot.open .chatbot-toggle {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* 机器人图标 */
.robot-icon {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.robot-head {
    position: relative;
    width: 32px;
    height: 28px;
}

/* 天线 */
.robot-antenna {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: #fff;
    border-radius: 2px;
    animation: antenna-bounce 1s ease-in-out infinite;
}

.robot-antenna::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
    animation: antenna-glow 1s ease-in-out infinite;
}

@keyframes antenna-bounce {
    0%, 100% { transform: translateX(-50%) rotate(-5deg); }
    50% { transform: translateX(-50%) rotate(5deg); }
}

@keyframes antenna-glow {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
        transform: translateX(-50%) scale(1);
    }
    50% { 
        box-shadow: 0 0 15px rgba(251, 191, 36, 1);
        transform: translateX(-50%) scale(1.2);
    }
}

/* 脸部 */
.robot-face {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #fff 0%, #e0e7ff 100%);
    border-radius: 8px;
    position: relative;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

/* 眼睛 */
.robot-eyes {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.robot-eye {
    width: 8px;
    height: 8px;
    background: #1e1b4b;
    border-radius: 50%;
    position: relative;
    animation: eye-look 3s ease-in-out infinite;
}

.robot-eye::before {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

@keyframes eye-look {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(2px); }
    75% { transform: translateX(-2px); }
}

@keyframes robot-blink {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

/* 嘴巴 */
.robot-mouth {
    width: 10px;
    height: 4px;
    background: #6366f1;
    border-radius: 0 0 4px 4px;
    transition: all 0.2s ease;
    animation: mouth-talk 2s ease-in-out infinite;
}

@keyframes mouth-talk {
    0%, 100% { 
        width: 10px; 
        height: 4px;
    }
    25%, 75% { 
        width: 8px; 
        height: 3px;
    }
    50% { 
        width: 12px; 
        height: 5px;
    }
}

/* 旧的 SVG 图标隐藏 */
.chatbot-toggle svg {
    display: none;
}

/* 聊天窗口 */
.chatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.chatbot-window[aria-hidden="false"],
.tah-chatbot.open .chatbot-window {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* 聊天头部 */
.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--primary-color);
    color: var(--text-light);
}

.chatbot-title {
    font-size: var(--text-base);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.chatbot-title svg {
    width: 20px;
    height: 20px;
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: var(--transition-fast);
}

.chatbot-close:hover {
    opacity: 1;
}

/* 消息区域 */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    background: var(--bg-secondary);
}

.chat-message {
    display: flex;
    max-width: 85%;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user .message-content {
    background: var(--primary-color);
    color: var(--text-light);
    border-bottom-right-radius: var(--radius-xs);
}

.chat-message.assistant .message-content {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-bottom-left-radius: var(--radius-xs);
}

/* 格式化消息样式 */
.chat-message.formatted .message-content {
    padding: var(--spacing-md);
}

.chat-message.formatted .message-content p {
    margin: 0 0 0.75em 0;
}

.chat-message.formatted .message-content p:last-child {
    margin-bottom: 0;
}

.chat-message.formatted .message-content h2.chat-h2,
.chat-message.formatted .message-content h3.chat-h3,
.chat-message.formatted .message-content h4.chat-h4 {
    margin: 0.75em 0 0.5em 0;
    font-weight: 600;
    line-height: 1.3;
}

.chat-message.formatted .message-content h2.chat-h2:first-child,
.chat-message.formatted .message-content h3.chat-h3:first-child,
.chat-message.formatted .message-content h4.chat-h4:first-child {
    margin-top: 0;
}

.chat-message.formatted .message-content h2.chat-h2 {
    font-size: 1.1em;
    color: var(--primary-color);
}

.chat-message.formatted .message-content h3.chat-h3 {
    font-size: 1em;
}

.chat-message.formatted .message-content h4.chat-h4 {
    font-size: 0.95em;
    color: var(--text-secondary);
}

.chat-message.formatted .message-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.chat-message.formatted .message-content em {
    font-style: italic;
}

.chat-message.formatted .message-content ul.chat-list,
.chat-message.formatted .message-content ol.chat-list {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.chat-message.formatted .message-content li {
    margin: 0.25em 0;
    line-height: 1.5;
}

.chat-message.formatted .message-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
}

.chat-message.formatted .message-content pre.code-block {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.75em;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5em 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85em;
    line-height: 1.4;
}

/* 资源信息卡片样式 */
.chat-message.formatted .message-content .resource-card {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 0.75em;
    margin: 0.5em 0;
}

.chat-message.formatted .message-content .resource-card-title {
    font-weight: 600;
    margin-bottom: 0.5em;
}

/* 流式光标 */
.chat-message.streaming .message-content {
    min-height: 1.5em;
}

.stream-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--primary-color);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursor-blink 0.8s infinite;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.chat-message.streaming .message-content br + .stream-cursor {
    display: block;
    margin-left: 0;
    margin-top: 2px;
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* 快速回复按钮 */
.chatbot-quick-replies {
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.quick-reply {
    padding: 6px 12px;
    font-size: var(--text-xs);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    color: var(--text-secondary);
}

.quick-reply:hover {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

/* 输入区域 */
.chatbot-input-wrapper {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border-light);
    background: var(--card-bg);
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    outline: none;
    background: var(--input-bg);
    color: var(--input-text);
    transition: var(--transition-fast);
}

.chatbot-input::placeholder {
    color: var(--input-placeholder);
}

.chatbot-input:focus {
    border-color: var(--input-border-focus);
    box-shadow: var(--input-shadow-focus);
}

.chatbot-send {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chatbot-send:hover {
    background: var(--primary-hover);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== AI 推荐区块 ==================== */

.ai-recommend-section {
    margin: var(--spacing-xl) 0;
}

.ai-recommend-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.ai-recommend-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.ai-recommend-title svg {
    color: var(--primary-color);
}

.ai-recommend-badge {
    padding: 2px 8px;
    font-size: var(--text-xs);
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-xs);
}

/* ==================== Toast 提示 ==================== */

.tah-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-dark);
    color: var(--text-light);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-tooltip);
    opacity: 0;
    transition: var(--transition-normal);
}

.tah-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.tah-toast.success {
    background: var(--success-color);
}

.tah-toast.error {
    background: var(--error-color);
}

.tah-toast.warning {
    background: var(--warning-color);
}

.tah-toast.info {
    background: var(--info-color);
}

/* ==================== 响应式适配 ==================== */

@media (max-width: 480px) {
    .tah-chatbot {
        bottom: 16px;
        right: 16px;
    }
    
    .chatbot-toggle {
        width: 52px;
        height: 52px;
    }
    
    .chatbot-toggle svg {
        width: 24px;
        height: 24px;
    }
    
    .robot-icon {
        width: 30px;
        height: 30px;
    }
    
    .robot-head {
        width: 26px;
        height: 24px;
    }
    
    .robot-antenna {
        top: -6px;
        height: 6px;
        width: 3px;
    }
    
    .robot-antenna::before {
        width: 6px;
        height: 6px;
        top: -4px;
    }
    
    .robot-eyes {
        gap: 6px;
    }
    
    .robot-eye {
        width: 6px;
        height: 6px;
    }
    
    .robot-eye::before {
        width: 2px;
        height: 2px;
    }
    
    .robot-mouth {
        width: 8px;
        height: 3px;
    }
    
    .chatbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 60px;
        right: -8px;
    }
    
    .ai-generate-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   深色主题（Dark）- AI 功能适配
   ============================================================ */

[data-theme="dark"] .ai-suggestions {
    background: var(--card-bg);
    border-color: var(--card-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .ai-suggestion-item:hover {
    background: rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] .suggestion-type {
    background: rgba(129, 140, 248, 0.15);
    color: #818CF8;
}

[data-theme="dark"] .ai-generate-btn {
    background: rgba(129, 140, 248, 0.15);
    color: #818CF8;
    border-color: rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .ai-generate-btn:hover {
    background: #818CF8;
    color: #fff;
}

/* 聊天机器人 - 深色主题 */
[data-theme="dark"] .chatbot-toggle {
    background: linear-gradient(135deg, #818CF8 0%, #A78BFA 50%, #C084FC 100%);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.5), 0 0 0 0 rgba(129, 140, 248, 0.4);
}

[data-theme="dark"] .chatbot-toggle:hover {
    box-shadow: 0 8px 35px rgba(129, 140, 248, 0.6);
}

[data-theme="dark"] .robot-face {
    background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%);
}

[data-theme="dark"] .robot-antenna::before {
    background: #fcd34d;
    box-shadow: 0 0 10px rgba(252, 211, 77, 1);
}

[data-theme="dark"] .chatbot-window {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .chatbot-header {
    background: #818CF8;
}

[data-theme="dark"] .chatbot-messages {
    background: #1a1a1a;
}

[data-theme="dark"] .chat-message.user .message-content {
    background: #818CF8;
}

[data-theme="dark"] .chat-message.assistant .message-content {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .quick-reply {
    background: rgba(45, 45, 45, 0.8);
    border-color: #4B5563;
    color: #E5E7EB;
}

[data-theme="dark"] .quick-reply:hover {
    background: #818CF8;
    color: #fff;
    border-color: #818CF8;
}

[data-theme="dark"] .chatbot-input {
    background: #1F2937;
    border-color: #4B5563;
    color: #E5E7EB;
}

[data-theme="dark"] .chatbot-input:focus {
    border-color: #818CF8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .chatbot-send {
    background: #818CF8;
}

[data-theme="dark"] .chatbot-send:hover {
    background: #6366f1;
}

[data-theme="dark"] .ai-recommend-badge {
    background: rgba(129, 140, 248, 0.15);
    color: #818CF8;
}

[data-theme="dark"] .tah-toast {
    background: #2D2D2D;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   毛玻璃主题（Glass）- AI 功能适配
   ============================================================ */

[data-theme="glass"] .ai-suggestions {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-color: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

[data-theme="glass"] .ai-suggestion-item:hover {
    background: rgba(99, 102, 241, 0.06);
}

[data-theme="glass"] .suggestion-type {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

[data-theme="glass"] .ai-generate-btn {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

[data-theme="glass"] .ai-generate-btn:hover {
    background: #6366f1;
    color: #fff;
}

/* 聊天机器人 - 毛玻璃主题 */
[data-theme="glass"] .chatbot-toggle {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #A855F7 100%);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5), 0 0 0 0 rgba(99, 102, 241, 0.4);
    backdrop-filter: blur(10px);
}

[data-theme="glass"] .chatbot-toggle:hover {
    box-shadow: 0 8px 35px rgba(99, 102, 241, 0.6);
}

[data-theme="glass"] .robot-face {
    background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(224,231,255,0.9) 100%);
}

[data-theme="glass"] .chatbot-window {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-color: var(--glass-border);
    box-shadow: var(--glass-shadow-strong);
}

[data-theme="glass"] .chatbot-header {
    background: #6366F1;
}

[data-theme="glass"] .chatbot-messages {
    background: rgba(242, 242, 247, 0.6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

[data-theme="glass"] .chat-message.user .message-content {
    background: #6366F1;
}

[data-theme="glass"] .chat-message.assistant .message-content {
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.4);
}

[data-theme="glass"] .chatbot-quick-replies {
    background: rgba(242, 242, 247, 0.6);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

[data-theme="glass"] .quick-reply {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="glass"] .quick-reply:hover {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

[data-theme="glass"] .chatbot-input-wrapper {
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

[data-theme="glass"] .chatbot-input {
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

[data-theme="glass"] .chatbot-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="glass"] .chatbot-send {
    background: #6366F1;
}

[data-theme="glass"] .chatbot-send:hover {
    background: #5558e3;
}

[data-theme="glass"] .ai-recommend-badge {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

[data-theme="glass"] .tah-toast {
    background: var(--glass-bg-solid);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

/* ============================================================
   扁平主题（Flat）- AI 功能适配
   ============================================================ */

[data-theme="flat"] .ai-suggestions {
    background: #fff;
    border-color: #E5E7EB;
    border-radius: 4px;
    box-shadow: none;
}

[data-theme="flat"] .ai-suggestion-item:hover {
    background: #EFF6FF;
}

[data-theme="flat"] .suggestion-type {
    background: #EFF6FF;
    color: #2563eb;
}

[data-theme="flat"] .ai-generate-btn {
    background: #EFF6FF;
    color: #2563eb;
    border-color: #2563eb;
    border-radius: 4px;
}

[data-theme="flat"] .ai-generate-btn:hover {
    background: #2563eb;
    color: #fff;
}

/* 聊天机器人 - 扁平主题 */
[data-theme="flat"] .chatbot-toggle {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    animation: none;
}

[data-theme="flat"] .chatbot-toggle:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

[data-theme="flat"] .robot-face {
    background: #fff;
    border-radius: 6px;
}

[data-theme="flat"] .robot-mouth {
    background: #2563eb;
}

[data-theme="flat"] .robot-antenna::before {
    background: #f59e0b;
}

[data-theme="flat"] .chatbot-window {
    background: #fff;
    border-color: #E5E7EB;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="flat"] .chatbot-header {
    background: #2563eb;
}

[data-theme="flat"] .chatbot-messages {
    background: #F3F4F6;
}

[data-theme="flat"] .chat-message.user .message-content {
    background: #2563eb;
    border-radius: 12px;
    border-bottom-right-radius: 4px;
}

[data-theme="flat"] .chat-message.assistant .message-content {
    background: #fff;
    border-color: #E5E7EB;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

[data-theme="flat"] .quick-reply {
    background: #fff;
    border-color: #D1D5DB;
    border-radius: 4px;
}

[data-theme="flat"] .quick-reply:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

[data-theme="flat"] .chatbot-input {
    background: #fff;
    border-color: #D1D5DB;
    border-radius: 4px;
}

[data-theme="flat"] .chatbot-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

[data-theme="flat"] .chatbot-send {
    background: #2563eb;
    border-radius: 4px;
}

[data-theme="flat"] .chatbot-send:hover {
    background: #1d4ed8;
}

[data-theme="flat"] .ai-recommend-badge {
    background: #EFF6FF;
    color: #2563eb;
}

[data-theme="flat"] .tah-toast {
    border-radius: 4px;
    box-shadow: none;
    border: 1px solid #E5E7EB;
}

/* ============================================================
   极简白主题（Light）- AI 功能适配
   ============================================================ */

[data-theme="light"] .ai-suggestions {
    background: #fff;
    border-color: #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .ai-suggestion-item:hover {
    background: #ECFDF5;
}

[data-theme="light"] .suggestion-type {
    background: #ECFDF5;
    color: #10B981;
}

[data-theme="light"] .ai-generate-btn {
    background: #ECFDF5;
    color: #10B981;
    border-color: #10B981;
    border-radius: 8px;
}

[data-theme="light"] .ai-generate-btn:hover {
    background: #10B981;
    color: #fff;
}

/* 聊天机器人 - 极简白主题 */
[data-theme="light"] .chatbot-toggle {
    background: linear-gradient(135deg, #10B981 0%, #34D399 50%, #6EE7B7 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4), 0 0 0 0 rgba(16, 185, 129, 0.3);
}

[data-theme="light"] .chatbot-toggle:hover {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
}

[data-theme="light"] .robot-face {
    background: linear-gradient(180deg, #fff 0%, #D1FAE5 100%);
}

[data-theme="light"] .robot-mouth {
    background: #10B981;
}

[data-theme="light"] .robot-antenna::before {
    background: #FBBF24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
}

[data-theme="light"] .chatbot-window {
    background: #fff;
    border-color: #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .chatbot-header {
    background: #10B981;
}

[data-theme="light"] .chatbot-messages {
    background: #F9FAFB;
}

[data-theme="light"] .chat-message.user .message-content {
    background: #10B981;
}

[data-theme="light"] .chat-message.assistant .message-content {
    background: #fff;
    border-color: #E5E7EB;
}

[data-theme="light"] .quick-reply {
    background: #fff;
    border-color: #E5E7EB;
}

[data-theme="light"] .quick-reply:hover {
    background: #10B981;
    color: #fff;
    border-color: #10B981;
}

[data-theme="light"] .chatbot-input {
    background: #fff;
    border-color: #E5E7EB;
}

[data-theme="light"] .chatbot-input:focus {
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

[data-theme="light"] .chatbot-send {
    background: #10B981;
}

[data-theme="light"] .chatbot-send:hover {
    background: #059669;
}

[data-theme="light"] .ai-recommend-badge {
    background: #ECFDF5;
    color: #10B981;
}

[data-theme="light"] .tah-toast {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

/* 登录提示样式 */
.login-prompt,
.login-required-message {
    text-align: center;
    padding: 20px;
}

.login-prompt p,
.login-required-message p {
    margin: 0 0 15px;
    color: var(--text-color, #333);
}

.login-prompt .btn,
.login-required-message .btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary-color, #6366f1);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s;
}

.login-prompt .btn:hover,
.login-required-message .btn:hover {
    background: var(--primary-hover, #4f46e5);
    color: #fff;
}

.login-prompt .login-hint {
    font-size: 12px;
    color: var(--text-muted, #888);
    margin-top: 12px;
}

/* 禁用状态的输入框 */
.chatbot-input:disabled {
    background: var(--bg-tertiary, #f0f0f0);
    cursor: not-allowed;
}

.chatbot-input:disabled::placeholder {
    color: var(--text-muted, #999);
}
