/* 性能优化CSS - 减少重绘和回流 */

/* 关键渲染路径优化 */
.hero-bg {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 减少动画开销 */
.gallery-item,
.healing-item,
.family-item {
    will-change: transform;
    transform: translateZ(0);
}

/* 字体加载优化 */
body {
    font-display: swap;
}

/* 减少布局抖动 */
.container {
    contain: layout style;
}

/* GPU加速 */
.back-to-top,
.cta-button,
.signup-btn {
    transform: translateZ(0);
    will-change: transform;
}

/* 预加载关键图片 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/1.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0;
    pointer-events: none;
}

/* 减少重绘 */
.photo-overlay {
    will-change: transform;
    transform: translateZ(0);
}

/* 优化滚动性能 */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-overflow-scrolling: touch;
}

/* 减少内存使用 */
@media (max-width: 768px) {
    .hero-bg {
        background-attachment: scroll !important;
        transform: none;
        will-change: auto;
    }
    
    .cloud {
        display: none;
    }
    
    .floating-elements {
        display: none;
    }
}