/* QR Icon Display Plugin Styles */

.qr-icon-container {
    position: relative;
    display: inline-block;
}

.qr-icon-wrapper {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

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

.qr-icon {
    width: 60%;
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-icon svg {
    width: 100%;
    height: 100%;
}

/* 二维码弹出层样式 */
.qr-code-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-bottom: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    /* 防止被父容器宽度限制 */
    white-space: nowrap;
    min-width: 180px;
    width: max-content;
    max-width: 300px;
    /* 强制脱离父容器布局限制 */
    box-sizing: border-box;
    overflow: visible;
    contain: none;
}

.qr-code-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: white;
}

.qr-icon-container:hover .qr-code-popup, .qr-code-popup.show {
    opacity: 1;
    visibility: visible;
}

.qr-code-image {
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 5px;
    /* 防止图片被压缩 */
    flex-shrink: 0;
    min-width: 150px;
    min-height: 150px;
    object-fit: contain;
}

/* 动画效果 */
.qr-icon-container[data-animation="fade"] .qr-code-popup.show {
    animation: fadeIn 0.3s ease;
}

.qr-icon-container[data-animation="slide"] .qr-code-popup.show {
    animation: slideUp 0.3s ease;
}

.qr-icon-container[data-animation="bounce"] .qr-code-popup.show {
    animation: bounceIn 0.5s ease;
}

.qr-icon-container[data-animation="zoom"] .qr-code-popup.show {
    animation: zoomIn 0.3s ease;
}

/* 关键帧动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.3);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
    70% {
        transform: translateX(-50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .qr-code-popup {
        position: fixed;
        top: 60%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin-bottom: 0;
        z-index: 9999;
        /* 移动端也防止被压缩 */
        white-space: normal;
        min-width: 200px;
        width: auto;
        max-width: 90vw;
        max-height: 90vh;
		min-height:210px;
    }
    
    .qr-code-popup::after {
        display: none;
    }
    
    .qr-code-image {
        min-width: auto;
        min-height: auto;
        max-width: 80vw;
        max-height: 80vh;
    }
}

/* 多个图标排列 */
.qr-icons-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.qr-icons-group .qr-icon-container {
    margin: 5px;
}

/* 悬浮效果增强 */
.qr-icon-wrapper {
    position: relative;
    overflow: hidden;
}

.qr-icon-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.qr-icon-wrapper:hover::before {
    transform: scale(1);
}

/* PC端hover显示优化 */
@media (hover: hover) and (pointer: fine) {
    .qr-icon-container:hover .qr-code-popup {
        transition-delay: 0.2s;
    }
    
    .qr-icon-container.hover-active .qr-code-popup {
        opacity: 1;
        visibility: visible;
    }
    
    /* 防止hover时的闪烁 */
    .qr-icon-container.hover-active {
        pointer-events: auto;
    }
    
    .qr-icon-container.hover-active .qr-code-popup {
        pointer-events: auto;
    }
}

/* 加载动画 */
.qr-icon-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .qr-code-popup {
        background: #2d2d2d;
        color: white;
    }
    
    .qr-code-popup::after {
        border-top-color: #2d2d2d;
    }
}

/* 自定义尺寸类 */
.qr-icon-small .qr-icon-wrapper {
    width: 40px !important;
    height: 40px !important;
}

.qr-icon-medium .qr-icon-wrapper {
    width: 60px !important;
    height: 60px !important;
}

.qr-icon-large .qr-icon-wrapper {
    width: 80px !important;
    height: 80px !important;
}

.qr-icon-xlarge .qr-icon-wrapper {
    width: 100px !important;
    height: 100px !important;
}