/* ================================================================
   全局加载动画样式
   ================================================================ */

/* ------------------------------------------------------------
   01. 加载遮罩层
   ------------------------------------------------------------ */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 加载动画容器 */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Logo加载动画容器 */
.loader-logo-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
}

.loader-logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 80px;
  object-fit: contain;
  transition: opacity 0.5s ease-in-out;
}

.loader-logo-1 {
  opacity: 1;
  z-index: 2;
}

.loader-logo-2 {
  opacity: 0;
  z-index: 1;
}

/* 加载圆环 */
.loader-ring {
  width: 48px;
  height: 48px;
  border: 4px solid #e5efe3;
  border-top-color: #2d5a27;
  border-radius: 50%;
  animation: ringSpin 0.8s linear infinite;
}

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

/* 加载点 */
.loader-dots {
  display: flex;
  gap: 8px;
}

.loader-dot {
  width: 10px;
  height: 10px;
  background: #2d5a27;
  border-radius: 50%;
  animation: dotBounce 1.4s ease-in-out infinite;
}

.loader-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loader-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.loader-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* 加载进度条 */
.loader-progress {
  width: 200px;
  height: 4px;
  background: #e5efe3;
  border-radius: 2px;
  overflow: hidden;
}

.loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2d5a27, #4a7c42);
  border-radius: 2px;
  animation: progressMove 1.5s ease-in-out infinite;
  background-size: 200% 100%;
}

@keyframes progressMove {
  0% {
    width: 0%;
    background-position: 100% 0;
  }
  50% {
    width: 60%;
    background-position: 50% 0;
  }
  100% {
    width: 100%;
    background-position: 0% 0;
  }
}

/* 加载文字 */
.loader-text {
  color: #2d5a27;
  font-size: 14px;
  font-weight: 500;
  animation: textFade 2s ease-in-out infinite;
}

@keyframes textFade {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* 迷你加载器（用于局部加载） */
.mini-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}

.mini-loader .loader-ring {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.mini-loader .loader-text {
  font-size: 12px;
}

/* 按钮加载器 */
.btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-loader .loader-ring {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 50%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text.large {
  height: 24px;
}

.skeleton-text.small {
  height: 12px;
}

.skeleton-image {
  aspect-ratio: 16 / 9;
}

.skeleton-card {
  padding: 20px;
  margin-bottom: 16px;
  border-radius: 8px;
}

/* 骨架屏变体 */
.skeleton-circle {
  border-radius: 50%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
}

.skeleton-title {
  height: 28px;
  margin-bottom: 12px;
}

.skeleton-paragraph {
  height: 16px;
  margin-bottom: 8px;
}

/* 淡入动画 */
/* fadeIn 已移至 main.css 通用定义 */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* 响应式调整 - 已禁用 */
