* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-blue: #f7f9f5;
    --secondary-blue: #e8f1e8;
    --accent-green: #7301FF;
    --accent-green-light: #85bd95;
    --white: #ffffff;
    --light-gray: #f5f7fa;
    --medium-gray: #e8ecf1;
    --text-dark: #20352a;
    --text-gray: #465b4d;
    --text-light-gray: #66786b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 0 40px;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 72px;
}

.header-inner .logo { flex-shrink: 0; }
.header-inner nav { margin-left: auto; margin-right: 0; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-green), #00d4aa);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--white);
}

.brand-logo {
    display: block;
    width: 280px;
    height: auto;
    max-width: 100%;
}

.logo-text { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.logo-text span { color: var(--accent-green); }

.nav-menu { display: flex; list-style: none; gap: 4px; }
.nav-menu > li { position: relative; }

.nav-menu > li > a {
    display: block;
    padding: 10px 18px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li.active > a {
    color: var(--text-dark);
    background: #f5edff;
}

.nav-menu .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 160px;
    z-index: 100;
    white-space: nowrap;
}

.nav-menu li:hover .dropdown,
.nav-menu li.submenu-open .dropdown { display: block; }

/* “关于我们”为直达页；兼容旧缓存页面中遗留的第五项下拉菜单。 */
.nav-menu > li:nth-child(5) > .dropdown { display: none !important; }

.nav-menu .dropdown a {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-menu .dropdown a:hover,
.nav-menu .dropdown a.active {
    color: var(--text-dark);
    background: rgba(36, 18, 46, 0.06);
}

.header-actions { display: flex; align-items: center; gap: 16px; }

.lang-switch {
    position: relative;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.lang-switch:hover { color: var(--accent-green); border-color: var(--accent-green); }
.lang-switch .arrow { font-size: 10px; transition: transform 0.3s ease; }
.lang-switch.open .arrow { transform: rotate(180deg); }

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 6px 0;
    min-width: 160px;
    z-index: 200;
}

.lang-dropdown.show { display: block; }

.lang-dropdown a {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lang-dropdown a:hover,
.lang-dropdown a.active {
    color: var(--text-dark);
    background: rgba(36, 18, 46, 0.06);
}
.lang-dropdown a.active { font-weight: 700; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.footer {
    background: #f1f1f1;
    color: var(--text-gray);
    padding: 60px 40px 30px;
}

.footer-grid {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(48, 70, 58, 0.12);
}

.footer-brand p { margin-top: 16px; font-size: 14px; line-height: 1.8; }
.footer .logo { color: var(--text-dark); }
.footer .brand-logo { content: url("assets/brand-logo.png?v=20260728-group14"); }
.footer-col h4 { color: var(--text-dark); font-size: 16px; font-weight: 700; margin-bottom: 20px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }

.footer-col a,
.footer-col a:visited,
.footer-col a:hover,
.footer-col a:active {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: break-word;
    transition: color 0.3s ease;
}

.footer-bottom {
    max-width: 1300px;
    margin: 0 auto;
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    overflow-wrap: break-word;
}

.footer-bottom a,
.footer-bottom a:visited,
.footer-bottom a:hover,
.footer-bottom a:active {
    color: var(--text-gray);
    text-decoration: none;
}

/* ============ 移动端 header 适配（防止溢出/横向滚动） ============ */
@media (max-width: 1024px) {
    .header {
        padding: 0 16px;
        overflow: visible;               /* 允许语言下拉框在 header 下方完整展开 */
    }
    .header-inner {
        min-width: 0;                    /* 允许 flex 内容收缩 */
        width: 100%;
        justify-content: space-between;
    }
    /* 保留 nav 容器（由 site.js 切换显示），避免汉堡菜单点击无反应 */
    .header-inner > nav { display: block; }
    .nav-menu { display: none; }         /* 移动端默认收起，点击汉堡后由 JS 展开 */
    .header-inner > .logo {
        flex: 1 1 auto !important;        /* 占据剩余空间，让 logo 不撑破 header-inner */
        min-width: 0 !important;
        max-width: calc(100% - 110px);   /* 给右侧 actions 预留空间 */
    }
    .brand-logo {
        width: 100%;       /* img 填满父容器 max-width,避免按 intrinsic 1131px 渲染 */
        max-width: 100%;
        height: auto;
        display: block;
    }
    .header-inner > .logo .brand-logo {
        width: 100%;
        max-width: 100%;
    }
    .header-actions {
        gap: 10px !important;
        flex-shrink: 0;
        position: relative;
        z-index: 5;
    }
    .lang-switch {
        padding: 5px 10px !important;
        font-size: 13px !important;
        flex-shrink: 0;
    }
    .menu-toggle {
        display: block;                   /* 移动端显示汉堡按钮 */
        flex-shrink: 0;
        padding: 6px !important;
    }
    /* 展开的移动菜单面板：浅色背景 + 深色文字，保证可读（覆盖 JS 内联深蓝） */
    .nav-menu {
        background: rgba(255, 255, 255, 0.98) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    }
    /* 移动端底部：单列堆叠、链接可换行，避免文字超出屏幕 */
    .footer { padding: 48px 24px 28px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 14px; }
}

@media (max-width: 768px) {
    .brand-logo {
        width: 210px !important;
    }
}

/* 超窄屏（iPhone SE 一代 / 320px 设备）进一步压缩 */
@media (max-width: 360px) {
    .header-inner > .logo {
        max-width: calc(100% - 105px);
    }
    .lang-switch {
        padding: 4px 8px !important;
        font-size: 12px !important;
    }
    .header-actions {
        gap: 6px !important;
    }
}

/* ============ 页面切换过渡动效 ============ */
/* 顶部加载进度条 */
.page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent-green), #00d4aa);
    box-shadow: 0 0 10px rgba(0, 212, 170, 0.6);
    z-index: 2000;
    opacity: 0;
    transition: width 0.25s ease, opacity 0.3s ease;
    pointer-events: none;
}
.page-progress.is-active {
    opacity: 1;
}
.page-progress.is-done {
    opacity: 0;
    transition: width 0.2s ease, opacity 0.4s ease 0.1s;
}

/* 整页离场遮罩（点击站内链接后淡出） */
.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(247, 249, 245, 0.96), rgba(232, 241, 232, 0.96));
    z-index: 1900;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.38s;
}
.page-transition-overlay.is-leaving {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transition: opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}
/* 遮罩中央的 Logo 标记，增强品牌连贯感 */
.page-transition-overlay .transition-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-green), #00d4aa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 1px;
    box-shadow: 0 8px 30px rgba(79, 144, 100, 0.35);
    opacity: 0;
    transform: scale(0.85) translateY(8px);
    transition: opacity 0.3s ease 0.06s, transform 0.3s ease 0.06s;
}
.page-transition-overlay.is-leaving .transition-mark {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* 新页面内容入场分级动画 */
body.page-enter .page-enter-target {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
body.page-enter .page-enter-target.is-in {
    opacity: 1;
    transform: translateY(0);
}
/* 分级延迟（header / hero / 主内容逐级出现） */
body.page-enter .page-enter-target.delay-1 { transition-delay: 0.08s; }
body.page-enter .page-enter-target.delay-2 { transition-delay: 0.16s; }
body.page-enter .page-enter-target.delay-3 { transition-delay: 0.24s; }
body.page-enter .page-enter-target.delay-4 { transition-delay: 0.32s; }

/* 尊重用户的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
    .page-progress,
    .page-transition-overlay,
    body.page-enter .page-enter-target {
        transition: none !important;
    }
    body.page-enter .page-enter-target {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============ 全站首屏加载层（复用 loading.html，与首页 hero-loader 一致） ============ */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #ffffff;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s linear 0s;
}
.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.page-loader iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
@media (prefers-reduced-motion: reduce) {
    .page-loader { transition: opacity 0.2s ease; }
    .page-loader.is-hidden { transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
}
