/* 基础样式 */
body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* 客服按钮样式 */
#chat-button {
    position: fixed;
    bottom: 100px;
    right: 80px;
    width: 60px;
    height: 60px;
    background-color: floralwhite;
    background-image: url('../image/aikf.png'); /* 替换为你的图片路径 */
    background-size: cover; /* 覆盖整个div区域 */
    background-position: center; /* 图片居中 */
    color: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-size: 24px;
    touch-action: none; /* 防止触摸事件的默认行为 */
}

/* 悬浮提示样式 */
#tooltip {
    visibility: hidden;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* 提示信息在按钮上方 */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap; /* 防止文字换行 */
}

#chat-button:hover #tooltip {
    visibility: visible;
    opacity: 1;
}

/* 机器人介绍框样式 */
#intro-box {
    position: fixed;
    bottom: 140px;
    right: 140px; /* 位于机器人图标的左侧 */
    width: 200px;
    height: 70px;
    padding: 10px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#intro-box .close-button {
    align-self: flex-end;
    cursor: pointer;
    color: #666;
    font-size: 12px;
}

#intro-box .close-button:hover {
    color: #333;
}

/* 聊天框样式 */
#chat-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50vw;
    height: 84vh;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    z-index: 1000;
}

#chat-header {
    padding: 10px;
    background-color: #4b5259;
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

#chat-header .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

#chat-header .header-info {
    display: flex;
    align-items: center;
}

#chat-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
}

.message {
    max-width: 80%;
    padding: 10px;
    border-radius: 10px;
    word-wrap: break-word;
    font-size: 14px;
    position: relative;
}

.message.user {
    background-color: #171b1e;
    color: white;
    align-self: flex-end;
}

.message.bot {
    background-color: #f1f1f1;
    color: black;
    align-self: flex-start;
}

.message-time {
    font-size: 10px;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

#chat-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
    display: flex;
    background-color: white;
    border-radius: 10px;
}

#chat-footer input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
    font-size: 14px;
}

#chat-footer button {
    padding: 10px 20px;
    background-color: #4b5259;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

#minimize-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

/* 手机屏幕适配 */
@media only screen and (max-width: 600px) {
    #chat-box {
        width: 90vw; /* 宽度为屏幕宽度的90% */
        height: 60vh; /* 高度为屏幕高度的60% */
    }

    #chat-button {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        font-size: 20px;
    }

    #intro-box {
        bottom: 80px;
        right: 90px;
        width: 150px;
    }
}