/**
 * 现代化CSS架构 - 小张个人网站 v3
 * 优化流畅度 + 蜡笔小新宠物
 */

/* ============================================
   CSS 变量 - 主题配置 (玄幻风格)
   ============================================ */
:root {
  /* 主色调 - 玄幻紫金色 */
  --primary: #8B5CF6;
  --primary-light: #A78BFA;
  --primary-dark: #7C3AED;
  --secondary: #C084FC;
  --accent: #F472B6;
  
  /* 渐变 - 玄幻星空 */
  --gradient-primary: linear-gradient(135deg, #4C1D95 0%, #7C3AED 50%, #8B5CF6 100%);
  --gradient-hero: radial-gradient(ellipse at 20% 10%, #1E1B4B 0%, #312E81 20%, #0F172A 55%, #020617 100%);
  --gradient-glass: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(196, 181, 253, 0.06) 100%);
  --gradient-neon: linear-gradient(90deg, #8B5CF6, #F472B6, #10B981, #8B5CF6);
  --gradient-magic: radial-gradient(circle, rgba(167,139,250,0.4) 0%, transparent 70%);
  
  /* 深色背景 */
  --bg-dark: #0f172a;
  --bg-dark-secondary: #1e293b;
  --bg-dark-tertiary: #334155;
  
  /* 浅色 */
  --text-light: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* 玻璃效果 */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* 间距 */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* 圆角 */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --radius-full: 9999px;
  
  /* 动画 */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  
  /* 发光效果 */
  --glow-primary: 0 0 20px rgba(102, 126, 234, 0.5);
  --glow-secondary: 0 0 30px rgba(139, 92, 246, 0.4);
  --glow-accent: 0 0 40px rgba(236, 72, 153, 0.3);
  --glow-neon: 0 0 10px, 0 0 20px, 0 0 30px;
  
  /* 字体 */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

/* ============================================
   基础重置
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

ul, ol {
  list-style: none;
}

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

/* ============================================
   背景效果 - 幻境星云 (微动态)
   ============================================ */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse 80% 60% at 50% 40%, #1a1150 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, #1e1145 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 70%, #0f2245 0%, transparent 65%),
    #020617;
  z-index: -1;
}

.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.bg-mesh::before,
.bg-mesh::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}

.bg-mesh::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
  animation: nebulaDrift1 25s ease-in-out infinite;
}

.bg-mesh::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.35), transparent 70%);
  animation: nebulaDrift2 30s ease-in-out infinite;
}

@keyframes nebulaDrift1 {
  0%, 100% { top: 10%; left: 20%; transform: scale(1); }
  25% { top: 40%; left: 60%; transform: scale(1.3); }
  50% { top: 60%; left: 70%; transform: scale(0.9); }
  75% { top: 20%; left: 40%; transform: scale(1.2); }
}

@keyframes nebulaDrift2 {
  0%, 100% { top: 50%; left: 70%; transform: scale(1); }
  33% { top: 15%; left: 30%; transform: scale(1.4); }
  66% { top: 70%; left: 20%; transform: scale(0.8); }
}

.bg-aurora {
  position: fixed;
  top: 0;
  left: -50%;
  width: 200%;
  height: 40%;
  z-index: -1;
  pointer-events: none;
  background: 
    linear-gradient(90deg, 
      transparent 0%, 
      rgba(17, 185, 129, 0.08) 15%,
      rgba(59, 130, 246, 0.1) 30%,
      transparent 50%,
      rgba(139, 92, 246, 0.08) 70%,
      transparent 100%
    );
  filter: blur(40px);
  animation: auroraSlide 35s linear infinite;
}

@keyframes auroraSlide {
  0% { transform: translateX(-10%) translateY(0) skewX(-3deg); }
  50% { transform: translateX(10%) translateY(-15px) skewX(3deg); }
  100% { transform: translateX(-10%) translateY(0) skewX(-3deg); }
}

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ============================================
   顶部导航栏
   ============================================ */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: rgba(15, 23, 42, 0.82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(167, 139, 250, 0.4);
}

.nav-brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(139, 92, 246, 0.25);
}

.nav-social {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-social .social-link {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.nav-social .social-link:hover {
  color: var(--primary-light);
  transform: translateY(-2px);
}

/* ============================================
   宠物容器
   ============================================ */
.sidebar-pet {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 999;
}

/* ============================================
   主内容区域 - 整页滚动
   ============================================ */
.main-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: var(--space-xl);
  padding-top: 72px;
}

/* ============================================
   英雄区 - Hero Section
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl) 0;
}

.hero-content {
  max-width: 800px;
  animation: fadeInUp 0.8s ease forwards;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.hero-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-weight: 400;
}

.hero-typing {
  display: inline-block;
  color: var(--accent);
  border-right: 2px solid var(--accent);
  animation: blink 0.7s infinite;
  padding-right: 4px;
}

.hero-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   按钮
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
  color: white;
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-light);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
  color: var(--text-light);
}

/* ============================================
   卡片网格
   ============================================ */
.section {
  padding: var(--space-3xl) var(--space-xl);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================
   卡片样式 - 3D悬浮效果优化
   ============================================ */
.card-wrapper {
  perspective: 1000px;
  -webkit-perspective: 1000px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  contain: layout style paint;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.2);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-light);
}

.card-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1) 0%,
    rgba(139, 92, 246, 0.05) 50%,
    rgba(236, 72, 153, 0.08) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
  border-radius: inherit;
}

.card::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--secondary) 50%,
    var(--accent) 100%
  );
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  filter: blur(15px);
  transition: opacity 0.5s ease;
}

/* ============================================
   友链卡片
   ============================================ */
.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.friend-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  contain: layout style paint;
}

.friend-card:hover {
  transform: translateX(8px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.friend-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--glass-border);
  flex-shrink: 0;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.friend-info {
  flex: 1;
  min-width: 0;
}

.friend-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--text-light);
}

.friend-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   页脚
   ============================================ */
.footer {
  padding: var(--space-3xl) var(--space-xl);
  background: var(--bg-dark-secondary);
  border-top: 1px solid var(--glass-border);
  margin-top: var(--space-3xl);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(139, 92, 246, 0.6) 20%, 
    rgba(244, 114, 182, 0.5) 50%, 
    rgba(16, 185, 129, 0.4) 80%, 
    transparent 100%);
  opacity: 0.6;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-sponsor {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.footer-sponsor a {
  color: var(--primary-light);
  font-weight: 600;
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-lg);
}

/* 旧宠物样式已移除，使用 Live2D 看板娘 */

/* ============================================
   动画
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes blink {
  0%, 100% { border-color: var(--accent); }
  50% { border-color: transparent; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes glow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  }
  50% { 
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.6);
  }
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .friend-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .top-nav {
    padding: 0 var(--space-md);
    height: 56px;
  }
  
  .nav-brand-text {
    display: none;
  }
  
  .nav-link {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
  }
  
  .nav-social .social-link {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  
  .main-content {
    width: 100%;
    margin: 0;
    padding: var(--space-md);
    padding-top: 64px;
  }
  
  .hero {
    min-height: calc(100vh - 60px);
    padding: var(--space-xl) var(--space-md);
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .top-nav {
    padding: 0 var(--space-sm);
    height: 48px;
  }
  
  .nav-avatar {
    width: 28px;
    height: 28px;
  }
  
  .nav-link {
    font-size: 0.7rem;
    padding: 2px 8px;
  }
  
  .nav-social {
    gap: var(--space-sm);
  }
  
  .nav-social .social-link {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .section {
    padding: var(--space-2xl) var(--space-md);
  }
}

/* ============================================
   页面加载动画
   ============================================ */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.page-loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  z-index: 2;
}

.loader-brand {
  margin-bottom: 3rem;
}

.loader-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.loader-spinner {
  width: 100%;
  height: 100%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: loader-spin 1s linear infinite;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loader-progress-container {
  width: 300px;
  margin: 0 auto 1rem;
}

.loader-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--glass-bg);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--glass-border);
}

.loader-progress-fill {
  height: 100%;
  width: 0;
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
}

.loader-progress-glow {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255,255,255,0.3) 50%, 
    transparent 100%);
  animation: loader-shine 1.5s ease-in-out infinite;
}

@keyframes loader-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.loader-progress-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-weight: 600;
}

.loader-tips {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 1rem;
  animation: loader-pulse 2s ease-in-out infinite;
}

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

.loader-bg-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* ============================================
   回到顶部按钮
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  z-index: 1000;
  overflow: hidden;
}

.back-to-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.back-to-top:hover::before {
  left: 100%;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 
    0 8px 30px rgba(99, 102, 241, 0.5),
    0 0 40px rgba(99, 102, 241, 0.3);
}

.back-to-top:active {
  transform: translateY(-2px) scale(1.05);
}

.back-to-top .icon {
  font-size: 1.5rem;
  color: white;
  transition: transform var(--transition-base);
}

.back-to-top:hover .icon {
  transform: translateY(-3px);
  animation: bounce-up 0.6s ease infinite;
}

@keyframes bounce-up {
  0%, 100% { transform: translateY(-3px); }
  50% { transform: translateY(-6px); }
}

.back-to-top .progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.back-to-top .progress-ring circle {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 2;
}

.back-to-top .progress-ring .progress {
  stroke: rgba(255, 255, 255, 0.6);
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
  transition: stroke-dashoffset 0.3s ease;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
  }

  .back-to-top .icon {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .back-to-top {
    bottom: 90px;
    right: 15px;
    width: 40px;
    height: 40px;
  }

  .back-to-top .icon {
    font-size: 1rem;
  }
}

/* ============================================
   工具类
   ============================================ */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 旧宠物样式已移除，使用 Live2D 看板娘 */

/* 加载动画简化 */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-progress-bar {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
}

.loader-progress-bar::after {
  content: '';
  display: block;
  width: 50%;
  height: 100%;
  background: var(--gradient-primary);
  animation: loadingStripes 0.8s linear infinite;
}

@keyframes loadingStripes {
  from { transform: translateX(-100%); }
  to { transform: translateX(200%); }
}

.hero-typing-enhanced {
  display: inline-block;
  color: #C084FC;
  border-right: 3px solid #F472B6;
  padding-right: 6px;
  text-shadow: 0 0 20px rgba(192, 132, 252, 0.4), 0 0 40px rgba(244, 114, 182, 0.2);
  animation: typingBlink 0.8s infinite, typingGlow 2s ease-in-out infinite;
  line-height: 1.8;
}

@keyframes typingBlink {
  0%, 100% { border-color: #F472B6; }
  50% { border-color: transparent; }
}

@keyframes typingGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(192, 132, 252, 0.4); }
  50% { text-shadow: 0 0 30px rgba(244, 114, 182, 0.6), 0 0 60px rgba(192, 132, 252, 0.3); }
}

/* ============================================
   卡片 Stagger 入场动画
   ============================================ */
.card.scroll-reveal,
.friend-card.scroll-reveal {
  transition: all 0.6s cubic-bezier(0.5, 0, 0, 1);
  transition-delay: var(--stagger, 0s);
}

.friend-card:hover {
  transform: translateX(8px) scale(1.02);
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 
    0 10px 30px rgba(139, 92, 246, 0.15),
    0 0 40px rgba(192, 132, 252, 0.1);
  background: rgba(139, 92, 246, 0.08);
}

.friend-card:hover .friend-avatar {
  transform: scale(1.15);
  border-color: rgba(167, 139, 250, 0.6);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.friend-avatar {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-icon {
  animation: iconFloat 3s ease-in-out infinite;
  animation-delay: var(--stagger, 0s);
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ============================================
   滚动条样式优化
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8B5CF6, #C084FC, #F472B6);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #A78BFA, #E9D5FF, #F9A8D4);
}
