/* 统一基础样式重置 - 确保所有页面布局一致 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background: transparent;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

/* 防止页面切换闪屏 */
html {
    background-color: #f8f9fa;
}

/* 全局背景容器 - 固定定位，确保背景图不随页面跳转重新加载 */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--light-mode-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f8f9fa;
    z-index: -1;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色模式背景 */
body.dark-mode .background-container, html.dark-mode .background-container {
    background-image: var(--dark-mode-bg);
    background-color: #121212;
}

/* 页面加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 呼吸跳动动画 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                    0 0 0 0.25px rgba(0, 0, 0, 0.16),
                    0 2px 8px rgba(0, 0, 0, 0.03),
                    0 8px 50px rgba(0, 0, 0, 0.08),
                    0 1px 3px rgba(0, 0, 0, 0.04),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                    0 0 0 0.25px rgba(0, 0, 0, 0.16),
                    0 4px 12px rgba(0, 0, 0, 0.05),
                    0 12px 60px rgba(0, 0, 0, 0.12),
                    0 2px 6px rgba(0, 0, 0, 0.06),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.95);
    }
}

/* 夜间模式呼吸跳动 */
@keyframes breatheDark {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0.33px 0 rgba(255, 255, 255, 0.06),
                    0 0 0 0.25px rgba(255, 255, 255, 0.12),
                    0 2px 8px rgba(0, 0, 0, 0.08),
                    0 8px 50px rgba(0, 0, 0, 0.35),
                    0 1px 3px rgba(0, 0, 0, 0.15),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0.33px 0 rgba(255, 255, 255, 0.06),
                    0 0 0 0.25px rgba(255, 255, 255, 0.12),
                    0 4px 12px rgba(0, 0, 0, 0.12),
                    0 12px 60px rgba(0, 0, 0, 0.45),
                    0 2px 6px rgba(0, 0, 0, 0.2),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
    }
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 页面主内容区域动画 - header 不受影响 */
.page-content {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    animation-delay: 0.1s;
}

/* 通用呼吸跳动类 - 适用于所有内容卡片 */
.breathe-animation {
    animation: breathe 4s ease-in-out infinite;
}

/* 夜间模式呼吸跳动 */
body.dark-mode .breathe-animation, html.dark-mode .breathe-animation {
    animation: breatheDark 4s ease-in-out infinite;
}

/* 导航栏 - iOS 26 最新风格毛玻璃效果 - 强制固定尺寸 */
.site-nav-header {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.78) 0%,
        rgba(255, 255, 255, 0.62) 100%
    );
    backdrop-filter: blur(50px) saturate(190%) contrast(1.05);
    -webkit-backdrop-filter: blur(50px) saturate(190%) contrast(1.05);
    box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                0 0 0 0.25px rgba(0, 0, 0, 0.16),
                0 2px 8px rgba(0, 0, 0, 0.03),
                0 8px 50px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    transition: background 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                backdrop-filter 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                box-shadow 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                border-color 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform, box-shadow;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    /* 强制固定尺寸，防止被其他样式覆盖 */
    height: 65px !important;
    min-height: 65px !important;
    max-height: 65px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.site-nav-header:hover {
    box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                0 0 0 0.25px rgba(0, 0, 0, 0.16),
                0 2px 8px rgba(0, 0, 0, 0.03),
                0 12px 60px rgba(0, 0, 0, 0.12),
                0 3px 6px rgba(0, 0, 0, 0.05),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.95);
}

/* 夜间模式导航栏 - iOS 26 风格 */
body.dark-mode .site-nav-header, html.dark-mode .site-nav-header {
    background: linear-gradient(
        180deg,
        rgba(22, 22, 22, 0.78) 0%,
        rgba(16, 16, 16, 0.62) 100%
    );
    box-shadow: 0 0.33px 0 rgba(255, 255, 255, 0.07),
                0 0 0 0.25px rgba(255, 255, 255, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.08),
                0 8px 50px rgba(0, 0, 0, 0.35),
                0 1px 3px rgba(0, 0, 0, 0.15),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: 100% !important;
    box-sizing: border-box !important;
}

/* Logo 和导航链接 - 强制固定尺寸 */
.logo { 
    font-size: 1.4rem !important; 
    font-weight: bold !important; 
    color: #2d3436 !important; 
    text-decoration: none !important; 
    transition: color 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) !important; 
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}
.nav-links { 
    display: flex !important; 
    align-items: center !important; 
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
}
.nav-links a { 
    text-decoration: none !important; 
    color: #636e72 !important; 
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) !important; 
    font-size: 0.95rem !important; 
    position: relative !important;
    padding: 5px 0 !important;
    line-height: 1 !important;
    margin: 0 !important;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #5e72e4;
    transition: width 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.nav-links a:hover, .nav-links a.active { 
    color: #5e72e4; 
    font-weight: bold; 
}
.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

/* 夜间模式 Logo 和导航链接 - 使用 !important 确保优先级 */
body.dark-mode .logo, html.dark-mode .logo { color: #dfe6e9 !important; }
body.dark-mode .nav-links a, html.dark-mode .nav-links a { color: #b2bec3 !important; }
body.dark-mode .nav-links a::after, html.dark-mode .nav-links a::after { background: #74b9ff !important; }
body.dark-mode .nav-links a:hover, body.dark-mode .nav-links a.active, html.dark-mode .nav-links a:hover, html.dark-mode .nav-links a.active { color: #74b9ff !important; }

/* 夜间模式切换按钮 */
.dark-mode-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s;
}

.dark-mode-toggle:hover {
    background: rgba(0,0,0,0.1);
}

body.dark-mode .dark-mode-toggle:hover, html.dark-mode .dark-mode-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 15px;
    }
}