* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; }

#app {
  display: flex;
  height: 100vh;
}

#map {
  flex: 1;
  position: relative;
}

#panel {
  width: 360px;
  background: #1a1a2e;
  color: #eee;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#panel h2 {
  font-size: 20px;
  color: #00d4ff;
}

#lang-toggle {
  background: transparent;
  color: #aaa;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

#lang-toggle:hover {
  color: #00d4ff;
  border-color: #00d4ff;
}

#target-info {
  font-size: 14px;
  color: #aaa;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
}

#legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-item i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

#hop-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hop-card {
  background: #16213e;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: default;
  border-left: 3px solid transparent;
  transition: background 0.15s, opacity 0.3s, box-shadow 0.3s;
  font-size: 13px;
}

.hop-card:hover {
  background: #1a2744;
}

.hop-card.timeout {
  opacity: 0.5;
}

.hop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hop-num {
  font-weight: 600;
  min-width: 28px;
}

.hop-ip {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: #ccc;
}

.hop-rtt {
  font-size: 12px;
  color: #aaa;
}

.hop-detail {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.hop-detail .backbone-tag {
  color: #ff9800;
  font-weight: 600;
}

.hop-detail .cross-ocean {
  color: #f44336;
  font-weight: 600;
}

/* 路线箭头 */
.route-arrow {
  background: none !important;
  border: none !important;
  width: 14px !important;
  height: 14px !important;
}

/* 跳过动画按钮 */
#skip-animation {
  position: absolute;
  bottom: 30px;
  right: 16px;
  z-index: 1000;
  background: rgba(26, 26, 46, 0.85);
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 6px 20px;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s, border-color 0.2s;
}

#skip-animation:hover {
  background: rgba(26, 26, 46, 0.95);
  border-color: #00d4ff;
  color: #00d4ff;
}

/* 侧边栏卡片动画高亮 */
.hop-card.active {
  background: #1a2744;
  border-left-color: #00d4ff !important;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.popup-content {
  font-size: 13px;
  line-height: 1.6;
}

.popup-content .label {
  color: #666;
  font-size: 11px;
}

.hostname {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: #90caf9;
}

.anycast-tag {
  display: inline-block;
  background: #7c4dff;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}
