/* 聊天页面样式 */ @import '../../utils/constant.wxss'; .chat-container { display: flex; flex-direction: column; height: 100vh; background-color: #f7f7f7; } .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; } .message-item { display: flex; margin: 20rpx 0; align-items: flex-start; padding: 0 10rpx; } .message-left { flex-direction: row; } .message-right { flex-direction: row-reverse; } .message-avatar { width: 72rpx; height: 72rpx; margin: 0 16rpx; flex-shrink: 0; border-radius: 12rpx; overflow: hidden; } .message-avatar image { width: 100%; height: 100%; border-radius: 12rpx; } .message-content { max-width: 75%; display: flex; flex-direction: column; } .message-header { margin-bottom: 8rpx; } .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; } .message-time { font-size: 20rpx; color: #ccc; margin-right: 16rpx; } .message-image { max-width: 400rpx; max-height: 400rpx; border-radius: 12rpx; margin: 4rpx 0; } /* 代码块样式 */ .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); } } /* 输入区域 */ .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); } .input-wrapper { display: flex; align-items: flex-end; gap: 16rpx; } .message-input { flex: 1; border: 1rpx solid #e0e0e0; border-radius: 28rpx; padding: 20rpx 28rpx; font-size: 28rpx; background-color: #f8f8f8; min-height: 80rpx; max-height: 200rpx; overflow-y: auto; line-height: 1.4; } .message-input:focus { border-color: #1677FF; background-color: white; box-shadow: 0 0 0 2rpx rgba(22, 119, 255, 0.1); } .send-btn { background-color: #1677FF; color: white; border: none; border-radius: 50%; width: 80rpx; height: 80rpx; font-size: 26rpx; font-weight: 500; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; flex-shrink: 0; } .send-btn:active { transform: scale(0.95); background-color: #0e66e0; } .send-btn:disabled { background: #ccc; color: #999; transform: none; } /* 富文本样式 */ rich-text { line-height: 1.5; } rich-text :deep(p) { margin: 12rpx 0; } rich-text :deep(h1), rich-text :deep(h2), rich-text :deep(h3) { font-weight: 600; margin: 16rpx 0 12rpx 0; } 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; } }