/*!
 * 万能墙（lhuiye.cn） — SPDX-License-Identifier: LicenseRef-Proprietary
 * Copyright (c) 2026 辉夜 <18759765356@163.com> 保留所有权利
 * 第三方组件保留各自许可（见 THIRD_PARTY_NOTICES.md）
 */
/* ==========================================================================
   【极速模式】低配设备深度适配样式（性能优先）
   --------------------------------------------------------------------------
   只在 <html data-perf="lite"> 时生效（选择器统一带该前缀，特异性高于普通规则，
   因此无论本文件被注入在样式表的什么位置都能稳定覆盖）。

   设计原则（越靠前收益越大）：
     1. 干掉所有动画/过渡/毛玻璃/阴影/滤镜 —— 低端 GPU 最大的卡顿来源
     2. 干掉全屏节日装饰伪元素（body:before/after）—— 全屏合成层 + 持续动画
     3. 干掉渐变与固定背景图 —— 每次滚动全屏重绘
     4. 用系统字体，不额外下载字体文件
     5. 长列表卡片开启 content-visibility，跳过屏幕外渲染
     6. 缩减留白/圆角/装饰，减少滚动距离与重排
   ========================================================================== */

/* ---------- 1. 全局：动画 / 过渡 / 阴影 / 滤镜 全关 ---------- */
html[data-perf="lite"] *,
html[data-perf="lite"] *::before,
html[data-perf="lite"] *::after {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    filter: none !important;
    will-change: auto !important;
}
html[data-perf="lite"] { scroll-behavior: auto !important; }
html[data-perf="lite"] * { scroll-behavior: auto !important; }

/* ---------- 2. 全屏节日装饰 / 特效伪元素：直接不渲染 ---------- */
html[data-perf="lite"] body::before,
html[data-perf="lite"] body::after,
html[data-perf="lite"] .site-header::before,
html[data-perf="lite"] .site-header::after { content: none !important; display: none !important; }

/* ---------- 3. 背景：纯色，去掉渐变与固定背景图 ---------- */
html[data-perf="lite"] body {
    background: #f5f3f7 !important;
    background-image: none !important;
    background-attachment: scroll !important;
    background-size: auto !important;
}
html[data-perf="lite"] .app-bg,
html[data-perf="lite"] [class*="bg-fixed"],
html[data-perf="lite"] [class*="animated-bg"] { display: none !important; background-image: none !important; }

/* ---------- 4. 字体：系统字体栈，零字体下载 ---------- */
html[data-perf="lite"] body,
html[data-perf="lite"] button,
html[data-perf="lite"] input,
html[data-perf="lite"] textarea,
html[data-perf="lite"] select {
    font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif !important;
}

/* ---------- 5. 卡片 / 面板：纯白扁平 + 细边框，去掉 hover 位移 ---------- */
html[data-perf="lite"] .post-card,
html[data-perf="lite"] .card,
html[data-perf="lite"] .glass-card,
html[data-perf="lite"] .card-body,
html[data-perf="lite"] .ui-card,
html[data-perf="lite"] [class*="rounded-2xl"],
html[data-perf="lite"] [class*="rounded-3xl"] {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid rgba(0, 0, 0, .08) !important;
    border-radius: 10px !important;
}
html[data-perf="lite"] .post-card:hover,
html[data-perf="lite"] .card:hover,
html[data-perf="lite"] [class*="hover:-translate"]:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: rgba(0, 0, 0, .16) !important;
}
/* 长列表：屏幕外不渲染（content-visibility 是低配设备最有效的省电/省帧手段） */
html[data-perf="lite"] .post-card,
html[data-perf="lite"] .food-card,
html[data-perf="lite"] .event-card,
html[data-perf="lite"] .hero-card,
html[data-perf="lite"] .listing-card {
    content-visibility: auto;
    contain-intrinsic-size: 320px;
}

/* ---------- 6. 顶栏：不透明吸顶，去掉毛玻璃与滚动过渡 ---------- */
html[data-perf="lite"] .site-header,
html[data-perf="lite"] header.sticky,
html[data-perf="lite"] nav.sticky {
    background: #ffffff !important;
    background-image: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, .08) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
html[data-perf="lite"] .site-header.is-scrolled { background: #ffffff !important; }

/* ---------- 7. 加载动画 / 骨架 / 回到顶部：轻量化 ---------- */
html[data-perf="lite"] #siteLoader,
html[data-perf="lite"] .site-loader { display: none !important; }
html[data-perf="lite"] .ui-skeleton-line,
html[data-perf="lite"] .ui-skeleton-avatar,
html[data-perf="lite"] .ui-skeleton-media {
    background: #ececf0 !important;
    background-image: none !important;
}
html[data-perf="lite"] .ui-to-top {
    /* 极速模式保留「方角 + 无阴影」的轻量观感，但底色改白：原来的 rgba(0,0,0,.55) 深底
     * 配上主题色箭头（国庆红/深紫等）对比度太低，实测几乎看不清图标。 */
    background: rgba(255, 255, 255, .94) !important;
    color: #4a5568 !important;
    border: 1px solid rgba(0, 0, 0, .12) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}
html[data-perf="lite"] .spinner,
html[data-perf="lite"] .loading-spinner,
html[data-perf="lite"] .site-loader-spinner { animation: none !important; border-color: rgba(0, 0, 0, .15) !important; }

/* ---------- 8. 图片：懒渲染，避免一次性解码大图 ---------- */
html[data-perf="lite"] img { content-visibility: auto; }
html[data-perf="lite"] img[lazy],
html[data-perf="lite"] .post-media img { background: #f0f0f3 !important; }

/* ---------- 9. 压缩留白与装饰，减少滚动距离 ---------- */
html[data-perf="lite"] .post-card { padding: 12px 14px !important; margin-bottom: 10px !important; }
html[data-perf="lite"] .post-card .mb-4 { margin-bottom: 8px !important; }
html[data-perf="lite"] .avatar { width: 36px !important; height: 36px !important; }
html[data-perf="lite"] .glass-card,
html[data-perf="lite"] .card { padding: 12px !important; }
html[data-perf="lite"] [class*="shadow-"],
html[data-perf="lite"] [class*="blur-"] { box-shadow: none !important; backdrop-filter: none !important; }
html[data-perf="lite"] .bg-gradient-to-r,
html[data-perf="lite"] .bg-gradient-to-br,
html[data-perf="lite"] .bg-gradient-to-b,
html[data-perf="lite"] [class*="bg-gradient"] {
    background-image: none !important;
    background-color: var(--primary, #9c27b0) !important;
}

/* ---------- 10. 界面切换器（极速模式下的朴素版） ---------- */
html[data-perf="lite"] .perf-switch-panel {
    box-shadow: none !important;
    border: 1px solid rgba(0, 0, 0, .12) !important;
    background: #fff !important;
}

/* ---------- 11. 尊重系统「减少动态效果」设置 ---------- */
@media (prefers-reduced-motion: reduce) {
    html[data-perf="lite"] * { animation: none !important; transition: none !important; }
}
