/* 图片懒加载过渡效果 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img.loaded {
    opacity: 1;
}

/* 轮播图加载指示器 */
.slider-loading {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    width: 0;
    transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out;
    z-index: 1000;
}

/* 图片加载占位符 */
.image-placeholder {
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
    min-height: 200px;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

/* 响应式图片容器 */
.responsive-image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 宽高比 */
    overflow: hidden;
}

/* 不同比例的响应式容器 */
.aspect-ratio-16-9 {
    padding-bottom: 56.25%; /* 16:9 */
}

.aspect-ratio-4-3 {
    padding-bottom: 75%; /* 4:3 */
}

.aspect-ratio-1-1 {
    padding-bottom: 100%; /* 1:1 */
}

/* 响应式图片 */
.responsive-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 图片错误状态 */
.image-error {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    color: #666;
    font-size: 14px;
    padding: 20px;
    text-align: center;
    border: 1px solid #ddd;
}

.image-error::before {
    content: '!';
    display: block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background-color: #ff5722;
    color: white;
    border-radius: 50%;
    margin-right: 8px;
}

/* 图片加载中状态 */
.image-loading {
    position: relative;
}

.image-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 图片预加载效果 */
.preload-fade {
    filter: blur(5px);
    transform: scale(1.1);
    transition: filter 0.3s ease-out, transform 0.3s ease-out;
}

.preload-fade.loaded {
    filter: blur(0);
    transform: scale(1);
}

/* 响应式断点 */
@media (max-width: 768px) {
    .responsive-image-container {
        padding-bottom: 75%; /* 4:3 宽高比，适合移动设备 */
    }
}

/* WebP 回退样式 */
.no-webp .webp-image {
    display: none;
}

.webp .fallback-image {
    display: none;
} 