/* =====================================================
   地球史栏目 · 地图视图补充样式（浅色，复用主界面 CSS 变量）
   —— 供「地球诞生 / 地质变迁 / 物种演化」三栏共用。
   —— 主界面视觉由 css/style.css + style_new.css + mobile-adapt.css 提供，
      本文件只补地球史特有的：详情弹窗、列表徽标、深时提示、Leaflet 图钉。
   —— 全部用 var(--bg-card / --text-primary / --border ...) 实现 data-theme 自适应。
   ===================================================== */

/* -----------------------------------------------------
   分类按钮：激活色跟随数据里的分类颜色（--cat 由 JS 注入）
   ----------------------------------------------------- */
.filter-btn.active {
  background: var(--cat, var(--primary)) !important;
  border-color: var(--cat, var(--primary)) !important;
  color: #fff !important;
}

/* -----------------------------------------------------
   列表徽标：存疑（琥珀）/ 辨析（青蓝）
   ----------------------------------------------------- */
.event-item-flags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gh-flag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.5;
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}
[data-theme="dark"] .gh-flag { color: #fbbf24; }

.gh-flag-note {
  background: rgba(14, 165, 233, 0.16);
  color: #0369a1;
}
[data-theme="dark"] .gh-flag-note { color: #7dd3fc; }

/* -----------------------------------------------------
   空态提示
   ----------------------------------------------------- */
.gh-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

/* 栏目简介（空数据时显示在「筹备中」下方，让访客一眼知晓本栏讲什么） */
.gh-intro {
  margin: 0 12px 8px;
  padding: 14px 14px 0;
  border-top: 1px dashed var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.8;
  text-align: left;
}

/* -----------------------------------------------------
   Leaflet 降级图钉
   ----------------------------------------------------- */
.gh-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

/* -----------------------------------------------------
   详情弹窗（地球史版）—— 视觉对齐主界面 .modal
   ----------------------------------------------------- */
.gh-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gh-modal[hidden] { display: none; }

.gh-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.gh-modal-card {
  position: relative;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 600px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

.gh-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.gh-modal-close:hover { background: rgba(0, 0, 0, 0.5); }

.gh-modal-head {
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--border);
}

.gh-modal-cat {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.gh-modal-head h2 {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
}

.gh-modal-year {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.gh-modal-flags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gh-modal-body {
  padding: 16px 24px 24px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}
.gh-modal-body p { margin-bottom: 10px; }

/* 要点 / 参考出处 */
.gh-detail-row {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.88rem;
  line-height: 1.6;
}
.gh-detail-key {
  flex-shrink: 0;
  min-width: 44px;
  color: var(--text-muted);
}
.gh-detail-val { color: var(--text-secondary); }

.gh-note-block {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.10);
  font-size: 0.88rem;
  line-height: 1.6;
}

.gh-refs { margin-top: 16px; }
.gh-refs h4 {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.gh-refs ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.gh-refs li {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 3px 0;
}
.gh-refs li::before { content: "· "; }

/* -----------------------------------------------------
   深时提示（地球史栏目的时间轴两端标签已由 JS 写入）
   ----------------------------------------------------- */
.timeline-start, .timeline-end {
  white-space: nowrap;
  font-size: 0.78rem;
}

/* -----------------------------------------------------
   窄屏：分类竖排筛选条不遮挡主视图
   ----------------------------------------------------- */
@media (max-width: 720px) {
  .category-filter { max-height: 55vh; overflow-y: auto; }
  .event-panel { width: 280px; }
}
