@import "tailwindcss";

@source "../../index.html";
@source "../**/*.{vue,js,ts,jsx,tsx}";

/* ===== 全局基础优化 ===== */

/* 优化字体渲染 */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

/* 图片优化 */
img {
  max-width: 100%;
  height: auto;
}

/* 懒加载图片过渡 */
.lazy-img {
  transition: opacity 0.3s ease;
  opacity: 0.6;
}

.lazy-loaded {
  opacity: 1;
}

.lazy-error {
  opacity: 0.3;
  filter: grayscale(1);
}

/* ===== 骨架屏动画 ===== */
@keyframes skeleton-loading {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* ===== 玻璃拟态效果 ===== */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== 渐变文字 ===== */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== 卡片悬浮效果 ===== */
.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(45, 113, 255, 0.12);
}

/* ===== 按钮优化 ===== */
.btn-gradient {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border: none;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-gradient:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-gradient:active {
  transform: translateY(0);
}

/* ===== 焦点样式优化 ===== */
:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ===== 选中文字样式 ===== */
::selection {
  background: rgba(59, 130, 246, 0.2);
  color: #1e40af;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ===== 响应式容器 ===== */
.container-responsive {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container-responsive {
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .container-responsive {
    padding: 0 32px;
  }
}

/* ===== 文字截断 ===== */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
