/* BMS系统加载样式 */
#loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0c2340 0%, #1e3a5f 50%, #2a4f7a 100%);
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#loader-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 85, 134, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 120, 180, 0.2) 0%, transparent 50%);
  animation: backgroundFlow 8s ease-in-out infinite alternate;
}

@keyframes backgroundFlow {
  0% { transform: translateX(-5%) translateY(-5%) scale(1); }
  100% { transform: translateX(5%) translateY(5%) scale(1.1); }
}

/* 电池指示器 */
#loader-wrapper .battery-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}

#loader-wrapper .battery-body {
  width: 80px;
  height: 40px;
  border: 3px solid #00d4ff;
  border-radius: 6px;
  position: relative;
  background-color: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

#loader-wrapper .battery-level {
  height: 100%;
  background: linear-gradient(90deg, #ff4757 0%, #ffa502 30%, #2ed573 100%);
  border-radius: 3px;
  width: 0%;
  animation: batteryCharge 3s ease-in-out infinite;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
}

@keyframes batteryCharge {
  0% { width: 20%; }
  50% { width: 60%; }
  100% { width: 90%; }
}

#loader-wrapper .battery-tip {
  width: 8px;
  height: 20px;
  background-color: #00d4ff;
  border-radius: 0 3px 3px 0;
  margin-left: 2px;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* 系统标题 */
#loader-wrapper .system-title {
  color: #00d4ff;
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
  animation: titleGlow 2s ease-in-out infinite alternate;
  z-index: 1;
  position: relative;
}

@keyframes titleGlow {
  0% { text-shadow: 0 0 10px rgba(0, 212, 255, 0.5); }
  100% { text-shadow: 0 0 30px rgba(0, 212, 255, 1), 0 0 40px rgba(0, 212, 255, 0.5); }
}

#loader-wrapper .system-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  margin-bottom: 40px;
  letter-spacing: 2px;
  z-index: 1;
  position: relative;
}

/* 数据流动效果 */
#loader-wrapper .data-flow {
  display: flex;
  justify-content: space-between;
  width: 200px;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}

#loader-wrapper .flow-line {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, #00d4ff 50%, transparent 100%);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

#loader-wrapper .flow-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
  animation: dataFlow 2s linear infinite;
}

#loader-wrapper .flow-line:nth-child(2)::before {
  animation-delay: 0.5s;
}

#loader-wrapper .flow-line:nth-child(3)::before {
  animation-delay: 1s;
}

@keyframes dataFlow {
  0% { left: -100%; }
  100% { left: 100%; }
}

#loader-wrapper .load_title {
  font-family: 'Microsoft YaHei', sans-serif;
  color: #ffffff;
  font-size: 16px;
  text-align: center;
  z-index: 1;
  position: relative;
  animation: textFade 2s ease-in-out infinite alternate;
}

@keyframes textFade {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* 加载完成动画 */
.loaded #loader-wrapper {
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease-out;
}

.no-js #loader-wrapper {
  display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
  #loader-wrapper .system-title {
    font-size: 24px;
  }

  #loader-wrapper .system-subtitle {
    font-size: 14px;
  }

  #loader-wrapper .data-flow {
    width: 150px;
  }

  #loader-wrapper .flow-line {
    width: 40px;
  }
}
