/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Cookie", "Alibaba PuHuiTi", Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    /* 主色调 */
    --primary-bg: #0f240e;
    --primary-accent: #c0392b; /* logo、强调色 Logo（navbar-logo）*/

    /* 辅助色 */
    --accent-pattern: #f8c98b; /* 花纹、时间线 */
    --accent-heart: #ff6b81; /* 爱心装饰 */
    --accent-hover: #c0392b; /* 菜单hover文字 ，导航链接（nav-link）*/
    --accent-text-layer: #ffc776;

    /* 中性色 */
    --neutral-light: #f8e0bd; /* 米白文字，主标题（main-title） */
    --neutral-brown: #a68d7c; /* 浅棕辅助 */
    --neutral-dark: #c7d810; /* 深棕菜单文字。导航链接（nav-link）时间树浏览 */
    --neutral-card: rgba(74, 52, 42, 0.95); /* 卡片背景 */
    --neutral-footer: #333; /* 页脚背景 */

    /* 功能色 - 方案2：遮罩适中（0.5），强化边界融合 */
    --shadow-color: rgba(0, 0, 0, 0.05);
    --mask-color: rgba(0, 0, 0, 0.5); /* 透明度0.5，遮罩更明显 */

    /* 布局变量 */
    --border-width: 1px;
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
}

/* 页面基础样式 */
body {
    background: var(--primary-bg);
    color: var(--neutral-light);
    line-height: 1.8;
    margin: 0;
    padding: 0;
}

/* 导航栏样式 */
.navbar {
    padding: 20px 40px;
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.1);
    background-image: url("../images/waken_flower.jpg");
    background-size: 100% auto;
    background-repeat: no-repeat;
    background-position: center 45%;
    top: 0;
    width: 100%;
    z-index: 3000;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 0 20px var(--shadow-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    transition: transform 0.3s ease-in-out;
}
.navbar.hide {
    transform: translateY(-100%);
}
.navbar-logo {
    color: var(--primary-accent);
    font-size: 3rem;
    font-family: "Times New Roman", Times, serif;
    margin: 0;
}
.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    width: 100%;
}
.nav-link {
    text-decoration: none;
    color: var(--neutral-dark);
    font-size: 1.3rem;
    transition: all 0.4s ease-out;
    text-shadow:
        0 2px 2px rgba(255, 255, 255, 0.3),
        0 4px 6px rgba(255, 192, 203, 0.5);
    position: relative;
}
.nav-link:hover {
    transform: scale(1.15) rotate(3deg);
    color: var(--accent-hover);
    text-shadow:
        0 0 15px rgba(255, 225, 235, 0.8),
        0 5px 10px rgba(255, 160, 176, 0.6);
}
.nav-link::after {
    content: "\2665\0020";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    color: var(--accent-heart);
    opacity: 0;
    transition:
        opacity 0.3s,
        transform 0.3s;
}
.nav-link:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
}
.mobile-menu-btn {
    display: none;
    color: var(--neutral-light);
    font-size: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* 头部视觉区样式 - 方案2：渐变过渡更紧凑，强化边界融合 */
.header-art {
    text-align: center;
    padding: 0;
    position: relative;
}
.header-art-optimized {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 4px;
    min-height: 70vh;
    overflow: hidden;
}
.header-border {
    position: absolute;
    inset: 8px;
    z-index: 10;
    border: var(--border-width) solid var(--accent-pattern) / 20;
    border-radius: var(--radius-md);
    pointer-events: none;
}
.bg-layer {
    position: absolute; /* 关键：让伪元素相对于图片容器定位 */
    inset: 0;
    z-index: 0;
}
.bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* 新增：图片上下边缘渐变透明遮罩（直接作用于图片） */
.bg-layer::after {
    content: "";
    position: absolute;
    inset: 0; /* 覆盖整个图片 */
    z-index: 1; /* 位于图片上方，不遮挡其他层 */
    /* 渐变逻辑：顶部和底部用背景色渐变覆盖，中间保持图片清晰 */
    background: linear-gradient(
        to bottom,
        var(--primary-bg) 0%,
        /* 顶部完全显示背景色 */ transparent 20%,
        /* 向上20%过渡到透明（图片逐渐显示） */ transparent 80%,
        /* 中间60%保持透明（图片完全显示） */ var(--primary-bg) 100% /* 底部80%开始过渡，100%完全显示背景色 */
    );
}

.text-layer {
    color: var(--accent-text-layer);

    position: relative;
    z-index: 20;
    text-align: center;
    padding: 4px;
    max-width: 4xl;
    margin: 0 auto;
}
.decor-top {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: -0.1rem;
}

.decor-line {
    width: 6rem;
    height: 2px;
    background-color: rgba(248, 201, 182);
}

/* 顶部花朵装饰 */
.decor-flower {
    margin: 0 0.75rem;
    color: var(--accent-pattern);
    font-size: 1.8rem; /* 比原来心形稍大，更醒目 */
    text-shadow: 0 0 10px rgba(248, 201, 139);
}

/* 底部小叶片装饰 */
.decor-flower-sm {
    color: var(--accent-pattern);
    font-size: 1.1rem;
}

.main-title {
    /* 字体选择：优先复古装饰性衬线字体，兼顾中文字体适配 */
    font-family: "Playfair Display", "Ma Shan Zheng", "Times New Roman", serif;
    /* Playfair Display：西方古典印刷风，有优雅的衬线装饰；
       Ma Shan Zheng：中文毛笔书法体，增强东方艺术感 */

    font-weight: 60; /* 稍轻于bold，避免过于厚重 */
    color: var(--neutral-light);
    margin-bottom: 1rem;
    line-height: 1.1; /* 更紧凑的行高，强化标题力量感 */
    font-size: clamp(3.2rem, 12vw, 6rem); /* 稍放大尺寸，增强视觉冲击 */

    /* 字间距：舒展文字，增强艺术呼吸感 */
    letter-spacing: 0.03em;

    /* 阴影升级：多层渐变阴影，模拟「立体浮雕」效果 */
    text-shadow:
        4px 1px 7px rgba(74, 52, 42, 0.8),
        /* 底层深色阴影，增强轮廓 */ 0 0 15px rgba(248, 224, 189, 0.6),
        /* 中层发光效果，模拟光晕 */ 0 0 30px rgba(248, 201, 139, 0.3); /* 外层弱光，增加氛围感 */

    /* 可选：添加轻微倾斜，增强动态感（根据风格调整） */
    /*transform: skew(-2deg);*/
}
.sub-title {
    /* 字体选择：替代Cookie，用更流畅/更有笔触感的手写体 */
    font-family: "Great Vibes", "ZCOOL XiaoWei", cursive;
    /* Great Vibes：西方优雅连笔手写体，线条流畅；
       ZCOOL XiaoWei：中文清新手写体，笔触自然 */

    color: rgb(255, 196, 117); /* 稍提高饱和度，增强辨识度 */
    line-height: 1.6; /* 稍松散，体现手写随性 */
    font-size: clamp(1.4rem, 2vw, 2rem); /* 放大尺寸，拉近与主标题的视觉权重 */

    /* 字间距：手写体特有的松散感 */
    word-spacing: 0.1em;
    letter-spacing: 0.02em;

    /* 阴影优化：模拟「手写笔迹反光」效果 */
    text-shadow:
        0 1px 2px rgba(74, 52, 42, 0.3),
        /* 轻微投影，避免轻浮 */ 0 0 8px rgba(248, 201, 139, 0.5); /* 同色系光晕，增强温暖感 */

    /* 可选：添加轻微上下波动，模拟手写自然倾斜 */
    /*transform: rotate(1deg); */
}
.decor-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2.5rem;
    gap: 0.75rem;
}

/* section标题样式 */
.section-title {

    text-align: center;
    margin-bottom: var(--spacing-lg);
}
.section-title h2 {
    font-family: "Ma Shan Zheng", cursive;
    font-size: 3rem;
    font-weight: bold;
    color: var(--neutral-dark);
    margin-bottom: var(--spacing-sm);
}
.section-title p {
    font-family: "Ma Shan Zheng", cursive;
    font-size: 1.1rem;
    color: var(--neutral-brown);
    max-width: 2xl;
    margin: 0 auto;
}





/* 页脚样式 */
.footer {
    background: var(--neutral-footer);
    color: var(--neutral-light);
    padding: 3rem 0;
    position: relative;
    margin-top: 4rem;
}
.footer-bg {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background: url("https://picsum.photos/id/1068/1920/1080") center/cover no-repeat;
}
.footer-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}
.footer-slogan {
    margin-bottom: var(--spacing-lg);
}
.footer-slogan p {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}
.footer-domain {
    color: var(--accent-pattern);
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: var(--spacing-lg);
}
.social-link {
    color: var(--neutral-light);
    font-size: 1.5rem;
    transition: color 0.3s;
}
.social-link:hover {
    color: var(--accent-pattern);
}
.copyright {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--primary-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: var(--primary-accent) / 90;
}

/* 移动端适配（≤768px） */
@media (max-width: 768px) {
    /* 导航栏 */
    .navbar {
        padding: 15px 20px;
        background-size: 150% auto;
        background-position: center 40%;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        box-shadow: 0 0 15px var(--shadow-color);
        flex-direction: row;
        justify-content: space-between;
    }
    .nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    .navbar-logo {
        font-size: 1.5rem;
    }
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 15px;
        margin-top: 10px;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(5px);
        padding: 1rem;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
    .nav-menu.show {
        display: flex;
    }
    .nav-link {
        font-size: 1rem;
        text-align: center;
    }
    .mobile-menu-btn {
        display: block;
    }

    /* 头部渐变（移动端保持方案2效果） */
    .header-art-optimized .blend-gradient {
        background: linear-gradient(
            to bottom,
            var(--mask-color) 0%,
            transparent 20%,
            transparent 80%,
            var(--mask-color) 100%
        );
    }


}



/* 核心模块样式 - 全设备并排显示 */
.modules-container {
    display: flex;
    flex-wrap: nowrap; /* 禁止换行，强制并排 */
    gap: 0.8rem;
    margin: 0 auto 3rem;
    padding: 0 0.5rem;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.module-item {
    flex: 1 1 33.333%; /* 平均分配宽度 */
    min-width: 0;
    text-align: center;
    padding: 1rem 0.6rem;
    border-radius: 6px;
    background-color: rgba(222, 237, 143, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.module-item.active {
    background-color: #ffff97;
    border: 1.5px solid #c2996c;
    box-shadow: 0 3px 10px rgba(194, 153, 108, 0.12);
}

.module-item.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #c2996c;
}

.module-icon {
    font-size: 1.6rem;
    color: #a67c52;
    margin-bottom: 0.5rem;
}

.module-title {
    font-family: "Ma Shan Zheng", cursive;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-desc {
    color: #666;
    line-height: 1.3;
    font-size: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

