.topbar {
    height: 72px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 22px;
    gap: 28px;
    position: relative;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 220px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6575ee, #8b95f7);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(86, 103, 232, .25);
}

.brand-title {
    font-size: 15px;
    font-weight: 800;
}

.brand-sub {
    font-size: 9px;
    color: #a1aaba;
    letter-spacing: 1.2px;
    margin-top: 3px;
}


/* =========================================================
   主菜单
========================================================= */

.menu-bar {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1;
}

.menu-bar button {
    border: 0;
    background: transparent;

    color: #465166;

    padding: 8px 13px;

    border-radius: 8px;

    font-size: 13px;
    font-weight: 650;

    letter-spacing: 0.2px;

    line-height: 1;

    cursor: pointer;

    white-space: nowrap;

    transition:
        color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.menu-bar button:hover {
    background: #f3f5fa;
    color: #273247;
}

.menu-bar button:active {
    background: #eceff7;
    color: #24304a;
}

.menu-bar button:focus-visible {
    outline: none;

    background: #f1f3fa;

    color: #273247;

    box-shadow:
        0 0 0 2px rgba(101, 117, 238, .12);
}


/* =========================================================
   右侧操作按钮
========================================================= */

.top-actions {
    display: flex;
    gap: 9px;
}

.btn {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 9px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
}

.btn:hover {
    background: #f6f7fa;
}

.btn.soft {
    background: var(--soft);
    color: #4d5fd5;
    border-color: #dfe3ff;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 8px 18px rgba(86, 103, 232, .2);
}


/* =========================================================
   Topbar 折叠 / 展开
========================================================= */

.topbar {
    transition:
        height 0.25s ease,
        padding 0.25s ease,
        border-color 0.25s ease;
}


/* =========================================================
   折叠按钮
========================================================= */

.topbar-toggle {
    position: absolute;

    left: 50%;
    bottom: -10px;

    transform: translateX(-50%);

    width: 30px;
    height: 18px;

    padding: 0;

    border: 1px solid var(--line);
    border-radius: 0 0 8px 8px;

    background: #fff;
    color: #687386;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 20;

    font-size: 13px;
    line-height: 1;

    box-shadow:
        0 3px 8px rgba(0, 0, 0, .06);

    transition:
        color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.topbar-toggle:hover {
    color: var(--primary);
    background: #f8f9ff;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, .10);
}

.topbar-toggle-icon {
    display: block;
    line-height: 1;
    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   Topbar 收起状态
========================================================= */

.topbar.collapsed {
    height: 0;
    min-height: 0;

    padding-top: 0;
    padding-bottom: 0;

    border-bottom-color: transparent;
}


/*
 * 收起时隐藏内容
 * 不使用 display:none，
 * 这样展开时可以保持平滑过渡。
 */

.topbar.collapsed>*:not(.topbar-toggle) {
    opacity: 0;
    visibility: hidden;
}


/* =========================================================
   收起后的展开提示
========================================================= */

.topbar.collapsed .topbar-toggle {
    bottom: -18px;

    width: 34px;
    height: 20px;

    border-radius: 0 0 10px 10px;
}


/* =========================================================
   小屏幕
========================================================= */

@media (max-width: 900px) {

    .topbar {
        gap: 14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .brand {
        min-width: auto;
    }

    .brand-sub {
        display: none;
    }

    .menu-bar {
        gap: 0;
    }

    .menu-bar button {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 12px;
    }

    .top-actions {
        gap: 5px;
    }

}