/**
 * 游戏下载二维码插件 - 双风格版
 */

:root {
    --qr-primary: #4a5568;
    --qr-border-color: #e2e8f0;
    --qr-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
    --qr-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --qr-shadow-lg: 0 20px 35px -12px rgba(0, 0, 0, 0.2);
    --qr-modal-radius: 8px;
    --qr-bg-white: #ffffff;
}

/* 模态框 - 方正风格 (默认) */
#qr-modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--qr-bg-white);
    border-radius: var(--qr-modal-radius);
    width: 360px;
    max-width: 90vw;
    padding: 0;
    z-index: 100001;
    box-shadow: var(--qr-shadow-md);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    text-align: center;
    border: 1px solid var(--qr-border-color);
    animation: modalIn 0.25s ease;
    overflow: hidden;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#qr-modal-container.no-animation { animation: none; }

/* 旧版圆润风格 */
#qr-modal-container.classic {
    border-radius: 32px;
    padding: 28px 24px 32px;
    box-shadow: var(--qr-shadow-lg);
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(2px);
    animation: modalInClassic 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

@keyframes modalInClassic {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 遮罩 */
.qr-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    animation: fadeIn 0.2s ease;
}

/* 旧版遮罩 */
#qr-modal-container.classic + .qr-modal-backdrop {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 头部 - 方正风格 */
#qr-modal-container .qr-header {
    padding: 20px 24px 0;
}

#qr-modal-container .qr-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

#qr-modal-container .qr-header p {
    font-size: 13px;
    color: #529dc7;
    margin: 12px 0 0;
    line-height: 1.5;
    background: #eff6ff;
    border-radius: 8px;
    padding: 14px 18px;
    border: 1px solid #dbeafe;
    margin-bottom: 0;
}

/* 头部 - 旧版圆润风格 */
#qr-modal-container.classic .qr-header {
    padding: 0;
    border-bottom: none;
    margin-bottom: 18px;
}

#qr-modal-container.classic .qr-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

#qr-modal-container.classic .qr-header p {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

/* 二维码容器 - 方正风格 */
#temp-qr-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 4px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin: 16px auto;
    border: 1px solid #f3f4f6;
}

#temp-qr-code canvas, #temp-qr-code img { border-radius: 4px; }

/* 二维码容器 - 旧版圆润风格 */
#qr-modal-container.classic #temp-qr-code {
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.6);
    margin: 8px auto 12px;
}

#qr-modal-container.classic #temp-qr-code canvas, 
#qr-modal-container.classic #temp-qr-code img { 
    border-radius: 12px; 
}

/* 二维码发光效果 - 仅旧版 */
#qr-modal-container.classic .qr-code-ready {
    animation: softGlow 3s infinite ease-in-out;
}

@keyframes softGlow {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.3), 0 10px 20px -5px rgba(0, 0, 0, 0.1); }
    70% { box-shadow: 0 0 0 12px rgba(102, 126, 234, 0), 0 10px 20px -5px rgba(0, 0, 0, 0.1); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0), 0 10px 20px -5px rgba(0, 0, 0, 0.1); }
}

/* 提示区域 - 旧版 */
#qr-modal-container.classic .qr-tip {
    background: #f8fafc;
    border-radius: 40px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    margin: 12px 0 20px;
    display: inline-block;
    border: 1px solid #e2e8f0;
}

/* 提示区域 - 方正风格 */
#qr-modal-container .qr-tip {
    background: #eff6ff;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 13px;
    color: #1e40af;
    margin: 0 20px 16px;
    line-height: 1.5;
    border: 1px solid #dbeafe;
}

/* 信息卡片 - 方正风格 */
#qr-modal-container .qr-info {
    padding: 0 20px;
    margin-bottom: 0;
}

#qr-modal-container .qr-info-title {
    display: none;
}

#qr-modal-container .qr-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#qr-modal-container .qr-info li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
}

#qr-modal-container .qr-info li:last-child {
    margin-bottom: 16px;
}

#qr-modal-container .qr-info li:first-child {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

#qr-modal-container .qr-info li:nth-child(2) {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

#qr-modal-container .qr-info li:nth-child(3),
#qr-modal-container .qr-info li:nth-child(4) {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

#qr-modal-container .qr-info li::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    flex-shrink: 0;
}

#qr-modal-container .qr-info li:first-child::before {
    content: "✓";
    background: #22c55e;
    color: white;
}

#qr-modal-container .qr-info li:nth-child(2)::before {
    content: "📋";
    background: transparent;
    font-size: 12px;
}

#qr-modal-container .qr-info li:nth-child(3)::before,
#qr-modal-container .qr-info li:nth-child(4)::before {
    content: "⚠️";
    background: transparent;
    font-size: 12px;
}

/* 信息卡片 - 旧版圆润风格 */
#qr-modal-container.classic .qr-info {
    background: #ffffff;
    border-radius: 24px;
    padding: 18px 20px;
    text-align: left;
    border: 1px solid #eef2ff;
    box-shadow: var(--qr-shadow-sm);
    margin: 16px 0 8px;
}

#qr-modal-container.classic .qr-info-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #667eea;
    margin-bottom: 12px;
    text-align: center;
}

#qr-modal-container.classic .qr-info ul {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
}

#qr-modal-container.classic .qr-info li {
    display: list-item;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.65;
    padding: 0;
    border-radius: 0;
    border: none;
    background: transparent;
    color: inherit;
}

#qr-modal-container.classic .qr-info li::marker {
    color: #667eea;
}

#qr-modal-container.classic .qr-info li::before {
    display: none;
}

/* 底部按钮 - 方正风格 */
#qr-modal-container .qr-footer {
    padding: 0 20px 20px;
}

.qr-close-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #4b5563;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.qr-close-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.qr-close-btn:active {
    background: #d1d5db;
}

/* 底部按钮 - 旧版圆润风格 */
#qr-modal-container.classic .qr-footer {
    margin-top: 24px;
    padding: 0;
    border-top: none;
    text-align: center;
}

#qr-modal-container.classic .qr-close-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 28px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    width: auto;
    min-width: 140px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

#qr-modal-container.classic .qr-close-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 12px 20px -12px rgba(102, 126, 234, 0.5);
}

#qr-modal-container.classic .qr-close-btn:active {
    transform: translateY(1px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 加载状态 */
.qr-loading {
    padding: 48px 24px;
    text-align: center;
    font-size: 15px;
    color: #4b5563;
}

.qr-loading::after {
    content: "";
    display: block;
    width: 32px;
    height: 32px;
    margin: 20px auto 0;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 移动端适配 */
@media (max-width: 480px) {
    #qr-modal-container {
        width: 92vw;
    }
    #qr-modal-container.classic {
        width: 88vw;
        padding: 20px 18px 24px;
        border-radius: 28px;
    }
    #qr-modal-container .qr-header h2 { font-size: 16px; }
    #qr-modal-container.classic .qr-header h2 { font-size: 20px; }
    #temp-qr-code { padding: 12px; }
    #qr-modal-container.classic #temp-qr-code { padding: 10px; }
    .qr-close-btn { padding: 10px 20px; font-size: 13px; }
    #qr-modal-container.classic .qr-close-btn { padding: 10px 24px; font-size: 14px; }
    #qr-modal-container .qr-info li { padding: 8px 12px; font-size: 12px; }
    #qr-modal-container.classic .qr-info { padding: 14px; }
    #qr-modal-container.classic .qr-info ul { padding-left: 16px; }
}

/* 动画降级 */
@media (prefers-reduced-motion: reduce) {
    #qr-modal-container, #qr-modal-container.classic, 
    .qr-modal-backdrop, .qr-code-ready, .qr-loading::after {
        animation: none !important;
        transition: none !important;
    }
    .qr-close-btn:hover { transform: none; }
}