/* ==========================================
   site-base.css - 全站通用基础样式（从 home-base 抽取）
   覆盖：CSS 变量、基础背景、通用卡片、通用动画、滚动条、性能优化
   ========================================== */

/* CSS 变量定义 */
:root {
  --primary-blue: #3b82f6;       /* Blue-500 */
  --primary-blue-light: #60a5fa; /* Blue-400 */
  --primary-blue-dark: #2563eb;  /* Blue-600 */
  --primary-blue-bg: #eff6ff;    /* Blue-50 */

  --secondary-indigo: #818cf8;   /* Indigo-400 */
  --secondary-indigo-light: #a5b4fc;

  --bg-light: #f8fafc;
  --text-dark: #1e293b;          /* Slate-800 */
  --text-light: #64748b;         /* Slate-500 */
  --white: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 50%, #ffffff 100%);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  position: relative;
  overflow-x: hidden;
}

/* 几何装饰背景：静态即可。整屏 will-change + 无限动画会逼出合成层，
   再叠加固定顶栏采样时就会整页闪。装饰漂浮不值得。 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(129, 140, 248, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(96, 165, 250, 0.05) 0%, transparent 50%);
  z-index: -2;
  pointer-events: none;
}

/* 现代卡片样式 */
.modern-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.modern-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 特殊效果 */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.icon-gradient {
  background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 滚动淡入：只用 opacity，不留 transform，避免多余合成层。 */
.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transition: none;
  }
}

/* 性能优化 */
* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* 现代化滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

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

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

/* ========== 加载动画 ========== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 200px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-text {
  font-size: 16px;
  color: #6b7280;
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

.loading-dots {
  display: inline-block;
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

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

