/**
 * 页面加载优化样式
 * 专门处理页面加载时的体验，防止滚动条闪烁
 * 优化页面宽度，保持协调的布局
 * 修复垂直滚动条和内容显示问题
 */

/* 页面加载时的基础优化 */
html {
    /* 防止页面加载时的水平滚动 */
    overflow-x: hidden;
    /* 确保页面加载过程中保持稳定 */
    scroll-behavior: smooth;
}

body {
    /* 防止页面加载时的水平滚动条闪烁 */
    overflow-x: hidden;
    /* 移除可能导致垂直滚动条问题的min-height设置 */
    /* min-height: 100vh; */
    /* 防止页面加载时的抖动 */
    margin: 0;
    padding: 0;
    /* 移除过度的宽度设置，保持页面协调 */
    width: auto;
    max-width: none;
}

/* 容器样式已移至main.css */
/* .container {
    overflow-x: hidden;
    padding-left: 20px;
    padding-right: 20px;
} */

/* 优势展示区样式已移至main.css */
/* .advantages-section {
    overflow-x: hidden;
}

.advantages-grid {
    overflow-x: hidden;
} */

/* 导航栏样式已移至navbar-optimization.css */
/* .navbar {
    overflow-x: hidden;
} */

/* 英雄区域样式已移至navbar-optimization.css */
/* .hero-section {
    overflow-x: hidden;
} */

/* 移动端特别优化 */
@media (max-width: 768px) {
    body {
        /* 移动端特别优化 */
        overflow-x: hidden;
        /* 防止触摸滑动时的水平滚动 */
        touch-action: pan-y;
        /* 确保移动端页面加载稳定 */
        -webkit-overflow-scrolling: touch;
    }
    
    /* 容器样式已移至main.css */
    /* .container {
        overflow-x: hidden;
        padding-left: 15px;
        padding-right: 15px;
    } */
}

/* 小屏幕特别优化 */
@media (max-width: 480px) {
    body {
        /* 小屏幕特别优化 */
        overflow-x: hidden;
    }
    
    /* 容器样式已移至main.css */
    /* .container {
        overflow-x: hidden;
        padding-left: 10px;
        padding-right: 10px;
    } */
}

/* 卡片样式已移至main.css */
/* .advantage-item,
.media-card,
.service-card {
    overflow-x: hidden;
} */

/* 优化图片加载时的表现 */
img {
    /* 防止图片在加载时超出容器 */
    max-width: 100%;
    height: auto;
    /* 防止图片加载时的布局跳动 */
    display: block;
}

/* 防止页面加载时的字体闪烁 */
* {
    /* 防止字体在加载时的闪烁 */
    font-display: swap;
    /* 确保文字渲染稳定 */
    text-rendering: optimizeLegibility;
}

/* 页面整体宽度协调性已移至main.css */
/* .advantages-section,
.media-section,
.services-overview {
    overflow-x: hidden;
}

.advantages-grid,
.media-grid,
.services-grid {
    overflow-x: hidden;
} */

/* 关于我们部分样式已移至main.css */
/* .about-showcase {
    overflow-x: hidden;
    padding: 80px 0;
}

.about-showcase .container {
    overflow-x: hidden;
}

.about-content {
    overflow-x: hidden;
} */

/* 页脚样式已移至main.css */
/* .footer {
    overflow-x: hidden;
}

.footer .container {
    overflow-x: hidden;
} */

/* 新增：防止页面加载时的垂直滚动条 */
/* 使用更温和的高度设置 */
body {
    /* 移除可能导致问题的min-height设置 */
    /* 让页面自然计算高度 */
}

/* 新增：优化页面加载时序 */
/* 确保CSS加载完成后页面布局稳定 */
html, body {
    /* 防止页面加载时的布局跳动 */
    overflow-x: hidden;
    /* 不设置固定高度，让内容自然撑开 */
}
