Files
JoyD/Claw/client/wechat_app/pages/chat/chat.wxss

425 lines
6.3 KiB
Plaintext
Raw Normal View History

2026-03-16 15:47:55 +08:00
/* 聊天页面样式 */
@import '../../utils/constant.wxss';
2026-03-16 15:47:55 +08:00
.chat-container {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f7f7f7;
2026-03-16 15:47:55 +08:00
}
.message-list {
flex: 1;
padding: 20rpx;
overflow-y: auto;
padding-bottom: 140rpx; /* 为输入区域预留空间 */
}
.empty-message {
display: flex;
justify-content: center;
align-items: center;
height: 400rpx;
color: #999;
}
.empty-text {
font-size: 28rpx;
color: #999;
}
.history-tip {
display: flex;
justify-content: center;
padding: 10rpx;
margin: 10rpx 0;
}
.history-tip text {
font-size: 24rpx;
color: #999;
background-color: #f0f0f0;
padding: 5rpx 20rpx;
border-radius: 20rpx;
2026-03-16 15:47:55 +08:00
}
.message-item {
display: flex;
margin: 20rpx 0;
align-items: flex-start;
padding: 0 10rpx;
2026-03-16 15:47:55 +08:00
}
.message-left {
flex-direction: row;
}
.message-right {
flex-direction: row-reverse;
}
.message-avatar {
width: 72rpx;
height: 72rpx;
margin: 0 16rpx;
2026-03-16 15:47:55 +08:00
flex-shrink: 0;
border-radius: 12rpx;
overflow: hidden;
2026-03-16 15:47:55 +08:00
}
.message-avatar image {
width: 100%;
height: 100%;
border-radius: 12rpx;
2026-03-16 15:47:55 +08:00
}
.message-content {
max-width: 75%;
2026-03-16 15:47:55 +08:00
display: flex;
flex-direction: column;
}
.message-header {
margin-bottom: 8rpx;
2026-03-16 15:47:55 +08:00
}
.message-nickname {
font-size: 24rpx;
color: #999;
font-weight: 500;
}
.message-body {
padding: 20rpx 24rpx;
word-wrap: break-word;
position: relative;
}
.message-left .message-body {
background-color: white;
border-radius: 16rpx 16rpx 16rpx 4rpx;
box-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.05);
}
.message-right .message-body {
background-color: #1677FF;
border-radius: 16rpx 16rpx 4rpx 16rpx;
box-shadow: 0 1rpx 2rpx rgba(22, 119, 255, 0.1);
}
.message-text-container {
line-height: 1.5;
}
.message-text {
font-size: 28rpx;
line-height: 1.5;
}
.message-left .message-text {
color: #333;
}
.message-right .message-text {
color: white;
}
.message-footer {
margin-top: 8rpx;
display: flex;
justify-content: flex-end;
2026-03-16 15:47:55 +08:00
}
.message-time {
font-size: 20rpx;
color: #ccc;
margin-right: 16rpx;
2026-03-16 15:47:55 +08:00
}
.message-image {
max-width: 400rpx;
max-height: 400rpx;
border-radius: 12rpx;
margin: 4rpx 0;
2026-03-16 15:47:55 +08:00
}
/* 代码块样式 */
.message-code {
background-color: #f5f5f5;
border-radius: 12rpx;
overflow: hidden;
margin: 8rpx 0;
}
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12rpx 16rpx;
background-color: #e8e8e8;
border-bottom: 1rpx solid #ddd;
}
.code-language {
font-size: 24rpx;
color: #666;
font-family: monospace;
}
.copy-btn {
background: none;
border: none;
display: flex;
align-items: center;
font-size: 22rpx;
color: #1677FF;
padding: 0;
}
.copy-icon {
margin-right: 4rpx;
}
.copy-text {
font-size: 22rpx;
}
.code-body {
padding: 16rpx;
max-height: 400rpx;
overflow-y: auto;
background-color: #f5f5f5;
}
.code-text {
font-size: 24rpx;
line-height: 1.4;
color: #333;
font-family: 'Courier New', Courier, monospace;
white-space: pre-wrap;
}
/* 按钮卡片样式 */
.message-button-card {
background-color: white;
border-radius: 12rpx;
padding: 20rpx;
box-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.05);
margin: 8rpx 0;
}
.card-title {
font-size: 26rpx;
font-weight: 500;
color: #333;
margin-bottom: 16rpx;
}
.card-buttons {
display: flex;
flex-direction: column;
gap: 12rpx;
}
.card-button {
background-color: #f8f8f8;
border: 1rpx solid #e0e0e0;
border-radius: 8rpx;
padding: 16rpx;
font-size: 26rpx;
color: #1677FF;
text-align: left;
transition: all 0.2s ease;
}
.card-button:active {
background-color: #f0f0f0;
}
/* 加载动画 */
.typing-container {
margin: 20rpx 0;
}
.typing-indicator {
display: flex;
align-items: center;
gap: 8rpx;
margin-bottom: 8rpx;
}
.typing-dot {
width: 12rpx;
height: 12rpx;
background-color: #1677FF;
border-radius: 50%;
animation: typing-bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) {
animation-delay: -0.32s;
}
.typing-dot:nth-child(2) {
animation-delay: -0.16s;
}
.typing-text {
font-size: 24rpx;
color: #999;
}
@keyframes typing-bounce {
0%, 80%, 100% {
transform: scale(0);
}
40% {
transform: scale(1);
}
}
/* 输入区域 */
2026-03-16 15:47:55 +08:00
.input-container {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: white;
border-top: 1rpx solid #e0e0e0;
padding: 20rpx;
z-index: 1000;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
2026-03-16 15:47:55 +08:00
}
.input-wrapper {
display: flex;
align-items: flex-end;
gap: 16rpx;
2026-03-16 15:47:55 +08:00
}
.message-input {
flex: 1;
border: 1rpx solid #e0e0e0;
border-radius: 28rpx;
padding: 20rpx 28rpx;
2026-03-16 15:47:55 +08:00
font-size: 28rpx;
background-color: #f8f8f8;
min-height: 80rpx;
max-height: 200rpx;
overflow-y: auto;
line-height: 1.4;
2026-03-16 15:47:55 +08:00
}
.message-input:focus {
border-color: #1677FF;
2026-03-16 15:47:55 +08:00
background-color: white;
box-shadow: 0 0 0 2rpx rgba(22, 119, 255, 0.1);
2026-03-16 15:47:55 +08:00
}
.send-btn {
background-color: #1677FF;
2026-03-16 15:47:55 +08:00
color: white;
border: none;
border-radius: 50%;
width: 80rpx;
height: 80rpx;
font-size: 26rpx;
2026-03-16 15:47:55 +08:00
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
2026-03-16 15:47:55 +08:00
transition: all 0.3s ease;
flex-shrink: 0;
2026-03-16 15:47:55 +08:00
}
.send-btn:active {
transform: scale(0.95);
background-color: #0e66e0;
2026-03-16 15:47:55 +08:00
}
.send-btn:disabled {
background: #ccc;
color: #999;
transform: none;
}
/* 富文本样式 */
rich-text {
line-height: 1.5;
2026-03-16 15:47:55 +08:00
}
rich-text :deep(p) {
margin: 12rpx 0;
2026-03-16 15:47:55 +08:00
}
rich-text :deep(h1),
rich-text :deep(h2),
rich-text :deep(h3) {
font-weight: 600;
margin: 16rpx 0 12rpx 0;
2026-03-16 15:47:55 +08:00
}
rich-text :deep(h1) {
font-size: 32rpx;
color: #333;
}
rich-text :deep(h2) {
font-size: 28rpx;
color: #444;
}
rich-text :deep(h3) {
font-size: 26rpx;
color: #555;
}
rich-text :deep(ul),
rich-text :deep(ol) {
margin: 12rpx 0;
padding-left: 40rpx;
}
rich-text :deep(li) {
margin: 8rpx 0;
line-height: 1.5;
}
rich-text :deep(strong) {
font-weight: 600;
}
/* 响应式设计 */
@media (max-width: 375px) {
.message-content {
max-width: 70%;
}
.message-avatar {
width: 64rpx;
height: 64rpx;
margin: 0 12rpx;
}
.message-body {
padding: 16rpx 20rpx;
}
.message-text {
font-size: 26rpx;
}
}
@media (min-width: 768px) {
.message-content {
max-width: 60%;
}
.message-body {
padding: 24rpx 28rpx;
}
.message-text {
font-size: 30rpx;
}
2026-03-16 15:47:55 +08:00
}