﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {

}

    body form {
        background-color: #f5f7fa;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
/* 顶部导航栏 */
.header {
    background-color: #409eff;
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

    .header h1 {
        font-size: 18px;
        font-weight: 600;
    }

    .header .settings {
        cursor: pointer;
        font-size: 16px;
    }

/* 聊天内容区域 */
.chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* 消息通用样式 */
.message {
    margin-bottom: 16px;
    display: flex;
    max-width: 80%;
}

/* 助手消息样式 */
.assistant-message {
    align-self: flex-start;
    flex-direction: row;
}

/* 用户消息样式 */
.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
    margin-left: auto;
}

/* 头像样式 - 重点修改：适配图片显示 */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e5e9f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
    flex-shrink: 0;
    overflow: hidden; /* 隐藏超出圆形的图片部分 */
}

.assistant-avatar {
    background-color: #409eff;
    color: white;
}

.user-avatar {
    /*background-color: #67c23a;*/
    background-color: #fff;
    color: white;
}

/* 头像图片样式 */
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持图片比例并填满容器 */
}

/* 消息内容气泡 */
.message-content {
    padding: 10px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    word-break: break-word;
    white-space: pre-wrap;
}

.assistant-content {
    background-color: white;
    border: 1px solid #e5e9f2;
    border-top-left-radius: 4px;
}

.user-content {
    background-color: #409eff;
    color: white;
    border-top-right-radius: 4px;
}

/* 输入区域样式 */
.input-container {
    padding: 16px 20px;
    background-color: white;
    border-top: 1px solid #e5e9f2;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e9f2;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    resize: none;
    height: 48px;
    max-height: 120px;
}

    #message-input:focus {
        border-color: #409eff;
    }

#send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #409eff;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    #send-btn:hover {
        background-color: #3399ff;
    }

/* 响应式适配 */
@media (max-width: 768px) {
    .chat-container, .input-container {
        max-width: 100%;
        padding: 10px;
    }

    .message {
        max-width: 90%;
    }
}
/* 聊天消息中的图片样式*/
.message-content img {
max-width: 100%;
max-height: 300px; 
border-radius: 8px; 
margin: 8px 0;
object-fit: contain; 
}