/* 动态图片布局样式 - 兼容1到4个图片显示 */

/* 基础容器样式重置 */
.index3_13 .index3_14 .index3_15 .index3_17 {
    width: 499px;
    position: relative;
    height: auto;
    padding: 0px;
    margin-top: 0px;
    float: left;
    text-align: left;
    
    /* 使用 CSS Grid 来处理动态布局 */
    display: grid;
    gap: 15px;
    align-content: center;
    justify-content: center;
}

/* 1个图片：居中单个大图 */
.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(1):last-child) {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
}

.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(1):last-child) .index3_25 {
    width: 100%;
    max-width: 400px;
    height: 300px;
    justify-self: center;
}

/* 2个图片：上下排列或左右排列 */
.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(2):last-child) {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
}

.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(2):last-child) .index3_25 {
    width: 100%;
    height: 250px;
}

/* 3个图片：第一个占一行，下面两个并排 */
.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
}

.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(1) {
    grid-column: 1 / -1; /* 跨越所有列 */
    width: 100%;
    height: 200px;
}

.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(2),
.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(3) {
    width: 100%;
    height: 180px;
}

/* 4个图片：2x2网格布局 */
.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(4):last-child) {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
}

.index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(4):last-child) .index3_25 {
    width: 100%;
    height: 200px;
}

/* 超过4个图片：隐藏第5个及以后的图片 */
.index3_13 .index3_14 .index3_15 .index3_17 .index3_25:nth-child(n+5) {
    display: none;
}

/* 兼容性方案：当浏览器不支持:has()时的fallback */
@supports not (selector(:has(*))) {
    /* 默认2x2布局 */
    .index3_13 .index3_14 .index3_15 .index3_17 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17 .index3_25 {
        width: 100%;
        height: 200px;
    }
    
    /* 单个图片的特殊类 */
    .index3_13 .index3_14 .index3_15 .index3_17.single-image {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17.single-image .index3_25 {
        max-width: 400px;
        height: 300px;
    }
    
    /* 两个图片的特殊类 */
    .index3_13 .index3_14 .index3_15 .index3_17.two-images {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17.two-images .index3_25 {
        height: 250px;
    }
    
    /* 三个图片的特殊类 */
    .index3_13 .index3_14 .index3_15 .index3_17.three-images {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17.three-images .index3_25:first-child {
        grid-column: 1 / -1;
        height: 200px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17.three-images .index3_25:not(:first-child) {
        height: 180px;
    }
}

/* 响应式样式 */

/* 大屏幕 (1920px+) */
@media (min-width: 1920px) {
    .index3_13 .index3_14 .index3_15 .index3_17 {
        width: 720px;
        gap: 20px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(1):last-child) .index3_25 {
        max-width: 500px;
        height: 380px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(2):last-child) .index3_25 {
        height: 320px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(1) {
        height: 250px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(2),
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(3) {
        height: 230px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(4):last-child) .index3_25 {
        height: 250px;
    }
}

/* 中屏幕 (1200px - 1919px) */
@media (max-width: 1200px) {
    .index3_13 .index3_14 .index3_15 .index3_17 {
        width: 100%;
        gap: 20px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(1):last-child) .index3_25 {
        max-width: 450px;
        height: 300px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(2):last-child) .index3_25 {
        height: 220px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(1) {
        height: 180px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(2),
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(3) {
        height: 160px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(4):last-child) .index3_25 {
        height: 180px;
    }
}

/* 平板样式 (768px - 1199px) */
@media (max-width: 1199px) {
    .index3_13 .index3_14 .index3_15 .index3_17 {
        gap: 15px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(1):last-child) .index3_25 {
        max-width: 400px;
        height: 250px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(2):last-child) .index3_25 {
        height: 180px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(1) {
        height: 150px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(2),
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(3) {
        height: 130px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(4):last-child) .index3_25 {
        height: 150px;
    }
}

/* 手机样式 (最大767px) */
@media (max-width: 767px) {
    /* 手机端改为单列布局，更适合小屏幕 */
    .index3_13 .index3_14 .index3_15 .index3_17 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* 1个图片 */
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(1):last-child) .index3_25 {
        max-width: 100%;
        height: 200px;
    }
    
    /* 2个图片 */
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(2):last-child) {
        grid-template-columns: 1fr 1fr;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(2):last-child) .index3_25 {
        height: 140px;
    }
    
    /* 3个图片 */
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(1) {
        grid-column: 1 / -1;
        height: 150px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(2),
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(3) {
        height: 120px;
    }
    
    /* 4个图片 */
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(4):last-child) {
        grid-template-columns: 1fr 1fr;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(4):last-child) .index3_25 {
        height: 120px;
    }
}

/* 小手机样式 (最大479px) */
@media (max-width: 479px) {
    .index3_13 .index3_14 .index3_15 .index3_17 {
        gap: 10px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(1):last-child) .index3_25 {
        height: 180px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(2):last-child) .index3_25 {
        height: 120px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(1) {
        height: 130px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(2),
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(3):last-child) .index3_25:nth-child(3) {
        height: 100px;
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17:has(.index3_25:nth-child(4):last-child) .index3_25 {
        height: 100px;
    }
}

/* 基础图片卡片样式保持不变 */
.index3_13 .index3_14 .index3_15 .index3_17 .index3_25 {
    padding: 0px;
    background-image: url(../images/index3/index3_25_25.jpg);
    text-align: left;
    position: relative;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* index3_158 元素样式 */
.index3_13 .index3_14 .index3_15 .index3_17 .index3_25 .index3_158 {
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 2;
    position: relative;
    text-align: center;
    padding: 8px;
    line-height: 1.4;
}

/* 悬浮效果 */
.index3_13 .index3_14 .index3_15 .index3_17 .index3_25:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* 遮罩效果 */
.index3_13 .index3_14 .index3_15 .index3_17 .index3_25::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 1;
}

.index3_13 .index3_14 .index3_15 .index3_17 .index3_25:hover::before {
    background-color: rgba(0, 0, 0, 0.2);
}

/* 加载动画 */
.index3_13 .index3_14 .index3_15 .index3_17 .index3_25.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .index3_13 .index3_14 .index3_15 .index3_17 .index3_25:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    
    .index3_13 .index3_14 .index3_15 .index3_17 .index3_25:active {
        transform: scale(0.98);
    }
} 