/**
 * CSS优化和性能配置文件
 * 功能：统一管理CSS优化规则，提升性能和兼容性
 * 作者：陕西大模智能科技有限公司
 * 创建时间：2024
 */

/* CSS优化规则 */

/* 1. 减少重绘和回流 */
.optimized-transform {
    will-change: transform;
    transform: translateZ(0); /* 启用硬件加速 */
}

.optimized-opacity {
    will-change: opacity;
}

.optimized-scroll {
    will-change: scroll-position;
}

/* 2. 字体渲染优化 */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 3. 图片优化 */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 4. 滚动优化 */
.smooth-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 5. 动画性能优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 6. GPU加速类 */
.gpu-accelerated {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 7. 防止布局抖动 */
.layout-stable {
    contain: layout style paint;
}

/* 8. 优化重复背景 */
.optimized-bg {
    background-attachment: local;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 9. 文本选择优化 */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.text-select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 10. 触摸优化 */
.touch-optimized {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 11. 内容可见性优化 */
.content-visibility-auto {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* 12. 关键CSS内联优化标记 */
/* .critical-css 类已移除 - 空规则集 */

/* 13. 懒加载优化 */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* 14. 防止FOUC (Flash of Unstyled Content) */
.prevent-fouc {
    visibility: hidden;
}

.prevent-fouc.loaded {
    visibility: visible;
}

/* 15. 性能监控类 */
/* .perf-monitor 类已移除 - 空规则集 */

/* 16. 响应式图片优化 */
.responsive-img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    /* loading: lazy; 应在HTML中使用 <img loading="lazy"> */
}

/* 17. 表格优化 */
.optimized-table {
    table-layout: fixed;
    border-collapse: collapse;
}

/* 18. 列表优化 */
.optimized-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 19. 输入框优化 */
.optimized-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* 20. 打印优化 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}