/* ═══════════════════════════════════════════════
   我的旅行足迹 · 星图
   设计规范参考 Apple Store（apple.com.cn/store）
   ───────────────────────────────────────────────
   排版  SF Pro / PingFang SC · 17 / 14 / 12 三级阶梯
        大标题 -0.015em 收紧字距，正文 0 字距，600 为最重字重
   间距  4 起点八级阶梯（4/8/12/16/24/32/48/64/80），区块留白 64–72
   圆角  28 大面板 · 18 卡片 · 12 控件 · 980 胶囊
   色彩  #1d1d1f 主文 / #6e6e73 次级 / #86868b 三级 / #d2d2d7 分割线
        #f5f5f7 浅灰面板 · 白卡片 · 青色仅用于数据可视化
   ═══════════════════════════════════════════════ */

:root {
  /* ── 排版阶梯 ── */
  --fs-display: clamp(32px, 4.4vw, 48px);   /* H1：48 / 40 / 32 */
  --fs-title: clamp(26px, 3.6vw, 40px);     /* H2 */
  --fs-headline: 21px;                      /* 强调正文 */
  --fs-body: 17px;                          /* 正文 */
  --fs-sm: 14px;                            /* 说明 */
  --fs-xs: 12px;                            /* 注脚 */
  --fs-caption: 11px;                       /* 最小标注 */
  --lh-tight: 1.08;
  --lh-body: 1.47;
  --lh-sm: 1.43;
  --lh-xs: 1.33;
  --ls-display: -0.015em;
  --ls-title: -0.01em;
  --ls-label: 0.06em;                       /* 仅用于大写英文标注 */

  /* ── 间距阶梯 ── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 80px;

  /* ── 圆角 ── */
  --r-pill: 980px;
  --r-xl: 28px;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;

  /* ── 色彩 ── */
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --dim: #86868b;
  --dim-2: #c7c7cc;
  --hairline: #d2d2d7;
  --hairline-soft: #e8e8ed;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #ffffff;
  --ink-2: #fbfbfd;

  /* 品牌色：仅用于地图数据与轨迹标注 */
  --cyan: #0CB6F2;
  --cyan-deep: #098EBD;
  --violet: #0CB6F2;
  --gold: #0CB6F2;

  /* ── 动效 ── */
  --ease: cubic-bezier(.28, .11, .32, 1);
  --dur-1: .2s;
  --dur-2: .3s;
  --dur-3: .45s;
  --dur-4: .7s;

  /* ── 字体 ── */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "PingFang SC", "Noto Sans SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC",
             "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --num: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC",
         "Helvetica Neue", Arial, sans-serif;
  --serif: var(--display);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

.tnum { font-variant-numeric: tabular-nums; }

/* ── 共享顶部导航（与主页 / 经历页一致） ─────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1500;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(20px, 4vw, 56px);
  color: #1D1D1F;
  background: rgba(245, 245, 247, 0.8);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(29, 29, 31, 0.10);
}
.topnav__logo {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", "Noto Sans SC", sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: #1D1D1F;
}
.topnav__logo span { margin: 0 5px; color: #0071E3; font-weight: 400; }
.topnav__menu { display: flex; gap: 40px; align-items: center; }
.topnav__menu a {
  position: relative;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  color: #6E6E73;
  padding: 8px 0;
  transition: color 280ms cubic-bezier(.22, 1, .36, 1);
}
.topnav__menu a:hover { color: #1D1D1F; }
.topnav__menu a::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -2px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #0071E3;
  transform: translateX(-50%) scale(0);
  transition: transform 200ms cubic-bezier(.22, 1, .36, 1);
}
.topnav__menu a.is-active { color: #1D1D1F; }
.topnav__menu a.is-active::after { transform: translateX(-50%) scale(1); }

.topnav__toggle {
  display: none;
  width: 44px; height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 8px;
}
.topnav__toggle span {
  width: 24px; height: 1.5px;
  background: #1D1D1F;
  transition: transform 280ms cubic-bezier(.22, 1, .36, 1), opacity 280ms cubic-bezier(.22, 1, .36, 1);
}
.topnav__toggle.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.topnav__toggle.is-open span:nth-child(2) { opacity: 0; }
.topnav__toggle.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* 移动端全屏菜单 */
.nav__panel {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: #F5F5F7;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-inline: clamp(20px, 4vw, 56px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(.22, 1, .36, 1), visibility 280ms;
}
.nav__panel.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
.nav__panel a {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", "Noto Sans SC", sans-serif;
  font-size: clamp(36px, 9vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #1D1D1F;
  padding-block: 12px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.10);
  display: flex;
  align-items: baseline;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 280ms cubic-bezier(.22, 1, .36, 1), transform 280ms cubic-bezier(.22, 1, .36, 1);
}
.nav__panel a small {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #6E6E73;
}
.nav__panel.is-open a { opacity: 1; transform: translateY(0); }
.nav__panel.is-open a:nth-child(1) { transition-delay: 60ms; }
.nav__panel.is-open a:nth-child(2) { transition-delay: 140ms; }
.nav__panel.is-open a:nth-child(3) { transition-delay: 220ms; }
.nav__panel.is-open a:nth-child(4) { transition-delay: 300ms; }

/* 菜单打开时 logo / 开关切深色 */
.topnav.menu-open .topnav__logo { color: #1D1D1F; }
.topnav.menu-open .topnav__logo span { color: #0071E3; }

/* 滚动进度条 */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 1600;
  pointer-events: none;
}
.scroll-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(135deg, #626DFF 0%, #9275FF 50%, #85DFFF 100%);
  transform-origin: left;
  transform: scaleX(0);
}

/* 跳过链接 */
.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 2000;
  background: #1D1D1F;
  color: #F5F5F7;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  transform: translateY(-150%);
  transition: transform 280ms cubic-bezier(.22, 1, .36, 1);
}
.skip-link:focus-visible { transform: translateY(0); }

body.is-locked { overflow: hidden; }

/* ── 背景：Apple 式的留白，星尘退到极淡 ── */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.sky__stars i {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--dim-2);
  opacity: .35;
  animation: twinkle var(--d, 4s) ease-in-out var(--dl, 0s) infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: .18; transform: scale(.85); }
  50%      { opacity: .55; transform: scale(1.05); }
}

/* 流星在浅色版面上属于噪音，按 Apple 的克制原则停用 */
.meteor { display: none; }

/* ── 页面骨架 ─────────────────────────── */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(56px + clamp(24px, 3vw, 40px)) clamp(20px, 4vw, 40px) clamp(56px, 7vw, 88px);
  display: grid;
  gap: clamp(20px, 2.6vw, 32px);   /* 缩短标题区与地图面板之间的间距 */
}

/* ── 灵感宣言 ── */
.manifesto {
  max-width: 900px;
  margin-inline: auto;      /* 相对页面居中 */
  text-align: center;
}
.manifesto__lede {
  font-size: var(--fs-sm);          /* 与数据面板标签「国家/地区」同号 14px */
  font-weight: 600;
  line-height: var(--lh-sm);
  color: var(--text);
}
.manifesto__notes {
  margin-top: var(--sp-5);
  display: grid;
  gap: var(--sp-3);
}
.manifesto__notes p {
  font-size: var(--fs-sm);          /* 同号 14px */
  line-height: var(--lh-sm);
  color: var(--text-dim);
}

/* 入场 */
.reveal {
  opacity: 0;
  translate: 0 20px;
  transition: opacity var(--dur-4) var(--ease), translate var(--dur-4) var(--ease);
}
.reveal.is-in { opacity: 1; translate: 0 0; }
.reveal:nth-child(2) { transition-delay: .1s; }
.reveal:nth-child(3) { transition-delay: .2s; }

/* ── 头部档案 ─────────────────────────── */
.profile {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-6);
}

.profile__id {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-inline: auto;   /* 桌面端：头部档案整体居中；右侧工具组保持原位 */
}

.avatar {
  position: relative;
  width: 56px; height: 56px;
  flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: linear-gradient(160deg, #5ed0f5 0%, var(--cyan) 100%);
}
.avatar__mono {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-body);
  letter-spacing: 0;
  color: #fff;
}
.avatar__orbit {
  position: absolute; inset: -6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-soft);
  animation: orbit 18s linear infinite;
}
.avatar__orbit::before {
  content: "";
  position: absolute;
  top: -2.5px; left: 50%;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cyan);
}
@keyframes orbit { to { rotate: 360deg; } }

.profile__name {
  font-family: var(--display);
  font-size: var(--fs-headline);   /* 与「南京 上海 杭州」同号 21px */
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: var(--lh-xs);
  letter-spacing: 0;
  color: #fff;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--cyan);
  translate: 0 -2px;
}
.badge__star {
  width: 8px; height: 8px;
  background: #fff;
  clip-path: polygon(50% 0, 63% 34%, 100% 38%, 72% 62%, 81% 100%, 50% 78%, 19% 100%, 28% 62%, 0 38%, 37% 34%);
}

.profile__stats {
  margin-top: var(--sp-2);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  letter-spacing: 0;
}
.profile__stats b {
  font-family: var(--num);
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.profile__stats .dot { margin: 0 6px; opacity: .6; }

.profile__tools {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

/* 分段控制器（iOS Segmented Control 风格） */
.chips {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-pill);
}

.chip {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: var(--text-dim);
  background: none;
  border: 0;
  border-radius: var(--r-pill);
  padding: 8px 18px;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}
.chip:hover { color: var(--text); }
.chip.is-on {
  color: #fff;
  background: #FF5588;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(255, 85, 136, 0.35);
}
.chip:focus-visible,
.hud-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.legend {
  position: absolute;
  right: var(--sp-5);
  bottom: calc(var(--sp-5) + 56px);   /* 平面/3D 切换按钮上方，右缘对齐 */
  display: flex;
  gap: var(--sp-4);
  z-index: 5;
}
.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  color: var(--dim);
}
.legend__swatch {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--dim-2);
}
.legend__swatch--on { background: var(--cyan); }
.legend__swatch--region { background: linear-gradient(160deg, #5ed0f5, #0CB6F2); }

/* ── 地图舞台 ─────────────────────────── */
.stage__frame {
  position: relative;
  border-radius: var(--r-xl);
  background: var(--surface-2);
  overflow: hidden;
  isolation: isolate;
}

#map {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 860;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#map:active { cursor: grabbing; }

/* 国家 */
.country { cursor: default; }
.country path {
  stroke: rgba(12, 182, 242, .35);
  stroke-width: 1;
  fill: transparent;
  transition: stroke var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease);
}
.country.is-dim { opacity: .22; }

/* 国家底色：深浅由该国点位数决定（fill 由脚本注入，勿在此声明 fill） */
.country-fill {
  stroke: none;
  pointer-events: none;
  transition: fill var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease);
}
.country-fill.is-dim { opacity: .14; }

/* 区域：省界 / 国界描边 */
.region { transition: stroke var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease); }
.region--cn { fill: none; stroke: rgba(12, 182, 242, .28); stroke-width: .7; }
.region--cn.is-on { stroke: rgba(12, 182, 242, .58); stroke-width: .9; }
/* 省份底色：深浅由该省分布点数量决定（fill 由脚本内联注入） */
.region--cn-fill { stroke: none; transition: fill var(--dur-3) var(--ease); }
.region.is-dim { opacity: .14; }

.country path.is-trace {
  fill: url(#fillOff);
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
}

.country.ctx path { fill: rgba(12, 182, 242, .06); stroke: rgba(12, 182, 242, .18); }

/* 城市 */
.city { cursor: pointer; outline: none; }
.city circle, .city path, .city text { transform-box: fill-box; transform-origin: center; }
.city .halo  { fill: url(#glowWarm); opacity: 0; transition: opacity var(--dur-3) var(--ease); }
/* 金色（水滴）地标：去掉蓝色光晕与动画，仅保留水滴本体 */
.city.is-gold .halo { display: none; }
.city.is-gold .ring { animation: none; opacity: 0; }
.city .ring  {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1;
  opacity: 0;
}
.city.is-on .ring { opacity: 0; animation: pulse 2.6s var(--ease) var(--ign, 0s) infinite; }
.city.is-gold.is-on .ring { animation: none; opacity: 0; }   /* 水滴坐标：无脉冲圆环 */
.city .core {
  fill: var(--dim-2);
  stroke: #fff;
  stroke-width: 1;
  transition: fill var(--dur-3) var(--ease), r var(--dur-3) var(--ease), stroke var(--dur-3) var(--ease), transform var(--dur-2) var(--ease);
}
.city.is-on .core {
  fill: var(--cyan);
  stroke: #fff;
}
.city.is-gold .core { fill: #FF5588; stroke: #fff; }
.city.is-gold .ring { stroke: var(--gold); stroke-width: 1.5; }
.city .pin-hole { fill: #fff; }
.city.is-gold:hover .core, .city.is-gold.is-hot .core { transform: scale(1.14); }

.city text {
  font-family: var(--sans);
  font-size: calc(11px * var(--k, 1));
  fill: var(--text-dim);
  letter-spacing: 0;
  pointer-events: none;
  opacity: 0;
  transition: fill var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease);
  dominant-baseline: middle;
}
.city:hover text, .city.is-hot text { opacity: 1; }
.is-zoomed-labels .city.is-on text { opacity: .92; }
.is-zoomed-labels .city.is-gold text { opacity: 1; }
.city.is-on text  { fill: var(--text); }
.city.is-gold text { fill: var(--text); opacity: 1; }
.city.is-dimmed { opacity: .18; pointer-events: none; }
.city:hover .core, .city.is-hot .core { r: 6px; }
.city:focus-visible .ring { opacity: 1; animation: none; stroke-dasharray: 3 3; }

@keyframes pulse {
  0%   { r: var(--r); opacity: .5; }
  70%  { r: calc(var(--r) * 3.2); opacity: 0; }
  100% { r: calc(var(--r) * 3.2); opacity: 0; }
}

.ripple {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
  animation: ripple .9s var(--ease) forwards;
  pointer-events: none;
}
@keyframes ripple {
  from { r: 4; opacity: .9; stroke-width: 3; }
  to   { r: 46; opacity: 0; stroke-width: .5; }
}

/* 城市入场 */
.city .pop { animation: pop .7s var(--ease) backwards; animation-delay: var(--ign, 0s); }
@keyframes pop {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}

/* 加载即逐个点亮 */
@keyframes ignite {
  0%   { opacity: 0; transform: scale(.15); }
  55%  { opacity: 1; transform: scale(1.12); }
  100% { opacity: .9; transform: scale(1); }
}

/* ── 浮层卡片：18 圆角 · 白底 · 极轻阴影（Apple tile） ── */
.cards { position: absolute; inset: 0; pointer-events: none; display: none; transition: opacity var(--dur-2) var(--ease); }   /* 隐藏城市手记照片卡片 */
.stage__frame.is-zoomed .cards { opacity: 0; pointer-events: none; }

.card {
  position: absolute;
  translate: -50% -50%;
  width: 148px;
  padding: 14px 16px 16px;
  border-radius: var(--r-lg);
  border: 0;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .08);
  pointer-events: auto;
  cursor: default;
  opacity: 0;
  scale: .96;
  transition: opacity var(--dur-4) var(--ease), scale var(--dur-4) var(--ease),
              box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.card.is-in { opacity: 1; scale: 1; transition-delay: var(--dl, 0s); }
.card:hover, .card.is-hot {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06), 0 20px 48px rgba(0, 0, 0, .12);
}

/* 纯照片卡：无内边距，图片铺满整卡，圆角由卡片裁切 */
.card--shot { width: 148px; padding: 0; overflow: hidden; }
.card--shot .card__shot { margin: 0; border-radius: 0; }
.card--shot .card__shot img { object-position: 50% 50%; }

/* 带照片的卡片：照片严格落在卡片内边距之内，不溢出圆角 */
.card--photo { width: 164px; padding: 10px 10px 14px; }
.card--photo .card__place,
.card--photo .card__note,
.card--photo .card__year { padding-inline: 6px; }
.card__shot {
  margin: 0 0 10px;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}
.card__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

.card__place {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 6px;
}
.card__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  line-height: var(--lh-sm);
  letter-spacing: 0;
  color: var(--text);
  white-space: nowrap;
}
.card__en {
  font-family: var(--num);
  font-size: var(--fs-caption);
  line-height: var(--lh-xs);
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  white-space: nowrap;
}
.card__note {
  margin-top: var(--sp-1);
  font-size: 13px;
  line-height: var(--lh-sm);
  color: var(--text-dim);
}
.card__year {
  margin-top: var(--sp-2);
  font-family: var(--num);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: var(--lh-xs);
  color: var(--cyan-deep);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.card.is-off { opacity: .34; }

/* ── tooltip ── */
.tooltip {
  position: absolute;
  z-index: 5;
  max-width: 248px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 0;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08), 0 20px 48px rgba(0, 0, 0, .12);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  translate: -50% calc(-100% - 14px);
  transition: opacity var(--dur-1) var(--ease);
}
.tooltip.is-show { opacity: 1; }
.tooltip__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  line-height: var(--lh-sm);
  letter-spacing: 0;
}
.tooltip__name small {
  font-family: var(--num);
  font-weight: 400;
  font-size: var(--fs-caption);
  color: var(--dim);
  margin-left: var(--sp-2);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.tooltip__status { margin-top: 2px; color: var(--cyan-deep); font-size: var(--fs-xs); letter-spacing: 0; }
.tooltip__status.is-off { color: var(--dim); }
.tooltip__note { margin-top: var(--sp-1); color: var(--text-dim); }
.tooltip__tip {
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--hairline-soft);
  color: var(--dim);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
}

/* ── HUD：圆形按钮 ── */
.stage__hud {
  position: absolute;
  left: var(--sp-5); bottom: var(--sp-5);   /* 缩放按钮组：地图左下角 */
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.hud-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--text);
  font-size: var(--fs-body);
  font-family: var(--num);
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.hud-btn:hover { background: #fff; border-color: var(--dim); }
.hud-btn--wide {
  width: auto;
  padding: 0 14px;
  font-family: var(--sans);
  font-size: var(--fs-xs);
  letter-spacing: 0;
}

.stage__hint {
  position: absolute;
  left: var(--sp-5); bottom: var(--sp-5);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  letter-spacing: 0;
  color: var(--dim);
}
.stage__hint::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  margin-right: 6px;
  vertical-align: 1px;
}

/* ── 成就面板 ─────────────────────────── */
.achv__title {
  position: relative;
  width: fit-content;
  margin: 0 auto var(--sp-6);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-title);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-title);
  text-align: center;
}
.achv__brush {
  position: absolute;
  left: 50%; bottom: -12px;
  width: min(200px, 80%);
  translate: -50% 0;
  opacity: .55;
}
.achv__brush path { stroke-dasharray: 260; stroke-dashoffset: 260; stroke-width: 3; }
.is-in .achv__brush path { animation: brush 1.1s var(--ease) .4s forwards; }
@keyframes brush { to { stroke-dashoffset: 0; } }

.achv__panel {
  border: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;   /* 与地图合并：底部直角相接 */
  background: var(--surface-2);
  padding: clamp(28px, 3.4vw, 40px) clamp(24px, 4vw, 48px) clamp(32px, 4vw, 48px);
  display: grid;
  gap: var(--sp-6);
}

/* 成就面板与星图地图合并：抵消 .page 的栅格间距，衔接处直角相接 */
.achv { margin-bottom: calc(-1 * clamp(40px, 6vw, 72px)); }
.stage__frame { border-radius: 0 0 var(--r-xl) var(--r-xl); }

.achv__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;          /* 指标组与「我已去过」垂直居中 */
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-5);
}
.achv__row .achv__grid {
  flex: 0 1 640px;              /* 指标组放入「我已去过」右侧空白区 */
  justify-self: end;
}
.achv__been {
  font-family: var(--display);
  font-size: var(--fs-headline);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: 0;
}

.flags { display: inline-flex; margin-left: var(--sp-3); vertical-align: -3px; }
.flag {
  font-size: 22px;
  margin-left: -6px;
  border-radius: var(--r-sm);
  animation: flag-in .8s var(--ease) backwards;
  animation-delay: calc(.4s + var(--i) * .12s);
}
@keyframes flag-in {
  from { opacity: 0; translate: 0 12px; scale: .7; }
  to   { opacity: 1; translate: 0 0;    scale: 1; }
}

.achv__km {
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  letter-spacing: 0;
}
.achv__km b {
  font-family: var(--num);
  font-size: var(--fs-headline);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.achv__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}
.achv__cell {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
  position: relative;
}
.achv__cell + .achv__cell::before {
  content: "";
  position: absolute;
  left: -12px; top: 8%;
  width: 1px; height: 84%;
  background: var(--hairline-soft);
}
.achv__num {
  font-family: var(--num);
  font-size: var(--fs-headline);
  font-weight: 600;
  line-height: 1.24;
  color: var(--text);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.achv__num--gold {
  font-family: var(--display);
}
.achv__cell dd {
  margin-top: var(--sp-1);
  color: var(--dim);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
  letter-spacing: 0;
}

.foot {
  text-align: center;
  color: var(--dim);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  letter-spacing: 0;
}

/* ── 响应式 ───────────────────────────── */
@media (max-width: 960px) {
  /* 窄屏地图高度不足以容纳浮层卡片，按 Apple 的渐进披露原则收起 */
  .cards { display: none; }
}

@media (max-width: 900px) {
  .profile { align-items: flex-start; }
}

@media (max-width: 720px) {
  .topnav__menu { display: none; }
  .topnav__toggle { display: flex; z-index: 1501; }
  .theme-toggle { display: none; }   /* 手机端：隐藏主题切换按钮 */
  /* 手机端顶栏：语言切换收成图标按钮（同 bytedance.com） */
  .lang-switch__label,
  .lang-switch__arrow { display: none; }
  .lang-switch__btn { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .lang-switch__globe { width: 22px; height: 22px; }
  /* 图标聚拢到右侧 */
  .topnav { justify-content: flex-start; }
  .lang-switch { margin-left: auto; margin-right: 2px; }
}

/* ── 语言切换（中/EN，参考 bytedance.com 顶栏交互） ─────────────────── */
.lang-switch { position: relative; }
.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 10px;
  background: none;
  border: 0;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background .25s var(--ease, ease);
}
.lang-switch__btn:hover { background: var(--hairline-soft); }
.lang-switch__globe { width: 18px; height: 18px; }
.lang-switch__label { font-weight: 500; letter-spacing: 0.01em; }
.lang-switch__arrow { width: 10px; height: 7px; opacity: 0.7; transition: transform .25s var(--ease, ease); }
.lang-switch.is-open .lang-switch__arrow { transform: rotate(180deg); }
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 104px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  z-index: 1600;
}
.lang-switch__menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: #1D1D1F;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: background .25s var(--ease, ease);
}
html.globe-dark .lang-switch__menu button { color: var(--ink); }
.lang-switch__menu button:hover { background: var(--hairline-soft); }
.lang-switch__menu button.is-active { color: #5C7CFA; font-weight: 600; }

/* ── 主题切换按钮（与主页 style.css 同款） ─────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  color: var(--ink);
  border-radius: 50%;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.theme-toggle:hover { background: var(--hairline-soft); transform: rotate(12deg); }
.theme-toggle__icon { width: 20px; height: 20px; display: none; }
.theme-toggle__icon--moon { display: block; }                 /* 浅色模式显示月亮 */
html[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
html[data-theme="dark"] .theme-toggle__icon--sun { display: block; }   /* 深色模式显示太阳 */

@media (max-width: 700px) {
  /* 手机端：头部档案、地图切换、筛选与成就面板整体居中 */
  .profile {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--sp-4);
  }
  .profile__id { justify-content: center; text-align: center; }
  .profile__name { justify-content: center; }
  .profile__tools {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
  }
  .chips { display: flex; width: fit-content; margin-inline: auto; flex-wrap: wrap; justify-content: center; }
  .achv__row {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--sp-4);
  }
  .achv__row .achv__grid { flex: none; width: 100%; }
  .legend { display: none; }
  .achv__grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }   /* 手机端三项指标一行排布 */
  .achv__cell + .achv__cell { border-top: 0; padding-top: 0; }
  .achv__cell + .achv__cell::before { display: block; }   /* 恢复列间竖向分隔线 */
  .stage__hud { left: var(--sp-4); bottom: var(--sp-4); }
}

/* ── 地图模式切换（平面 / 3D 点阵地球）：地图右下角悬浮 ─────────────────────────── */
.map-switch {
  position: absolute;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 5;                  /* 高于地图与提示层 */
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--hairline-soft, rgba(0, 0, 0, 0.08));
  border-radius: 999px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
/* 手机端：与左下缩放按钮组底边对齐 */
@media (max-width: 700px) {
  .map-switch { right: var(--sp-4); bottom: var(--sp-4); }
}
.map-switch__btn {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  line-height: 1;
  color: #8FA6B8;
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.map-switch__btn:hover { color: #CDEBF7; }
.map-switch__btn.is-on {
  color: #fff;
  background: var(--cyan);
  font-weight: 600;
}
.map-switch__btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── 3D 点阵地球 ─────────────────────────── */
.stage__globe {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 深色球体背景：对齐 localhost:8823 参考页的暗卡 */
  background:
    radial-gradient(120% 90% at 50% 108%, rgba(43, 107, 255, 0.16), transparent 55%),
    #070b16;
}

/* ── 3D 模式：整页切换为深色 ─────────────────────────── */
html.globe-dark {
  --surface: #0B0D14;
  --surface-2: #141822;
  --text: #F2F3F7;
  --text-dim: #A8ADBB;
  --dim: #8A90A0;
  --dim-2: #4A5264;
  --hairline: rgba(245, 245, 242, 0.12);
  --hairline-soft: rgba(245, 245, 242, 0.07);
  --ink: #F2F3F7;
  --ink-2: #A8ADBB;
}
html.globe-dark body { background: #0B0D14; }
html.globe-dark .stage__frame { background: #070b16; }
html.globe-dark .achv__panel { background: #141822; }
html.globe-dark .sky__stars i { opacity: 0.5; }
html.globe-dark .meteor { display: block; }   /* 深色下恢复流星 */
.stage__globe[hidden] { display: none; }
#globeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#globeCanvas:active { cursor: grabbing; }
.stage__globe-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #5F7688;
  pointer-events: none;
}
/* 3D 模式：隐藏平面地图与其专属浮层；保持舞台高度 */
.stage__frame.is-globe { aspect-ratio: 1200 / 860; }
.stage__frame.is-globe #map,
.stage__frame.is-globe .cards,
.stage__frame.is-globe .tooltip,
.stage__frame.is-globe .stage__hud { display: none; }

/* ── 页面导航：与主页 .about__links 完全同款 ── */
/* 电脑端：悬浮固定于页面右上方（顶栏下方），竖排右对齐；手机端：底部通栏吸附条 */
.about__links {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  top: calc(56px + 56px);      /* 顶栏(56px)下方空出一个按钮高度 */
  z-index: 1200;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 4px;
  background: var(--surface, #fff);
  border: 1px solid var(--hairline-soft, rgba(0, 0, 0, 0.08));
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 24px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.3;
  color: #FF5588;
  text-decoration: none;
  background: none;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.page-link:hover { color: #F04A78; background: rgba(255, 85, 136, 0.08); }
.page-link:focus-visible { outline: 2px solid #FF5588; outline-offset: 2px; }
/* 首项粉底（与主页一致） */
.about__links .page-link:first-child {
  background: #FF5588;
  color: #fff;
  box-shadow: 0 2px 10px rgba(255, 85, 136, 0.35);
}
.about__links .page-link:first-child:hover { background: #F04A78; color: #fff; }
/* 当前页高亮 */
.about__links .page-link[aria-current="page"] {
  background: #FF5588;
  color: #fff;
  font-weight: 600;
}
.about__links .page-link[aria-current="page"]:hover { background: #F04A78; color: #fff; }

/* 手机端：底部通栏吸附条 */
@media (max-width: 720px) {
  .about__links {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    flex-direction: row;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-top: 1px solid var(--hairline-soft, rgba(0, 0, 0, 0.08));
    justify-content: space-around;
  }
  .about__links .page-link {
    flex: 1;
    padding: 8px 12px;
    justify-content: center;
  }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .foot { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ── 桌面端顶栏：语言切换移到最右侧、紧邻主题按钮（手机端保持不变） ── */
@media (min-width: 721px) {
  .topnav { justify-content: flex-start; }
  .topnav__menu { margin-inline: auto; }
  .lang-switch { margin-right: 6px; }
}

/* ── 动效减弱 ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; translate: 0 0; }
}
