/* ===== 室内街景查看器样式 · 苹果极简风 ===== */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, 'SF Pro Text', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #000;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

/* 全景容器 */
#panorama {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}
#panorama .pnlm-container {
  background: #000;
}
/* 把 Pannellum 控件容器（缩放按钮）整体从左上角移到右上角、顶栏下方，避免压住节点标题 */
#panorama .pnlm-controls-container {
  top: 64px !important;
  left: auto !important;
  right: 20px !important;
}
/* Pannellum 自带控件按钮也走毛玻璃极简 */
#panorama .pnlm-controls {
  background: rgba(28, 28, 30, 0.55) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28) !important;
}
#panorama .pnlm-controls:hover {
  background: rgba(44, 44, 46, 0.78) !important;
}
/* 缩放组整体大圆角，分隔线弱化 */
#panorama .pnlm-zoom-controls {
  border-radius: 14px !important;
  overflow: hidden;
}
#panorama .pnlm-zoom-in {
  border-radius: 0 !important;
}
#panorama .pnlm-zoom-out {
  border-radius: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}
/* 隐藏 Pannellum 自带的左下角场景标题条（顶栏已显示节点名），避免与校准状态重叠 */
#panorama .pnlm-panorama-info {
  display: none !important;
}

/* 顶部标题栏 */
#topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent);
  z-index: 10;
  pointer-events: none;
}
#topbar > * {
  pointer-events: auto;
}
#node-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-right: auto;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
#node-id-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 12px;
  background: rgba(28, 28, 30, 0.55);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* 工具按钮 · 苹果毛玻璃圆形按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(28, 28, 30, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition:
    background 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
    backdrop-filter 0.18s,
    box-shadow 0.18s,
    transform 0.12s cubic-bezier(0.22, 0.61, 0.36, 1);
  user-select: none;
}
.btn:hover {
  background: rgba(44, 44, 46, 0.78);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.btn:active {
  transform: scale(0.96);
  background: rgba(58, 58, 60, 0.9);
}
.btn.active {
  background: #0a84ff;
  border-color: rgba(10, 132, 255, 0.6);
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.35);
}
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  font-size: 16px;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
}

/* 管理工具栏 */
#admin-bar {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  white-space: nowrap;
  background: rgba(28, 28, 30, 0.72);
  border: 1px solid rgba(10, 132, 255, 0.35);
  border-radius: 999px;
  z-index: 15;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
#admin-bar.show {
  display: inline-flex;
}
#admin-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 6px;
}
#admin-bar .btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}
#admin-bar .btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
#admin-bar #admin-save {
  background: #0a84ff;
  border-color: transparent;
}
#admin-bar #admin-save:hover {
  background: #2b98ff;
}

/* 节点选择器 · iOS 风格毛玻璃菜单 */
#node-selector {
  position: absolute;
  top: 62px;
  left: 20px;
  min-width: 200px;
  max-width: 240px;
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(28, 28, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 6px;
  z-index: 10;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: none;
}
#node-selector.show {
  display: block;
}
#node-selector .item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.15s;
}
#node-selector .item:hover {
  background: rgba(255, 255, 255, 0.08);
}
#node-selector .item.active {
  background: #0a84ff;
  color: #fff;
}
#node-selector .item .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0a84ff;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}
#node-selector .item.active .dot {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* Minimap · 右下角毛玻璃小地图 */
#minimap-wrap {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 232px;
  height: 232px;
  background: rgba(28, 28, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  z-index: 10;
  overflow: hidden;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.42);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#minimap-wrap.collapsed {
  transform: translateY(calc(100% - 44px));
}
#minimap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#minimap-header .toggle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.15s;
}
#minimap-header .toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}
#minimap {
  width: 100%;
  height: calc(100% - 45px);
  display: block;
  padding-bottom: 8px;
}

/* SVG 内容 */
#minimap .grid {
  stroke: rgba(255, 255, 255, 0.055);
  stroke-width: 1;
}
#minimap .axis {
  stroke: rgba(10, 132, 255, 0.4);
  stroke-width: 1;
}
#minimap .link-line {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}
#minimap .node-dot {
  fill: #0a84ff;
  stroke: #fff;
  stroke-width: 1.5;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  transition:
    r 0.15s ease,
    fill 0.15s;
}
#minimap .node-dot:hover {
  fill: #4aa3ff;
}
#minimap .node-dot.current {
  fill: #ff9f0a;
  stroke: #fff;
  stroke-width: 2;
  r: 6;
  filter: drop-shadow(0 0 6px rgba(255, 159, 10, 0.55));
}
#minimap .node-label {
  fill: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 500;
  pointer-events: none;
}
#minimap .current-label {
  fill: #ff9f0a;
  font-size: 11px;
  font-weight: 600;
}
#minimap .floor-bg {
  opacity: 0.3;
}

/* 校准面板 · 毛玻璃弹层 */
#calibrate-panel {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 30, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 18px 22px;
  z-index: 20;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  text-align: center;
  min-width: 380px;
  display: none;
}
#calibrate-panel.show {
  display: block;
}
#calibrate-panel h3 {
  font-size: 14px;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
#calibrate-panel p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 14px;
  line-height: 1.6;
}
#calibrate-panel .row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
#calibrate-panel input {
  width: 84px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
#calibrate-panel input:focus {
  border-color: #0a84ff;
}
#calibrate-panel .hint-small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 10px;
}
#calibrate-panel .row .btn {
  background: #0a84ff;
  border-color: transparent;
  padding: 8px 18px;
}
#calibrate-panel .row .btn:hover {
  background: #2b98ff;
}

/* 自定义导航箭头 hotspot
   注意：Pannellum 给设了 cssClass 的热点加的 class 是 "pnlm-hotspot-base <cssClass>"
   （不含 pnlm-hotspot），所以选择器必须用 .pnlm-hotspot-base.nav-arrow */
.pnlm-hotspot-base.nav-arrow {
  width: 46px !important;
  height: 46px !important;
  border-radius: 50% !important;
  background: rgba(28, 28, 30, 0.5) !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 0 6px rgba(10, 132, 255, 0.18) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(10px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(150%) !important;
  transition:
    background 0.18s,
    box-shadow 0.18s !important;
}
.pnlm-hotspot-base.nav-arrow:hover {
  background: rgba(10, 132, 255, 0.9) !important;
  box-shadow:
    0 6px 26px rgba(0, 0, 0, 0.5),
    0 0 0 8px rgba(10, 132, 255, 0.25) !important;
}
.pnlm-hotspot-base.nav-arrow::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 15px solid #fff;
  margin-top: -3px;
  transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.pnlm-hotspot-base.nav-arrow:hover::before {
  transform: scale(1.18);
}
.pnlm-tooltip span {
  font-size: 13px !important;
}

/* 画面说明文字：默认打开的悬浮卡片，固定在 yaw/pitch，跟随画面
   仅在热点转到画面背后时由 Pannellum 隐藏（visibility:inherit 继承底座显隐） */
.pnlm-hotspot-base.note-marker {
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  cursor: default !important;
}
/* 定位锚点小圆点（卡片顶端对点） */
.pnlm-hotspot-base.note-marker::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #0a84ff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: background 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.pnlm-hotspot-base.note-marker:hover::before {
  background: #ff9f0a;
}
/* 说明文字卡片：默认显示（无需悬停），跟随画面；背后时随底座隐藏 */
div.pnlm-tooltip.note-marker > span {
  visibility: inherit !important;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 !important;
  width: max-content !important;
  max-width: 240px;
  background-color: rgba(28, 28, 30, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 2;
}
div.pnlm-tooltip.note-marker > span:after {
  display: none;
}
/* 管理模式下：说明卡片可点击删除，并显示删除提示 */
.is-admin .pnlm-hotspot-base.note-marker {
  cursor: pointer !important;
}
.is-admin .pnlm-hotspot-base.note-marker > span {
  border-color: rgba(10, 132, 255, 0.4);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(10, 132, 255, 0.25);
}
.is-admin .pnlm-hotspot-base.note-marker > span::after {
  content: '点击删除';
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255, 159, 10, 0.9);
  letter-spacing: 0.2px;
}

/* 加载/错误提示 */
#notice {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(28, 28, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 24px 30px;
  z-index: 50;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 460px;
  display: none;
}
#notice.show {
  display: block;
}
#notice h2 {
  color: #ff9f0a;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
#notice p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  line-height: 1.7;
  margin: 4px 0;
}
#notice code {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 12px;
  color: #fff;
}

/* 校准状态指示 */
#cal-status {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  z-index: 10;
  background: rgba(28, 28, 30, 0.5);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
#cal-status.dirty {
  color: #ff9f0a;
}
