/* Skeleton Loading - 骨架屏加载动画 */
/* 用法: 替代 loading 文字，显示内容即将出现的视觉暗示 */

.skeleton {
  position: relative;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 8px;
}

/* Shimmer 动画 */
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  transform: translateX(-100%);
}

@keyframes skeleton-shimmer {
  to { transform: translateX(100%); }
}

/* 变体 */
.skeleton--dark {
  background: #334155;
}

.skeleton--dark::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
}

/* 预设形状 */
.skeleton--text {
  height: 1em;
  margin-bottom: 0.5em;
  border-radius: 4px;
}

.skeleton--text-sm {
  height: 0.75em;
  width: 60%;
  border-radius: 4px;
}

.skeleton--title {
  height: 1.5em;
  width: 40%;
  margin-bottom: 1em;
  border-radius: 6px;
}

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

.skeleton--avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.skeleton--image {
  width: 100%;
  height: 200px;
  border-radius: 12px;
}

.skeleton--button {
  width: 120px;
  height: 40px;
  border-radius: 8px;
}

.skeleton--card {
  width: 100%;
  height: 280px;
  border-radius: 16px;
}

/* 组合: 卡片骨架 */
.skeleton-card {
  background: #fff;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.skeleton-card__image {
  width: 100%;
  height: 180px;
  background: #e2e8f0;
  position: relative;
  overflow: hidden;
}

.skeleton-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  transform: translateX(-100%);
}

.skeleton-card__body {
  padding: 1.25rem;
}

.skeleton-card__line {
  height: 0.875em;
  background: #e2e8f0;
  border-radius: 4px;
  margin-bottom: 0.75em;
  position: relative;
  overflow: hidden;
}

.skeleton-card__line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  transform: translateX(-100%);
}

.skeleton-card__line:last-child {
  width: 60%;
  margin-bottom: 0;
}

/* Pulse 变体 (用于极简场景) */
.skeleton--pulse {
  animation: skeleton-pulse 2s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
