/*!
 * 时光夸克网盘二维码 - 前端样式 v1.1.0
 *
 * 复用 Zibll 主题 CSS 变量，自动适配暗色模式；
 * 类名前缀 shiguang- / shiguang-qrcode-，避免污染主题全局样式
 */

/* ========== 被标记的夸克链接 ========== */
.shiguang-quark-link {
    position: relative;
}
/* v1.4.0：移除"手机扫码"徽章样式（插件为 PC 端专用，不再注入徽章 DOM） */

/* ========== 悬浮二维码弹窗 ========== */
.shiguang-qrcode-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.shiguang-qrcode-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 21, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: shiguang-qrcode-fade-in .2s ease;
}

.shiguang-qrcode-box {
    position: relative;
    width: 100%;
    max-width: 380px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--main-bg-color, #fff);
    border: 1px solid var(--main-border-color, #e5e7eb);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: shiguang-qrcode-pop-in .25s cubic-bezier(0.16, 1, 0.3, 1);
}

.shiguang-qrcode-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.shiguang-qrcode-head b {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.shiguang-qrcode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #fff;
    flex-shrink: 0;
}
.shiguang-qrcode-icon i {
    font-size: 15px;
    line-height: 1;
}

.shiguang-qrcode-close {
    color: #fff;
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .2s ease;
    cursor: pointer;
}
.shiguang-qrcode-close i { font-size: 16px; line-height: 1; }
.shiguang-qrcode-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.shiguang-qrcode-body {
    padding: 22px 20px 18px;
    text-align: center;
}

.shiguang-qrcode-imgbox {
    position: relative;
    display: inline-block;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--main-border-color, #e5e7eb);
    margin: 0 auto 14px;
}

.shiguang-qrcode-img {
    display: block;
    width: 220px;
    height: 220px;
    max-width: 100%;
    background: #f5f6fa;
}

.shiguang-qrcode-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    color: var(--muted-2-color, #6b7280);
    font-size: 13px;
    border-radius: 12px;
    gap: 6px;
}
.shiguang-qrcode-loading i { color: var(--main-color, #3b82f6); }

.shiguang-qrcode-src {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    margin-bottom: 8px;
}

.shiguang-qrcode-src[data-src="paid"] {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.shiguang-qrcode-src[data-src="resolved"] {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.shiguang-qrcode-src[data-src="error"] {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.shiguang-qrcode-desc {
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.6;
}

.shiguang-qrcode-desc.is-error {
    color: #ef4444;
}

.shiguang-qrcode-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(59, 130, 246, 0.06);
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted-2-color, #6b7280);
    text-align: left;
    margin-bottom: 14px;
}

.shiguang-qrcode-tip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 1px;
}
.shiguang-qrcode-tip-icon i {
    font-size: 14px;
    line-height: 1;
}

.shiguang-qrcode-tip-text {
    flex: 1;
}

.shiguang-qrcode-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.shiguang-qrcode-actions .but {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.shiguang-qrcode-actions .but i { line-height: 1; }

.shiguang-qrcode-foot {
    font-size: 12px;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.shiguang-qrcode-foot i { line-height: 1; }

/* ========== 动画 ========== */
@keyframes shiguang-qrcode-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shiguang-qrcode-pop-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
    .shiguang-qrcode-modal {
        padding: 12px;
        align-items: flex-end;
    }
    .shiguang-qrcode-box {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        animation: shiguang-qrcode-slide-up .25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .shiguang-qrcode-img {
        width: 180px;
        height: 180px;
    }
    .shiguang-qrcode-body {
        padding: 18px 16px 14px;
    }
    .shiguang-qrcode-head {
        padding: 14px 16px;
    }
    @keyframes shiguang-qrcode-slide-up {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========== 暗色模式适配 ========== */
body.dark-theme .shiguang-qrcode-imgbox,
body[data-theme="dark"] .shiguang-qrcode-imgbox {
    border-color: rgba(255, 255, 255, 0.08);
    background: #fff; /* 二维码背景必须保持白色以保证识别率 */
}

body.dark-theme .shiguang-qrcode-loading,
body[data-theme="dark"] .shiguang-qrcode-loading {
    background: rgba(20, 22, 28, 0.92);
    color: #e6e8ec;
}

body.dark-theme .shiguang-qrcode-tip,
body[data-theme="dark"] .shiguang-qrcode-tip {
    background: rgba(59, 130, 246, 0.12);
}

/* ========== Zibll 下载按钮里的链接适配 ========== */
.but-download .shiguang-quark-link::after,
.pay-download-box .shiguang-quark-link::after {
    margin-left: 8px;
}