/* ══════════════════════════════════════════════════════════
   全球每日热点热力图 — 样式表
   视觉风格：深空蓝赛博风
   ══════════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 主色板 */
  --deep-blue: #061224;
  --dark-bg: #020b1a;
  --cyan: #4FC3F7;
  --cyan-dim: rgba(79, 195, 247, 0.15);
  --text-primary: #e0e6f0;
  --text-secondary: #8899aa;
  --text-muted: #556677;

  /* 科技/金融高亮 */
  --tech-gold: #FFD700;
  --finance-amber: #FFB300;

  /* 面板背景 */
  --panel-bg: rgba(6, 18, 36, 0.85);
  --panel-border: rgba(79, 195, 247, 0.25);
  --panel-blur: blur(8px);

  /* 字体 */
  --font-sans: 'Inter', 'Noto Sans SC', 'PingFang SC', 'San Francisco', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* 圆角 & 阴影 */
  --radius: 10px;
  --shadow-glow: 0 0 20px rgba(79, 195, 247, 0.1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--dark-bg);
}

/* ── Header ────────────────────────────────────────── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(6,18,36,0.95) 60%, rgba(6,18,36,0) 100%);
  pointer-events: none;
}

#header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

#stats {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ── View Summary (当前视角摘要) ─────────────────── */
#view-summary {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 85;
  width: 220px;
  max-height: 260px;
  overflow-y: auto;
  padding: 12px 14px;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow);
  transition: opacity 0.4s;
}

#view-summary.hidden { opacity: 0; pointer-events: none; }

#view-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#view-events {
  list-style: none;
  margin-top: 6px;
}

#view-events li {
  padding: 4px 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: color 0.2s;
}

#view-events li:hover { color: var(--text-primary); }

#view-events li .v-cat {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

#view-events li .v-imp {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* ── Timeline ──────────────────────────────────────── */
#timeline {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
}

#timeline-presets {
  display: flex;
  gap: 4px;
}

.preset {
  padding: 4px 12px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.preset:hover { color: var(--text-primary); border-color: var(--cyan-dim); }
.preset.active {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-color: var(--cyan);
}

#timeline-bar {
  position: relative;
  width: 200px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  cursor: pointer;
}

#timeline-track {
  position: absolute;
  inset: 0;
  border-radius: 3px;
}

#timeline-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--cyan);
  opacity: 0.6;
}

#btn-jump-today {
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--cyan);
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

#btn-jump-today:hover { background: var(--cyan-dim); }

/* ── Globe Container ───────────────────────────────── */
#globe-container {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #0a1a35 0%, #020b1a 70%);
}

#globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Loading ───────────────────────────────────────── */
#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 50;
  transition: opacity 0.5s;
}

#loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid var(--cyan-dim);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#loading p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── Detail Card ───────────────────────────────────── */
#detail-card {
  position: absolute;
  right: 24px;
  bottom: 100px;
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
  padding: 20px;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow);
  z-index: 80;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#detail-card.hidden {
  transform: translateX(120%);
  opacity: 0;
  pointer-events: none;
}

#detail-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 28px;
  height: 28px;
  font-size: 18px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#detail-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }

#detail-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
}

.tag.tech { background: rgba(255,215,0,0.2); color: var(--tech-gold); }
.tag.finance { background: rgba(255,179,0,0.2); color: var(--finance-amber); }

#detail-category {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  margin-bottom: 8px;
}

#detail-location {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

#detail-summary {
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(79,195,247,0.06);
  border-left: 2px solid var(--cyan);
  border-radius: 0 6px 6px 0;
}

#detail-summary .label {
  font-size: 11px;
  color: var(--cyan);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

#detail-summary p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

#detail-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

#detail-link {
  display: block;
  padding: 8px 0;
  font-size: 12px;
  color: var(--cyan);
  text-decoration: none;
  text-align: center;
  border-top: 1px solid var(--panel-border);
  transition: color 0.2s;
}

#detail-link:hover { color: #fff; }

/* ── Legend Panel ──────────────────────────────────── */
#legend {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  max-height: 70vh;
  overflow-y: auto;
  padding: 16px;
  background: var(--panel-bg);
  backdrop-filter: var(--panel-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  z-index: 80;
  user-select: none;
}

#legend h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

#legend-list {
  list-style: none;
}

#legend-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: opacity 0.2s;
}

#legend-list li:hover { color: var(--text-primary); }
#legend-list li.hidden { opacity: 0.3; }

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

#legend hr {
  margin: 10px 0;
  border: none;
  border-top: 1px solid var(--panel-border);
}

#legend-highlight {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-secondary);
}

#legend-highlight .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 2px;
  vertical-align: middle;
}

#legend-highlight .dot.tech { background: var(--tech-gold); }
#legend-highlight .dot.finance { background: var(--finance-amber); }

#legend-controls {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Hint ──────────────────────────────────────────── */
#hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.8;
  pointer-events: none;
  transition: opacity 0.8s;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
