/* 统一导航样式 */

/* 侧边栏基础样式 */
.sidebar {
    width: 280px;
    background: #1f2937;
    border-right: 1px solid #374151;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #374151;
    background: #111827;
}

.sidebar-content {
    padding: 1rem 0;
}

/* 菜单项样式 */
.menu-item {
    margin-bottom: 0.25rem;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-header:hover {
    background: #374151;
    color: #ffffff;
}

.menu-header.has-children {
    user-select: none;
}

/* 活动菜单样式 */
.menu-item.active .menu-header,
.menu-item.parent-active .menu-header {
    background: #2d5016;
    color: #ffffff;
    border-left-color: #4a7c59;
}

.menu-item.active .menu-header {
    background: #1e3a8a;
    border-left-color: #3b82f6;
}

/* 子菜单样式 */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #111827;
}

.submenu.expanded {
    max-height: 500px;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.5rem 0.625rem 3rem;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.875rem;
}

.submenu-item:hover {
    background: #374151;
    color: #ffffff;
    border-left-color: #6b7280;
}

.submenu-item.active {
    background: #1e3a8a;
    color: #ffffff;
    border-left-color: #3b82f6;
    font-weight: 500;
}

/* 菜单链接样式（无子菜单的项目） */
.menu-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-link:hover {
    background: #374151;
    color: #ffffff;
    border-left-color: #6b7280;
}

.menu-link.active {
    background: #1e3a8a;
    color: #ffffff;
    border-left-color: #3b82f6;
    font-weight: 500;
}

/* 面包屑导航样式 */
.breadcrumb-container {
    background: #1f2937;
    border-bottom: 1px solid #374151;
    padding: 0.75rem 1.5rem;
}

.breadcrumb-container nav {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.breadcrumb-container a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-container a:hover {
    color: #ffffff;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #6b7280;
    font-size: 0.75rem;
}

/* 系统状态指示器 */
.system-status {
    padding: 1rem 1.5rem;
    border-top: 1px solid #374151;
    background: #111827;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #9ca3af;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 0.5rem;
}

.status-indicator.online {
    background: #10b981;
    box-shadow: 0 0 4px #10b981;
}

.status-indicator.warning {
    background: #f59e0b;
    box-shadow: 0 0 4px #f59e0b;
}

.status-indicator.offline {
    background: #ef4444;
    box-shadow: 0 0 4px #ef4444;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .menu-header,
    .submenu-item,
    .menu-link {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .submenu-item {
        padding-left: 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* 动画效果 */
.menu-header i:last-child {
    transition: transform 0.2s ease;
}

.menu-item.expanded .menu-header i:last-child {
    transform: rotate(90deg);
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #111827;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* 加载状态 */
.menu-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #9ca3af;
}

.menu-loading i {
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.menu-tooltip {
    position: relative;
}

.menu-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #111827;
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    margin-left: 0.5rem;
    border: 1px solid #374151;
}

.menu-tooltip:hover::after {
    opacity: 1;
}

/* 菜单折叠状态 */
.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .menu-header span,
.sidebar.collapsed .submenu,
.sidebar.collapsed .breadcrumb-container,
.sidebar.collapsed .system-status {
    display: none;
}

.sidebar.collapsed .menu-header {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .menu-header i:first-child {
    margin: 0;
}

/* 主题切换 */
.theme-dark .sidebar {
    background: #0f172a;
    border-color: #1e293b;
}

.theme-dark .menu-header {
    color: #cbd5e1;
}

.theme-dark .submenu {
    background: #020617;
}

.theme-dark .submenu-item {
    color: #94a3b8;
}
