/* ===== 自定义滚动条 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
}

/* ===== 隐藏横向滚动条 ===== */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ===== 骨架屏动画 ===== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-item {
  background: linear-gradient(
    90deg,
    rgba(30, 41, 59, 0.6) 25%,
    rgba(51, 65, 85, 0.4) 37%,
    rgba(30, 41, 59, 0.6) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

/* ===== 卡片入场动画 ===== */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-enter {
  animation: cardFadeIn 0.35s ease-out forwards;
  opacity: 0;
}

/* ===== 卡片悬停效果 ===== */
.project-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

/* ===== 分类标签样式 ===== */
.category-tag {
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}
.category-tag:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}
.category-tag.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

/* ===== 搜索框聚焦效果 ===== */
#searchInput:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 0 20px rgba(59, 130, 246, 0.05);
}

/* ===== 回到顶部按钮 ===== */
#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ===== 空状态 ===== */
#emptyState.visible {
  display: flex;
}

/* ===== 标签样式 ===== */
.tag-pill {
  transition: background 0.15s ease, color 0.15s ease;
}
.tag-pill:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* ===== 图标容器 ===== */
.icon-container {
  transition: background 0.2s ease;
}
.project-card:hover .icon-container {
  background: rgba(59, 130, 246, 0.15);
}

/* ===== 加载更多按钮 ===== */
#loadMoreBtn:active {
  transform: scale(0.97);
}

/* ===== 响应式微调 ===== */
@media (max-width: 640px) {
  .project-card {
    padding: 0.875rem;
  }
}

/* ===== 懒加载图片淡入 ===== */
.lazy-img {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lazy-img.loaded {
  opacity: 1;
}

/* ===== 减少动画偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  .skeleton-item {
    animation: none;
  }
  .card-enter {
    animation: none;
    opacity: 1;
  }
  .project-card {
    transition: none;
  }
  .category-tag {
    transition: none;
  }
}
