/* 悬浮按钮 */
.ai-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0A76F7, #00c6ff);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(10, 118, 247, 0.4);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.ai-chat-btn:hover {
    transform: scale(1.1);
}

.ai-chat-btn svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

/* 聊天窗口容器 */
.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    display: none; /* 默认隐藏 */
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
    border: 1px solid #eee;
}

.ai-chat-window.active {
    display: flex;
    animation: slideIn 0.3s ease;
}

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

/* 头部 */
.ai-header {
    padding: 15px 20px;
    background: #0A76F7;
    color: #fff;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header .close-btn {
    cursor: pointer;
    font-size: 20px;
}

/* 消息区域 */
.ai-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
}

.message {
    margin-bottom: 15px;
    max-width: 85%;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.message.user {
    margin-left: auto;
    background: #0A76F7;
    color: #fff;
    padding: 10px 15px;
    border-radius: 12px 12px 0 12px;
}

.message.ai {
    margin-right: auto;
    background: #fff;
    color: #333;
    padding: 10px 15px;
    border-radius: 12px 12px 12px 0;
    border: 1px solid #e0e0e0;
}

/* 思考过程样式 */
.message.thinking {
    font-size: 12px;
    color: #888;
    font-style: italic;
    border-left: 2px solid #ccc;
    padding-left: 10px;
    margin-bottom: 5px;
    background: transparent;
    border: none;
    border-left: 3px solid #ddd;
}

/* 输入区域 */
.ai-input-area {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.ai-input-area input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    transition: border-color 0.2s;
}

.ai-input-area input:focus {
    border-color: #0A76F7;
}

.ai-input-area button {
    background: #0A76F7;
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

.ai-input-area button:disabled {
    background: #ccc;
    cursor: not-allowed;
}