/* 产品分类区域 */
.goods-class-section {
    padding: 80px 0;
    background: #F4F1EB;
}

.goods-class-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.goods-class-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    text-align: left;
    margin-bottom: 60px;
    position: relative;
}

/* .goods-class-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #E21111, #F19090);
    border-radius: 2px;
} */

/* 产品分类网格布局 */
.goods-class-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* 产品分类项 */
.goods-class-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
}

.goods-class-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.goods-class-image-wrapper {
    position: relative;
    width: 100%;
    height: 410px;
    border: 5px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: all 0.4s ease;
}

.goods-class-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.6s ease;
}

.goods-class-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 40px;
}

.placeholder-image {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    opacity: 0.7;
    transition: all 0.4s ease;
}

/* 蒙版效果 - 默认可见 */
.goods-class-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all 0.4s ease;
    padding: 20px;
}

.goods-class-name {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: all 0.4s ease;
    word-break: break-word;
    max-width: 100%;
}

/* 悬停效果 - 使用边框背景动画 */
.goods-class-item:hover {
    transform: translateY(-8px);
}

.goods-class-item:hover .goods-class-image-wrapper {
    border: 5px solid transparent;
    background: 
        linear-gradient(#fff, #fff) padding-box,
        conic-gradient(
            from 0deg at 50% 50%,
            #E21111 0%,
            #F19090 25%,
            #E21111 50%,
            #F19090 75%,
            #E21111 100%
        ) border-box;
    animation: rotateBorder 1.5s linear infinite;
}

.goods-class-item:hover .goods-class-image {
    transform: scale(1.1);
}

.goods-class-item:hover .placeholder-image {
    transform: scale(1.05);
    opacity: 0.9;
}

.goods-class-item:hover .goods-class-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
}

.goods-class-item:hover .goods-class-name {
    font-size: 1.5rem;
    transform: scale(1.05);
}

/* 360度旋转边框动画 */
@keyframes rotateBorder {
    0% {
        background: 
            linear-gradient(#fff, #fff) padding-box,
            conic-gradient(
                from 0deg at 50% 50%,
                #E21111 0%,
                #F19090 25%,
                #E21111 50%,
                #F19090 75%,
                #E21111 100%
            ) border-box;
    }
    100% {
        background: 
            linear-gradient(#fff, #fff) padding-box,
            conic-gradient(
                from 360deg at 50% 50%,
                #E21111 0%,
                #F19090 25%,
                #E21111 50%,
                #F19090 75%,
                #E21111 100%
            ) border-box;
    }
}

/* 占位项特殊样式 */
.goods-class-placeholder-item .goods-class-image-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
}

.goods-class-placeholder-item .goods-class-overlay {
    display: none;
}

.goods-class-placeholder-item:hover .goods-class-image-wrapper {
    background: 
        linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) padding-box,
        conic-gradient(
            from 0deg at 50% 50%,
            #6c757d 0%,
            #adb5bd 25%,
            #6c757d 50%,
            #adb5bd 75%,
            #6c757d 100%
        ) border-box;
    animation: rotateBorderGray 1.5s linear infinite;
}

.goods-class-placeholder-item:hover .placeholder-image {
    transform: scale(1.1);
    opacity: 0.9;
}

/* 占位项灰色边框动画 */
@keyframes rotateBorderGray {
    0% {
        background: 
            linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) padding-box,
            conic-gradient(
                from 0deg at 50% 50%,
                #6c757d 0%,
                #adb5bd 25%,
                #6c757d 50%,
                #adb5bd 75%,
                #6c757d 100%
            ) border-box;
    }
    100% {
        background: 
            linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) padding-box,
            conic-gradient(
                from 360deg at 50% 50%,
                #6c757d 0%,
                #adb5bd 25%,
                #6c757d 50%,
                #adb5bd 75%,
                #6c757d 100%
            ) border-box;
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .goods-class-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .goods-class-image-wrapper {
        height: 350px;
    }
    
    .goods-class-title {
        font-size: 2.2rem;
        margin-bottom: 50px;
    }
    
    .goods-class-name {
        font-size: 1.3rem;
    }
    
    .goods-class-item:hover .goods-class-name {
        font-size: 1.4rem;
    }
}

@media (max-width: 992px) {
    .goods-class-section {
        padding: 60px 0;
    }
    
    .goods-class-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .goods-class-image-wrapper {
        height: 300px;
    }
    
    .goods-class-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }
    
    .goods-class-name {
        font-size: 1.2rem;
    }
    
    .goods-class-item:hover .goods-class-name {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .goods-class-container {
        padding: 0 15px;
    }
    
    .goods-class-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .goods-class-image-wrapper {
        height: 250px;
        border-width: 3px;
    }
    
    .goods-class-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    .goods-class-name {
        font-size: 1.1rem;
    }
    
    .goods-class-item:hover .goods-class-name {
        font-size: 1.2rem;
    }
    
    /* 移动端简化动画 */
    .goods-class-item:hover .goods-class-image-wrapper {
        animation: none;
        background: 
            linear-gradient(#fff, #fff) padding-box,
            linear-gradient(135deg, #E21111, #F19090) border-box;
    }
    
    .goods-class-placeholder-item:hover .goods-class-image-wrapper {
        animation: none;
        background: 
            linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) padding-box,
            linear-gradient(135deg, #6c757d, #adb5bd) border-box;
    }
}

@media (max-width: 576px) {
    .goods-class-section {
        padding: 40px 0;
    }
    
    .goods-class-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .goods-class-image-wrapper {
        height: 280px;
    }
    
    .goods-class-title {
        font-size: 1.6rem;
        margin-bottom: 25px;
    }
    
    .goods-class-name {
        font-size: 1rem;
    }
    
    .goods-class-item:hover .goods-class-name {
        font-size: 1.1rem;
    }
}

/* 大屏幕适配 */
@media (min-width: 1440px) {
    .goods-class-container {
        padding: 0 40px;
    }
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.goods-class-item {
    animation: fadeInUp 0.6s ease;
}

.goods-class-item:nth-child(1) { animation-delay: 0.1s; }
.goods-class-item:nth-child(2) { animation-delay: 0.2s; }
.goods-class-item:nth-child(3) { animation-delay: 0.3s; }
.goods-class-item:nth-child(4) { animation-delay: 0.4s; }
.goods-class-item:nth-child(5) { animation-delay: 0.5s; }
.goods-class-item:nth-child(6) { animation-delay: 0.6s; }
.goods-class-item:nth-child(7) { animation-delay: 0.7s; }
.goods-class-item:nth-child(8) { animation-delay: 0.8s; }

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .goods-class-section {
        background: #2c3e50;
    }
    
    .goods-class-title {
        color: #ecf0f1;
    }
    
    .goods-class-placeholder {
        background: #34495e;
    }
    
    .goods-class-placeholder-item .goods-class-image-wrapper {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
        border-color: #4a6572;
    }
    
    .goods-class-placeholder-item:hover .goods-class-image-wrapper {
        background: 
            linear-gradient(135deg, #34495e 0%, #2c3e50 100%) padding-box,
            conic-gradient(
                from 0deg at 50% 50%,
                #4a6572 0%,
                #5a7685 25%,
                #4a6572 50%,
                #5a7685 75%,
                #4a6572 100%
            ) border-box;
    }
}

/* 无障碍支持 */
.goods-class-link:focus {
    outline: 3px solid #E21111;
    outline-offset: 2px;
    border-radius: 12px;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .goods-class-overlay {
        opacity: 1;
    }
    
    .goods-class-name {
        transform: translateY(0);
    }
    
    .goods-class-item:active {
        transform: scale(0.98);
    }
    
    .goods-class-item:active .goods-class-image {
        transform: scale(1.05);
    }
    
    .goods-class-item:active .goods-class-name {
        transform: scale(1.02);
    }
    
    /* 触摸设备简化边框效果 */
    .goods-class-item:active .goods-class-image-wrapper {
        border: 3px solid #E21111;
        animation: none;
        background: #fff;
    }
    
    .goods-class-placeholder-item:active .goods-class-image-wrapper {
        border: 3px solid #6c757d;
        animation: none;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    }
}