/* Contact Float Widget - 联络悬浮球样式 */

/* 桌面端右侧悬浮球 */
.contact-float {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-float-item {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.contact-float-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.contact-float-item i {
    font-size: 24px;
    color: white;
}

/* WhatsApp - 绿色 */
.contact-float-item.whatsapp {
    background: #25D366;
}

/* Email - 橙色 */
.contact-float-item.email {
    background: #f39c12;
}

/* WeChat - 绿色 */
.contact-float-item.wechat {
    background: #07C160;
}

/* Line - 绿色 */
.contact-float-item.line {
    background: #00B900;
}

/* 二维码弹窗 */
.contact-qr-popup {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    width: 180px;
    text-align: center;
}

.contact-float-item:hover .contact-qr-popup {
    opacity: 1;
    visibility: visible;
}

.contact-qr-popup img {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.contact-qr-popup .qr-label {
    font-size: 12px;
    color: #333;
    font-weight: 500;
}

/* 箭头 */
.contact-qr-popup::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

/* 移动端底部联络栏 */
.mobile-contact-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    padding: 10px 0;
    border-top: 1px solid #eee;
}

.mobile-contact-bar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.mobile-contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #333;
    padding: 5px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-contact-item:hover {
    background: #f5f5f5;
}

.mobile-contact-item i {
    font-size: 22px;
}

.mobile-contact-item.whatsapp i {
    color: #25D366;
}

.mobile-contact-item.email i {
    color: #f39c12;
}

.mobile-contact-item.wechat i {
    color: #07C160;
}

.mobile-contact-item.line i {
    color: #00B900;
}

.mobile-contact-item span {
    font-size: 11px;
    font-weight: 500;
}

/* 移动端二维码弹窗 */
.mobile-qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.mobile-qr-modal.active {
    display: flex;
}

.mobile-qr-content {
    background: white;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    max-width: 300px;
    width: 100%;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-qr-content img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.mobile-qr-content h4 {
    margin-bottom: 5px;
    color: #333;
}

.mobile-qr-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.mobile-qr-close {
    background: #1a5f9e;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.mobile-qr-close:hover {
    background: #124a7c;
}

/* 响应式：平板和手机显示底部栏，隐藏右侧悬浮球 */
@media (max-width: 1024px) {
    .contact-float {
        display: none;
    }
    
    .mobile-contact-bar {
        display: block;
    }
    
    /* 为底部栏留出空间 */
    body {
        padding-bottom: 70px;
    }
    
    /* 调整聊天窗口位置 */
    .chat-widget {
        bottom: 80px !important;
    }
    
    .chat-toggle {
        bottom: 80px !important;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
    .mobile-contact-item {
        padding: 5px 10px;
    }
    
    .mobile-contact-item i {
        font-size: 20px;
    }
    
    .mobile-contact-item span {
        font-size: 10px;
    }
}
