/* 访客地球 — 前端样式（小工具 + 全屏页） */

html.vg-fullpage,
body.vg-fullpage {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #02050a;
  color: #e2e8f0;
  font-family: var(--vg-font-sans);
}

:root {
  --vg-font-sans: 'DM Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --vg-font-mono: 'DM Sans', ui-monospace, monospace;
  --vg-accent: #60a5fa;
  --vg-accent-soft: rgba(96, 165, 250, 0.35);
  --vg-mint: #34d399;
  --vg-text: #334155;
  --vg-muted: #64748b;
  --vg-radius: 12px;
  --vg-radius-lg: 16px;
  --vg-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --vg-shadow-hover: 0 8px 32px rgba(15, 23, 42, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 侧边栏小工具（浅色卡片） ─────────────────────────────── */
.vg-widget-wrap,
.vg-widget-wrap * {
  font-family: var(--vg-font-sans);
}

.vg-widget-wrap {
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--vg-radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--vg-shadow);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.vg-widget-wrap:hover {
  box-shadow: var(--vg-shadow-hover);
  border-color: rgba(96, 165, 250, 0.25);
}

.vg-widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.98), rgba(239, 246, 255, 0.5));
}

.vg-icon {
  font-size: 18px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

.vg-title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--vg-text);
  letter-spacing: 0.02em;
}

.vg-fs-btn {
  font-size: 16px;
  color: #94a3b8;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s, transform 0.15s;
  line-height: 1;
}

.vg-fs-btn:hover {
  color: #2563eb;
  background: rgba(59, 130, 246, 0.12);
  transform: scale(1.05);
}

.vg-globe-container {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
  cursor: grab;
  /* 与透明 WebGL 合成：浅色穹顶 + 底部略深 */
  background:
    radial-gradient(ellipse 100% 70% at 50% 0%, rgba(96, 165, 250, 0.14), transparent 52%),
    linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 50%, #cbd5e1 100%);
}

.vg-globe-container:active {
  cursor: grabbing;
}

.vg-globe-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  position: relative;
  z-index: 1;
}

#vg-count-wg,
#vg-count-fp {
  font-family: var(--vg-font-mono);
  font-variant-numeric: tabular-nums;
}

.vg-counter {
  position: absolute;
  bottom: 12px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  pointer-events: none;
  z-index: 5;
}

.vg-widget-wrap .vg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

.vg-overlay-info {
  position: absolute;
  z-index: 20;
  font-family: var(--vg-font-sans);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  line-height: 1.65;
  color: #475569;
  max-width: 220px;
  pointer-events: none;
  display: none;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.15);
}

.vg-overlay-info .tc {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 6px;
}

.vg-visitor-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 6px 8px 10px;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.vg-visitor-list::-webkit-scrollbar {
  width: 5px;
}

.vg-visitor-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 4px;
}

.vg-visitor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.15s ease;
  cursor: default;
  border-bottom: 1px solid rgba(248, 250, 252, 0.9);
}

.vg-visitor-item:last-child {
  border-bottom: none;
}

.vg-visitor-item:hover {
  background: linear-gradient(90deg, rgba(241, 245, 249, 0.95), rgba(239, 246, 255, 0.6));
}

.vg-flag {
  font-size: 18px;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vg-visitor-info {
  flex: 1;
  min-width: 0;
}

.vg-visitor-location {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.vg-visitor-meta {
  font-size: 11px;
  color: var(--vg-muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.vg-visitor-time {
  font-size: 11px;
  color: #94a3b8;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ── 全屏页 #vg-fp（深色太空主题） ─────────────────────────── */
@keyframes vg-spin-globe {
  to {
    transform: rotate(360deg);
  }
}

@keyframes vg-pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}

#vg-fp {
  position: fixed;
  inset: 0;
  /* WebGL 透明处透出：多层径向渐变模拟深空与远处星云 */
  background:
    radial-gradient(ellipse 95% 55% at 50% -5%, rgba(56, 120, 180, 0.22) 0%, transparent 45%),
    radial-gradient(ellipse 70% 50% at 85% 25%, rgba(30, 58, 95, 0.18) 0%, transparent 42%),
    radial-gradient(ellipse 60% 45% at 12% 35%, rgba(25, 45, 75, 0.14) 0%, transparent 40%),
    radial-gradient(ellipse 120% 90% at 50% 120%, rgba(5, 15, 35, 0.85) 0%, transparent 55%),
    linear-gradient(180deg, #050a14 0%, #02050c 40%, #010206 100%);
}

#vg-fp,
#vg-fp * {
  box-sizing: border-box;
}

#vg-fp .vg-hd {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: linear-gradient(180deg, rgba(2, 5, 10, 0.75) 0%, rgba(2, 5, 10, 0.2) 65%, transparent 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: none;
}

#vg-fp .vg-logo-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#vg-fp .vg-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

#vg-fp .vg-logo .ico {
  font-size: 28px;
  animation: vg-spin-globe 18s linear infinite;
  filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.35));
}

/* 勿用 background-clip:text + 透明填充：与 backdrop-filter 等合成时易整段不可见，只能靠选中反色才看见 */
#vg-fp .vg-logo h1 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.15;
  color: #f1f5f9;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(96, 165, 250, 0.35);
}

#vg-fp .vg-sub {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 8px;
  padding-left: 40px;
  letter-spacing: 0.06em;
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
  max-width: min(520px, 70vw);
  line-height: 1.45;
}

#vg-fp .vg-stx {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

#vg-fp .vg-stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  border: none;
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#vg-fp .vg-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.08em;
}

#vg-fp .vg-stat-num {
  font-family: var(--vg-font-mono);
  font-size: 17px;
  font-weight: 800;
  color: #7dd3fc;
  text-shadow: 0 0 20px rgba(96, 165, 250, 0.45);
  font-variant-numeric: tabular-nums;
}

#vg-fp .vg-bk {
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(96, 165, 250, 0.08);
  border: none;
  color: #93c5fd;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#vg-fp .vg-bk:hover {
  background: rgba(96, 165, 250, 0.18);
  box-shadow: 0 0 32px rgba(96, 165, 250, 0.15);
  transform: translateY(-1px);
}

#vg-canvas-fp {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

#vg-fp .vg-side {
  position: absolute;
  right: 0;
  top: 84px;
  bottom: 0;
  z-index: 10;
  width: 300px;
  max-width: 42vw;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 20px 36px;
  background: linear-gradient(270deg, rgba(2, 5, 10, 0.72) 0%, rgba(2, 5, 10, 0.35) 50%, transparent 100%);
  border: none;
  box-shadow: none;
}

#vg-fp .vg-side h2 {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 14px;
  font-weight: 700;
  padding-left: 4px;
}

#vg-fp .vg-side h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  margin-top: 10px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.35), transparent);
  opacity: 1;
}

#vg-fp .vg-vlist {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.25) transparent;
}

#vg-fp .vg-vlist::-webkit-scrollbar {
  width: 4px;
}

#vg-fp .vg-vlist::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.28);
  border-radius: 4px;
}

#vg-fp .vg-vlist .vg-visitor-item {
  border: none;
  border-radius: 10px;
  margin-bottom: 2px;
  padding: 11px 10px;
  background: transparent;
  transition: background 0.2s ease;
}

#vg-fp .vg-vlist .vg-visitor-item:hover {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

#vg-fp .vg-vlist .vg-visitor-location {
  color: #e2e8f0;
}

#vg-fp .vg-vlist .vg-visitor-meta {
  color: #94a3b8;
}

#vg-fp .vg-vlist .vg-visitor-time {
  color: #64748b;
}

#vg-fp .vg-cnt {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
  padding: 8px 4px 8px 0;
  border-radius: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

#vg-fp .vg-cnt .vg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--vg-mint);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.75);
  animation: vg-pulse-dot 2.2s ease-in-out infinite;
}

#vg-fp .vg-ht {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #64748b;
  letter-spacing: 0.12em;
  white-space: nowrap;
  opacity: 0.75;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

@media (max-width: 768px) {
  #vg-fp .vg-hd {
    padding: 12px 16px;
  }

  #vg-fp .vg-logo .ico {
    font-size: 22px;
  }

  #vg-fp .vg-logo h1 {
    font-size: 18px;
    letter-spacing: 0.08em;
  }

  #vg-fp .vg-sub {
    font-size: 11px;
    padding-left: 32px;
    margin-top: 4px;
  }

  #vg-fp .vg-stx {
    display: none;
  }

  #vg-fp .vg-bk {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
  }

  #vg-fp .vg-side {
    top: auto;
    bottom: 36px;
    right: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: 36vh;
    min-height: 188px;
    padding: 28px 16px 12px 16px;
    background: linear-gradient(0deg, rgba(2, 5, 10, 0.75) 40%, rgba(2, 5, 10, 0.38) 78%, transparent 100%);
  }

  #vg-fp .vg-side h2 {
    margin-bottom: 8px;
  }

  #vg-fp .vg-cnt {
    left: 16px;
    bottom: 16px;
    font-size: 11px;
    z-index: 20;
    padding: 6px 0;
  }

  #vg-fp .vg-ht {
    display: none;
  }
}

/* ── 地球标签层（WebGL 上叠加 HTML） ───────────────────────── */
.vg-label-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

.vg-marker-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -5px;
  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 20;
}

.vg-marker-label.vg-marker-label--visible {
  opacity: 1;
}

.vg-marker-label__box {
  background: rgba(2, 8, 18, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: 10px;
  padding: 7px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  text-align: center;
  color: #f8fafc;
  font-family: var(--vg-font-sans);
  white-space: nowrap;
  transform: translateY(-4px);
}

.vg-marker-label__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.vg-marker-label__flag {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: none;
}

.vg-marker-label__loc {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.vg-marker-label__pin {
  width: 2px;
  height: 26px;
  margin-top: -5px;
  background: linear-gradient(to bottom, rgba(96, 165, 250, 0.9), transparent);
  border-radius: 2px;
}

.vg-flag-img {
  width: 20px;
  height: 15px;
  object-fit: cover;
  vertical-align: middle;
  border-radius: 2px;
  display: inline-block;
}

.vg-flag-unknown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 15px;
  font-size: 11px;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.9);
  border-radius: 2px;
}

/* ── 悬停 / 固定 浮层 ─────────────────────────────────────── */
.vg-tooltip {
  display: none;
  pointer-events: none;
  z-index: 100;
  max-width: 260px;
  font-family: var(--vg-font-sans);
  line-height: 1.75;
  font-size: 12px;
  border-radius: 12px;
  padding: 12px 16px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.vg-tooltip.vg-is-open {
  display: block;
}

.vg-tooltip--fullpage {
  background: rgba(2, 8, 18, 0.72);
  border: none;
  color: #e2e8f0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.vg-tooltip--fullpage .vg-tooltip__head {
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.vg-tooltip--widget {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.95);
  color: #475569;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
}

.vg-tooltip--center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.vg-tooltip--follow-fp {
  position: fixed;
}

.vg-tooltip--follow-wg {
  position: absolute;
}

.vg-tooltip__head {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}

.vg-tooltip--widget .vg-tooltip__head {
  color: #1e293b;
  border-bottom-color: #f1f5f9;
}

.vg-tooltip__head-flag {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vg-tooltip__row {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 4px;
}

.vg-tooltip--widget .vg-tooltip__row {
  color: #64748b;
}

.vg-tooltip__row span {
  color: #cbd5e1;
}

.vg-tooltip--widget .vg-tooltip__row span {
  color: #334155;
}

.vg-tooltip__k {
  opacity: 0.85;
}

/* ── 首屏加载（地球区域） ─────────────────────────────────── */
.vg-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(ellipse at 50% 40%, rgba(2, 5, 10, 0.55), rgba(2, 5, 10, 0.82));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.vg-loading-overlay.vg-loading-overlay--active {
  opacity: 1;
  visibility: visible;
}

.vg-widget-wrap .vg-loading-overlay {
  background: radial-gradient(ellipse at 50% 40%, rgba(248, 250, 252, 0.75), rgba(241, 245, 249, 0.92));
}

.vg-loading-overlay__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(96, 165, 250, 0.2);
  border-top-color: var(--vg-accent);
  border-radius: 50%;
  animation: vg-spin-load 0.85s linear infinite;
}

.vg-widget-wrap .vg-loading-overlay__spinner {
  border-top-color: #3b82f6;
}

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

@media (prefers-reduced-motion: reduce) {
  .vg-loading-overlay__spinner {
    animation: none;
    border-top-color: var(--vg-accent);
    opacity: 0.85;
  }
}

.vg-loading-overlay__text {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.06em;
}

.vg-widget-wrap .vg-loading-overlay__text {
  color: #64748b;
}
