/* ===== 暮想 Museve — 性能优化样式 ===== */

/* ---------- 字体优化 ---------- */
/* 使用 font-display: swap 避免 FOIT */
@font-face {
    font-family: 'Noto Serif SC';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Noto Serif SC Regular'), local('NotoSerifSC-Regular'),
         url('https://fonts.gstatic.com/s/notoserifsc/v17/GOTVpgZhre_cXWO1hAjhbg.woff2') format('woff2');
}

@font-face {
    font-family: 'Noto Serif SC';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: local('Noto Serif SC Medium'), local('NotoSerifSC-Medium'),
         url('https://fonts.gstatic.com/s/notoserifsc/v17/GOTVpgZhre_cXJuxhAjhbg.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Inter Regular'), local('Inter-Regular'),
         url('https://fonts.gstatic.com/s/inter/v18/UcCo3FwrK3iLTcviYwY.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: local('Inter Medium'), local('Inter-Medium'),
         url('https://fonts.gstatic.com/s/inter/v18/UcCo3FwrK3iLTcviYwY8.woff2') format('woff2');
}

/* ---------- 关键 CSS 内联 ---------- */
/* 以下样式会在 head.php 中内联，减少 HTTP 请求 */
.museve-critical {
    /* 首屏关键样式 */
}

/* ---------- 懒加载动画 ---------- */
.lazy-load {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.lazy-load.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- 图片占位符 ---------- */
.image-placeholder {
    background: linear-gradient(90deg, #F5F2F0 25%, #F9F7F4 50%, #F5F2F0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ---------- Pjax 过渡优化 ---------- */
.pjax-fade-in {
    animation: pjaxFadeIn 0.3s ease-out;
}

.pjax-fade-out {
    animation: pjaxFadeOut 0.2s ease-in forwards;
}

@keyframes pjaxFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pjaxFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ---------- 滚动性能优化 ---------- */
.scroll-animate {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ---------- 减少动画时长 ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- 打印优化 ---------- */
@media print {
    .no-print, nav, footer, .mobile-menu {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
