/* ==========================================================================
   飞喵云「可爱动漫猫咪 × 全节点实时动态星轨」专属样式 (node-orbit.css)
   色彩基调：樱花粉 (#F472B6)、天空蓝 (#38BDF8)、薄荷绿 (#10B981)、奶油白 (#FFFDF9)、淡紫 (#DDD6FE)
   ========================================================================== */

.node-orbit-stage {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: radial-gradient(circle at 50% 30%, rgba(254, 242, 246, 0.95) 0%, rgba(255, 253, 249, 0.98) 70%, #FFFDF9 100%);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 14px 18px 14px;
  box-shadow: 0 16px 36px rgba(244, 114, 182, 0.14), 0 2px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  user-select: none;
}

/* 顶部交互控制栏（地区分类 + 全节点入口） */
.orbit-controls-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  z-index: 10;
}

.region-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}
.region-pills::-webkit-scrollbar { display: none; }

.region-pill {
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  color: var(--text-subtle);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.region-pill:hover {
  background: var(--bg-tint-pink);
  border-color: var(--primary-pink);
  color: var(--primary-deep);
}

.region-pill.active {
  background: linear-gradient(135deg, #F472B6 0%, #DB2777 100%);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(219, 39, 119, 0.28);
}

.btn-all-nodes {
  background: #FFFFFF;
  border: 1px solid #BAE6FD;
  color: var(--accent-blue);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  min-height: 32px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-all-nodes:hover {
  background: var(--bg-blue-tint);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

/* 核心星轨动态舞台画布 */
.orbit-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 62 / 46;
  min-height: 340px;
  max-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 背景 SVG 轨道与电波流光 */
.orbit-bg-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* 中央互动动漫猫咪 */
.center-cat-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  z-index: 4;
  cursor: pointer;
  outline: none;
  user-select: none;
}

.cat-floating-body {
  width: 100%;
  height: 100%;
  position: relative;
  animation: catGentleFloat 4.2s ease-in-out infinite;
  transform-origin: center center;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cat-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(244, 114, 182, 0.25));
}

@keyframes catGentleFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-5px) rotate(-1.2deg);
  }
  50% {
    transform: translateY(-9px) rotate(0deg);
  }
  75% {
    transform: translateY(-4px) rotate(1.2deg);
  }
}

.center-cat-wrap:hover .cat-floating-body {
  transform: scale(1.08) translateY(-6px);
}

.center-cat-wrap:active .cat-floating-body {
  transform: scale(0.95);
}

/* 身体周围青色悬浮光环柔和流光 */
.cat-cyan-ring-flow {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 61%;
  height: 22%;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.85), inset 0 0 10px rgba(56, 189, 248, 0.6);
  pointer-events: none;
  animation: cyanRingPulse 3.2s ease-in-out infinite alternate;
  z-index: 2;
}

@keyframes cyanRingPulse {
  0% {
    transform: scale(0.98);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.6), inset 0 0 6px rgba(56, 189, 248, 0.4);
    opacity: 0.75;
  }
  100% {
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.95), inset 0 0 12px rgba(56, 189, 248, 0.8);
    opacity: 1;
  }
}

/* 自然眨眼交互动效层 */
.cat-micro-anim-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.cat-eye-blink-ovl {
  position: absolute;
  top: 42%;
  left: 28%;
  width: 44%;
  height: 12%;
  pointer-events: none;
  transform-origin: center center;
  animation: catEyeBlinkLoop 4.6s ease-in-out infinite;
}

@keyframes catEyeBlinkLoop {
  0%, 93%, 97%, 100% {
    opacity: 0;
    transform: scaleY(1);
  }
  95% {
    opacity: 0.9;
    transform: scaleY(0.2);
  }
}

/* 周围轻盈漂浮的星星与爱心微光粒子 */
.cat-sparkles-ambient {
  position: absolute;
  inset: -16px;
  pointer-events: none;
  z-index: 1;
}

.ambient-particle {
  position: absolute;
  display: block;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.ap-star-1 {
  top: 14%;
  left: -6%;
  color: #F59E0B;
  font-size: 0.95rem;
  animation: sparkleFloatA 3.6s ease-in-out infinite alternate;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.ap-heart-1 {
  top: 28%;
  right: -8%;
  color: #F43F5E;
  font-size: 0.85rem;
  animation: sparkleFloatB 4.2s ease-in-out infinite alternate;
  text-shadow: 0 0 8px rgba(244, 63, 94, 0.4);
}

.ap-star-2 {
  bottom: 12%;
  right: -4%;
  color: #F59E0B;
  font-size: 0.8rem;
  animation: sparkleFloatA 4.8s ease-in-out infinite alternate-reverse;
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.ap-heart-2 {
  bottom: 24%;
  left: -8%;
  color: #EC4899;
  font-size: 0.8rem;
  animation: sparkleFloatB 3.8s ease-in-out infinite alternate-reverse;
  text-shadow: 0 0 6px rgba(236, 72, 153, 0.4);
}

@keyframes sparkleFloatA {
  0% { transform: translateY(0) rotate(0deg) scale(0.85); opacity: 0.55; }
  100% { transform: translateY(-7px) rotate(15deg) scale(1.15); opacity: 0.95; }
}

@keyframes sparkleFloatB {
  0% { transform: translateY(0) scale(0.85); opacity: 0.5; }
  100% { transform: translateY(-6px) scale(1.1); opacity: 0.9; }
}

/* 点击猫咪触发的爱心气泡反馈 */
.cat-heart-bubble {
  position: absolute;
  pointer-events: none;
  font-size: 1.25rem;
  color: #F43F5E;
  opacity: 0;
  transform: scale(0.5) translateY(0);
  transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 10;
}

.cat-heart-bubble.pop {
  opacity: 1;
  transform: scale(1.4) translateY(-36px);
}

/* 猫咪光环与光晕 */
.cat-halo {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 215, 226, 0.6) 0%, rgba(224, 242, 254, 0.2) 60%, transparent 80%);
  z-index: -1;
  animation: haloPulse 3s ease-in-out infinite alternate;
}
@keyframes haloPulse {
  from { transform: scale(0.95); opacity: 0.6; }
  to { transform: scale(1.1); opacity: 0.9; }
}

/* 轨道层与沿轨道分布的节点胶囊 */
.orbit-nodes-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* 节点胶囊卡片 (Rounded Pill Capsule) */
.node-capsule-item {
  position: absolute;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 4px 10px 4px 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 6px 16px rgba(244, 114, 182, 0.12), 0 2px 4px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.4, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.node-capsule-item:hover, .node-capsule-item:focus-visible {
  transform: translate(-50%, -54%) scale(1.06);
  border-color: var(--primary-pink);
  box-shadow: 0 10px 24px rgba(219, 39, 119, 0.22);
  z-index: 20;
}

/* 暂停运动状态（鼠标悬浮或点击） */
.node-capsule-item.paused {
  border-color: #38BDF8;
  box-shadow: 0 10px 24px rgba(56, 189, 248, 0.25);
}

/* 在线状态呼吸指示灯 */
.node-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10B981; /* 默认薄荷绿 */
  position: relative;
  flex-shrink: 0;
}

.node-status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background-color: inherit;
  opacity: 0.4;
  animation: dotBreathe 2s ease-in-out infinite;
}
@keyframes dotBreathe {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.8); opacity: 0; }
}

.node-status-dot.abnormal { background-color: #F59E0B; } /* 柔和橙色 */
.node-status-dot.offline { background-color: #F87171; }  /* 浅红色 */
.node-status-dot.pending { background-color: #94A3B8; }  /* 灰蓝色 */

/* 节点名称 */
.node-capsule-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

/* 延迟徽标数值 */
.node-latency-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: var(--radius-pill);
  line-height: 1.2;
  background-color: #F0FDF4;
  color: #16A34A;
}

.node-latency-badge.medium {
  background-color: #FEF3C7;
  color: #D97706;
}

.node-latency-badge.pending {
  background-color: #F1F5F9;
  color: #64748B;
}

/* 地区微标识点 */
.region-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}
.region-dot-hk { background-color: #EF4444; }
.region-dot-jp { background-color: #F43F5E; }
.region-dot-sg { background-color: #10B981; }
.region-dot-us { background-color: #3B82F6; }
.region-dot-eu { background-color: #8B5CF6; }

/* 底部状态指示条 */
.orbit-footer-status {
  width: 100%;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #FBCFE8;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-subtle);
  box-shadow: 0 2px 6px rgba(244, 114, 182, 0.08);
  z-index: 10;
}

.status-left-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 6px #10B981;
}

.status-metrics-tag {
  font-family: monospace;
  font-weight: 700;
  color: #059669;
  font-size: 0.78rem;
}

/* 节点点击详情卡片 (Floating Popover) */
.node-detail-popover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 280px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border: 1.5px solid #FBCFE8;
  border-radius: var(--radius-md);
  padding: 18px 16px;
  box-shadow: 0 16px 36px rgba(219, 39, 119, 0.22);
  z-index: 40;
  display: none;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.node-detail-popover.active {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.popover-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
}

.popover-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.popover-close-btn:hover {
  color: var(--primary-deep);
}

.popover-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.78rem;
}

.popover-info-item {
  display: flex;
  flex-direction: column;
}

.popover-info-label {
  color: var(--text-light);
  font-size: 0.72rem;
}

.popover-info-val {
  font-weight: 700;
  color: var(--text-main);
}

.popover-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.popover-tag {
  background: var(--bg-tint-pink);
  color: var(--primary-deep);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.popover-note {
  font-size: 0.7rem;
  color: var(--text-light);
  line-height: 1.35;
  border-top: 1px dashed var(--border-light);
  padding-top: 6px;
}

/* 全节点展示模态弹窗 (All Nodes Modal) */
.nodes-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  padding: 40px 16px 20px 16px;
  justify-content: center;
  align-items: center;
}

.nodes-modal.active {
  display: flex;
}

.nodes-modal-dialog {
  background: #FFFFFF;
  width: 100%;
  max-width: 680px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--border-light);
  padding-bottom: 14px;
}

.modal-header-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-light);
  cursor: pointer;
  min-height: 38px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  color: var(--primary-deep);
}

.modal-nodes-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.modal-node-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #FFFDFD;
  transition: all 0.2s ease;
}

.modal-node-card:hover {
  border-color: var(--primary-pink);
  background: var(--bg-tint-pink);
  transform: translateX(2px);
}

.modal-node-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-node-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-node-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-node-meta {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* 手机端优化 (Viewport <= 680px) */
@media (max-width: 680px) {
  .node-orbit-stage {
    padding: 12px 8px 14px 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  .orbit-controls-bar {
    gap: 6px;
    margin-bottom: 6px;
  }
  .region-pill {
    font-size: 0.74rem;
    padding: 4px 9px;
    min-height: 28px;
  }
  .btn-all-nodes {
    font-size: 0.74rem;
    padding: 4px 9px;
    min-height: 28px;
  }
  .orbit-canvas-wrap {
    min-height: 260px;
    max-height: 330px;
    aspect-ratio: 54 / 36;
    width: 100%;
    position: relative;
    overflow: hidden;
  }
  .center-cat-wrap {
    width: 95px;
    height: 95px;
  }
  .node-capsule-item {
    padding: 3px 6px;
    gap: 4px;
    max-width: 125px;
    box-sizing: border-box;
  }
  .node-capsule-name {
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .node-latency-badge {
    font-size: 0.64rem;
    padding: 1px 3px;
    flex-shrink: 0;
  }
  .orbit-footer-status {
    flex-direction: column;
    text-align: center;
    gap: 4px;
    padding: 8px 10px;
  }
  .status-left-group {
    justify-content: center;
  }
}

/* 无障碍偏好适配 */
@media (prefers-reduced-motion: reduce) {
  .cat-floating-body, 
  .cat-cyan-ring-flow,
  .cat-eye-blink-ovl,
  .ambient-particle,
  .cat-halo, 
  .node-status-dot::after {
    animation: none !important;
  }
}
