* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f9ff;
    color: #333;
}

.demo-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.demo-content h1 {
    color: #4a90e2;
    margin-bottom: 20px;
}

/* ========== 客服悬浮框 ========== */
.cs-float-panel {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.15);
    overflow: visible;
    border: 1px solid #e0ecfa;
}

.cs-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    padding: 12px 8px;
    color: #4a90e2;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f6ff;
}

.cs-item:last-child {
    border-bottom: none;
}

.cs-item:hover {
    background: #e8f3ff;
    color: #2563eb;
}

.cs-icon {

    height: 24px;
    margin-bottom: 6px;
}

.cs-icon svg {
    width: 100%;
    height: 100%;
}

.cs-text {
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
}

/* 电话项 */
.cs-phone .cs-text {
    font-size: 11px;
    font-weight: 500;
}

.cs-phone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.35;
}

.cs-phone-row {
    display: block;
    white-space: nowrap;
}


/* 微信二维码弹窗 */
.cs-qrcode-popup {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.2);
    border: 1px solid #e0ecfa;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 10000;
}

/* PC端悬停显示 */
.cs-wechat:hover .cs-qrcode-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

/* 弹窗小三角 */
.cs-qrcode-popup::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 8px solid #fff;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    filter: drop-shadow(1px 0 0 #e0ecfa);
    z-index: 10001;
}

.cs-qrcode-box {
    text-align: center;
}

.cs-qrcode-placeholder {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    background: #fff;
    border: 1px solid #e0ecfa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

/* 二维码图片自适应 */
.cs-qrcode-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cs-qrcode-placeholder svg {
    width: 100%;
    height: 100%;
}

.cs-qrcode-box p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* 返回顶部默认隐藏 */
.cs-back-top {
    display: none;
}

.cs-back-top.show {
    display: flex;
}

/* ========== 响应式：移动端 ========== */
@media screen and (max-width: 768px) {
    .cs-float-panel {
        right: 10px;
        border-radius: 10px;
    }

    .cs-item {
        width: 56px;
        padding: 10px 6px;
    }

    .cs-icon {
        width: 20px;
        height: 20px;
        margin-bottom: 4px;
    }

    .cs-text {
        font-size: 11px;
    }

    .cs-phone .cs-text {
        font-size: 10px;
    }

    /* 移动端二维码弹窗 */
    .cs-qrcode-popup {
        right: calc(100% + 8px);
        padding: 12px;
    }

    /* 移动端点击展开 */
    .cs-wechat.active .cs-qrcode-popup {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0);
        pointer-events: auto;
    }

    .cs-qrcode-placeholder {
        width: 100px;
        height: 100px;
    }
}

@media screen and (max-width: 480px) {
    .cs-float-panel {
        right: 6px;
    }

    .cs-item {
        width: 48px;
        padding: 8px 4px;
    }

    .cs-text {
        font-size: 10px;
    }

    .cs-phone .cs-text {
        font-size: 9px;
    }
}
