/* =========================================================
   AOMIN — 3D global footprint page
   ========================================================= */

.gl-page {
  background: #04070c;
  --gold: #efc883;
  --gold-2: #f6dcae;
  --space: #04070c;
}

/* ---------- stage ---------- */
.gl-stage {
  position: relative;
  height: 100svh;
  min-height: 640px;
  background: #04070c;
  overflow: hidden;
  isolation: isolate;
}
#glCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#glCanvas.is-dragging { cursor: grabbing; }
#glCanvas.is-hot { cursor: pointer; }

/* 空间氛围 + 四周压暗，突出球体（径向中心跟随球体取景框） */
.gl-scrim {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(46% 46% at 57.5% 52%, rgba(38, 96, 168, 0.13), transparent 72%),
    radial-gradient(120% 100% at 50% 52%, transparent 42%, rgba(2, 4, 8, 0.55) 82%, rgba(2, 4, 8, 0.9) 100%);
}
.gl-scrim::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: overlay;
}

/* ---------- 顶部标题 ---------- */
.gl-head {
  position: absolute; z-index: 5;
  left: var(--pad); top: 112px;
  max-width: 30rem;
  color: var(--paper);
  pointer-events: none;
}
.gl-head__crumb {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: rgba(247, 246, 243, 0.4);
  margin-bottom: 20px;
}
.gl-head__crumb a { pointer-events: auto; transition: color 0.3s; }
.gl-head__crumb a:hover { color: rgba(247, 246, 243, 0.8); }
.gl-head__crumb i { font-style: normal; opacity: 0.4; }

.gl-head h1 {
  font-size: clamp(1.9rem, 3.4vw, 3.1rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0;
}
.gl-head h1 em {
  font-style: normal;
  color: var(--gold, #efc883);
}
.gl-head p {
  margin-top: 16px;
  max-width: 26rem;
  font-size: 0.86rem;
  line-height: 1.8;
  color: rgba(247, 246, 243, 0.52);
}

.gl-stats {
  display: flex; gap: 26px;
  margin-top: 26px;
  pointer-events: none;
}
.gl-stats div { display: flex; align-items: baseline; gap: 7px; }
.gl-stats b {
  font-family: var(--mono); font-size: 1.02rem; font-weight: 500;
  color: var(--gold, #efc883); letter-spacing: 0.04em;
}
.gl-stats span {
  font-size: 0.68rem; letter-spacing: 0.12em;
  color: rgba(247, 246, 243, 0.42);
}

/* ---------- 左下：图例 / 提示 ---------- */
.gl-foot {
  position: absolute; z-index: 5;
  left: var(--pad); bottom: 30px;
  display: flex; flex-direction: column; gap: 12px;
  pointer-events: none;
  color: rgba(247, 246, 243, 0.44);
}
.gl-legend { display: flex; gap: 22px; font-size: 0.68rem; letter-spacing: 0.04em; }
.gl-legend span { display: inline-flex; align-items: center; gap: 8px; }
.gl-legend i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold, #efc883);
  box-shadow: 0 0 10px rgba(239, 200, 131, 0.85);
}
.gl-legend i.is-line {
  width: 18px; height: 2px; border-radius: 1px;
  background: linear-gradient(90deg, rgba(239, 200, 131, 0.2), rgba(239, 200, 131, 0.95));
  box-shadow: none;
}
.gl-hint {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: rgba(247, 246, 243, 0.3);
}
.gl-hint kbd {
  font: inherit; letter-spacing: 0.1em;
  padding: 3px 7px; border-radius: 3px;
  border: 1px solid rgba(247, 246, 243, 0.16);
  color: rgba(247, 246, 243, 0.55);
}

/* ---------- 右下：返回 ---------- */
.gl-back {
  position: absolute; z-index: 5;
  right: var(--pad); bottom: 30px;
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.74rem; letter-spacing: 0.02em;
  color: rgba(247, 246, 243, 0.62);
  padding: 9px 15px;
  border: 1px solid rgba(247, 246, 243, 0.16);
  border-radius: 999px;
  transition: color 0.35s, border-color 0.35s, background 0.35s;
  backdrop-filter: blur(8px);
}
.gl-back:hover {
  color: #fff;
  border-color: rgba(239, 200, 131, 0.5);
  background: rgba(239, 200, 131, 0.08);
}
.gl-back svg { width: 13px; height: 13px; }

/* ---------- 国家标签（跟随 3D 投影） ---------- */
.gl-labels { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.gl-lb {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 9px;
  background: rgba(16, 18, 21, 0.86);
  border: 1px solid rgba(247, 246, 243, 0.1);
  border-radius: 3px;
  color: rgba(247, 246, 243, 0.92);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.35s var(--ease), background 0.3s, border-color 0.3s;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(6px);
}
.gl-lb.is-on { opacity: 1; }
.gl-lb:hover, .gl-lb.is-active {
  background: rgba(28, 26, 20, 0.94);
  border-color: rgba(239, 200, 131, 0.55);
  color: #fff;
}
.gl-lb b {
  font-family: var(--mono); font-size: 0.54rem; font-weight: 400;
  color: rgba(239, 200, 131, 0.85); letter-spacing: 0.08em;
}
.gl-lb--cn b { display: none; }

/* ---------- 信息面板 ---------- */
.glp {
  position: absolute; z-index: 6;
  right: var(--pad); top: 50%;
  width: clamp(320px, 24vw, 392px);
  max-height: min(74vh, 660px);
  transform: translate(24px, -50%);
  opacity: 0; visibility: hidden;
  padding: 22px 22px 20px;
  background: rgba(13, 15, 19, 0.82);
  border: 1px solid rgba(247, 246, 243, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.95);
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--paper);
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease), visibility 0.45s;
}
.glp.is-open { transform: translate(0, -50%); opacity: 1; visibility: visible; }
.glp::-webkit-scrollbar { width: 3px; }
.glp::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); }

.glp__close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(247, 246, 243, 0.14);
  display: grid; place-items: center;
  color: rgba(247, 246, 243, 0.6);
  transition: color 0.3s, border-color 0.3s, transform 0.4s var(--ease);
}
.glp__close:hover { color: #fff; border-color: rgba(239, 200, 131, 0.5); transform: rotate(90deg); }

.glp__idx {
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.2em;
  color: rgba(239, 200, 131, 0.85);
  margin-bottom: 12px;
}
.glp__cn { font-size: 1.6rem; font-weight: 400; line-height: 1.1; }
.glp__en {
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.26em;
  color: rgba(247, 246, 243, 0.35); margin-top: 7px;
}
.glp__sites {
  margin-top: 12px; font-size: 0.72rem; line-height: 1.7;
  color: rgba(247, 246, 243, 0.5);
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(247, 246, 243, 0.09);
}
.glp__gal {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 5px; height: 152px;
  margin: 14px 0 14px;
}
.glp__gal figure {
  margin: 0; overflow: hidden; border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}
.glp__gal figure:first-child { grid-row: span 2; }
.glp__gal img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.05);
  transition: opacity 0.6s var(--ease), transform 1.2s var(--ease);
}
.glp__gal img.is-in { opacity: 1; transform: none; }

.glp__desc { font-size: 0.79rem; line-height: 1.8; color: rgba(247, 246, 243, 0.66); }
.glp__addr {
  display: flex; gap: 7px; align-items: flex-start;
  margin-top: 13px; font-size: 0.7rem; line-height: 1.55;
  color: rgba(247, 246, 243, 0.5);
  transition: color 0.3s;
}
.glp__addr svg { flex: none; margin-top: 2px; width: 12px; height: 12px; }
.glp__addr:hover { color: var(--gold, #efc883); }
.glp__addr span { border-bottom: 1px solid rgba(247, 246, 243, 0.16); }

.glp__cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 9px 15px;
  font-size: 0.73rem;
  border: 1px solid rgba(247, 246, 243, 0.16);
  border-radius: 999px;
  transition: background 0.35s, border-color 0.35s, gap 0.35s var(--ease);
}
.glp__cta:hover {
  background: rgba(239, 200, 131, 0.1);
  border-color: rgba(239, 200, 131, 0.5);
  gap: 12px;
}
.glp__cta svg { width: 12px; height: 12px; }

/* ---------- 加载 ---------- */
.gl-load {
  position: absolute; inset: 0; z-index: 8;
  display: grid; place-content: center; justify-items: center; gap: 16px;
  background: #04070c;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.gl-load.is-done { opacity: 0; visibility: hidden; }
.gl-load__ring {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(239, 200, 131, 0.18);
  border-top-color: rgba(239, 200, 131, 0.9);
  animation: glspin 1s linear infinite;
}
.gl-load__txt {
  font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.3em;
  color: rgba(247, 246, 243, 0.32);
}
@keyframes glspin { to { transform: rotate(360deg); } }

.gl-fallback {
  position: absolute; inset: 0; z-index: 7;
  display: none; place-content: center; text-align: center;
  color: rgba(247, 246, 243, 0.5); font-size: 0.85rem;
  padding: 40px;
}
.gl-fallback.is-on { display: grid; }

/* ---------- 下方：国家索引 ---------- */
.glidx {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding-block: clamp(56px, 7vw, 100px);
}
.glidx__hd {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 30px; flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.glidx__hd h2 { font-size: var(--fs-h2); font-weight: 400; letter-spacing: -0.01em; }
.glidx__hd p { font-size: var(--fs-sm); color: var(--muted); max-width: 34rem; }
.glidx__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}
.glidx__i {
  display: flex; align-items: baseline; gap: 14px;
  padding: 20px 18px 20px 0;
  border-top: 1px solid var(--line);
  transition: background 0.35s var(--ease), padding 0.35s var(--ease);
}
.glidx__i:nth-child(3n + 2), .glidx__i:nth-child(3n) { padding-left: 18px; }
.glidx__i:nth-child(-n + 3) { border-top: 0; }
.glidx__i:hover { background: rgba(16, 18, 20, 0.03); }
.glidx__i .n {
  font-family: var(--mono); font-size: 0.6rem; color: var(--muted);
  letter-spacing: 0.12em;
}
.glidx__i .c { display: flex; flex-direction: column; gap: 4px; }
.glidx__i .c b { font-weight: 500; font-size: 1rem; }
.glidx__i .c i {
  font-style: normal; font-family: var(--mono);
  font-size: 0.56rem; letter-spacing: 0.16em; color: var(--muted);
}
.glidx__i .k {
  margin-left: auto; font-family: var(--mono);
  font-size: 0.62rem; color: var(--muted);
}
.glidx__i:hover .k { color: var(--ink); }
.glidx__note {
  margin-top: 20px; font-size: 0.72rem; color: var(--muted);
  display: flex; gap: 8px; align-items: flex-start;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .gl-head { top: 96px; max-width: 22rem; }
  .gl-head p { font-size: 0.8rem; }
  .glp { width: clamp(300px, 32vw, 360px); }
  .glidx__grid { grid-template-columns: repeat(2, 1fr); }
  .glidx__i:nth-child(3n + 2), .glidx__i:nth-child(3n) { padding-left: 0; }
  .glidx__i:nth-child(2n) { padding-left: 18px; }
  .glidx__i:nth-child(-n + 2) { border-top: 0; }
  .glidx__i:nth-child(3) { border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
  .gl-stage { height: 100svh; min-height: 560px; }
  .gl-scrim {
    background:
      radial-gradient(52% 26% at 50% 40%, rgba(38, 96, 168, 0.14), transparent 76%),
      linear-gradient(180deg, rgba(2, 4, 8, 0.72) 0%, rgba(2, 4, 8, 0.28) 14%, transparent 24%);
  }
  .gl-head { top: 84px; left: var(--pad); right: var(--pad); max-width: none; }
  .gl-head h1 { font-size: clamp(1.55rem, 7vw, 2rem); }
  .gl-head p { display: none; }
  .gl-stats { gap: 18px; margin-top: 16px; }
  .gl-stats b { font-size: 0.9rem; }
  .gl-stats span { font-size: 0.6rem; }
  .gl-hint { display: none; }
  .gl-foot { bottom: 78px; }
  .gl-legend { font-size: 0.62rem; gap: 14px; }
  .gl-back {
    right: auto; left: var(--pad); bottom: 24px;
    font-size: 0.68rem; padding: 7px 12px;
  }
  .gl-lb { font-size: 0.66rem; padding: 4px 8px; }
  .gl-lb b { display: none; }

  .glp {
    left: 0; right: 0; top: auto; bottom: 0;
    width: 100%;
    max-height: 56vh;
    transform: translateY(104%);
    border-radius: 14px 14px 0 0;
    border-bottom: 0;
    padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .glp.is-open { transform: translateY(0); }
  .glp__cn { font-size: 1.35rem; }
  .glp__gal { height: 124px; }
  .glidx__grid { grid-template-columns: 1fr; }
  .glidx__i { padding-left: 0 !important; }
  .glidx__i:nth-child(2) { border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  .gl-load__ring { animation: none; }
}

/* ---------- 重置视角 ---------- */
.gl-reset {
  position: absolute; z-index: 6;
  right: var(--pad); bottom: 82px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; font-size: 0.72rem; letter-spacing: 0.02em;
  color: rgba(247, 246, 243, 0.62);
  border: 1px solid rgba(247, 246, 243, 0.16);
  border-radius: 999px;
  background: rgba(10, 13, 18, 0.62);
  backdrop-filter: blur(10px);
  transition: color 0.3s, border-color 0.3s;
}
.gl-reset:hover { color: #fff; border-color: rgba(239, 200, 131, 0.5); }
.gl-reset[hidden] { display: none; }

/* 面板内小标签 */
.glp__stat {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.14em;
  color: rgba(239, 200, 131, 0.9);
  padding: 4px 8px; border-radius: 3px;
  background: rgba(239, 200, 131, 0.1);
}

.gl-lb.is-hover { border-color: rgba(239, 200, 131, 0.45); }

@media (max-width: 860px) {
  .gl-reset {
    right: var(--pad); left: auto; bottom: auto;
    top: 88px;
    padding: 6px 11px; font-size: 0.66rem;
  }
}

/* 左侧文字压暗，保证可读性（球体取景在 40.5%–75%，渐变到 40% 已归零） */
.gl-scrim {
  background:
    linear-gradient(96deg, rgba(4, 7, 12, 0.94) 0%, rgba(4, 7, 12, 0.78) 14%, rgba(4, 7, 12, 0.34) 28%, rgba(4, 7, 12, 0) 40%),
    radial-gradient(46% 46% at 57.5% 52%, rgba(38, 96, 168, 0.13), transparent 72%),
    radial-gradient(120% 100% at 50% 52%, transparent 46%, rgba(2, 4, 8, 0.5) 86%, rgba(2, 4, 8, 0.85) 100%);
}
@media (max-width: 860px) {
  /* 移动端文案在球体上方，遮罩只压顶部导航区，不再盖住球面 */
  .gl-scrim {
    background:
      linear-gradient(180deg, rgba(4, 7, 12, 0.86) 0%, rgba(4, 7, 12, 0.42) 10%, rgba(4, 7, 12, 0) 20%),
      radial-gradient(62% 30% at 50% 47%, rgba(38, 96, 168, 0.12), transparent 74%);
  }
}

/* 聚焦时淡出开场文案，把画面让给地球与面板 */
.gl-head { transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
body.gl-has-focus .gl-head { opacity: 0; transform: translateY(-14px); pointer-events: none; }
body.gl-has-focus .gl-foot { opacity: 0; }
.gl-foot { transition: opacity 0.4s var(--ease); }
@media (max-width: 860px) { .gl-reset { display: none; } }
