/* ========================================
   加载等待页面样式 - 科技感设计
   ======================================== */

#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 1s ease-out, visibility 1s ease-out;
}

/* 固定背景 - 深邃科技感 */
#loading-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #0a0a0f;
  z-index: 0;
}

/* 网格背景 - 数据矩阵风格 */
#loading-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
  animation: gridMove 15s linear infinite;
}

@keyframes gridMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(40px); }
}

/* 数据流效果 */
.loading-data-stream {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  overflow: hidden;
  opacity: 0.3;
}

.loading-data-stream::before,
.loading-data-stream::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, 
    transparent 0%, 
    rgba(0, 212, 255, 0.8) 50%, 
    transparent 100%);
  animation: dataFlow 3s linear infinite;
}

.loading-data-stream::before {
  left: 20%;
  animation-delay: 0s;
}

.loading-data-stream::after {
  left: 80%;
  animation-delay: 1.5s;
}

@keyframes dataFlow {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* 加载内容容器 - 硬朗科技风 */
.loading-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 3rem 4rem;
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 4px;
  box-shadow: 
    0 0 0 1px rgba(0, 212, 255, 0.1),
    inset 0 0 30px rgba(0, 212, 255, 0.05);
  animation: contentFadeIn 0.6s ease-out;
}

/* 科技边框装饰 */
.loading-content::before,
.loading-content::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 212, 255, 0.6);
}

.loading-content::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.loading-content::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 科技感加载动画 - 六边形 */
.tech-loader {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
}

/* 外圈 - 六边形旋转 */
.tech-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid #00d4ff;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: hexRotate 3s linear infinite;
}

/* 内圈 - 反向旋转 */
.tech-loader::after {
  content: '';
  position: absolute;
  inset: 20px;
  border: 2px solid #7c3aed;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: hexRotate 2s linear infinite reverse;
}

/* 核心脉冲 */
.loader-core {
  position: absolute;
  inset: 35px;
  background: #00d4ff;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: corePulse 1.5s ease-in-out infinite;
}

@keyframes hexRotate {
  to { transform: rotate(360deg); }
}

@keyframes corePulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 1;
  }
  50% { 
    transform: scale(0.8);
    opacity: 0.6;
  }
}

/* 加载文字 - 科技终端风格 */
#loading-text {
  font-size: 1.4rem;
  font-weight: 500;
  color: #00d4ff;
  margin-bottom: 0.5rem;
  letter-spacing: 3px;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
}

#loading-subtext {
  font-size: 0.9rem;
  color: #71717a;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
}

/* 进度条 - 数据传输风格 */
.loading-progress {
  width: 240px;
  height: 2px;
  background: rgba(0, 212, 255, 0.1);
  margin: 1.5rem auto 0;
  position: relative;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: #00d4ff;
  transition: width 0.3s ease;
}

/* 进度条百分比文字 */
.loading-progress-text {
  position: absolute;
  right: -50px;
  top: -6px;
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  color: #00d4ff;
  font-weight: 500;
}

/* 进度条闪烁点 */
.loading-progress::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  width: 8px;
  height: 8px;
  background: #00d4ff;
  border-radius: 50%;
  animation: blinkDot 0.5s ease-in-out infinite;
}

@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 淡出动画 */
#loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

#loading-overlay.fade-out .loading-content {
  animation: contentFadeOut 0.6s ease-out forwards;
}

@keyframes contentFadeOut {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* 主内容隐藏 */
#main-content {
  display: none;
}

/* 响应式 */
@media (max-width: 768px) {
  .loading-content {
    padding: 2rem 2.5rem;
    margin: 1rem;
  }
  
  .tech-loader {
    width: 80px;
    height: 80px;
  }
  
  .loader-core {
    inset: 28px;
  }
  
  #loading-text {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }
  
  #loading-subtext {
    font-size: 0.85rem;
  }
  
  .loading-progress {
    width: 180px;
  }
}

@media (max-width: 480px) {
  .loading-content {
    padding: 1.5rem 2rem;
  }
  
  #loading-text {
    font-size: 1rem;
  }
  
  #loading-subtext {
    font-size: 0.8rem;
  }
}
