/* ============================================================
   风语气象监测系统 · 专用样式
   复用 common.css 设计令牌；以墨蓝 --info 为主调，
   区别于调查系统的深林绿，营造监测终端质感
   ============================================================ */

/* ============ 事故回放控制台 ============ */
.replay-bar {
  position: sticky;
  top: 72px;          /* 紧贴页头底部（页头高度 72px） */
  z-index: 50;        /* 低于页头 z-index:100，高于正文 */
  background: var(--bg-card);
  background-image:
    linear-gradient(rgba(58, 90, 124, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 90, 124, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--info);
  border-left: 4px solid var(--info);
  border-radius: var(--radius-lg);
  padding: 22px 26px 18px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
}
.replay-header {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.replay-title {
  font-family: var(--font-serif); font-size: 18px; font-weight: 600;
  color: var(--text-main); display: flex; align-items: center; gap: 10px;
}
.replay-title .replay-icon { color: var(--info); font-size: 16px; }
.replay-clock {
  font-family: var(--font-mono); font-size: 24px; font-weight: 700;
  color: var(--info); letter-spacing: 2px;
  padding: 4px 14px; background: var(--info-bg); border-radius: var(--radius-sm);
  border: 1px solid var(--info);
}
.replay-controls {
  display: flex; align-items: center; gap: 16px; margin-bottom: 12px;
}
.replay-play {
  flex: 0 0 auto; padding: 10px 22px;
  background: var(--info); color: #fff;
  border: none; border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  letter-spacing: 1px; cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.replay-play:hover { background: #2a4258; transform: translateY(-1px); }
.replay-play.playing { background: var(--danger); }
.replay-play.playing:hover { background: #8a2840; }

.replay-slider-wrap {
  flex: 1 1 auto; min-width: 0; position: relative;
  padding-bottom: 26px;
}
.replay-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: linear-gradient(90deg, var(--info-bg) 0%, var(--danger-bg) 100%);
  border-radius: 3px; outline: none; cursor: pointer;
  border: 1px solid var(--border);
}
.replay-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--info);
  box-shadow: 0 2px 6px rgba(58, 90, 124, 0.35);
  cursor: grab; transition: transform 0.1s, border-color 0.15s;
}
.replay-slider::-webkit-slider-thumb:hover { transform: scale(1.15); border-color: var(--danger); }
.replay-slider::-webkit-slider-thumb:active { cursor: grabbing; }
.replay-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--info);
  box-shadow: 0 2px 6px rgba(58, 90, 124, 0.35);
  cursor: grab;
}
.replay-slider:focus-visible { box-shadow: 0 0 0 3px rgba(58, 90, 124, 0.2); }

.replay-ticks {
  position: absolute; left: 0; right: 0; top: 14px;
  height: 20px; pointer-events: none;
}
.replay-ticks .tick {
  position: absolute; top: 0; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--text-muted); white-space: nowrap;
  pointer-events: auto; cursor: pointer; padding: 2px 4px;
  border-radius: 3px; transition: color 0.15s, background 0.15s;
}
.replay-ticks .tick.tick-start { transform: translateX(0); }
.replay-ticks .tick.tick-end { transform: translateX(-100%); }
.replay-ticks .tick:hover { color: var(--info); background: var(--info-bg); }

.replay-event {
  font-family: var(--font-serif); font-size: 14.5px; font-weight: 500;
  color: var(--text-body); line-height: 1.6;
  padding: 10px 14px; background: var(--bg-alt);
  border-left: 3px solid var(--info); border-radius: var(--radius-sm);
  margin-bottom: 8px; min-height: 22px;
  transition: border-color 0.3s, background 0.3s;
}
.replay-event.tl-warning { border-left-color: var(--accent); background: var(--accent-bg); }
.replay-event.tl-danger { border-left-color: var(--danger); background: var(--danger-bg); color: #7a1f30; }

.replay-hint {
  font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono);
}

@media (max-width: 640px) {
  .replay-controls { flex-direction: column; align-items: stretch; gap: 12px; }
  .replay-play { width: 100%; }
  .replay-ticks .tick { font-size: 9.5px; }
}

/* ============ 游标 overlay ============ */
.cursor-overlay { pointer-events: none; }
.cursor-overlay .cursor-pt {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25));
  animation: cursor-pulse 1.4s ease-in-out infinite;
}
/* 钢缆图"采样窗口外"遮罩：纯视觉，不挡柱子点击 */
.cursor-dim { pointer-events: none; }
@keyframes cursor-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============ 时间线 past/active 状态 ============ */
.tl-item { transition: opacity 0.3s; cursor: pointer; }
.tl-item:hover .tl-title { color: var(--info); }
.tl-item.past { opacity: 0.42; }
.tl-item.past .tl-node { background: var(--info-bg); }
.tl-item.active {
  background: linear-gradient(90deg, var(--info-bg) 0%, transparent 80%);
  border-radius: var(--radius-sm);
  margin-left: -10px;
  padding-left: 54px;
  margin-right: -8px;
}
.tl-item.active .tl-node {
  transform: scale(1.25);
  box-shadow: 0 0 0 4px var(--info-bg), 0 0 0 7px rgba(58, 90, 124, 0.25);
  animation: tl-pulse 1.4s ease-in-out infinite;
}
.tl-item.active.tl-warning .tl-node { box-shadow: 0 0 0 4px var(--accent-bg), 0 0 0 7px rgba(184, 132, 46, 0.3); }
.tl-item.active.tl-danger .tl-node { box-shadow: 0 0 0 4px var(--danger-bg), 0 0 0 7px rgba(168, 50, 74, 0.3); }
@keyframes tl-pulse {
  0%, 100% { transform: scale(1.25); }
  50% { transform: scale(1.45); }
}

/* 罗盘指针动画 */
.compass-needle {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: 120px 120px;
  transform-box: view-box;
}
.replay-bar.is-playing .compass-needle { transition: none; }

/* ============ 数据点点击下钻 ============ */
.data-pt { cursor: pointer; transition: opacity 0.15s; }
.data-pt:hover { opacity: 0.55; }

/* ============ 档案原文弹窗 ============ */
.archive-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.archive-modal.open { display: flex; }
.archive-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 30, 25, 0.55);
  backdrop-filter: blur(4px);
  animation: archive-fade-in 0.2s ease-out;
}
.archive-modal-card {
  position: relative; z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  max-width: 720px; width: 100%;
  max-height: 82vh;
  display: flex; flex-direction: column;
  animation: archive-pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.archive-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 22px;
  border-bottom: 1px solid var(--border-light);
}
.archive-modal-header h3 {
  margin: 0;
  font-family: var(--font-serif); font-size: 16px; font-weight: 600;
  color: var(--text-main);
}
.archive-modal-close {
  flex: 0 0 auto;
  background: none; border: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.archive-modal-close:hover { color: var(--danger); background: var(--danger-bg); }
.archive-modal-body {
  margin: 0; padding: 0;
  overflow-y: auto;
  background: var(--bg-alt);
}
.archive-modal-content {
  margin: 0; padding: 20px 24px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.75;
  color: var(--text-body); white-space: pre-wrap; word-break: break-word;
}
.archive-modal-content .keyword {
  color: var(--text-main); font-weight: 700;
}
.archive-modal-content .clue {
  color: var(--accent); font-weight: 700;
}
.archive-modal-hidden {
  margin: 0 24px 18px; padding: 14px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(184, 132, 46, 0.1);
}
.archive-modal-hidden .hidden-label {
  font-family: var(--font-serif); font-size: 12px; font-weight: 600;
  color: var(--accent); margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.archive-modal-hidden .hidden-text {
  font-family: var(--font-serif); font-size: 14px; line-height: 1.7;
  color: var(--text-light); font-style: italic;
}
.archive-modal-hidden .key-word {
  color: var(--accent); font-weight: 700; font-style: normal;
  border-bottom: 2px solid var(--accent);
  padding: 0 1px;
}
.archive-modal-image-wrap {
  margin: 0 24px 18px;
  text-align: center;
}
.archive-modal-image {
  max-width: 100%;
  max-height: 50vh;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.archive-modal-hint {
  margin: 0 24px 20px; padding: 10px 14px;
  background: var(--info-bg);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 13px;
  color: var(--text-body);
}
@keyframes archive-fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes archive-pop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ 页头（墨蓝主调） ============ */
.weather-header {
  background: linear-gradient(135deg, #3a5a7c 0%, #2a4258 100%);
  padding-bottom: 36px;
}
.weather-header .container { position: relative; z-index: 1; }
.weather-header::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 420px; height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(184, 132, 46, 0.15) 0%, transparent 60%);
  pointer-events: none;
}
.weather-sub {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  font-size: 12.5px; font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.9);
}
.weather-sub .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6fe09a; box-shadow: 0 0 8px #6fe09a;
  animation: weather-pulse 1.6s infinite;
}
@keyframes weather-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ============ 主体 ============ */
.weather-main { padding: 40px 0 64px; flex: 1; }

.block { margin-bottom: 44px; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 2px solid var(--info-bg);
}
.block-title {
  font-family: var(--font-serif); font-size: 20px; font-weight: 600;
  color: var(--text-main); display: flex; align-items: center; gap: 10px;
}
.block-title .num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--info); color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
}
.block-desc { font-size: 13px; color: var(--text-light); }

/* ============ 站点卡 ============ */
.stations-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.station-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-sm); border-top: 3px solid var(--info);
  transition: transform 0.2s, box-shadow 0.2s;
}
.station-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.station-card.st-danger {
  border-top-color: var(--danger);
  background: linear-gradient(180deg, var(--danger-bg) 0%, #fff 42%);
}
.station-card.st-warning {
  border-top-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-bg) 0%, #fff 42%);
}
.station-card.st-lost { border-top-color: var(--text-muted); opacity: 0.82; }
.station-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.station-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.station-status { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--radius-pill); }
.st-normal .station-status { background: var(--primary-bg); color: var(--primary); }
.st-warning .station-status { background: var(--accent-bg); color: var(--accent); }
.st-danger .station-status { background: var(--danger-bg); color: var(--danger); }
.st-lost   .station-status { background: var(--bg-alt); color: var(--text-muted); }
.station-name { font-family: var(--font-serif); font-size: 16px; font-weight: 600; color: var(--text-main); }
.accent-text { color: var(--accent); font-weight: 700; }
.station-loc { font-size: 12.5px; color: var(--text-light); margin-top: 2px; }
.station-metric {
  display: flex; gap: 14px; margin: 14px 0 10px; padding: 10px 0;
  border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border);
}
.metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.metric-label { font-size: 11px; color: var(--text-muted); }
.metric-val { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--info); }
.st-danger .metric-val { color: var(--danger); }
.metric-val.sm { font-size: 12px; font-weight: 600; color: var(--text-body); }
.station-note { font-size: 12px; color: var(--text-light); line-height: 1.6; }

@media (max-width: 900px) { .stations-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stations-grid { grid-template-columns: 1fr; } }

/* ============ 图表卡（监测终端网格底纹） ============ */
.chart-card {
  background: var(--bg-card);
  background-image:
    linear-gradient(rgba(58, 90, 124, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 90, 124, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 6px;
}
.chart-title { font-family: var(--font-serif); font-size: 15.5px; font-weight: 600; color: var(--text-main); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-body); }
.lg-dot { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.chart-box { width: 100%; margin-top: 6px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-note {
  margin-top: 14px; font-size: 12.5px; color: var(--text-light); line-height: 1.75;
  padding: 10px 14px; background: var(--bg-alt); border-radius: var(--radius-sm);
  border-left: 3px solid var(--info);
}
.chart-note.danger { border-left-color: var(--danger); background: var(--danger-bg); color: #7a1f30; }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

/* 罗盘面板 */
.compass-panel { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.compass-svg { width: 220px; height: 220px; }
.compass-panel .chart-box { width: 100%; }

/* 摘要列表 */
.summary-list { display: flex; flex-direction: column; }
.sum-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 4px; border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}
.sum-row:last-child { border-bottom: none; }
.sum-row span { color: var(--text-light); }
.sum-row b { font-family: var(--font-mono); font-weight: 700; color: var(--info); }
.sum-row b.danger { color: var(--danger); }

/* ============ 时间线 ============ */
.tl { position: relative; padding-left: 6px; }
.tl::before {
  content: ''; position: absolute; left: 17px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--info) 0%, var(--accent) 30%, var(--danger) 45%, var(--danger) 70%, var(--info) 100%);
}
.tl-item { position: relative; padding: 0 0 24px 44px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-node {
  position: absolute; left: 10px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--info);
  box-shadow: 0 0 0 4px var(--info-bg);
}
.tl-warning .tl-node { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.tl-danger .tl-node { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.tl-time { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--info); margin-bottom: 3px; }
.tl-warning .tl-time { color: var(--accent); }
.tl-danger .tl-time { color: var(--danger); }
.tl-title { font-family: var(--font-serif); font-size: 15px; font-weight: 600; color: var(--text-main); }
.tl-desc { font-size: 13px; color: var(--text-light); margin-top: 2px; line-height: 1.6; }

/* ============ 结论横幅 ============ */
.conclusion {
  background: linear-gradient(135deg, var(--info-bg) 0%, #f0f5fa 100%);
  border: 1px solid var(--info); border-left: 4px solid var(--info);
  border-radius: var(--radius-lg); padding: 30px 32px; text-align: center;
}
.conclusion h3 { font-family: var(--font-serif); font-size: 19px; color: var(--info); margin-bottom: 12px; }
.conclusion p { font-size: 14.5px; color: #2a4258; line-height: 1.85; max-width: 680px; margin: 0 auto 16px; }
.conclusion .alert-line {
  font-family: var(--font-mono); font-size: 13px; color: var(--danger);
  font-weight: 600; margin-bottom: 20px;
}
