/* ==================== 客服悬浮组件 ==================== */

/* 悬浮按钮 */
.cs-fab {
    position: fixed;
    right: 20px;
    bottom: 90px; /* 底部导航栏之上 */
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9000;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: cs-pulse 2.5s infinite;
}

.cs-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(102, 126, 234, 0.7);
}

.cs-fab svg {
    width: 26px;
    height: 26px;
    fill: white;
}

@keyframes cs-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5); }
    50% { box-shadow: 0 4px 30px rgba(102, 126, 234, 0.8), 0 0 0 8px rgba(102, 126, 234, 0.15); }
}

/* 弹窗遮罩 */
.cs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9001;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: cs-fade-in 0.2s ease;
}

.cs-overlay.show {
    display: block;
}

@keyframes cs-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 弹窗主体 */
.cs-popup {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 16px;
    width: 300px;
    background: rgba(16, 20, 50, 0.97);
    border: 1px solid rgba(102, 126, 234, 0.35);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05);
    z-index: 9002;
    overflow: hidden;
    transform-origin: bottom right;
    animation: cs-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cs-popup.show {
    display: block;
}

@keyframes cs-slide-up {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 弹窗头部 */
.cs-popup-header {
    padding: 18px 20px 16px;
    background: linear-gradient(135deg, rgba(102,126,234,0.3) 0%, rgba(118,75,162,0.3) 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cs-popup-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cs-popup-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.cs-popup-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 2px;
}

.cs-popup-info p {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin: 0;
}

.cs-online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #2ecc71;
    border-radius: 50%;
    margin-right: 4px;
    box-shadow: 0 0 6px #2ecc71;
    animation: cs-blink 1.5s infinite;
}

@keyframes cs-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.cs-close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: rgba(255,255,255,0.7);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cs-close-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: rotate(90deg);
}

/* 联系方式列表 */
.cs-contacts {
    padding: 12px 14px;
}

.cs-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.04);
}

.cs-contact-item:last-child {
    margin-bottom: 0;
}

.cs-contact-item:hover {
    background: rgba(102, 126, 234, 0.18);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateX(3px);
}

.cs-contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.cs-contact-text {
    flex: 1;
    min-width: 0;
}

.cs-contact-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 2px;
}

.cs-contact-value {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-contact-arrow {
    color: rgba(255,255,255,0.3);
    font-size: 14px;
    flex-shrink: 0;
}

/* 复制提示 */
.cs-copy-toast {
    display: none;
    position: fixed;
    bottom: 160px;
    right: 20px;
    background: rgba(46, 204, 113, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    animation: cs-toast-in 0.3s ease;
    pointer-events: none;
}

.cs-copy-toast.show {
    display: block;
}

@keyframes cs-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 无客服配置提示 */
.cs-empty {
    padding: 24px 20px;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}

.cs-empty .cs-empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}
