/* 全景 VR 展示 —— 深色玻璃拟态界面 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* [hidden] 属性优先级高于任何 display 设置 */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0b0e13;
  color: #e8edf4;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#glcanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  background: radial-gradient(120% 90% at 50% 40%, #17202e 0%, #0b0e13 70%);
}
#glcanvas:active { cursor: grabbing; }

#app { position: fixed; inset: 0; pointer-events: none; }
#app > * { pointer-events: auto; }

/* ---------- 通用控件 ---------- */
.ui { transition: opacity .45s ease; }
body.ui-dim .ui { opacity: .18; }
body.ui-hidden .ui, body.vr-mode .ui { opacity: 0 !important; pointer-events: none !important; }
body.ui-dim .ui:hover { opacity: 1; }

button { font-family: inherit; }

.icon-btn, .dock-btn, .nav-arrow, .chip, .thumb-item, #btn-strip-toggle {
  background: rgba(17, 22, 30, .78);
  color: #dfe7f2;
  border: 1px solid rgba(255, 255, 255, .09);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}
.icon-btn:hover, .dock-btn:hover, .nav-arrow:hover, #btn-strip-toggle:hover {
  background: rgba(41, 54, 72, .92);
  border-color: rgba(96, 160, 255, .55);
  color: #fff;
}
.dock-btn.on, .chip.active {
  background: linear-gradient(135deg, rgba(45,108,223,.95), rgba(77,163,255,.9));
  border-color: rgba(140, 190, 255, .6);
  color: #fff;
}

/* ---------- 顶部 ---------- */
#topbar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 16px; right: 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  z-index: 20;
}
#brand-logo {
  height: 52px;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

#btn-compass {
  width: 46px; height: 46px; border-radius: 50%;
  padding: 3px;
  cursor: pointer;
}
.compass-ring { fill: rgba(15, 19, 26, .72); stroke: rgba(255,255,255,.22); stroke-width: 1.4; }
.compass-n { fill: #ff6a5e; }
.compass-s { fill: #8a97a8; }
.compass-txt { font-size: 7.5px; fill: #b9c4d4; }
/* 罗盘指针用 CSS transform 旋转（JS 设 style.transform = rotate(Xdeg)）。
   轴心由 transform-box + transform-origin 固定在 viewBox 中心 (20,20)；
   不要改回 SVG transform 属性写法——那套解析在不同 Chrome 上行为不一致 */
#compass-rose { transform-box: view-box; transform-origin: 20px 20px; transition: transform .12s linear; }

/* ---------- 加载进度 ---------- */
#progress {
  position: absolute;
  top: max(74px, calc(env(safe-area-inset-top) + 60px));
  left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(15, 19, 26, .8);
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
  z-index: 30;
}
#progress-track { width: 140px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
#progress-fill { height: 100%; width: 0%; border-radius: 4px; background: linear-gradient(90deg, #2d6cdf, #4da3ff); transition: width .2s ease; }
#progress-text { font-size: 12px; color: #b9c4d4; white-space: nowrap; }

/* ---------- 左右切换箭头 ---------- */
.nav-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 72px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 15;
}
.nav-arrow svg { width: 26px; height: 26px; }
.nav-arrow.left { left: 14px; }
.nav-arrow.right { right: 14px; }
.nav-arrow:active { transform: translateY(-50%) scale(.94); }

/* ---------- 提示 ---------- */
#hint {
  position: absolute;
  left: 50%; bottom: 190px; transform: translateX(-50%);
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(15, 19, 26, .78);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 13px; color: #cdd7e4;
  white-space: nowrap;
  z-index: 25;
  animation: hintFloat 2.6s ease-in-out infinite;
}
@keyframes hintFloat { 50% { transform: translateX(-50%) translateY(-5px); } }

#toast {
  position: absolute;
  left: 50%; bottom: 128px; transform: translateX(-50%) translateY(8px);
  max-width: min(84vw, 480px);
  padding: 9px 18px;
  border-radius: 12px;
  background: rgba(20, 26, 36, .92);
  border: 1px solid rgba(96, 160, 255, .4);
  font-size: 13px; color: #e8eefb;
  text-align: center;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 60;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 热点 ---------- */
#hotspots { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 10; }
.hotspot {
  position: absolute;
  width: 40px; height: 46px;
  margin: 0; padding: 0;
  border: none; background: none;
  cursor: pointer;
  pointer-events: auto;
  display: flex; flex-direction: column; align-items: center;
}
.hotspot-ring {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(120, 180, 255, .95);
  background: rgba(30, 60, 110, .45);
  backdrop-filter: blur(2px);
  animation: pulse 1.8s ease-out infinite;
}
.hotspot-arrow { margin-top: 1px; color: rgba(150, 195, 255, .95); font-size: 15px; line-height: 1; }
.hotspot.info {
  width: 34px; height: 34px;
  font-size: 15px; font-weight: 700; font-style: italic; color: #fff;
  background: rgba(40, 90, 170, .55);
  border: 2px solid rgba(120, 180, 255, .9);
  border-radius: 50%;
  animation: pulse 1.8s ease-out infinite;
}
.hotspot.info .hotspot-ring { display: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 170, 255, .55); }
  70% { box-shadow: 0 0 0 14px rgba(110, 170, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 170, 255, 0); }
}

/* ---------- 底部 ---------- */
#bottombar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
}

#chips {
  display: flex; gap: 6px;
  max-width: 96vw;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}
#chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: rgba(96, 160, 255, .55); }
.chip[draggable="true"] { cursor: grab; }
.chip.dragging { opacity: .45; }
.chip.drag-over { border-color: #4da3ff; box-shadow: 0 0 0 1px #4da3ff; }

#strip-wrap {
  position: relative;
  width: min(96vw, 1080px);
  /* 顶部留出折叠按钮的独立空间带，避免与分类栏/缩略图重合 */
  margin-top: 32px;
}
#strip-wrap.stripped { margin-top: 14px; }
#strip {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 6px 34px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.thumb-item {
  flex: 0 0 auto;
  width: 104px;
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
  scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.thumb-item:hover { border-color: rgba(96, 160, 255, .6); transform: translateY(-2px); }
.thumb-item.active {
  border-color: #4da3ff;
  box-shadow: 0 0 0 1px #4da3ff, 0 4px 16px rgba(50, 120, 230, .35);
  background: rgba(35, 60, 100, .85);
}
.thumb-img-wrap {
  width: 94px; height: 47px;
  border-radius: 7px; overflow: hidden;
  background: #10151d;
  display: block;
}
.thumb-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-name {
  font-size: 11px; color: #b9c4d4;
  max-width: 96px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb-item.active .thumb-name { color: #fff; }

#btn-strip-toggle {
  position: absolute;
  top: -26px; left: 50%;
  transform: translateX(-50%);
  width: 34px; height: 22px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 5;
}
#strip-wrap.stripped #strip { display: none; }
#strip-wrap.stripped #btn-strip-toggle svg { transform: rotate(180deg); }

#dock {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 19, 26, .78);
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 96vw;
  overflow-x: auto;
  scrollbar-width: none;
}
#dock::-webkit-scrollbar { display: none; }
.dock-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 12.5px; font-weight: 700;
}
.dock-btn svg { width: 20px; height: 20px; }
.dock-sep { width: 1px; height: 22px; background: rgba(255,255,255,.14); flex: 0 0 auto; margin: 0 3px; }

/* ---------- 帮助 ---------- */
#help-modal {
  position: fixed; inset: 0;
  background: rgba(5, 8, 12, .62);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
#help-card {
  position: relative;
  width: min(92vw, 640px);
  max-height: 84vh; overflow-y: auto;
  background: #131923;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 22px 26px 20px;
  box-shadow: 0 18px 60px rgba(0,0,0,.5);
}
#help-card h2 { margin: 0 0 14px; font-size: 18px; }
#help-card h3 { margin: 0 0 8px; font-size: 13.5px; color: #9fc4ff; }
#help-card ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 2; color: #cdd7e4; }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.help-note { margin: 16px 0 0; font-size: 12px; color: #8a97a8; line-height: 1.8; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; }
kbd {
  display: inline-block; min-width: 20px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #1e2735;
  border: 1px solid rgba(255,255,255,.16);
  border-bottom-width: 2px;
  font-family: inherit; font-size: 11.5px; text-align: center;
}
#btn-help-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #cdd7e4; cursor: pointer;
}
#btn-help-close:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- 场景管理 ---------- */
#manage-modal {
  position: fixed; inset: 0;
  background: rgba(5, 8, 12, .62);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 110;
}
#manage-card {
  position: relative;
  width: min(94vw, 720px);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: #131923;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  padding: 20px 22px 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5);
}
#manage-card h2 { margin: 0 0 12px; font-size: 18px; }
#btn-manage-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: #cdd7e4; cursor: pointer;
}
#btn-manage-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }
#manage-api-tip {
  margin: 0 0 10px; padding: 8px 12px;
  border-radius: 8px;
  background: rgba(160, 90, 40, .18);
  border: 1px solid rgba(255, 170, 90, .4);
  font-size: 12.5px; color: #ffd9b0;
}

#manage-add {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px dashed rgba(120, 170, 255, .45);
  background: rgba(30, 48, 80, .25);
  color: #b9d2f5;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
#manage-add:hover, #manage-add.drag { border-color: #4da3ff; background: rgba(45, 80, 140, .35); }
#manage-add svg { width: 26px; height: 26px; flex: 0 0 auto; }
.manage-add-text { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.manage-add-text b { font-size: 13.5px; color: #e8eefb; }
.manage-add-text span { font-size: 11.5px; color: #8a97a8; }

#manage-queue { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mq-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(22, 30, 44, .9);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: 12.5px;
}
.mq-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #cdd7e4; }
.mq-bar { width: 130px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; flex: 0 0 auto; }
.mq-fill { height: 100%; width: 0%; border-radius: 4px; background: linear-gradient(90deg, #2d6cdf, #4da3ff); transition: width .2s ease; }
.mq-status { flex: 0 0 auto; width: 88px; text-align: right; color: #8a97a8; }
.mq-row.error .mq-status { color: #ff8f7e; }
.mq-row.done .mq-status { color: #7ee2a0; }

#manage-list {
  margin-top: 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 60px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}
.mrow {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(22, 30, 44, .75);
  border: 1px solid rgba(255, 255, 255, .07);
}
.mrow.current { border-color: rgba(96, 160, 255, .5); }
.mthumb { width: 74px; height: 37px; border-radius: 6px; object-fit: cover; background: #10151d; flex: 0 0 auto; }
.mfields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mfields input {
  width: 100%;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(10, 14, 20, .8);
  color: #e8edf4;
  font-family: inherit; font-size: 12.5px;
}
.mfields input:focus { outline: none; border-color: #4da3ff; }
.mfields input.dirty { border-color: rgba(255, 200, 90, .6); }
.msrc { font-size: 10.5px; color: #67717f; }
.mdel {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: #8a97a8; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.mdel:hover { color: #ff8f7e; border-color: rgba(255, 120, 100, .5); }
.mdel.confirm { color: #fff; background: #c0392b; border-color: #e74c3c; }

#manage-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
#manage-dirty-tip { font-size: 12px; color: #ffc85e; }
#btn-manage-save {
  padding: 7px 20px;
  border-radius: 999px;
  border: 1px solid rgba(140, 190, 255, .6);
  background: linear-gradient(135deg, rgba(45,108,223,.95), rgba(77,163,255,.9));
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
#btn-manage-save:disabled { opacity: .45; cursor: default; }

@media (max-width: 720px) {
  #manage-card { padding: 14px 12px 12px; }
  .mthumb { width: 58px; height: 29px; }
  .mq-bar { width: 70px; }
}

/* ---------- file:// 提示 ---------- */
#file-protocol-tip, #noscript-tip {
  position: fixed; inset: 0;
  background: #0b0e13;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  z-index: 200;
  padding: 20px;
}
#file-protocol-tip h2, #noscript-tip { font-size: 18px; }
#file-protocol-tip p { color: #a8b4c4; font-size: 14px; line-height: 2; }
#file-protocol-tip b { color: #9fc4ff; }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .nav-arrow { display: none; }
  .hotspot.photo { width: 18px; height: 18px; }
  .hotspot.photo .hotspot-core { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }
  .hotspot.photo .hotspot-label { font-size: 10px; padding: 3px 8px; max-width: 120px; bottom: calc(100% + 8px); }
  .hotspot-custom { max-width: 46px; max-height: 32px; }
  .hotspot.scene { width: 34px; height: 30px; }
  .hotspot.scene .hotspot-label { font-size: 10px; padding: 3px 8px; }
  #brand-logo { height: 36px; padding: 5px 11px; }
  #btn-compass { width: 40px; height: 40px; }
  .thumb-item { width: 84px; }
  .thumb-img-wrap { width: 74px; height: 37px; }
  .thumb-name { font-size: 10px; max-width: 76px; }
  .dock-btn { width: 34px; height: 34px; }
  #hint { bottom: 160px; font-size: 12px; }
  .help-cols { grid-template-columns: 1fr; }
}

@media (max-height: 560px) {
  #chips { display: none; }
  #hint { bottom: 130px; }
  #toast { bottom: 96px; }
}

/* ---------- 材料热点 ---------- */
/* 默认造型：白色圆点 + 半透明光晕（向外脉冲），标注在图标上方（参考主流材料标注样式） */
.hotspot.photo { width: 24px; height: 24px; }
.hotspot.photo.has-icon, .hotspot.scene.has-icon { width: auto; height: auto; }
.hotspot-custom {
  display: block;
  max-width: 64px;
  max-height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .38));
  pointer-events: none;
}
.hotspot.photo .hotspot-halo {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .32);
  transition: background .2s ease;
}
.hotspot.photo:hover .hotspot-halo { background: rgba(255, 255, 255, .5); }
.hotspot.photo .hotspot-core {
  position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
}
.hotspot.photo .hotspot-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .38);
  animation: spotPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes spotPulse {
  0%   { transform: scale(.45); opacity: .75; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}
.hotspot .hotspot-label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 150px;
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(38, 38, 40, .82);
  color: #fff;
  font-size: 11px;
  letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
  pointer-events: none;
}
.hotspot.photo:hover .hotspot-label,
.hotspot.scene:hover .hotspot-label { background: rgba(28, 28, 30, .95); }

/* 热点编辑模式 */
body.spot-edit #glcanvas { cursor: crosshair; }
.hotspot.editable .hotspot-halo {
  outline: 2px dashed rgba(255, 215, 106, .95);
  outline-offset: 3px;
}
.hotspot.editable .hotspot-custom {
  outline: 2px dashed rgba(255, 215, 106, .95);
  outline-offset: 3px;
}
.hotspot.editable.info,
.hotspot.editable .hotspot-ring {
  border-style: dashed;
  border-color: #ffd76a;
}
.hotspot.editable { filter: drop-shadow(0 0 6px rgba(255, 215, 106, .55)); }

/* 热点表单弹窗 */
#spot-modal {
  position: fixed; inset: 0;
  background: rgba(5, 8, 12, .62);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 120;
}
#spot-card {
  position: relative;
  width: min(92vw, 460px);
  max-height: 86vh; overflow-y: auto;
  background: #131923;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  padding: 20px 22px 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5);
}
#spot-card h2 { margin: 0 0 14px; font-size: 18px; }
#btn-spot-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: #cdd7e4; cursor: pointer;
}
#btn-spot-close:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.spot-field { display: block; margin-bottom: 12px; font-size: 13px; color: #b9c4d4; }
.spot-field input[type="text"], .spot-field input, .spot-field textarea {
  display: block; width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: #0e131b;
  color: #e8edf4;
  font-family: inherit; font-size: 13.5px;
  resize: vertical;
}
.spot-field input:focus, .spot-field textarea:focus { outline: none; border-color: rgba(96, 160, 255, .65); }
#spot-img-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
#spot-img-preview {
  width: 74px; height: 74px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .18);
}
#btn-spot-img {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px dashed rgba(120, 170, 255, .55);
  background: rgba(45, 90, 160, .18);
  color: #b9d4ff; cursor: pointer; font-size: 13px;
}
#btn-spot-img:hover { background: rgba(45, 90, 160, .34); }
#spot-img-tip { font-size: 12px; color: #8a97a8; }
#spot-form-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
#spot-form-actions button {
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  color: #dfe7f2; cursor: pointer; font-size: 13.5px;
}
#spot-form-actions button:hover { background: rgba(255, 255, 255, .14); }
#spot-form-actions .danger { color: #ff9d94; border-color: rgba(255, 120, 110, .4); }
#spot-form-actions .danger:hover { background: rgba(255, 120, 110, .16); }
#spot-form-actions #btn-spot-save {
  background: linear-gradient(135deg, rgba(45,108,223,.95), rgba(77,163,255,.9));
  border-color: rgba(140, 190, 255, .6);
  color: #fff; font-weight: 600;
}
.flex-grow { flex: 1; }

/* 材料大图灯箱 */
#lightbox {
  position: fixed; inset: 0;
  background: rgba(4, 6, 10, .78);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 130;
}
#lightbox-card {
  position: relative;
  max-width: min(92vw, 900px);
  max-height: 88vh;
  background: #131923;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column;
  gap: 10px;
}
#lightbox-img {
  max-width: 100%;
  max-height: 64vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}
#lightbox-text { padding: 2px 6px 4px; }
#lightbox-title { margin: 0 0 4px; font-size: 16px; color: #eef3fa; }
#lightbox-desc { margin: 0; font-size: 13px; line-height: 1.8; color: #b9c4d4; white-space: pre-wrap; }
#btn-lightbox-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(10, 14, 20, .7);
  color: #dfe7f2; cursor: pointer; z-index: 2;
}
#btn-lightbox-close:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* 场景跳转热点：白色双箭头 + 上方标注 */
.hotspot.scene { width: 46px; height: 42px; }
.hotspot.scene .hotspot-chevrons {
  position: absolute; inset: 0;
  transition: transform .15s ease;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .45));
}
.hotspot.scene:hover .hotspot-chevrons { transform: scale(1.1); }
.hotspot .hotspot-label { pointer-events: none; }
.hotspot.scene .hotspot-label { animation: none; }

/* 表单：热点类型选择 */
#spot-type-row { display: flex; gap: 8px; margin-top: 8px; }
#spot-type-row .type-btn {
  flex: 1;
  padding: 9px 6px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .05);
  color: #b9c4d4;
  font-size: 12.5px;
  cursor: pointer;
}
#spot-type-row .type-btn:hover { background: rgba(255, 255, 255, .12); }
#spot-type-row .type-btn.active {
  background: linear-gradient(135deg, rgba(45,108,223,.95), rgba(77,163,255,.9));
  border-color: rgba(140, 190, 255, .6);
  color: #fff;
  font-weight: 600;
}
#spot-target-row select {
  display: block; width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: #0e131b;
  color: #e8edf4;
  font-family: inherit; font-size: 13.5px;
}

/* 同步到其他场景 */
#spot-sync-actions { display: flex; gap: 6px; margin-top: 8px; }
#spot-sync-actions button {
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: #b9c4d4;
  font-size: 12px;
  cursor: pointer;
}
#spot-sync-actions button:hover { background: rgba(255, 255, 255, .13); color: #fff; }
#spot-sync-list {
  margin-top: 8px;
  max-height: 168px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  background: #0e131b;
}
#spot-sync-list .sync-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #cdd7e4;
  cursor: pointer;
}
#spot-sync-list .sync-row:hover { background: rgba(255, 255, 255, .06); }
#spot-sync-list .sync-row em {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  color: #77839280;
  color: #77839a;
}
#spot-sync-list input { accent-color: #4da3ff; }

/* 灯箱大画廊：大尺寸展示 + 左右切换 + 计数 */
#lightbox-card {
  width: auto;
  max-width: min(97vw, 2000px);
  max-height: 94vh;
  padding: 10px 12px 8px;
  display: flex; flex-direction: column;
}
#lightbox-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 120px;
}
#lightbox-img {
  max-width: 100%;
  max-height: calc(94vh - 160px);
  min-height: 120px;
  min-width: 320px;
  object-fit: contain;
  border-radius: 10px;
  background: #0a0d12;
  opacity: 1;
  transition: opacity .15s ease;
}
#lightbox-img.loading { opacity: .25; }
#lightbox-stage.no-img #lightbox-img { display: none; }
#lightbox-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #b9c4d4;
  background: rgba(10, 13, 18, .5);
  border-radius: 10px;
}
.lb-nav {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 64px;
  border: none; border-radius: 10px;
  background: rgba(10, 14, 20, .62);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lb-nav:hover { background: rgba(45, 90, 170, .8); }
.lb-nav svg { width: 26px; height: 26px; }
#btn-lightbox-prev { left: 10px; }
#btn-lightbox-next { right: 10px; }
#lightbox-counter {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(10, 14, 20, .7);
  color: #dfe9f8;
  font-size: 12.5px;
}
#lightbox-text { padding: 6px 6px 2px; }
#lightbox-title { margin: 0 0 4px; font-size: 17px; color: #eef3fa; }
#lightbox-desc { margin: 0; font-size: 13px; line-height: 1.8; color: #b9c4d4; white-space: pre-wrap; }

/* 表单：展示图库缩略图 */
#spot-gallery {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}
#spot-gallery .gallery-cell {
  position: relative;
  width: 92px; height: 58px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
}
#spot-gallery .gallery-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
#spot-gallery .gallery-del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: rgba(10, 14, 20, .78);
  color: #ffb3ab;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}
#spot-gallery .gallery-del:hover { background: rgba(220, 80, 70, .9); color: #fff; }

/* 纯净模式：隐藏工具栏与热点，仅保留 LOGO（右上角按钮或 C 键切换） */
#topbar-right { display: flex; align-items: center; gap: 8px; }
body.clean-mode #bottombar,
body.clean-mode .nav-arrow,
body.clean-mode #hotspots,
body.clean-mode #progress { display: none !important; }
body.clean-mode #btn-clean { opacity: .45; }
body.clean-mode #btn-clean:hover,
body.clean-mode #btn-clean.on { opacity: 1; }
body.clean-mode #btn-clean.on svg { opacity: .9; }

/* 纯净模式按钮使用自定义图标 */
#btn-clean img {
  width: 22px; height: 22px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* 纯净模式按钮：仅显示透明通道图标，无边框底色 */
#btn-clean {
  width: auto; height: auto;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#btn-clean:hover {
  background: none;
  border-color: transparent;
  transform: scale(1.08);
}
#btn-clean img {
  width: 26px; height: 26px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
