/**
 * 客服悬浮泡泡组件样式
 * 用于在网站右下角显示客服入口
 */

/* ==================== 悬浮泡泡 ==================== */
#customer-service-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #07C160 0%, #05a550 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(7, 193, 96, 0.4);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    user-select: none;
}

#customer-service-bubble:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 30px rgba(7, 193, 96, 0.6);
}

#customer-service-bubble:active {
    transform: translateY(-3px) scale(1.02);
}

#customer-service-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
    margin-bottom: 4px;
}

#customer-service-bubble span {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* 浮动动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

#customer-service-bubble.animate {
    animation: float 3s ease-in-out infinite;
}

/* ==================== 模态框 ==================== */
#customer-service-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.cs-modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 480px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    animation: scaleIn 0.3s ease forwards;
}

@keyframes scaleIn {
    to {
        transform: scale(1);
    }
}

/* 模态框头部 */
.cs-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.cs-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.cs-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    transition: all 0.2s;
}

.cs-modal-close:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* Tab 切换（简化版不需要，保留注释以备后用）*/

/* 客服内容区域 */
.cs-contact-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
}

.cs-contact-content::-webkit-scrollbar {
    width: 6px;
}

.cs-contact-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* 单个客服卡片 */
.cs-contact-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.cs-contact-card:hover {
    background: #f0f2f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 二维码 */
.cs-qr-code {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cs-qr-code img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 客服信息 */
.cs-contact-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.cs-contact-handle {
    font-size: 15px;
    color: #666;
    margin: 0 0 12px 0;
}

.cs-contact-description {
    font-size: 13px;
    color: #999;
    margin: 0 0 16px 0;
    line-height: 1.6;
}

/* 按钮 */
.cs-btn-primary {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #07C160 0%, #05a550 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}

.cs-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(7, 193, 96, 0.5);
}

.cs-btn-primary:active {
    transform: translateY(0);
}

/* 空状态 */
.cs-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.cs-empty-state svg {
    width: 64px;
    height: 64px;
    fill: #ddd;
    margin-bottom: 16px;
}

/* ==================== 响应式设计 ==================== */

/* 平板 */
@media (max-width: 768px) {
    #customer-service-bubble {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }

    #customer-service-bubble svg {
        width: 24px;
        height: 24px;
        margin-bottom: 2px;
    }

    #customer-service-bubble span {
        font-size: 10px;
    }

    .cs-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .cs-qr-code {
        width: 180px;
        height: 180px;
    }
}

/* 手机 */
@media (max-width: 480px) {
    #customer-service-bubble {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
    }

    #customer-service-bubble svg {
        width: 22px;
        height: 22px;
    }

    #customer-service-bubble span {
        font-size: 9px;
    }

    .cs-modal-header h3 {
        font-size: 18px;
    }

    .cs-tabs {
        padding: 12px 16px;
    }

    .cs-contact-content {
        padding: 16px;
    }

    .cs-qr-code {
        width: 160px;
        height: 160px;
    }

    .cs-contact-name {
        font-size: 16px;
    }

    .cs-btn-primary {
        padding: 10px 24px;
        font-size: 13px;
    }
}

/* 避免与其他浮动元素冲突 */
@media (max-width: 768px) {
    /* 如果有购买通知等其他浮动元素，调整泡泡位置 */
    body.has-notifications #customer-service-bubble {
        bottom: 100px; /* 避开底部通知 */
    }
}
