/* 历史舆图 · 交互页样式。样式令牌沿用站点 style.css，勿在页面内手改主题色。 */
.atlas-app[hidden] { display: none; }
.atlas-app { scroll-margin-top: calc(var(--header-h, 56px) + 16px); }
.atlas-js .atlas-fallback { display: none; }

.atlas-stagebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.atlas-stage-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.atlas-stage-btn:hover { border-color: var(--accent); color: var(--accent); }
.atlas-stage-btn.is-active { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.atlas-stage-btn .atlas-stage-count { opacity: .72; margin-left: 5px; font-size: var(--text-xs); }
.atlas-stage-meta { margin: 0 0 12px; color: var(--muted, #7a7165); font-size: var(--text-sm); }

.atlas-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 16px;
  align-items: start;
}
.atlas-map-wrap {
  position: relative;
  min-height: 580px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 32% 18%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--bg));
}
.atlas-svg { display: block; width: 100%; height: 100%; min-height: 580px; touch-action: none; cursor: grab; }
.atlas-svg.is-dragging { cursor: grabbing; }
.atlas-grid-line { stroke: var(--border); stroke-width: .7; opacity: .65; }
.atlas-grid-label { fill: var(--muted, #8a8070); font-size: 9px; opacity: .8; }
.atlas-land { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.4; stroke-linejoin: round; }
.atlas-island { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.1; }
.atlas-river { fill: none; stroke: #6f9fb8; stroke-width: 1.5; opacity: .85; }
[data-theme="dark"] .atlas-river { stroke: #6aa6c4; }
.atlas-mountain { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 4; opacity: .7; }
.atlas-feature-name { fill: var(--muted, #8a8070); font-size: 10px; letter-spacing: .08em; }
.atlas-journey-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-dasharray: 7 6; opacity: 0; }
.atlas-journey-line.is-on { opacity: .95; animation: atlas-dash 18s linear infinite; }
@keyframes atlas-dash { to { stroke-dashoffset: -260; } }

.atlas-place { cursor: pointer; }
.atlas-place .atlas-dot { fill: var(--accent-solid); stroke: var(--surface); stroke-width: 1.4; }
.atlas-place .atlas-ring { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 3; opacity: .75; }
.atlas-place .atlas-label {
  fill: var(--text); font-size: 11px; font-weight: 600;
  paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round;
}
.atlas-place.is-active .atlas-dot { fill: #c4452f; stroke-width: 2; }
[data-theme="dark"] .atlas-place.is-active .atlas-dot { fill: #f08268; }
.atlas-place.is-active .atlas-label { fill: #c4452f; font-size: 12px; }
.atlas-place.is-related .atlas-dot { fill: var(--accent); stroke-width: 2; }
.atlas-place.is-dim { opacity: .72; }
.atlas-place.is-quiz-target .atlas-ring { stroke: #c4452f; stroke-width: 2; stroke-dasharray: none; }

.atlas-map-tools {
  position: absolute; right: 12px; top: 12px;
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end;
  max-width: 240px;
}
.atlas-map-tools button {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: var(--radius-sm); padding: 5px 9px; font: inherit; font-size: var(--text-xs); cursor: pointer;
}
.atlas-map-tools button:hover { border-color: var(--accent); color: var(--accent); }
.atlas-scale {
  position: absolute; left: 14px; bottom: 12px;
  font-size: var(--text-xs); color: var(--muted, #8a8070);
}
.atlas-scale i { display: inline-block; width: 56px; height: 6px; border: 1px solid var(--border-strong); border-top: 0; margin-right: 6px; }
.atlas-legend {
  position: absolute; right: 12px; bottom: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: var(--text-xs); color: var(--muted, #8a8070);
  line-height: 1.7;
}
.atlas-legend b { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-solid); margin-right: 5px; }
.atlas-legend em { display: inline-block; width: 8px; height: 8px; border: 1px dashed var(--accent); border-radius: 50%; margin-right: 5px; }

.atlas-sidebar { display: flex; flex-direction: column; gap: 12px; }
.atlas-panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 14px 16px;
}
.atlas-panel h2, .atlas-panel h3 { margin: 0 0 8px; font-size: 1.05rem; }
.atlas-panel p { margin: 0 0 8px; font-size: var(--text-sm); line-height: 1.7; }
.atlas-panel .atlas-eyebrow { color: var(--accent); font-size: var(--text-xs); letter-spacing: .12em; }
.atlas-event-year { font-size: 1.6rem; font-weight: 800; color: var(--accent); line-height: 1.2; }
.atlas-event-title { font-size: 1.15rem; margin: 4px 0 6px; }
.atlas-tag {
  display: inline-block; border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  padding: 1px 8px; margin: 0 4px 6px 0; font-size: var(--text-xs); color: var(--muted, #7a7165);
}
.atlas-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.atlas-links a { font-size: var(--text-sm); font-weight: 600; }
.atlas-nav-row { display: flex; gap: 8px; margin-top: 12px; }
.atlas-nav-row button {
  flex: 1; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
  border-radius: var(--radius-sm); padding: 7px; font: inherit; font-size: var(--text-sm); cursor: pointer;
}
.atlas-nav-row button:hover { border-color: var(--accent); color: var(--accent); }
.atlas-event-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.atlas-event-chip {
  flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: var(--radius-pill); padding: 5px 11px; font: inherit; font-size: var(--text-xs); cursor: pointer;
  white-space: nowrap;
}
.atlas-event-chip:hover { border-color: var(--accent); }
.atlas-event-chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 700; }
.atlas-mini-list { margin: 6px 0 0; padding-left: 18px; font-size: var(--text-sm); line-height: 1.8; }
.atlas-mini-list a { color: var(--accent); }
.atlas-quiz-q { font-weight: 700; margin: 6px 0 10px; line-height: 1.6; }
.atlas-quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.atlas-quiz-options button {
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 6px; font: inherit; font-size: var(--text-sm); cursor: pointer;
}
.atlas-quiz-options button.correct { border-color: #3c8a5b; background: rgba(60, 138, 91, .12); color: #3c8a5b; }
.atlas-quiz-options button.wrong { border-color: #c4452f; background: rgba(196, 69, 47, .1); color: #c4452f; }
.atlas-quiz-feedback { min-height: 22px; margin-top: 8px; font-size: var(--text-sm); color: var(--muted, #7a7165); }
.atlas-journey-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.atlas-journey-btns button {
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
  border-radius: var(--radius-sm); padding: 6px 9px; font: inherit; font-size: var(--text-xs); cursor: pointer;
}
.atlas-journey-btns button.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.atlas-tip { margin-top: 14px; font-size: var(--text-xs); color: var(--muted, #8a8070); line-height: 1.7; }
.atlas-fallback { display: grid; gap: 16px; }
.atlas-fallback section h2 { font-size: 1.15rem; }
.atlas-fallback ul { line-height: 1.9; }

@media (max-width: 1024px) {
  .atlas-shell { grid-template-columns: 1fr; }
  .atlas-map-wrap, .atlas-svg { min-height: 460px; }
}
@media (max-width: 768px) {
  /* 地名字号由 atlas.js 按当前缩放换算写入行内样式；这里只隐藏过小的经纬网标注 */
  .atlas-grid-label { display: none; }
  .atlas-feature-name { font-size: 22px; }
}
@media (max-width: 480px) {
  .atlas-map-wrap, .atlas-svg { min-height: 380px; }
  .atlas-legend { display: none; }
  .atlas-map-tools { max-width: 180px; }
}
