/* =============================================================
 * traceroute-map.css · 路由追踪地图模块样式
 * ============================================================= */

.tr-map-card {
  margin-bottom: 12px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tr-map-card.is-hidden {
  display: none;
}

.tr-map-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  min-height: 440px;
}

.tr-map-left {
  position: relative;
  height: 440px;
  background: #fff;
  border-right: 1px solid #f0f0f0;
  overflow: hidden;
}

.tr-map-chart {
  width: 100%;
  height: 100%;
}

.tr-map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 14px;
  text-align: center;
  padding: 20px;
  line-height: 1.6;
}

.tr-map-placeholder .tr-map-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #cbd5e1;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: tr-map-spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes tr-map-spin {
  to { transform: rotate(360deg); }
}

.tr-map-right {
  max-height: 440px;
  overflow-y: auto;
  padding: 8px 0;
}

.tr-map-hop-empty {
  padding: 40px 16px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

.tr-map-hop {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  position: relative;
}

.tr-map-hop:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 30px;
  top: 40px;
  bottom: -12px;
  width: 2px;
  background: #e5e7eb;
}

.tr-map-hop-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
  position: relative;
  background: #3b82f6;
  flex-shrink: 0;
}

.tr-map-hop-num.is-start { background: #22c55e; }
.tr-map-hop-num.is-end   { background: #ef4444; }

.tr-map-hop-content {
  min-width: 0;
  overflow: hidden;
}

.tr-map-hop-tag {
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
  white-space: nowrap;
}
.tr-map-hop-tag.is-start { background: #d1fae5; color: #065f46; }
.tr-map-hop-tag.is-end   { background: #fee2e2; color: #991b1b; }

.tr-map-hop-loc {
  font-size: 13px;
  font-weight: 500;
  color: #111;
  display: inline;
}

.tr-map-hop-ip {
  font-size: 11px;
  color: #6b7280;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tr-map-hop-rtt {
  font-size: 12px;
  color: #374151;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .tr-map-body {
    grid-template-columns: 1fr;
  }
  .tr-map-left {
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
    height: 320px;
  }
  .tr-map-right {
    max-height: 280px;
  }
}

/* 骨干网络跳点：灰色号码圆 + 灰色 tag */
.tr-map-hop-num.is-backbone { background: #9ca3af; }
.tr-map-hop-tag.is-backbone { background: #e5e7eb; color: #4b5563; }
