/* 管理后台菜单样式 */

/* 菜单项基础样式 */
/* .nav-sidebar .nav-item {
    margin: 0;
} */

.nav-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative;
    font-size: 14px;
    text-decoration: none;
}

.nav-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(2px);
    text-decoration: none;
}

.nav-sidebar .nav-link.active {
    background: linear-gradient(90deg, #1890ff, rgba(24, 144, 255, 0.8));
    color: #fff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.nav-sidebar ::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #fff;
}

/* 菜单图标样式 */
.nav-sidebar .nav-link .nav-icon {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.nav-sidebar .nav-link span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 子菜单箭头 */
.nav-sidebar .nav-link .submenu-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 14px;
}

.nav-sidebar .menu-open > .nav-link .submenu-arrow {
    transform: rotate(90deg);
}

/* 子菜单样式 */
.nav-sidebar .nav-treeview {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 4px 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nav-sidebar .nav-treeview .nav-link {
    padding: 10px 20px 10px 50px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.nav-sidebar .nav-treeview .nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.nav-sidebar .nav-treeview .nav-link.active {
    background-color: rgba(24, 144, 255, 0.3);
    color: #fff;
}

/* 导航标题 */
.nav-sidebar .nav-header {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px 20px 8px;
    margin: 0;
}

/* 响应式处理 */
@media (max-width: 768px) {
    .nav-sidebar .nav-link {
        padding: 10px 16px;
    }

    .nav-sidebar .nav-treeview .nav-link {
        padding: 8px 16px 8px 40px;
    }
}

/* 加载动画 */
.nav-sidebar .nav-link.loading {
    opacity: 0.6;
    pointer-events: none;
}

.nav-sidebar .nav-link.loading::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Logo区域样式 */
.main-header .navbar-brand {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
}

.main-header .navbar-brand:hover {
    color: #fff;
    text-decoration: none;
}

.main-header .navbar-brand img {
    margin-right: 0.5rem;
}

/* 首页默认选中样式 */
.nav-sidebar .nav-item:first-child .nav-link {
    font-weight: 500;
}

/* 优化菜单展开/收起动画 */
.nav-sidebar .nav-treeview {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.nav-sidebar .menu-open .nav-treeview {
    max-height: 500px;
    transition: max-height 0.3s ease-in;
}



/* 菜单项样式 */
.nav-item .nav-link p {
    margin: 0;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

/* 有子菜单的菜单项样式 */
.has-treeview .nav-link p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    line-height: 1.4;
}
