/* ---------------- 字体图标 --------------------*/
@font-face {
    font-family: 'icomoon2';
    src: url('https://static.igem.wiki/teams/5872/materials/fonts/icomoon2/icomoon.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Play';
    src: url('https://static.igem.wiki/teams/5872/materials/fonts/playregular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}




/* ------------------- top-container ------------------*/
.top-container {
    position: fixed;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: 8vh;
    background-color: #fff;
    padding: 0 5% 0 10%;
    box-sizing: border-box;
    z-index: 1000;
}

.top-container::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 12px;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(175, 215, 222, 0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
    z-index: 5;
}

/* ************ home-logo ************ */
.home-logo {
    flex: 0 0 auto;
    width: 22%;
    height: 84px;
    /* min-width: 70px; */
    /* max-width: 100px; */
    margin-left: -8%;
    background-color: #4f649b;
    border-bottom-right-radius: 40px;
    display: flex;
    align-items: center;
    justify-self: center;
    z-index: 10;
}

.logo-container {
    flex: 0 0 auto;
    width: 100%;
    min-width: 60px;
    position: relative;
    top: 8%;
    margin: 10px 10px 0 10px;
    z-index: 10;
}

.logo-wrapper {
    display: block;
    position: relative;
    top: 10px;
    display: flex;
    align-items: center;
    justify-self: center;
    flex-direction: row;
    gap: 6px;
    width: 100%;
}

.logo-wrapper .logo1 {
    width: 32%;
}

.logo-wrapper .logo2 {
    width: 50%;
}


/* **************** nav ****************** */
.nav-container {
    display: flex;
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    min-width: 0px;
    max-width: 80%;
    margin: 0;
    box-sizing: border-box;
}

.nav-bar,
.dropdown-menu {
    position: relative;
    display: flex;
    flex-direction: row;
    column-gap: 1px;
    align-items: center;
    justify-self: flex-start;
    padding: 10px;
    text-align: center;
    list-style: none;
}

.nav-bar {
    position: relative;
    min-width: 0;
    transition: all 0.3s ease;
}

.nav-item {
    min-width: 0;
}

.nav-item>a {
    display: inline-block;
    position: relative;
    min-width: 0;
    padding: 14px 16px;
    /* color: rgb(40, 62, 122); */
    color: rgb(40, 62, 122);
    font-size: clamp(12px, 1.5vw, 20px);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    z-index: 3;
}

.nav-item span {
    color: rgb(40, 62, 122);
    font-family: "icomoon2";
    font-size: 16px;
    font-weight: 500;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 80px;
    background-color: #ebfbfee2;
    border-radius: 8px;
    box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.2);
    text-align: left;
    padding: 8px auto;
    z-index: 1001;
}

.dropdown-menu::after {
    content: "";
    position: absolute;
    top: -55px;
    left: 0;
    width: 100%;
    height: 60px;
    background: transparent;
}

.dropdown-menu a {
    display: inline-block;
    padding: 4px 10px;
    color: rgb(51, 75, 140);
    font-size: clamp(10px, 1.5vw, 18px);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.dropdown-menu a:hover {
    color: rgb(159, 125, 73);
    transform: scale(1.03);
}

.nav-item:hover .dropdown-menu {
    display: block;
}


/* ******************* sliders ****************** */
.nav-bar .slide1,
.nav-bar .slide2 {
    position: absolute;
    display: inline-block;
    height: 40px;
    border-radius: 8em;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1.05);
    will-change: left, width;
}

.nav-bar .slide1 {
    background-color: #9abeff;
    z-index: 2;
}

.nav-bar .slide2 {
    opacity: 0;
    background-color: rgba(170, 190, 255, .5);
    z-index: 1;
    box-shadow: 0 0 20px #ffffffaa inset;
}

.squeeze {
    transform: scale(0.9);
}

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: rgb(11, 38, 112);
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
}


/* ========== 响应式布局 ========== */
@media (max-width: 1200px) {
    .nav-bar {
        gap: 1px;
    }

    .nav-item>a {
        padding: 8px 10px;
        font-size: 16px;
    }
}

@media (max-width: 1100px) {
    .nav-bar {
        gap: 0.8px;
    }

    .nav-item>a {
        padding: 6px 8px;
        font-size: 15px;
    }
}

@media (max-width: 1000px) {
    .nav-bar {
        gap: 0.6px;
    }

    .nav-item>a {
        padding: 4px 5px;
        font-size: 14px;
    }
}

/* --------------- 小屏幕样式（响应式）--------------- */
@media (max-width: 900px) {

    .hamburger-btn {
        display: block;
    }

    #navBar .nav-item.mobile-hover>a {
        background-color: #769ce1 !important;
        color: #f3e6c8 !important;
        border-radius: 10px;
    }

    /* hide the sliders */
    #navBar .slide1,
    #navBar .slide2 {
        display: none !important;
    }

    .nav-bar {
        display: none;
        position: absolute;
        top: 13vh;
        right: 0;
        width: 240px;
        flex-direction: column;
        gap: 0;
        padding: 10px;
        background-color: #9abeff;
        box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.1);
        border-bottom-left-radius: 16px;
        z-index: 1000;
    }

    .nav-bar.active {
        display: flex;
    }

    .nav-item {
        position: relative;
        width: 90%;
    }

    .nav-item.active {
        background-color: #f4e4f6;
        border-radius: 10px;
    }

    .nav-item::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 20px;
        background: transparent;
        z-index: 1001;
    }

    .nav-item>a {
        padding: 12px 15px;
        display: block;
    }

    .dropdown-menu {
        right: 100%;
        top: 0;
        margin-top: -20px;
    }

    .dropdown-menu::after {
        display: none;
    }
}