/* =========================================
   1. 全局变量定义 (Variables) - 整个网站的调色盘
   ========================================= */
:root {
    /* --- 浅色马卡龙色系 --- */
    --pastel-blue: #74b9ff; 
    --pastel-pink: #ffafbd;
    --pastel-light: #ffdf87;

    /* --- 渐变色变量 --- */
    --gradient-split: linear-gradient(135deg, var(--pastel-pink), var(--pastel-blue));
    
    /* --- 文字颜色 --- */
    --text-main: #57606f; 
    --text-light: #747d8c;
    
    /* --- 玻璃效果变量 (用于导航栏、卡片等) --- */
    --glass-nav: rgba(255, 255, 255, 0.4); 
    --glass-card: rgba(255, 255, 255, 0.85);
    --glass-btn: rgba(255, 255, 255, 0.6);
    --glass-border: 1px solid rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 8px 32px 0 rgba(200, 200, 200, 0.2);
}

/* =========================================
   1.5 页面级主题变量 (Page Theme Variables)
   根据每个页面 body 的 class 自动切换网站的主色调！
   ========================================= */
body.theme-home       { --theme-color: #e0c3fc; } /* 主页：珍珠紫 */
body.theme-green      { --theme-color: #55efc4; } /* Pack1：薄荷绿 */
body.theme-blue       { --theme-color: #74b9ff; } /* Pack2：冰蓝色 */
body.theme-pink       { --theme-color: #ffafbd; } /* Pack3：白桃粉 */
body.theme-yellow     { --theme-color: #ffeaa7; } /* Pack4：暖阳黄 */
body.theme-collection { --theme-color: #81ecec; } /* 典藏页：深海凝霜 */

/* =========================================
   2. 全局重置与基础样式 (Global & Reset)
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 隐藏系统默认的丑陋滚动条，保持页面整洁 */
html, body {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: var(--text-main);
    line-height: 1.7;
    background-image: url('../images/bg.png'); /* 网页全局星空/渐变背景 */
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
}

/* 通用居中容器，限制网页最大宽度 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* =========================================
   3. 导航栏样式 (Navigation)
   ========================================= */
header {
    background: rgba(255, 255, 255, 0.05); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: 100%;
    padding: 1.2rem 0;
    position: sticky; /* 吸顶效果 */
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15); 
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 3rem;
}

nav a {
    color: #ffffff; 
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* 导航栏底部的流光线条 (默认缩放为0隐藏) */
nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    transform: scaleX(0); 
    transform-origin: center;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 鼠标悬停时，线条向两边展开 */
nav a:hover::after {
    transform: scaleX(1);
}

/* --- 导航栏各频道的专属发光颜色 --- */
/* 1. 首页 */
nav ul li:nth-child(1) a:hover, nav ul li:nth-child(1) a.active { color: #e0c3fc; text-shadow: 0 0 15px rgba(224, 195, 252, 0.9); }
nav ul li:nth-child(1) a::after { background: #e0c3fc; }

/* 2. 香草纪元 */
nav ul li:nth-child(2) a:hover, nav ul li:nth-child(2) a.active { color: #55efc4; text-shadow: 0 0 15px rgba(85, 239, 196, 0.9); }
nav ul li:nth-child(2) a::after { background: #55efc4; }

/* 3. 海洋方块2 */
nav ul li:nth-child(3) a:hover, nav ul li:nth-child(3) a.active { color: #74b9ff; text-shadow: 0 0 15px rgba(116, 185, 255, 0.9); }
nav ul li:nth-child(3) a::after { background: #74b9ff; }

/* 4. 宁然一隅 */
nav ul li:nth-child(4) a:hover, nav ul li:nth-child(4) a.active { color: #ffafbd; text-shadow: 0 0 15px rgba(255, 175, 189, 0.9); }
nav ul li:nth-child(4) a::after { background: #ffafbd; }

/* 5. 农场物语 */
nav ul li:nth-child(5) a:hover, nav ul li:nth-child(5) a.active { color: #ffeaa7; text-shadow: 0 0 15px rgba(255, 234, 167, 1.0); }
nav ul li:nth-child(5) a::after { background: #ffeaa7; }

/* 6. 典藏合照 */
nav ul li:nth-child(6) a:hover, nav ul li:nth-child(6) a.active { color: #81ecec; text-shadow: 0 0 15px rgba(129, 236, 236, 0.8); }
nav ul li:nth-child(6) a::after { background: #81ecec; }

/* =========================================
   4. 标题动画与样式 (Typography)
   ========================================= */

/* A. 首页大标题：流动的渐变紫 */
.home-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #e0c3fc; 
    text-shadow: 0 0 10px rgba(224, 195, 252, 0.6);
}

.home-title span {
    background: linear-gradient(135deg, #e0c3fc 0%, #ffffff 50%, #a29bfe 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 10px rgba(162, 155, 254, 0.4));
    animation: gradientFlow 6s ease-in-out infinite;
}

/* B. 各整合包通用大标题 */
.page-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--pastel-blue); 
    text-shadow: 2px 2px 0px white, 4px 4px 0px rgba(0,0,0,0.1);
}

/* 典藏合照页专属发光标题 */
body.theme-collection .page-title {
    color: var(--theme-color);
    text-shadow: 0 0 20px rgba(129, 236, 236, 0.8);
    margin-bottom: 3rem;
}

/* C. 通用小标题样式 */
h2 {
    color: var(--pastel-pink);
    margin-bottom: 1.2rem;
    border-bottom: 3px dotted var(--pastel-pink);
    display: inline-block;
    padding-bottom: 5px;
}
h3 {
    color: var(--pastel-blue);
    margin-top: 1.5rem;
}

/* =========================================
   5. 组件：顶部剧情介绍卡片 (Intro Card)
   ========================================= */
.intro-card {
    background: rgba(255, 255, 255, 0.08); 
    backdrop-filter: blur(4px); 
    -webkit-backdrop-filter: blur(4px);
    border: 5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 1000px;
    margin: 0 auto 3rem auto;
    padding: 3rem;
    border-radius: 25px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 鼠标悬停时的立体浮起效果 */
.intro-card:hover {
    transform: translateY(-10px); 
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.intro-card p, .intro-card li { color: white; font-size: 1.05rem; line-height: 1.8; }

/* 粗体和标题自动读取当前页面的主题色 */
.intro-card strong { color: var(--theme-color); font-weight: 800; text-shadow: none; }
.intro-card h2 { color: var(--theme-color); border-bottom: 2px dashed var(--theme-color); display: inline-block; }
.intro-card h3 { color: var(--theme-color); margin-top: 2rem; }

/* =========================================
   6. 组件：相册网格 (Gallery) - 瀑布流排版
   ========================================= */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* 单张相片画框 */
.screenshot {
    background: rgba(255, 255, 255, 0.1);
    border: 4px solid rgba(255, 255, 255, 0.2); 
    border-radius: 20px;
    overflow: hidden;
    position: relative; 
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    cursor: pointer; 
    /* 防止内部图片在做放大动画时溢出圆角 */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

/* 默认照片悬停效果（会有俏皮的歪头动作） */
.screenshot:hover {
    transform: rotate(2deg) scale(1.03);
    border-color: var(--theme-color); 
    box-shadow: 0 10px 30px var(--theme-color); 
    z-index: 10;
}

.screenshot img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 16px;
}

.screenshot:hover img {
    transform: scale(1.05);
}

/* 悬停浮现的黑色半透明文字遮罩 */
.caption {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center; justify-content: center;
    padding: 1.5rem;
    color: white; 
    font-size: 1.05rem; font-weight: bold;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    text-align: center;
    opacity: 0; /* 默认隐藏 */
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.screenshot:hover .caption {
    opacity: 1;
}

/* =========================================
   独立组件：图片放大灯箱 (Lightbox)
   ========================================= */
#lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center; align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    opacity: 1;
    pointer-events: all;
    cursor: zoom-out; 
}

#lightbox img {
    max-width: 90%;
    max-height: 90vh; 
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5), 0 0 20px rgba(255, 243, 173, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    border: 4px solid white;
}

#lightbox.active img { transform: scale(1); }

/* =========================================
   7. 组件：通用磨砂玻璃按钮 (目前页面暂未用到，作为储备)
   ========================================= */
.btn {
    display: inline-block; padding: 1rem 3rem; text-decoration: none;
    border-radius: 50px; font-weight: bold; font-size: 1.1rem; color: white; 
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.5); 
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.25); border: 1px solid rgba(255, 255, 255, 0.8);
    color: var(--theme-color); box-shadow: 0 10px 30px var(--theme-color);
}
.btn:active { transform: scale(0.96); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }

/* =========================================
   8. 关键帧动画 (Animations)
   ========================================= */
@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* =========================================
   9. 页面特定样式：模组特性网格 (Features Grid)
   ========================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 2rem;
    margin-top: 2rem;
}

.feature-box {
    background: rgba(255, 255, 255, 0.08); 
    backdrop-filter: blur(4px); 
    -webkit-backdrop-filter: blur(4px);
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
    padding: 2rem; color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.feature-box:hover {
    transform: translateY(-10px); 
    background: rgba(255, 255, 255, 0.15);
}

.feature-box h3 {
    margin-top: 0; font-size: 1.4rem; margin-bottom: 1rem;
    padding-bottom: 0.5rem; display: block;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.3);
}

.feature-box p { font-size: 0.95rem; margin-bottom: 1rem; color: white; }
.feature-box ul { list-style: none; padding-left: 0; }
.feature-box li {
    font-size: 0.9rem; margin-bottom: 0.5rem; padding-left: 1.2rem;
    position: relative; color: white; 
}
.feature-box li::before { content: '•'; position: absolute; left: 0; font-weight: bold; }

/* 专门给不同特性卡片设定的高亮颜色 */
.box-green h3 { color: #55efc4; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.box-green li::before { color: #55efc4; }
.box-green:hover { border-color: #55efc4; box-shadow: 0 10px 30px rgba(85, 239, 196, 0.3); }

.box-red h3 { color: #ff7675; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.box-red li::before { color: #ff7675; }
.box-red:hover { border-color: #ff7675; box-shadow: 0 10px 30px rgba(255, 118, 117, 0.3); }

.box-blue h3 { color: #74b9ff; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.box-blue li::before { color: #74b9ff; }
.box-blue:hover { border-color: #74b9ff; box-shadow: 0 10px 30px rgba(116, 185, 255, 0.3); }

.box-pink h3 { color: #fdcb6e; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.box-pink li::before { color: #fdcb6e; }
.box-pink:hover { border-color: #fdcb6e; box-shadow: 0 10px 30px rgba(253, 203, 110, 0.3); }

/* =========================================
   10. 精彩瞬间 & 主题色文字高亮强制覆盖
   ========================================= */
.gallery-title {
    display: table;
    margin: 5rem auto 2rem auto; 
    color: #fff3ad; 
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    border-bottom: 3px dotted #fff3ad;
    padding-bottom: 5px;
}

.theme-green { color: #55efc4 !important; text-shadow: 0 0 10px rgba(85, 239, 196, 0.4); border-color: #55efc4 !important; }
.theme-blue { color: #74b9ff !important; text-shadow: 0 0 10px rgba(116, 185, 255, 0.4); border-color: #74b9ff !important; }
.theme-pink { color: #ffafbd !important; text-shadow: 0 0 10px rgba(255, 175, 189, 0.4); border-color: #ffafbd !important; }
.theme-yellow { color: #ffeaa7 !important; text-shadow: 0 0 10px rgba(255, 234, 167, 0.4); border-color: #ffeaa7 !important; }

/* =========================================
   11. 专属卡片光晕 (结合各页面的主题色)
   ========================================= */
.home-card:hover { border-color: rgba(224, 195, 252, 0.8); box-shadow: 0 20px 40px rgba(224, 195, 252, 0.4); }
.card-green:hover { border-color: rgba(85, 239, 196, 0.8); box-shadow: 0 20px 40px rgba(85, 239, 196, 0.4); }
.card-blue:hover { border-color: rgba(116, 185, 255, 0.8); box-shadow: 0 20px 40px rgba(116, 185, 255, 0.4); }
.card-pink:hover { border-color: rgba(255, 175, 189, 0.8); box-shadow: 0 20px 40px rgba(255, 175, 189, 0.4); }
.card-yellow:hover { border-color: rgba(255, 234, 167, 0.8); box-shadow: 0 20px 40px rgba(255, 234, 167, 0.4); }

/* =========================================
   12. 独立组件：动态生长时间轴 (Scroll Reveal Timeline)
   ========================================= */
.timeline {
    position: relative; max-width: 1000px; margin: 0 auto;
    padding: 5rem 0; /* 上下留白出引导线 */
    overflow: hidden; 
}

/* 中央半透明白线轨道 */
.timeline::after {
    content: ''; position: absolute; width: 2px; 
    background: rgba(255, 255, 255, 0.1); 
    top: 0; bottom: 0; left: 50%; margin-left: -1px;
}

/* 时间节点布局 */
.timeline-item { padding: 20px 40px; position: relative; width: 50%; box-sizing: border-box; }
.timeline-item.left { left: 0; padding-right: 60px; text-align: right; }
.timeline-item.right { left: 50%; padding-left: 60px; }

/* 伪造的发光白点 */
.timeline-item::after {
    content: ''; position: absolute; width: 12px; height: 12px;
    background: #fff; border-radius: 50%; top: 36px; z-index: 2;
    transform: scale(0); /* 默认隐藏 */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8); 
}

/* 延伸的横向白线 */
.timeline-item::before {
    content: ''; position: absolute; height: 2px; background: #fff; 
    top: 41px; width: 0%; z-index: 1; transition: width 0.6s ease-in-out; 
}

.timeline-item.left::after { right: -6px; } 
.timeline-item.left::before { right: 0; }   
.timeline-item.right::after { left: -6px; } 
.timeline-item.right::before { left: 0; }   

/* 初始隐藏内容卡片 */
.timeline-content {
    position: relative; opacity: 0; transform: translateY(30px); 
    transition: all 0.6s ease-out; transition-delay: 0.3s; 
}

/* --- JS 触发后的激活状态 --- */
.timeline-item.is-visible::after { transform: scale(1); }
.timeline-item.is-visible::before { width: 60px; }
.timeline-item.is-visible .timeline-content { opacity: 1; transform: translateY(0); }

/* 典藏页微型画廊布局 */
.timeline-gallery {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem; margin-top: 1rem;
}
.timeline-gallery .screenshot img { height: 180px; }

.timeline-date {
    display: inline-block; padding: 0.4rem 1.2rem; margin-bottom: 1rem;
    background: var(--theme-color); color: #1a1a1a; font-weight: bold;
    border-radius: 50px; font-size: 0.9rem; box-shadow: 0 4px 10px rgba(129, 236, 236, 0.4);
}

/* =========================================
   13. 手机端响应式适配 (Mobile Responsive)
   ========================================= */
@media (max-width: 768px) {
    /* 导航栏适配：允许横向滑动 */
    nav ul {
        justify-content: flex-start; gap: 1.5rem; padding: 0 1.5rem; 
        overflow-x: auto; -webkit-overflow-scrolling: touch; 
    }
    nav ul::-webkit-scrollbar { display: none; }
    nav a { font-size: 1rem; white-space: nowrap; }
    header { padding: 0.8rem 0; }

    /* 时间轴适配：变单列 */
    .timeline::after { left: 30px; } 
    .timeline-item { width: 100%; text-align: left; padding-left: 70px; padding-right: 20px;}
    .timeline-item.right { left: 0; }
    .timeline-item.left::after, .timeline-item.right::after { left: 24px; right: auto; }
    .timeline-item.left::before, .timeline-item.right::before { left: 30px; right: auto; }
    .timeline-content { transition-delay: 0.2s; }
}

/* =========================================
   14. 全局组件：音乐悬浮按钮
   ========================================= */
.music-toggle {
    position: fixed;
    top: 90px; /* 完美避开顶部的导航栏 */
    right: 20px;
    z-index: 9999;
    width: 45px; height: 45px;
    background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.music-toggle:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.1); }
.music-toggle.playing { animation: spin 4s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

@media (max-width: 768px) {
    .music-toggle { top: 75px; right: 15px; width: 40px; height: 40px; font-size: 1rem; }
}

/* =========================================
   ✨ 四大整合包通用动画：深海上浮 (Scroll Reveal)
   ========================================= */
.gallery .screenshot {
    opacity: 0; transform: translateY(80px) scale(0.95);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
}
.gallery .screenshot.is-visible {
    opacity: 1; transform: translateY(0) scale(1);
}
.gallery .screenshot:nth-child(1) { transition-delay: 0.0s; }
.gallery .screenshot:nth-child(2) { transition-delay: 0.1s; }
.gallery .screenshot:nth-child(3) { transition-delay: 0.2s; }
.gallery .screenshot:nth-child(4) { transition-delay: 0.3s; }
.gallery .screenshot:nth-child(5) { transition-delay: 0.4s; }
.gallery .screenshot:nth-child(6) { transition-delay: 0.5s; }


/* =========================================
   15. 典藏页专属修正：照片平稳悬停 (直上直下)
   ========================================= */
/* 覆盖原本第6节里 .screenshot:hover 的“歪头”动作，改为像卡片一样平稳上浮 */
.timeline-content .screenshot:hover {
    transform: translateY(-8px); /* 纯粹向上平移 8px，完全不歪 */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4); /* 加深底部阴影，增强立体悬浮感 */
    z-index: 10;
}

/* 防止内部图片再次被外层动画干扰，做极其轻微的呼吸放大 */
.timeline-content .screenshot:hover img {
    transform: scale(1.02);
}