/* 机器人图标样式 */
#chatbot-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    cursor: pointer;
    z-index: 1000;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background-color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#chatbot-icon:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

#chatbot-icon img {
    width: 70%;
    height: auto;
}

/* 对话框样式 */
#chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 800px;
    border: 1px solid #ccc;
    background-color: #fff;
    padding: 10px;
    z-index: 1001;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
    border-radius: 10px;
}

/* 对话框标题栏样式 */
#chatbot-header {
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.2em;
    color: #333;
    display: flex;
    justify-content: flex-start; /* 左对齐 */
    align-items: center; /* 垂直居中 */
    gap: 10px; /* 图标和文字之间的间距 */
    position: relative; /* 添加相对定位 */
}

/* 机器人图标样式 */
#chatbot-header .robot-icon {
    width: 30px; /* 图标大小 */
    height: 30px; /* 图标大小 */
    background-image: url('robot_icon.png'); /* 确保路径正确 */
    background-size: contain; /* 保持图标比例 */
    background-repeat: no-repeat;
    background-position: center;

}

#chatbot-messages {
    height: calc(100% - 150px);
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* 输入框和按钮容器样式 */
#chatbot-input-container {
    position: absolute;
    bottom: 20px; /* 调整底部间距 */
    left: 10px;
    right: 10px;
}

#user-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 5px;
    font-size: 0.9em;
    resize: none; /* 禁止用户调整大小 */
    height: 60px; /* 设置固定高度，支持三行文字 */
    line-height: 1.5; /* 调整行高 */
}

#chatbot button {
    width: 100%; /* 调整为100%宽度 */
    padding: 8px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
    margin-top: 10px; /* 增加与输入框的间距 */
}

#chatbot button:hover {
    background-color: #0056b3;
}


/* 关闭按钮样式 */
#chatbot-header .close-btn {
    background: none;
    border: none;
    font-size: 1.2em; /* 调整字体大小 */
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
    width: 24px; /* 固定宽度 */
    height: 24px; /* 固定高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* 圆形按钮 */
    transition: background-color 0.2s ease;
    position: absolute; /* 添加绝对定位 */
    top: 0; /* 固定在顶部 */
    right: 0; /* 固定在右侧 */
}

#chatbot-header .close-btn:hover {
    color: #333;
    background-color: #f0f0f0; /* 悬停时添加背景色 */
}

/* 消息样式 */
.user-message {
    color: #007bff;
    margin-bottom: 5px;
}

.bot-message {
    color: #333;
    margin-bottom: 5px;
}

/* 移动端样式 */
@media (max-width: 768px) {
    #chatbot {
        width: 90%;
        height: 70%; /* 调整移动端高度 */
        bottom: 10px;
        right: 5%;
    }

    #chatbot-messages {
        height: calc(100% - 130px); /* 调整移动端消息区域高度 */
    }

    #user-input {
        height: 50px; /* 调整移动端输入框高度 */
    }

    #chatbot button {
        width: 100%; /* 调整为100%宽度 */
    }
}