/* main.css - 主题全局样式 */
:root {
    --color-bg: #fcfcfc;
    --color-text: #0f0f0f;
    --color-gray: #888888;
    --color-light-gray: #eaeaea;
    --font-sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --transition-slow: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast: all 0.3s ease;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 48px;
    --spacing-xl: 96px;
    --spacing-xxl: 160px;
    --z-header: 100;
    --z-lightbox: 9999;
}

/* 如果用户选择了深色模式或根据图片色调，可能动态注入 class */
body.dark-mode {
    --color-bg: #0f0f0f;
    --color-text: #fcfcfc;
    --color-gray: #a0a0a0;
    --color-light-gray: #333333;
}

/* 基础复位 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 极简 Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--z-header);
    mix-blend-mode: difference; /* 关键：让白色文字在浅色图上变黑，黑色文字在深色图上变白 */
    color: #fff; /* 初始给白色，配合 mix-blend-mode */
}

.site-branding .site-title {
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 1rem;
}

.site-navigation ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
}

.site-navigation a {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.site-navigation a:hover {
    opacity: 1;
}

/* 极简 Footer */
.site-footer {
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-gray);
    border-top: 1px solid var(--color-light-gray);
}

/* 全屏大图轮播 (首页) */
.hero-slider {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
}

.hero-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out, visibility 1.5s;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

.hero-slide img {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.05); /* 预留给 Ken Burns 放大效果 */
    transition: transform 10s linear;
}

.hero-slide.active img {
    transform: scale(1);
}

/* 画册封面展示网格 (首页) */
.album-covers {
    padding: var(--spacing-xxl) var(--spacing-lg);
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--spacing-lg);
}

.album-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* 比如第一张占8列，第二张占4列，实现不对称 */
.album-card:nth-child(even) { grid-column: span 5; }
.album-card:nth-child(odd) { grid-column: span 7; }

.album-image {
    width: 100%;
    height: 60vh;
    object-fit: cover;
    transition: var(--transition-slow);
}

.album-card:hover .album-image {
    transform: scale(1.02);
}

.album-title-overlay {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: var(--spacing-lg);
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-fast);
}

.album-card:hover .album-title-overlay {
    opacity: 1;
    transform: translateY(0);
}

.album-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
}

/* 文章页：左右分栏 (Split Screen) */
.post-split-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 100px; /* 避开 header */
}

.post-sidebar {
    width: 35%;
    padding: var(--spacing-lg) var(--spacing-xl);
    position: sticky;
    top: 100px;
    height: calc(100vh - 100px);
    overflow-y: auto;
    /* 隐藏滚动条 */
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
.post-sidebar::-webkit-scrollbar { display: none; }

.post-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
}

.post-meta {
    font-size: 0.85rem;
    color: var(--color-gray);
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-content-text {
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.8;
}

.post-content-text p { margin-bottom: var(--spacing-md); }

/* 文章页：右侧瀑布流画廊 */
.post-gallery {
    width: 65%;
    padding: var(--spacing-lg);
}

/* Masonry Grid 容器 */
.masonry-grid {
    /* js 中会计算 Gutter */
    width: 100%;
}

.masonry-item {
    margin-bottom: var(--spacing-md);
    /* 默认两列排版 */
    width: calc(50% - (var(--spacing-md) / 2));
}

/* 如果是横图，让它占满整行 */
.masonry-item.landscape { width: 100%; }

.masonry-item img {
    width: 100%;
    display: block;
    cursor: zoom-in;
}

/* 隐藏在文章内容里被剥离出来的原生图片 */
.post-content-raw { display: none; }

/* 关于我 (Hero Portrait) */
.about-hero {
    display: flex;
    min-height: 100vh;
}
.about-portrait {
    width: 50%;
    height: 100vh;
    position: sticky;
    top: 0;
}
.about-portrait img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.about-content {
    width: 50%;
    padding: var(--spacing-xxl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.about-content h1 {
    font-family: var(--font-serif);
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
}

/* 沉浸式阅图体验 (Lightbox) */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: var(--z-lightbox);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    /* 背景自适应模糊预留 */
    backdrop-filter: blur(20px);
}
.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}
.lightbox-exif {
    position: absolute;
    bottom: var(--spacing-lg);
    left: var(--spacing-lg);
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    font-family: var(--font-sans);
    letter-spacing: 0.05em;
}

/* 响应式 */
@media (max-width: 1024px) {
    .post-split-layout { flex-direction: column; }
    .post-sidebar, .post-gallery { width: 100%; }
    .post-sidebar { position: relative; top: 0; height: auto; }
    .masonry-item { width: 100% !important; }
    .album-card:nth-child(n) { grid-column: span 12; }
    .about-hero { flex-direction: column; }
    .about-portrait, .about-content { width: 100%; }
    .about-portrait { height: 60vh; }
}