/* =========================================
   1. 字体与变量定义
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Inter:wght@300;400;600&display=swap');

:root {
    --bg-color: #02040a; 
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-cyan: #00f3ff;
    --accent-blue: #0066ff;
    --glass-bg: rgba(10, 10, 15, 0.5); 
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* =========================================
   2. 全局基础样式 & 修复核心
   ========================================= */
* {
    font-family: 'Inter', -apple-system, sans-serif !important;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color) !important;
    color: var(--text-primary) !important;
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
    
    /* [修复] 强制使用灰度抗锯齿，防止亚像素渲染切换导致的闪烁 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text-primary) !important; text-decoration: none !important; transition: 0.3s; }
a:hover { color: var(--accent-cyan) !important; }

/* =========================================
   3. 核心背景：像素光流系统
   ========================================= */
.pixel-light-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    background-color: #010205;
    
    /* [优化] 容器本身开启硬件加速 */
    transform: translateZ(0);
}

/* 0. 环境底光 (Ambient Aura) */
.pixel-light-container::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 120vw; height: 120vh;
    background: radial-gradient(circle, rgba(0, 50, 150, 0.15) 0%, transparent 60%);
    z-index: 0;
    animation: ambient-pulse 10s infinite ease-in-out;
}

/* 1. 网格遮罩 (Grid Mask) */
.pixel-grid-mask {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    z-index: 10;
    background-image: 
        linear-gradient(to right, #02040a 1px, transparent 1px),
        linear-gradient(to bottom, #02040a 1px, transparent 1px);
    background-size: 14px 14px;
    pointer-events: none;
}

/* 2. 能量波纹 (Shockwave Rings) */
.energy-wave {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%); /* 初始位置 */
    width: 100vw; 
    height: 100vw; 
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    z-index: 1;
    opacity: 0;
    pointer-events: none;

    background: radial-gradient(circle at center, 
        transparent 30%, 
        rgba(0, 243, 255, 0.1) 40%, 
        rgba(0, 243, 255, 0.8) 50%, 
        rgba(0, 102, 255, 0.4) 55%, 
        transparent 70%
    );
    
    mix-blend-mode: screen; 
    filter: blur(8px);
    
    /* [修复] 告诉浏览器这两个属性会变动，提前优化 */
    will-change: transform, opacity;
    /* [修复] 开启3D加速，隔离图层 */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
}

/* 波纹动画组 */
.wave-1 { 
    animation: shockwave-expand 12s infinite cubic-bezier(0.1, 0.5, 0.1, 1); 
}
.wave-2 { 
    animation: shockwave-expand 12s infinite cubic-bezier(0.1, 0.5, 0.1, 1); 
    animation-delay: 4s; 
}
.wave-3 { 
    animation: shockwave-expand 12s infinite cubic-bezier(0.1, 0.5, 0.1, 1); 
    animation-delay: 8s; 
}

/* =========================================
   4. 动画定义 (Keyframes)
   ========================================= */
@keyframes shockwave-expand {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
    5% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3.5) rotate(90deg); 
        opacity: 0;
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

@keyframes ambient-pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* =========================================
   5. 右侧轨道组件
   ========================================= */
.orbit-system {
    position: absolute;
    right: 10%; top: 30%;
    width: 200px; height: 200px;
    pointer-events: none;
    z-index: 5;
    will-change: transform; /* 优化 */
}
.orbit-ring {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 100%; height: 100%;
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 50%;
}
.orbit-planet {
    position: absolute;
    top: 0; left: 50%;
    width: 6px; height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan);
    offset-path: path("M 0,100 a 100,100 0 1,1 0,1 z");
    animation: orbit-move 4s linear infinite;
}
.orbit-label {
    position: absolute;
    top: 40%; left: 110%;
    font-size: 0.6rem; color: var(--accent-cyan);
    letter-spacing: 2px; white-space: nowrap;
}
@keyframes orbit-move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } }

/* =========================================
   6. 隐藏默认元素
   ========================================= */
#navList, #navigator, .postMeta, #blogTitle, #header { display: none !important; }
.newsItem, .catListLink, .sidebar-block, #sidebar_news, #sidebar_toptags, #sidebar_recentposts, .catListTitle, #sidebar_shortcuts { display: none !important; }
#blog-calendar, #blog_stats, .blogStats { display: none !important; }
#sidebar_info, .author_profile_info, #blog-news img { display: none !important; }

/* =========================================
   7. 主内容容器 (修复重点)
   ========================================= */
#main {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border) !important;
    border-radius: 0;
    padding: 60px 40px !important;
    margin: 40px auto !important;
    max-width: 1000px;
    
    /* [修复] 强制提升为独立合成层 (Compositing Layer) */
    transform: translateZ(0);
    
    /* [修复] 隐藏背面，消除渲染伪影 */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    
    /* [修复] 性能提示 */
    will-change: backdrop-filter;
}

#footer {
    text-align: center !important;
    width: 100% !important;
    padding: 40px 0 !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
    border: none !important;
}

h1, .postTitle {
    font-family: 'Playfair Display', serif !important;
    font-weight: 400 !important;
    font-style: italic !important;
}