/**
 * 用户中心壳层：可拖动快捷菜单（对齐 acg-faka assets/user/css/theme/cartoon2/item-page-fab.css）
 * 菜单相对按钮绝对定位；水平/垂直朝向由根节点 class --h-start / --v-below 控制（JS 按视口位置切换）
 */
.acg-item-quick-fab {
    position: fixed;
    z-index: 1040;
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: auto;
    top: max(
        16px,
        min(
            calc(58vh - 24px),
            calc(100vh - env(safe-area-inset-bottom, 0px) - 200px)
        )
    );
    user-select: none;
    -webkit-user-select: none;
}

.acg-item-quick-fab__anchor {
    position: relative;
    width: 48px;
    height: 48px;
}

.acg-item-quick-fab.is-dragging,
.acg-item-quick-fab.is-dragging * {
    cursor: grabbing;
}

.acg-item-quick-fab__main {
    position: relative;
    z-index: 3;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, rgba(12, 132, 209, 0.95), rgba(0, 158, 247, 0.88));
    box-shadow: 0 6px 20px rgba(12, 132, 209, 0.35);
    cursor: grab;
    touch-action: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.acg-item-quick-fab__main:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 26px rgba(12, 132, 209, 0.42);
}

.acg-item-quick-fab__main:active {
    cursor: grabbing;
}

.acg-item-quick-fab__main .fa {
    font-size: 1.25rem;
    color: #fff;
}

.acg-item-quick-fab__main[aria-expanded="true"] {
    background: linear-gradient(135deg, rgba(10, 110, 175, 0.98), rgba(0, 140, 220, 0.92));
}

.acg-item-quick-fab__menu {
    position: absolute;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 148px;
    max-width: min(168px, calc(100vw - 24px));
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(12, 132, 209, 0.2);
    box-shadow: 0 10px 32px rgba(12, 132, 209, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    right: 0;
    left: auto;
    bottom: calc(100% + 8px);
    top: auto;
}

.acg-item-quick-fab--h-start .acg-item-quick-fab__menu {
    left: 0;
    right: auto;
}

.acg-item-quick-fab--v-below .acg-item-quick-fab__menu {
    top: calc(100% + 8px);
    bottom: auto;
}

.acg-item-quick-fab__menu[hidden] {
    display: none !important;
}

.acg-item-quick-fab__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.3;
    color: #0b3b66;
    background: transparent;
    cursor: pointer;
    transition: background 0.12s ease;
}

.acg-item-quick-fab__link:hover {
    background: rgba(12, 132, 209, 0.1);
    color: #064a78;
}

.acg-item-quick-fab__link .fa {
    width: 1.25em;
    flex-shrink: 0;
    font-size: 15px;
    color: #0c84d1;
}

@media (max-width: 991.98px) {
    .acg-item-quick-fab {
        top: max(
            16px,
            min(
                calc(60vh - 24px),
                calc(100vh - env(safe-area-inset-bottom, 0px) - 220px)
            )
        );
    }

    /* 认证页公开 FAB：默认贴右下，拖动下限由 JS 按 safe-area 收紧（勿再用 220px 顶起） */
    .acg-item-quick-fab--public {
        top: auto;
        bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 12px));
    }
}
