| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546 |
- /* 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;
- }
|