#ConsultWidget {
    --consult-launcher-theme: #fd560f;
    --consult-launcher-theme-rgb: 253, 86, 15;
    --consult-back-to-top: #e0115f;
    --consult-back-to-top-rgb: 224, 17, 95;
    --consult-back-to-top-dark: #c2004b;
    --consult-online: #22c55e;
    --consult-online-rgb: 34, 197, 94;
}

.app-s-iframe-box {
    position: fixed;
    z-index: 99999999;
    left: 20px;
    bottom: 150px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    max-height: 600px;
    height: 100% !important;
    max-width: 400px;
    width: 100%;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    pointer-events: none;
}

.app-s-iframe-box.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#ConsultWidget.consult-launcher-theme-dark .app-s-iframe-box {
    background: #1c1c1e;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.app-s-consult-launcher {
    position: fixed;
    left: 20px;
    bottom: 80px;
    z-index: 10050;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    overflow: visible;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.app-s-consult-launcher:hover {
    transform: translateY(-2px);
}

.app-s-consult-launcher:active {
    transform: translateY(0);
}

.app-s-consult-launcher.minimized {
    left: -120px;
    opacity: 0;
    pointer-events: none;
}

.app-s-consult-launcher__pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 40px;
    padding: 0 18px 0 22px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1;
    background: linear-gradient(
        145deg,
        rgba(var(--consult-launcher-theme-rgb), 1) 0%,
        rgba(var(--consult-launcher-theme-rgb), 0.88) 100%
    );
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    box-shadow:
        0 10px 28px rgba(var(--consult-launcher-theme-rgb), 0.34),
        0 2px 8px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: box-shadow 0.25s ease;
}

.app-s-consult-launcher:hover .app-s-consult-launcher__pill {
    box-shadow:
        0 14px 32px rgba(var(--consult-launcher-theme-rgb), 0.42),
        0 4px 10px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.app-s-consult-launcher__label {
    white-space: nowrap;
    user-select: none;
}

.app-s-consult-launcher__online,
.app-s-consult-sidebar-online {
    position: absolute;
    top: -2px;
    left: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-sizing: border-box;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.app-s-consult-launcher__online.is-online,
.app-s-consult-sidebar-online.is-online {
    opacity: 1;
    transform: scale(1);
    background: var(--consult-online);
    box-shadow: 0 0 0 2px rgba(var(--consult-online-rgb), 0.25);
    animation: consult-online-pulse 2.4s ease-in-out infinite;
}

.app-s-consult-launcher__online.is-offline,
.app-s-consult-sidebar-online.is-offline {
    opacity: 1;
    transform: scale(1);
    background: #9ca3af;
    box-shadow: none;
    animation: none;
}

@keyframes consult-online-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(var(--consult-online-rgb), 0.22);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(var(--consult-online-rgb), 0.08);
    }
}

.app-s-consult-launcher__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ff4d4f;
    color: #ffffff;
    border-radius: 9px;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(255, 77, 79, 0.45);
}

.app-s-consult-sidebar {
    position: fixed;
    left: 0;
    bottom: 80px;
    z-index: 10049;
    min-width: 44px;
    height: 36px;
    padding: 0 10px 0 14px;
    background: linear-gradient(
        145deg,
        rgba(var(--consult-launcher-theme-rgb), 1) 0%,
        rgba(var(--consult-launcher-theme-rgb), 0.88) 100%
    );
    border-radius: 0 12px 12px 0;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-left: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 2px 0 14px rgba(var(--consult-launcher-theme-rgb), 0.3);
    transition: min-width 0.2s ease;
}

.app-s-consult-sidebar.show {
    display: flex;
}

.app-s-consult-sidebar:hover {
    min-width: 52px;
}

.app-s-consult-sidebar-icon {
    position: relative;
    display: flex;
    align-items: center;
    color: #fff;
}

.app-s-consult-sidebar-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding-left: 6px;
}

.app-s-consult-sidebar-online {
    position: relative;
    top: auto;
    left: auto;
    flex-shrink: 0;
}

.app-s-consult-sidebar-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
    border: 2px solid #fff;
}

.app-s-back-to-top-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10048;
    width: 48px;
    height: 48px;
    background: linear-gradient(
        145deg,
        var(--consult-back-to-top) 0%,
        var(--consult-back-to-top-dark) 100%
    );
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(var(--consult-back-to-top-rgb), 0.45);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.app-s-back-to-top-button.show {
    display: flex;
}

.app-s-back-to-top-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 12px 26px rgba(var(--consult-back-to-top-rgb), 0.52);
}

.app-s-back-to-top-button-icon {
    color: #fff;
    font-size: 22px;
}

#ConsultIframe {
    background: transparent !important;
    border: none !important;
}

body.theme-realisticsexdoll #ConsultWidget .app-s-consult-launcher__pill,
body.theme-shedoll #ConsultWidget .app-s-consult-launcher__pill,
#ConsultWidget.consult-launcher-theme-dark .app-s-consult-launcher__pill {
    background: linear-gradient(145deg, rgba(42, 42, 46, 0.98) 0%, rgba(24, 24, 28, 1) 100%);
    color: #f3f4f6;
    border-color: rgba(var(--consult-launcher-theme-rgb), 0.45);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.theme-realisticsexdoll #ConsultWidget .app-s-consult-sidebar,
body.theme-shedoll #ConsultWidget .app-s-consult-sidebar,
#ConsultWidget.consult-launcher-theme-dark .app-s-consult-sidebar {
    background: linear-gradient(145deg, rgba(42, 42, 46, 0.98) 0%, rgba(24, 24, 28, 1) 100%);
    border-color: rgba(var(--consult-launcher-theme-rgb), 0.4);
    border-left: none;
}

@media screen and (max-width: 720px) {
    .app-s-iframe-box {
        border-radius: 16px 16px 0 0;
        max-height: min(82vh, 640px);
        max-width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
        transform: translateY(100%);
    }

    .app-s-iframe-box.is-open {
        transform: translateY(0);
    }

    .app-s-consult-launcher {
        left: 12px;
        bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }

    /* 分类/品牌列表页：避开左下角「筛选」悬浮钮 */
    body.page-categories #ConsultWidget .app-s-consult-launcher,
    body.page-brand-show #ConsultWidget .app-s-consult-launcher {
        bottom: calc(var(--mobile-filter-fab-bottom, calc(4.35rem + env(safe-area-inset-bottom, 0px))) + 2.85rem);
    }

    .app-s-consult-launcher__pill {
        min-width: 68px;
        height: 38px;
        padding: 0 16px 0 20px;
        font-size: 13px;
    }

    .app-s-consult-launcher.minimized {
        left: -110px;
    }

    .app-s-consult-sidebar {
        bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }

    body.page-categories #ConsultWidget .app-s-consult-sidebar,
    body.page-brand-show #ConsultWidget .app-s-consult-sidebar {
        bottom: calc(var(--mobile-filter-fab-bottom, calc(4.35rem + env(safe-area-inset-bottom, 0px))) + 2.85rem);
    }

    .app-s-back-to-top-button {
        width: 44px;
        height: 44px;
        right: 12px;
        bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
    }
}
