/* ============================================================
   终端监控系统 · 样式
   与气象系统同调（墨蓝主色），区别于调查系统的深林绿
   ============================================================ */

/* ============ 页头（墨蓝主调，同 weather-header） ============ */
.terminal-header {
  background: linear-gradient(135deg, #3a5a7c 0%, #2a4258 100%);
  padding-bottom: 36px;
  color: #fff;
}
.terminal-header .container { position: relative; z-index: 1; }
.terminal-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;
}
.terminal-header .breadcrumb a { color: rgba(255, 255, 255, 0.75); }
.terminal-header h1 {
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 700;
  margin: 8px 0 6px;
}
.terminal-header p { color: rgba(255, 255, 255, 0.85); }
.terminal-sub {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 6px 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; color: #fff;
}
.terminal-sub .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  animation: term-blink 1.5s infinite;
}
@keyframes term-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

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

/* ============ 区块 ============ */
.block { margin-bottom: 44px; }
.block-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.block-title {
  font-family: var(--font-serif); font-size: 18px; font-weight: 600;
  color: var(--text-main); display: flex; align-items: center; gap: 10px;
}
.block-title .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--info); color: #fff;
  border-radius: 50%; font-size: 14px; font-weight: 700;
}
.block-desc { font-size: 13px; color: var(--text-light); }

/* ============ 卡片 ============ */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ============ 终端总览 ============ */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.terminal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.terminal-card:hover { box-shadow: var(--shadow-md); }
.terminal-card.t-danger {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger), 0 4px 16px rgba(168, 50, 74, 0.12);
}
.terminal-card.t-warning {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 12px rgba(184, 132, 46, 0.1);
}
.terminal-card.t-normal { border-color: var(--border); }
.terminal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.terminal-id {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: var(--info);
}
.t-danger .terminal-id { color: var(--danger); }
.t-warning .terminal-id { color: var(--accent); }
.terminal-status {
  font-family: var(--font-mono); font-size: 11px;
  padding: 3px 8px; border-radius: 4px;
}
.t-normal .terminal-status { background: var(--info-bg); color: var(--info); }
.t-warning .terminal-status { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.t-danger .terminal-status { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.terminal-name {
  font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  color: var(--text-main); margin-bottom: 4px;
}
.terminal-loc { font-size: 12.5px; color: var(--text-light); margin-bottom: 12px; }
.terminal-metric {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-top: 1px dashed var(--border);
  font-size: 12.5px;
}
.terminal-metric .m-label { color: var(--text-muted); }
.terminal-metric .m-val { color: var(--text-body); font-family: var(--font-mono); }
.t-danger .terminal-metric .m-val.danger { color: var(--danger); font-weight: 700; }
.terminal-note {
  margin-top: 10px; padding: 8px 10px;
  background: var(--bg-alt); border-radius: var(--radius-sm);
  font-size: 11.5px; color: var(--text-light); line-height: 1.5;
}

/* ============ 时间线 ============ */
.tl { padding: 24px; position: relative; }
.tl::before {
  content: ''; position: absolute;
  left: 32px; top: 24px; bottom: 24px;
  width: 2px; background: var(--border);
}
.tl-item {
  position: relative; padding: 0 0 24px 60px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-node {
  position: absolute; left: 25px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--info);
}
.tl-item.tl-danger .tl-node { border-color: var(--danger); background: var(--danger); }
.tl-item.tl-warning .tl-node { border-color: var(--accent); background: var(--accent); }
.tl-item.tl-normal .tl-node { border-color: var(--info); }
.tl-time {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted); margin-bottom: 2px;
}
.tl-title {
  font-family: var(--font-serif); font-size: 14px; font-weight: 600;
  color: var(--text-main); margin-bottom: 4px;
}
.tl-item.tl-danger .tl-title { color: var(--danger); }
.tl-item.tl-warning .tl-title { color: var(--accent); }
.tl-desc {
  font-size: 13px; color: var(--text-light); line-height: 1.6;
}

/* ============ 监控日志 ============ */
.surveillance-log { padding: 8px 24px; }
.surv-row {
  display: grid;
  grid-template-columns: 140px 110px 1fr 80px;
  gap: 16px; align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  font-family: var(--font-mono); font-size: 12.5px;
}
.surv-row:last-child { border-bottom: none; }
.surv-row .sv-time { color: var(--text-muted); }
.surv-row .sv-channel { color: var(--info); font-weight: 600; }
.surv-row .sv-event { color: var(--text-body); }
.surv-row .sv-status {
  text-align: center; padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.surv-row .sv-status.ok { background: var(--info-bg); color: var(--info); }
.surv-row .sv-status.anomaly { background: var(--danger-bg); color: var(--danger); }
.surv-row .sv-status.warn { background: var(--accent-bg); color: var(--accent); }

/* ============ 网络流量 ============ */
.packet-card { padding: 20px 24px; }
.packet-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.packet-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 3px;
  background: var(--danger-bg); color: var(--danger);
  letter-spacing: 1px;
}
.packet-time {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--accent); font-weight: 600;
}
.packet-rows { margin-bottom: 16px; }
.packet-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px; padding: 8px 0;
  font-family: var(--font-mono); font-size: 13px;
  border-bottom: 1px dashed var(--border);
}
.packet-row:last-child { border-bottom: none; }
.pk-label { color: var(--text-muted); }
.pk-val { color: var(--text-body); }
.pk-payload {
  display: inline-block;
  color: var(--danger) !important;
  font-size: 18px; font-weight: 700;
  padding: 0 8px; background: var(--danger-bg);
  border-radius: 3px;
}
.packet-note {
  padding: 12px 14px;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.7;
  color: var(--text-light);
}

/* ============ 终端屏幕模拟（浅色终端窗口，同页面风格） ============ */
.screen-sim { padding: 24px; text-align: center; }
.screen-bezel {
  display: inline-block;
  width: 100%; max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.screen-bezel::before {
  content: '终端#12 · 命令提示符';
  display: block;
  padding: 9px 14px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.screen-crt {
  position: relative;
  background: var(--bg-alt);
  padding: 18px 22px;
  font-family: var(--font-mono); font-size: 13px;
  line-height: 1.8;
  min-height: 300px;
  max-height: 420px;
  overflow: hidden;
  border-top: 1px solid var(--border-light);
}
.screen-content {
  color: var(--text-body);
  text-align: left;
}
.screen-content .sc-line { white-space: pre-wrap; }
.screen-content .sc-prompt { color: var(--info); font-weight: 600; }
.screen-content .sc-cmd { color: var(--primary); }
.screen-content .sc-warn { color: var(--accent); font-weight: 600; }
.screen-content .sc-danger { color: var(--danger); font-weight: 600; }
.screen-content .sc-cursor {
  display: inline-block; width: 8px; height: 14px;
  background: var(--primary);
  vertical-align: text-bottom;
  animation: term-cursor 1s steps(1) infinite;
}
@keyframes term-cursor { 50% { opacity: 0; } }
.screen-scanline { display: none; }
.screen-label {
  margin-top: 14px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted);
}

/* ============ 结论 ============ */
.conclusion {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}
.conclusion h3 {
  color: var(--danger); font-family: var(--font-serif);
  font-size: 18px; margin-bottom: 12px;
}
.conclusion p {
  color: var(--text-body); font-size: 14px; line-height: 1.8;
  margin-bottom: 14px;
}
.alert-line {
  padding: 10px 14px; background: var(--danger-bg);
  border-radius: var(--radius-sm); color: var(--danger);
  font-family: var(--font-mono); font-size: 13px;
  margin-bottom: 18px;
}

/* ============ 响应式 ============ */
@media (max-width: 640px) {
  .surv-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 0;
  }
  .surv-row .sv-status { justify-self: start; }
  .packet-row { grid-template-columns: 1fr; gap: 2px; }
  .screen-crt { width: 100%; }
}
