Files
ZhiQiXiaoYuan/pages/ai-assistant/ai-assistant.wxss
ChuXun eaab9a762a 1
2025-10-19 20:28:31 +08:00

357 lines
6.2 KiB
Plaintext

/* pages/ai-assistant/ai-assistant.wxss */
@import "/styles/design-tokens.wxss";
@import "/styles/premium-animations.wxss";
.ai-container {
width: 100%;
height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
flex-direction: column;
position: relative;
}
/* 场景选择栏 */
.scenario-bar {
padding: 20rpx 0;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20rpx);
border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
}
.scenario-scroll {
white-space: nowrap;
padding: 0 20rpx;
}
.scenario-item {
display: inline-block;
padding: 20rpx 30rpx;
margin-right: 20rpx;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 20rpx;
text-align: center;
transition: all 0.3s ease;
box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
}
.scenario-item:active {
transform: scale(0.95);
box-shadow: 0 2rpx 8rpx rgba(102, 126, 234, 0.2);
}
.scenario-icon {
font-size: 48rpx;
margin-bottom: 8rpx;
}
.scenario-name {
font-size: 24rpx;
color: #FFFFFF;
font-weight: 500;
}
/* 欢迎界面 */
.welcome-section {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60rpx 40rpx;
animation: fadeInUp 0.6s ease;
}
.welcome-icon {
font-size: 120rpx;
margin-bottom: 30rpx;
animation: float 3s ease-in-out infinite;
}
.welcome-title {
font-size: 48rpx;
font-weight: bold;
color: #FFFFFF;
margin-bottom: 20rpx;
text-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}
.welcome-subtitle {
font-size: 28rpx;
color: rgba(255, 255, 255, 0.9);
margin-bottom: 60rpx;
text-align: center;
}
.welcome-tips {
width: 100%;
}
.tip-item {
padding: 24rpx;
margin-bottom: 20rpx;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(20rpx);
border-radius: 16rpx;
color: #FFFFFF;
font-size: 28rpx;
border: 1rpx solid rgba(255, 255, 255, 0.3);
}
/* 消息列表 */
.message-list {
flex: 1;
padding: 30rpx;
overflow-y: auto;
}
.message-item {
display: flex;
margin-bottom: 30rpx;
animation: messageSlideIn 0.3s ease;
}
.message-item.user {
flex-direction: row-reverse;
}
.avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
flex-shrink: 0;
margin: 0 20rpx;
}
.avatar image {
width: 100%;
height: 100%;
}
.user-avatar {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
display: flex;
align-items: center;
justify-content: center;
font-size: 40rpx;
box-shadow: 0 4rpx 12rpx rgba(74, 144, 226, 0.3);
}
.ai-avatar {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
font-size: 40rpx;
box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
}
.message-content {
max-width: 500rpx;
animation: fadeIn 0.3s ease;
}
.message-text {
padding: 24rpx 28rpx;
border-radius: 20rpx;
font-size: 28rpx;
line-height: 1.6;
word-wrap: break-word;
white-space: pre-wrap;
}
.message-item.user .message-text {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #FFFFFF;
border-bottom-right-radius: 4rpx;
box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
}
.message-item.assistant .message-text {
background: rgba(255, 255, 255, 0.95);
color: #2D3436;
border-bottom-left-radius: 4rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}
.message-time {
font-size: 22rpx;
color: rgba(255, 255, 255, 0.7);
margin-top: 8rpx;
text-align: right;
}
.message-item.assistant .message-time {
text-align: left;
}
/* AI思考中 */
.thinking-dots {
display: flex;
align-items: center;
padding: 24rpx 28rpx;
background: rgba(255, 255, 255, 0.95);
border-radius: 20rpx;
border-bottom-left-radius: 4rpx;
}
.dot {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background: #667eea;
margin: 0 6rpx;
animation: thinking 1.4s infinite;
}
.dot:nth-child(2) {
animation-delay: 0.2s;
}
.dot:nth-child(3) {
animation-delay: 0.4s;
}
/* 输入区域 */
.input-bar {
display: flex;
align-items: flex-end;
padding: 20rpx;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20rpx);
border-top: 1rpx solid rgba(0, 0, 0, 0.05);
safe-area-inset-bottom: constant(safe-area-inset-bottom);
safe-area-inset-bottom: env(safe-area-inset-bottom);
}
.input-wrapper {
flex: 1;
position: relative;
margin-right: 20rpx;
}
.message-input {
width: 100%;
min-height: 80rpx;
max-height: 200rpx;
padding: 20rpx 24rpx;
background: #F5F6FA;
border-radius: 16rpx;
font-size: 28rpx;
line-height: 1.5;
box-sizing: border-box;
}
.char-count {
position: absolute;
right: 24rpx;
bottom: 8rpx;
font-size: 20rpx;
color: #999999;
}
.send-btn {
width: 120rpx;
height: 80rpx;
background: #CCCCCC;
color: #FFFFFF;
border-radius: 16rpx;
font-size: 28rpx;
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
margin: 0;
padding: 0;
border: none;
}
.send-btn.active {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.4);
}
.send-btn:active {
transform: scale(0.95);
}
.send-btn::after {
border: none;
}
/* 清空按钮 */
.clear-btn {
position: absolute;
top: 20rpx;
right: 20rpx;
padding: 16rpx 24rpx;
background: rgba(255, 59, 48, 0.9);
color: #FFFFFF;
border-radius: 30rpx;
font-size: 24rpx;
box-shadow: 0 4rpx 12rpx rgba(255, 59, 48, 0.3);
z-index: 100;
}
.clear-btn:active {
transform: scale(0.95);
}
/* 动画 */
@keyframes messageSlideIn {
from {
opacity: 0;
transform: translateY(20rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes thinking {
0%, 60%, 100% {
transform: translateY(0);
opacity: 0.7;
}
30% {
transform: translateY(-10rpx);
opacity: 1;
}
}
@keyframes float {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-20rpx);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(40rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}