/* 引入思源黑体 (Source Han Sans / Noto Sans SC) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* 全局基础设置 */
:root {
    --color-bg: #1A1A1A;
    --color-text-primary: #F8F9FA;
    --color-text-secondary: #E6DACE; /* 砂岩色 - 标题 */
    --color-accent: #3A5F7E; /* 矿物蓝 */
    --font-primary: 'Noto Sans SC', 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    /* 默认隐藏内容，等待JS加载完成后淡入 */
    opacity: 0; 
    transition: opacity 0.6s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* 链接高亮下划线动画 */
.nav-link {
    position: relative;
    text-decoration: none;
    color: var(--color-text-primary);
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--color-accent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--color-text-secondary);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    background-color: #111;
}

::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
    transition: background-color 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-accent);
}

/* 交互光标效果 - 简约箭头 */
a, button, .cursor-pointer {
    cursor: pointer;
}

/* 视觉组件：磨砂玻璃效果 */
.glass-effect {
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* 动画关键帧 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes kenburns {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* 实用动画类 */
.animate-fade-in {
    animation: fadeIn 1.2s ease-out forwards;
}

.animate-slide-up {
    animation: slideUpFade 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 延时类 */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-500 { animation-delay: 500ms; }

/* 页面切换过渡层 */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.page-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* 瀑布流布局辅助 */
.masonry-grid {
    column-count: 1;
    column-gap: 1.5rem;
}

@media (min-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* 隐藏类 */
.hidden-visually {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 轮播图渐隐过渡 */
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 0;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: kenburns 20s linear infinite alternate;
}

/* 细节哲学页面 - 滚动捕捉 */
.snap-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
}

.snap-section {
    scroll-snap-align: start;
    height: 100vh;
}

/* 图片加载占位 */
.img-placeholder {
    background-color: #2a2a2a;
    position: relative;
    overflow: hidden;
}

.img-placeholder::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 文本选择颜色 */
::selection {
    background: var(--color-accent);
    color: #fff;
}