/* Shanyu strategy layer: first-baiyue hubs, lightweight tools, and ad slots. */

.shanyu-section {
  padding: 56px 12px;
}

.shanyu-section-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.shanyu-section-kicker {
  margin: 0 0 8px;
  color: var(--primary-600, #b84e2e);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.shanyu-section-title {
  margin: 0;
  color: var(--text-primary, #1c1917);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

.shanyu-section-lede {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--text-secondary, #5c5751);
  font-size: 17px;
  line-height: 1.75;
}

.shanyu-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.shanyu-card,
.route-card,
.tool-panel {
  border: 1px solid var(--border-light, #e8e6e3);
  border-radius: 8px;
  background: var(--bg-elevated, #fff);
  box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.06));
}

.shanyu-card {
  grid-column: span 4;
  padding: 22px;
}

.shanyu-card h3,
.route-card h3,
.tool-panel h2 {
  margin: 0;
  color: var(--text-primary, #1c1917);
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: 0;
}

.shanyu-card p,
.route-card p,
.tool-panel p {
  margin: 10px 0 0;
  color: var(--text-secondary, #5c5751);
  font-size: 15px;
  line-height: 1.7;
}

.shanyu-card-link,
.shanyu-button,
.tool-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.shanyu-card-link {
  margin-top: 16px;
  color: var(--primary-600, #b84e2e);
  font-size: 15px;
  font-weight: 700;
}

.shanyu-card-link:hover,
.shanyu-card-link:focus-visible {
  color: var(--primary-800, #7d311a);
}

.shanyu-button,
.tool-action {
  border: 1px solid var(--primary-500, #d1603d);
  background: var(--primary-500, #d1603d);
  color: #fff;
  padding: 10px 16px;
  font-weight: 700;
}

.shanyu-button:hover,
.tool-action:hover {
  background: var(--primary-600, #b84e2e);
  border-color: var(--primary-600, #b84e2e);
  color: #fff;
}

.shanyu-button.secondary,
.tool-action.secondary {
  background: #fff;
  color: var(--primary-700, #9a3e22);
}

.shanyu-button.secondary:hover,
.tool-action.secondary:hover {
  background: var(--primary-50, #fef5f2);
  color: var(--primary-800, #7d311a);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.home-journey-step {
  position: relative;
}

.home-journey-step::before {
  content: attr(data-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--primary-100, #fde8e0);
  color: var(--primary-700, #9a3e22);
  font-size: 14px;
  font-weight: 800;
}

.tool-hero {
  padding: 64px 12px 32px;
  background: linear-gradient(180deg, var(--primary-50, #fef5f2), var(--bg-primary, #fafaf9));
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 24px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 12px 72px;
}

.tool-panel {
  padding: 22px;
}

.tool-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.tool-field {
  display: grid;
  gap: 7px;
}

.tool-field label {
  color: var(--text-primary, #1c1917);
  font-size: 14px;
  font-weight: 700;
}

.tool-field input,
.tool-field select,
.tool-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-default, #d4d1cc);
  border-radius: 8px;
  background: #fff;
  color: var(--text-primary, #1c1917);
  font: inherit;
  padding: 10px 12px;
}

.tool-field textarea {
  min-height: 116px;
  resize: vertical;
}

.tool-field input:focus-visible,
.tool-field select:focus-visible,
.tool-field textarea:focus-visible,
.tool-action:focus-visible,
.shanyu-button:focus-visible {
  outline: 3px solid rgba(209, 96, 61, 0.35);
  outline-offset: 2px;
}

.tool-output {
  min-height: 420px;
  font-family: var(--font-mono, Menlo, Consolas, monospace);
  white-space: pre-wrap;
}

.tool-status {
  min-height: 26px;
  color: var(--text-secondary, #5c5751);
  font-size: 14px;
  line-height: 1.6;
}

.tool-status[data-state="ready"] {
  color: #047857;
}

.tool-status[data-state="missing"] {
  color: var(--primary-700, #9a3e22);
}

.route-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.route-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.route-card {
  padding: 20px;
}

.route-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.route-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: var(--neutral-100, #f5f4f2);
  color: var(--text-secondary, #5c5751);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.route-pill.verified {
  background: #dcfce7;
  color: #166534;
}

.route-pill.external {
  background: #e0f2fe;
  color: #075985;
}

.route-pill.missing {
  background: var(--primary-100, #fde8e0);
  color: var(--primary-700, #9a3e22);
}

.route-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.shanyu-ad {
  max-width: 720px;
  min-height: 96px;
  margin: 28px auto;
  padding: 12px;
  border: 1px solid var(--border-light, #e8e6e3);
  border-radius: 8px;
  background: var(--bg-secondary, #f5f4f2);
}

.shanyu-ad-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted, #78736d);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .shanyu-card {
    grid-column: span 6;
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }

  .route-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shanyu-section {
    padding: 40px 12px;
  }

  .shanyu-section-title {
    font-size: 24px;
  }

  .shanyu-card {
    grid-column: 1 / -1;
  }

  .hero-actions,
  .route-card-actions {
    flex-direction: column;
  }

  .shanyu-button,
  .tool-action {
    width: 100%;
  }

  .route-filter-bar {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   百岳地圖頁面 (custom-baiyue-map.hbs)
   ============================================================ */

/* Hero */
.map-hero {
  padding: 56px 12px 40px;
  background: linear-gradient(160deg, #1c2b1e 0%, #2d3a24 60%, #3b3228 100%);
  color: #fff;
}

.map-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.map-hero .shanyu-section-kicker {
  color: #86c996;
}

.map-hero .shanyu-section-title {
  color: #fff;
  font-size: 32px;
}

.map-hero .shanyu-section-lede {
  color: rgba(255, 255, 255, 0.72);
}

/* Stats bar */
.map-stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 32px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  width: fit-content;
}

.map-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
}

.map-stat-number {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.map-stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
}

.map-stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.18);
}

/* Explorer section */
.map-explorer {
  background: var(--bg-primary, #fafaf9);
  border-bottom: 1px solid var(--border-light, #e8e6e3);
}

.map-explorer-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 12px;
}

/* Taiwan SVG */
.map-taiwan-wrap {
  position: sticky;
  top: 72px;
}

.map-taiwan-container {
  position: relative;
  display: flex;
  justify-content: center;
}

.taiwan-svg {
  width: 100%;
  max-width: 240px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.taiwan-outline {
  fill: #e8ede9;
  stroke: #b8c4ba;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

/* Peak dots */
.peak-dot {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 1.2;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
  transition: opacity 0.2s, transform 0.15s;
  transform-box: fill-box;
  transform-origin: center;
}

.peak-dot.level-1 { fill: #16a34a; }
.peak-dot.level-2 { fill: #d97706; }
.peak-dot.level-3 { fill: #dc2626; }

.peak-dot:hover,
.peak-dot:focus-visible {
  transform: scale(1.35);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  outline: none;
}

.peak-dot:focus-visible {
  stroke: var(--primary-500, #d1603d);
  stroke-width: 2.5;
}

.peak-dot.dimmed {
  opacity: 0.12;
  pointer-events: none;
}

/* Map tooltip */
.map-tooltip {
  position: fixed;
  z-index: 300;
  padding: 8px 12px;
  background: rgba(28, 27, 23, 0.92);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.map-tooltip strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

/* Map legend */
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary, #5c5751);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.legend-dot.level-1 { background: #16a34a; }
.legend-dot.level-2 { background: #d97706; }
.legend-dot.level-3 { background: #dc2626; }

.legend-size {
  color: var(--text-muted, #78736d);
  font-style: italic;
}

/* Chip filters */
.map-filters-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.map-filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #1c1917);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--border-default, #d4d1cc);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary, #5c5751);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, color 150ms, box-shadow 150ms;
}

.map-chip:hover {
  border-color: var(--primary-400, #e07856);
  color: var(--primary-700, #9a3e22);
}

.map-chip.active {
  border-color: var(--primary-500, #d1603d);
  background: var(--primary-500, #d1603d);
  color: #fff;
  box-shadow: 0 2px 6px rgba(209, 96, 61, 0.3);
}

.map-chip:focus-visible {
  outline: 3px solid rgba(209, 96, 61, 0.35);
  outline-offset: 2px;
}

.map-result-count {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #5c5751);
}

.map-extra-content {
  border-top: 1px solid var(--border-light, #e8e6e3);
  padding-top: 16px;
  font-size: 14px;
  color: var(--text-secondary, #5c5751);
}

/* Cards section */
.map-cards-section {
  padding: 32px 12px 72px;
  background: var(--bg-secondary, #f5f4f2);
}

.map-cards-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.map-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.map-card-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary, #5c5751);
  background: #fff;
  border: 1px solid var(--border-light, #e8e6e3);
  border-radius: 12px;
}

/* Individual card */
.map-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border-light, #e8e6e3);
  border-left: 4px solid transparent;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: box-shadow 180ms, transform 180ms, border-color 180ms;
  text-align: left;
}

.map-card:hover,
.map-card:focus-visible {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  outline: none;
}

.map-card:focus-visible {
  outline: 3px solid rgba(209, 96, 61, 0.4);
  outline-offset: 2px;
}

.map-card[data-level="1"] { border-left-color: #16a34a; }
.map-card[data-level="2"] { border-left-color: #d97706; }
.map-card[data-level="3"] { border-left-color: #dc2626; }

.map-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-card-region {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary, #5c5751);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-card-days {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.map-card-days.days-1 { background: #dcfce7; color: #15803d; }
.map-card-days.days-2 { background: #fef9c3; color: #854d0e; }
.map-card-days.days-3 { background: #fee2e2; color: #991b1b; }

.map-card-name {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary, #1c1917);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.map-card-summary {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #5c5751);
  line-height: 1.6;
  flex: 1;
}

.map-card-stats {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-light, #e8e6e3);
  border-radius: 8px;
  overflow: hidden;
}

.map-card-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  gap: 2px;
  border-right: 1px solid var(--border-light, #e8e6e3);
}

.map-card-stat:last-child { border-right: none; }

.stat-label {
  font-size: 11px;
  color: var(--text-muted, #78736d);
  font-weight: 600;
}

.stat-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #1c1917);
}

/* Elevation bar */
.map-card-elev-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-card-elev-bar {
  height: 6px;
  background: var(--neutral-100, #f5f4f2);
  border-radius: 999px;
  overflow: hidden;
}

.map-card-elev-fill {
  height: 100%;
  background: linear-gradient(90deg, #6b7280, #374151);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.map-card-elev-label {
  font-size: 11px;
  color: var(--text-muted, #78736d);
  text-align: right;
}

/* Card footer */
.map-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.map-card-level {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.map-card-level.level-1 { background: #dcfce7; color: #15803d; }
.map-card-level.level-2 { background: #fef3c7; color: #92400e; }
.map-card-level.level-3 { background: #fee2e2; color: #991b1b; }

/* Difficulty dots */
.diff-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.diff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neutral-200, #e5e2de);
  transition: background 0.2s;
}

.diff-dot.filled {
  background: var(--text-primary, #1c1917);
}

.map-card-gpx {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.map-card-gpx.gpx-verified { background: #dcfce7; color: #15803d; }
.map-card-gpx.gpx-external { background: #dbeafe; color: #1d4ed8; }
.map-card-gpx.gpx-missing { background: var(--primary-100, #fde8e0); color: var(--primary-700, #9a3e22); }

/* ── Detail Panel ──────────────────────────────────────────────── */
.map-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(28, 27, 23, 0);
  transition: background 0.3s;
  pointer-events: none;
}

.map-detail-overlay.visible {
  background: rgba(28, 27, 23, 0.5);
  pointer-events: auto;
}

.map-detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  width: 440px;
  max-width: 100vw;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  visibility: hidden;
}

.map-detail-panel.open {
  transform: translateX(0);
  visibility: visible;
}

.map-detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-default, #d4d1cc);
  border-radius: 50%;
  background: #fff;
  color: var(--text-primary, #1c1917);
  font-size: 16px;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  line-height: 1;
}

.map-detail-close:hover {
  background: var(--neutral-100, #f5f4f2);
  border-color: var(--border-default, #d4d1cc);
}

.map-detail-close:focus-visible {
  outline: 3px solid rgba(209, 96, 61, 0.35);
  outline-offset: 2px;
}

.map-detail-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.map-detail-content {
  padding: 48px 24px 40px;
}

/* Panel content styles */
.detail-name {
  margin: 8px 0 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary, #1c1917);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.detail-summary {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text-secondary, #5c5751);
  line-height: 1.7;
}

.detail-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light, #e8e6e3);
}

.detail-sec-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted, #78736d);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail-stat {
  padding: 12px;
  background: var(--bg-secondary, #f5f4f2);
  border-radius: 8px;
  text-align: center;
}

.detail-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary, #1c1917);
  line-height: 1;
}

.detail-stat-label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary, #5c5751);
}

.detail-elev-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-elev-bar {
  height: 8px;
  background: var(--neutral-100, #f5f4f2);
  border-radius: 999px;
  overflow: hidden;
}

.detail-elev-fill {
  height: 100%;
  background: linear-gradient(90deg, #6b7280, #1c1917);
  border-radius: 999px;
}

.detail-elev-label {
  font-size: 12px;
  color: var(--text-muted, #78736d);
  text-align: right;
}

.detail-diff-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-diff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.diff-row-label {
  font-size: 14px;
  color: var(--text-secondary, #5c5751);
  min-width: 72px;
}

.detail-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-secondary, #5c5751);
  line-height: 1.6;
}

.detail-note.small {
  font-size: 12px;
  color: var(--text-muted, #78736d);
}

.detail-permit {
  margin-bottom: 14px;
}

.detail-permit-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1c1917);
}

.permit-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.permit-badge.required { background: #fee2e2; color: #991b1b; }
.permit-badge.ok { background: #dcfce7; color: #15803d; }

.detail-permit-note {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary, #5c5751);
  line-height: 1.6;
}

.detail-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-600, #b84e2e);
  text-decoration: none;
}

.detail-link:hover { color: var(--primary-800, #7d311a); }

.detail-trailhead {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-secondary, #5c5751);
  line-height: 1.6;
}

.detail-transport {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-transport-row {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary, #5c5751);
  line-height: 1.6;
}

.transport-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.detail-logistics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-logistics-row {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary, #5c5751);
  line-height: 1.6;
}

.logistics-label {
  font-weight: 700;
  color: var(--text-primary, #1c1917);
  min-width: 36px;
  flex-shrink: 0;
}

.detail-gpx-status {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-secondary, #5c5751);
}

.detail-gpx-btn {
  display: inline-flex;
  margin-top: 12px;
}

.detail-gpx-na {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted, #78736d);
}

.detail-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* WIP notice for basic peaks */
.detail-wip {
  padding: 20px;
  background: var(--neutral-100, #f5f4f2);
  border-radius: 10px;
  text-align: center;
}

.detail-wip-icon {
  font-size: 28px;
  margin: 0 0 8px;
}

.detail-wip-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #1c1917);
}

.detail-wip-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #5c5751);
  line-height: 1.6;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light, #e8e6e3);
}

/* body lock when panel open */
body.panel-open {
  overflow: hidden;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .map-explorer-inner {
    grid-template-columns: 1fr;
  }

  .map-taiwan-wrap {
    position: static;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: start;
  }

  .map-taiwan-container {
    width: 160px;
  }

  .map-legend {
    justify-content: flex-start;
    margin-top: 0;
    padding-top: 4px;
  }

  .map-card-grid {
    grid-template-columns: 1fr;
  }

  .map-detail-panel {
    width: 100%;
    top: auto;
    bottom: 0;
    height: 90vh;
    transform: translateY(110%);
    border-radius: 16px 16px 0 0;
  }

  .map-detail-panel.open {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .map-hero .shanyu-section-title {
    font-size: 26px;
  }

  .map-stats-bar {
    flex-wrap: wrap;
    gap: 16px 0;
    width: 100%;
  }

  .map-stat {
    flex: 1;
    min-width: 80px;
  }

  .map-stat-divider {
    display: none;
  }

  .map-taiwan-wrap {
    grid-template-columns: 1fr;
  }

  .map-taiwan-container {
    width: 100%;
  }

  .taiwan-svg {
    max-width: 180px;
  }
}

/* ============================================================
   Magazine Infographic Cards (百岳地圖 v2)
   ============================================================ */

/* Sticky filter bar */
.mfilter-bar {
  position: sticky;
  top: 56px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light, #e8e6e3);
}

.mfilter-bar-inner {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mfilter-bar-inner::-webkit-scrollbar { display: none; }

.mfilter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mfilter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #78736d);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 2px;
  white-space: nowrap;
}

.mfilter-sep {
  width: 1px;
  height: 24px;
  background: var(--border-default, #d4d1cc);
  margin: 0 12px;
  flex-shrink: 0;
}

.mfilter-count {
  margin: 0 0 0 auto;
  padding-left: 16px;
  font-size: 13px;
  color: var(--text-muted, #78736d);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Magazine grid */
.mcard-section {
  padding: 24px 20px 80px;
  background: #111;
  min-height: 60vh;
}

.mcard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.mcard-empty {
  grid-column: 1 / -1;
  padding: 64px 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
}

/* Individual card */
.mcard {
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mcard[data-featured="true"] {
  grid-column: span 2;
}

.mcard:hover,
.mcard:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.mcard:focus-visible {
  box-shadow: 0 0 0 3px rgba(209, 96, 61, 0.6), 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* Photo layer */
.mcard-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.mcard[data-featured="true"] .mcard-photo {
  aspect-ratio: 16 / 9;
}

/* Gradient overlay for text readability */
.mcard-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0) 35%,
    rgba(0, 0, 0, 0.3) 55%,
    rgba(0, 0, 0, 0.85) 100%
  );
  z-index: 1;
}

/* Regional gradient fallbacks (no photo) — bright enough to read on #111 bg */
.mcard-photo.region-north {
  background: linear-gradient(160deg, #1e3f6b 0%, #2d5fa0 40%, #3b7abf 70%, #2a5e96 100%);
}
.mcard-photo.region-central {
  background: linear-gradient(160deg, #1a4025 0%, #286035 50%, #357a42 80%, #205230 100%);
}
.mcard-photo.region-south {
  background: linear-gradient(160deg, #4a2208 0%, #7a3a12 40%, #9a5018 70%, #7a3810 100%);
}

/* Top bar: badge + days */
.mcard-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}

.mcard-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

.mcard-badge.level-1 { background: rgba(22, 163, 74, 0.85); color: #fff; }
.mcard-badge.level-2 { background: rgba(217, 119, 6, 0.85); color: #fff; }
.mcard-badge.level-3 { background: rgba(220, 38, 38, 0.85); color: #fff; }

.mcard-days {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Mini Taiwan map */
.mcard-minimap {
  position: absolute;
  top: 48px;
  right: 14px;
  width: 42px;
  height: 76px;
  z-index: 3;
  opacity: 0.85;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  transition: opacity 0.2s;
}

.mcard:hover .mcard-minimap,
.mcard:focus-visible .mcard-minimap {
  opacity: 1;
}

.minimap-svg {
  width: 100%;
  height: 100%;
}

.minimap-outline {
  fill: rgba(255, 255, 255, 0.25);
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 6;
  stroke-linejoin: round;
}

.minimap-dot {
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

/* Elevation profile */
.mcard-profile {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 88px;
  height: 64px;
  z-index: 2;
  pointer-events: none;
}

.mcard-profile svg {
  width: 100%;
  height: 100%;
}

.prof-fill {
  fill: rgba(255, 255, 255, 0.07);
}

.prof-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.65);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

.mcard[data-featured="true"] .prof-line {
  stroke-width: 3;
}

/* Info overlay at bottom */
.mcard-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 16px 16px;
  z-index: 3;
}

.mcard-name {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.mcard[data-featured="true"] .mcard-name {
  font-size: 28px;
}

/* Numbers row */
.mcard-numbers {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-bottom: 10px;
}

.mcard-num {
  display: flex;
  flex-direction: column;
  padding-right: 14px;
  margin-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.mcard-num:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}

.mcard-num-val {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.mcard[data-featured="true"] .mcard-num-val {
  font-size: 24px;
}

.mcard-num-unit {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 1px;
  vertical-align: baseline;
}

.mcard-num-key {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  white-space: nowrap;
}

.mcard-num-divider {
  display: none;
}

/* Meta tags row */
.mcard-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mcard-region-tag {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mcard-gpx-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.mcard-gpx-tag.gpx-v { background: rgba(22, 163, 74, 0.6); color: #d1fae5; }
.mcard-gpx-tag.gpx-e { background: rgba(59, 130, 246, 0.5); color: #dbeafe; }
.mcard-gpx-tag.gpx-n { background: rgba(209, 96, 61, 0.5); color: #fde8e0; }

.mcard-elev-pct {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .mcard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .mcard-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mcard[data-featured="true"] {
    grid-column: span 1;
  }

  .mcard[data-featured="true"] .mcard-photo {
    aspect-ratio: 4 / 3;
  }

  .mfilter-bar-inner {
    gap: 0;
    padding: 8px 12px;
  }

  .mfilter-sep {
    margin: 0 8px;
  }

  .mfilter-count {
    display: none;
  }

  .mcard-name {
    font-size: 20px;
  }

  .mcard[data-featured="true"] .mcard-name {
    font-size: 22px;
  }

  .mcard-num-val {
    font-size: 17px;
  }
}

@media print {
  .header,
  footer,
  .tool-panel:first-child,
  .shanyu-ad,
  .reading-progress {
    display: none !important;
  }

  .tool-layout {
    display: block;
    padding: 0;
  }

  .tool-panel {
    border: 0;
    box-shadow: none;
  }

  .tool-output {
    min-height: auto;
    border: 0;
  }
}
