:root {
    --koyo-float-red: #FA1C01;
    --koyo-float-dark: #221815;
    --koyo-float-size: 48px;
    --koyo-float-gap: 12px;
}

.koyo-side-float {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--koyo-float-gap);
    overflow: visible;
    pointer-events: auto;
}

.koyo-side-float-list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--koyo-float-gap);
    overflow: visible;
}

.koyo-side-float-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow: visible;
}

/* 收起时隐藏非钉住图标，WhatsApp（--pin）始终显示 */
.koyo-side-float:not(.is-open) .koyo-side-float-list .koyo-side-float-item:not(.koyo-side-float-item--pin) {
    display: none;
}
.koyo-side-float-btn {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: var(--koyo-float-size);
    height: var(--koyo-float-size);
    border: 0;
    border-radius: 50%;
    background: var(--koyo-float-red);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(228, 35, 19, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
}

.koyo-side-float-btn:hover,
.koyo-side-float-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(228, 35, 19, 0.42);
    outline: 0;
}

.koyo-side-float-btn--toggle {
    background: var(--koyo-float-dark);
    box-shadow: 0 4px 14px rgba(34, 24, 21, 0.28);
}

.koyo-side-float-btn--toggle:hover,
.koyo-side-float-btn--toggle:focus-visible {
    box-shadow: 0 6px 18px rgba(34, 24, 21, 0.36);
}

.koyo-side-float-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    transition: transform 0.25s ease;
    transform: rotate(0deg);
}

.koyo-side-float-btn--toggle.is-collapsed .koyo-side-float-arrow {
    transform: rotate(180deg);
}

.koyo-side-float-btn.is-copied {
    animation: koyoFloatPulse 0.4s ease;
}

.koyo-side-float-tip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--koyo-float-red);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 4px 12px rgba(228, 35, 19, 0.25);
}

.koyo-side-float-tip::after {
    content: "";
    position: absolute;
    right: -11px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent var(--koyo-float-red);
}
.koyo-side-float-item:first-child .koyo-side-float-tip::after {
    border-color: transparent transparent transparent rgb(255, 255, 255);
}
.koyo-side-float-tip.is-visible {
    opacity: 1;
    visibility: visible;
}

.koyo-side-float-tip.is-copied::before {
    content: "Copied! ";
}

@keyframes koyoFloatPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 1024px) {
    .koyo-side-float {
        right: 16px;
        bottom: 64px;
    }
}

@media (max-width: 767px) {
    :root {
        --koyo-float-size: 44px;
        --koyo-float-gap: 10px;
    }

    .koyo-side-float {
        right: 12px;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    .koyo-side-float-tip {
        font-size: 12px;
        padding: 6px 12px;
        max-width: calc(100vw - 90px);
        white-space: normal;
    }
}
