/* 知识库问答机器人 - 独立样式文件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", Arial, sans-serif;
}

/* 右下角悬浮按钮 */
.chatbot-float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #409eff;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 15px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}
.chatbot-float-btn:hover {
    background: #66b1ff;
    transform: scale(1.05);
}
/* 禁止选中文字，避免拖动干扰 */
.chatbot-float-btn {
    -webkit-user-select: none;
    user-select: none;
}

/* 对话窗口容器 */
.chatbot-container {
    position: fixed;
    right: 30px;
    bottom: 35px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #eee;
}

/* 窗口头部 */
.chatbot-header {
    background: linear-gradient(135deg, #4285f4, #0d6efd);
    color: white;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chatbot-close {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.chatbot-close:hover {
    opacity: 1;
}

/* 对话内容区域 */
.chatbot-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
}
.chatbot-content::-webkit-scrollbar {
    width: 6px;
}
.chatbot-content::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

/* 样例问题区域 */
.sample-questions {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.sample-questions-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}
.sample-btn {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 8px 8px 0;
    background: #e8f4ff;
    color: #0d6efd;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}
.sample-btn:hover {
    background: #0d6efd;
    color: white;
}

/* 消息样式 + 头像样式 */
.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.message-user {
    justify-content: flex-end;
}
.message-assistant {
    justify-content: flex-start;
}
/* 通用头像 */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
/* 用户头像 */
.user-avatar {
    background: #0d6efd;
    color: #fff;
}
/* 机器人头像 */
.assistant-avatar {
    background: #e9ecef;
    color: #0d6efd;
}
.message-content {
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
}
.user-content {
    background: #0d6efd;
    color: white;
    border-bottom-right-radius: 4px;
}
.assistant-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 输入区域 */
.chatbot-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}
.input-wrap {
    display: flex;
    gap: 10px;
}
#chatInput {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}
#chatInput:focus {
    border-color: #0d6efd;
}
#sendBtn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #0d6efd;
    color: white;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}
#sendBtn:hover {
    background: #0b5ed7;
}

/* 加载中样式 */
.loading {
    display: inline-block;
    padding: 12px 18px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.loading-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0d6efd;
    margin: 0 2px;
    animation: loading 1s infinite alternate;
}
.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}
.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes loading {
    from { opacity: 0.3; }
    to { opacity: 1; }
}