@font-face {
    font-family: "KN Yuanmo SC Hero";
    src: url("https://static.igem.wiki/teams/6419/wiki/fonts/kingnamypeyuanmosc.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: 'KN Yuanmo SC';
    src: url('https://static.igem.wiki/teams/6419/wiki/fonts/knyuanmo-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    /* 你可以自己给它起个名字，调用时就用这个名字 */
    src: url('https://static.igem.wiki/teams/6419/wiki/fonts/zhengwen500.woff2') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Alkatra';
    /* 这是你给这个字体起的名字，下面应用时会用到 */
    src: url('https://static.igem.wiki/teams/6419/wiki/fonts/geyan.woff2') format('woff2');
    /* 假设你把字体放在了 fonts 文件夹下 */
    font-weight: 600;
    /* Alkatra 我们下载的是 600 字重 */
    font-style: normal;
    font-display: swap;
}

:root {
    --brand: #0070C0;
    --primary-blue: #0070C0;
    --light-blue: #93E3ED;
    --yellow: #FFFF00;
    --white: #FFFFFF;
    --text-main: #333333;
    --text-muted: #666666;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e9f2 100%);
}
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 105px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5% 0 70px;
    background-color: #0070C0;
    box-sizing: border-box;
    z-index: 1000;
    transition: width 0.7s ease, border-radius 0.7s ease, background-color 0.7s ease, box-shadow 0.7s ease;

    border-bottom: 6px solid var(--yellow);
    box-shadow: 0 4px 15px rgba(255, 255, 0, 0.5), 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 0;
}

@media (min-width: 993px) {
    .navbar.scrolled {
        width: 300px;
        padding-right: 30px;
        border-radius: 0 45px 45px 0;
        background-color: rgba(0, 112, 192, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 4px 15px rgba(255, 255, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    .navbar.scrolled:hover {
        width: 100%;
        padding-right: 5%;
        border-radius: 0;
        background-color: var(--primary-blue);
    }

    .nav-links {
        list-style: none;
        display: flex;
        gap: 12px;
        margin: 0;
        padding: 0;
        white-space: nowrap;
        flex-shrink: 0;
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    }

    .navbar.scrolled .nav-links {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(20px);
        transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    }

    .navbar.scrolled:hover .nav-links {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(0);
        transition: opacity 0.5s ease 0.3s, visibility 0.5s ease 0.3s, transform 0.5s ease 0.3s;
    }
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    height: 88px;
    margin-bottom: -35px;
    position: relative;
    top: -14px;
    z-index: 1010;
    transition: all 0.4s ease;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.15));
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.nav-links>li {
    position: relative;
}

.nav-links>li>a {
    text-decoration: none;
    color: var(--white);
    font-weight: normal;
    font-family: 'KN Yuanmo SC', 'Montserrat', sans-serif;
    font-size: 22px;
    letter-spacing: 1px;
    padding: 10px 22px;
    display: flex;
    align-items: center;
    border-radius: 30px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-links>li>a:hover {
    background-color: var(--yellow);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-arrow {
    display: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-15px);
    transform-origin: top center;
    background-color: var(--primary-blue);
    list-style: none;
    padding: 15px 10px;
    margin: 0;
    margin-top: 23px;
    min-width: 190px;
    border-radius: 4px 4px 20px 20px;
    box-shadow: 6px 6px 0px var(--yellow);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0s ease 0.3s, visibility 0s ease 0.3s;
}

@media (min-width: 993px) {
    .nav-links>li:hover>a {
        background-color: var(--yellow);
        color: var(--primary-blue);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .nav-links>li:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
        transition: opacity 0.3s ease 0.15s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.15s, visibility 0s ease 0.15s;
    }
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 0;
    width: 100%;
    height: 25px;
}

.dropdown-menu li a {
    text-decoration: none;
    color: var(--white);
    display: block;
    padding: 12px 20px;
    font-weight: normal;
    font-family: 'KN Yuanmo SC', 'Montserrat', sans-serif;
    font-size: 17px;
    letter-spacing: 0.5px;
    border-radius: 30px;
    margin-bottom: 5px;
    text-align: center;
    transition: all 0.3s ease;
}

.dropdown-menu li:last-child {
    margin-bottom: 0;
}

.dropdown-menu li a:hover {
    background-color: var(--yellow);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1010;
}

.mobile-menu-btn .bar {
    height: 3px;
    width: 100%;
    background-color: var(--white);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background-color: var(--yellow);
}

.mobile-menu-btn.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background-color: var(--yellow);
}

@media screen and (max-width: 992px) {
    .navbar {
        height: 75px;
        padding: 0 25px;
        width: 100%;
        border-radius: 0;
    }

    .navbar.scrolled {
        width: 100%;
        height: 92px;
        padding: 0 25px;
        border-radius: 0;
    }

    .logo img {
        height: 75px;
        margin-bottom: -25px;
        top: -5px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        list-style: none;
        position: absolute;
        top: 100%;
        left: 5%;
        width: 90%;
        background-color: var(--primary-blue);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        border-radius: 25px;
        box-shadow: 6px 6px 0px var(--yellow);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s ease;
        white-space: normal;
    }

    .nav-links.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(15px);
    }

    .nav-links>li {
        width: 100%;
        text-align: center;
    }

    .nav-links>li>a {
        justify-content: center;
        padding: 15px 22px;
        width: 85%;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .nav-links>li>a:hover,
    li.mobile-active>a {
        background-color: var(--yellow);
        color: var(--primary-blue);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .mobile-arrow {
        display: inline-block;
        border: solid currentColor;
        border-width: 0 2.5px 2.5px 0;
        padding: 4px;
        margin-left: 12px;
        transform: translateY(-2px) rotate(45deg);
        transition: transform 0.3s ease;
    }

    li.mobile-active>a .mobile-arrow {
        transform: translateY(2px) rotate(-135deg);
    }

    .dropdown-menu {
        position: relative;
        top: 0;
        left: 0;
        width: 90%;
        margin: 0 auto;
        transform: none !important;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.15);
        padding: 0 10px;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
        list-style: none;
        border-radius: 20px !important;
    }

    .dropdown-menu::before {
        display: none;
    }

    .dropdown-menu li a {
        text-align: center;
        width: 85%;
        margin: 0 auto 5px auto;
        box-sizing: border-box;
        border-radius: 20px;
    }

    .dropdown-menu li a:hover {
        transform: translateY(-2px);
    }

    li.mobile-active .dropdown-menu {
        max-height: 400px;
        padding: 15px 10px;
        margin-top: 10px;
        margin-bottom: 10px;
    }
}