﻿.skeleton {
    background-color: #e0e0e0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    /* 新增：让骨架屏成为 flex 容器，方便文字居中 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.skeleton-wrapper {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    background-color: #e0e0e0;
}

.skeleton-wrapper > .skeleton {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.skeleton-wrapper > img.lazy-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.skeleton-ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.skeleton-ratio-3-2 {
    aspect-ratio: 3 / 2;
}

/* 文字样式 */
.skeleton-text {
    position: relative;
    z-index: 2; /* 确保文字在闪烁层之上 */
    color: #999;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    user-select: none;
}

/* 闪烁光效（z-index 低于文字） */
.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* 图片淡入（与之前相同） */
img.lazy-img {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

    img.lazy-img.loaded {
        opacity: 1;
    }
