| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- /* pages/chat/chat.wxss */
- .container {
- display: flex;
- flex-direction: column;
- height: 100vh;
- background: linear-gradient(180deg, #f8f9ff 0%, #f5f5f5 100%);
- }
- .messages-container {
- flex: 1;
- padding: 30rpx;
- overflow-y: auto;
- }
- .messages {
- display: flex;
- flex-direction: column;
- gap: 30rpx;
- }
- .message-row {
- display: flex;
- align-items: flex-end;
- gap: 16rpx;
- }
- .row-right {
- flex-direction: row-reverse;
- }
- .row-left {
- flex-direction: row;
- }
- .message-item {
- display: flex;
- flex-direction: column;
- max-width: 70%;
- animation: fadeIn 0.3s ease;
- }
- @keyframes fadeIn {
- from {
- opacity: 0;
- transform: translateY(10rpx);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
- }
- .user-message {
- align-self: flex-end;
- }
- .user-message .message-content {
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- color: #fff;
- border-radius: 20rpx 20rpx 4rpx 20rpx;
- padding: 20rpx 24rpx;
- box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
- }
- .assistant-message {
- align-self: flex-start;
- }
- .assistant-message .message-content {
- background: #fff;
- color: #333;
- border-radius: 20rpx 20rpx 20rpx 4rpx;
- padding: 20rpx 24rpx;
- box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
- border: 1rpx solid #f0f0f0;
- }
- .avatar {
- width: 56rpx;
- height: 56rpx;
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 26rpx;
- font-weight: 600;
- color: #fff;
- box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.08);
- }
- .avatar-user {
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- }
- .avatar-assistant {
- background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%);
- }
- .message-text {
- font-size: 28rpx;
- line-height: 1.6;
- word-wrap: break-word;
- }
- .message-time {
- font-size: 22rpx;
- color: #999;
- margin-top: 8rpx;
- padding: 0 8rpx;
- }
- .user-message .message-time, .time-right {
- text-align: right;
- }
- .assistant-message .message-time, .time-left {
- text-align: left;
- }
- .input-container {
- display: flex;
- align-items: center;
- padding: 20rpx 30rpx;
- padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
- background: #fff;
- border-top: 1rpx solid #e0e0e0;
- box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
- }
- .input-box {
- flex: 1;
- height: 72rpx;
- padding: 0 24rpx;
- background: #f5f5f5;
- border-radius: 36rpx;
- font-size: 28rpx;
- margin-right: 20rpx;
- transition: background 0.2s ease, box-shadow 0.2s ease;
- }
- .input-box:focus {
- background: #fff;
- box-shadow: 0 0 0 4rpx rgba(102,126,234,0.15);
- }
- .send-btn {
- width: 120rpx;
- height: 72rpx;
- line-height: 72rpx;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- color: #fff;
- border-radius: 36rpx;
- font-size: 28rpx;
- border: none;
- font-weight: 500;
- }
- .send-btn::after {
- border: none;
- }
- .send-btn[disabled] {
- background: #ccc;
- color: #999;
- }
- .loading {
- text-align: center;
- padding: 40rpx;
- font-size: 26rpx;
- color: #999;
- }
- .empty {
- text-align: center;
- padding: 160rpx 40rpx;
- color: #8b8b8b;
- }
- .empty-icon { font-size: 120rpx; opacity: 0.25; }
- .empty-title { display:block; margin-top: 24rpx; font-size: 30rpx; color:#666; font-weight: 600; }
- .empty-tip { display:block; margin-top: 10rpx; font-size: 26rpx; color:#9aa0a6; }
|