/* ============================================================
 * layout.css — 页面布局（顶部导航、侧边栏、主内容区）
 * 依赖：base.css
 * ============================================================ */

/* 顶部导航 */
.header {
    background: linear-gradient(135deg, #00838f 0%, #006064 100%);
    color: white;
    padding: 0 24px;
    height: 64px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 22px;
    font-weight: 600;
}

.header .subtitle {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    text-align: right;
    font-size: 13px;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.breadcrumb {
    font-size: 13px;
    margin-top: 2px;
}

.breadcrumb .crumb-current {
    opacity: 0.9;
}

/* 主布局 */
.main-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 64px);
}

.content-area {
    flex: 1;
    padding: 20px 28px;
    overflow-y: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #001529;
    color: #fff;
    flex-shrink: 0;
    transition: width 0.25s;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar-logo {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: #00838f;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-logo .logo-text {
    display: none;
}

.sidebar-menu {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 44px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
    position: relative;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.menu-item.active {
    background: linear-gradient(90deg, rgba(0, 131, 143, 0.25), rgba(0, 131, 143, 0));
    color: #fff;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #00838f;
    border-radius: 0 2px 2px 0;
}

.menu-icon {
    font-size: 18px;
    width: 20px;
    flex-shrink: 0;
}

.menu-text {
    margin-left: 12px;
    flex: 1;
    font-size: 14px;
}

.sidebar.collapsed .menu-text,
.sidebar.collapsed .menu-arrow,
.sidebar.collapsed .submenu {
    display: none;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 0;
}

.menu-arrow {
    font-size: 12px;
    transition: transform 0.25s;
}

.menu-item.open .menu-arrow {
    transform: rotate(90deg);
}

.submenu {
    background: rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}

.submenu.open {
    max-height: 300px;
}

.submenu .menu-item {
    padding-left: 50px;
    height: 40px;
    font-size: 13px;
}

/* 页面面板切换 */
.page-panel {
    display: none;
    animation: fadeIn 0.25s;
}

.page-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
