/* ==========================================================================
   720云全景 · 扫码分享弹层样式（搭配 share-qrcode.js）
   --------------------------------------------------------------------------
   这套样式自带遮罩与配色兜底，不依赖 home.css：
   - 作品详情页（深色主题）走 var(--panel-2) 等主题变量
   - 全屏播放页没有引入 home.css，则由括号里的默认值兜底
   ========================================================================== */

.sq-mask {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 6, 10, .68);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .2s ease;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}
.sq-mask.show { opacity: 1; }
.sq-mask * { box-sizing: border-box; }

.sq-dialog {
    width: 100%;
    max-width: 380px;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    background: var(--panel-2, #121a25);
    border: 1px solid var(--line-strong, #223041);
    border-radius: 16px;
    box-shadow: var(--shadow, 0 18px 50px rgba(0, 0, 0, .45));
    overflow: hidden;
    transform: translateY(10px) scale(.97);
    transition: transform .22s cubic-bezier(.2, .8, .3, 1);
}
.sq-mask.show .sq-dialog { transform: translateY(0) scale(1); }

/* ---------------- 头部 ---------------- */
.sq-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px 12px;
    border-bottom: 1px solid var(--line, #1b2532);
}
.sq-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 620;
    color: var(--text, #e6edf5);
}
.sq-close {
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    font-size: 18px;
    color: var(--text-dim, #5f6d80);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: color .16s, background .16s;
}
.sq-close:hover { color: var(--text, #e6edf5); background: var(--bg-soft, #16202c); }

/* ---------------- 主体 ---------------- */
.sq-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 18px 6px;
}

/* 二维码：白底卡片，保证任何主题下都有足够对比度 */
.sq-qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.sq-qr-plate {
    position: relative;
    padding: 10px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
    line-height: 0;
}
.sq-canvas {
    display: block;
    width: 100%;
    max-width: 236px;
    height: auto !important;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
}
/* 二维码未就绪时的占位 */
.sq-qr-loading {
    position: absolute;
    inset: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    line-height: 1.5;
    color: #8592a3;
    background: #fff;
    border-radius: 4px;
    text-align: center;
}
.sq-qr-loading.hide { display: none; }

.sq-qr-tip {
    font-size: 12.5px;
    color: var(--text-dim, #5f6d80);
    text-align: center;
    line-height: 1.6;
}
.sq-qr-tip b { color: var(--accent, #22d3c5); font-weight: 600; }

/* 链接行 */
.sq-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 7px 8px 7px 12px;
    border-radius: 10px;
    background: var(--bg-soft, #16202c);
    border: 1px solid var(--line, #1b2532);
}
.sq-link-input {
    flex: 1;
    min-width: 0;
    height: 24px;
    font-size: 12.5px;
    color: var(--text-sub, #93a2b3);
    background: transparent;
    border: 0;
    outline: none;
    text-overflow: ellipsis;
    font-family: inherit;
}
.sq-link-input::selection { background: var(--accent, #22d3c5); color: #04120f; }
.sq-copy {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 12px;
    font-size: 12.5px;
    color: #04120f;
    background: var(--accent, #22d3c5);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: filter .16s;
}
.sq-copy:hover { filter: brightness(1.08); }
.sq-copy.done { background: #3ecf8e; }

/* 移动端长按提示 */
.sq-mobile-tip {
    display: none;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-sub, #93a2b3);
    background: rgba(34, 211, 197, .1);
    border: 1px solid rgba(34, 211, 197, .26);
}
.sq-mobile .sq-mobile-tip { display: block; }

/* ---------------- 底部 ---------------- */
.sq-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px 16px;
    border-top: 1px solid var(--line, #1b2532);
}
.sq-note {
    font-size: 12px;
    color: var(--text-dim, #5f6d80);
    line-height: 1.5;
}
.sq-save {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
    color: var(--text, #e6edf5);
    background: var(--bg-soft, #16202c);
    border: 1px solid var(--line-strong, #223041);
    border-radius: 9px;
    cursor: pointer;
    transition: border-color .16s, color .16s;
}
.sq-save:hover { border-color: var(--accent, #22d3c5); color: var(--accent, #22d3c5); }
.sq-save:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 420px) {
    .sq-mask { padding: 14px; align-items: center; }
    .sq-dialog { max-width: 100%; }
    .sq-body { padding: 15px 15px 4px; }
    .sq-foot { flex-direction: column; align-items: stretch; gap: 10px; }
    .sq-save { width: 100%; }
    .sq-note { text-align: center; }
}

/* 浅色主题（后台或其他浅色页面复用时不至于糊成一片） */
.sq-light .sq-dialog {
    background: #ffffff;
    border-color: #e2e8f0;
}
.sq-light .sq-head,
.sq-light .sq-foot { border-color: #eef2f7; }
.sq-light .sq-head h3 { color: #1f2937; }
.sq-light .sq-close { color: #94a3b8; }
.sq-light .sq-close:hover { color: #1f2937; background: #f1f5f9; }
.sq-light .sq-link { background: #f8fafc; border-color: #e8eef4; }
.sq-light .sq-link-input { color: #64748b; }
.sq-light .sq-qr-tip,
.sq-light .sq-note { color: #94a3b8; }
.sq-light .sq-save { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
