#js-page-content.acme-scm-workspace-active {
    position: relative;
    min-width: 0;
}
.acme-scm-workspace-active > #scmShellMain {
    min-width: 0;
    margin-right: var(--acme-scm-workspace-rail-width, 330px);
}

#scmShellWorkspace[hidden] {
    display: none !important;
}

#scmShellBusinessDrawer[hidden] {
    display: none !important;
}

#scmShellBusinessDrawer {
    --acme-scm-business-drawer-target-width: 880px;
    position: absolute;
    box-sizing: border-box;
    z-index: 20;
    top: 6px;
    right: var(--acme-scm-workspace-rail-width, 330px);
    bottom: auto;
    left: auto;
    display: flex;
    width: min(var(--acme-scm-business-drawer-target-width), max(0px, calc(100% - var(--acme-scm-workspace-rail-width, 330px))));
    max-width: max(0px, calc(100% - var(--acme-scm-workspace-rail-width, 330px)));
    height: calc(100vh - 2.5rem - 2.125rem - 12px);
    min-width: 0;
    padding-left: 0;
    overflow: visible;
    pointer-events: none;
}

#scmShellBusinessDrawer.is-open {
    display: flex;
}

#scmShellBusinessDrawer.is-collapsed {
    width: 7px;
    max-width: 7px;
    padding-left: 0;
}

#scmShellBusinessDrawer.is-collapsed > .acme-purchase-order-drawer,
#scmShellBusinessDrawer.is-collapsed > .gs-spu-drawer {
    display: none !important;
}

#scmShellBusinessDrawer > .acme-purchase-order-drawer,
#scmShellBusinessDrawer > .gs-spu-drawer {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
    min-height: 0;
    margin-left: 0;
    pointer-events: auto;
}

.scm-shell-business-drawer-toggle {
    position: absolute;
    z-index: 1;
    top: 50%;
    bottom: auto;
    left: -17px;
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--acme-color-text-muted, #94a3b8);
    cursor: pointer;
    pointer-events: auto;
    transform: translateY(-50%);
    transition: color .15s ease, transform .15s ease;
}

.scm-shell-business-drawer-toggle::before {
    position: absolute;
    inset: 5px;
    content: "";
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--acme-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, .05));
    pointer-events: none;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.scm-shell-business-drawer-toggle:hover,
.scm-shell-business-drawer-toggle:focus-visible {
    color: var(--acme-color-primary, #41b584);
    transform: translate(-1px, -50%);
}

.scm-shell-business-drawer-toggle:hover::before,
.scm-shell-business-drawer-toggle:focus-visible::before {
    border-color: var(--acme-color-primary, #41b584);
    background: var(--acme-color-primary-light, #ecf8f3);
    box-shadow: 0 2px 6px rgba(65, 181, 132, .14);
}

.scm-shell-business-drawer-toggle:focus-visible {
    outline: 2px solid var(--acme-color-primary, #41b584);
    outline-offset: -2px;
}

.scm-shell-business-drawer-toggle > i {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    transition: transform .18s ease;
}

#scmShellBusinessDrawer.is-collapsed .scm-shell-business-drawer-toggle > i {
    transform: rotate(180deg);
}

#scmShellBusinessDrawer.is-collapsed .scm-shell-business-drawer-toggle {
    width: 34px;
}

#scmShellWorkspace {
    position: absolute;
    z-index: 30;
    top: 6px;
    right: 0;
    bottom: auto;
    width: var(--acme-scm-workspace-rail-width, 330px);
    min-width: 0;
    height: calc(100vh - 2.5rem - 2.125rem - 12px);
}

#scmShellWorkspace > .scm-workspace-rail {
    height: 100%;
    max-width: min(720px, 60vw);
}

/* 原工作台的手机独立页会强制展开；shell 内仍须保留旧业务页和收起入口。 */
@media (max-width: 767.98px) {
    #js-page-content.acme-scm-workspace-active {
        position: relative;
    }

    .acme-scm-workspace-active > #scmShellMain {
        margin-right: var(--acme-scm-workspace-rail-width, 46px);
        padding-right: 0;
    }

    #scmShellWorkspace:not([hidden]) {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(var(--acme-scm-workspace-rail-width, 330px), calc(100vw - 70px));
        height: auto;
        z-index: 10;
        box-shadow: var(--acme-shadow-lg);
    }

    #scmShellWorkspace > .scm-workspace-rail {
        width: min(var(--scm-rail-w), calc(100vw - 70px));
        max-width: calc(100vw - 70px);
        flex: none;
    }

    #scmShellWorkspace > .scm-workspace-rail.is-collapsed {
        width: 46px;
    }

    #scmShellWorkspace .scm-workspace-rail.is-collapsed .scm-workspace-rail__collapsed {
        display: flex;
    }

    #scmShellWorkspace .scm-workspace-rail.is-collapsed .scm-workspace-rail__expanded,
    #scmShellWorkspace .scm-workspace-rail:not(.is-collapsed) .scm-workspace-rail__collapsed {
        display: none;
    }

    #scmShellWorkspace #workspaceRailCollapse {
        display: inline-flex;
    }

    #scmShellBusinessDrawer:not([hidden]) {
        position: absolute;
        top: 0;
        right: 46px;
        bottom: 0;
        left: auto;
        width: min(var(--acme-scm-business-drawer-target-width), calc(100% - 46px));
        max-width: calc(100% - 46px);
        height: auto;
        margin: 0;
        padding-left: 0;
        pointer-events: auto;
        z-index: 11;
        box-shadow: var(--acme-shadow-lg);
    }

    #scmShellBusinessDrawer > .scm-shell-business-drawer-toggle {
        display: none;
    }

    #scmShellBusinessDrawer > .acme-purchase-order-drawer,
    #scmShellBusinessDrawer > .gs-spu-drawer {
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    /* 保留移动端原有单栏抽屉策略，不额外挤出业务卡片的桌面渐变带。 */
    #scmShellBusinessDrawer.is-collapsed > .acme-purchase-order-drawer,
    #scmShellBusinessDrawer.is-collapsed > .gs-spu-drawer {
        display: block !important;
    }
}
