2025-09-24 08:37:16 +08:00

187 lines
3.0 KiB
CSS

/* 客服聊天页面样式 */
page {
background-color: #f6f7fb;
overflow-y: hidden;
}
/* 聊天容器 */
.chat-container {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f6f7fb;
}
/* 聊天头部 */
.chat-header {
display: flex;
align-items: center;
justify-content: space-between;
height: 50px;
padding: 0 15px;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
padding-bottom: 15rpx;
}
.back-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
.chat-title {
font-size: 16px;
font-weight: 500;
color: #333;
}
.empty-header {
width: 40px;
}
/* 切换客服按钮 */
.change-service-btn {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
}
/* 连接状态提示 */
.connecting-status {
padding: 5px 15px;
background-color: #fff3cd;
color: #856404;
font-size: 14px;
text-align: center;
}
/* 聊天消息区域 */
.chat-messages {
width: 97%;
margin: 0 auto;
flex: 1;
padding: 10px;
overflow-y: auto;
}
/* 时间分割线 */
.message-time {
margin: 10px 0;
text-align: center;
font-size: 12px;
color: #999;
}
/* 消息项 */
.message-item {
display: flex;
margin-bottom: 15px;
align-items: flex-start;
}
.message-item.self {
flex-direction: row-reverse;
}
/* 头像 */
.message-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
margin: 0 10px;
}
/* 消息内容 */
.message-content {
max-width: 70%;
padding: 10px 15px;
border-radius: 10px;
word-break: break-word;
font-size: 15px;
line-height: 1.5;
}
.message-item.self .message-content {
background-color: #91d5ff;
color: #333;
border-bottom-right-radius: 4px;
}
.message-item.other .message-content {
background-color: #fff;
color: #333;
border-bottom-left-radius: 4px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
/* 加载状态 */
.message-item.loading .message-content {
opacity: 0.7;
}
/* 输入区域 */
.chat-input-area {
background-color: #fff;
padding: 10px 15px;
border-top: 1px solid #eee;
margin-bottom: 20rpx;
}
.input-container {
display: flex;
align-items: flex-end;
}
.message-input {
flex: 1;
height: 20px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 20px;
font-size: 15px;
line-height: 1.5;
resize: none;
background-color: #f9f9f9;
}
.send-btn {
margin-left: 10px;
padding: 0 20px;
height: 40px;
background-color: #07c160;
color: #fff;
font-size: 15px;
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.send-btn:disabled {
background-color: #ccc;
color: #fff;
}
/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
background-color: #f1f1f1;
border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb {
background-color: #c1c1c1;
border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
background-color: #a8a8a8;
}