.chat-message { display: flex; margin-bottom: 8px; } .message-content { display: flex; align-items: center; } .chat-message.user { justify-content: flex-end; } .chat-message.bot { justify-content: flex-start; } .chat-message.user .message-content { flex-direction: row-reverse; /* 头像和气泡反向排列 */ } .avatar { width: 40px; height: 40px; border-radius: 50%; margin: 0 8px; } .bubble { max-width: 70%; padding: 8px; border-radius: 4px; background-color: #e0e0e0; word-wrap: break-word; } .chat-message.user .bubble { background-color: #1cbbb4; color: #fff; } .chat-container { display: flex; flex-direction: column; height: 100vh; justify-content: space-between; } .chat-box { flex: flex; height: 100%; padding: 16px; overflow-y: auto; background-color: #f9f9f9; } .input-box { display: flex; align-items: center; /* 垂直居中对齐 */ padding: 5px; background-color: #f9f9f9; margin-left: 15px; } .box1 { flex: 1; /* 使输入框占据剩余空间 */ height: 35px; /* 设置输入框的高度 */ padding: 8px; /* 设置输入框内边距 */ font-size: 16px; /* 设置字体大小 */ border: 1px solid #ccc; /* 设置边框 */ border-radius: 4px; /* 设置边框圆角 */ box-sizing: border-box; /* 使内边距和边框包含在宽度和高度内 */ margin-right: 10px; /* 设置输入框和按钮之间的间距 */ } .send-button { display: flex; /* 使用 flexbox 布局 */ justify-content: center; /* 水平居中对齐 */ align-items: center; /* 垂直居中对齐 */ background-color: #62adf9; /* 设置按钮背景色 */ border: none; /* 去掉按钮边框 */ padding: 15px 10px; /* 设置按钮内边距 */ color: #fff; /* 设置按钮文字颜色 */ border-radius: 4px; /* 设置按钮圆角 */ cursor: pointer; /* 设置鼠标指针为手型 */ font-size: 16px; /* 设置字体大小 */ }