/* ==========================================================================
   VR 全景查看器（/vr/<slug>/）—— 独立全屏页，不继承站内样式
   变量统一加 --vr- 前缀，避免与站内 :root 冲突
   ========================================================================== */
:root {
  --vr-bg: #f5f6f8;
  --vr-card: #fff;
  --vr-line: #e4e7ec;
  --vr-txt: #222;
  --vr-muted: #6b7280;
  --vr-brand: #c80000;
  --vr-brand2: #a50000;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body.vr-body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #111;
  color: var(--vr-txt);
  line-height: 1.5;
  overflow: hidden;
}
a { color: var(--vr-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏（覆在全景上） */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--vr-card);
  border-bottom: 1px solid var(--vr-line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 18px; margin: 0; flex: 1; }
.topbar .back { font-weight: 600; }

/* 查看器主体 */
.pano-wrap { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
#panorama { width: 100%; height: 100%; background: #111; }

.scene-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 21;
  background: linear-gradient(to bottom, rgba(0,0,0,.5), rgba(0,0,0,0));
  border-bottom: none;
  padding: 12px 16px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.scene-top h1 { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.7); font-size: 18px; }
.scene-top .back { color: #fff; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.7); margin-right: 6px; }

/* 底部：视角说明 + 视角切换按钮 */
.scene-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 14px;
  z-index: 21;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 76px;
  pointer-events: none;
}
.scene-overlay > * { pointer-events: auto; }
.desc {
  background: rgba(0,0,0,.42);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  max-width: min(92vw, 560px);
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.desc:empty { display: none; }
.desc-title { display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.desc-text { display: block; color: rgba(255,255,255,.85); font-size: 12px; white-space: pre-wrap; }
.navbtns {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  justify-content: center;
  max-width: min(92vw, 520px);
}
.navbtn {
  background: rgba(0,0,0,.42);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13px;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.navbtn:hover { border-color: rgba(255,255,255,.55); }
.navbtn.active { background: #fff; color: #111; border-color: #fff; text-shadow: none; }

/* 隐藏 Pannellum 自带控件（缩放 / 全屏 / 自动旋转） */
.pnlm-controls, .pnlm-controls-container, .pnlm-zoom-controls,
.pnlm-fullscreen-toggle-button, .pnlm-orientation-button,
.pnlm-hot-spot-debug-indicator { display: none !important; }

/* 右侧视角模式：广角 / 无畸变 / 横屏 */
.viewmodes {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vmode {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 58px;
  padding: 8px 4px;
  border-radius: 14px;
  background: rgba(0,0,0,.42);
  color: #fff;
  border: 1px solid rgba(255,255,255,.20);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.vmode:hover { background: rgba(0,0,0,.62); }
.vmode .vm-ico { display: block; width: 24px; height: 24px; }
.vmode .vm-ico svg { width: 24px; height: 24px; display: block; }
.vmode .vm-en { font-size: 9px; font-weight: 700; letter-spacing: .6px; opacity: .95; }
.vmode .vm-cn { font-size: 12px; font-weight: 600; line-height: 1.2; }
.vmode.active { background: #fff; color: #111; border-color: #fff; }
.vmode.active:hover { background: #fff; }

/* 横屏按钮用品牌红区分 */
.land-toggle { background: rgba(200,0,0,.62); border-color: rgba(255,255,255,.35); }
.land-toggle:hover { background: rgba(200,0,0,.78); }
.land-toggle.active { background: #fff; color: #111; border-color: #fff; }

/* 首次打开的手势提示 */
.gesture-hint {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gesture-hint .gh-card {
  background: rgba(17,17,17,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 18px 24px;
  color: #fff;
  max-width: 84vw;
  opacity: 0;
  transform: translateY(8px) scale(.96);
  transition: opacity .4s ease, transform .4s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.gesture-hint.show .gh-card { opacity: 1; transform: translateY(0) scale(1); }
.gesture-hint.hide .gh-card { opacity: 0; transform: translateY(0) scale(.96); }
.gesture-hint .gh-title { font-size: 14px; font-weight: 600; letter-spacing: .05em; margin-bottom: 12px; opacity: .92; text-align: center; }
.gesture-hint .gh-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.gesture-hint .gh-ico { flex: 0 0 auto; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.gesture-hint .gh-ico svg { width: 24px; height: 24px; display: block; }
.gesture-hint .gh-txt { font-size: 14px; line-height: 1.4; opacity: .95; }

/* 全景页 logo 水印：屏幕纵向 2/3 处，水平居中，不挡拖拽 */
.pano-watermark {
  position: absolute;
  top: 66.667%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(220px, 34vw);
  height: auto;
  opacity: .3;
  z-index: 20;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* 横屏观看模式：全景铺满全屏，隐藏顶栏与视角按钮 */
html.is-landscape body { overflow: hidden; background: #000; }
html.is-landscape .pano-wrap { position: fixed; inset: 0; z-index: 9999; background: #000; }
html.is-landscape #panorama { width: 100%; height: 100%; }
html.is-landscape .scene-top { display: none; }
html.is-landscape .viewmodes { z-index: 10000; }

/* 竖屏时点了横屏但系统无法锁定方向（如 iOS）：提示用户把手机横过来 */
.rotate-hint { display: none; }
@media (orientation: portrait) {
  html.is-landscape .rotate-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10001;
    padding: 11px 14px;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: 13px;
    text-align: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

@media (max-width: 520px) {
  .pano-watermark { width: min(160px, 40vw); }
  .gesture-hint .gh-card { padding: 15px 18px; border-radius: 12px; }
  .gesture-hint .gh-txt { font-size: 13px; }
  .viewmodes { right: 10px; top: 50%; transform: translateY(-50%); gap: 8px; }
  .vmode { width: 50px; padding: 6px 3px; }
  .vmode .vm-ico, .vmode .vm-ico svg { width: 21px; height: 21px; }
  .vmode .vm-cn { font-size: 11px; }
  .scene-overlay { padding: 0 62px; bottom: 10px; gap: 6px; }
  .navbtn { padding: 7px 12px; font-size: 12px; }
  .desc { font-size: 12px; padding: 6px 12px; }
  .scene-top h1 { font-size: 15px; }
}
