/* =====================================================================
   NCCL M2N 深度报告专属样式（仅「分层拓扑路由」动画板自定义类）
   公共组件样式见 static/css/report.css（.board/.bhead/.stage/.step-desc/
   .legend/.controls/.btn/.flyer 等）；此处只放论文专属类，全部以
   .report 前缀收紧作用域，与 DoIt 主题隔离。
   舞台：源域(左) + 网络走廊(中) + 两个目的 NVLink 域(右上/右下) + 底部对账条
   ===================================================================== */

/* ---------- 舞台尺寸（绝对定位布局，配合 .stage 的 overflow-x:auto） ---------- */
.report .stage.hroute { min-height: 640px; min-width: 800px; }

/* ---------- 源域面板 ---------- */
.report .hroute-src {
  position: absolute; left: 14px; top: 14px; width: 176px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 12px 12px 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.report .hroute-src-t {
  font-size: 0.78rem; font-weight: 700; color: var(--primary);
  margin-bottom: 10px; line-height: 1.4;
}
.report .hroute-shard {
  height: 60px; margin-bottom: 10px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.8rem; font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.report .hroute-shard.c0 { background: #2980b9; }
.report .hroute-shard.c1 { background: #8e44ad; }
.report .hroute-shard.c2 { background: #d35400; }
.report .hroute-shard.c3 { background: #00897b; }

/* ---------- 网络走廊 ---------- */
.report .hroute-net {
  position: absolute; left: 208px; top: 14px; width: 84px; height: 560px;
  border: 1.5px dashed #aed6f1; border-radius: 10px; background: #f4f9fd;
  display: flex; align-items: center; justify-content: center;
}
.report .hroute-net div {
  font-size: 0.72rem; color: #2471a3; font-weight: 600;
  text-align: center; line-height: 1.6;
}

/* ---------- 目的域面板 ---------- */
.report .hroute-dom {
  position: absolute; left: 312px; width: 470px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 10px 12px 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.report .hroute-dom.alpha { top: 14px; }
.report .hroute-dom.beta  { top: 302px; }
.report .hroute-dom-t {
  font-size: 0.78rem; font-weight: 700; color: var(--primary);
  margin-bottom: 10px; line-height: 1.4;
}
.report .hroute-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 目的 GPU 卡（每卡 = 1 个 TP 槽 × 1 个副本，含两片相邻贡献） ---------- */
.report .hroute-card {
  border: 1px solid var(--border); border-radius: 8px; background: #fbfdfc;
  padding: 8px 9px; min-height: 102px;
  transition: border-color .25s, background .25s;
}
.report .hroute-card.is-lead { border: 2px solid var(--success); background: #f0faf4; padding: 7px 8px; }
.report .hroute-card-t {
  font-size: 0.76rem; font-weight: 700; color: var(--primary);
  margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center;
}
.report .hroute-lead {
  display: none; font-size: 0.62rem; color: #fff; background: var(--success);
  border-radius: 999px; padding: 1px 7px; white-space: nowrap;
}
.report .hroute-card.is-lead .hroute-lead { display: inline-block; }
.report .hroute-segs { display: flex; gap: 6px; }
.report .hroute-seg {
  flex: 1; height: 36px; border-radius: 6px;
  border: 1px dashed var(--border); background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; color: var(--text-muted); font-weight: 600;
  transition: background .25s, color .25s;
}
.report .hroute-seg.filled { border: none; color: #fff; font-weight: 700; }
.report .hroute-seg.filled.c0 { background: #2980b9; }
.report .hroute-seg.filled.c1 { background: #8e44ad; }
.report .hroute-seg.filled.c2 { background: #d35400; }
.report .hroute-seg.filled.c3 { background: #00897b; }
.report .hroute-seg.nvflash { animation: hrouteFlash 1.1s ease; }
@keyframes hrouteFlash {
  0% { box-shadow: 0 0 0 4px rgba(39,174,96,.5); }
  100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); }
}

/* ---------- 底部对账条 ---------- */
.report .hroute-meter {
  position: absolute; left: 312px; right: 14px; bottom: 14px; height: 46px;
  display: flex; gap: 10px;
}
.report .hroute-chip {
  flex: 1; border-radius: 8px; padding: 5px 12px;
  border: 1px solid var(--border); background: #f8fafc;
  display: flex; flex-direction: column; justify-content: center;
  font-size: 0.72rem; line-height: 1.4;
}
.report .hroute-chip .t { color: var(--text-muted); }
.report .hroute-chip .v { color: var(--primary); font-weight: 700; font-size: 0.76rem; }
.report .hroute-chip.flat { background: #fdf4f3; border-color: #f5b7b1; }
.report .hroute-chip.flat .v { color: var(--danger); }
