/* chat_system/css/chat.css */
body { font-family: sans-serif; margin: 0; padding: 0; background: #f0f2f5; }

.demo-content { padding: 50px; text-align: center; color: #666; }

/* 悬浮小球 */
.chat-trigger {
    position: fixed; bottom: 30px; right: 30px;
    width: 60px; height: 60px;
    background: #1a4a9c; border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s; z-index: 999;
}
.chat-trigger:hover { transform: scale(1.1); }
.chat-trigger .icon { color: white; font-size: 30px; }

/* 聊天主窗口 */
.chat-window {
    position: fixed; bottom: 100px; right: 30px;
    width: 380px; height: 600px; max-height: 80vh;
    background: white; border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.15);
    display: flex; flex-direction: column; overflow: hidden; z-index: 1000;
}

/* 头部 */
.chat-header {
    background: #1a4a9c; color: white; padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.header-info { display: flex; align-items: center; }
.avatar { width: 40px; height: 40px; background: #fff; color: #1a4a9c; 
          border-radius: 50%; font-weight: bold; display: flex; 
          align-items: center; justify-content: center; margin-right: 12px; }
.name { font-weight: bold; font-size: 16px; }
.status { font-size: 12px; opacity: 0.8; }
#close-chat { cursor: pointer; font-size: 24px; }

/* 消息区域 */
.chat-messages {
    flex: 1; padding: 20px; overflow-y: auto; background: #f9fafb;
}
.msg-item { margin-bottom: 20px; display: flex; }
.msg-item.user { justify-content: flex-end; }

.msg-bubble {
    max-width: 80%; padding: 10px 15px; border-radius: 15px;
    font-size: 14px; line-height: 1.5; word-wrap: break-word;
}
.msg-item.bot .msg-bubble { background: #fff; color: #333; border: 1px solid #eee; border-top-left-radius: 2px; }
.msg-item.user .msg-bubble { background: #1a4a9c; color: #fff; border-top-right-radius: 2px; }

/* 正在输入动效 */
.typing-indicator { padding: 0 20px 10px; display: flex; align-items: center; }
.typing-indicator span {
    width: 8px; height: 8px; background: #ccc; border-radius: 50%; margin-right: 4px;
    animation: typing 1s infinite alternate;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { from { opacity: 0.3; } to { opacity: 1; } }

/* 输入区域 */
.chat-input-area {
    padding: 15px; border-top: 1px solid #eee; display: flex; align-items: flex-end;
}
#user-input {
    flex: 1; border: none; outline: none; background: #f4f6f8; 
    padding: 10px 15px; border-radius: 20px; font-size: 14px;
    resize: none; max-height: 100px;
}
#send-btn {
    background: #1a4a9c; color: white; border: none; padding: 8px 15px;
    border-radius: 20px; margin-left: 10px; cursor: pointer; font-size: 14px;
}
#send-btn:hover { opacity: 0.9; }
