/* Bootstrap 导航栏自定义样式 */
.custom-navbar {
    max-width: 93.875rem;
    min-height: 3rem;
    border-radius: 7.6875rem;
    margin: 0 auto;
    margin-top: 1.875rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.65) 100%);
    backdrop-filter: blur(0.9375rem);
    box-shadow: 0px 0.625rem 1.25rem 0px rgba(0, 0, 0, 0.1), inset 0px 0px 0.125rem 0px rgba(255, 255, 255, 0.1);
    padding: 0;
}

.custom-navbar-container {
    padding: 0;
    display: flex;
    align-items: center;
    width: 100%;
}

.custom-logo {
    width: 4.5rem;
    height: 1.625rem;
    margin-left: 1.25rem;
    padding: 0;
}

.custom-logo img {
    width: 4.5rem;
    height: 1.625rem;
    min-width: 4.5rem;
}

.custom-navbar-nav {
    display: flex;
    align-items: center;
    margin-left: 5.1875rem;
    gap: 1.25rem;
}

.custom-navbar-nav .nav-link {
    color: #585858;
    font-size: 1rem;
    padding: 0.5rem 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.custom-navbar-nav .nav-link:hover,
.custom-navbar-nav .nav-link.active {
    color: #1a1a1a;
    border-bottom: 2px solid #0256FF;
}

.custom-navbar-nav .nav-item.active > .nav-link {
    border-bottom: 2px solid #0256FF;
    color: #1a1a1a;
}

/* 下拉菜单样式 */
.custom-dropdown {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.8) 100%);
    backdrop-filter: blur(0.625rem);
    box-shadow: 0.25rem 0.25rem 1.25rem 0px rgba(0, 0, 0, 0.1), inset 0px 0px 0.125rem 0px rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.25rem;
    border: none;
    margin-top: 0.5rem;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
}

/* 桌面端 hover 显示下拉菜单 */
@media (min-width: 992px) {
    .has-dropdown {
        position: relative;
    }
    
    .has-dropdown .custom-dropdown {
        display: none !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        margin-top: 7px !important;
        /* 向上移动5px，让下拉菜单覆盖父菜单的一部分，消除间隙 */
        top: calc(100% - 5px) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        min-width: 10.5rem;
        /* 使用padding-top创建视觉间距 */
        padding-top: 0.75rem;
    }
    
    /* 当hover父菜单或下拉菜单时都显示 */
    .has-dropdown:hover .custom-dropdown,
    .has-dropdown .custom-dropdown:hover {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .has-dropdown .dropdown-toggle::after {
        display: inline-block;
    }
    
    /* 防止Bootstrap的点击事件干扰hover */
    .has-dropdown .dropdown-toggle {
        pointer-events: auto;
    }
}

.custom-dropdown .dropdown-item {
    width: 10.5rem;
    height: 2.375rem;
    text-align: center;
    line-height: 2.375rem;
    color: #585858;
    font-size: 1rem;
    padding: 0;
    margin: 0.3125rem 0;
    border-radius: 35px;
    cursor: pointer;
    display: block;
}

.custom-dropdown .dropdown-item:hover {
    background-color: rgba(2, 86, 255, 0.1);
    color: #0256FF;
}

.custom-dropdown .dropdown-item.active {
    background-color: #0256FF;
    color: #fff;
}

a.link {
    width: 10.5rem;
    height: 2.375rem;
    display: inline-block;
    text-decoration: none;
}

.language {
    width: 5rem;
    height: 2.25rem;
    border-radius: 3.875rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 0.375rem 0.625rem;
    gap: 0.625rem;
    background: #0256FF;
    color: #fff;
    margin-left: auto;
    margin-right: 1.25rem;
    font-size: 0.875rem;
    text-decoration: none;
}

/* Bootstrap 汉堡菜单按钮样式 */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
    margin-right: 1.25rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2858, 58, 58, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .custom-navbar {
        border-radius: 1rem;
        margin-top: 0.5rem;
    }

    .custom-navbar-container {
        padding: 0.75rem 1rem;
    }

    .custom-logo {
        margin-left: 0;
    }

    .custom-navbar-nav {
        margin-left: 0;
        margin-top: 1rem;
        gap: 0;
    }

    .custom-navbar-nav .nav-item {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .custom-navbar-nav .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .custom-navbar-nav .nav-link.active {
        border-bottom: 2px solid #0256FF;
    }

    .custom-dropdown {
        position: static !important;
        transform: none !important;
        margin-top: 0.5rem;
        margin-left: 1rem;
        width: calc(100% - 2rem);
        box-shadow: none;
        background: rgba(255, 255, 255, 0.5);
        display: none;
    }
    
    .has-dropdown.show .custom-dropdown {
        display: block !important;
    }

    .custom-dropdown .dropdown-item {
        width: 100%;
        text-align: left;
        padding-left: 1rem;
    }

    .language {
        /* margin: 1rem auto 0; */
        order: 3;
        width: 4rem;
        height: 2rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .custom-logo {
        width: 3.5rem;
        height: 1.25rem;
    }

    .custom-logo img {
        width: 3.5rem;
        height: 1.25rem;
        min-width: 3.5rem;
    }

    .language {
        width: 3.5rem;
        height: 1.75rem;
        font-size: 0.7rem;
    }
}