/* 导航栏样式 */
:root {
    --primary-color: #8828FF ;
    --secondary-color: #6F48C9;
    --text-color: #333;
}

/* 顶部导航 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1030;
    transition: box-shadow 0.3s;
}

.top-header {
    background: white;
    padding: 1rem 0;
}

.logo img {
    height: 40px;
}

/* 主导航 */
.main-nav {
    background: white;
    padding: 0 0 30px;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

.nav-list-item {
    padding: 0 0.5rem;
}

.header .nav-item {
    color: var(--text-color);
    text-decoration: none;
    padding: 1rem 0;
    font-weight: 500;
    display: block;
    transition: color 0.3s;
}
.company-header .nav-item{
    color: #6909E1;
}
.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
}
.nav-item.active {
    font-weight: bold;
}
.nav-item.active::after{
    content: "";
    width: 33px;
    height: 3px;
    background: var(--primary-color);
    display: block;
    margin: 0.25rem auto 0;
    border-radius: 2px;
}
.nav-item.dropdown-toggle.active::after {
    margin: 0.25rem 15px 0;
}
/* 新增公司页面专用导航样式 */
.company-header {
    background: transparent;
    box-shadow: none;
    transition: all 0.3s;
}

/* 在.company-header样式中添加滚动效果 */
.company-header.scrolled {
    background: white;
    box-shadow: #792dd51a 0px 2px 10px;
}

/* 新增移动端滚动样式 */
@media (max-width: 991px) {
    .company-header.scrolled {
        background: white !important;
    }
    
    .company-header.scrolled .top-header {
        background: white !important;
    }
}
.company-header .top-header,.company-header .main-nav {
    background: transparent;
}
.company-header.scrolled .nav-item {
    color: #333 !important; /* 新增滚动时文字颜色 */
}

.company-header.scrolled .nav-item:hover,
.company-header.scrolled .nav-item.active {
    color: var(--primary-color) !important; /* 保持悬停/激活状态颜色 */
}

/* 移动端适配 */
@media (max-width: 991px) {
    .company-header.scrolled .nav-item {
        color: #333 !important;
    }
}
/* 汉堡菜单按钮样式 */
.navbar-toggler {
    padding: 0;
    width: 32px;
    height: 32px;
    border: none;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
}

.navbar-toggler:focus {
    box-shadow: none;
    outline: 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%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 24px;
    height: 24px;
}

/* 按钮样式 */
.btn-primary {
    background-color: transparent;
    border-color: var(--primary-color);
    padding: 0.4rem 1rem;
    transition: all 0.3s;
    color: var(--primary-color);
    border-radius: 50px;
    font-size: 0.75rem;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:focus, .btn-primary:active, .btn-primary:focus-visible {
    background-color: var(--secondary-color)!important;
    border-color: var(--secondary-color)!important;
    transform: translateY(-2px);
}
.other-link{
    font-size: 0.75rem;
    color: var(--text-color);
    text-decoration: none;
}
.mr-4{
    margin-right: 4rem;
}
.other-link img{
    width: 0.751rem;
    height: 0.75rem;
    margin-right: 0.5rem;
}
/* 移动端适配 */
@media (max-width: 991px) {
    .header {
        position: fixed;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        padding: 0;
    }

    .top-header {
        padding: 0.5rem 0;
    }

    .logo img {
        height: 32px;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
    }

    .nav-list-item {
        width: 100%;
        text-align: center;
    }

    .nav-item {
        padding: 0.75rem 1rem;
    }

    .nav-item:hover,
    .nav-item.active {
        background: rgba(130, 87, 230, 0.1);
        width: calc(100% + 76px);
        margin-left: -38px;
    }
    .nav-item.active::after{
        content: none;
    }
    .mobile-login {
        text-align: center;
    }

    .btn-primary {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0.5rem 0;
    }

    .logo img {
        height: 28px;
    }
}

/* 导航核心样式 */
.nav-extra {
    display: flex;
    align-items: center;
}

.nav-contact {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-icon {
    width: 20px;
    margin-right: 8px;
}

.nav-contact:hover {
    color: var(--primary-color);
}

/* 移动端导航适配 */
@media (max-width: 991px) {
    body {
        padding-top: 64px; /* 移动端导航栏高度 */
    }
}

@media (max-width: 991px) {
    .company-header {
        background: transparent !important; /* 移动端默认透明 */
    }
    
    .company-header .main-nav {
        background: transparent; /* 初始透明背景 */
        box-shadow: none;
    }
    
    /* 菜单展开时样式 */
    .company-header .main-nav.collapsing,
    .company-header .main-nav.show {
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .nav-item:hover,
    .nav-item.active {
        background: rgba(130, 87, 230, 0.1);
    }
}

/* 在nav.css中添加 */
.nav-list-item.dropdown .bi-caret-down-fill {
    font-size: 0.7em;
    vertical-align: middle;
    margin-left: 0.3rem;
    transition: transform 0.3s ease;
}

.nav-list-item.dropdown.show .bi-chevron-down {
    transform: rotate(180deg);
}
.down-list {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 0 16px 1px rgb(193 115 255 / 12%);
    border: none;
    line-height: 32px;
    margin-left: -50%;
    display: none;
}
.dropdown-item:focus{
    color: #8257e6;
    background-color: hsl(258deg 74% 65% / 10%);
}
.dropdown-item:hover {
    color: #8257e6;
    background-color: transparent;
}
.dropdown-toggle::after {
    content: none;
}

/* 移动端导航样式 */
@media (max-width: 991px) {
    .nav-list-item.dropdown .nav-item.dropdown-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav-list-item.dropdown .nav-item.dropdown-toggle .bi {
        transition: transform 0.3s ease;
    }

    .nav-list-item.dropdown .nav-item.dropdown-toggle[aria-expanded="true"] .bi {
        transform: rotate(180deg);
    }

    .nav-list-item.dropdown .dropdown-menu {
        position: static !important;
        width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
        transform: none !important;
        display: none;
    }

    .nav-list-item.dropdown .dropdown-menu.show {
        display: block;
        text-align: center;
    }

    .nav-list-item.dropdown .dropdown-item {
        padding: 8px 16px;
        white-space: normal;
        color: #6909E1;
    }

    .nav-list-item.dropdown .dropdown-item:hover {
        background-color: rgba(136, 40, 255, 0.1);
    }

    /* 确保下拉菜单显示在正确的位置 */
    .navbar-collapse {
        max-height: calc(100vh - 48px);
        overflow-y: auto;
    }

    .nav-list {
        width: 100%;
        overflow: hidden;
    }

    /* 移除桌面端的下拉菜单样式 */
    .down-list {
        margin-left: 0;
        box-shadow: none;
        border-radius: 0;
    }
}
