/* ============================================================
   02 计算方法与设定 · 模块专属样式（frontend-results）
   v5（2026-10-30）：静止列车重复震源波前动画 + 事件池批次
   顶部：左 列车/波前动画 · 右 频散曲线；池子条；中部 VSG | FV（f-x/c-y）
   底部：dv/v(f) 特定频率（只画到当前批次 win_upto）
   白底浅色主题，复用 style.css 的 .panel/.badge 设计系统。
   ============================================================ */

.s2-wrap {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

/* ---------------- rows ---------------- */
.s2-top { flex: 0 0 26%; min-height: 0; display: flex; gap: 8px; }
.s2-top .panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.s2-top .panel .s2-pbody { flex: 1 1 auto; min-height: 0; }
.s2-train { flex: 0 0 54%; }
.s2-train .s2-pbody { padding: 0; }
.s2-train .s2-cw { position: absolute; inset: 0; }
.s2-topdisp { flex: 1 1 auto; min-width: 0; }
.s2-pool { flex: 0 0 30px; }

.s2-mid { flex: 1 1 auto; min-height: 0; display: flex; gap: 10px; }
.s2-mid .panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.s2-mid .panel .s2-pbody { flex: 1 1 auto; min-height: 0; }
.s2-vsg { flex: 0 0 44%; }
.s2-fv { flex: 1 1 auto; min-width: 0; }
.s2-bottom { flex: 0 0 26%; min-height: 0; display: flex; }
.s2-bottom .panel { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.s2-bottom .panel .s2-pbody { flex: 1 1 auto; min-height: 0; }
.s2-strip {
  flex: 0 0 20px;
  display: flex; align-items: center; gap: 12px;
  min-width: 0; padding: 0 4px;
  font-family: var(--font-mono); font-size: 8.5px; color: #5f7d97;
  white-space: nowrap; overflow: hidden;
}
.s2-strip .note { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------------- panel heads ---------------- */
.s2-wrap .panel { min-width: 0; overflow: hidden; }
.s2-wrap .panel-head { min-width: 0; padding: 5px 10px 4px; gap: 8px; }
.s2-wrap .panel-title {
  font-size: 11.5px; letter-spacing: 1.6px; gap: 7px;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s2-wrap .panel-title em { font-size: 8px; letter-spacing: 1.2px; }
.s2-wrap .panel-title::before { height: 11px; }
.s2-wrap .panel-tools { flex: 0 0 auto; }
.s2-wrap .panel-tools .badge { font-size: 8.5px; padding: 1px 5px; white-space: nowrap; }

/* ---------------- canvas bodies ---------------- */
.s2-pbody {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 5px 8px 7px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.s2-cw { position: relative; flex: 1 1 auto; min-height: 0; }
.s2-cv { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ---------------- pool / history bar ---------------- */
.s2-pool {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 0 8px;
  background: #ffffff;
  border: 1px solid rgba(16, 64, 110, 0.16);
  box-shadow: 0 1px 3px rgba(16, 64, 110, 0.06);
  font-family: var(--font-mono); font-size: 9.5px; color: #3a5570;
  white-space: nowrap; overflow: hidden;
}
.s2-pool-ev { color: #0b76c9; font-weight: 700; flex: 0 0 auto; }
.s2-pool-evbar {
  flex: 0 0 110px; height: 6px;
  background: repeating-linear-gradient(90deg,
    rgba(11, 118, 201, 0.16) 0, rgba(11, 118, 201, 0.16) calc(10% - 1px),
    rgba(255, 255, 255, 0.9) calc(10% - 1px), rgba(255, 255, 255, 0.9) 10%);
  border: 1px solid rgba(11, 118, 201, 0.12); overflow: hidden; position: relative;
}
.s2-pool-evbar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #0a8fb8, #0b76c9); transition: width .18s linear; }
.s2-pool-batch { color: #10263d; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.s2-pool-batch b { color: #c47a10; font-weight: 700; }
.s2-pool-rate {
  flex: 0 0 auto; font-size: 8.5px; color: #c47a10;
  border: 1px solid rgba(196, 122, 16, 0.30); background: rgba(196, 122, 16, 0.06);
  padding: 1px 6px; white-space: nowrap;
}
.s2-pool-ctl { margin-left: auto; display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.s2-pbtn {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .4px;
  padding: 2px 8px; cursor: pointer; white-space: nowrap;
  color: #0b76c9; background: #ffffff;
  border: 1px solid rgba(11, 118, 201, 0.40);
  transition: all .15s;
}
.s2-pbtn:hover { background: rgba(11, 118, 201, 0.08); }
.s2-pbtn.primary { color: #ffffff; background: #0b76c9; border-color: #0b76c9; }
.s2-pbtn.primary:hover { background: #0a67b0; }
.s2-pbtn:disabled { color: #a9bccd; border-color: rgba(16, 64, 110, 0.16); background: #f4f8fb; cursor: default; }
.s2-pool input[type="range"] {
  flex: 0 0 110px; height: 16px; accent-color: #0b76c9; cursor: pointer; background: transparent;
}
.s2-pool input[type="range"]::-moz-range-track { height: 4px; background: rgba(11, 118, 201, 0.18); border-radius: 2px; }
.s2-pool input[type="range"]::-moz-range-progress { height: 4px; background: #0b76c9; border-radius: 2px; }
.s2-pool input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; background: #0b76c9; border: 2px solid #fff; border-radius: 50%; }
.s2-pool input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: rgba(11, 118, 201, 0.18); border-radius: 2px; }
.s2-pool input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; background: #0b76c9; border: 2px solid #fff; border-radius: 50%; margin-top: -4px; }
.s2-pool-mode {
  flex: 0 0 auto; font-size: 8.5px; padding: 1px 7px;
  border: 1px solid rgba(16, 64, 110, 0.18); color: #5f7d97; background: #f4f8fb;
}
.s2-pool-mode.live { color: #0f9d8a; border-color: rgba(15, 157, 138, 0.45); background: rgba(15, 157, 138, 0.07); }
.s2-pool-mode.hist { color: #c47a10; border-color: rgba(196, 122, 16, 0.45); background: rgba(196, 122, 16, 0.07); }

/* ---------------- bottom: velocity controls ---------------- */
.s2-velctl {
  flex: 0 0 24px;
  display: flex; align-items: center; gap: 5px; min-width: 0;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(16, 64, 110, 0.08);
}
.s2-fchips { display: flex; gap: 4px; align-items: center; min-width: 0; overflow: hidden; }
.s2-vellabel { font-family: var(--font-mono); font-size: 8.5px; color: #5f7d97; margin-right: 2px; white-space: nowrap; }
.s2-fchip {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .3px;
  padding: 2px 7px; cursor: pointer;
  color: #3a5570; background: #ffffff;
  border: 1px solid rgba(16, 64, 110, 0.22);
  transition: all .15s; white-space: nowrap;
}
.s2-fchip:hover { border-color: rgba(11, 118, 201, 0.55); color: #0b76c9; }
.s2-fchip.active { color: #ffffff; border-color: transparent; font-weight: 700; }
.s2-modes { margin-left: auto; display: flex; gap: 4px; flex: 0 0 auto; align-items: center; }
.s2-vnote { font-family: var(--font-mono); font-size: 8.5px; color: #5f7d97; white-space: nowrap; margin-right: 6px; }
.s2-mode {
  font-family: var(--font-mono); font-size: 9px; padding: 2px 7px; cursor: pointer;
  color: #3a5570; background: #ffffff; border: 1px solid rgba(16, 64, 110, 0.22);
  white-space: nowrap; transition: all .15s;
}
.s2-mode:hover { border-color: rgba(11, 118, 201, 0.55); color: #0b76c9; }
.s2-mode.active { color: #ffffff; background: #0b76c9; border-color: #0b76c9; font-weight: 700; }

/* ---------------- pool transition overlay ---------------- */
.s2-pooloverlay {
  position: absolute; left: 0; right: 0;
  top: calc(26% + 38px);
  bottom: 0;
  z-index: 6;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(1px);
}
.s2-pooloverlay.hidden { display: none; }
.s2-poolbox {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(196, 122, 16, 0.45);
  box-shadow: 0 4px 16px rgba(16, 64, 110, 0.12);
}
.s2-poolbox .t1 { font-size: 12.5px; letter-spacing: 2px; color: #c47a10; font-weight: 600; }
.s2-poolbox .t2 { font-family: var(--font-mono); font-size: 9px; color: #3a5570; letter-spacing: .6px; }

/* ---------------- short viewport (1280x720) ---------------- */
@media (max-height: 900px) {
  .s2-wrap { gap: 6px; }
  .s2-top { flex-basis: 26%; gap: 6px; }
  .s2-bottom { flex-basis: 25%; }
  .s2-mid { gap: 8px; }
  .s2-strip { flex-basis: 16px; font-size: 8px; }
  .s2-wrap .panel-head { padding: 3px 8px 3px; }
  .s2-wrap .panel-title { font-size: 10.5px; letter-spacing: 1.2px; }
  .s2-wrap .panel-title em { display: none; }
  .s2-wrap .panel-tools .badge { font-size: 8px; padding: 0 4px; }
  .s2-pbody { padding: 3px 6px 5px; }
  .s2-pool { flex-basis: 24px; gap: 6px; font-size: 8.5px; padding: 0 6px; }
  .s2-pool-evbar { flex-basis: 70px; height: 5px; }
  .s2-pool-batch .cum { display: none; }
  .s2-pool-rate { display: none; }
  .s2-pool input[type="range"] { flex-basis: 70px; }
  .s2-pbtn { font-size: 8px; padding: 1px 6px; }
  .s2-pooloverlay { top: calc(26% + 30px); }
  .s2-velctl { flex-basis: 21px; gap: 4px; }
  .s2-fchips { gap: 3px; }
  .s2-fchip { font-size: 8px; padding: 1px 5px; }
  .s2-mode { font-size: 8px; padding: 1px 5px; }
  .s2-vellabel { display: none; }
  .s2-vnote { display: none; }
}
@media (max-height: 780px) {
  .s2-pool-batch .cum { display: none; }
  .s2-pool-rate { display: none; }
  .s2-strip { display: none; }
}

/* ============================================================
   MOBILE (≤900px): 02 屏单列纵向排列（列宽 100%，纵向可滚动）
   顺序：顶部标题条 → 列车动画 → 频散曲线 → 事件池条 → VSG → FV
         → 频率 chips + 绝对/相对 → dv/v 渐进曲线
   桌面端（≥1024）不受影响。
   ============================================================ */
@media (max-width: 900px) {
  #sec2-root { height: auto; min-height: 0; }

  .s2-wrap {
    height: auto;
    min-height: 0;
    gap: 12px;
    padding-bottom: 6px;
    overflow-x: hidden;
    width: 100%;
  }

  /* ---- top row 拆成上下两块 ---- */
  .s2-top {
    display: flex;
    flex-direction: column;
    flex: none;
    height: auto;
    gap: 12px;
  }
  .s2-train { flex: none; width: 100%; height: 208px; }
  .s2-topdisp { flex: none; width: 100%; height: 262px; }

  /* ---- 事件池 / 历史条：换行 + 大按钮 ---- */
  .s2-pool {
    position: static;
    flex: none;
    height: auto;
    min-height: 0;
    flex-wrap: wrap;
    white-space: normal;
    gap: 6px 8px;
    padding: 8px 10px;
    font-size: 11px;
  }
  .s2-pool-ev { font-size: 11px; }
  .s2-pool-evbar { flex: 1 1 80px; height: 8px; }
  .s2-pool-batch { font-size: 11px; }
  .s2-pool-rate { font-size: 10px; padding: 2px 6px; }
  .s2-pool-ctl {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .s2-pool-ctl input[type="range"] {
    flex: 1 1 100%;
    order: -1;
    height: 28px;
    margin: 0;
  }
  .s2-pbtn {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 11px;
  }
  .s2-pool-mode {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 11px;
  }

  /* ---- 中部 VSG / FV 单列 ---- */
  .s2-mid {
    display: flex;
    flex-direction: column;
    flex: none;
    height: auto;
    gap: 12px;
  }
  .s2-vsg, .s2-fv {
    flex: none;
    width: 100%;
    height: 268px;
    min-width: 0;
  }
  .s2-mid .panel { width: 100%; }

  /* ---- 底部 dv/v 面板 ---- */
  .s2-bottom {
    flex: none;
    height: auto;
    display: block;
  }
  .s2-bottom .panel { width: 100%; height: auto; }
  .s2-bottom .s2-pbody { padding: 6px 8px 8px; }
  .s2-velctl {
    flex: 0 0 auto;
    flex-wrap: wrap;
    height: auto;
    min-height: 0;
    gap: 8px;
    padding: 2px 0 8px;
    align-items: flex-start;
  }
  .s2-fchips {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
  }
  .s2-fchip {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 11px;
  }
  .s2-modes {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .s2-mode {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 11px;
  }
  .s2-vnote { display: none; }
  .s2-bottom .s2-cw { height: 200px; flex: none; }

  /* ---- 面板标题 / 角标：手机可读字号 ---- */
  .s2-wrap .panel-head { padding: 6px 10px 5px; gap: 4px 8px; }
  .s2-wrap .panel-title { font-size: 12px; letter-spacing: .8px; white-space: normal; }
  .s2-wrap .panel-title em { display: none; }
  .s2-wrap .panel-tools { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .s2-wrap .panel-tools .badge {
    font-size: 10px;
    padding: 2px 6px;
    white-space: normal;
  }
  .s2-pbody { padding: 4px 6px 6px; }

  /* 过渡遮罩：手机铺满视口 */
  .s2-pooloverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
  }
  .s2-poolbox { margin: 0 14px; padding: 14px 18px; }
  .s2-poolbox .t1 { font-size: 13px; }
  .s2-poolbox .t2 { font-size: 10px; line-height: 1.5; text-align: center; }
}
