/* ============================================
   天津新奥拓自动化 - 智能制造特色增强样式
   🤖 智能制造 · 自动化流程 · 控制系统
   ============================================ */

/* 智能制造流程可视化 */
.smart-manufacturing-flow {
  position: relative;
  padding: var(--spacing-12);
  background: linear-gradient(135deg, #0EA5E9 0%, #0c8bc4 100%);
  border-radius: var(--radius-3xl);
  color: white;
  overflow: hidden;
}

.smart-manufacturing-flow::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(246, 102, 241, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: rotate-glow 20s linear infinite;
}

@keyframes rotate-glow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.flow-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-8);
  position: relative;
  z-index: 1;
}

.flow-stages::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 5%;
  right: 5%;
  height: 4px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 10%, 
    rgba(255, 255, 255, 0.3) 90%, 
    transparent 100%
  );
  z-index: 0;
  animation: flow-data 3s linear infinite;
}

@keyframes flow-data {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.flow-stage {
  position: relative;
  text-align: center;
  z-index: 1;
  animation: fade-in-scale 0.6s ease-out backwards;
}

.flow-stage:nth-child(1) { animation-delay: 0.1s; }
.flow-stage:nth-child(2) { animation-delay: 0.2s; }
.flow-stage:nth-child(3) { animation-delay: 0.3s; }
.flow-stage:nth-child(4) { animation-delay: 0.4s; }
.flow-stage:nth-child(5) { animation-delay: 0.5s; }

@keyframes fade-in-scale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.flow-stage__icon {
  width: 90px;
  height: 90px;
  margin: 0 auto var(--spacing-4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 3px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-base);
}

.flow-stage:hover .flow-stage__icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.flow-stage__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-2);
}

.flow-stage__desc {
  font-size: var(--font-size-sm);
  opacity: 0.9;
  line-height: 1.6;
}

/* 自动化控制面板 */
.control-panel {
  padding: var(--spacing-10);
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  border-radius: var(--radius-2xl);
  color: white;
  box-shadow: var(--shadow-2xl);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-6);
}

.control-unit {
  padding: var(--spacing-6);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
}

.control-unit:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(14, 165, 233, 0.5);
  transform: translateY(-3px);
}

.control-unit__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-4);
}

.control-unit__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0EA5E9;
}

.control-unit__indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
  animation: pulse-indicator 2s ease-in-out infinite;
}

@keyframes pulse-indicator {
  0%, 100% { 
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
  }
  50% { 
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

.control-unit__display {
  text-align: center;
  padding: var(--spacing-5) 0;
  margin-bottom: var(--spacing-4);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
}

.control-unit__value {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  color: #0EA5E9;
  font-family: 'Courier New', monospace;
}

.control-unit__unit {
  font-size: var(--font-size-sm);
  opacity: 0.7;
  margin-top: var(--spacing-2);
}

.control-unit__controls {
  display: flex;
  gap: var(--spacing-2);
}

.control-btn {
  flex: 1;
  padding: var(--spacing-2);
  border: 1px solid rgba(14, 165, 233, 0.5);
  background: transparent;
  color: #0EA5E9;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.control-btn:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: #0EA5E9;
}

/* 设备联网状态拓扑图 */
.network-topology {
  position: relative;
  padding: var(--spacing-10);
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  min-height: 400px;
}

.topology-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0EA5E9 0%, #6366F1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  box-shadow: 0 15px 40px rgba(14, 165, 233, 0.3);
  z-index: 10;
}

.topology-center::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 2px dashed rgba(14, 165, 233, 0.3);
  animation: rotate-border 10s linear infinite;
}

@keyframes rotate-border {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.topology-nodes {
  position: relative;
  height: 400px;
}

.topology-node {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: white;
  border: 3px solid #0EA5E9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: float-node 3s ease-in-out infinite;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topology-node:hover {
  transform: scale(1.15);
  border-color: #F59E0B;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

@keyframes float-node {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.topology-node:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.topology-node:nth-child(2) { top: 10%; right: 20%; animation-delay: 0.5s; }
.topology-node:nth-child(3) { bottom: 10%; left: 15%; animation-delay: 1s; }
.topology-node:nth-child(4) { bottom: 10%; right: 15%; animation-delay: 1.5s; }
.topology-node:nth-child(5) { top: 50%; left: 5%; animation-delay: 2s; }
.topology-node:nth-child(6) { top: 50%; right: 5%; animation-delay: 2.5s; }

.topology-connection {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, 
    rgba(14, 165, 233, 0.3), 
    rgba(14, 165, 233, 0.1)
  );
  transform-origin: left center;
  animation: pulse-connection 2s ease-in-out infinite;
}

@keyframes pulse-connection {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* 生产效率仪表盘 */
.efficiency-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-5);
  padding: var(--spacing-8);
  background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
  border-radius: var(--radius-2xl);
}

.efficiency-gauge {
  text-align: center;
  padding: var(--spacing-6);
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.efficiency-gauge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0EA5E9, #F59E0B, #6366F1);
}

.gauge-circle {
  width: 140px;
  height: 140px;
  margin: 0 auto var(--spacing-4);
  border-radius: 50%;
  background: conic-gradient(
    #0EA5E9 0deg,
    #0EA5E9 var(--gauge-angle, 270deg),
    #E5E7EB var(--gauge-angle, 270deg)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gauge-circle::before {
  content: '';
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: white;
}

.gauge-value {
  position: relative;
  z-index: 1;
  font-size: 2.5rem;
  font-weight: 900;
  color: #0EA5E9;
  line-height: 1;
}

.gauge-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-2);
}

.gauge-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-1);
  padding: var(--spacing-1) var(--spacing-3);
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* 智能调度时间轴 */
.scheduling-timeline {
  padding: var(--spacing-8);
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-6);
  padding-bottom: var(--spacing-4);
  border-bottom: 2px solid var(--color-border);
}

.timeline-tasks {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.timeline-task {
  display: grid;
  grid-template-columns: 120px 1fr 100px;
  gap: var(--spacing-4);
  align-items: center;
  padding: var(--spacing-4);
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
  border-radius: var(--radius-lg);
  border-left: 4px solid #0EA5E9;
  transition: all var(--transition-fast);
}

.timeline-task:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.timeline-task__time {
  font-weight: 700;
  color: #0EA5E9;
  font-family: 'Courier New', monospace;
}

.timeline-task__content {
  flex: 1;
}

.timeline-task__title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-1);
}

.timeline-task__device {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.timeline-task__status {
  padding: var(--spacing-1) var(--spacing-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-align: center;
}

.timeline-task__status.running {
  background: rgba(14, 165, 233, 0.15);
  color: #0EA5E9;
}

.timeline-task__status.completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.timeline-task__status.scheduled {
  background: rgba(156, 163, 175, 0.15);
  color: #6B7280;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .flow-stages {
    grid-template-columns: 1fr;
    gap: var(--spacing-6);
  }
  
  .flow-stages::before {
    top: 0;
    left: 45px;
    right: auto;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, 
      transparent 0%, 
      rgba(255, 255, 255, 0.3) 10%, 
      rgba(255, 255, 255, 0.3) 90%, 
      transparent 100%
    );
  }
  
  .flow-stage {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: var(--spacing-4);
    text-align: left;
  }
  
  .panel-grid {
    grid-template-columns: 1fr;
  }
  
  .topology-nodes {
    display: none;
  }
  
  .efficiency-dashboard {
    grid-template-columns: 1fr;
  }
  
  .timeline-task {
    grid-template-columns: 1fr;
    gap: var(--spacing-2);
  }
}
