/* 全局重置 + 基础样式（所有页面共用） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
html {
    scroll-behavior: smooth; /* 平滑滚动 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar {
    display: none;
}

/* 标准化页面布局（核心：所有页面统一的flex布局） */
body {
    color: #333;
    background-color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 0;
    /* 全局flex布局：区分头部/内容/底部 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

/* 页面容器：所有页面的内容区都用这个类 */
.page-container {
    flex: 1; /* 占满除header/footer外的所有高度 */
    width: 100%;
}

/* 全屏区块样式（index/404的核心内容区共用） */
.full-screen {
    height: 100%; /* 继承page-container的高度，不是100vh */
    min-height: calc(100vh - 80px - 80px); /* 预留header(80px)+footer(80px) */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* 头部导航（全局统一） */
.header {
    height: 80px;
    line-height: 80px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}
.header.scrolled {
    background-color: rgba(0, 0, 0, 0.8);
    height: 70px;
    line-height: 70px;
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.logo img {
    height: 40px;
    vertical-align: middle;
    transition: height 0.3s ease;
}
.header.scrolled .logo img {
    height: 36px;
}
.nav-list {
    display: flex;
    list-style: none;
    gap: 40px;
}
.nav-item a {
    font-size: 16px;
    color: #fff;
    transition: color 0.3s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: relative;
    padding: 5px 0;
    text-decoration: none !important; /* 移除默认下划线 */
}
/* 修复：仅hover/active时显示下划线，默认无 */
.nav-item a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0; /* 默认宽度0，不显示 */
    height: 2px;
    background-color: #ffffff;
    transition: width 0.3s ease;
}
.nav-item a.active::after, .nav-item a:hover::after {
    width: 100%; /* hover/active时宽度100%，显示下划线 */
}
.nav-item a.active, .nav-item a:hover {
    color: #ffffff;
}

/* 移动端汉堡按钮（全局统一） */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1000;
    position: relative;
}
.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.menu-toggle span:nth-child(1) { top: 12px; }
.menu-toggle span:nth-child(2) { top: 19px; }
.menu-toggle span:nth-child(3) { top: 26px; }
.menu-toggle.active span:nth-child(1) {
    top: 19px;
    transform: translateX(-50%) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    top: 19px;
    transform: translateX(-50%) rotate(-45deg);
}

/* 底部样式（全局统一，所有页面footer高度一致） */
.footer {
    height: auto; /* 由内容决定高度，不再强制100vh */
    min-height: 80px; /* 基础高度，和index一致 */
    width: 100%;
    background-color: #2D3748;
    color: #E2E8F0;
    padding: 20px 0;
    flex-shrink: 0; /* 禁止footer被压缩 */
}
.footer .section-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    margin: 0 auto;
    text-align: center;
}
.footer-bottom {
    font-size: 14px;
    color: #A0AEC0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* 回到顶部按钮（全局统一） */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    z-index: 998;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top::after {
    content: '';
    width: 6px;
    height: 6px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: rotate(-45deg) translateY(1.5px) translateX(-1.5px);
}
.back-to-top:hover {
    background-color: #e51b44;
}

/* 区块内容容器（全局统一） */
.section-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* 响应式适配（全局统一） */
@media (max-width: 768px) {
    /* 移动端header高度 */
    .header { 
        height: 60px; 
        line-height: 60px; 
    }
    .header.scrolled {
        height: 55px;
        line-height: 55px;
    }
    /* 移动端全屏区块高度 */
    .full-screen {
        min-height: calc(100vh - 60px - 60px); /* 适配移动端header/footer */
    }
    /* 移动端导航菜单 */
    .nav-list {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        background-color: rgba(0, 0, 0, 0.9);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        transform: translateX(100%);
        transition: transform 0.4s ease;
        z-index: 999;
        padding: 20px;
    }
    .nav-list.active {
        transform: translateX(0);
    }
    .nav-item a {
        font-size: 18px;
    }
    /* 显示移动端菜单按钮 */
    .menu-toggle {
        display: flex;
    }
    /* 移动端footer高度 */
    .footer {
        min-height: 60px;
        padding: 15px 0;
    }
}

/* 404页面基础样式（仅布局，背景图已内置在404.html） */
.error-section {
    color: #fff;
}
/* 移动端404基础适配 */
@media (max-width: 768px) {
    .error-message { font-size: 28px; }
    .home-btn { 
        width: 140px;
        padding: 10px 0; 
        font-size: 16px; 
    }
}
