/* ============================================
   阳西 · 八镇风物志 —— 暗色海洋主题
   ============================================ */
:root {
  --bg: #04091a;
  --bg-2: #071228;
  --panel: rgba(13, 28, 54, .55);
  --line: rgba(94, 148, 214, .18);
  --text: #d7e3f4;
  --muted: #7c8db5;
  --accent: #2dd4bf;
  --gold: #fbbf24;
  --serif: "Noto Serif SC", "Source Han Serif SC", "STZhongsong", "SimSun", serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.8;
  overflow-x: hidden;
}

::selection { background: rgba(45, 212, 191, .3); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #16305a; border-radius: 6px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; gap: 28px;
  height: 62px; padding: 0 26px;
  background: linear-gradient(180deg, rgba(4, 9, 26, .92), rgba(4, 9, 26, .55));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-family: var(--serif); font-size: 19px; letter-spacing: 4px;
  white-space: nowrap;
}
.logo em { font-style: normal; color: var(--accent); font-size: 14px; letter-spacing: 2px; }
.logo-mark {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}

.topbar-links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.topbar-links::-webkit-scrollbar { display: none; }
.topbar-links a {
  color: var(--muted); text-decoration: none; font-size: 13px;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
  transition: all .25s;
}
.topbar-links a:hover { color: #fff; background: color-mix(in srgb, var(--c) 18%, transparent); }

.progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  box-shadow: 0 0 10px rgba(45, 212, 191, .8);
}

/* ---------- 首屏 Hero ---------- */
.hero { position: relative; height: 100vh; min-height: 560px; overflow: hidden; }

.stage { position: absolute; inset: 0; }
.stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.stage canvas:active { cursor: grabbing; }

.stage-loader {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: var(--muted); font-size: 13px; letter-spacing: 3px;
  display: flex; align-items: center; gap: 10px;
}
.stage-loader span {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(45, 212, 191, .25);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; padding: 0 24px;
}

.hero-kicker {
  color: var(--accent); font-size: 12px; letter-spacing: 8px;
  margin-bottom: 22px; text-transform: uppercase;
}

.hero-title {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(90px, 16vw, 190px); line-height: 1;
  letter-spacing: .08em;
  background: linear-gradient(180deg, #fff 20%, #6ea8d8 75%, #274b6d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 40px rgba(56, 189, 248, .35));
}
.hero-title .ch { display: inline-block; will-change: transform, opacity; }

.hero-sub { color: var(--muted); margin-top: 26px; font-size: 15px; letter-spacing: 3px; }

.hero-hint {
  position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12px; letter-spacing: 2px; opacity: .8;
}

.scroll-cue {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 44px; border: 1.5px solid rgba(124, 141, 181, .5);
  border-radius: 14px; z-index: 5;
}
.scroll-cue::before {
  content: ""; position: absolute; left: 50%; top: 8px;
  width: 4px; height: 8px; border-radius: 2px; margin-left: -2px;
  background: var(--accent); animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(16px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- 概览 ---------- */
.overview { padding: 130px 0 110px; position: relative; }
.overview::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 50% 0%, rgba(45, 212, 191, .06), transparent 70%);
  pointer-events: none;
}

.sec-title {
  font-family: var(--serif); font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 6px; margin-bottom: 34px;
}
.sec-title span {
  color: var(--accent); font-size: .55em; margin-right: 14px;
  vertical-align: middle; opacity: .9;
}

.overview-intro { color: var(--muted); max-width: 760px; font-size: 15.5px; }

.stats {
  margin-top: 56px; display: grid;
  grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 20px; text-align: center; backdrop-filter: blur(8px);
  transition: border-color .3s, transform .3s;
}
.stat:hover { border-color: rgba(45, 212, 191, .5); transform: translateY(-4px); }
.stat-value b {
  font-family: var(--serif); font-size: 38px; font-weight: 700; color: #fff;
}
.stat-value i { font-style: normal; color: var(--accent); font-size: 14px; margin-left: 4px; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 8px; letter-spacing: 1px; }

/* ---------- 各镇 ---------- */
.towns { position: relative; }
.town {
  padding: 100px 0; border-top: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.town::before {
  content: ""; position: absolute; right: -10%; top: 15%;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 14%, transparent), transparent 70%);
  pointer-events: none;
}

.town-inner {
  display: grid; grid-template-columns: 340px 1fr; gap: 60px; align-items: center;
}

.town-visual { position: relative; height: 300px; }
.town-index {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  font-family: var(--serif); font-size: 150px; font-weight: 900; line-height: 1;
  color: color-mix(in srgb, var(--c) 30%, transparent);
  -webkit-text-stroke: 1px color-mix(in srgb, var(--c) 55%, transparent);
}
.town-blob, .town-blob2 {
  position: absolute; border-radius: 42% 58% 60% 40% / 50% 45% 55% 50%;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  filter: blur(.4px);
}
.town-blob { width: 190px; height: 190px; right: 30px; top: 26px; animation: blob 9s ease-in-out infinite; }
.town-blob2 { width: 120px; height: 120px; right: 130px; bottom: 8px; opacity: .6; animation: blob 12s ease-in-out infinite reverse; }
@keyframes blob {
  0%, 100% { border-radius: 42% 58% 60% 40% / 50% 45% 55% 50%; transform: rotate(0) scale(1); }
  50% { border-radius: 58% 42% 40% 60% / 45% 60% 40% 55%; transform: rotate(12deg) scale(1.08); }
}

.town-en { color: var(--c); font-size: 12px; letter-spacing: 6px; text-transform: uppercase; }
.town-name {
  font-family: var(--serif); font-size: clamp(34px, 5vw, 50px);
  font-weight: 800; letter-spacing: 4px; margin: 8px 0 4px;
  color: #fff;
  text-shadow: 0 4px 30px color-mix(in srgb, var(--c) 45%, transparent);
}
.town-slogan { color: var(--muted); letter-spacing: 2px; margin-bottom: 22px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.chip {
  font-size: 13px; padding: 5px 16px; border-radius: 999px;
  color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}

.town-desc { color: #a8b8d4; max-width: 620px; font-size: 15px; }

.fly-btn {
  margin-top: 30px; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px; border-radius: 999px; cursor: pointer;
  font-family: var(--sans); font-size: 14px; letter-spacing: 1px;
  color: #041018; font-weight: 600;
  background: linear-gradient(120deg, var(--c), color-mix(in srgb, var(--c) 60%, #fff));
  border: none; box-shadow: 0 6px 24px color-mix(in srgb, var(--c) 35%, transparent);
  transition: transform .25s, box-shadow .25s;
}
.fly-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 34px color-mix(in srgb, var(--c) 55%, transparent); }

.town:nth-of-type(even) .town-inner { direction: rtl; }
.town:nth-of-type(even) .town-inner > * { direction: ltr; }
.town:nth-of-type(even) .town-visual .town-index { left: auto; right: 0; }
.town:nth-of-type(even) .town-blob { right: auto; left: 30px; }
.town:nth-of-type(even) .town-blob2 { right: auto; left: 130px; }
.town:nth-of-type(even)::before { right: auto; left: -10%; }

/* 聚焦高亮（点击 3D 地图跳转时） */
.town.flash { animation: flash 2.2s ease; }
@keyframes flash {
  0%, 100% { background: transparent; }
  25% { background: color-mix(in srgb, var(--c) 9%, transparent); }
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line); padding: 60px 0 46px;
  text-align: center; background: linear-gradient(180deg, transparent, rgba(45, 212, 191, .04));
}
.footer-brand { font-family: var(--serif); letter-spacing: 5px; font-size: 18px; color: #cfe0f2; }
.footer-meta { color: var(--muted); font-size: 13px; margin-top: 10px; }
.footer-note { color: #556488; font-size: 12px; margin-top: 4px; }
.footer-icp { margin-top: 14px; }
.footer-icp a {
  color: var(--muted); font-size: 13px; text-decoration: none;
  padding: 2px 6px; border-radius: 4px; transition: color .25s;
}
.footer-icp a:hover { color: var(--accent); }

/* ---------- 动效辅助 ---------- */
.reveal { opacity: 0; }
.no-anim .reveal { opacity: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .topbar-links { display: none; }
  .town-inner { grid-template-columns: 1fr; gap: 30px; }
  .town-visual { height: 190px; }
  .town-index { font-size: 96px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .stats { gap: 10px; }
  .stat-value b { font-size: 28px; }
  .town { padding: 70px 0; }
  .hero-hint { display: none; }
}
