/* 聊天小部件样式 */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 聊天按钮 */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.chat-toggle-btn img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* 聊天弹窗 */
.chat-popup {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.chat-popup.show {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 聊天头部 */
.chat-header {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chat-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.user {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    background: white;
    color: #333;
    align-self: flex-start;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 4px;
}

/* 聊天输入区域 */
.chat-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #2196F3;
}

.chat-send-btn {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 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;
}

.chat-send-btn:hover {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin: 10px 0;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .chat-popup {
        width: 300px;
        height: 400px;
        right: -10px;
    }
    
    .chat-widget {
        right: 10px;
        bottom: 10px;
    }
    
    .chat-toggle-btn {
        width: 50px;
        height: 50px;
    }
    
    .chat-toggle-btn img {
        width: 28px;
        height: 28px;
    }
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
