* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #0e0f12;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #fff; user-select: none; -webkit-user-select: none;
}

#viewer { position: fixed; inset: 0; }
#pano-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#pano-canvas:active { cursor: grabbing; }

/* ---------- 加载层 ---------- */
.loading {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #1c1f26 0%, #0e0f12 100%);
  transition: opacity .6s ease;
}
.loading.hide { opacity: 0; pointer-events: none; }
.loading-box { text-align: center; width: 72%; max-width: 320px; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 18px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: #d9b382; border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 15px; letter-spacing: 2px; color: rgba(255,255,255,.85); margin-bottom: 16px; }
.progress { height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg,#c99a5f,#e7cba3); transition: width .25s ease; }
.progress-text { margin-top: 10px; font-size: 12px; color: rgba(255,255,255,.5); }

/* ---------- 错误提示 ---------- */
.error-tip { position: absolute; inset: 0; z-index: 31; display: flex; align-items: center; justify-content: center; background: rgba(10,10,12,.85); }
.error-tip.hidden { display: none; }
.error-box { text-align: center; }
.error-text { font-size: 14px; color: rgba(255,255,255,.8); margin-bottom: 18px; }
#retry-btn {
  padding: 9px 26px; border: 1px solid #d9b382; border-radius: 22px;
  background: transparent; color: #e7cba3; font-size: 14px; cursor: pointer;
}
#retry-btn:active { background: rgba(217,179,130,.15); }

/* ---------- 顶部标题 ---------- */
.top-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.42), transparent);
  pointer-events: none;
}
.top-bar h1 { font-size: 16px; font-weight: 600; letter-spacing: 1px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.badge {
  font-size: 10px; line-height: 1; padding: 4px 7px; border-radius: 10px;
  background: rgba(217,179,130,.9); color: #2a1f12; font-weight: 700; letter-spacing: 1px;
}

/* ---------- 操作提示 ---------- */
.hint {
  position: absolute; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translateX(-50%);
  padding: 7px 16px; border-radius: 18px;
  background: rgba(0,0,0,.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 12px; color: rgba(255,255,255,.85); white-space: nowrap;
  animation: hintFade 6s ease forwards; pointer-events: none;
}
@keyframes hintFade { 0%,60% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- 底部控制条 ---------- */
.control-bar {
  position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translateX(-50%);
  display: flex; gap: 10px;
  padding: 8px; border-radius: 26px;
  background: rgba(16,17,21,.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.ctrl-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: 0; border-radius: 20px;
  background: transparent; color: rgba(255,255,255,.72);
  font-size: 13px; cursor: pointer; transition: all .2s ease;
}
.ctrl-btn .ico { font-size: 15px; line-height: 1; }
.ctrl-btn:active { transform: scale(.95); }
.ctrl-btn.active { background: rgba(217,179,130,.92); color: #2a1f12; font-weight: 600; }

@media (max-width: 380px) {
  .ctrl-btn { padding: 9px 12px; }
  .ctrl-btn .lbl { font-size: 12px; }
}
