/* pages/index/index.wxss */ page { padding: 0; margin: 0; } .container { min-height: 100vh; background: linear-gradient(180deg, #f8f9ff 0%, #f5f5f5 100%); padding-bottom: 20rpx; padding-top: 0; margin-top: 0; } /* 轮播图区域 */ .swiper-section { width: 100%; height: 400rpx; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); position: relative; overflow: hidden; padding-top: 0; transition: margin-top 0.3s ease; } .swiper { width: 100%; height: 100%; } .swiper-item { width: 100%; height: 100%; position: relative; overflow: hidden; } .swiper-image { width: 100%; height: 100%; opacity: 0.7; } .swiper-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 40rpx 30rpx 30rpx; background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%); color: #fff; } .swiper-title { font-size: 36rpx; font-weight: 600; margin-bottom: 12rpx; text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .swiper-author { font-size: 26rpx; opacity: 0.9; text-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .search-bar { background: #fff; padding: 20rpx 30rpx 20rpx; position: fixed; top: 0; left: 0; right: 0; z-index: 1000; box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08); padding-top: calc(20rpx + env(safe-area-inset-top)); } .search-box { display: flex; align-items: center; background: linear-gradient(135deg, #f5f5f5 0%, #f0f0f0 100%); border-radius: 50rpx; padding: 22rpx 32rpx; box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06); transition: all 0.3s ease; border: 2rpx solid transparent; } .search-box:active { transform: scale(0.98); box-shadow: 0 2rpx 12rpx rgba(102, 126, 234, 0.2); border-color: #667eea; } .search-placeholder { margin-left: 12rpx; font-size: 28rpx; color: #999; flex: 1; } .search-input-box { display: flex; align-items: center; background: rgba(255, 255, 255, 0.98); padding: 20rpx 30rpx; box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08); position: fixed; top: calc(100rpx + env(safe-area-inset-top)); left: 0; right: 0; z-index: 999; } .search-input { flex: 1; height: 64rpx; padding: 0 24rpx; background: #f5f5f5; border-radius: 32rpx; font-size: 28rpx; border: 2rpx solid transparent; transition: all 0.3s ease; } .search-input:focus { border-color: #667eea; background: #fff; } .search-cancel { margin-left: 20rpx; font-size: 28rpx; color: #667eea; font-weight: 500; padding: 8rpx 16rpx; } .type-tabs { display: flex; background: #fff; padding: 24rpx 30rpx; border-bottom: 1rpx solid rgba(0, 0, 0, 0.05); box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03); } .type-tab { margin-right: 48rpx; font-size: 30rpx; color: #666; padding: 12rpx 0; position: relative; font-weight: 500; transition: all 0.3s ease; } .type-tab.active { color: #667eea; font-weight: 600; } .type-tab.active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 6rpx; background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); border-radius: 3rpx; animation: slideIn 0.3s ease; } @keyframes slideIn { from { transform: scaleX(0); } to { transform: scaleX(1); } } .category-scroll { white-space: nowrap; background: #fff; padding: 24rpx 0; border-bottom: 1rpx solid rgba(0, 0, 0, 0.05); } .category-list { display: inline-flex; padding: 0 30rpx; gap: 20rpx; } .category-item { display: inline-block; padding: 12rpx 32rpx; font-size: 26rpx; color: #666; background: linear-gradient(135deg, #f5f5f5 0%, #f0f0f0 100%); border-radius: 32rpx; font-weight: 500; transition: all 0.3s ease; white-space: nowrap; border: 2rpx solid transparent; } .category-item.active { color: #fff; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); box-shadow: 0 4rpx 16rpx rgba(102, 126, 234, 0.3); transform: scale(1.05); border-color: rgba(255, 255, 255, 0.3); } /* 今日推荐区域 */ .recommended-section { background: #fff; margin: 24rpx 0; border-radius: 0; padding: 30rpx 20rpx; box-shadow: 0 4rpx 20rpx rgba(102, 126, 234, 0.08); width: 100%; box-sizing: border-box; } .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24rpx; } .section-title { font-size: 32rpx; font-weight: 600; color: #1a1a1a; } .section-more { font-size: 26rpx; color: #999; } .recommended-grid { display: flex; flex-wrap: wrap; gap: 20rpx; } .recommended-item { flex: 0 0 calc(50% - 10rpx); /* 每行2个,默认 */ display: flex; flex-direction: column; align-items: center; transition: transform 0.3s ease; } .recommended-item:active { transform: scale(0.95); } .recommended-cover-wrapper { width: 100%; aspect-ratio: 3/4; border-radius: 12rpx; overflow: hidden; box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.12); margin-bottom: 12rpx; background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%); } .recommended-cover { width: 100%; height: 100%; transition: transform 0.3s ease; } .recommended-item:active .recommended-cover { transform: scale(1.05); } .recommended-cover-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; padding: 12rpx; box-sizing: border-box; } .recommended-cover-text { color: #fff; font-size: 20rpx; font-weight: 500; text-align: center; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; } .recommended-title { font-size: 24rpx; color: #333; font-weight: 500; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; line-height: 1.4; } /* 每行3个的样式 */ .recommended-grid.columns-3 .recommended-item { flex: 0 0 calc(33.333% - 14rpx); } .content-list { padding: 30rpx 24rpx; } .content-item { display: flex; background: #fff; border-radius: 20rpx; padding: 32rpx; margin-bottom: 24rpx; box-shadow: 0 4rpx 20rpx rgba(102, 126, 234, 0.08); transition: all 0.3s ease; position: relative; overflow: hidden; } .content-item::before { content: ''; position: absolute; top: 0; left: 0; width: 6rpx; height: 100%; background: linear-gradient(180deg, #667eea 0%, #764ba2 100%); opacity: 0; transition: opacity 0.3s ease; } .content-item:active { transform: translateY(-4rpx); box-shadow: 0 8rpx 28rpx rgba(102, 126, 234, 0.15); } .content-item:active::before { opacity: 1; } .cover-wrapper { width: 180rpx; height: 240rpx; margin-right: 32rpx; flex-shrink: 0; border-radius: 12rpx; overflow: hidden; box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.12); } .cover { width: 100%; height: 100%; transition: transform 0.3s ease; } .content-item:active .cover { transform: scale(1.05); } .cover-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12rpx; display: flex; align-items: center; justify-content: center; padding: 12rpx; box-sizing: border-box; } .cover-text { color: #fff; font-size: 22rpx; font-weight: 500; text-align: center; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.4; } .content-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; } .title { font-size: 34rpx; font-weight: 600; color: #1a1a1a; margin-bottom: 12rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; } .author { font-size: 26rpx; color: #8a8a8a; margin-bottom: 14rpx; font-weight: 500; } .meta { display: flex; align-items: center; margin-bottom: 16rpx; flex-wrap: wrap; gap: 12rpx; } .meta text { font-size: 22rpx; color: #667eea; padding: 6rpx 14rpx; background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%); border-radius: 12rpx; font-weight: 500; } .description { font-size: 26rpx; color: #666; line-height: 1.8; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .loading { text-align: center; padding: 60rpx 40rpx; display: flex; flex-direction: column; align-items: center; } .loading text { font-size: 26rpx; color: #999; margin-top: 20rpx; } .loading::before { content: ''; width: 40rpx; height: 40rpx; border: 4rpx solid #f0f0f0; border-top-color: #667eea; border-radius: 50%; animation: spin 0.8s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .no-more { text-align: center; padding: 40rpx; font-size: 26rpx; color: #999; position: relative; } .no-more::before, .no-more::after { content: ''; position: absolute; top: 50%; width: 80rpx; height: 1rpx; background: #e0e0e0; } .no-more::before { left: 20%; } .no-more::after { right: 20%; } .empty { text-align: center; padding: 200rpx 40rpx; display: flex; flex-direction: column; align-items: center; } .empty::before { content: '📖'; font-size: 120rpx; margin-bottom: 30rpx; opacity: 0.3; } .empty text { font-size: 28rpx; color: #999; line-height: 1.6; }