/* ============================================================
   地图样式 — 只负责 .map-root 内部；页面级样式由 style.css 负责
   ============================================================ */

.map-root {
  --canvas: #ffffff;
  --canvas-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-muted: #6e6e73;
  --hairline: #d2d2d7;
  --accent: #0066cc;
  --map-radius: 18px;

  display: block;
  width: 100%;
}

/* ── 工具条 ── */
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.map-toolbar.is-empty {
  display: none;
}

.map-chip {
  appearance: none;
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 15px;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.map-chip:hover {
  border-color: #b9b9c0;
  background: var(--canvas-alt);
}

.map-chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--canvas);
}

.map-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── 画布 ── */
.map-frame {
  position: relative;
  border-radius: var(--map-radius);
  overflow: hidden;
  background: var(--canvas-alt);
  border: 1px solid rgba(210, 210, 215, .55);
}

.map-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ── 陆地与文字 ── */
.land {
  fill: #ffffff;
  stroke: #c8ced6;
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.aside-label {
  fill: rgba(29, 29, 31, .42);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 2.1px;
  pointer-events: none;
  user-select: none;
}

.sea-name {
  fill: rgba(29, 29, 31, .30);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 4.5px;
  pointer-events: none;
  user-select: none;
}

/* ── 路线 ── */
.path-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.path-line[data-mode="air"] {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 9 8;
}

.path-line[data-mode="train"] {
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-dasharray: none;
}

.path-line[data-mode="bus"] {
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-dasharray: 3 6;
}

.path-line[data-mode="ferry"] {
  stroke: #0b7285;
  stroke-width: 2.4;
  stroke-dasharray: 2 5;
}

.path-line[data-mode="ground"] {
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-dasharray: none;
}

/* 火车枕木：叠在白线之上的细虚线 */
.path-rail {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-dasharray: 2 6;
  stroke-linecap: butt;
  pointer-events: none;
}

/* 飞行光点 */
.flight {
  pointer-events: none;
}

.flight-dot {
  fill: var(--accent);
}

.flight-glow {
  fill: var(--accent);
  opacity: .22;
}

/* ── 交通方式图标 ── */
.seg-badge {
  pointer-events: none;
}

.seg-badge-bg {
  fill: var(--canvas);
  stroke: var(--hairline);
  stroke-width: 1;
}

.seg-icon-part {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.seg-icon-part.is-solid {
  fill: var(--ink-muted);
  stroke: none;
}

.seg[data-mode="air"] .seg-icon-part {
  stroke: var(--accent);
  fill: none;
}

.seg[data-mode="air"] .seg-icon-part.is-solid {
  fill: var(--accent);
  stroke: none;
}

.seg[data-mode="ferry"] .seg-icon-part {
  stroke: #0b7285;
  fill: none;
}

.seg[data-mode="ferry"] .seg-icon-part.is-solid {
  fill: #0b7285;
  stroke: none;
}

.seg-mode {
  fill: var(--ink-muted);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .5px;
  pointer-events: none;
  user-select: none;
}

/* ── 站点节点 ── */
.node {
  cursor: pointer;
  transition: opacity .25s ease;
}

.node:focus {
  outline: none;
}

.node-halo {
  fill: var(--accent);
  opacity: .10;
  transition: opacity .2s ease, r .2s ease;
}

.node-core {
  fill: var(--ink);
  stroke: var(--canvas);
  stroke-width: 2.5;
}

.node-num {
  fill: var(--canvas);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  pointer-events: none;
  user-select: none;
}

.node-label {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  pointer-events: none;
  user-select: none;
  /* 白描边：线路/图标从文字下方穿过时字仍然清楚 */
  paint-order: stroke fill;
  stroke: var(--canvas);
  stroke-width: 3.2px;
  stroke-linejoin: round;
}

.node-sub {
  fill: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .08em;
  pointer-events: none;
  user-select: none;
  paint-order: stroke fill;
  stroke: var(--canvas);
  stroke-width: 2.8px;
  stroke-linejoin: round;
}

.node:hover .node-halo,
.node:focus-visible .node-halo {
  opacity: .2;
}

.node:focus-visible .node-core {
  stroke: var(--accent);
}

.node.is-dim {
  opacity: .28;
}

.node.is-active .node-halo {
  opacity: .22;
}

.node.is-active .node-core {
  fill: var(--accent);
}

/* ── 说明文字 ── */
.map-caption {
  margin: 12px 2px 0;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ── 减少动态 ── */
@media (prefers-reduced-motion: reduce) {
  .map-chip {
    transition: none;
  }

  .node,
  .node-halo {
    transition: none;
  }

  .flight {
    display: none;
  }
}
