/* 现代化侧边栏布局架构 */
.page-container {
    display: flex;
    flex-direction: row; /* 显式设置为水平排列，防止继承 common.css 的 column */
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: var(--bg-main);
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    height: 100%;
    background: rgba(10, 15, 25, 0.85);
    backdrop-filter: blur(25px);
    border-right: 1px solid var(--border-line);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    padding: 0 !important;
}

.sidebar-logo {
    height: 70px;
    padding: 0 24px;
    font-size: 18px;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    letter-spacing: 2px;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    box-sizing: border-box;
}

.sidebar-logo:hover {
    text-shadow: 0 0 25px var(--primary-glow);
    background: rgba(0, 229, 255, 0.03);
}

.sidebar-logo::before {
    content: "";
    width: 28px;
    height: 28px;
    background: var(--bg-deep);
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px var(--primary-glow), inset 0 0 10px var(--primary-glow);
    border-radius: 6px;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: logo-pulse 2s infinite ease-in-out;
    flex-shrink: 0;
}

.sidebar-logo::after {
    content: "";
    position: absolute;
    left: 33px; 
    top: 42%;
    width: 14px;
    height: 14px;
    background: var(--primary);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transform: translateY(-50%);
    animation: logo-inner-pulse 2s infinite ease-in-out;
}

@keyframes logo-pulse {
    0%, 100% { transform: rotate(45deg) scale(1); border-color: var(--primary); }
    50% { transform: rotate(45deg) scale(1.1); border-color: var(--accent); }
}

@keyframes logo-inner-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.6); opacity: 0.5; }
}

.sidebar-nav {
    flex-grow: 1;
    padding: 24px 12px;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.nav-item:hover a {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-bright);
    padding-left: 20px;
}

.nav-item.active a {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(0, 229, 255, 0.02));
    color: var(--primary);
    border: 1px solid rgba(0, 229, 255, 0.2);
    box-shadow: inset 0 0 15px rgba(0, 229, 255, 0.05);
    font-weight: 700;
}

/* 主容器 */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-deep);
    overflow: hidden;
    position: relative;
}

/* 顶部栏 */
.top-header {
    height: 70px;
    background: rgba(10, 15, 25, 0.4);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    flex-shrink: 0;
    z-index: 1500;
}

.page-current-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 移动端菜单开关 */
.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.sidebar-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-bright);
    border-radius: 2px;
    transition: 0.3s;
}

/* 兼容旧布局代码的隐藏 */
.page-header { display: none !important; }
.mobile-nav { display: none !important; }
.mobile-nav-toggle { display: none !important; }

/* 内容区域 */
.page-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    animation: fadeIn 0.6s ease-out;
}

/* 响应式断点 */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .top-header {
        padding: 0 15px;
    }
    
    .page-current-title {
        font-size: 16px;
    }

    .dashboard-container {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }
}