:root {
  --bg: #0b0e14;
  --bg-2: #11151f;
  --card: #161b27;
  --card-2: #1d2433;
  --text: #eef1f6;
  --muted: #9aa6b8;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --gold: #ffcf6b;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1a2236 0%, var(--bg) 55%) fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(11, 14, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 0.5px; }
.brand-mark { font-size: 1.3rem; }
.brand-name { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 6px; }
.nav a {
  padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 0.92rem;
  transition: all 0.2s ease;
}
.nav a:hover { color: var(--text); background: var(--card-2); }
.nav a.active { color: #fff; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.search-wrap { margin-left: auto; flex: 0 1 320px; }
#search {
  width: 100%; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 0.9rem; outline: none;
}
#search:focus { border-color: var(--accent); }

/* ---------- 视图容器 ---------- */
.view { max-width: 1240px; margin: 0 auto; padding: 0 20px 80px; }
.view[hidden] { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; margin: 24px 0 28px; border-radius: 22px; overflow: hidden;
  min-height: 320px; display: flex; align-items: flex-end;
  background-size: cover; background-position: center; box-shadow: var(--shadow);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,14,20,0.15) 0%, rgba(11,14,20,0.85) 100%);
}
.hero-content { position: relative; padding: 28px 30px; }
.hero-content h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: 1px; }
.hero-content p { margin: 0; color: #d7deea; max-width: 640px; }

/* ---------- 筛选 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.region-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 0.85rem; cursor: pointer; font-weight: 600;
  transition: all 0.18s ease;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { color: #fff; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-color: transparent; }
.country-select-wrap select {
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 0.85rem; outline: none; max-width: 220px;
}

/* ---------- 网格 ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
}
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); border-color: rgba(124, 92, 255, 0.55); }
.card-thumb { width: 100%; height: 180px; object-fit: cover; display: block; background: #000; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-size: 1.05rem; font-weight: 700; }
.card-sub { color: var(--muted); font-size: 0.82rem; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; color: var(--muted); font-size: 0.78rem; }
.card-meta .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.heat { color: var(--gold); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- 详情页 ---------- */
.detail-hero {
  position: relative; margin: 22px 0 24px; border-radius: 22px; overflow: hidden;
  min-height: 300px; display: flex; align-items: flex-end; background-size: cover; background-position: center;
  box-shadow: var(--shadow);
}
.detail-hero .hero-overlay { background: linear-gradient(180deg, rgba(11,14,20,0.1), rgba(11,14,20,0.9)); }
.detail-hero .hero-content { padding: 26px 28px; }
.detail-hero h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3.5vw, 2.3rem); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag { padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,0.12); font-size: 0.8rem; }
.detail-intro {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 26px; font-size: 1rem; color: #dde3ee;
}
.detail-block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 22px;
}
.detail-block p { margin: 0; font-size: 0.98rem; color: #dde3ee; line-height: 1.85; }
.detail-section-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.subspots { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.subspot {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--muted); font-size: 0.82rem;
}

/* 全景画廊 */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.pano {
  position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; border: 1px solid var(--line);
  background: #000; aspect-ratio: 16 / 10; transition: transform 0.2s ease, border-color 0.2s ease;
}
.pano:hover { transform: translateY(-3px); border-color: var(--accent); }
.pano img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pano .badge {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.6); color: #fff;
  padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; display: flex; align-items: center; gap: 5px;
}
.pano .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85)); font-size: 0.85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- 全景弹层 ---------- */
.modal {
  position: fixed; inset: 0; background: #000; z-index: 1000;
  display: flex; flex-direction: column;
}
.modal[hidden] { display: none; }
.modal-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: rgba(0,0,0,0.7); position: absolute; top: 0; left: 0; right: 0; z-index: 10;
}
.modal-back { background: transparent; border: none; color: #fff; font-size: 1rem; cursor: pointer; padding: 4px 8px; }
.modal-back:hover { color: var(--accent); }
.modal-titles { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.modal-subspot { color: var(--gold); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.modal-nav button {
  background: rgba(255,255,255,0.1); border: none; color: #fff; width: 34px; height: 34px;
  border-radius: 8px; font-size: 1.2rem; cursor: pointer;
}
.modal-nav button:hover { background: var(--accent); }
.modal-close { font-size: 1.6rem !important; }
.modal-count { color: var(--muted); font-size: 0.85rem; min-width: 46px; text-align: center; }
.panorama { flex: 1; width: 100%; height: 100%; }
.viewer-info {
  position: absolute; left: 0; right: 0; bottom: 76px; padding: 12px 18px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.75)); z-index: 9;
  max-width: 720px;
}
.viewer-desc { margin: 0 0 4px; font-size: 0.9rem; color: #e7ecf5; }
.viewer-loc { margin: 0; font-size: 0.8rem; color: var(--muted); }
.viewer-strip {
  position: absolute; left: 0; right: 0; bottom: 0; height: 72px; z-index: 9;
  display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto;
  background: rgba(0,0,0,0.78); scrollbar-width: thin;
}
.viewer-strip img {
  height: 56px; width: 84px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: 0.55;
  border: 2px solid transparent; flex: 0 0 auto;
}
.viewer-strip img.active { opacity: 1; border-color: var(--accent); }
.viewer-strip img:hover { opacity: 0.9; }

/* ---------- 地球 ---------- */
#view-globe { max-width: none; padding: 0; }
#globe-container { position: relative; width: 100%; height: calc(100vh - 58px); }
#globe-canvas-wrap { position: absolute; inset: 0; }
#globe-canvas-wrap canvas { display: block; }
.globe-hint {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(11,14,20,0.7); border: 1px solid var(--line); color: var(--muted);
  padding: 8px 16px; border-radius: 999px; font-size: 0.82rem; z-index: 5; pointer-events: none;
}
.globe-tooltip {
  position: absolute; transform: translate(-50%, -130%); z-index: 6; pointer-events: none;
  background: rgba(11,14,20,0.92); border: 1px solid var(--accent); color: #fff;
  padding: 6px 12px; border-radius: 10px; font-size: 0.82rem; white-space: nowrap;
  box-shadow: var(--shadow);
}
.globe-legend {
  position: absolute; right: 14px; bottom: 14px; background: rgba(11,14,20,0.72);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 0.78rem; z-index: 5;
  display: flex; flex-direction: column; gap: 5px;
}
.globe-legend .lg { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.globe-legend .dot { width: 9px; height: 9px; border-radius: 50%; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #2a3142; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 2000;
  box-shadow: var(--shadow); font-size: 0.9rem; border: 1px solid var(--line);
}
.toast[hidden] { display: none; }

/* ---------- 统计页 ---------- */
.stats-hero { margin: 24px 0 26px; }
.stats-hero h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3.5vw, 2.2rem); letter-spacing: 1px; }
.stats-hero p { margin: 0 0 18px; color: var(--muted); max-width: 720px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: linear-gradient(135deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px;
}
.stat-card b { font-size: 1.7rem; font-weight: 800; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card span { color: var(--muted); font-size: 0.85rem; }
.stat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.stat-tabs button {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 0.88rem; cursor: pointer; font-weight: 600;
  transition: all 0.18s ease;
}
.stat-tabs button:hover { color: var(--text); border-color: var(--accent); }
.stat-tabs button.active { color: #fff; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-color: transparent; }

.stat-groups {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px;
}
.stat-group {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.stat-group:hover { border-color: rgba(124, 92, 255, 0.5); transform: translateY(-3px); }
.sg-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sg-cover { flex: 0 0 84px; width: 84px; height: 60px; border-radius: 10px; overflow: hidden; display: block; background: #000; }
.sg-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.sg-cover:hover img { transform: scale(1.08); }
.sg-headinfo { min-width: 0; }
.sg-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 700; }
.sg-title .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.sg-sub { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.sg-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px;
  padding: 14px; max-height: 320px; overflow-y: auto; align-content: start;
}
.sg-item { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.sg-item img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block;
  background: #000; border: 1px solid var(--line); transition: border-color 0.18s ease, transform 0.18s ease;
}
.sg-item:hover img { border-color: var(--accent); transform: translateY(-2px); }
.sg-name {
  font-size: 0.74rem; color: var(--muted); line-height: 1.25; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.sg-num { font-size: 0.68rem; color: var(--gold); font-weight: 700; }

/* ---------- 首页分页加载 ---------- */
.home-end {
  text-align: center; padding: 22px 0 8px; color: var(--muted); font-size: 0.85rem; min-height: 24px;
}
.loadmore-btn {
  padding: 10px 26px; border-radius: 999px; border: 1px solid var(--accent);
  background: rgba(79, 140, 255, 0.12); color: var(--text); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: all 0.18s ease;
}
.loadmore-btn:hover { background: var(--accent); color: #fff; }

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--bg-2);
  color: var(--text);
  margin-top: 40px;
  padding: 24px 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
}
.site-footer p {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}
.site-footer p:last-child { margin-bottom: 0; }
.site-footer a {
  color: var(--text);
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav { order: 3; }
  .search-wrap { order: 2; flex: 1 1 100%; margin-left: 0; }
  .view { padding: 0 14px 60px; }
  .hero { min-height: 240px; }
  .hero-content { padding: 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .card-thumb { height: 120px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .viewer-info { bottom: 70px; padding: 10px 14px; }
  .modal-subspot { font-size: 0.72rem; }
  .globe-hint { font-size: 0.75rem; width: calc(100% - 28px); text-align: center; }
}
