/* pages/forum/forum.wxss */ .container { padding-bottom: 30rpx; background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); min-height: 100vh; animation: fadeIn 0.5s ease-out; /* 底部留出TabBar的空间 */ padding-bottom: calc(env(safe-area-inset-bottom) + 150rpx); } /* 分类标签 */ .category-scroll { white-space: nowrap; background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%); padding: 24rpx 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08); backdrop-filter: blur(10rpx); animation: slideInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1); } .category-list { display: inline-flex; padding: 0 30rpx; gap: 20rpx; } .category-item { display: inline-block; padding: 14rpx 32rpx; background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%); color: #666666; border-radius: 32rpx; font-size: 26rpx; font-weight: 500; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06); } .category-item:active { transform: scale(0.95); } .category-item.active { background: linear-gradient(135deg, #50C878 0%, #3CB371 100%); color: #ffffff; box-shadow: 0 4rpx 12rpx rgba(80, 200, 120, 0.3); transform: scale(1.05); } /* 帖子列表 */ .post-list { padding: 24rpx 30rpx; } .post-card { background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%); border-radius: 20rpx; padding: 35rpx; margin-bottom: 24rpx; box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.08); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); animation: slideInUp 0.6s ease-out; position: relative; overflow: hidden; } .post-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6rpx; background: linear-gradient(to bottom, #50C878, #3CB371); transform: scaleY(0); transition: transform 0.3s ease; } .post-card:active { transform: translateY(-4rpx); box-shadow: 0 12rpx 32rpx rgba(0, 0, 0, 0.12); } .post-card:active::before { transform: scaleY(1); } .post-card:nth-child(1) { animation-delay: 0.1s; } .post-card:nth-child(2) { animation-delay: 0.15s; } .post-card:nth-child(3) { animation-delay: 0.2s; } .post-card:nth-child(4) { animation-delay: 0.25s; } .post-card:nth-child(5) { animation-delay: 0.3s; } /* 帖子头部 */ .post-header { display: flex; align-items: center; margin-bottom: 24rpx; } .avatar { width: 80rpx; height: 80rpx; border-radius: 50%; margin-right: 18rpx; background: linear-gradient(135deg, #e0e0e0 0%, #c8c8c8 100%); box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1); transition: all 0.3s ease; } .avatar:active { transform: scale(1.1); } .author-info { flex: 1; } .author-name { font-size: 30rpx; font-weight: bold; color: #333333; margin-bottom: 8rpx; } .post-time { font-size: 24rpx; color: #999999; opacity: 0.8; } .category-tag { padding: 10rpx 22rpx; background: linear-gradient(135deg, #E8F8F0 0%, #D5F2E3 100%); color: #50C878; border-radius: 24rpx; font-size: 22rpx; font-weight: 600; box-shadow: 0 2rpx 6rpx rgba(80, 200, 120, 0.2); } /* 帖子内容 */ .post-content { margin-bottom: 24rpx; } .post-title { font-size: 34rpx; font-weight: bold; color: #333333; margin-bottom: 18rpx; line-height: 1.6; position: relative; } .post-text { font-size: 28rpx; color: #666666; line-height: 1.8; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; } .post-images { display: flex; gap: 12rpx; margin-top: 18rpx; flex-wrap: wrap; } .post-image { width: 200rpx; height: 200rpx; border-radius: 12rpx; background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%); box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08); transition: all 0.3s ease; } .post-image:active { transform: scale(0.95); } /* 帖子底部 */ .post-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 24rpx; border-top: 2rpx solid rgba(0, 0, 0, 0.05); } .footer-left { display: flex; align-items: center; gap: 45rpx; flex: 1; } .stat-item { display: flex; align-items: center; gap: 10rpx; font-size: 24rpx; color: #999999; padding: 8rpx 16rpx; border-radius: 20rpx; transition: all 0.3s ease; } .stat-item:active { background-color: rgba(0, 0, 0, 0.03); transform: scale(1.1); } .stat-icon { font-size: 32rpx; transition: all 0.3s ease; } .like-item.liked .stat-text { color: #FF6B6B; font-weight: bold; } .like-item.liked .stat-icon { animation: pulse 0.6s ease; } /* 收藏按钮 */ .favorite-btn { display: flex; align-items: center; justify-content: center; width: 68rpx; height: 68rpx; border-radius: 50%; background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08); } .favorite-btn:active { transform: scale(0.9) rotate(72deg); box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.12); } .favorite-btn.favorited { background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%); box-shadow: 0 4rpx 12rpx rgba(255, 215, 0, 0.4); } .favorite-icon { font-size: 38rpx; transition: all 0.3s ease; color: #999999; } .favorite-btn.favorited .favorite-icon { color: #ffffff; animation: bounce 0.6s ease; } /* 收藏动画 */ @keyframes bounce { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.3); } 50% { transform: scale(0.9); } 75% { transform: scale(1.1); } } /* 空状态 */ .empty-state { display: flex; flex-direction: column; align-items: center; padding: 120rpx 60rpx; animation: fadeIn 0.8s ease-out; } .empty-icon { font-size: 120rpx; margin-bottom: 24rpx; opacity: 0.4; animation: pulse 2s ease-in-out infinite; } .empty-text { font-size: 28rpx; color: #999999; } /* 发布按钮 */ .fab { position: fixed; right: 30rpx; bottom: calc(env(safe-area-inset-bottom) + 120rpx); width: 110rpx; height: 110rpx; border-radius: 50%; background: linear-gradient(135deg, #50C878 0%, #3CB371 100%); box-shadow: 0 12rpx 32rpx rgba(80, 200, 120, 0.5); display: flex; align-items: center; justify-content: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); animation: scaleIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both; z-index: 999; } .fab:active { transform: scale(0.88) rotate(90deg); box-shadow: 0 6rpx 16rpx rgba(80, 200, 120, 0.5); } .fab-icon { font-size: 52rpx; color: #ffffff; transition: all 0.3s ease; } .fab:active .fab-icon { transform: rotate(-90deg); }