/**
 * 分类展示页面样式 - 现代设计版
 * 使用主题设计令牌系统
 * 
 * @package LightingTheme
 */

/* ========================================
   页面整体布局
   ======================================== */

.products-showcase-page,
.posts-showcase-page {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--theme-bg-secondary, #f8fafc) 0%, var(--theme-bg-tertiary, #e2e8f0) 100%);
    padding: 0;
}

.products-showcase-page .container,
.posts-showcase-page .container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* ========================================
   页面介绍区域
   ======================================== */

.page-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    border-radius: var(--theme-radius-xl, 24px);
    backdrop-filter: blur(10px);
    box-shadow: var(--theme-shadow-lg, 0 4px 24px rgba(0,0,0,0.06));
}

.page-intro h1 {
    font-size: var(--theme-font-size-4xl, 36px);
    font-weight: var(--theme-font-weight-bold, 700);
    background: var(--theme-gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--theme-spacing-md, 16px);
}

.page-intro p {
    font-size: var(--theme-font-size-md, 16px);
    color: var(--theme-text-secondary, #64748b);
    line-height: 1.8;
}

/* ========================================
   分类区块 - 流动渐变背景
   ======================================== */

.products-showcase-page .category-section,
.posts-showcase-page .category-section {
    margin-bottom: 48px;
    background: linear-gradient(
        -45deg,
        #fef9e7,  /* 淡金 */
        #e8f4fd,  /* 淡蓝 */
        #f4ecf7,  /* 淡紫 */
        #fef9e7,  /* 淡金 */
        #e8f4fd   /* 淡蓝 */
    );
    background-size: 400% 400%;
    animation: sectionGradientFlow 15s ease infinite;
    will-change: background-position;
    border-radius: 20px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

/* 尊重用户的减少动画偏好设置 */
@media (prefers-reduced-motion: reduce) {
    .products-showcase-page .category-section,
    .posts-showcase-page .category-section {
        animation: none;
        background-position: 0% 50%;
    }
}

@keyframes sectionGradientFlow {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 100%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   分类标题区域 - 动态渐变头部（使用设计令牌）
   ======================================== */

.products-showcase-page .category-header,
.posts-showcase-page .category-header {
    padding: 20px 32px;
    background: var(--theme-fluid-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%));
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    display: flex;
    align-items: center;
    min-height: 80px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.products-showcase-page .category-title-wrap,
.posts-showcase-page .category-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* 分类缩略图 */
.products-showcase-page .category-thumb,
.posts-showcase-page .category-thumb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 2px solid rgba(255,255,255,0.4);
}

.products-showcase-page .category-thumb-img,
.posts-showcase-page .category-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.products-showcase-page .category-thumb--placeholder,
.posts-showcase-page .category-thumb--placeholder {
    color: rgba(255,255,255,0.9);
}

.products-showcase-page .category-title,
.posts-showcase-page .category-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
    line-height: 1;
    display: flex;
    align-items: center;
}

.products-showcase-page .category-title::before,
.posts-showcase-page .category-title::before {
    display: none;
}

.products-showcase-page .category-count,
.posts-showcase-page .category-count {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.3);
    white-space: nowrap;
    line-height: 1;
}

.products-showcase-page .category-description,
.posts-showcase-page .category-description {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    margin: 12px 0 0;
    max-width: 600px;
}

/* ========================================
   产品网格 - 精致缩略图
   ======================================== */

.products-showcase-page .products-grid,
.posts-showcase-page .posts-grid {
    display: grid;
    padding: 24px 32px;
    grid-template-columns: repeat(8, 1fr);
    gap: 16px;
}

/* ========================================
   产品卡片 - 悬浮效果
   ======================================== */

.products-showcase-page .product-card,
.posts-showcase-page .post-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(0,0,0,0.06),
        0 1px 3px rgba(0,0,0,0.04);
}

.products-showcase-page .product-card::after,
.posts-showcase-page .post-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--theme-radius-lg, 16px);
    padding: 1px;
    background: linear-gradient(135deg, rgba(var(--theme-gradient-primary-rgb-start, 102, 126, 234), 0.2) 0%, rgba(var(--theme-gradient-primary-rgb-end, 118, 75, 162), 0.2) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.products-showcase-page .product-card:hover,
.posts-showcase-page .post-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(var(--theme-gradient-primary-rgb-start, 102, 126, 234), 0.15),
        0 8px 16px rgba(0, 0, 0, 0.08);
}

.products-showcase-page .product-card:hover::after,
.posts-showcase-page .post-card:hover::after {
    opacity: 1;
}

.products-showcase-page .product-link,
.posts-showcase-page .post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ========================================
   缩略图容器
   ======================================== */

.products-showcase-page .product-thumbnail,
.posts-showcase-page .post-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.products-showcase-page .product-thumbnail img,
.posts-showcase-page .post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.products-showcase-page .product-card:hover .product-thumbnail img,
.posts-showcase-page .post-card:hover .post-thumbnail img {
    transform: scale(1.1);
}

/* 图片加载占位 */
.post-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #94a3b8;
}

/* ========================================
   产品标题
   ======================================== */

.products-showcase-page .product-title,
.posts-showcase-page .post-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin: 0;
    padding: 12px 10px;
    text-align: center;
    line-height: 1.4;
    height: 52px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    transition: color 0.2s ease;
}

.products-showcase-page .product-card:hover .product-title,
.posts-showcase-page .post-card:hover .post-title {
    color: var(--theme-gradient-primary-start, #667eea);
}

/* ========================================
   查看更多按钮 - 使用设计令牌
   ======================================== */

.products-showcase-page .category-footer,
.posts-showcase-page .category-footer {
    text-align: center;
    padding: 0 32px 32px;
    margin-top: 8px;
}

.products-showcase-page .view-more-btn,
.posts-showcase-page .view-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--theme-gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: #fff;
    text-decoration: none;
    border-radius: var(--theme-radius-full, 50px);
    font-size: 15px;
    font-weight: var(--theme-font-weight-semibold, 600);
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 15px rgba(var(--theme-gradient-primary-rgb-start, 102, 126, 234), 0.35),
        inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.products-showcase-page .view-more-btn::before,
.posts-showcase-page .view-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.products-showcase-page .view-more-btn:hover,
.posts-showcase-page .view-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(var(--theme-gradient-primary-rgb-start, 102, 126, 234), 0.45),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.products-showcase-page .view-more-btn:hover::before,
.posts-showcase-page .view-more-btn:hover::before {
    left: 100%;
}

.products-showcase-page .view-more-btn svg,
.posts-showcase-page .view-more-btn svg {
    transition: transform 0.3s ease;
}

.products-showcase-page .view-more-btn:hover svg,
.posts-showcase-page .view-more-btn:hover svg {
    transform: translateX(4px);
}

/* ========================================
   空状态
   ======================================== */

.no-categories {
    text-align: center;
    padding: 80px 40px;
    background: rgba(255,255,255,0.8);
    border-radius: 24px;
    backdrop-filter: blur(10px);
}

.no-categories p {
    font-size: 18px;
    color: #64748b;
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 1599px) {
    .products-showcase-page .products-grid,
    .posts-showcase-page .posts-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 1199px) {
    .products-showcase-page .products-grid,
    .posts-showcase-page .posts-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 14px;
    }
    
    .products-showcase-page .container,
    .posts-showcase-page .container {
        padding: 40px 30px;
    }
}

@media (max-width: 1023px) {
    .products-showcase-page .products-grid,
    .posts-showcase-page .posts-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        padding: 20px 24px;
    }
    
    .products-showcase-page .category-section,
    .posts-showcase-page .category-section {
        border-radius: 16px;
    }
    
    .products-showcase-page .category-header,
    .posts-showcase-page .category-header {
        padding: 16px 24px;
        min-height: 64px;
    }
    
    .products-showcase-page .category-title,
    .posts-showcase-page .category-title {
        font-size: 20px;
    }
    
    .products-showcase-page .category-thumb,
    .posts-showcase-page .category-thumb {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .products-showcase-page .category-footer,
    .posts-showcase-page .category-footer {
        padding: 0 24px 24px;
    }
}

@media (max-width: 767px) {
    .products-showcase-page .container,
    .posts-showcase-page .container {
        padding: 24px 16px;
    }
    
    .products-showcase-page .category-section,
    .posts-showcase-page .category-section {
        margin-bottom: 24px;
        border-radius: 12px;
    }
    
    .products-showcase-page .category-header,
    .posts-showcase-page .category-header {
        padding: 14px 16px;
        min-height: 56px;
    }
    
    .products-showcase-page .category-title,
    .posts-showcase-page .category-title {
        font-size: 16px;
    }
    
    .products-showcase-page .category-thumb,
    .posts-showcase-page .category-thumb {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 8px;
    }
    
    .products-showcase-page .category-title-wrap,
    .posts-showcase-page .category-title-wrap {
        gap: 10px;
    }
    
    .products-showcase-page .category-count,
    .posts-showcase-page .category-count {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .products-showcase-page .products-grid,
    .posts-showcase-page .posts-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 16px;
    }
    
    .products-showcase-page .hide-on-mobile,
    .posts-showcase-page .hide-on-mobile {
        display: none !important;
    }
    
    .products-showcase-page .product-card,
    .posts-showcase-page .post-card {
        border-radius: 10px;
    }
    
    .products-showcase-page .product-title,
    .posts-showcase-page .post-title {
        font-size: 11px;
        padding: 8px 6px;
        height: 42px;
    }
    
    .products-showcase-page .category-footer,
    .posts-showcase-page .category-footer {
        padding: 0 16px 20px;
    }
    
    .products-showcase-page .view-more-btn,
    .posts-showcase-page .view-more-btn {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
    }
    
    .page-intro {
        padding: 24px;
        margin-bottom: 32px;
        border-radius: 16px;
    }
    
    .page-intro h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .products-showcase-page .products-grid,
    .posts-showcase-page .posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .products-showcase-page .product-title,
    .posts-showcase-page .post-title {
        font-size: 10px;
        padding: 6px 4px;
        height: 36px;
    }
    
    .products-showcase-page .product-card,
    .posts-showcase-page .post-card {
        border-radius: 8px;
    }
}
