html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    overflow: hidden;
}

#appShell {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ---------- 左侧菜单 ---------- */

#sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #1c2b4a;
    color: #cfd6e4;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
    overflow: hidden;
}

#appShell.collapsed #sidebar {
    width: 56px;
}

#sidebarHeader {
    height: 56px;
    line-height: 56px;
    padding: 0 16px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    background: #16213c;
}

#sidebarHeader .fa {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

#sidebarMenu {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.menu-group-title {
    padding: 12px 16px;
    cursor: pointer;
    white-space: nowrap;
    color: #f0a830;
    display: flex;
    align-items: center;
}

.menu-group-title .fa:first-child {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

.menu-group-title .menu-caret {
    margin-left: auto;
    transition: transform 0.2s ease;
    font-size: 12px;
}

.menu-group.open > .menu-group-title .menu-caret {
    transform: rotate(180deg);
}

.menu-root {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-children {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
    background: #16213c;
}

.menu-group.open > .menu-children {
    max-height: 1000px;
}

/* 子菜单层级越深，缩进越多；多级嵌套时父级的 padding 会叠加，这里再额外加一点 */
.menu-children .menu-group-title {
    padding-left: 28px;
}

.menu-children .menu-item {
    padding-left: 56px;
}

.menu-item {
    padding: 10px 16px 10px 44px;
    cursor: pointer;
    white-space: nowrap;
    color: #cfd6e4;
}

.menu-item:hover,
.menu-item.active {
    background: #2a3c63;
    color: #fff;
}

#appShell.collapsed .menu-text,
#appShell.collapsed #sidebarHeader span.logo-text {
    display: none;
}

#appShell.collapsed .menu-group-title .menu-caret {
    display: none;
}

#appShell.collapsed .menu-children {
    max-height: 0 !important;
}

/* ---------- 主区域 ---------- */

#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#tabBar {
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    background: #eceff3;
    border-bottom: 1px solid #d7dbe2;
    padding: 0 4px;
}

#tabBar .icon-btn {
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    color: #555;
    flex-shrink: 0;
}

#tabBar .icon-btn:hover {
    background: #dde2ea;
}

#tabs {
    flex: 1;
    display: flex;
    overflow-x: auto;
    height: 100%;
    align-items: center;
}

.tab-item {
    display: flex;
    align-items: center;
    height: 30px;
    padding: 0 14px;
    margin-right: 2px;
    background: #e4e8ee;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 2px 2px 0 0;
    flex-shrink: 0;
}

.tab-item .fa {
    margin-right: 6px;
}

.tab-item.active {
    background: #fff;
    color: #1c2b4a;
    font-weight: bold;
    box-shadow: 0 -2px 0 #1c2b4a inset;
}

.tab-close {
    margin-left: 8px;
    color: #999;
}

.tab-close:hover {
    color: #d33;
}

#tabBarRight {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
}

#notifyBadge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #f5862a;
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    line-height: 14px;
    min-width: 14px;
    text-align: center;
    padding: 0 2px;
}

.toolbar-dropdown {
    position: relative;
}

.toolbar-dropdown-label {
    height: 40px;
    line-height: 40px;
    padding: 0 10px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.toolbar-dropdown-label:hover {
    background: #dde2ea;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    background: #fff;
    border: 1px solid #d7dbe2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    z-index: 1000;
}

.toolbar-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu > div {
    padding: 8px 14px;
    cursor: pointer;
    color: #333;
}

.dropdown-menu > div:hover {
    background: #f0f2f5;
}

/* ---------- 内容区 ---------- */

#contentArea {
    flex: 1;
    position: relative;
    background: #fff;
}

.tab-pane {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.home-placeholder {
    padding: 40px;
    color: #999;
    text-align: center;
}
