/* navbar.css - 导航栏美化样式 */
/* ===============================
   合并后的导航栏样式 (包含原modules/navbar.css内容)
   =============================== */

/* 基础导航栏样式 */
.custom-navbar {
    background-color: #07073fc5 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    max-height: 80px;
    /* 限制导航栏高度 */
    transition: background-color 0.3s ease; /* 从modules/navbar.css添加 */
}

/* 品牌logo区域 - 新增容器控制 */
.navbar-brand-container {
    display: flex;
    align-items: center;
    max-width: 300px;
    /* 固定品牌区域宽度 */
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
    /* 防止压缩 */
}

.navbar-brand {
    font-weight: 600;
    color: #fff !important;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* 从modules/navbar.css添加的品牌样式 */
.custom-navbar .navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
    color: #D4AF37 !important;
    /* 金色文字 */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-navbar .navbar-brand img {
    height: 40px;
    width: auto;
}

.custom-navbar .navbar-brand:hover {
    color: #F1D97A !important;
    /* 更亮金色 */
}

.navbar-brand img {
    transition: transform 0.3s;
    margin-right: 10px;
    max-height: 40px;
    max-width: 40px;
    flex-shrink: 0;
    /* 防止图片压缩 */
}

.navbar-brand span {
    font-size: 1.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-brand:hover img {
    transform: rotate(10deg);
}

/* 导航菜单项 - 新增布局控制 */
.navbar-nav {
    display: flex;
    flex-wrap: nowrap;
    /* 防止菜单项换行 */
    width: 100%;
    justify-content: flex-end;
    /* 菜单项靠右 */
}

.nav-item {
    min-width: 80px;
    /* 最小菜单项宽度 */
    text-align: center;
    flex-shrink: 0;
    /* 防止菜单项压缩 */
}

/* 从modules/navbar.css添加的导航链接样式 */
.custom-navbar .nav-link {
    color: #D4AF37 !important;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.custom-navbar .nav-link:hover {
    color: #ffffff !important;
    /* 高亮 */
    background-color: rgba(0, 108, 154, 0.3);
    /* 半透明景泰蓝 */
    border-radius: 6px;
    /* 稍微圆角 */
}

.custom-navbar:hover .nav-link:not(:hover) {
    color: rgba(212, 175, 55, 0.5) !important;
    /* 其他变浅 */
}

.nav-link {
    position: relative;
    padding: 0.5rem 1rem !important;
    margin: 0 2px;
    border-radius: 4px;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.85) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    /* 防止文字换行 */
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.nav-link i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* 下拉菜单样式优化 */
.dropdown-menu {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 5px;
    background-color: #2c3e50;
    min-width: 200px;
    /* 固定下拉菜单最小宽度 */
}

/* 从modules/navbar.css添加的下拉菜单样式 */
.custom-navbar .dropdown-menu {
    background-color: #1A1233;
    /* 深紫，和整体统一 */
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 1.5rem;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    white-space: nowrap;
    /* 防止下拉项文字换行 */
}

/* 从modules/navbar.css添加的下拉项样式 */
.custom-navbar .dropdown-item {
    color: #D4AF37;
    /* 金色文字 */
}

.custom-navbar .dropdown-item:hover {
    background-color: #006C9A;
    /* 景泰蓝 hover 背景 */
    color: #ffffff;
    /* hover 时字体改白 */
}

.dropdown-item:hover {
    background-color: #3498db;
    color: #fff;
    padding-left: 2rem;
}

.dropdown-item i {
    margin-right: 10px;
    width: 18px;
    text-align: center;
    font-size: 1rem;
}

.dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

/* 从modules/navbar.css添加的toggler样式 */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(212,175,55,0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 1rem 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* 新增柔和阴影 */
        background-color: #07073fc5; /* 确保背景一致 */
        margin-top: 0.5rem; /* 添加间距 */
        border-radius: 0 0 10px 10px; /* 可选圆角 */
    }

    .navbar-brand-container {
        max-width: 200px;
    }

    .dropdown-menu {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
        box-shadow: none; /* 保持下拉菜单无阴影 */
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
    }

    .nav-item {
        min-width: auto;
        /* 移动端取消最小宽度 */
    }

    /* 从modules/navbar.css添加的移动端样式 */
    @media (max-width: 768px) {
        .custom-navbar .nav-link {
            font-size: 0.95rem;
            margin: 0.4rem 0;
        }
    }
}

/* 活动状态指示器 */
.nav-item.active .nav-link {
    background-color: rgba(52, 152, 219, 0.2);
    color: #fff !important;
}

.nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: #3498db;
}

/* 下拉菜单动画 */
.dropdown-menu {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}