:root {
    /* 禅意基底色 - The Shelter */
    --bg-primary: #F8F6F2;    /* 米白/Rice White: 作为主背景，营造温暖、如同宣纸般的质感 */
    --bg-secondary: #E8ECE9;  /* 青瓷灰/Celadon Ash: 可用于次要背景，如代码块或引用区，增加层次 */
    --bg-tertiary: #e5e5ea;
    --text-primary: #2D2D2D;  /* 炭灰/Charcoal Gray: 用于正文 */
    --text-secondary: #587465; /* 石绿/Mineral Green: 与朱红搭配，用于次要标签、插图中的辅助图形 */
    --text-tertiary: #86868b;
    --accent: #C84630;        /* 朱红/Vermilion: 核心情绪色。用于文章标题、关键链接、最重要的按钮或标签 */
    --accent-hover: #B03C28;  /* 朱红暗色调，用于悬停状态 */
    --card-bg: #F8F6F2;       /* 卡片背景色与主背景相同，增加统一感 */
    --card-border: rgba(88, 116, 101, 0.2); /* 石绿透明色，用于边框 */
    --card-shadow: rgba(0, 0, 0, 0.05);
    --header-bg: rgba(248, 246, 242, 0.9);
    --footer-bg: #E8ECE9;
    --sidebar-width: 220px;
    --sidebar-bg: var(--bg-secondary);
}

.dark-theme {
    /* 暗色调配色方案 */
    --bg-primary: #222221;
    --bg-secondary: #2B2E2C;
    --bg-tertiary: #2c2c2e;
    --text-primary: #E8ECE9;
    --text-secondary: #90A49B;
    --text-tertiary: #6e6e73;
    --accent: #C84630;
    --accent-hover: #B03C28;
    --card-bg: #2B2E2C;
    --card-border: rgba(88, 116, 101, 0.25);
    --card-shadow: rgba(0, 0, 0, 0.2);
    --header-bg: rgba(34, 34, 33, 0.9);
    --footer-bg: #2B2E2C;
    --sidebar-bg: var(--bg-secondary);
}

/* ----------------------------------------------------
 * 「筑居思」色彩主题变量 (Matisse x Zen Aesthetics)
 * 核心原则：禅意 (留白) 为底，马蒂斯 (高饱和) 为锚点。
 * 亮色模式 (默认) 基础变量 + 无 data-emotion 时的默认主题
 * ---------------------------------------------------- */

:root {
    /* 禅意基础色 (The Zen Base) */
    --color-background-primary: #FCFCF8; /* 温暖奶油白，纸张感 */
    --color-background-secondary: #F0ECE3; /* 浅米灰，用于卡片/区块背景 */
    --color-text-primary: #262626;      /* 深炭黑，主正文 */
    --color-text-secondary: #575757;    /* 中灰，描述性文字 */
    --color-border-subtle: #E0E0E0;     /* 浅灰边框 */

    /* 通用马蒂斯锚点色 (General Accents) */
    --color-accent-blue: #007BFF;       /* 马蒂斯蓝：核心链接/按钮 */
    --color-accent-orange: #E67E22;     /* 赭石橙：Remake 徽章/CTA */
    --color-accent-yellow: #FFD700;     /* 纯粹黄：Hover/Tooltip 惊喜 */

    /* 无 data-emotion 时的默认主题变量 */
    --theme-primary: var(--color-accent-blue);
    --theme-secondary: var(--color-background-secondary);
    --theme-accent: var(--color-accent-orange);
    --theme-support: #90BE6D; /* 辅助色，檀青绿 */
    --theme-ink: var(--color-text-primary);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* 深色基础 (Zen Base Dark) */
        --color-background-primary: #1F2124;
        --color-background-secondary: #2C2F33;
        --color-text-primary: #F0ECE3;
        --color-text-secondary: #A0A0A0;

        /* 默认主题 (Dark) */
        --theme-primary: #599FFF;
        --theme-secondary: #3A3E45;
        --theme-accent: #FF9E4A;
        --theme-support: #B8DB8D;
        --theme-ink: var(--color-text-primary);
    }
}

/* ========== Emotion Themes (Light & Dark) ========== */
/* Light variants */
:root[data-emotion="passion"] {
    --theme-primary: #E63946;
    --theme-secondary: #FFB703;
    --theme-accent: #2A9D8F;
    --theme-support: #264653;
    --theme-ink: #1D1D1F;
}

:root[data-emotion="serenity"] {
    --theme-primary: #277DA1;
    --theme-secondary: #43AA8B;
    --theme-accent: #F3722C;
    --theme-support: #90BE6D;
    --theme-ink: #0F172A;
}

:root[data-emotion="joy"] {
    --theme-primary: #FF006E;
    --theme-secondary: #FDC500;
    --theme-accent: #3A86FF;
    --theme-support: #8338EC;
    --theme-ink: #111827;
}

:root[data-emotion="contemplation"] {
    --theme-primary: #4C3F91;
    --theme-secondary: #26A69A;
    --theme-accent: #FF6B6B;
    --theme-support: #FFD166;
    --theme-ink: #0B1021;
}

:root[data-emotion="growth"] {
    --theme-primary: #00A884;
    --theme-secondary: #7AE582;
    --theme-accent: #FF9F1C;
    --theme-support: #2D7DD2;
    --theme-ink: #0A0A0B;
}

:root[data-emotion="wander"] {
    --theme-primary: #1AA7EC;
    --theme-secondary: #F46036;
    --theme-accent: #2EC4B6;
    --theme-support: #FFBF69;
    --theme-ink: #0E1116;
}

:root[data-emotion="transcend"] {
    --theme-primary: #C84630; /* 品牌朱红 */
    --theme-secondary: #7E9C8D;
    --theme-accent: #1D3557;
    --theme-support: #E63946;
    --theme-ink: #111111;
}

/* Dark variants */
@media (prefers-color-scheme: dark) {
    :root[data-emotion="passion"] {
        --theme-primary: #FF5566;
        --theme-secondary: #FFC44D;
        --theme-accent: #34B6A3;
        --theme-support: #1C2A35;
        --theme-ink: #F5F5F5;
    }
    :root[data-emotion="serenity"] {
        --theme-primary: #3B95BE;
        --theme-secondary: #5BC2A3;
        --theme-accent: #FF8A48;
        --theme-support: #A5D983;
        --theme-ink: #E6EAF3;
    }
    :root[data-emotion="joy"] {
        --theme-primary: #FF3390;
        --theme-secondary: #FFD04D;
        --theme-accent: #69A3FF;
        --theme-support: #9C66FF;
        --theme-ink: #F3F4F6;
    }
    :root[data-emotion="contemplation"] {
        --theme-primary: #6A5BB3;
        --theme-secondary: #3CBBAF;
        --theme-accent: #FF8E8E;
        --theme-support: #FFDE85;
        --theme-ink: #E6E9F4;
    }
    :root[data-emotion="growth"] {
        --theme-primary: #1BC1A0;
        --theme-secondary: #96F19B;
        --theme-accent: #FFB347;
        --theme-support: #4A96EC;
        --theme-ink: #F3F3F4;
    }
    :root[data-emotion="wander"] {
        --theme-primary: #3ABDFF;
        --theme-secondary: #FF7B55;
        --theme-accent: #55DDCF;
        --theme-support: #FFD787;
        --theme-ink: #E9ECF2;
    }
    :root[data-emotion="transcend"] {
        --theme-primary: #E55A4B;
        --theme-secondary: #96B5A6;
        --theme-accent: #2A4B85;
        --theme-support: #FF6B6B;
        --theme-ink: #F2F2F2;
    }
}

/* Trial mounts (scoped; no change without data-emotion) */
[data-emotion] .content-card {
    /* 回归克制：保留中性边框，加入轻微情绪内嵌色条与柔和阴影 */
    border: 1px solid color-mix(in oklab, var(--theme-support), transparent 80%);
    box-shadow:
        inset 3px 0 0 color-mix(in oklab, var(--theme-primary), transparent 86%),
        0 4px 14px color-mix(in oklab, var(--theme-support), transparent 88%);
}

[data-emotion] .content-card:hover {
    border-color: color-mix(in oklab, var(--theme-support), transparent 72%);
    box-shadow:
        inset 3px 0 0 color-mix(in oklab, var(--theme-primary), transparent 82%),
        0 8px 22px color-mix(in oklab, var(--theme-support), transparent 82%);
}

[data-emotion] .content-card h4 {
    color: var(--theme-ink);
}

[data-emotion] .content-card .date {
    color: var(--theme-accent);
}

[data-emotion] .btn-primary {
    background: var(--theme-primary);
    color: #fff;
    border-color: transparent;
}

[data-emotion] .btn-primary:hover {
    background: var(--theme-accent);
    color: #fff;
    border-color: transparent;
}

/* Links adopt emotion accent; hover pivots to primary for clearer affordance */
[data-emotion] a {
    color: var(--theme-accent);
}

[data-emotion] a:hover {
    color: var(--theme-primary);
}

/* Tags adopt themed secondary background and ink color */
[data-emotion] .tag {
    background-color: var(--theme-secondary);
    color: var(--theme-ink);
    border: 1px solid color-mix(in oklab, var(--theme-support), transparent 75%);
}

/* 时间标签统一使用红色背景和白色字体 */
[data-emotion] .date-tag {
    background-color: #C84630; /* 红色背景 */
    color: #FFFFFF; /* 白色字体 */
    border: 1px solid #C84630;
}

/* CTA button mapping if present */
[data-emotion] .cta-button {
    background-color: var(--theme-primary);
    color: #fff;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px 12px; /* ensure left/right >= 4px */
    margin-top: 8px; /* top spacing outside frame */
}

[data-emotion] .cta-button:hover {
    background-color: var(--theme-accent);
    color: #fff;
    border-color: transparent;
}

/* Ensure spacing between invite paragraph and CTA */
.invitation-link-area p {
    margin-bottom: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

/* 8点网格系统 - 确保所有间距都是8的倍数 */
:root {
    --spacing-1: 8px;
    --spacing-2: 16px;
    --spacing-3: 24px;
    --spacing-4: 32px;
    --spacing-5: 40px;
    --spacing-6: 48px;
    --spacing-7: 56px;
    --spacing-8: 64px;
}

body {
    /* 使用霞鹜文楷字体 */
    font-family: 'LXGW WenKai', '霞鹜文楷', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.75; /* 增加行高，提升阅读体验 */
    font-weight: 300; /* 保持轻盈感 */
    letter-spacing: 0.01em; /* 稍微增加字间距 */
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    min-height: 100vh;
    -webkit-user-select: text; /* 确保文字可被选择 */
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.container {
    max-width: 720px; /* 减小最大宽度，确保在任何屏幕上都聚焦于内容 */
    margin: 0 auto;
    padding: 0 var(--spacing-3);
    width: 100%;
}

/* 首页专用容器宽度 - 在大屏幕上充分利用空间 */
body.index-page .container {
    max-width: 1200px; /* 1080p及以上屏幕充分利用宽度 */
}

body.index-page .hero {
    max-width: 900px; /* 首页英雄区与container宽度协调 */
}

/* 响应式调整 */
@media (max-width: 1400px) {
    body.index-page .container {
        max-width: 1000px;
    }
    body.index-page .hero {
        max-width: 800px;
    }
}

@media (max-width: 1200px) {
    body.index-page .container {
        max-width: 900px;
    }
    body.index-page .hero {
        max-width: 700px;
    }
}

@media (max-width: 1000px) {
    body.index-page .container {
        max-width: 720px; /* 恢复标准宽度 */
    }
    body.index-page .hero {
        max-width: 720px; /* 恢复标准宽度 */
    }
}

/* 调整标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: var(--accent); /* 使用朱红色作为标题颜色 */
    font-weight: 500; /* 使用 Medium 字重，不过于加粗 */
    margin-bottom: var(--spacing-3);
    line-height: 1.4;
    font-family: 'LXGW WenKai', '霞鹜文楷', 'Kaiti SC', 'STKaiti', 'PingFang SC', sans-serif; /* 使用霞鹜文楷 */
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    padding: var(--spacing-4) 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 0 var(--spacing-3);
    margin-bottom: var(--spacing-5);
}

.sidebar-logo h1 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar-logo h1 span {
    font-weight: 500;
    margin-left: 0.25rem;
    color: var(--accent);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: var(--spacing-1);
}

.sidebar-nav a {
    display: block;
    padding: var(--spacing-2) var(--spacing-3);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: background-color 0.2s ease, color 0.2s ease, border-left-color 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover:not(.active),
.sidebar-nav a:focus:not(.active) {
    background-color: var(--bg-primary);
    color: var(--theme-primary);
}

.sidebar-nav a.active {
    background-color: var(--bg-primary);
    color: var(--theme-primary);
    border-left-color: var(--theme-primary);
}

.sidebar-nav a.active:hover,
.sidebar-nav a.active:focus {
    background-color: var(--bg-primary);
    color: var(--theme-primary);
    border-left-color: var(--theme-primary);
}

/* 修改按钮和图标样式 */
button, .btn {
    font-family: 'LXGW WenKai', '霞鹜文楷', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    /* 允许内部全宽区块（如 footer 的 100vw 背景）突破容器 */
    overflow-x: visible;
    opacity: 0;
    animation: fadeInContent 0.8s ease forwards;
}

/* 子页面顶部留白 - 排除首页 */
body:not(.index-page) .main-content {
    padding-top: var(--spacing-6);
}

/* 页面加载时所有内容的淡入动画 */
@keyframes fadeInContent {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 英雄区样式 */
.hero {
    padding: var(--spacing-8) 0 var(--spacing-6);
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 2.2rem;
    font-weight: 500;
    margin-bottom: var(--spacing-3);
    color: var(--accent); /* 使用朱红色作为标题颜色 */
    letter-spacing: 0.02em;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: var(--spacing-1) auto;
    line-height: 1.8;
}

/* 引用样式 */
blockquote {
    margin: var(--spacing-3) 0;
    padding: var(--spacing-2) var(--spacing-3);
    border-left: 2px solid var(--accent); /* 朱红色竖线 */
    background-color: var(--bg-secondary);
    font-family: 'LXGW WenKai', '霞鹜文楷', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-style: italic;
    color: var(--text-secondary);
}

/* 卡片样式 */
.category, .featured-card, .link-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--card-shadow);
    transition: all 0.3s ease;
    margin-bottom: var(--spacing-4);
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.category:hover, .featured-card:hover, .link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--card-shadow);
}

/* 关于我部分 */
.about-me {
    padding: var(--spacing-4) var(--spacing-2);
    border-radius: 8px;
    margin-bottom: var(--spacing-6);
    background-color: var(--bg-secondary);
}

.about-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
}

.avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.about-content h3 {
    color: var(--accent);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-2);
}

.about-bio {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-3);
}

.bio-item {
    font-size: 0.9rem;
    margin-right: var(--spacing-2);
    color: var(--text-secondary);
}

/* 链接卡片 */
.link-card {
    position: relative;
    display: block;
    text-decoration: none;
    padding: var(--spacing-3);
    margin-bottom: var(--spacing-2);
    transition: all 0.3s ease;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.link-card:hover {
    transform: translateX(4px);
}

.link-card:hover::before {
    opacity: 1;
}

.link-content h5 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-1);
    font-weight: 500;
    transition: color 0.3s ease;
}

.link-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--spacing-1);
}

.link-content p.blog-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: var(--spacing-1);
    margin-bottom: var(--spacing-1);
}

/* 关键词样式 */
.blog-keywords {
    margin-top: var(--spacing-1);
    padding-top: var(--spacing-1);
    border-top: 1px solid var(--color-border-subtle);
    font-size: 0.85rem;
}

.keywords-label {
    color: var(--text-tertiary);
    font-weight: 500;
    margin-right: 0.5em;
}

.keywords-list {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 首页关键词标签样式（灵魂黄金三角的一部分） */
.content-card .keywords-tags {
    display: block;
    margin-top: var(--spacing-2);
    padding-top: var(--spacing-2);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    border-top: 1px solid var(--color-border-subtle);
    opacity: 0.85;
}

.content-card:hover .keywords-tags {
    opacity: 1;
    color: var(--text-primary);
}

.link-card:hover .link-content h5 {
    color: var(--accent);
}

/* 页脚样式 */
footer {
    padding: var(--spacing-4) 0;
    margin-top: var(--spacing-6);
    text-align: center;
    background-color: var(--footer-bg);
    /* full-bleed background even when inside a centered container */
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.footer-content {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--spacing-4) var(--spacing-3);
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#footer-greeting {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: var(--spacing-2);
    font-weight: 500;
}

.footer-nav {
    display: flex;
    justify-content: center;
    margin: 16px 0;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-secondary);
    margin: 0 12px;
    text-decoration: none;
    transition: color 0.3s;
    border-bottom: none;
}

.footer-link:hover {
    color: var(--accent);
    border-bottom: none;
}

/* 社交链接 */
.social-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-2);
    margin-top: var(--spacing-2);
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: transparent;
    color: var(--accent);
    transition: all 0.3s ease;
    border: 1px solid var(--accent);
    text-decoration: none;
}

.social-icon svg {
    color: var(--accent);
    stroke: var(--accent);
    transition: stroke 0.3s ease, color 0.3s ease;
}

.social-icon:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    border-bottom: none;
}

.social-icon:hover svg {
    color: white;
    stroke: white;
}

/* 阅读进度指示器 */
.progress-container {
    position: fixed;
    top: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#theme-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 0;
}

#theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dark-theme #theme-toggle-btn {
    background: rgba(0, 0, 0, 0.2);
}

.dark-theme #theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

.dark-theme .theme-toggle .sun-icon {
    display: none;
}

.dark-theme .theme-toggle .moon-icon {
    display: block;
}

/* 移动端适配 */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    right: 16px;
    top: 16px;
    background: var(--bg-secondary);
    border: none;
    width: 44px; /* 增大触摸目标，符合移动端最小44x44px标准 */
    height: 44px;
    border-radius: 8px;
    z-index: 1001;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 8px;
    box-shadow: 0 2px 8px var(--card-shadow);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

.mobile-menu-toggle span {
    display: block;
    height: 2px;
    background-color: var(--text-primary);
    transition: transform 0.3s ease, opacity 0.3s ease;
    width: 100%;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .about-container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* 基础字体大小调整 */
    html {
        font-size: 15px; /* 移动端稍微减小基础字体 */
    }
    
    body {
        line-height: 1.7; /* 移动端行高稍微减小 */
    }
    
    /* 侧边栏移动端样式 */
    .sidebar {
        transform: translateX(-100%);
        width: 280px; /* 移动端侧边栏稍宽，便于操作 */
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* 侧边栏遮罩层 - 使用body类控制 */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        animation: fadeIn 0.3s ease;
    }
    
    body.sidebar-open {
        overflow: hidden; /* 防止背景滚动 */
    }
    
    .sidebar-nav a {
        padding: var(--spacing-2) var(--spacing-3);
        font-size: 1rem;
        min-height: 44px; /* 确保触摸目标足够大 */
        display: flex;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* 移动端菜单按钮动画 */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* 移动端子页面顶部留白 */
    body:not(.index-page) .main-content {
        padding-top: var(--spacing-4);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* 主题切换按钮移动端位置调整 */
    .theme-toggle {
        top: 16px;
        right: 68px; /* 为移动菜单按钮留出空间 */
    }
    
    #theme-toggle-btn {
        width: 44px;
        height: 44px;
    }
    
    /* 标题样式优化 */
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
        margin-bottom: var(--spacing-2);
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-3);
    }
    
    .links-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-3);
    }
    
    /* 英雄区优化 */
    .hero {
        padding: var(--spacing-5) 0 var(--spacing-4);
    }
    
    .hero h2 {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-2);
    }
    
    .hero p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* 卡片样式优化 */
    .content-card, .link-card, .featured-card {
        padding: var(--spacing-3);
        margin-bottom: var(--spacing-3);
    }
    
    .link-content {
        padding: var(--spacing-3);
    }
    
    .link-content h5 {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: var(--spacing-1);
    }
    
    /* 关于我部分移动端优化 */
    .about-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: var(--spacing-3);
    }
    
    .about-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .avatar-container {
        width: 100px;
        height: 100px;
        margin-bottom: var(--spacing-3);
    }
    
    .about-bio {
        justify-content: center;
        gap: var(--spacing-1);
    }
    
    .bio-item {
        font-size: 0.85rem;
        padding: 0.4rem 0.7rem;
    }
    
    .about-social {
        justify-content: center;
        margin-top: var(--spacing-2);
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    /* 按钮优化 */
    .btn, .btn-primary, .btn-secondary {
        min-height: 44px;
        padding: var(--spacing-2) var(--spacing-4);
        font-size: 1rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation; /* 优化触摸响应 */
    }
    
    .cta-button {
        min-height: 44px;
        padding: var(--spacing-2) var(--spacing-4);
        font-size: 1rem;
        width: 100%;
        text-align: center;
        display: block;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* 链接卡片触摸优化 */
    .link-card, .content-card {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        cursor: pointer;
    }
    
    /* 改善移动端链接点击体验 */
    a {
        -webkit-tap-highlight-color: rgba(200, 70, 48, 0.1);
        touch-action: manipulation;
    }
    
    /* 页脚优化 */
    .footer-content {
        padding: var(--spacing-3) var(--spacing-2);
    }
    
    .footer-nav {
        flex-direction: column;
        gap: var(--spacing-2);
    }
    
    .footer-link {
        margin: 0;
        padding: var(--spacing-1) 0;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 容器优化 */
    .container {
        padding: 0 var(--spacing-3);
    }
    
    /* 引用块优化 */
    blockquote {
        padding: var(--spacing-2) var(--spacing-3);
        margin: var(--spacing-3) 0;
        font-size: 0.95rem;
    }
    
    /* 分类头部优化 */
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-2);
    }
    
    /* 展品容器优化 */
    .cabinet-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-3);
    }
    
    .exhibit-item {
        height: 250px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .exhibit-title {
        font-size: 0.95rem;
        padding: var(--spacing-2);
    }
    
    /* 博客封面图移动端优化 */
    .blog-cover-wrap {
        aspect-ratio: 16 / 9;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    .blog-cover {
        max-width: 100%;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* 日期标签移动端优化 */
    .date-tag, .date {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* 关键词标签移动端优化 */
    .keywords-tags {
        font-size: 0.8rem;
        line-height: 1.5;
    }
    
    /* 页脚社交图标移动端优化 */
    .social-links {
        gap: var(--spacing-2);
    }
    
    .social-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 var(--spacing-2);
    }
    
    .hero {
        padding: var(--spacing-4) 0 var(--spacing-3);
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    /* 更小屏幕的卡片内边距 */
    .content-card, .link-card, .featured-card {
        padding: var(--spacing-2);
    }
    
    .link-content {
        padding: var(--spacing-2);
    }
    
    /* 标题进一步缩小 */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    /* 侧边栏在小屏幕上更窄 */
    .sidebar {
        width: 260px;
    }
    
    /* 移动菜单按钮位置调整 */
    .mobile-menu-toggle {
        right: 12px;
        top: 12px;
    }
    
    .theme-toggle {
        right: 60px;
        top: 12px;
    }
    
    /* 关于我部分进一步优化 */
    .about-section {
        padding: var(--spacing-2);
    }
    
    .avatar-container {
        width: 90px;
        height: 90px;
    }
    
    .bio-item {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

/* 超小屏幕优化（iPhone SE等） */
@media (max-width: 375px) {
    html {
        font-size: 13px;
    }
    
    .container {
        padding: 0 var(--spacing-1);
    }
    
    .hero h2 {
        font-size: 1.3rem;
    }
    
    .content-card, .link-card {
        padding: var(--spacing-2);
    }
    
    .sidebar {
        width: 240px;
    }
    
    /* 超小屏幕下的按钮和链接 */
    .btn, .btn-primary, .btn-secondary, .cta-button {
        font-size: 0.95rem;
        padding: var(--spacing-2) var(--spacing-3);
    }
    
    .link-content h5 {
        font-size: 1rem;
    }
}

/* Remove old header styles that are no longer needed */
.site-header {
    display: none;
}

.main-nav {
    display: none;
}

/* Remove navigation toggle styles that are no longer needed */
.nav-toggle {
    display: none;
}

.breadcrumbs {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem;
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.breadcrumbs a:hover {
    background-color: var(--accent);
    color: white;
}

@media (max-width: 768px) {
    .breadcrumbs {
        margin: 0.5rem 0;
        padding: 0 0.75rem;
    }
}

/* Featured Categories */
.featured-categories {
    margin-bottom: 3rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.featured-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--card-shadow);
}

.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.75rem;
}

.featured-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.view-more {
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.view-more:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.featured-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.featured-item {
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.featured-item:hover {
    background-color: var(--bg-secondary);
}

.featured-item h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    transition: color 0.2s ease;
}

.featured-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.featured-item:hover h4 {
    color: var(--accent);
}

/* ========== newsletter 轮播样式 ========== */
.newsletter-carousel {
    position: relative;
    overflow: hidden;
    margin: 2rem 0;
}
.newsletter-carousel .slides {
    display: flex;
    width: calc(100% * 3);    /* 三页 */
    transition: transform 0.4s ease;
}
.newsletter-carousel .slide {
    flex: 0 0 100%;
    padding: 0 0.5rem;
}
.newsletter-carousel .slide .links-grid {
    display: grid;
    /* 每页项目更小：每项最小 160px */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}
.newsletter-carousel .dots {
    text-align: center;
    margin-top: 1rem;
}
.newsletter-carousel .dot {
    width: 8px; height: 8px;
    display: inline-block;
    margin: 0 4px;
    background-color: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.newsletter-carousel .dot.active {
    background-color: var(--accent);
}

/* 在窄屏下，把轮播拆回单列纯滚动 */
@media (max-width: 576px) {
    .newsletter-carousel .slides {
        flex-direction: column;
        width: 100%;
    }
    .newsletter-carousel .slide {
        padding: 0;
    }
    .newsletter-carousel .dot {
        display: none;
    }
}

/* Portfolio Styles */
.portfolio-showcase {
    margin: 2rem 0 4rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.portfolio-item {
    background-color: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.portfolio-media {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.portfolio-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-image {
    transform: scale(1.03);
}

.portfolio-info {
    padding: 2rem;
}

.portfolio-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tag {
    background-color: var(--bg-tertiary);
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.portfolio-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.portfolio-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
    border: 2px solid transparent;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    border: 2px solid transparent;
}

.btn-primary:hover {
    background-color: white;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 2px solid transparent;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--accent);
    border-color: var(--accent);
}

/* 暗色主题下的按钮 hover 效果 */
.dark-theme .btn-primary:hover,
.dark-theme .btn-secondary:hover {
    background-color: var(--bg-primary);
    color: var(--accent);
    border-color: var(--accent);
}

/* Large Screens - Portfolio Layout */
@media (min-width: 992px) {
    .portfolio-item {
        flex-direction: row;
        align-items: center;
    }
    
    .portfolio-media {
        flex: 0 0 50%;
        max-width: 50%;
        height: 400px;
    }
    
    .portfolio-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .portfolio-info {
        flex: 1;
    }
}

/* 响应式适配 - 中小屏幕 */
@media (max-width: 992px) {
    .portfolio-media {
        height: 300px;
    }
    
    .portfolio-image {
        height: 100%;
        object-fit: cover;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* 重复的768px媒体查询已合并到上方统一管理 */

/* 添加日期标签样式 */
.date-tag {
    display: inline-block;
    font-size: 0.75rem;
    color: #FFFFFF; /* 白色字体 */
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
    padding: 0.15rem 0.5rem;
    background-color: #C84630; /* 红色背景 */
    border-radius: 3px;
    font-weight: 500;
}

.dark-mode .date-tag {
    background-color: #C84630; /* 红色背景 */
    color: #FFFFFF; /* 白色字体 */
}

/* Newsletter部分样式 */
.newsletter-section {
    margin: var(--spacing-6) 0;
    padding: var(--spacing-4);
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--card-shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-4);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: var(--spacing-2);
}

.section-header h3 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 0;
}

.newsletter-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-3);
}

.newsletter-item {
    background-color: var(--bg-primary);
    padding: var(--spacing-3);
    border-radius: 8px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.newsletter-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--card-shadow);
}

.newsletter-item h4 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-1);
}

.newsletter-item p {
    color: var(--text-secondary);
    margin: var(--spacing-2) 0;
    font-size: 0.9rem;
}

.newsletter-link {
    display: inline-block;
    color: var(--accent);
    font-size: 0.9rem;
    text-decoration: none;
    margin-top: var(--spacing-2);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.newsletter-link:hover {
    border-color: var(--accent);
}

/* Newsletter推荐列表样式 */
.newsletter-recommendations {
    list-style: none;
    padding: 0;
    margin: var(--spacing-2) 0;
}

.newsletter-recommendations li {
    margin-bottom: var(--spacing-1);
    padding-left: var(--spacing-2);
    position: relative;
}

.newsletter-recommendations li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.newsletter-recommendations .newsletter-link {
    margin-top: 0;
}

@media (max-width: 768px) {
    .newsletter-content {
        grid-template-columns: 1fr;
    }
}

/* ========== blogs 页面定制：去外框 + 入场动画 ========== */
/* 去掉分类容器的外框，只保留卡片自身边框 */
body.blogs-page .category {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

/* 分类头部去分割线，让视觉更干净 */
body.blogs-page .category-header {
    border-bottom: none;
    padding-bottom: 0;
}

/* 博客卡片：加载时淡入上浮效果 */
body.blogs-page .links-grid .link-card {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

/* 逐项延迟，形成柔和瀑布式入场 */
body.blogs-page .links-grid .link-card:nth-child(1) { animation-delay: 0.02s; }
body.blogs-page .links-grid .link-card:nth-child(2) { animation-delay: 0.06s; }
body.blogs-page .links-grid .link-card:nth-child(3) { animation-delay: 0.10s; }
body.blogs-page .links-grid .link-card:nth-child(4) { animation-delay: 0.14s; }
body.blogs-page .links-grid .link-card:nth-child(5) { animation-delay: 0.18s; }
body.blogs-page .links-grid .link-card:nth-child(6) { animation-delay: 0.22s; }
body.blogs-page .links-grid .link-card:nth-child(7) { animation-delay: 0.26s; }
body.blogs-page .links-grid .link-card:nth-child(8) { animation-delay: 0.30s; }
body.blogs-page .links-grid .link-card:nth-child(9) { animation-delay: 0.34s; }
body.blogs-page .links-grid .link-card:nth-child(10) { animation-delay: 0.38s; }
body.blogs-page .links-grid .link-card:nth-child(11) { animation-delay: 0.42s; }
body.blogs-page .links-grid .link-card:nth-child(12) { animation-delay: 0.46s; }
body.blogs-page .links-grid .link-card:nth-child(13) { animation-delay: 0.50s; }
body.blogs-page .links-grid .link-card:nth-child(14) { animation-delay: 0.54s; }
body.blogs-page .links-grid .link-card:nth-child(15) { animation-delay: 0.58s; }
body.blogs-page .links-grid .link-card:nth-child(16) { animation-delay: 0.62s; }
body.blogs-page .links-grid .link-card:nth-child(17) { animation-delay: 0.66s; }
body.blogs-page .links-grid .link-card:nth-child(18) { animation-delay: 0.70s; }
body.blogs-page .links-grid .link-card:nth-child(19) { animation-delay: 0.74s; }
body.blogs-page .links-grid .link-card:nth-child(20) { animation-delay: 0.78s; }

/* 博客列表：强制单列布局，一行一个卡片 */
body.blogs-page .links-grid {
    grid-template-columns: 1fr;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* 博客列表卡片标题：字号增大一档 */
body.blogs-page .link-content h5 {
    font-size: 1.3rem;
}

/* 展品页面样式补充 */
.categories {
    margin-bottom: var(--spacing-6);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-4);
    padding-bottom: var(--spacing-2);
    border-bottom: 1px solid var(--card-border);
}

.category-header h3 {
    margin-bottom: 0;
    color: var(--accent);
}

.category-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.cabinet-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-4);
}

.exhibit-item-link {
    display: block;
    text-decoration: none;
}

.exhibit-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 300px;
}

.exhibit-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.exhibit-item:hover {
    transform: translateY(-5px);
}

.exhibit-item:hover img {
    transform: scale(1.05);
}

.exhibit-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-3);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

.subcategories {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-5);
}

.subcategory {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.subcategory h4 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-3);
    color: var(--accent);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-3);
}

.link-card {
    text-decoration: none;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--accent);
}

/* 博客列表卡片封面图样式（灵魂封面图） */
.blog-cover-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-secondary);
    position: relative;
}

.blog-cover {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    box-sizing: border-box;
}

.link-card:hover .blog-cover {
    transform: scale(1.05);
}

.link-content {
    padding: var(--spacing-3);
}

.link-content h5 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-2);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.link-card:hover .link-content h5 {
    color: var(--accent);
}

.link-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.immersive-gallery-entry {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.exhibit-item:hover .immersive-gallery-entry {
    opacity: 1;
}

.immersive-gallery-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.immersive-gallery-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(10px);
}

.immersive-gallery-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--spacing-4);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    max-width: 300px;
}

.immersive-gallery-content h3 {
    color: white;
    margin-bottom: var(--spacing-2);
}

.immersive-gallery-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-3);
}

.immersive-gallery-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    color: var(--accent);
    background: white;
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.immersive-gallery-cta:hover {
    background: var(--accent);
    color: white;
}

/* 重复的768px媒体查询已合并到上方统一管理 */

/* ========== 灵魂配图样式 (Soulful Image Curation) ========== */
/* 这是"Vibe Coding"工作流的核心样式，兼顾"灵魂美学"与"性能洁癖" */

/* Figure 容器 - 灵魂美学的基础 */
figure {
    margin: 2.5rem auto;
    max-width: 100%;
    position: relative;
    /* 防止页面跳动 (CLS) */
    min-height: 1px;
}

/* 图片样式 - 性能洁癖 + 视觉呼吸 */
figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    /* 优雅的阴影，增加层次感 */
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;
    /* 平滑淡入动画 - 图片加载时自动触发 */
    opacity: 0;
    animation: soulfulFadeIn 0.8s ease forwards;
}

/* 图片已加载完成（由lazy-loading.js添加的class） */
figure img.lazy-loaded {
    opacity: 1;
}

/* 如果图片没有loading属性（立即加载的图片），直接显示 */
figure img:not([loading="lazy"]) {
    opacity: 1;
    animation: soulfulFadeIn 0.6s ease forwards;
}

/* 图片悬停效果 - 微妙的"呼吸感" */
figure:hover img {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.06);
}

/* 图注样式 - 灵魂印记 */
figure figcaption {
    margin-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary, #587465);
    text-align: center;
    font-style: italic;
    /* 优雅的透明度，不抢夺主图注意力 */
    opacity: 0.85;
    /* 禅意留白 */
    padding: 0 1rem;
    max-width: 100%;
}

/* 暗色模式下的图注 */
.dark-theme figure figcaption {
    color: var(--text-secondary, #90A49B);
    opacity: 0.75;
}

/* 淡入动画 - 灵魂美学 */
@keyframes soulfulFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式优化 - 移动端图片样式 */
@media (max-width: 768px) {
    figure {
        margin: 1.5rem auto;
    }
    
    figure img {
        border-radius: 6px;
        max-width: 100%;
    }
    
    figure figcaption {
        font-size: 0.85rem;
        padding: 0 var(--spacing-2);
        margin-top: var(--spacing-2);
        line-height: 1.5;
    }
}

/* 位置A：灵魂定调图 - 特殊样式（可选） */
.whisper-intro + figure {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* 位置B：灵魂呼吸点 - 章节后的图片 */
h2 + figure {
    margin-top: 2rem;
    margin-bottom: 2.5rem;
}

/* 位置C：灵魂印记 - 后记图片（可选） */
.postscript figure,
.easter-egg figure {
    margin-top: 2.5rem;
    margin-bottom: 2rem;
}

/* 打印样式优化 */
@media print {
    figure {
        page-break-inside: avoid;
        margin: 1.5rem 0;
    }
    
    figure img {
        box-shadow: none;
    }
    
    figure figcaption {
        font-size: 0.8rem;
        opacity: 1;
    }
} /* Whisper 组件样式 - 与项目禅意风格保持一致 */

/* 灵感私语卡片容器 */
.whisper-intro-section {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.whisper-intro-card {
  display: block;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg, rgba(255, 255, 255, 0.6));
  border: 1px solid var(--card-border, rgba(88, 116, 101, 0.15));
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.whisper-intro-card:hover {
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.1);
  border-color: var(--card-border, rgba(88, 116, 101, 0.25));
  transform: translateY(-1px);
}

.whisper-intro-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary, #587465);
  line-height: 1.4;
}

.whisper-intro {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #777);
  line-height: 1.6;
}

.dark-theme .whisper-intro-card {
  background: var(--card-bg, rgba(43, 46, 44, 0.6));
  border-color: var(--card-border, rgba(88, 116, 101, 0.2));
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-theme .whisper-intro-card:hover {
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 2px 6px rgba(0, 0, 0, 0.4);
  border-color: var(--card-border, rgba(88, 116, 101, 0.3));
}

.dark-theme .whisper-intro-card h3 {
  color: var(--text-secondary, #90A49B);
}

.dark-theme .whisper-intro {
  color: var(--text-secondary, #90A49B);
}

/* 响应式调整 - Whisper组件移动端 */
@media (max-width: 768px) {
  .whisper-intro-card {
    padding: var(--spacing-2) var(--spacing-3);
    margin: var(--spacing-2) 0;
  }
  
  .whisper-intro-card h3 {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .whisper-intro {
    font-size: 0.8rem;
    line-height: 1.6;
  }
}

.whisper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  margin: 0 0.2em;
  vertical-align: middle;
  font-size: 1em;
  line-height: 1;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* 让图标更明显 - 添加背景和边框 */
  background: rgba(88, 116, 101, 0.08);
  border: 1px solid rgba(88, 116, 101, 0.2);
  border-radius: 4px;
  padding: 0.15em 0.3em;
  min-width: 1.2em;
  min-height: 1.2em;
}

.whisper:hover {
  transform: scale(1.15);
  background: rgba(88, 116, 101, 0.15);
  border-color: rgba(88, 116, 101, 0.4);
  box-shadow: 0 2px 6px rgba(88, 116, 101, 0.2);
}

.whisper:focus-visible {
  outline: 2px solid var(--accent, #C84630);
  outline-offset: 2px;
  border-radius: 2px;
}

.whisper-card {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5em;
  
  /* 卡片样式 - 使用项目 CSS 变量 */
  background: var(--card-bg, var(--bg-primary, #F8F6F2));
  border: 1px solid var(--card-border, rgba(88, 116, 101, 0.2));
  border-radius: 8px;
  padding: 0.75em 1em;
  
  /* 增强投影效果 - 多层阴影营造立体感 */
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(88, 116, 101, 0.1);
  transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* 文字样式 - 比正文小一号 */
  color: var(--text-primary, #2D2D2D);
  font-size: 0.9rem; /* 正文是 1.1rem，小一号是 0.9rem */
  line-height: 1.5;
  
  /* 自适应宽度：确保能容纳足够的文字 */
  width: fit-content;
  /* 桌面端：至少容纳 150 个字，一行至少 20 个字符 */
  max-width: min(70ch, calc(100vw - 60px)); /* 70ch 足够容纳 150 个字 */
  min-width: 22ch; /* 一行至少容纳 20 个中文字符 */
  white-space: normal; /* 允许多行显示 */
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  /* 确保内容不会被截断，可以无限多行 */
  overflow: visible;
  /* 不限制高度，允许内容无限扩展 */
  max-height: none;
  
  /* 确保卡片在最上层 */
  z-index: 1000;
}

/* hover 时增强投影效果 */
.whisper:hover .whisper-card,
.whisper:focus .whisper-card {
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.1),
    0 12px 32px rgba(88, 116, 101, 0.15);
  /* 保持居中定位，只添加垂直偏移 */
  transform: translateX(-50%) translateY(-2px) scale(1);
}

/* 指针箭头 - 外层箭头（边框） */
.whisper-card::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--card-border, rgba(88, 116, 101, 0.2));
  margin-top: -1px;
}

/* 指针箭头 - 内层箭头（背景） */
.whisper-card::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--card-bg, var(--bg-primary, #F8F6F2));
}

/* 深色模式适配 */
.dark-theme .whisper {
  background: rgba(88, 116, 101, 0.15);
  border-color: rgba(88, 116, 101, 0.3);
}

.dark-theme .whisper:hover {
  background: rgba(88, 116, 101, 0.25);
  border-color: rgba(88, 116, 101, 0.5);
  box-shadow: 0 2px 6px rgba(88, 116, 101, 0.3);
}

.dark-theme .whisper-card {
  background: var(--card-bg, var(--bg-primary, #222221));
  border-color: var(--card-border, rgba(88, 116, 101, 0.25));
  color: var(--text-primary, #E8ECE9);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.25),
    0 8px 24px rgba(88, 116, 101, 0.15);
}

.dark-theme .whisper:hover .whisper-card,
.dark-theme .whisper:focus .whisper-card {
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 12px 32px rgba(88, 116, 101, 0.2);
}

.dark-theme .whisper-card::after {
  border-top-color: var(--card-bg, var(--bg-primary, #222221));
}

.dark-theme .whisper-card::before {
  border-top-color: var(--card-border, rgba(88, 116, 101, 0.25));
}

/* 响应式设计 - Whisper卡片移动端 */
@media (max-width: 768px) {
  .whisper-card {
    /* 移动端：至少容纳 150 个字，一行至少 8 个字符 */
    max-width: min(90vw, 50ch); /* 50ch 足够容纳 150 个字 */
    width: fit-content;
    min-width: 10ch; /* 一行至少容纳 8 个中文字符 */
    font-size: 0.85rem; /* 移动端稍小一些 */
    padding: var(--spacing-2) var(--spacing-3);
    /* 不限制高度，允许内容无限扩展 */
    max-height: none;
    line-height: 1.5;
  }
  
  .whisper {
    margin: 0 0.15em;
    min-width: 1.3em;
    min-height: 1.3em;
    padding: 0.2em 0.35em;
  }
}

