/* SEO优化相关的样式 */

/* 屏幕阅读器专用内容 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 页面加载优化 */
.article-image {
    transition: opacity 0.3s ease-in-out;
}

.article-image.loaded {
    opacity: 1;
}

/* 图片加载失败样式 */
.article-image:error {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.875rem;
}

/* 性能优化 - 减少重绘 */
.article-card {
    contain: layout style paint;
}

/* 预加载动画 */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.preloader .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式图片优化 */
@media (max-width: 768px) {
    .article-image {
        object-fit: cover;
        max-width: 100%;
        height: 100%;
    }
}

/* 打印样式优化 */
@media print {
    .article-image {
        width: 100%;
        height: 100%;
        page-break-inside: avoid;
    }
    
    .nav-menu,
    .search-overlay,
    .mobile-sidebar,
    .share-section {
        display: none !important;
    }
}