/* 基础设置 */
.custom-featured-categories {
    display: grid;
    gap: 20px;
    padding: 20px;
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
}

/* 链接样式 - 移除下划线 */
.custom-featured-categories a.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

.custom-featured-categories a.category-link:hover {
    text-decoration: none;
}

/* ========== Grid 布局 - 图片整张展示 ========== */
.custom-featured-categories-grid {
    grid-template-columns: repeat(3, 1fr);
}

.custom-featured-categories-grid .category-module {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-featured-categories-grid .category-module:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.custom-featured-categories-grid .category-banner {
    height: 220px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.custom-featured-categories-grid .category-banner img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain; /* 改为contain，显示整张图片 */
    transition: transform 0.5s ease;
}

.custom-featured-categories-grid .category-module:hover .category-banner img {
    transform: scale(1.05);
}

.custom-featured-categories-grid .category-title {
    padding: 15px;
    margin: 0;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
    color: #333;
}

/* ========== Card 布局 - 图片整张展示 ========== */
.custom-featured-categories-card {
    grid-template-columns: repeat(3, 1fr);
}

.custom-featured-categories-card .category-module {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #eaeaea;
}

.custom-featured-categories-card .category-module:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: #007cba;
}

.custom-featured-categories-card .category-banner {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.custom-featured-categories-card .category-banner img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain; /* 改为contain，显示整张图片 */
    transition: transform 0.5s ease;
}

.custom-featured-categories-card .category-module:hover .category-banner img {
    transform: scale(1.1);
}

.custom-featured-categories-card .category-content {
    padding: 20px;
    text-align: center;
}

.custom-featured-categories-card .category-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* ========== Large Image 布局 - 图片整张展示 ========== */
.custom-featured-categories-large_image {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.custom-featured-categories-large_image .large-main-section {
    flex: 1;
    max-width: 400px;
}

.custom-featured-categories-large_image .large-main-item {
    height: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.custom-featured-categories-large_image .large-main-item .category-banner {
    height: 450px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.custom-featured-categories-large_image .large-main-item .category-banner img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain; /* 改为contain，显示整张图片 */
    transition: transform 0.6s ease;
}

.custom-featured-categories-large_image .large-main-item:hover .category-banner img {
    transform: scale(1.08);
}

.custom-featured-categories-large_image .large-main-item .category-title {
    padding: 20px;
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: #333;
}

.custom-featured-categories-large_image .large-side-section {
    flex: 1;
    max-width: 600px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    align-items: start;
}

.custom-featured-categories-large_image .category-module-small {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.custom-featured-categories-large_image .category-module-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.custom-featured-categories-large_image .category-module-small .category-banner {
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.custom-featured-categories-large_image .category-module-small .category-banner img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain; /* 改为contain，显示整张图片 */
    transition: transform 0.5s ease;
}

.custom-featured-categories-large_image .category-module-small:hover .category-banner img {
    transform: scale(1.1);
}

.custom-featured-categories-large_image .category-module-small .category-title {
    padding: 15px 10px;
    margin: 0;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
    color: #333;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Dynamic 布局 - 图片整张展示 ========== */
.custom-featured-categories-dynamic {
    grid-template-columns: repeat(2, 1fr);
}

.custom-featured-categories-dynamic .category-module {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.custom-featured-categories-dynamic .category-module:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.custom-featured-categories-dynamic .category-banner {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.custom-featured-categories-dynamic .category-banner img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain; /* 改为contain，显示整张图片 */
    transition: transform 0.5s ease;
}

.custom-featured-categories-dynamic .category-module:hover .category-banner img {
    transform: scale(1.05);
}

.custom-featured-categories-dynamic .category-content {
    padding: 15px;
}

.custom-featured-categories-dynamic .category-title {
    margin: 0;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
    color: #333;
}

/* ========== Circle Box 布局 ========== */
.custom-featured-categories-circle_box {
    display: grid;
    gap: 30px;
    justify-items: center;
    grid-template-columns: repeat(3, 1fr); /* 6个分类时显示3列 */
}

.custom-featured-categories-circle_box .category-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 220px;
}

.custom-featured-categories-circle_box .circle-image-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 10px;
}

.custom-featured-categories-circle_box .circle-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.custom-featured-categories-circle_box .circle-image.no-image {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-featured-categories-circle_box .circle-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.custom-featured-categories-circle_box .circle-text-overlay .category-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-align: center;
    line-height: 1.3;
    padding: 10px;
}

.custom-featured-categories-circle_box .circle-image-wrapper:hover .circle-text-overlay {
    opacity: 1;
}

.custom-featured-categories-circle_box .circle-image-wrapper:hover .circle-image {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 手机端显示的文字 */
.custom-featured-categories-circle_box .mobile-circle-text {
    display: none;
    margin-top: 10px;
}

.custom-featured-categories-circle_box .mobile-circle-text .category-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.3;
}

/* ========== Circle Below 布局 ========== */
.custom-featured-categories-circle_below {
    display: grid;
    gap: 30px;
    justify-items: center;
    grid-template-columns: repeat(3, 1fr); /* 6个分类时显示3列 */
}

.custom-featured-categories-circle_below .category-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 200px;
}

.custom-featured-categories-circle_below .circle-image-wrapper {
    width: 160px;
    height: 160px;
    margin-bottom: 15px;
}

.custom-featured-categories-circle_below .circle-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-featured-categories-circle_below .circle-image.no-image {
    background: #f0f0f0;
}

.custom-featured-categories-circle_below .category-module:hover .circle-image {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.custom-featured-categories-circle_below .category-title {
    margin: 15px 0 0 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding: 0 10px;
    max-width: 180px;
    text-align: center;
}

/* ========== 响应式设计 ========== */

/* 平板端 (768px-1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Large布局保持左右结构 */
    .custom-featured-categories-large_image {
        flex-direction: row;
    }
    
    .custom-featured-categories-large_image .large-main-item .category-banner {
        height: 350px;
    }
    
    /* Grid和Card布局：2列 */
    .custom-featured-categories-grid,
    .custom-featured-categories-card {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 圆形布局：3列（6个分类时） */
    .custom-featured-categories-circle_box,
    .custom-featured-categories-circle_below {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .custom-featured-categories-circle_box .category-module,
    .custom-featured-categories-circle_below .category-module {
        justify-self: center;
    }
}

/* 手机横屏 (576px-767px) */
@media (min-width: 576px) and (max-width: 767px) {
    /* Large布局保持左右结构 */
    .custom-featured-categories-large_image {
        flex-direction: row;
    }
    
    .custom-featured-categories-large_image .large-main-item .category-banner {
        height: 250px;
    }
    
    /* Grid、Card、Dynamic布局：2列 */
    .custom-featured-categories-grid,
    .custom-featured-categories-card,
    .custom-featured-categories-dynamic {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
    
    /* 圆形布局：3列（6个分类时） */
    .custom-featured-categories-circle_box,
    .custom-featured-categories-circle_below {
        grid-template-columns: repeat(3, 1fr);
        justify-content: center;
        max-width: 100%;
    }
    
    .custom-featured-categories-circle_box .category-module,
    .custom-featured-categories-circle_below .category-module {
        max-width: 160px;
    }
    
    .custom-featured-categories-circle_box .circle-image-wrapper {
        width: 150px;
        height: 150px;
    }
    
    .custom-featured-categories-circle_below .circle-image-wrapper {
        width: 140px;
        height: 140px;
    }
}

/* 手机竖屏 (小于576px) */
@media (max-width: 575px) {
    /* 所有布局容器 */
    .custom-featured-categories {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 15px;
    }
    
    /* Large布局改为上下结构 */
    .custom-featured-categories-large_image {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 400px;
    }
    
    .custom-featured-categories-large_image .large-main-item .category-banner {
        height: 200px;
    }
    
    .custom-featured-categories-large_image .large-side-section {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .custom-featured-categories-large_image .large-main-item .category-title {
        font-size: 18px;
        padding: 15px;
    }
    
    .custom-featured-categories-large_image .category-module-small .category-banner {
        height: 150px;
    }
    
    .custom-featured-categories-large_image .category-module-small .category-title {
        font-size: 14px;
        padding: 10px 5px;
    }
    
    /* Grid、Card、Dynamic布局：1列 */
    .custom-featured-categories-grid,
    .custom-featured-categories-card,
    .custom-featured-categories-dynamic {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 400px;
    }
    
    /* 圆形布局：2列 */
    .custom-featured-categories-circle_box,
    .custom-featured-categories-circle_below {
        grid-template-columns: repeat(2, 1fr);
        justify-content: center;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
        gap: 15px;
    }
    
    .custom-featured-categories-circle_box .category-module,
    .custom-featured-categories-circle_below .category-module {
        max-width: 140px;
        margin: 0;
    }
    
    .custom-featured-categories-circle_box .circle-image-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .custom-featured-categories-circle_below .circle-image-wrapper {
        width: 110px;
        height: 110px;
    }
    
    /* Circle Box布局：手机端显示下方文字 */
    .custom-featured-categories-circle_box .circle-text-overlay {
        display: none;
    }
    
    .custom-featured-categories-circle_box .mobile-circle-text {
        display: block;
    }
    
    .custom-featured-categories-circle_below .category-title {
        font-size: 14px;
        max-width: 120px;
    }
}

/* 超小手机端 (小于400px) */
@media (max-width: 400px) {
    /* 圆形布局保持2列但缩小尺寸 */
    .custom-featured-categories-circle_box,
    .custom-featured-categories-circle_below {
        grid-template-columns: repeat(2, 1fr);
        max-width: 350px;
        gap: 10px;
    }
    
    .custom-featured-categories-circle_box .category-module,
    .custom-featured-categories-circle_below .category-module {
        max-width: 120px;
    }
    
    .custom-featured-categories-circle_box .circle-image-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .custom-featured-categories-circle_below .circle-image-wrapper {
        width: 90px;
        height: 90px;
    }
    
    .custom-featured-categories-circle_box .mobile-circle-text .category-title,
    .custom-featured-categories-circle_below .category-title {
        font-size: 12px;
        max-width: 100px;
    }
    
    .custom-featured-categories-large_image .large-side-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* 通用样式 */
.custom-featured-categories .category-banner img {
    display: block;
}

/* 加载动画 */
.custom-featured-categories .category-module {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

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

/* 延迟动画 */
.custom-featured-categories .category-module:nth-child(1) { animation-delay: 0.1s; }
.custom-featured-categories .category-module:nth-child(2) { animation-delay: 0.2s; }
.custom-featured-categories .category-module:nth-child(3) { animation-delay: 0.3s; }
.custom-featured-categories .category-module:nth-child(4) { animation-delay: 0.4s; }
.custom-featured-categories .category-module:nth-child(5) { animation-delay: 0.5s; }
.custom-featured-categories .category-module:nth-child(6) { animation-delay: 0.6s; }