/* 化则智核 · 布局 */

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 顶栏 */
#topbar {
    background: #1f1f22;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-main);
    flex-shrink: 0;
    height: 52px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-left .brand {
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
}

.topbar-left .brand-sub {
    color: #8899aa;
    font-size: 11px;
    letter-spacing: 2px;
}

.topbar-center {
    color: #8899aa;
    font-size: 12px;
}

.topbar-right .status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8899aa;
    font-size: 12px;
}

.topbar-right .status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    display: inline-block;
}

.topbar-right .status.online .dot {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.topbar-right .status.offline .dot {
    background: var(--error);
}

/* 容器 */
.container {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* 侧栏 */
#sidebar {
    width: 200px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-main);
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.nav-item {
    padding: 11px 24px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-panel-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-panel-hover);
    color: var(--accent);
    border-left-color: var(--accent);
}

#sidebar .spacer { flex: 1; }

#sidebar .footer {
    padding: 12px 24px;
    font-size: 11px;
    color: var(--text-weak);
    line-height: 1.8;
}

/* 侧栏分组 */
.nav-divider {
    height: 1px;
    background: var(--border-main);
    margin: 12px 24px;
}

.nav-group-title {
    padding: 8px 24px 4px;
    font-size: 10px;
    color: var(--text-weak);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-external {
    display: block;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 主区 */
#main {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-main);
    min-width: 0;
}

/* 主区内的通用 padding */
.page {
    padding: 24px 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 2px;
}

/* 移动端 */
@media (max-width: 768px) {
    #sidebar { width: 60px; }
    .nav-item {
        padding: 12px 0;
        text-align: center;
        font-size: 20px;
    }
    .nav-item span.label { display: none; }
    .page { padding: 16px; }
}