/**
 * 骨架屏加载样式
 * @Version: 1.0
 */

/* 基础骨架屏动画 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 暗色模式适配 */
.io-black-mode .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

/* 卡片骨架 */
.skeleton-card {
    background: white;
    border-radius: var(--theme-border-radius);
    padding: 20px;
    box-shadow: 0 2px 10px var(--main-shadow);
    margin-bottom: 20px;
}

.skeleton-card .skeleton-image {
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    border-radius: var(--theme-border-radius-sm);
}

.skeleton-card .skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 10px;
}

.skeleton-card .skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-card .skeleton-text:last-child {
    width: 60%;
}

/* 列表骨架 */
.skeleton-list-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.skeleton-list-item:last-child {
    border-bottom: none;
}

.skeleton-list-item .skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-list-item .skeleton-content {
    flex: 1;
}

.skeleton-list-item .skeleton-title {
    height: 18px;
    width: 70%;
    margin-bottom: 10px;
}

.skeleton-list-item .skeleton-text {
    height: 14px;
    width: 100%;
}

/* 网格布局骨架 */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* 详情页面骨架 */
.skeleton-detail .skeleton-header {
    height: 300px;
    margin-bottom: 20px;
    border-radius: var(--theme-border-radius);
}

.skeleton-detail .skeleton-title {
    height: 30px;
    width: 60%;
    margin-bottom: 15px;
}

.skeleton-detail .skeleton-meta {
    height: 20px;
    width: 40%;
    margin-bottom: 20px;
}

.skeleton-detail .skeleton-content {
    height: 150px;
    margin-bottom: 20px;
}

/* 统计卡片骨架 */
.skeleton-stat {
    text-align: center;
    padding: 30px 20px;
    background: #fff;
    border-radius: var(--theme-border-radius);
    box-shadow: 0 2px 10px var(--main-shadow);
}

.skeleton-stat .skeleton-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
}

.skeleton-stat .skeleton-number {
    height: 30px;
    width: 50%;
    margin: 0 auto 10px;
}

.skeleton-stat .skeleton-label {
    height: 16px;
    width: 40%;
    margin: 0 auto;
}

/* Banner骨架 */
.skeleton-banner {
    height: 400px;
    border-radius: var(--theme-border-radius);
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .skeleton-banner {
        height: 200px;
    }
    
    .skeleton-grid {
        grid-template-columns: 1fr;
    }
}

/* 加载完成后的淡入效果 */
.loaded {
    animation: fade-in 0.5s ease-in;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
