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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
}

#pano-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* ---------- 覆盖层（加载 / 错误） ---------- */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #4da6ff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-text {
  margin-top: 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.progress-track {
  margin-top: 12px;
  width: 180px;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: #4da6ff;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.error-icon {
  width: 52px;
  height: 52px;
  line-height: 48px;
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: #ff6b6b;
  border: 2px solid #ff6b6b;
  border-radius: 50%;
}

.error-text {
  margin-top: 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 80%;
  text-align: center;
  word-break: break-all;
}

.btn {
  margin-top: 18px;
  padding: 8px 30px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #fff;
  font-size: 14px;
  border-radius: 20px;
  outline: none;
}

.btn:active {
  background: rgba(255, 255, 255, 0.15);
}

/* ---------- 标题栏 ---------- */
#title-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 12px;
  background: linear-gradient(rgba(0, 0, 0, 0.45), transparent);
  color: #fff;
  font-size: 15px;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* ---------- 底部提示 ---------- */
#hint {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  left: 0;
  right: 0;
  z-index: 5;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transition: opacity 0.8s ease;
}

/* ---------- 陀螺仪按钮 ---------- */
#gyro-btn {
  position: fixed;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 6;
  padding: 6px 14px;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  outline: none;
}

#gyro-btn.active {
  background: rgba(77, 166, 255, 0.75);
  border-color: #4da6ff;
}
