/* 性能优化CSS - 只包含性能优化，不影响布局 */

/* 图片懒加载优化 */
img[loading="lazy"] {
  transition: opacity 0.3s ease-in-out;
}

/* 字体加载优化 */
@font-face {
  font-family: 'Microsoft Yahei';
  font-display: swap;
  src: local('Microsoft Yahei'), local('微软雅黑');
}

/* 性能优化 - 不影响布局 */
.lpost {
  will-change: transform;
}

/* 减少重绘 */
.btn {
  will-change: background-color, color;
}

.btn:hover {
  will-change: auto;
}

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

/* 减少CLS (Cumulative Layout Shift) */
.article-content img {
  height: auto;
  max-width: 100%;
}

/* 优化动画性能 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 内容可见性优化 */
.related-list {
  content-visibility: auto;
  contain-intrinsic-size: 300px;
}

/* 图片加载状态 */
.img-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* 关键渲染路径优化 */
.above-fold {
  contain: layout style paint;
}

.below-fold {
  content-visibility: auto;
  contain-intrinsic-size: 500px;
}