/* 启动加载优化样式 */

/* 应用容器优化 */
#app {
  min-height: 100vh;
  transform: translateZ(0);
  will-change: transform;
  contain: layout style paint;
}

/* 骨架屏样式 */
.app-skeleton {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

.app-skeleton.fade-out {
  opacity: 0;
  pointer-events: none;
}

.skeleton-content {
  text-align: center;
  color: white;
}

.skeleton-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

.skeleton-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  opacity: 0.9;
}

.skeleton-subtitle {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 30px;
}

.skeleton-loading {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}

.skeleton-loading::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  animation: loading 1.5s infinite;
}

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

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(400%);
  }
}

/* 骨架屏卡片组件 */
.skeleton-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

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

.skeleton-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-title {
  height: 20px;
  width: 60%;
}

.skeleton-text {
  height: 14px;
  width: 100%;
}

.skeleton-text.short {
  width: 40%;
}

/* 骨架屏动画 */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

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

/* 防止布局偏移 */
.prevent-cls {
  min-height: 1px;
}

/* 优化滚动性能 */
.scroll-container {
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

/* 减少重绘重排 */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}
