﻿/* ========== 全局重置 & 基础 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: #f4f6f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== 导航容器 #1a2634  #1e3a8a;========== */
.navbar {
    background: #fff;
    color: #1e3a8a;
    padding: 0 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 999;
}

    .navbar::after {
        content: '';
        display: block;
        width: 103%;
        height: 6px;
        background: #1e3a8a;
        margin-left: -2%;       
    }

.nav-container {
    max-width: 2200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: relative;    
}

.logo {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

    .logo span {
        color: #5fc3e4;
    }

/* ========== 汉堡按钮 ========== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

    .menu-toggle .bar {
        display: block;
        width: 100%;
        height: 2.5px;
        background: #1e3a8a;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(8.5px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-8.5px) rotate(-45deg);
    }

/* ========== 导航菜单 ========== */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 20px;
    height: 100%;
}

.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
/*rgba(255, 255, 255, 0.85) #1e3a8a*/
.nav-link {
    color: #1e3a8a;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0 10px;
    height: 38px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background 0.25s, color 0.25s;
    cursor: pointer;
    white-space: nowrap;
    gap: 3px;
}

    .nav-link:hover,
    .nav-link:focus {
        color: #1e3a8a;
        background: #d8eeff;
    }

    .nav-link .arrow {
        font-size: 12px;
        margin-left: 4px;
        transition: transform 0.3s ease;
        display: inline-block;
    }

.nav-item:hover > .nav-link .arrow {
    transform: rotate(180deg);
}

/* ========== 二级菜单（分组） ========== */
.dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #ffffff;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: grid;
    gap: 12px 20px;
}

.grid-sp1 {
    grid-template-columns: repeat(1, 1fr); /* 2列分组 */
    min-width: 260px; /* 扩大宽度容纳多列 220 */
}

.grid-sp2 {
    grid-template-columns: repeat(2, 1fr); /* 2列分组 */
    min-width: 380px; /* 扩大宽度容纳多列 */
}

.grid-sp3 {
    grid-template-columns: repeat(3, 1fr); /* 3列分组 */
    min-width: 520px; /* 扩大宽度容纳多列 */
}

.grid-sp4 {
    grid-template-columns: repeat(4, 1fr); /* 4列分组 */
    min-width: 680px; /* 扩大宽度容纳多列 */
}

.grid-sp5 {
    grid-template-columns: repeat(5, 1fr); /* 5列分组 */
    min-width: 800px; /* 扩大宽度容纳多列 */
}
/* 小三角 */
.dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
    filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.04));
}

.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* ——— 分组容器 ——— */
.dropdown-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.group-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c7a8a;
    padding: 6px 0 8px 0;
    border-bottom: 1px solid #e9edf2;
    margin-bottom: 8px;
}

.group-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: #1a2634;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 450;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

    .dropdown-link:hover {
        background: #f0f4ff;
        color: #0a58ca;
    }

    .dropdown-link .icon {
        font-size: 12px;
        width: 22px;
        text-align: center;
        flex-shrink: 0;
    }

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 66px;
        left: 0;
        right: 0;
        background: #dddddd;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 12px 16px 24px;
        gap: 2px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        transform: scaleY(0);
        transform-origin: top center;
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
        border-radius: 0 0 16px 16px;
        overflow-y: auto;
        max-height: calc(100vh - 64px);
    }

        .nav-menu.open {
            transform: scaleY(1);
            opacity: 1;
            visibility: visible;
        }

    .nav-item {
        height: auto;
        flex-direction: column;
        align-items: stretch;
        border-radius: 8px;
        /*overflow: hidden;*/
    }

    .nav-link {
        height: 48px;
        padding: 0 16px;
        border-radius: 8px;
        white-space: nowrap;
        font-size: 0.9rem;
        justify-content: space-between;
        width: 100%;
        background: transparent;
    }

        .nav-link:hover,
        .nav-link:focus {
            background: rgba(255, 255, 255, 0.06);
        }

        .nav-link .arrow {
            transition: transform 0.3s ease;
        }

    .nav-item.active > .nav-link .arrow {
        transform: rotate(180deg);
    }

    /* 移动端：二级菜单变为内嵌折叠 */
    .dropdown {
        position: static;
        transform: none !important;
        background: rgba(255, 255, 255, 0.04);
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0 0 8px 12px;
        min-width: unset;
        width: 100%;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        max-height: 0; /* 收起时高度为0 */
        overflow: hidden; /* 隐藏溢出 */
        transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease, visibility 0.3s;
        margin-top: 0;
        display: block;
        grid-template-columns: unset;
        gap: 0;
        max-width: none;
        overflow-x: visible;
    }

    .nav-item.active > .dropdown {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        max-height: none; /* 关键：完全展开，不限制高度 */
        padding: 8px 0 16px 12px;
        overflow: visible; /* 内容溢出则由外层滚动 */
    }

    .dropdown::before {
        display: none;
    }

    /* 移动端右对齐类无效 */
    .nav-item.align-right .dropdown {
        left: 0;
        right: 0;
        transform: none;
    }

    .nav-item.align-right:hover > .dropdown,
    .nav-item.align-right:focus-within > .dropdown {
        transform: none;
    }

    /* 移动端分组样式 */
    .dropdown-group {
        margin-bottom: 8px;
    }

    .group-title {
        color: #0a58ca;
        font-size: 12px;
        font-weight: 600;
        border-bottom-color: rgba(255, 255, 255, 0.1);
        padding: 6px 0 4px 0;
        margin-bottom: 4px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .dropdown-link {
        color: #0a58ca;
        padding: 8px 12px;
        font-size: 0.9rem;
        border-radius: 4px;
    }

        .dropdown-link:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #1e3a8a;
        }

        .dropdown-link .icon {
            color: rgba(255, 255, 255, 0.5);
        }
}

/* ========== 更小屏手机 ========== */
@media (max-width: 420px) {
    .navbar {
        padding: 0 12px;
    }

    .nav-link {
        font-size: 14px;
        padding: 0 12px;
    }

    .logo {
        font-size: 18px;
    }

    .nav-menu {
        padding: 8px 12px 18px;
    }
}

/* ========== 页面内容（演示） ========== */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.hero-content {
    max-width: 560px;
}

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1a2634;
    margin-bottom: 12px;
}

    .hero h1 span {
        color: #0a58ca;
    }

.hero p {
    font-size: 18px;
    color: #4a5568;
    line-height: 1.6;
}

.badge {
    display: inline-block;
    margin-top: 20px;
    padding: 8px 20px;
    background: #e6f0ff;
    color: #0a58ca;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
}

/* 页脚 */
footer {
    font-size:0.9rem;
    background-color: #1e3a8a;
    color: #ccc;
    padding: 25px 10%;
    text-align: center;
}

    footer p {
        line-height: 25px;
    }

.footer-links {
    margin-top:-25px;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

    .footer-links a {
        color: #ccc;
        text-decoration: none;
    }

.copyright {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    font-size: 12px;
}
