| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691 |
- /* 页面容器 - 符合抖音小程序视觉规范 */
- .container {
- min-height: 100vh;
- height: 100vh;
- background: #f8f9fa;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- padding-bottom: 100rpx;
- }
- /* 顶部导航栏 */
- .nav-bar {
- height: 88rpx;
- background: #ffffff;
- border-bottom: 1rpx solid #e8e8e8;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 32rpx;
- flex-shrink: 0;
- }
- .nav-left {
- display: flex;
- align-items: center;
- }
- .nav-logo {
- width: 48rpx;
- height: 48rpx;
- border-radius: 8rpx;
- margin-right: 16rpx;
- }
- .nav-title {
- font-size: 32rpx;
- font-weight: 600;
- color: #1a1a1a;
- line-height: 1.2;
- }
- .nav-right {
- display: flex;
- align-items: center;
- }
- .nav-icon {
- font-size: 36rpx;
- color: #666666;
- padding: 8rpx;
- }
- /* 聊天消息区域 - 完全重写的滚动解决方案 */
- .chat-container {
- flex: 1;
- min-height: 0;
- background: #f8f9fa;
- padding: 24rpx 40rpx 40rpx 40rpx;
- overflow-y: auto;
- box-sizing: border-box;
- height: auto;
- -webkit-overflow-scrolling: touch; /* 添加iOS滚动惯性 */
- position: relative;
- }
- /* 消息项通用样式 */
- .message-item {
- display: flex;
- width: 100%;
- box-sizing: border-box;
- padding: 0;
- margin-bottom: 32rpx;
- animation: fadeIn 0.3s ease-out;
- }
- .message-left {
- justify-content: flex-start;
- }
- .message-right {
- justify-content: flex-end;
- padding-right: 0;
- }
- .message-center {
- justify-content: center;
- }
- /* 头像样式 - 彻底解决显示不全和边框遮挡问题 */
- .avatar {
- width: 60rpx; /* 稍微减小宽度,为边框留出更多空间 */
- height: 60rpx; /* 稍微减小高度,保持比例 */
- border-radius: 50%;
- background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 30rpx; /* 相应调整字体大小 */
- color: #ffffff;
- flex-shrink: 0;
- margin: 0;
- z-index: 1; /* 避免头像压到固定输入区上层 */
- position: relative;
- overflow: hidden; /* 确保头像内容在容器内完整显示 */
- line-height: 60rpx; /* 让头像文字垂直居中完整显示 */
- min-width: 60rpx; /* 固定最小宽度 */
- min-height: 60rpx; /* 固定最小高度 */
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); /* 添加阴影增强可见性 */
- }
- .user-avatar {
- background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
- order: 2;
- }
- .message-left .avatar {
- margin-right: 12rpx;
- }
- .message-right .avatar {
- margin-left: 12rpx;
- }
- /* 消息内容区域 */
- .message-content {
- max-width: 440rpx;
- background: #ffffff;
- border-radius: 16rpx;
- padding: 20rpx 24rpx;
- box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
- position: relative;
- }
- .message-right .message-content {
- background: #4facfe;
- }
- .message-right .message-content::before {
- content: '';
- position: absolute;
- right: -8rpx;
- top: 20rpx;
- width: 0;
- height: 0;
- border-left: 8rpx solid #4facfe;
- border-top: 8rpx solid transparent;
- border-bottom: 8rpx solid transparent;
- }
- .message-left .message-content::before {
- content: '';
- position: absolute;
- left: -8rpx;
- top: 20rpx;
- width: 0;
- height: 0;
- border-right: 8rpx solid #ffffff;
- border-top: 8rpx solid transparent;
- border-bottom: 8rpx solid transparent;
- }
- /* 消息文本 */
- .message-text {
- font-size: 28rpx;
- color: #1a1a1a;
- line-height: 1.5;
- word-break: break-word;
- /* 与输入框保持完全一致的字体渲染 */
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- .message-right .message-text {
- color: #ffffff;
- }
- /* 消息时间 */
- .message-time {
- font-size: 20rpx;
- color: #999999;
- margin-top: 8rpx;
- display: block;
- }
- .message-right .message-time {
- color: rgba(255, 255, 255, 0.8);
- text-align: right;
- }
- /* 提示消息 */
- .tip-content {
- background: rgba(255, 255, 255, 0.8);
- border-radius: 20rpx;
- padding: 12rpx 24rpx;
- backdrop-filter: blur(10rpx);
- }
- .tip-text {
- font-size: 24rpx;
- color: #666666;
- font-style: italic;
- }
- /* 底部区域:输入区 + 版权信息 */
- .bottom-section {
- flex-shrink: 0;
- background: #ffffff;
- border-top: 1rpx solid #e8e8e8;
- }
- /* 输入区域 */
- .input-container {
- background: #ffffff;
- padding: 20rpx 32rpx;
- position: relative;
- box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.06);
- }
- .input-wrapper {
- background: #f8f9fa;
- border-radius: 24rpx;
- border: 1rpx solid #e8e8e8;
- position: relative;
- padding: 0;
- }
- .message-input {
- width: 100%;
- min-height: 120rpx;
- max-height: 200rpx;
- background: transparent;
- border: none;
- font-size: 28rpx; /* 与消息记录完全一致 */
- color: #1a1a1a; /* 与助手消息文本颜色完全一致 */
- line-height: 1.6; /* 优化行高 */
- padding: 16rpx 120rpx 40rpx 16rpx;
- resize: none;
- box-sizing: border-box;
- font-weight: 400; /* 确保字体权重一致 */
- /* 针对 textarea 原生组件的特殊优化 */
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
- }
- .message-input::placeholder {
- color: #999999;
- font-size: 28rpx;
- }
- /* 输入框内部元素 */
- .char-count-inside {
- position: absolute;
- bottom: 8rpx;
- right: 100rpx;
- font-size: 20rpx;
- color: #999999;
- z-index: 10;
- }
- .input-actions {
- position: absolute;
- bottom: 8rpx;
- right: 16rpx;
- display: flex;
- align-items: center;
- flex-shrink: 0;
- }
- .send-btn {
- width: 60rpx;
- height: 60rpx;
- border-radius: 50%;
- background: #e8e8e8;
- border: none;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: all 0.3s ease;
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
- }
- .send-btn.active {
- background: #4facfe;
- box-shadow: 0 2rpx 12rpx rgba(79, 172, 254, 0.4);
- }
- .send-btn::after {
- border: none;
- }
- .send-icon {
- font-size: 28rpx;
- color: #ffffff;
- transform: rotate(225deg);
- display: block;
- }
- .send-btn:not(.active) .send-icon {
- color: #999999;
- }
- .send-btn:not(.active) {
- background: #e8e8e8;
- }
- .send-btn:active {
- transform: scale(0.95);
- }
- /* 加载状态 */
- .loading-container {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.4);
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 1000;
- }
- .loading-content {
- background: #ffffff;
- border-radius: 16rpx;
- padding: 32rpx;
- display: flex;
- align-items: center;
- flex-direction: column;
- }
- .loading-dots {
- display: flex;
- gap: 8rpx;
- margin-bottom: 16rpx;
- }
- .dot {
- width: 12rpx;
- height: 12rpx;
- border-radius: 50%;
- background: #4facfe;
- animation: bounce 1.4s infinite ease-in-out;
- }
- .dot:nth-child(1) {
- animation-delay: -0.32s;
- }
- .dot:nth-child(2) {
- animation-delay: -0.16s;
- }
- .loading-text {
- font-size: 24rpx;
- color: #666666;
- }
- /* 动画效果 */
- @keyframes fadeIn {
- from {
- opacity: 0;
- transform: translateY(20rpx);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
- }
- @keyframes bounce {
- 0%, 80%, 100% {
- transform: scale(0.8);
- opacity: 0.5;
- }
- 40% {
- transform: scale(1);
- opacity: 1;
- }
- }
- /* 滚动锚点 */
- #bottom-anchor {
- height: 120rpx; /* 给最新消息预留可视缓冲,避免贴到底部输入区边缘 */
- }
- /* 导航栏下方简介区域 */
- .nav-intro-section {
- background: rgba(255, 255, 255, 0.95);
- border-bottom: 1rpx solid #e8e8e8;
- padding: 16rpx 32rpx;
- text-align: center;
- flex-shrink: 0;
- }
- .nav-intro-text {
- font-size: 24rpx;
- color: #666666;
- line-height: 1.4;
- display: block;
- }
- /* 底部版权信息 */
- .footer-section {
- background: #ffffff;
- border-top: 1rpx solid #e8e8e8;
- padding: 16rpx 32rpx;
- text-align: center;
- position: relative;
- }
- /* 顶部标题区域 */
- .header {
- text-align: center;
- margin-bottom: 0;
- padding: 20rpx 0 16rpx;
- flex-shrink: 0;
- }
- .logo-section {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-bottom: 8rpx;
- }
- .logo {
- width: 80rpx;
- height: 80rpx;
- border-radius: 16rpx;
- margin-right: 12rpx;
- }
- .app-name {
- font-size: 28rpx;
- font-weight: bold;
- color: #ffffff;
- text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
- line-height: 1.2;
- }
- .welcome-text {
- font-size: 20rpx;
- color: rgba(255, 255, 255, 0.85);
- line-height: 1.3;
- max-width: 400rpx;
- margin: 0 auto;
- padding: 0 16rpx;
- }
- /* 功能介绍区域 */
- .feature-section {
- margin-bottom: 16rpx;
- flex-shrink: 0;
- }
- .feature-item {
- background: rgba(255, 255, 255, 0.98);
- border-radius: 16rpx;
- padding: 16rpx;
- margin-bottom: 8rpx;
- display: flex;
- align-items: center;
- box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
- transition: all 0.3s ease;
- }
- .feature-item:active {
- transform: scale(0.98);
- }
- .feature-icon {
- font-size: 32rpx;
- margin-right: 16rpx;
- width: 40rpx;
- text-align: center;
- flex-shrink: 0;
- }
- .feature-content {
- flex: 1;
- min-width: 0;
- }
- .feature-title {
- font-size: 22rpx;
- font-weight: 600;
- color: #2c3e50;
- display: block;
- margin-bottom: 4rpx;
- line-height: 1.2;
- }
- .feature-desc {
- font-size: 18rpx;
- color: #7f8c8d;
- line-height: 1.3;
- display: block;
- }
- /* 操作按钮区域 */
- .action-section {
- display: flex;
- flex-direction: column;
- gap: 8rpx;
- margin-bottom: 16rpx;
- flex-shrink: 0;
- }
- .primary-btn {
- background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
- color: #ffffff;
- border: none;
- border-radius: 24rpx;
- height: 60rpx;
- font-size: 24rpx;
- font-weight: 600;
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow: 0 2rpx 8rpx rgba(255, 107, 107, 0.4);
- transition: all 0.3s ease;
- }
- .primary-btn::after {
- border: none;
- }
- .primary-btn:active {
- transform: scale(0.98);
- box-shadow: 0 2rpx 8rpx rgba(255, 107, 107, 0.4);
- }
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 移除不使用的样式 */
- /* 输入区域 */
- .input-section {
- margin-bottom: 16rpx;
- flex-shrink: 0;
- }
- .legacy-message-input {
- width: 100%;
- height: 120rpx;
- background: #ffffff;
- border: 1rpx solid #e1e8ed;
- border-radius: 12rpx;
- padding: 12rpx;
- font-size: 20rpx;
- color: #2c3e50;
- box-sizing: border-box;
- resize: none;
- }
- .legacy-message-input::placeholder {
- color: #95a5a6;
- font-size: 20rpx;
- }
- .char-count {
- font-size: 16rpx;
- color: #7f8c8d;
- text-align: right;
- margin-top: 4rpx;
- }
- /* 助手回复区域 */
- .reply-section {
- background: rgba(255, 255, 255, 0.98);
- border-radius: 12rpx;
- padding: 16rpx;
- margin-bottom: 12rpx;
- box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
- animation: fadeIn 0.4s ease-in-out;
- flex-shrink: 0;
- max-height: 200rpx;
- overflow-y: auto;
- }
- .reply-header {
- margin-bottom: 8rpx;
- }
- .reply-title {
- font-size: 22rpx;
- font-weight: 600;
- color: #3498db;
- display: block;
- line-height: 1.2;
- }
- .reply-content {
- background: #f8f9fa;
- border-radius: 8rpx;
- padding: 12rpx;
- margin-bottom: 8rpx;
- }
- .reply-text {
- font-size: 20rpx;
- color: #2c3e50;
- line-height: 1.4;
- white-space: pre-wrap;
- word-break: break-word;
- }
- .reply-actions {
- display: flex;
- justify-content: flex-end;
- }
- .reply-close-btn {
- background: #95a5a6;
- color: #ffffff;
- border: none;
- border-radius: 20rpx;
- height: 44rpx;
- font-size: 20rpx;
- font-weight: 500;
- padding: 0 20rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .reply-close-btn::after {
- border: none;
- }
- .reply-close-btn:active {
- transform: scale(0.98);
- background: #5a6268;
- }
- @keyframes fadeIn {
- from {
- opacity: 0;
- transform: translateY(16rpx);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
- }
- /* 底部信息 */
- .footer {
- text-align: center;
- padding: 8rpx 0;
- flex-shrink: 0;
- }
- .footer-text {
- font-size: 16rpx;
- color: rgba(255, 255, 255, 0.7);
- }
- .footer-section .footer-text {
- font-size: 20rpx;
- color: #999999;
- line-height: 1.4;
- }
|