/* style.css - 简约黑白色调与转场动画 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 保持垂直滚动条稳定，避免页面切换时因滚动条出现/消失导致水平位移 */
html {
    overflow-y: scroll;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* 导航栏（电脑端默认样式） */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #eaeaea;
    z-index: 1000;
    padding: 0.75rem 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lab-logo {
    flex-shrink: 0;
    margin-right: auto;
    /* 可选，与 space-between 同时使用效果相同 */
}

.lab-logo img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    color: #2c2c2c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s, border-bottom 0.2s;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.nav-active {
    font-weight: 500;
    color: #000000;
    border-bottom-color: #000000;
}

.nav-link:hover {
    color: #000000;
    border-bottom-color: #000000;
}

/* 默认隐藏固定 Logo（电脑端不显示） */
.mobile-fixed-logo {
    display: none;
}

/* ========== 手机端汉堡菜单样式（替换原竖向排列） ========== */
@media (max-width: 680px) {
    .mobile-fixed-logo {
        display: block;
        position: fixed;
        top: 0.8rem;
        right: 1rem;
        z-index: 1002;
        width: 40px;
        /* 明确容器宽度 */
        height: 40px;
        /* 明确容器高度 */
    }

    .mobile-fixed-logo a {
        display: block;
        width: 100%;
        height: 100%;
        text-decoration: none;
    }

    .mobile-fixed-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        /* 保证图片等比缩放不裁剪 */
        display: block;
    }

    .navbar.open~.mobile-fixed-logo {
        z-index: 998;
    }

    /* 隐藏导航栏内的原有 Logo */
    .navbar .lab-logo {
        display: none;
    }

    /* 侧滑菜单中的链接改为垂直排列 */
    .nav-links {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        align-items: flex-end;
        /* 新增：让链接整体右对齐 */
    }

    /* 汉堡菜单按钮 */
    .menu-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        width: 44px;
        height: 44px;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .menu-toggle:hover {
        background: #f5f5f5;
        border-color: #111;
    }

    .menu-toggle span {
        display: block;
        width: 22px;
        height: 0;
        /* 高度归零，靠 border 撑开 */
        border-top: 2px solid;
        /* 线宽2px，颜色继承自 color */
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    /* 汉堡菜单动画：点击后变成 X */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* 导航栏 - 侧滑面板（初始隐藏） */
    .navbar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(16px);
        padding: 4rem 1.5rem 2rem;
        transition: left 0.3s ease;
        box-shadow: none;
        border-right: 1px solid #eaeaea;
        z-index: 1000;
    }

    .navbar.open {
        left: 0;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.08);
    }

    .nav-container {
        flex-direction: column;
        align-items: stretch;
        /* 关键：让所有子元素（Logo 和链接）都靠右 */
        gap: 0.75rem;
        justify-content: flex-start;
        padding: 0;
    }

    .nav-link {
        display: block;
        text-align: right;
        padding: 0.8rem 0.5rem;
        white-space: normal;
        border-bottom: none;
        background: transparent;
        border-radius: 8px;
        transition: background 0.2s;
        font-size: 1rem;
    }

    .nav-link:hover,
    .nav-active {
        background: #f0f0f0;
        border-bottom: none;
        color: #000;
    }

    /* 遮罩层（点击关闭菜单） */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* 调整 body，为汉堡菜单留出空间 */
    body {
        padding-top: 64px;
    }
}

/* 电脑端隐藏汉堡菜单按钮和遮罩层 */
@media (min-width: 681px) {
    .menu-toggle {
        display: none;
    }

    .menu-overlay {
        display: none;
    }
}


/* 全站内容容器 */
.container {
    max-width: 1200px;
    margin: 64px auto 0;
    padding: 2rem;
    box-sizing: border-box;
}

/* 主内容顶部留出导航栏空间 */
main,
.container,
.main-container {
    margin-top: 64px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid #ececec;
    color: #6c6c6c;
    font-size: 0.85rem;
}

/* 转场动画 */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.9, 0.4, 1.1), transform 0.7s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 页面转场动画 - 仅淡入淡出 */
.page-transition {
    animation: fadeIn 1.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-out {
    animation: fadeOut 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

main,
.container,
.footer {
    animation: none;
}

/* 研究页卡片样式 */
.papers-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 2rem;
    border-left: 4px solid #111;
    padding-left: 1rem;
}


/* 团队成员网格 */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.team-card {
    text-align: center;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #f5f5f5;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #333;
    border: 1px solid #e0e0e0;
}

/* EvoMass 页样式 */
.download-card,
.video-card {
    background: #fafafa;
    border: 1px solid #eaeaea;
    padding: 2rem;
    margin-bottom: 3rem;
    text-align: center;
    transition: transform 0.2s;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.btn {
    display: inline-block;
    background: #111;
    color: white;
    padding: 0.8rem 2rem;
    text-decoration: none;
    margin-top: 1rem;
    border: none;
    transition: background 0.2s;
}

.btn:hover {
    background: #333;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-top: 1.5rem;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 统一页面标题样式 */
.container .page-title,
.container .section-title,
.container .tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.9rem 0 0.75rem;
    line-height: 1.12;
}

.page-header,
.tool-header,
.section-title {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* ========== 响应式 - 手机端（内容区域调整） ========== */
@media (max-width: 768px) {

    /* 重置 .container 和 main 的 margin-top，避免与 body padding-top 叠加 */
    .container {
        margin-top: 0 !important;
        padding: 1rem;
    }

    main,
    .main-container {
        margin-top: 0 !important;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .container .page-title {
        font-size: 1.6rem;
    }

    .team-grid {
        gap: 1.5rem;
    }
}

/* 强制所有页面统一滚动条样式，避免宽度变化 */
* {
    scrollbar-width: thin;
    /* Firefox: 设置滚动条为细窄样式 */
}

/* WebKit 浏览器 (Chrome, Edge, Safari) 自定义滚动条样式，固定宽度 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* ========== 统一页面头部样式 (.page-header) ========== */
.page-header {
    text-align: left;
    padding: 2rem 0 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eaeaea;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
}

.page-header .subtitle {
    font-size: 1.1rem;
    color: #6c6c6c;
    max-width: 700px;
    margin: 0 auto;
}

.chn-text {
    color: #4a4a4a;
    font-size: 0.9rem;
    border-left: 2px solid #ddd;
    padding-left: 1rem;
    margin-top: 0.75rem;
    width: 100%;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .page-header {
        padding: 1rem 0 1rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .page-header .subtitle {
        font-size: 0.95rem;
    }
}

/* ========== 区块标题手机端适配 ========== */
@media (max-width: 680px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    /* 确保小字单独成行且左对齐，没有任何左边距 */
    .section-header small {
        display: block;
        margin-left: 0 !important;
        /* 强制覆盖任何之前的左边距 */
        margin-top: 0.2rem;
        font-size: 0.7rem;
        line-height: 1.3;
        text-align: left;
        /* 明确左对齐 */
    }

    .contact-btn,
    .support-btn-wrapper {
        text-align: center;
        width: 100%;
    }

    .contact-email-link,
    .support-btn {
        display: inline-flex;
        margin: 0 auto;
    }
}