body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0; /* 背景颜色 */
}

.chat-container {
    max-width: 600px; /* 限制最大宽度 */
    margin: 0 auto; /* 居中 */
}

.chat {
    display: flex; /* 使用 flexbox */
    align-items: flex-start; /* 让头像与气泡顶部对齐 */
    margin-bottom: 15px; /* 添加底部间距 */
}

.chat-start {
    justify-content: flex-start; /* 左侧对齐 */
}

.chat-end {
    justify-content: flex-end; /* 右侧对齐 */
}

.chat-image {
    margin-right: 10px; /* 头像和气泡之间的间距 */
}

.chat-bubble {
    position: relative; /* 让伪元素相对于聊天气泡进行定位 */
}

.chat-bubble:before {
    border-color: transparent #4b5a6f transparent transparent; /* 设置三角箭头的颜色 */
    border-style: solid; /* 边框样式为实线 */
    border-width: 6px; /* 边框宽度 */
    content: ""; /* 设置伪元素内容为空 */
    position: absolute; /* 绝对定位 */
    left: -9px; /* 三角箭头位置在气泡左侧 */
    top:10px; /* 根据缩放比例调整箭头垂直位置 */
 }

/* 如果气泡在右侧的箭头 */
.chat-end .chat-bubble:before {
    border-color: transparent transparent transparent #4a8ac6;
    border-style: solid;
    border-width: 6px;
    content: "";
    position: absolute;
    top: 10px;
    inset-inline-start: 99%;
    }

/*聊天气泡*/
.chat-bubble {
    color: white; /* 字体颜色 */
    border-radius: 15px; /* 圆角 */
    padding: 10px 15px; /* 内边距 */
    max-width: 100%; /* 最大宽度 */
    word-wrap: break-word; /* 自动换行 */
    flex-grow: 0; /* 让聊天框占据更多空间 */
    margin-top: 5px; /* 与昵称之间的间距 */
    position: relative; /* 必须加上，确保伪元素定位在正确的位置 */
    /* 保持气泡底部的圆角 */
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}


.chat-start .chat-bubble {
    background-color: #4b5a6f; /* 左侧气泡颜色 */
    border-end-start-radius: 15px; /* 取消左下角圆角 */
}

.chat-end .chat-bubble {
    background-color: #4a8ac6; /* 右侧气泡颜色 */
    border-end-end-radius: 15px; /* 取消左下角圆角 */
}

/*表情*/
.emoji-image {
    width: 200px; /* 表情图片的宽度 */
    height: 200px; /* 表情图片的高度 */
    display: inline-block; /* 让表情和文本在同一行显示 */
    vertical-align: middle; /* 垂直对齐 */
}


.chat-image img {
    width: 60px; /* 头像宽度 */
    height: 60px; /* 头像高度 */
    border-radius: 50%; /* 确保头像为圆形 */
    object-fit: cover; /* 保证图片覆盖整个区域，不会变形 */
}

/*头像容器，用这个*/
.avatar-container {
    width: 65px; /* 固定宽度 */
    height: 65px; /* 固定高度 */
    border-radius: 50%; /* 使其成为圆形 */
    overflow: hidden; /* 确保图片不会溢出容器 */
}

.avatar-container img {
    width: 100%; /* 图片填满容器 */
    height: 100%; /* 图片填满容器 */
    object-fit: cover; /* 保持图片比例并填满容器 */
}

/*昵称设置*/
.chat-header {
    font-weight: bold; /* 粗体 */
    color: black; /* 字体颜色 */
    margin-bottom: 3px; /* 与气泡的间距减小 */
    align-self: flex-start; /* 确保昵称和气泡左对齐 */
}

/*旁白气泡*/
.text-container {
    display: flex; /* 使用 flexbox 布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    height: 30px; /* 可根据需要调整高度 */
}

/*旁白设置*/
.text-message {
    color: #474f5d; /* 设置文本颜色 */
    font-size: 15px; /* 设置字体大小 */
    text-align: center; /* 文本居中对齐 */
    background-color: #dce6e8; /* 设置色块的背景颜色 */
    border: 0px solid #dce6e8; /* 设置边框 */
    border-radius: 10px; /* 设置圆角 */
    padding: 5px 10px; /* 添加内边距 */
    font-weight: bold; /* 加粗字体 */
}

/*羁绊气泡*/
.text-bubble {
    display: flex; /* 使用 flexbox 布局 */
    flex-direction: column; /* 让内容垂直排列 */
    align-items: flex-start; /* 左对齐 */
    background-color: rgba(255, 255, 255, 0.9); /* 背景颜色，可以根据需要自定义 */
    background-image: url('https://bu.dusays.com/2024/10/09/6705649e15f30.jpg'); /* 自定义背景图片 */
    background-size: cover; /* 使背景图覆盖整个气泡 */
    background-position: center; /* 确保背景图居中显示 */
    border-radius: 15px; /* 圆角 */
    padding: 15px; /* 内边距 */
    max-width: 520px; /* 限制最大宽度 */
    margin: 30px auto; /* 居中 */
    box-sizing: border-box; /* 包括内边距和边框在内的宽度计算 */
    box-shadow: 0px 3.2px 6.4px 0px rgba(0, 0, 0, 0.3);
}

/*羁绊按钮分割线*/
.separator {
    margin: 5px 0; /* 上下间距 */
    width: 100%; /* 横线宽度 */
    border-top: 1px solid #fff; /* 横线样式 */
}

/*羁绊按钮文本*/
.text {
    color: #474f5d; /* 文本颜色 */
    font-size: 20px; /* 文本大小 */
    text-align: left; /* 文本左对齐 */
    font-weight: bold; /* 加粗字体 */
    margin-bottom: 5px; /* 文本与分隔线之间的间距 */
}

/*羁绊按钮*/
.button {
    background-color: #fc879a; /* 按钮颜色 */
    color: white; /* 按钮文字颜色 */
    font-weight: bold; /* 加粗字体 */
    border: none; /* 去掉边框 */
    border-radius: 5px; /* 圆角 */
    padding: 15px; /* 内边距 */
    cursor: pointer; /* 鼠标悬停变为手形 */
    transition: background-color 0.3s; /* 动画效果 */
    width: 100%; /* 按钮宽度适应气泡 */
    box-sizing: border-box; /* 包括内边距和边框在内的宽度计算 */
    box-shadow: 0px 0.6px 1.6px 0px rgba(0, 0, 0, 0.4);
}

/*羁绊按钮点击效果*/
.button:hover {
    background-color: #fc748a; /* 鼠标悬停时按钮颜色 */
}

.button:active {
    background-color: #f1304f;
}

.text-center {
    text-align: center;
  }