/**
 * 加载状态和骨架屏样式
 */

/* 骨架屏动画 */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton-container {
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-line,
.skeleton-avatar,
.skeleton-item,
.skeleton-row {
  background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
  background-size: 200px 100%;
  border-radius: 4px;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-card {
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-content {
  flex: 1;
}

.skeleton-chart {
  padding: 1rem;
}

.skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-row {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
}

/* 加载按钮样式 */
button.loading,
.btn-submit.loading,
.btn-secondary.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

button.loading::after,
.btn-submit.loading::after,
.btn-secondary.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* 加载中遮罩 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 内联加载指示器 */
.inline-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--alipay-border);
  border-top-color: var(--alipay-blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 0.5rem;
}

/* 页面加载动画 - Wealth Insight 渐变文字效果 */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #f0f5ff 0%, #e6f4ff 50%, #f5f5f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

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

.loader-content {
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

.loader-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(
    135deg,
    #1677ff 0%,
    #4096ff 25%,
    #722ed1 50%,
    #b37feb 75%,
    #1677ff 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
  letter-spacing: 0.05em;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
}

.loader-subtitle {
  font-size: 1.2rem;
  color: var(--alipay-text-secondary);
  margin-top: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .loader-title {
    font-size: 2.5rem;
  }

  .loader-subtitle {
    font-size: 1rem;
  }
}
