/* 分类页面专用样式 */

/* 分类页面头部 */
.category-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 60px;
    margin-top: 70px;
}

.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
    opacity: 0.7;
}

.separator {
    margin: 0 0.5rem;
}

.category-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.category-description {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    max-width: 600px;
}

.category-stats {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.8;
}

/* 筛选和排序区域 */
.filters-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e0e6ed;
    position: sticky;
    top: 70px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #2c3e50;
}

.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    background: white;
    color: #2c3e50;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #e74c3c;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    border: 2px solid #e0e6ed;
    background: white;
    color: #7f8c8d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.view-btn:hover,
.view-btn.active {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fff5f5;
}

/* 内容区域 */
.category-content {
    padding: 3rem 0;
    background: #f8f9fa;
    min-height: 60vh;
}

.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 网格视图 */
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.items-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* 项目卡片样式 */
.item-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.item-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.item-image {
    width: 100%;
    height: 0;
    padding-bottom: 177.78%; /* 9:16 比例 (16/9 = 1.7778) */
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.item-image img,
.item-image video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.item-card:hover .item-image img,
.item-card:hover .item-image video {
    transform: scale(1.05);
}

/* 视频预览样式 */
.item-card.video .item-image {
    background: #000;
}

.video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 0;
    height: 0;
    border-left: 12px solid rgba(255, 255, 255, 0.8);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.item-card.video:hover .video-overlay {
    opacity: 1;
    border-left-color: rgba(255, 255, 255, 1);
}

.item-content {
    padding: 1.2rem;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.item-description {
    color: #7f8c8d;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    font-size: 0.9rem;
}

.item-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e74c3c;
}

/* 列表视图样式 */
.items-grid.list-view .item-card,
.item-card.list-view {
    display: flex !important;
    align-items: flex-start !important;
    padding: 1rem !important;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    min-height: 150px !important;
}

.item-card.list-view:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.items-grid.list-view .item-card .item-image,
.item-card.list-view .item-image {
    width: 80px !important;
    height: 142px !important; /* 9:16 比例 (80 * 16/9 = 142.22) */
    margin-right: 1rem !important;
    flex-shrink: 0;
    background: #f0f0f0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    padding-bottom: 0 !important; /* 覆盖首页的padding-bottom */
}

.item-card.list-view.video .item-image {
    background: #000;
}

.item-card.list-view .item-image img,
.item-card.list-view .item-image video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-card.list-view .item-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-card.list-view .item-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
}

.item-card.list-view .item-description {
    -webkit-line-clamp: 2;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #7f8c8d;
    line-height: 1.4;
}

.item-card.list-view .item-price {
    font-size: 1rem;
    font-weight: 600;
    color: #e74c3c;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #7f8c8d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.back-home-btn {
    display: inline-block;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}



/* 中等屏幕响应式设计 */
@media (max-width: 1200px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.2rem;
    }
}

@media (max-width: 992px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-hero {
        padding: 100px 0 40px;
    }

    .category-title {
        font-size: 2.2rem;
    }

    .category-description {
        font-size: 1rem;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        justify-content: center;
    }

    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    .items-grid.list-view {
        gap: 0.6rem;
    }
    
    .items-grid.list-view .item-card,
    .item-card.list-view {
        flex-direction: row !important;
        align-items: flex-start !important;
        padding: 0.8rem !important;
        min-height: 130px !important;
    }

    .items-grid.list-view .item-card .item-image,
    .item-card.list-view .item-image {
        width: 70px !important;
        height: 124px !important; /* 9:16 比例 (70 * 16/9 = 124.44) */
        margin-right: 0.8rem !important;
        background: #f0f0f0;
        position: relative;
        border-radius: 6px;
        overflow: hidden;
        flex-shrink: 0;
        padding-bottom: 0 !important;
    }

    .item-card.list-view.video .item-image {
        background: #000;
    }

    .item-card.list-view .item-image img,
    .item-card.list-view .item-image video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .item-content {
        padding: 0.8rem;
    }

    .item-title {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
        -webkit-line-clamp: 1;
    }

    .item-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
        margin-bottom: 0.5rem;
    }

    .item-price {
        font-size: 0.95rem;
    }

    /* 手机端列表视图特殊样式 */
    .item-card.list-view .item-content {
        padding: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .item-card.list-view .item-title {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
        font-weight: 600;
        line-height: 1.2;
        -webkit-line-clamp: 2;
    }

    .item-card.list-view .item-description {
        font-size: 0.75rem;
        color: #999;
        margin-bottom: 0.3rem;
        -webkit-line-clamp: 1;
        line-height: 1.3;
    }

    .item-card.list-view .item-price {
        font-size: 0.85rem;
        font-weight: 600;
        color: #e74c3c;
    }
}
