/* ================================
   Skeleton.css - 骨架屏系统
   ================================ */

/* 页面容器最小高度，防止footer跳动（仅用于有 .site-wrapper 的页面） */
.site-wrapper .page-container {
    min-height: calc(100vh - 200px); /* 减去header和margin的高度 */
}

/* ================================
   骨架屏动画
   ================================ */
@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* ================================
   资讯页面骨架屏
   ================================ */

/* 新闻列表骨架 */
.skeleton-news-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 15px;
}

.skeleton-news-image {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 4px;
}

.skeleton-news-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.skeleton-news-title {
    width: 80%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 4px;
}

.skeleton-news-title-short {
    width: 60%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 4px;
}

.skeleton-news-meta {
    width: 40%;
    height: 14px;
    background: #f0f0f0;
    border-radius: 4px;
}

/* 热点资讯骨架 */
.skeleton-hot-news-item {
    background-color: #1e1e1e;
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}

.skeleton-hot-news-image {
    width: 100%;
    height: 140px;
    background: #333;
}

.skeleton-hot-news-content {
    padding: 12px 15px;
}

.skeleton-hot-news-title {
    width: 90%;
    height: 18px;
    background: #333;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-hot-news-title-short {
    width: 70%;
    height: 18px;
    background: #333;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-hot-news-meta {
    width: 50%;
    height: 14px;
    background: #333;
    border-radius: 4px;
}

/* ================================
   主页骨架屏
   ================================ */

/* Banner骨架 */
.skeleton-banner {
    width: 100%;
    height: 520px;
    background: linear-gradient(
        90deg,
        rgba(102, 126, 234, 0.1) 25%,
        rgba(102, 126, 234, 0.15) 50%,
        rgba(102, 126, 234, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 16px;
}

/* 游戏卡片骨架 */
.skeleton-card {
    background: #f0f0f0;
    border-radius: 16px;
    width: calc(20% - 8px);
    height: 320px;
    margin-bottom: 10px;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 25%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ================================
   加载状态管理
   ================================ */

/* 内容加载前显示骨架屏 */
.content-loading .actual-content {
    display: none;
}

.content-loading .skeleton-container {
    display: block;
}

/* 内容加载后隐藏骨架屏 */
.content-loaded .skeleton-container {
    display: none;
}

.content-loaded .actual-content {
    display: block;
    animation: fadeInContent 0.3s ease-in;
}

/* 内容淡入动画 */
@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   响应式调整
   ================================ */

@media (max-width: 768px) {
    .skeleton-card {
        width: calc(50% - 5px);
        height: 280px;
    }

    .skeleton-news-item {
        flex-direction: column;
    }

    .skeleton-news-image {
        width: 100%;
        height: 150px;
    }

    .skeleton-news-title,
    .skeleton-news-title-short {
        width: 100%;
    }
}
