﻿/* ============================================
   美冠塔口腔患者分析系统 - 布局样式
   ============================================ */

/* 主应用布局 */
.app-container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.app-header {
    flex-shrink: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.app-sidebar {
    flex-shrink: 0;
    width: 256px;
    background: white;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    /* padding 由 sidebar.css 和 _sidebar_tree.html 内部控制，layout.css 不加统一内边距 */
}

.app-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 0;
    background: #F4F5F7;
}

/* 移动端遮罩 */
.app-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.app-sidebar-overlay.show {
    display: block;
}

/* 侧边栏分组样式 */
.sidebar-group {
    margin-bottom: 2px;
}

.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-group-header:hover {
    background: rgba(0,0,0,0.06);
    color: #1e3a8a;
}

.sidebar-group-header .group-chevron {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}

.sidebar-group-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px 0 4px 0;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease, opacity 0.2s;
    opacity: 1;
}

.sidebar-group-body.collapsed {
    max-height: 0;
    opacity: 0;
}

/* 侧边栏菜单项 */
.sidebar-group .nav-item {
    padding: 9px 14px 9px 36px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-group .nav-item:hover {
    background: rgba(0,0,0,0.06);
    color: #1a1a2e;
}

.sidebar-group .nav-item.active {
    background: rgba(59,130,246,0.15);
    color: #1B3A7B;
    font-weight: 600;
}

.sidebar-group .nav-item i {
    width: 18px;
    font-size: 14px;
    flex-shrink: 0;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
    }

    .app-main {
        padding: 0;
    }
}
