/* Floating Customer Service Button */
.floating-kefu {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.floating-kefu-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--apple-blue, #0071e3) 0%, var(--apple-purple, #5e5ce6) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 113, 227, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.floating-kefu-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 113, 227, 0.5);
}

.floating-kefu-btn svg {
    width: 28px;
    height: 28px;
    color: white;
}

.floating-kefu-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.floating-kefu-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-kefu-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-kefu-panel::before {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.floating-kefu-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
    text-align: center;
}

.floating-kefu-qr {
    width: 160px;
    height: 160px;
    margin: 0 auto 12px;
    background: #f5f5f7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.floating-kefu-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.floating-kefu-desc {
    font-size: 12px;
    color: #86868b;
    text-align: center;
    line-height: 1.5;
}

.floating-kefu-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #f5f5f7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.floating-kefu-close:hover {
    background: #e8e8ed;
}

.floating-kefu-close svg {
    width: 14px;
    height: 14px;
    color: #86868b;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .floating-kefu {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-kefu-btn {
        width: 48px;
        height: 48px;
    }
    
    .floating-kefu-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .floating-kefu-panel {
        right: -10px;
        min-width: 180px;
        padding: 16px;
    }
    
    .floating-kefu-qr {
        width: 140px;
        height: 140px;
    }
}
