/* 分类区域样式 */
.category-section {
    margin-top: 0; /* 移除上边距，搜索容器已有下边距 */
    padding: 0 2%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    width: 100%;
    justify-content: center;
    max-width: 100%;
}

.category-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 3/4; /* 竖向长方形，类似封面 */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 分类卡片遮罩层 */
.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(128, 128, 128, 0.3);
    z-index: 1;
}

.category-name {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 2;
    height: 100%;
}

/* 有背景图片时的文字样式 */
.category-card[style*="background-image"] .category-name {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 700;
}

/* 分类卡片统一样式 */

/* 大屏幕优化 */
@media (min-width: 1200px) {
    .category-section {
        padding: 0 3rem;
        margin-top: 0; /* 保持统一，由搜索容器控制间距 */
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, 180px);
        gap: 2rem;
    }
    
    .category-name {
        font-size: 1.4rem;
        letter-spacing: 0.15em;
    }
}

/* 中等屏幕 */
@media (max-width: 768px) {
    .category-section {
        padding: 0 3%;
        margin-top: 0; /* 保持统一，由搜索容器控制间距 */
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 1.2rem;
    }
    
    .category-name {
        font-size: 1.1rem;
        letter-spacing: 0.12em;
    }
}

/* 小屏幕手机 */
@media (max-width: 480px) {
    .category-section {
        padding: 0 4%;
        margin-top: 0; /* 保持统一，由搜索容器控制间距 */
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-width: 100%;
    }
    
    .category-card {
        width: 100%;
        min-width: 0;
    }
    
    .category-name {
        font-size: 1rem;
        letter-spacing: 0.1em;
    }
}
