/* style.css - 公共样式文件（最终版：滚动触发时间轴动画） */
/* 1. 引入 Balloon Extra Bold 字体（放在最顶部） */
@import url('https://fonts.googleapis.com/css2?family=Balloon+Extra+Bold&display=swap');

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* 全局变量定义（主题色：黄色 #FFF000 + 黑色） */
:root {
    --primary-color: #FFF000; /* 主色调（亮黄色） */
    --primary-dark: #E6E000; /* 黄色加深（hover效果） */
    --secondary-color: #000000; /* 辅助色（黑色） */
    --text-color: #333333; /* 主要文字色 */
    --light-text: #666666; /* 次要文字色 */
    --bg-light: #f8f9fa; /* 浅背景色 */
    --white: #ffffff; /* 白色 */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影效果 */
}

/* Logo 样式（整合 Balloon Extra Bold 字体 + 图片布局） */
.logo {
    display: flex;
    align-items: center; /* 垂直居中 */
    gap: 10px;           /* 图片和文字之间距离 */
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary-color);
    /* 核心：应用 Balloon Extra Bold 字体 */
    font-family: 'Balloon Extra Bold', cursive;
}

.logo-images {
    display: flex;
    gap: -5px; /* 两张图片之间的间距 */
}

.logo-part {
    height: 50px; /* 调整两张图片高度一致 */
    object-fit: contain;
}

.logo-part:first-child {
    /* 第一张图片往右靠近第二张 */
}

.logo-part:last-child {
    margin-left:-44px;      /* 第二张图片保持原位 */
}

.logo-img {
    width: 60px;   /* 调整logo大小 */
    height: 60px;
    object-fit: contain;
}

/* Logo 内span样式（同步字体） */
.logo span {
    color: var(--primary-color);
    background-color: var(--secondary-color);
    padding: 0 8px;
    border-radius: 4px;
    margin-right: 5px;
    font-family: 'Balloon Extra Bold', cursive;
}

/* 通用样式 */
body {
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: var(--secondary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
}

/* 导航栏样式（修复active下划线问题） */
nav {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    font-weight: 500;
    transition: all 0.3s;
    padding: 5px 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

/* 强化active样式，确保下划线显示稳定 */
.nav-links a.active {
    color: var(--secondary-color);
    font-weight: 700;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    /* 新增：确保下划线层级和显示 */
    z-index: 1;
    transition: width 0.3s ease;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 滚动触发动画的时间轴样式（核心修改） */
.timeline {
    padding: 100px 0;
    overflow: hidden; /* 隐藏容器外的内容 */
    position: relative;
}

.timeline-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: var(--secondary-color);
    position: relative;
}

.timeline-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
}

/* 时间轴容器 - 移除横向滚动，改为固定宽度+溢出隐藏 */
.timeline-container {
    width: 100%;
    padding: 20px 0 40px;
    overflow: hidden; /* 隐藏超出部分，用于动画 */
}

/* 时间轴主体 - 初始状态（左移+透明），滚动后动画滑入 */
.timeline-content {
    display: flex;
    gap: 30px;
    align-items: center;
    min-width: max-content;
    padding: 0 20px;
    /* 初始状态：左移+全透明 */
    transform: translateX(-100%);
    opacity: 0;
    /* 动画参数：顺滑滑入+渐显 */
    transition:
            transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            opacity 1.2s ease;
}

/* 滚动触发后的激活状态：回到原位+完全显示 */
.timeline-content.animate {
    transform: translateX(0);
    opacity: 1;
}

/* 单个时间节点 - 初始透明，逐个渐亮 */
.timeline-item {
    flex: 0 0 300px; /* 固定宽度 */
    padding: 0;
    position: relative;
    opacity: 0; /* 初始透明 */
    transform: translateY(20px); /* 初始轻微下移 */
    /* 逐个延迟动画 */
    transition:
            opacity 0.8s ease,
            transform 0.8s ease,
            scale 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 激活后节点渐亮+归位 */
.timeline-content.animate .timeline-item {
    opacity: 1;
    transform: translateY(0);
}

/* 逐个节点延迟动画（实现依次点亮） */
.timeline-content.animate .timeline-item:nth-child(1) { transition-delay: 0.2s; }
.timeline-content.animate .timeline-item:nth-child(2) { transition-delay: 0.4s; }
.timeline-content.animate .timeline-item:nth-child(3) { transition-delay: 0.6s; }
.timeline-content.animate .timeline-item:nth-child(4) { transition-delay: 0.8s; }
.timeline-content.animate .timeline-item:nth-child(5) { transition-delay: 1.0s; }
.timeline-content.animate .timeline-item:nth-child(6) { transition-delay: 1.2s; }

/* hover 效果：放大+高亮+上浮 */
.timeline-item:hover {
    transform: translateY(-10px) scale(1.03);
    z-index: 10;
}

/* 时间节点连接线 */
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: calc(100% + 15px);
    width: 30px;
    height: 4px;
    background-color: var(--primary-color);
    transform: translateY(-50%);
    z-index: 1;
    /* 连接线也随节点动画 */
    opacity: 0;
    transition: opacity 0.8s ease;
    transition-delay: inherit; /* 继承节点的延迟 */
}

.timeline-content.animate .timeline-item:not(:last-child)::after {
    opacity: 1;
}

/* 时间节点圆点 */
.timeline-dot {
    width: 24px;
    height: 24px;
    background-color: var(--white);
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    position: absolute;
    top: 30px;
    right: -12px;
    z-index: 2;
    box-shadow: 0 0 0 4px rgba(255, 240, 0, 0.2);
    /* 圆点也随节点动画 */
    opacity: 0;
    transform: scale(0.5);
    transition:
            opacity 0.8s ease,
            transform 0.8s ease;
    transition-delay: inherit;
}

.timeline-content.animate .timeline-dot {
    opacity: 1;
    transform: scale(1);
}

/* 时间节点内容卡片 */
.timeline-content-inner {
    padding: 30px 20px 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-top: 5px solid var(--primary-color);
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

/* 年份标签 - 突出显示 */
.timeline-content-inner h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-left: 10px;
}

.timeline-content-inner h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: var(--primary-color);
}

.timeline-content-inner p {
    color: var(--light-text);
    line-height: 1.7;
}

/* 页脚样式 */
footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    color: var(--primary-color);
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    transition: background-color 0.3s;
    border: 2px solid var(--primary-color);
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

/* 响应式适配（手机端） */
@media (max-width: 768px) {
    /* 导航栏移动端 */
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px 0;
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-links li {
        margin: 10px 30px;
    }

    /* Logo 移动端缩小 */
    .logo {
        font-size: 1.8rem;
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .logo-part {
        height: 35px;
    }

    /* 时间轴移动端适配 */
    .timeline-item {
        flex: 0 0 250px; /* 移动端卡片略窄 */
    }

    .timeline-item:not(:last-child)::after {
        width: 20px; /* 移动端连接线缩短 */
        left: calc(100% + 10px);
    }

    .timeline-content-inner {
        min-height: 180px;
        padding: 25px 15px 15px;
    }

    /* 移动端动画适配：缩短动画时间 */
    .timeline-content {
        transition:
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 1s ease;
    }
}