/* ==========================================================================
   Framework 45: 电路拓扑 · 电路逐段点亮 (Circuit Topology & Segmented Lighting)
   Interactive PCB Traces, Pulse Waves & Real-Time Ingress-to-Edge Routing
   ========================================================================== */

.topology-section {
  position: relative;
  padding: 80px 0;
  z-index: 10;
}

.topology-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.topology-header {
  text-align: center;
  margin-bottom: 48px;
}

.topology-title {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 800;
  color: #ffffff;
  margin-top: 12px;
  letter-spacing: -0.5px;
}

.topology-subtitle {
  font-size: 16px;
  color: var(--aurora-text-muted);
  max-width: 680px;
  margin: 12px auto 0;
  line-height: 1.6;
}

/* PCB Motherboard Main Board */
.circuit-board {
  background: radial-gradient(circle at 50% 30%, #0c182b 0%, #060b17 100%);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 20px;
  padding: 36px 30px;
  box-shadow: 
    0 24px 60px -15px rgba(0, 0, 0, 0.8),
    inset 0 0 40px rgba(6, 182, 212, 0.05),
    0 0 25px rgba(16, 185, 129, 0.12);
  position: relative;
  overflow: hidden;
}

/* Board Corner Chip Indicators */
.circuit-board::before {
  content: "TOPOLOGY-ENG-45 // REV.2026";
  position: absolute;
  top: 14px;
  left: 20px;
  font-family: var(--aurora-font-mono);
  font-size: 11px;
  color: rgba(6, 182, 212, 0.5);
  letter-spacing: 1.5px;
}

.circuit-board::after {
  content: "AURORA PHOTONIC BUS · STATUS: NOMINAL";
  position: absolute;
  top: 14px;
  right: 20px;
  font-family: var(--aurora-font-mono);
  font-size: 11px;
  color: rgba(16, 185, 129, 0.5);
  letter-spacing: 1.5px;
}

/* Interactive Controls Toolbar */
.topology-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  margin-bottom: 32px;
  padding: 14px 20px;
  background: rgba(10, 20, 36, 0.6);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 12px;
}

.topology-btn-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.topology-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  background: rgba(15, 27, 48, 0.7);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topology-ctrl-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--aurora-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.topology-ctrl-btn.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.3));
  border-color: var(--aurora-cyan);
  color: #38bdf8;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.topology-node-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--aurora-text-muted);
}

.node-pill {
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--aurora-text-muted);
  cursor: pointer;
  font-size: 12.5px;
  font-family: var(--aurora-font-mono);
  transition: all 0.2s ease;
}

.node-pill:hover {
  border-color: var(--aurora-emerald);
  color: #fff;
}

.node-pill.selected {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--aurora-emerald);
  color: #34d399;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

/* Topology Diagram Track / Grid */
.topology-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  position: relative;
  margin: 30px 0;
}

/* Connecting PCB Bus Line (SVG Overlay) */
.circuit-svg-canvas {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 60px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

/* Circuit Stage Card */
.circuit-stage {
  position: relative;
  z-index: 2;
  background: rgba(12, 22, 38, 0.88);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
}

.circuit-stage-number {
  font-family: var(--aurora-font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--aurora-text-dim);
  letter-spacing: 1px;
  margin-bottom: 6px;
  transition: color 0.3s ease;
}

.circuit-stage-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.35s ease;
}

.circuit-stage-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.circuit-stage-desc {
  font-size: 11px;
  color: var(--aurora-text-muted);
  line-height: 1.4;
}

.circuit-stage-indicator {
  margin-top: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  font-family: var(--aurora-font-mono);
  font-size: 10px;
  color: var(--aurora-text-dim);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

/* STAGE ACTIVE & LIGHTING STATES (逐段点亮动效) */
.circuit-stage.lit-active {
  border-color: var(--aurora-cyan);
  background: rgba(14, 30, 52, 0.95);
  box-shadow: 
    0 0 25px rgba(6, 182, 212, 0.45),
    inset 0 0 15px rgba(16, 185, 129, 0.2);
  transform: translateY(-6px) scale(1.02);
}

.circuit-stage.lit-active .circuit-stage-number {
  color: #38bdf8;
}

.circuit-stage.lit-active .circuit-stage-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.4));
  border-color: var(--aurora-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
  transform: scale(1.1);
}

.circuit-stage.lit-active .circuit-stage-indicator {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--aurora-emerald);
  color: #34d399;
}

/* Golden Peak for Core Circuit (Stage 4) */
.circuit-stage[data-stage="4"].lit-active {
  border-color: var(--aurora-gold);
  box-shadow: 
    0 0 30px rgba(245, 158, 11, 0.45),
    inset 0 0 15px rgba(245, 158, 11, 0.2);
}

.circuit-stage[data-stage="4"].lit-active .circuit-stage-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(251, 191, 36, 0.4));
  border-color: var(--aurora-gold);
}

/* Connecting Trace Pulse Animation */
.trace-bg {
  stroke: rgba(6, 182, 212, 0.15);
  stroke-width: 3;
}

.trace-active {
  stroke: url(#circuitPulseGrad);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 40 180;
  animation: tracePulseAnim 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes tracePulseAnim {
  0% {
    stroke-dashoffset: 220;
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.2;
  }
}

/* Telemetry Real-time Data Bar */
.topology-telemetry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(6, 182, 212, 0.12);
}

.telemetry-item {
  background: rgba(8, 15, 27, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 14px;
}

.telemetry-label {
  font-size: 11px;
  font-family: var(--aurora-font-mono);
  color: var(--aurora-text-dim);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.telemetry-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--aurora-font-mono);
  color: #ffffff;
}

.telemetry-value span {
  font-size: 12px;
  font-weight: normal;
  color: var(--aurora-text-muted);
  margin-left: 4px;
}

.telemetry-val-emerald {
  color: #34d399;
}

.telemetry-val-cyan {
  color: #38bdf8;
}

.telemetry-val-gold {
  color: #fbbf24;
}

/* Responsive Grid */
@media (max-width: 992px) {
  .topology-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  .circuit-svg-canvas {
    display: none;
  }
  .topology-telemetry {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .topology-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .topology-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .topology-telemetry {
    grid-template-columns: 1fr;
  }
}
