﻿.ai-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-chat-content {
    background: #f5f5f5;
    width: 500px;
    height: 600px; /* 固定高度 */
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ai-chat-header {
    background: #333;
    color: #fff;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.ai-chat-close:hover {
    color: #ccc;
}

.ai-chat-messages {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto; /* 超出时显示滚动条 */
    background: #fff;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column; /* 垂直排列消息 */
}

.user-message {
    align-self: flex-end; /* 用户消息靠右 */
    background: #e0e0e0;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0;
    max-width: 70%;
    word-wrap: break-word;
}

.ai-message {
    align-self: flex-start; /* AI 消息靠左 */
    margin: 8px 0;
    max-width: 70%;
}

.ai-response p {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 4px 0;
    word-wrap: break-word;
}

.message-divider {
    border-top: 1px dashed #999;
    margin: 10px 0;
    width: 80%;
    align-self: center;
}

.ai-chat-input {
    padding: 15px;
    border-top: 1px solid #ddd;
    background: #f5f5f5;
    display: flex;
    gap: 10px;
}

.ai-chat-input input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #999;
    border-radius: 5px;
    font-size: 14px;
    background: #fff;
    outline: none;
}

.ai-chat-input input:focus {
    border-color: #333;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

.ai-chat-input button {
    padding: 8px 15px;
    background: #000; /* 黑色按钮 */
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.ai-chat-input button:hover {
    background: #333;
}

.error {
    color: #d9534f;
    font-style: italic;
}