/* 原有样式不变，省略 */
/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    overflow: hidden;
    font-family: "Microsoft Yahei", sans-serif;
}

/* 聊天窗口（全屏展示） */
.im-chat {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #e6e6e6;
    display: flex;
    align-items: center;
    background-color: #f8f8f8;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.chat-title {
    font-size: 16px;
    font-weight: 600;
}

.chat-status {
    font-size: 12px;
    color: #52c41a;
    margin-top: 2px;
}

.chat-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #fafafa;
}

/* 消息样式 */
.msg-item {
    margin-bottom: 20px;
    display: flex;
}

.msg-item.user {
    justify-content: flex-end;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.msg-item.user .msg-avatar {
    margin-right: 0;
    margin-left: 10px;
}

.msg-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 8px;
    position: relative;
    word-wrap: break-word;
}

.msg-item.robot .msg-content {
    background-color: #fff;
    border: 1px solid #e6e6e6;
}

.msg-item.user .msg-content {
    background-color: #168cff;
    color: #fff;
}

/* 多媒体消息样式 */
.msg-media {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    cursor: pointer;
}

.msg-video {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    cursor: pointer;
}

.msg-time {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    text-align: center;
}

/* 输入区域 */
.chat-input {
    padding: 15px;
    border-top: 1px solid #e6e6e6;
    background-color: #fff;
}

.input-toolbar {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
}

.tool-btn {
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border-radius: 4px;
    border: none;
    background-color: #f5f5f5;
    cursor: pointer;
    margin-right: 8px;
    font-size: 18px;
}

.tool-btn:hover {
    background-color: #e8e8e8;
}

.input-wrap {
    display: flex;
    align-items: flex-end;
}

#msgInput {
    flex: 1;
    resize: none;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #e6e6e6;
    outline: none;
    height: 60px;
    font-size: 14px;
}

#sendBtn {
    margin-left: 10px;
    width: 80px;
    height: 60px;
    border-radius: 6px;
}

/* 隐藏文件上传按钮 */
#fileUpload {
    display: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .chat-content {
        padding: 10px;
    }

    .msg-content {
        max-width: 85%;
    }

    .msg-media, .msg-video {
        max-width: 150px;
        max-height: 150px;
    }

    #msgInput {
        height: 50px;
    }

    #sendBtn {
        width: 70px;
        height: 50px;
    }
}

/* 图片预览弹窗 */
.preview-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.preview-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.close-preview {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}
