body {
    font-family: Arial, sans-serif;
/*    --main-color: linear-gradient(
            180deg,
            rgba(0, 99, 53, 1) 0%,
            rgba(1, 135, 73, 1) 100%
    );*/
    --main-color: rgba(1, 98, 163, 1);
}

.navbar {
    position: fixed;
    top: 0;
    padding: 0;
    width: 100%;
    height: 126px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    color: #fff;
    z-index: 1000;
    min-width: 1400px;
}

.navbar-container {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 1200px;
    max-width: 1400px;
    margin: 0 auto;
    height: 126px;
}
.navbar-container .logo{
    display: inline-block;
}
.navbar-container .logo img{
    width: auto;
    height: 68px;
}
.navbar-links {
    display: flex;
    height: 100%;
    line-height: 60px;
}
.navbar-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    background: rgba(0, 0, 0, 0);
}

.navbar-links {
    display: flex;
    height: 100%;
    line-height: 60px;
}

.navbar-links ul {
    height: 100%;
}

.navbar-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    background: rgba(0, 0, 0, 0);
}

.navbar-links li a {
    /* margin: 0 15px; */
    cursor: pointer;
}

/*.navbar-links ul li:first-child:hover::after {
    border-bottom-color: transparent;
}*/

.navbar-links li:hover::after {
    content: "";
    position: absolute;
    bottom: 30px;
    left: 10%; /* 让底边的宽度为容器的80% */
    width: 80%;
    border-bottom: 2px solid white;
}
.navbar-links li:last-child:hover::after {
    content: "";
    position: absolute;
    bottom: 30px;
    left: 10%; /* 让底边的宽度为容器的80% */
    width: 80%;
    border-bottom: 0px solid white;
}
.navbar-links li {
    position: relative;
}
.navbar-links li a {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 15px;
    height: 100%;
    color: white;
    text-decoration: none;
    white-space: nowrap; /* 防止链接文本换行 */
    font-size: 18px;
}

.navbar-links ul li:first-child a{
    padding: 0 30px;
}
.navbar-links li a .search-btn {
    display: inline-block;
    padding: 0;
    width: 38px;
    height: 38px;
    line-height: 34px;
    text-align: center;
    background-color: #fff;
    border-radius: 19px;
}
.navbar-links li a .search-btn .icon-search{
    width: 18px;
    height: 18px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    /* 解决对齐问题 */
    left: 0;
    position: absolute;
    background: var(--main-color);
}

.dropdown-content a {
    color: white;
    padding-left: 15px;
    padding-right: 15px;
    text-decoration: none;
    display: block;
    text-align: left;
    border-bottom: 1px solid white;
}

.dropdown-content a:hover {
    background-color: #555;
}

.dropdown:hover .dropdown-content {
    display: block;
}
.dropdown.show .dropdown-content {
    display: block;
}

/* .dropdown.show,
.dropdown:hover {
  border: 1px solid white;
} */

.toggle-button {
    font-size: 30px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: none;
}

.toggle-button.active {
    content: "\2715";
}

/* 在1150px宽度下调整下拉菜单的位置 */
@media (max-width: 780px) {
    .navbar {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
        height: 80px;
        background: var(--main-color);
    }
    .navbar-container {
        width: 100%;
        height: 80px;
        max-width: 100%;
        min-width: 100%;
    }
    .navbar-container .logo img{
        height: 40px;
    }

    .navbar-links {
        width: 40%;
        /*height: 400px;*/

        display: none;
        flex-direction: column;
        /* width: 100%; */
        background-color: #333;
        position: absolute;
        top: 100%;
        right: 0;
    }

    .navbar-links ul {
        flex-direction: column;
        margin: 0;
        padding: 0;
    }

    .navbar-links li {
        padding-left: 0;
        padding-right: 0;
        margin: 0;
        text-align: center;
        background: var(--main-color);
        border-bottom: 1px solid white;
    }

    /* 可以从这里改 */
    .navbar-links li a {
        position: static;
        font-size: 12px;
        padding-left: 20px;
        height: 50px;
    }

    .navbar-links ul li:first-child a{
        padding-left: 20px;
    }

    .navbar-links ul li:first-child {
        padding-left: 0;
        background: var(--main-color);
    }

    .navbar-links ul li:not(:first-child) {
        background: var(--main-color);
    }

    .navbar-links ul li:last-child {
        /* 右侧间距在这里 */
        padding-right: 0;
    }

    .navbar-links li > a {
        text-align: center;
        width: 50px;
    }

    .navbar-links .search-li {
        display: none;
    }

    .toggle-button {
        display: block;
        margin-right: 50px;
    }

    .navbar-links.active {
        display: flex;
    }

    .dropdown-content {
        display: none;
        position: static;
        width: 100%;
        background-color: #555;
    }

    .dropdown {
        position: relative;
    }

    .dropdown > a {
        position: relative;
        padding-right: 250px;
    }

    .dropdown > a::after {
        content: "+";
        font-size: 20px;
        height: 50px;
        line-height: 50px;
        color: white;
        position: absolute;
        right: 10px;
        top: 0;
        pointer-events: auto;
        cursor: pointer;
    }

    .dropdown.show > a::after {
        content: "-";
    }

    .navbar-links li:hover::after {
        border-bottom: transparent;
    }
}

@media (max-width: 780px) {
    .navbar-container img {
        width: 70%;
        height: auto;
    }

    .toggle-button {
        margin-right: 0;
        width: 30%;
    }

    .dropdown > a {
        position: relative;
        padding-right: 50px; /* 给右侧的伪元素留出空间 */
    }

    /* 最终发现是小屏幕下hover的问题 */
    .dropdown:hover .dropdown-content {
        display: none;
    }

    .dropdown.show .dropdown-content {
        display: block;
    }
}