/* AI助手客服样式 */
.ai-assistant {
    position: fixed;
    z-index: 9999;
}

/* 移动端图标 */
.ai-assistant-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.ai-assistant-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.ai-assistant-icon svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* PC端聊天窗口 */
.ai-chat-window {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

.ai-chat-window.minimized {
    height: 60px;
}

/* 聊天窗口头部 */
.ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chat-controls {
    display: flex;
    gap: 10px;
}

.ai-chat-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background 0.2s;
}

.ai-chat-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 聊天消息区域 */
.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    scroll-behavior: smooth;
    max-height: 350px;
}

/* 滚动条样式 */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.ai-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.ai-message.user .ai-message-avatar {
    background: #007bff;
}

.ai-message.assistant .ai-message-avatar {
    background: #28a745;
}

.ai-message-content {
    background: white;
    padding: 12px 15px;
    border-radius: 15px;
    max-width: 80%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.ai-message.user .ai-message-content {
    background: #007bff;
    color: white;
}

/* 输入区域 */
.ai-chat-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}

.ai-chat-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    font-size: 14px;
}

.ai-chat-input input:focus {
    border-color: #667eea;
}

.ai-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.ai-send-btn:hover {
    transform: scale(1.1);
}

.ai-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 加载动画 */
.ai-loading {
    display: flex;
    gap: 4px;
    padding: 10px 0;
}

.ai-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: ai-loading 1.4s ease-in-out infinite both;
}

.ai-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-loading {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .ai-chat-window.show {
        transform: translateY(0);
    }
    
    .ai-chat-window.minimized {
        transform: translateY(100%);
        height: 100%;
    }
    
    .ai-assistant-icon {
        display: block;
    }
}

@media (min-width: 769px) {
    .ai-assistant-icon {
        display: none;
    }
    
    .ai-chat-window {
        display: block;
    }
}

/* 隐藏状态 */
.ai-assistant.hidden {
    display: none;
}

/* 错误消息样式 */
.ai-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 10px;
    background: #f8d7da;
    border-radius: 5px;
}