/* ==================== 基础重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    width: 100%; height: 100%; overflow: hidden; background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    user-select: none; -webkit-user-select: none;
    color: #fff;
}
.hidden { display: none !important; }

/* ==================== 全景容器 ==================== */
#viewer-wrap { position: fixed; inset: 0; display: flex; }
#panorama { flex: 1; height: 100%; }
#vr-second { width: 0; height: 100%; overflow: hidden; transition: width .3s; }
body.vr-on #panorama { flex: 1; }
body.vr-on #vr-second { width: 50vw; border-left: 2px solid #000; }

.vignette {
    position: fixed; inset: 0; pointer-events: none; z-index: 4;
    background: radial-gradient(ellipse at center, transparent 58%, rgba(0,0,0,.4) 100%);
}

/* ==================== 顶部栏 ==================== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 45;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent);
    pointer-events: none;
}
.brand {
    display: flex; align-items: center; gap: 9px;
    font-size: 15px; font-weight: 600; opacity: .92;
    text-shadow: 0 1px 4px rgba(0,0,0,.7); pointer-events: auto;
}
.brand .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #4fc3f7; box-shadow: 0 0 10px rgba(79,195,247,.8);
}
.top-actions { display: flex; gap: 6px; pointer-events: auto; }
.tbtn {
    border: 1px solid rgba(255,255,255,.12); cursor: pointer;
    background: rgba(0,0,0,.45); color: rgba(255,255,255,.82);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    padding: 7px 13px; border-radius: 16px; font-size: 13px;
    transition: all .2s; white-space: nowrap;
}
.tbtn:hover { background: rgba(255,255,255,.15); color: #fff; }
.tbtn.active { background: rgba(79,195,247,.25); color: #4fc3f7; border-color: rgba(79,195,247,.4); }

/* ==================== 画廊侧栏 ==================== */
.gallery {
    position: fixed; top: 56px; left: 12px; bottom: 84px; z-index: 45;
    width: 188px; display: flex; flex-direction: column;
    background: rgba(10,10,12,.6);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.08); border-radius: 16px;
    overflow: hidden; transition: transform .3s, opacity .3s;
}
.gallery.collapsed { transform: translateX(-210px); opacity: 0; }
.gallery-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px; font-size: 13px; font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.gallery-head button {
    background: none; border: none; color: rgba(255,255,255,.6);
    cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px;
    border-radius: 6px;
}
.gallery-head button:hover { background: rgba(255,255,255,.1); color: #fff; }
.gallery-head-btns { display: flex; gap: 2px; }
.gallery-head #gallery-add { color: #4fc3f7; font-weight: 600; }
.gallery-tip {
    padding: 8px 14px; font-size: 11px; color: rgba(255,255,255,.32);
    border-top: 1px solid rgba(255,255,255,.05); text-align: center;
}

/* 拖放上传遮罩 */
.drop-zone {
    position: fixed; inset: 0; z-index: 80;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drop-zone.active { opacity: 1; pointer-events: auto; }
.drop-zone-inner {
    border: 3px dashed #4fc3f7; border-radius: 20px;
    padding: 48px 80px; color: #4fc3f7; font-size: 18px; font-weight: 500;
    background: rgba(79,195,247,.08);
}
.gallery-list { flex: 1; overflow-y: auto; padding: 8px; }
.gallery-list::-webkit-scrollbar { width: 6px; }
.gallery-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }

.scene-item {
    display: flex; flex-direction: column; gap: 5px;
    margin-bottom: 8px; padding: 6px; border-radius: 10px;
    cursor: pointer; border: 2px solid transparent;
    background: rgba(255,255,255,.04); transition: all .2s;
}
.scene-item:hover { background: rgba(255,255,255,.1); }
.scene-item.active { border-color: #4fc3f7; background: rgba(79,195,247,.12); }
.scene-thumb {
    width: 100%; aspect-ratio: 2/1; border-radius: 6px;
    background: #1a1a1a center/cover no-repeat;
}
.scene-name { font-size: 12px; color: rgba(255,255,255,.8); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 画廊展开按钮（收起时） */
.gallery-open-btn {
    position: fixed; top: 56px; left: 12px; z-index: 45;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.1);
    color: #fff; cursor: pointer; font-size: 18px;
    backdrop-filter: blur(10px); display: none;
}
.gallery.collapsed ~ .gallery-open-btn { display: flex; align-items: center; justify-content: center; }

/* ==================== 底部控制栏 ==================== */
.controls {
    position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 20;
    display: flex; align-items: center; gap: 5px; padding: 6px 12px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.08); border-radius: 24px;
}
.btn {
    width: 38px; height: 38px; border: none; cursor: pointer;
    background: rgba(255,255,255,.07); color: rgba(255,255,255,.72);
    border-radius: 50%; font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s, transform .1s;
}
.btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.btn:active { transform: scale(.9); }
.btn.active { background: rgba(79,195,247,.22); color: #4fc3f7; box-shadow: 0 0 12px rgba(79,195,247,.3); }
.sep { width: 1px; height: 20px; background: rgba(255,255,255,.1); margin: 0 4px; flex-shrink: 0; }

/* ==================== 提示 / Toast ==================== */
.hint {
    position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 18;
    color: rgba(255,255,255,.55); font-size: 13px; padding: 6px 18px;
    background: rgba(0,0,0,.35); backdrop-filter: blur(8px);
    border-radius: 16px; pointer-events: none; transition: opacity .6s;
}
.hint.fade { opacity: 0; }
.toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
    z-index: 60; background: rgba(20,20,22,.92); color: #fff; font-size: 14px;
    padding: 10px 22px; border-radius: 22px; border: 1px solid rgba(79,195,247,.3);
    opacity: 0; pointer-events: none; transition: all .3s;
    box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==================== 通用弹出层 ==================== */
.popup {
    position: fixed; top: 92px; right: 16px; z-index: 40; width: 280px;
    background: rgba(18,18,20,.94); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
    overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.popup-head {
    padding: 12px 40px 12px 16px; font-size: 14px; font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex; justify-content: space-between; align-items: baseline; position: relative;
}
.popup-sub { font-size: 11px; color: rgba(255,255,255,.45); font-weight: 400; }
.popup-close {
    position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
    background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer;
    font-size: 15px; width: 28px; height: 28px; border-radius: 50%; line-height: 1;
}
.popup-close:hover { background: rgba(255,255,255,.12); color: #fff; }
/* 面板遮罩（仅手机端，不挡顶栏，点遮罩关闭） */
.popup-backdrop { display: none; }
.popup-list { max-height: 320px; overflow-y: auto; }
.popup-list::-webkit-scrollbar { width: 6px; }
.popup-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.popup-empty { padding: 18px 16px; font-size: 12px; color: rgba(255,255,255,.45); text-align: center; }

/* 书签条目 */
.bm-item {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px;
}
.bm-item:hover { background: rgba(255,255,255,.06); }
.bm-name { flex: 1; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-meta { font-size: 10px; color: rgba(255,255,255,.35); }
.bm-del { background: none; border: none; color: rgba(255,255,255,.3); cursor: pointer; font-size: 15px; padding: 2px 4px; border-radius: 4px; }
.bm-del:hover { color: #ff6b6b; background: rgba(255,107,107,.12); }

/* ==================== 热点编辑面板 ==================== */
.editor-panel {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 45;
    width: 360px; max-width: calc(100vw - 24px);
    background: rgba(18,18,20,.95); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5); overflow: hidden;
}
.editor-head {
    padding: 12px 16px; font-size: 14px; font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between;
}
.editor-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 11px; }
.editor-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: rgba(255,255,255,.6); }
.editor-body input, .editor-body select, .editor-body textarea {
    background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); color: #fff;
    padding: 8px 10px; border-radius: 8px; font-size: 13px; font-family: inherit; outline: none;
}
.editor-body input:focus, .editor-body select:focus, .editor-body textarea:focus { border-color: #4fc3f7; }
.editor-body textarea { resize: vertical; }
.editor-coords { display: flex; gap: 16px; font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }
.editor-coords strong { color: #4fc3f7; }
.editor-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.editor-foot .spacer { flex: 1; }
.dbtn {
    border: 1px solid rgba(255,255,255,.14); cursor: pointer; background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.85); padding: 7px 15px; border-radius: 9px; font-size: 13px; transition: all .2s;
}
.dbtn:hover { background: rgba(255,255,255,.13); }
.dbtn.primary { background: #4fc3f7; color: #062b3a; border-color: #4fc3f7; font-weight: 600; }
.dbtn.primary:hover { background: #66d4ff; }
.dbtn.danger { color: #ff6b6b; border-color: rgba(255,107,107,.3); }
.dbtn.danger:hover { background: rgba(255,107,107,.15); }

/* ==================== 导览面板 ==================== */
.tour-actions { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.tour-actions .dbtn { flex: 1; text-align: center; }
.tour-step {
    display: flex; align-items: center; gap: 8px; padding: 9px 14px;
    border-bottom: 1px solid rgba(255,255,255,.05); font-size: 12px;
}
.tour-step .idx { color: #4fc3f7; font-weight: 600; min-width: 18px; }
.tour-step .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour-step .dw { color: rgba(255,255,255,.4); width: 50px; text-align: right; }
.tour-step input { width: 44px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); color: #fff; padding: 3px 5px; border-radius: 5px; font-size: 11px; text-align: center; }

/* ==================== 热点样式（覆盖 Pannellum 默认） ==================== */
.pnlm-hotspot { cursor: pointer; }
.pnlm-tooltip { background: rgba(18,18,20,.95) !important; border-radius: 10px !important; }
.pnlm-about-msg { display: none !important; }

/* ==================== 响应式 ==================== */
@media (max-width: 720px) {
    .topbar { padding: 8px 10px; }
    .tbtn { padding: 6px 9px; font-size: 12px; }
    .brand { font-size: 13px; }
    .gallery { width: 150px; top: 50px; left: 8px; bottom: 90px; }
    .controls { gap: 3px; padding: 5px 8px; bottom: 14px; }
    .btn { width: 34px; height: 34px; font-size: 15px; }
    .editor-panel { width: calc(100vw - 20px); }
    .popup { right: 8px; left: 8px; width: auto; }
}

/* ============================================================
 * 首页样式（index.html）
 * ============================================================ */
body.home {
    overflow: auto; background: #f5f8fc; color: #0f172a;
    font-family: 'Manrope', -apple-system, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    position: relative; min-height: 100vh;
}

/* 氛围背景：浅底 + 极淡青色光晕 + 细颗粒（干净不花哨） */
.home-bg { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; background: #f5f8fc; }
.home-bg::before {
    content: ""; position: absolute; left: -25%; top: -30%; width: 150%; height: 150%;
    background:
        radial-gradient(closest-side at 12% 6%, rgba(14,165,233,.18), transparent 60%),
        radial-gradient(closest-side at 92% 0%, rgba(56,189,248,.13), transparent 55%);
    animation: nebula 32s ease-in-out infinite alternate;
}
.home-bg::after {
    content: ""; position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: .22; mix-blend-mode: multiply;
}
@keyframes nebula { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(-2%,2%) scale(1.05); } }

body.home .dot { width: 10px; height: 10px; border-radius: 50%; background: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.18); display: inline-block; margin-right: 9px; vertical-align: middle; }

/* 顶部导航 */
.home-nav {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 3vw;
    background: rgba(245,248,252,.78); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid rgba(15,23,42,.07);
}
.home-logo { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 700; color: #0f172a; letter-spacing: .2px; }
.home-nav-actions { display: flex; align-items: center; gap: 6px; }
.home-link-sub { color: #475569; text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 18px; transition: all .2s; }
.home-link-sub:hover { color: #0f172a; background: rgba(15,23,42,.06); }
.home-cta-sm {
    color: #fff; text-decoration: none; font-size: 14px; font-weight: 600;
    padding: 9px 18px; background: #0284c7; border-radius: 18px;
    box-shadow: 0 6px 16px rgba(2,132,199,.3); transition: all .2s;
}
.home-cta-sm:hover { transform: translateY(-1px); background: #0369a1; box-shadow: 0 10px 24px rgba(2,132,199,.4); }

/* Hero 分屏：左文案 + 右全景预览窗 */
.home-hero {
    margin: 0; padding: 92px 3vw 80px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center;
}
.hero-copy { animation: rise .7s .05s both ease-out; }
.hero-eyebrow {
    display: inline-block; font-family: 'Sora', sans-serif; font-size: 12px; letter-spacing: 2px;
    color: #0369a1; padding: 6px 14px; border: 1px solid rgba(14,165,233,.25); border-radius: 16px;
    margin-bottom: 24px; background: rgba(14,165,233,.08);
}
.home-hero h1 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(38px, 5.4vw, 62px); font-weight: 800; line-height: 1.06; letter-spacing: -1px;
    margin-bottom: 22px; color: #0f172a;
}
.hero-sub { font-size: clamp(15px, 1.7vw, 18px); color: #475569; line-height: 1.8; margin-bottom: 34px; max-width: 30em; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
    text-decoration: none; padding: 15px 30px; border-radius: 26px; font-size: 16px; font-weight: 600;
    transition: all .25s; font-family: 'Manrope', sans-serif; display: inline-flex; align-items: center;
}
.btn-primary { background: #0284c7; color: #fff; box-shadow: 0 10px 28px rgba(2,132,199,.32); }
.btn-primary:hover { transform: translateY(-2px); background: #0369a1; box-shadow: 0 14px 36px rgba(2,132,199,.42); }
.btn-primary:active, .btn-ghost:active { transform: scale(.98); }
.btn-ghost { border: 1px solid rgba(15,23,42,.16); color: #0f172a; background: #fff; }
.btn-ghost:hover { background: #f1f5f9; border-color: rgba(15,23,42,.28); }
/* Hero 全景预览窗（home.js 填充首张演示缩略图） */
.hero-portal {
    position: relative; aspect-ratio: 4/3; border-radius: 22px; overflow: hidden;
    background: #0c1320 center/cover no-repeat; border: 1px solid rgba(15,23,42,.08);
    box-shadow: 0 30px 60px rgba(2,32,71,.18), 0 8px 20px rgba(2,32,71,.1);
    animation: rise .8s .15s both ease-out;
}
.hero-portal-ring { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 120%, rgba(2,132,199,.25), transparent 60%); }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* 功能特性：2×2 紧凑网格（内容自适应高度，无空洞） */
.features-bento {
    max-width: none; margin: 0; padding: 24px 3vw 80px;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.feat {
    background: #fff; border: 1px solid rgba(15,23,42,.08); border-radius: 18px; padding: 28px 26px;
    box-shadow: 0 4px 14px rgba(2,32,71,.05); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.feat:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(2,32,71,.1); border-color: rgba(14,165,233,.35); }
.feat-lg {
    background: linear-gradient(150deg, #0369a1, #0284c7); border-color: transparent; color: #fff;
    box-shadow: 0 16px 40px rgba(2,132,199,.28);
}
.feat-lg:hover { box-shadow: 0 20px 48px rgba(2,132,199,.4); }
.feat-tag {
    font-family: 'Sora', sans-serif; font-size: 11px; letter-spacing: 1.5px; color: #0ea5e9;
    text-transform: uppercase; font-weight: 600; margin-bottom: 10px; display: block;
}
.feat-lg .feat-tag { color: rgba(255,255,255,.82); }
.feat h3 { font-family: 'Sora', sans-serif; font-size: 19px; font-weight: 700; margin-bottom: 8px; color: #0f172a; }
.feat-lg h3 { font-size: 22px; color: #fff; }
.feat p { font-size: 14px; color: #64748b; line-height: 1.65; }
.feat-lg p { color: rgba(255,255,255,.92); }

/* 演示网格 */
.home-demos { max-width: none; margin: 0; padding: 16px 3vw 72px; }
.demos-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.home-demos h2 { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; color: #0f172a; }
.demo-count { font-size: 14px; color: #0ea5e9; font-weight: 600; }
.demos-tip { font-size: 14px; color: #64748b; margin-bottom: 26px; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.demo-card {
    display: block; text-decoration: none; color: inherit;
    background: #fff; border: 1px solid rgba(15,23,42,.08); border-radius: 16px; overflow: hidden;
    box-shadow: 0 4px 14px rgba(2,32,71,.05); transition: all .25s;
}
.demo-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(2,32,71,.13); border-color: rgba(14,165,233,.4); }
.demo-thumb { aspect-ratio: 2/1; background: #0c1320 center/cover no-repeat; }
.demo-name { padding: 14px 16px 4px; font-size: 15px; font-weight: 600; color: #0f172a; }
.demo-go { padding: 0 16px 16px; font-size: 13px; color: #0284c7; font-weight: 500; }
.empty { color: #94a3b8; padding: 30px; text-align: center; }

/* 页脚 */
.home-footer { max-width: none; margin: 0; padding: 28px 3vw 48px; border-top: 1px solid rgba(15,23,42,.08); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.footer-link { color: #475569; text-decoration: none; font-size: 14px; transition: color .2s; font-weight: 500; }
.footer-link:hover { color: #0284c7; }
.footer-sep { color: #cbd5e1; }
.footer-note { width: 100%; margin-top: 8px; color: #94a3b8; font-size: 12.5px; }

/* 首页响应式：Bento/Hero 在窄屏显式折叠 */
@media (max-width: 900px) {
    .home-hero { grid-template-columns: 1fr; gap: 36px; padding: 64px 3vw 56px; }
    .hero-portal { aspect-ratio: 16/10; }
    .features-bento { grid-template-columns: repeat(2, 1fr); }
    .feat-lg { grid-column: span 2; grid-row: auto; }
    .feat-tall { grid-row: auto; }
    .feat-wide { grid-column: span 2; }
}
@media (max-width: 560px) {
    .features-bento { grid-template-columns: 1fr; }
    .feat-lg, .feat-wide { grid-column: auto; }
    .home-nav { padding: 12px 5vw; }
    .home-link-sub { padding: 7px 10px; font-size: 13px; }
    .home-hero h1 { font-size: clamp(32px, 9vw, 44px); }
}

/* 返回首页链接（查看器顶栏） */
.home-link {
    color: rgba(255,255,255,.6); text-decoration: none; font-size: 18px;
    margin-right: 6px; padding: 0 6px; border-radius: 6px; transition: all .2s;
}
.home-link:hover { background: rgba(255,255,255,.1); color: #fff; }

/* 画廊角标与删除（查看器） */
.scene-thumb { position: relative; }
.scene-badge {
    position: absolute; top: 5px; left: 5px; font-size: 10px; padding: 2px 6px;
    border-radius: 8px; font-weight: 600; backdrop-filter: blur(4px);
}
.scene-badge.b-demo { background: rgba(0,0,0,.55); color: rgba(255,255,255,.7); }
.scene-badge.b-user { background: rgba(79,195,247,.85); color: #062b3a; }
.scene-del {
    position: absolute; top: 5px; right: 5px; width: 20px; height: 20px;
    border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #ff6b6b;
    cursor: pointer; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.scene-del:hover { background: rgba(255,107,107,.85); color: #fff; }

/* ============================================================
 * 查看器手机端适配
 * ============================================================ */
/* 菜单触发按钮：桌面隐藏，手机显示 */
.menu-toggle {
    display: none;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0,0,0,.45); color: #fff; border: 1px solid rgba(255,255,255,.12);
    cursor: pointer; font-size: 20px; line-height: 1;
    align-items: center; justify-content: center;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;   /* 顶栏是 pointer-events:none，这里必须重新开启才能点 */
}
/* 手机端画廊抽屉遮罩（桌面不显示） */
.gallery-backdrop { display: none; }

@media (max-width: 720px) {
    /* 顶栏：5 个按钮合并成右上角下拉菜单 */
    .menu-toggle { display: flex; }
    .topbar { padding: 8px 10px; }
    .brand { font-size: 13px; max-width: 60vw; }
    .brand #scene-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .top-actions {
        position: absolute; top: calc(100% + 4px); right: 8px; left: auto;
        flex-direction: column; gap: 2px; padding: 6px;
        background: rgba(18,18,20,.96);
        backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
        box-shadow: 0 10px 32px rgba(0,0,0,.55);
        display: none; z-index: 25;
    }
    .top-actions.open { display: flex; }
    .top-actions .tbtn { width: 150px; justify-content: flex-start; border-radius: 8px; padding: 9px 12px; }

    /* 画廊更窄 */
    .gallery { width: 128px; top: 50px; left: 8px; bottom: 88px; }
    /* 画廊抽屉遮罩：打开时盖住画面，点遮罩关闭 */
    .gallery-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 14; }

    /* 底部控制：换行排布，隐藏分隔线，触控区加大，居中不溢出 */
    .controls { flex-wrap: wrap; max-width: 94vw; justify-content: center; gap: 5px; padding: 7px 10px; bottom: 12px; border-radius: 20px; }
    .controls .sep { display: none; }
    .btn { width: 38px; height: 38px; font-size: 16px; }

    /* 编辑/弹出面板：弹出面板改底部抽屉（不挡顶栏菜单/画廊，✕或点遮罩关闭） */
    .editor-panel { width: calc(100vw - 20px); bottom: 60px; }
    .popup {
        top: auto; bottom: 0; left: 0; right: 0; width: auto;
        border-radius: 18px 18px 0 0; max-height: 62vh;
        box-shadow: 0 -8px 32px rgba(0,0,0,.5);
    }
    .popup-backdrop.show {
        display: block; position: fixed; top: 50px; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,.45); z-index: 38;
    }
    .popup-list { max-height: 38vh; }

    /* 提示条上移避免挡控制栏 */
    .hint { top: 52px; font-size: 11px; padding: 5px 14px; }
}
