/* 首页「全球航线」世界地图（#global-markets .gm-visual 里的 .ym-map-wrap，2026-11-26 重做）。
   画法与动画参照 feichuang 项目的板块08「From Rui'an to the World.」：
   底图内联进 DOM（assets/world-map.svg 的副本，外部文件 + CSS mask 的组合在部分渲染器下不渲染，feichuang 实测弃用）、
   陆地墨色浅调实心 + 纸白色细国界线、航线「接力单发」——每 0.5s 从出发点发一条弧线
   （画入 1.26s → 亮 0.6s → 从出发点收线 0.6s），滑行光点骑在画线前锋上，到站被城市光点吸收
   （爆亮 + 外扩脉冲环）；城市光点常态呼吸，悬停出「城市 · 国家」标签。
   本站改动：出发点 = 青田工厂（28.14N, 120.29E，投影 x=fmod(lon-150+540,360)/360×2000，
   y=(90-lat)/180×1000，与底图同为中央经线 150°E 的等距圆柱投影）；城市 = YIMING AIR 出口品
   对应的主要进口市场 12 城（名单与逐城依据见 index.html 内的生成注释 / tools/build-yiming-map.py），
   不是 feichuang 的 4WD 汽配名单；配色按本站——航线/出发点「浙江金」#b8852b（呼应标题的金色
   Zhejiang），城市光点/到站环本站蓝，标签白底 + 深藍字。地图显示宽度（右栏约 690px）只有
   feichuang 全宽版的一半，所以字号/线宽/半径都按视箱单位放大了一档；≤720px 再放大保可见度。
   动画属性由生成脚本算成具体数值内联进 HTML，这里只放静态属性与关键帧；关键帧百分比按一轮
   6s（12 城 × 0.5s）计算：画入 1.26s=21%，停留到 1.86s=31%，收线到 2.46s=41%，滑行光点 24% 前隐没。
   改城市/节拍：改 tools/build-yiming-map.py 重跑，同时改这里的关键帧百分比（百分比=秒数/6×100）。 */
#global-markets .ym-map-wrap { position: relative; width: 100%; margin-top: 2px; }  /* gm-visual 是 flex：不占满会被压缩成 svg 默认宽 300px */
.ym-world-map { display: block; width: 100%; height: auto; }
.ym-world-map path {
  fill: rgba(23, 60, 86, .14);
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linejoin: round;
}
.ym-world-map .map-seam-fill path { stroke: none; }  /* 贴接缝多边形：只填充 */
.ym-world-map .map-seam-line path { fill: none; }    /* 贴接缝多边形：只描边 */

/* 航线叠加层：与底图同视箱叠放；整层不吃鼠标，只有城市光点重新打开（.ym-map-city） */
.ym-map-routes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.ym-map-arc {
  fill: none;
  stroke: #b8852b;
  stroke-width: 3;          /* 视箱单位：右栏 690px 显示时约 1px */
  stroke-opacity: .8;
  stroke-linecap: round;
  stroke-dasharray: 100 100;  /* 基态 = 完整线条：动画停掉（reduced-motion）时全部航线静态全显 */
}
@keyframes ymMapArcLine {
  0%  { stroke-dashoffset: 100; opacity: 1; animation-timing-function: ease-out; }
  21% { stroke-dashoffset: 0; }                 /* 1.26s 画到城市 */
  31% { stroke-dashoffset: 0; }                 /* 亮 0.6s */
  41% { stroke-dashoffset: -100; opacity: 0; }  /* 0.6s 从出发点收线 */
  100% { stroke-dashoffset: -100; opacity: 0; }
}
/* 滑行光点：平时不可见，仅随 ymMapArcRun 在飞行窗口出现 */
.ym-map-runner {
  fill: #b8852b;
  filter: drop-shadow(0 0 6px rgba(184, 133, 43, .9));
  opacity: 0;
  offset-distance: 0%;
}
@keyframes ymMapArcRun {
  0%  { offset-distance: 0%; opacity: 1; animation-timing-function: ease-out; }
  21% { offset-distance: 100%; opacity: 1; }
  24% { opacity: 0; }
  100% { offset-distance: 100%; opacity: 0; }
}
/* 城市光点：本站蓝（比航线金深一档的蓝，落点读作「市场」）；白描边让点在陆地上成点 */
.ym-map-city { pointer-events: auto; }
.ym-map-hit { fill: transparent; }  /* 透明大圆：小光点也容易悬停到 */
.ym-map-dot {
  fill: #6196c3;
  stroke: #fff;
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  transition: r .3s ease;
}
.ym-map-city:hover .ym-map-dot,
.ym-map-city:focus-visible .ym-map-dot { r: 10; }
@keyframes ymMapDotBreathe { 0%, 100% { scale: 1; } 50% { scale: 1.18; } }
@keyframes ymMapDotFlash { 0% { transform: scale(1); } 1.5% { transform: scale(1.9); } 6% { transform: scale(1.15); } 100% { transform: scale(1); } }
/* 到站脉冲环：平时不可见，仅到站瞬间外扩一圈（比光点深一档的蓝） */
.ym-map-pulse {
  fill: none;
  stroke: #2b72b1;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}
@keyframes ymMapHitRing {
  0% { transform: scale(.6); opacity: 0; }
  1% { opacity: .9; }
  8% { transform: scale(2.9); opacity: 0; }
  100% { transform: scale(2.9); opacity: 0; }
}
/* 城市标签：白底圆角衬底 + 单行「城市 · 国家」，默认隐藏、悬停显示（同 feichuang）；
   衬底宽度由生成脚本按文字长度估算（34px × 约 0.58em/字符 + 左右各 23），字号改了要同步改脚本 */
.ym-map-label { opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.ym-map-label rect { fill: #fff; stroke: #d9e2ea; }
.ym-map-label text {
  fill: #173c56;
  text-anchor: middle;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: .02em;
}
.ym-map-city:hover .ym-map-label,
.ym-map-city:focus-visible .ym-map-label { opacity: 1; }

/* 出发点标记：金点 + 三道静态信号环 + 一道外扩脉冲环，环朝标签一侧开槽不压文字（同 feichuang） */
.ym-map-marker {
  --ring-1: 34px;
  --ring-2: 64px;
  --ring-3: 96px;
  --slot: 10px;
  position: absolute;
  pointer-events: none;
}
.ym-map-marker-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #b37c20;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(179, 124, 32, .45);
}
.ym-map-marker .ym-map-ring,
.ym-map-marker .ym-map-ping {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--r);
  height: var(--r);
  transform: translate(-50%, -50%);
  border: 1px solid #b37c20;
  border-radius: 50%;
  /* 向右开槽：环在标签那一侧断开 */
  clip-path: polygon(0 0, 100% 0, 100% calc(50% - var(--slot)), 50% calc(50% - var(--slot)), 50% calc(50% + var(--slot)), 100% calc(50% + var(--slot)), 100% 100%, 0 100%);
}
.ym-map-marker .ym-map-ring--1 { --r: var(--ring-1); opacity: .4; }
.ym-map-marker .ym-map-ring--2 { --r: var(--ring-2); opacity: .22; }
.ym-map-marker .ym-map-ring--3 { --r: var(--ring-3); opacity: .12; }
.ym-map-marker .ym-map-ping {
  --r: var(--ring-3);
  opacity: 0;
  animation: ymMapPing 2.8s ease-out infinite;
}
@keyframes ymMapPing {
  from { transform: translate(-50%, -50%) scale(.3); opacity: .5; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
.ym-map-marker-label {
  position: absolute;
  left: 15px;
  top: 0;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: .72rem;
  letter-spacing: .2em;
  color: #173c56;
}

/* ≤1080px：环收一档；≤720px：地图约 350px 宽，弧线加粗、光点/脉冲环加大保可见度（触屏无悬停，标签本就不出现） */
@media (max-width: 1080px) {
  .ym-map-marker { --ring-1: 28px; --ring-2: 52px; --ring-3: 80px; }
}
@media (max-width: 720px) {
  .ym-map-marker { --ring-1: 22px; --ring-2: 36px; --ring-3: 54px; }
  .ym-map-marker-label { font-size: .66rem; letter-spacing: .16em; }
  .ym-map-arc { stroke-width: 4.5; }
  .ym-map-dot { r: 12; stroke-width: 2.5; }
  .ym-map-city:hover .ym-map-dot,
  .ym-map-city:focus-visible .ym-map-dot { r: 16; }
  .ym-map-pulse { r: 20; }
}
/* 减少动态效果：退化为静态地图——航线全部完整显示，滑行光点/呼吸/爆亮/脉冲全部停用 */
@media (prefers-reduced-motion: reduce) {
  .ym-map-arc, .ym-map-runner, .ym-map-dot, .ym-map-pulse, .ym-map-marker .ym-map-ping { animation: none !important; }
}
