/* ============================================
   布局与导航样式
   ============================================ */

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

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

#current-model {
    color: var(--text-secondary);
}

.main-layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #001529 0%, #002140 100%);
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.sidebar.nav-sidebar {
    padding-top: 8px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
}

.nav-group-title {
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    padding: 16px 16px 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 0;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

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

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(24, 144, 255, 0.3) 0%, rgba(24, 144, 255, 0.1) 100%);
}

.nav-item.active::before {
    transform: scaleY(1);
}

.nav-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
    font-weight: 400;
}

/* 子菜单样式 */
.nav-item.has-submenu {
    cursor: pointer;
    justify-content: flex-start;
}

.nav-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.45);
}

.nav-item.has-submenu.expanded .nav-arrow {
    transform: rotate(90deg);
}

.nav-submenu {
    display: none;
    flex-direction: column;
    padding-left: 12px;
    margin-left: 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-submenu.expanded {
    display: flex;
}

.nav-subitem {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 6px;
    margin: 2px 0;
    font-size: 13px;
}

.nav-subitem:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-subitem.active {
    color: var(--primary-color);
    background: rgba(24, 144, 255, 0.1);
}

.nav-subitem .nav-icon {
    font-size: 14px;
    margin-right: 10px;
    width: 18px;
}

.nav-subitem .nav-text {
    font-size: 13px;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 24px;
    background: var(--bg-color);
    min-height: calc(100vh - var(--header-height));
}

.tab-nav-with-model {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.tab-nav {
    display: flex;
}

.tab-btn {
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    background: var(--bg-white);
    border-radius: 0 0 var(--radius) var(--radius);
    min-height: calc(100vh - 200px);
    overflow-x: hidden;
    max-width: 100%;
}

.tab-panel {
    display: none;
    max-width: 100%;
}

.tab-panel.active {
    display: block;
    max-width: 100%;
}

.sub-tab-nav {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-white);
}

.sub-tab-btn {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.sub-tab-btn:hover {
    color: var(--primary-color);
}

.sub-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.sub-tab-content {
    padding: 16px;
}

.sub-tab-panel {
    display: none;
}

.sub-tab-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.panel-actions {
    display: flex;
    gap: 8px;
}
