/**
 * Skeleton Loading Styles
 * 骨架屏加载样式
 */

/* ========================================
   Base Skeleton Styles
   ======================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Skeleton Elements
   ======================================== */

/* 文本行 */
.skeleton-text {
    height: 14px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-text-sm {
    height: 12px;
    border-radius: 3px;
}

.skeleton-text-lg {
    height: 18px;
    border-radius: 4px;
}

/* 标题 */
.skeleton-title {
    height: 20px;
    width: 70%;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-title-lg {
    height: 24px;
    width: 60%;
    border-radius: 4px;
}

/* 头像 */
.skeleton-avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-avatar-sm {
    width: 32px;
    height: 32px;
}

.skeleton-avatar-md {
    width: 40px;
    height: 40px;
}

.skeleton-avatar-lg {
    width: 48px;
    height: 48px;
}

.skeleton-avatar-xl {
    width: 64px;
    height: 64px;
}

/* 徽章/标签 */
.skeleton-badge {
    height: 20px;
    width: 60px;
    border-radius: 4px;
    display: inline-block;
}

.skeleton-badge-sm {
    height: 16px;
    width: 48px;
    border-radius: 3px;
}

/* 图片/封面 */
.skeleton-image {
    border-radius: 8px;
}

.skeleton-image-sm {
    width: 80px;
    height: 80px;
}

.skeleton-image-md {
    width: 120px;
    height: 90px;
}

.skeleton-image-lg {
    width: 100%;
    height: 180px;
}

/* 按钮 */
.skeleton-button {
    height: 36px;
    width: 80px;
    border-radius: 6px;
}

.skeleton-button-sm {
    height: 28px;
    width: 60px;
    border-radius: 4px;
}

/* 图标占位 */
.skeleton-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

/* ========================================
   Skeleton Item Containers
   ======================================== */

/* 骨架项容器 */
.skeleton-item {
    pointer-events: none;
}

/* 问题列表骨架 */
.skeleton-question-item {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.skeleton-question-item .skeleton-content {
    flex: 1;
}

.skeleton-question-item .skeleton-meta {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

/* 热榜骨架 */
.skeleton-hot-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.skeleton-hot-item:last-child {
    border-bottom: none;
}

.skeleton-hot-item .skeleton-rank {
    width: 40px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* 动态流骨架 */
.skeleton-feed-item {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.skeleton-feed-item .skeleton-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.skeleton-feed-item .skeleton-user-info {
    flex: 1;
    margin-left: 12px;
}

/* 专栏卡片骨架 */
.skeleton-column-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.skeleton-column-card .skeleton-cover {
    width: 100%;
    height: 140px;
}

.skeleton-column-card .skeleton-body {
    padding: 16px;
}

/* 推荐内容骨架 */
.skeleton-recommend-item {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ========================================
   Skeleton Wrapper
   ======================================== */

.skeleton-wrapper {
    min-height: 200px;
}

/* 隐藏骨架（内容加载后） */
.skeleton-hidden {
    display: none !important;
}

/* 淡出动画 */
.skeleton-fade-out {
    animation: skeleton-fade 0.3s ease-out forwards;
}

@keyframes skeleton-fade {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* ========================================
   Dark Mode Support
   ======================================== */

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
    background-size: 200% 100%;
}

[data-theme="dark"] .skeleton-question-item,
[data-theme="dark"] .skeleton-feed-item,
[data-theme="dark"] .skeleton-column-card,
[data-theme="dark"] .skeleton-recommend-item {
    background: #1a1a1a;
}

[data-theme="dark"] .skeleton-hot-item {
    border-bottom-color: #333;
}
