/* 🍞 @FILE static/about-globe.css — 官网首屏地球区域样式
 *
 * @WHY 2026-10-16 需求方拍板：首屏右侧用地球替换后台界面截图。
 *   本文件只负责**容器与统计条**的样式，地球本身由 about_globe.js 渲染。
 *
 * @GOTCHA 三条硬性约束：
 *   ① `.globe-wrap` 必须有**确定的高度** —— echarts 初始化时若容器无高度，
 *      canvas 会是 0 高（白屏）。故用 aspect-ratio + min-height 双保险。
 *   ② 地球区域是深色（NASA 纹理+深色球体），与首屏浅色背景冲突 ——
 *      故给容器加**深色圆角底板 + 渐变**，让它像"嵌入的一块屏幕"，
 *      既协调又不显突兀。
 *   ③ 统计条叠在地球下方，不能遮挡球体 —— 用绝对定位 + 半透明底。
 *
 * @COUPLED templates/_about_hero.html（DOM 结构）、static/about_globe.js（渲染）
 */

/* ── 容器 ── */
.globe-wrap {
  position: relative;
  width: 100%;
  /* @WHY 用 aspect-ratio 保证不同屏宽下比例稳定；
     @GOTCHA 必须配合 min-height，否则窄屏会塌成 0 */
  aspect-ratio: 1 / 0.86;
  min-height: 340px;
  max-height: 460px;
  border-radius: 18px;
  overflow: hidden;
  /* @WHY 深色底板：地球本身是深色的，配浅色首屏需要过渡 */
  background:
    radial-gradient(120% 90% at 50% 30%, rgba(56, 189, 248, .10), transparent 62%),
    linear-gradient(165deg, #0a1526 0%, #060d18 55%, #04080f 100%);
  border: 1px solid rgba(56, 189, 248, .16);
  box-shadow:
    0 20px 50px -22px rgba(2, 8, 20, .55),
    inset 0 1px 0 rgba(255, 255, 255, .04);
}

/* @WHY 顶部一条细光带，模拟"屏幕边框高光"，提升精致度 */
.globe-wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
      transparent, rgba(125, 211, 252, .5), transparent);
  z-index: 3;
}

/* ── 地球画布 ── */
.home-globe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* @GOTCHA echarts 需要容器有明确尺寸，这里用绝对定位铺满父容器 */
}

/* @WHY 加载中显示一个呼吸圆点，避免"空白等待"的焦虑感 */
.home-globe::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(125, 211, 252, .8);
  animation: globePulse 1.4s ease-in-out infinite;
}
.home-globe.is-ready::after { display: none; }

@keyframes globePulse {
  0%, 100% { opacity: .25; transform: scale(.6); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ── 统计条 ── */
.globe-stats {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  /* @WHY 渐变半透明底：让数字可读，同时不完全遮盖地球底部 */
  background: linear-gradient(180deg,
      rgba(4, 10, 20, 0) 0%,
      rgba(4, 10, 20, .82) 34%,
      rgba(4, 10, 20, .94) 100%);
  padding: 26px 14px 13px;
}

.gs-item {
  text-align: center;
  position: relative;
}

/* @WHY 中间项加分隔线，形成"三栏读数"的仪表感 */
.gs-item + .gs-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  height: 76%;
  width: 1px;
  background: linear-gradient(180deg, transparent,
      rgba(125, 211, 252, .26), transparent);
}

.gs-item b {
  display: block;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  color: #EAF4FF;
  /* @WHY 极淡的青光，呼应地球的科幻调性 */
  text-shadow: 0 0 18px rgba(56, 189, 248, .45);
}

.gs-item span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: rgba(148, 163, 184, .95);
  letter-spacing: .06em;
}

/* ── 兜底（库加载失败时）── */
.globe-wrap.is-fallback::before { display: block; }
.globe-wrap.is-fallback {
  background:
    radial-gradient(circle at 50% 42%, rgba(56, 189, 248, .18), transparent 58%),
    linear-gradient(165deg, #0a1526, #04080f);
}

/* ── 响应式 ── */
@media (max-width: 980px) {
  .globe-wrap {
    aspect-ratio: 1 / 0.8;
    min-height: 300px;
    max-height: 400px;
  }
  .gs-item b { font-size: 17px; }
}

@media (max-width: 640px) {
  .globe-wrap {
    aspect-ratio: 1 / 0.92;
    min-height: 260px;
    max-height: 340px;
    border-radius: 14px;
  }
  .globe-stats { padding: 20px 8px 10px; }
  .gs-item b { font-size: 15px; }
  .gs-item span { font-size: 10px; }
}

/* @WHY 尊重"减少动态效果"偏好：关闭呼吸动画 */
@media (prefers-reduced-motion: reduce) {
  .home-globe::after { animation: none; opacity: .6; }
}
