/* CLS优化补充样式 - 在所有页面加载 */

/* 为所有图片预留空间 */
img:not([width]):not([height]) {
    aspect-ratio: attr(width) / attr(height);
}

/* 文章封面固定尺寸 */
.article-cover {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 应用图标固定尺寸 */
.app-icon {
    width: 80px;
    height: 80px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* 车机屏幕容器固定尺寸 */
.car-screen-container {
    min-height: 600px;
}

.car-screen {
    min-height: 550px;
}

/* 功能卡片固定最小高度 */
.feature-card {
    min-height: 200px;
}

/* 统计项固定高度 */
.stat-item {
    min-height: 120px;
}

/* 文章卡片固定最小高度 */
.article-card {
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.article-card .article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 防止图标字体加载导致的布局偏移 */
.fas, .fab, .far {
    display: inline-block;
    min-width: 1em;
    text-align: center;
}

/* 导航栏项固定高度 */
.nav-item {
    min-height: 40px;
}

/* 按钮固定最小尺寸 */
.btn-download {
    min-width: 180px;
    min-height: 56px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .article-cover {
        height: 180px;
    }

    .app-icon {
        width: 60px;
        height: 60px;
    }

    .car-screen-container {
        min-height: 400px;
    }

    .car-screen {
        min-height: 350px;
    }

    .feature-card {
        min-height: 180px;
    }

    .stat-item {
        min-height: 100px;
    }

    .article-card {
        min-height: 300px;
    }

    .phone-mockup {
        min-height: 400px;
    }
}

/* 骨架屏样式 - 内容加载前显示 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 防止内容闪烁 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
