/* 全局样式 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.content {
    padding: 20px;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #f0f0f0;
    border-radius: 30px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.service-item,
.top-item {
    position: relative;
    cursor: pointer;
}

.service-item img,
.top-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.service-item:hover img:not(.qrcode),
.top-item:hover img {
    transform: scale(1.1);
}

.qrcode-wrapper {
    position: absolute;
    right: 60px;
    transform: scale(0.8);
    width: 230px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    text-align: center;
}

/* 正常位置（垂直居中） */
.service-item[data-position="normal"] .qrcode-wrapper {
    top: 50%;
    transform: translateY(-50%) scale(0.8);
}

/* 向上弹出位置 */
.service-item[data-position="upward"] .qrcode-wrapper {
    bottom: 0;
    transform: scale(0.8);
}

.qrcode {
    display: block;
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto 10px;
    border-radius: 0 !important;
}

.qrcode-text {
    display: block;
    width: 100%;
    font-size: 16px;
    color: #333333;
    margin: 0;
    padding: 5px 0;
}

/* 显示状态 */
.service-item:hover .qrcode-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.service-item[data-position="upward"]:hover .qrcode-wrapper {
    transform: scale(1);
}

.top-item {
    display: none; /* 默认隐藏，通过JS控制显示 */
}

/* 移动端样式 */
@media (max-width: 768px) {
    .sidebar {
        bottom: 15px;
        right: 15px;
    }

    .service-item img,
    .top-item img {
        width: 35px;
        height: 35px;
    }

    .qrcode-wrapper {
        right: 50px;
        width: 220px;
        padding: 10px;
    }

    .qrcode {
        width: 200px !important;
        height: 200px !important;
    }

    .qrcode-text {
        font-size: 12px;
    }
}

/* 移动端点击显示二维码 */
.show-qrcode .qrcode-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}