/* ========================================
   本周热推页面样式
   特点：高性能、高视觉体验、黄色主题
   ======================================== */

/* 性能优化：启用GPU加速 */
.weekly-main * {
    will-change: auto;
    contain: layout style paint;
}

/* 主容器 */
.weekly-main {
    min-height: 100vh;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFFDE7 50%, #ffffff 100%);
}

/* ========================================
   Hero Section
   ======================================== */
.weekly-hero {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #F57F17 0%, #FBC02D 50%, #FDD835 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.15)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    animation: dotsMove 30s linear infinite;
}

@keyframes dotsMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    transform: translateZ(0);
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.hero-title i {
    font-size: 2.5rem;
    margin-right: 15px;
    animation: fireAnimation 2s ease-in-out infinite;
}

@keyframes fireAnimation {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.1); }
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Books Section
   ======================================== */
.books-section {
    padding: 25px 30px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.6s ease-out;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    flex: 1;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #F57F17;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-title i {
    font-size: 2.2rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
}

.refresh-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #F57F17, #FBC02D);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 127, 23, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 127, 23, 0.4);
}

.refresh-btn i {
    transition: transform 0.3s ease;
}

.refresh-btn:hover i {
    transform: rotate(180deg);
}

/* Loading状态 */
.loading-container {
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-spinner {
    font-size: 3rem;
    color: #F57F17;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.2rem;
    color: #666;
}

/* 错误状态 */
.error-container {
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.3s ease-out;
}

.error-icon {
    font-size: 3rem;
    color: #ff5252;
    margin-bottom: 20px;
}

.error-text {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 25px;
}

.retry-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #F57F17, #FBC02D);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 127, 23, 0.3);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 127, 23, 0.4);
}

/* 空状态 */
.empty-container {
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.3s ease-out;
}

.empty-icon {
    font-size: 3rem;
    color: #999;
    margin-bottom: 20px;
}

.empty-text {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 25px;
}

.browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #F57F17, #FBC02D);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 127, 23, 0.3);
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 127, 23, 0.4);
}

/* 书籍网格 */
.books-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 0;
}

/* 书籍卡片 */
.book-card {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(245, 127, 23, 0.1);
    transition: all 0.3s ease;
    transform: translateZ(0);
    animation: fadeInScale 0.6s ease-out backwards;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.book-card:nth-child(1) { animation-delay: 0.05s; }
.book-card:nth-child(2) { animation-delay: 0.1s; }
.book-card:nth-child(3) { animation-delay: 0.15s; }
.book-card:nth-child(4) { animation-delay: 0.2s; }
.book-card:nth-child(5) { animation-delay: 0.25s; }
.book-card:nth-child(6) { animation-delay: 0.3s; }
.book-card:nth-child(7) { animation-delay: 0.35s; }
.book-card:nth-child(8) { animation-delay: 0.4s; }
.book-card:nth-child(9) { animation-delay: 0.45s; }
.book-card:nth-child(10) { animation-delay: 0.5s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.book-card:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 12px 40px rgba(245, 127, 23, 0.2);
}

/* 热推标识 */
.hot-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hot-badge i {
    font-size: 0.9rem;
}

/* 书籍封面 */
.book-card .book-cover {
    position: relative;
    width: 100% !important;
    height: auto !important;
    padding-top: 100%; /* 1:1 正方形比例 */
    overflow: hidden;
    background: linear-gradient(135deg, #FFF8E1, #FFE082);
    flex-shrink: 0; /* 防止被挤压 */
    margin-right: 0 !important;
    border-radius: 16px 16px 0 0;
}

.book-card .book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-card .book-cover-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFF8E1, #FFE082);
    color: #F57F17;
    font-size: 3rem;
}

/* 书籍信息 */
.book-info {
    padding: 15px;
    flex: 1; /* 填充剩余空间 */
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-author {
    font-size: 0.9rem;
    color: #F57F17;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.book-desc {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #999;
}

.meta-item i {
    color: #F57F17;
}

.book-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.book-tag {
    padding: 4px 12px;
    background: rgba(245, 127, 23, 0.1);
    color: #F57F17;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ========================================
   推荐理由Section
   ======================================== */
.recommendations-section {
    padding: 80px 30px;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 248, 225, 0.5);
}

.recommendations-section .section-header {
    text-align: center;
    margin-bottom: 60px;
}

.recommendations-section .section-title {
    justify-content: center;
}

.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.reason-card {
    background: white;
    padding: 35px 25px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(245, 127, 23, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    transform: translateZ(0);
    animation: fadeInUp 0.6s ease-out backwards;
}

.reason-card:nth-child(1) { animation-delay: 0.1s; }
.reason-card:nth-child(2) { animation-delay: 0.15s; }
.reason-card:nth-child(3) { animation-delay: 0.2s; }
.reason-card:nth-child(4) { animation-delay: 0.25s; }

.reason-card:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 12px 40px rgba(245, 127, 23, 0.15);
}

.reason-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #F57F17, #FDD835);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.reason-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.reason-desc {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
    background: linear-gradient(135deg, #F57F17 0%, #E65100 100%);
    padding: 80px 30px;
    text-align: center;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
    animation: fadeInUp 0.6s ease-out;
}

.cta-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    transform: translateZ(0);
}

.cta-btn.primary {
    background: white;
    color: #F57F17;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.cta-btn.primary:hover {
    transform: translateY(-3px) translateZ(0);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.cta-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    backdrop-filter: blur(10px);
}

.cta-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) translateZ(0);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .books-section,
    .recommendations-section {
        padding: 30px 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .refresh-btn {
        width: 100%;
        justify-content: center;
    }
    
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .reasons-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-subtitle {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cta-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 性能优化：减少重绘 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

