/* UAP 全球事件地圖 — 深藍黑底、青色霓虹風格 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep: #030712;
  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.35);
  --text-main: #d8f4ff;
  --text-dim: #7fa8bd;
  --panel-bg: rgba(6, 20, 34, 0.92);
  --font-stack: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC",
                "Heiti TC", system-ui, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #07182c 0%, var(--bg-deep) 70%);
  font-family: var(--font-stack);
  color: var(--text-main);
}

#app { position: relative; width: 100%; height: 100%; }

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene.dragging { cursor: grabbing; }
#scene.pickable { cursor: pointer; }

/* ── 標題 ─────────────────────────────── */
#title-bar {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 0 12px var(--cyan-dim);
}
#title-bar h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cyan);
}
#subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ── 重置按鈕 ─────────────────────────── */
#reset-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 10;
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 2px;
  font-family: var(--font-stack);
  color: var(--cyan);
  background: rgba(0, 40, 60, 0.45);
  border: 1px solid var(--cyan-dim);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
#reset-btn:hover {
  background: rgba(0, 229, 255, 0.15);
  box-shadow: 0 0 14px var(--cyan-dim);
}
#reset-btn:active { transform: translateY(1px); }

/* ── 圖例 ─────────────────────────────── */
#legend {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--panel-bg);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
}
.legend-title {
  color: var(--cyan);
  letter-spacing: 2px;
  margin-bottom: 8px;
  font-size: 12px;
}
#legend ul { list-style: none; }
#legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  color: var(--text-main);
}
#legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, #fff);
  box-shadow: 0 0 8px var(--c, #fff);
  flex: none;
}

/* ── 資料面板 ─────────────────────────── */
#panel {
  position: absolute;
  top: 72px;
  right: 18px;
  z-index: 20;
  width: 320px;
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: 18px 20px 20px;
  background: var(--panel-bg);
  border: 1px solid var(--cyan-dim);
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.12);
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
#panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
#panel-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
}
#panel-close:hover { color: var(--cyan); }
#panel-name {
  font-size: 17px;
  color: var(--cyan);
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-right: 24px;
  text-shadow: 0 0 10px var(--cyan-dim);
}
#panel dl {
  display: grid;
  grid-template-columns: 44px 1fr;
  row-gap: 6px;
  column-gap: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}
#panel dt { color: var(--text-dim); }
#panel dd { color: var(--text-main); }
#panel-desc {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-main);
  border-top: 1px solid rgba(0, 229, 255, 0.15);
  padding-top: 12px;
}
#panel-source {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dashed var(--cyan-dim);
}
#panel-source:hover { text-shadow: 0 0 8px var(--cyan); }

/* ── 提示文字 ─────────────────────────── */
#hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
}

/* ── 小螢幕調整 ───────────────────────── */
@media (max-width: 640px) {
  #title-bar h1 { font-size: 17px; letter-spacing: 2px; }
  #subtitle { font-size: 11px; }
  #panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 55vh;
    border-radius: 12px 12px 0 0;
    transform: translateY(110%);
  }
  #panel.open { transform: translateY(0); }
  #hint { display: none; }
  #legend { font-size: 11px; padding: 8px 10px; }
}

/* ══════════════════════════════════════════════════════════
   UUAAPP 導覽列 —— 地球儀頁返回主目錄之路徑
   自帶樣式：唔引入 shared/style.css，避免全站主題變數／淺色模式
   同地球儀嘅深色星空場景衝突。主題切換按鈕亦刻意唔加（地球儀
   本質係深色場景，加咗只會係死按鈕）。
   ══════════════════════════════════════════════════════════ */
.nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.2rem;
  background: rgba(3, 10, 20, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.16);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cyan);
  text-decoration: none;
}
.nav-logo::before { content: "◆"; font-size: 0.72rem; }
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-links a {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--cyan); background: rgba(0, 229, 255, 0.08); }
.nav-links a.active { color: var(--cyan); background: rgba(0, 229, 255, 0.12); }
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

/* 頂部 UI 下移，避開導覽列（只影響 ≥641px；≤640px 時面板係底部抽屜） */
@media (min-width: 641px) {
  #title-bar { top: 74px; }
  #reset-btn { top: 74px; }
  #panel { top: 128px; }
}

/* 手機：漢堡選單 */
@media (max-width: 768px) {
  .hamburger { display: block; }
  .nav-links {
    position: fixed;
    top: 52px; left: 12px; right: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.45rem;
    background: rgba(3, 10, 20, 0.97);
    border: 1px solid rgba(0, 229, 255, 0.22);
    border-radius: 8px;
    display: none;
  }
  .nav-links.open { display: flex; }
  #title-bar { top: 64px; }
  #reset-btn { top: 64px; }
}
