/* 最终版合集详情页面样式 - 统一菜单容器设计规格 */

:root {
    --primary-gradient: linear-gradient(45deg, #6a11cb, #2575fc);
    --primary-color: #2575fc;
    --secondary-color: #6a11cb;
    --dark-gradient: linear-gradient(45deg, #5910b0, #1e65da);
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --card-height: 380px;
    --text-shadow: 0 3px 12px rgba(0, 0, 0, 0.95), 0 6px 24px rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ==========================================================================
   合集头部区域
   ========================================================================== */
.collection-hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    align-items: center;
    margin-top: 0px;
    margin-bottom: 60px;
}

.collection-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 25%, 
        #f093fb 50%, 
        #f5576c 75%, 
        #4facfe 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(106, 17, 203, 0.2) 0%, 
        rgba(37, 117, 252, 0.2) 50%, 
        rgba(0, 0, 0, 0.1) 100%);
    z-index: 2;
}

.collection-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collection-info {
    flex: 1;
    max-width: 800px;
    color: white;
    text-align: center;
}

.collection-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.collection-subtitle {
    font-size: 1.5rem;
    margin-bottom: 20px;
    opacity: 0.9;
    text-shadow: var(--text-shadow);
}

/* ==========================================================================
   合集描述区域
   ========================================================================== */
.collection-description {
    padding: 40px 0;
    background: white;
}

.collection-description p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #666;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

/* ==========================================================================
   设定集展示区域
   ========================================================================== */
.collection-items {
    padding: 60px 0;
    background: #f9f9f9;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==========================================================================
   设定集网格布局 - 统一菜单容器规格
   ========================================================================== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 25px; 
    padding: 15px 30px;
    max-width: 1400px;
    margin: -10px auto 0;
    position: relative;
}

/* 网格加载状态 */
.items-grid.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

/* ==========================================================================
   设定集卡片样式 - 完全统一菜单容器设计
   ========================================================================== */

/* 卡片进入动画 */
@keyframes slide-fade-in {
    from {
        opacity: 0;
        box-shadow: none;
        transform: scale(.8) translateY(5vh);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        box-shadow: var(--box-shadow);
    }
}

/* 基础卡片样式 - 统一菜单容器规格 */
.book-item {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    height: var(--card-height);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    
    /* 视图触发动画效果 */
    animation: slide-fade-in both;
    animation-timeline: view();
    animation-range: entry 0% entry 50%;
}

/* 统一菜单容器悬停效果 */
.book-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--hover-shadow);
    z-index: 2;
}

/* 图片样式 - 支持真实图片和占位符 */
.book-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.book-item:hover img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

/* 占位符图片样式 */
.placeholder-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #f0f2f5, #e1e6ea);
    font-size: 3rem;
    color: #666;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.book-item:hover .placeholder-image {
    transform: scale(1.08);
    background: linear-gradient(45deg, #6a11cb, #2575fc);
    color: white;
    filter: brightness(1.05);
}

/* 卡片标题 - 统一菜单容器规格 */
.book-item h2 {
    margin: 15px 15px 10px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 卡片描述 - 统一菜单容器规格 */
.book-item p {
    margin: 0 15px 15px;
    color: #666;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.8em;
    line-height: 1.4;
}

/* 卡片链接按钮 - 统一菜单容器规格 */
.book-item a {
    display: block;
    background: var(--primary-gradient);
    color: white;
    text-align: center;
    padding: 12px 15px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: auto;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

.book-item a:hover {
    background: var(--dark-gradient);
    letter-spacing: 1.5px;
}

/* ==========================================================================
   加载状态和空状态
   ========================================================================== */
.loading-state {
    text-align: center;
    color: #666;
    padding: 60px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

.no-results h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.no-results p {
    margin: 0 0 20px 0;
    font-size: 16px;
}

.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    border: 2px solid #f5c6cb;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.test-footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
}

.test-footer p {
    margin: 0;
    opacity: 0.8;
}

/* ==========================================================================
   响应式设计 - 统一菜单容器网格布局适配
   ========================================================================== */

/* 大屏幕适配 (1100px - 1400px) */
@media (max-width: 1400px) {
    .items-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 中等屏幕适配 (768px - 1100px) */
@media (max-width: 1100px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 桌面设备特定样式 */
@media (min-width: 769px) {
    .items-grid {
        margin-top: -20px;
    }
}

/* 平板设备 (480px - 768px) */
@media (max-width: 768px) {
    /* 标题适配 */
    .collection-title {
        font-size: 2.5rem;
    }
    
    .collection-subtitle {
        font-size: 1.2rem;
    }
    
    .container {
        padding: 0 20px;
    }
    
    .collection-hero {
        height: 60vh;
        min-height: 400px;
    }
    
    .collection-description {
        padding: 30px 0;
    }
    
    .collection-description p {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    .section-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    /* 网格布局 - 2列 */
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 10px 20px;
        margin-top: -15px;
    }
    
    /* 🔥 卡片高度降低保持比例 */
    .book-item {
        height: 340px;  /* 从380px降低到340px */
    }
    
    .book-item img,
    .placeholder-image {
        height: 180px;  /* 图片从200px降低到180px */
    }
}

/* 🔥 移动设备 (<480px) - 改为2列布局 */
@media (max-width: 480px) {
    /* 标题适配 */
    .collection-title {
        font-size: 2rem;
    }
    
    .collection-subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .collection-description p {
        font-size: 0.9rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    /* 🔥 关键修改：改为2列布局 */
    .items-grid {
        grid-template-columns: repeat(2, 1fr);  /* 从1fr改为2列 */
        gap: 12px;  /* 间距缩小 */
        margin-top: -10px;
        padding: 5px 12px;
    }
    
    /* 🔥 卡片高度大幅降低保持比例 */
    .book-item {
        height: 280px;  /* 从350px降低到280px */
    }
    
    .book-item img,
    .placeholder-image {
        height: 140px;  /* 图片从200px降低到140px */
    }
    
    /* 卡片内容适配 */
    .book-item h2 {
        font-size: 14px;  /* 标题缩小 */
        margin: 10px 10px 8px;
    }
    
    .book-item p {
        font-size: 12px;  /* 描述文字缩小 */
        margin: 0 10px 10px;
        line-height: 1.3;
        -webkit-line-clamp: 2;  /* 限制2行 */
        line-clamp: 2;  
    }
    
    .book-item a {
        padding: 10px 10px;  /* 按钮padding缩小 */
        font-size: 11px;
    }
}