/**
 * 二维码悬浮组件样式
 * QR Code Floating Component Styles
 */

/* 固定悬浮二维码容器 */
.qr-floating-container {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 单个二维码项 */
.qr-item {
    position: relative;
    width: 50px;
    height: 50px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qr-item:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 二维码图标 */
.qr-item .icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* 微信图标特殊样式 */
.qr-item.wechat {
    background: linear-gradient(135deg, #07C160 0%, #09B955 100%);
}

.qr-item.wechat .icon {
    filter: brightness(0) invert(1);
}

/* 电话图标特殊样式 */
.qr-item.phone {
    background: linear-gradient(135deg, #013D8D 0%, #0250B8 100%);
}

.qr-item.phone .icon {
    filter: brightness(0) invert(1);
}

/* 二维码展示框 */
.qr-popup {
    position: absolute;
    right: 70px;
    bottom: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    min-width: 200px;
}

/* 永久显示的二维码 */
.qr-item.always-show .qr-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: all;
}

/* 鼠标悬停显示二维码 */
.qr-item:hover .qr-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: all;
}

/* 二维码图片 - 保持原图比例 */
.qr-popup img {
    width: 180px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 10px;
    /* 确保图片质量 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    object-fit: contain;
}

/* 二维码标题 */
.qr-popup .qr-title {
    text-align: center;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 5px;
}

/* 二维码描述 */
.qr-popup .qr-desc {
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* 箭头指示器 */
.qr-popup::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 998;
    box-shadow: 0 4px 12px rgba(1, 61, 141, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(1, 61, 141, 0.4);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .qr-floating-container {
        right: 15px;
        bottom: 80px;
        gap: 12px;
    }
    
    .qr-item {
        width: 45px;
        height: 45px;
    }
    
    .qr-item .icon {
        width: 24px;
        height: 24px;
    }
    
    .qr-popup {
        right: 60px;
        min-width: 180px;
        padding: 12px;
    }
    
    .qr-popup img {
        width: 150px;
        height: auto;
        /* 移动端保持比例 */
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        right: 15px;
        bottom: 20px;
    }
}

/* 简化版二维码显示（适用于首页） */
.qr-simple {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.qr-simple .qr-code {
    width: 120px;
    max-width: 120px;
    height: auto;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.qr-simple .qr-code img {
    width: 100%;
    height: auto;
    /* 确保简化版二维码质量 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    object-fit: contain;
}

.qr-simple .qr-info {
    flex: 1;
}

.qr-simple .qr-info h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.qr-simple .qr-info p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}