/**
 * 尘渊文化 - 高级设计感样式
 * Premium Design System - Glassmorphism, Gradients, Animations
 * @version 1.0.0
 */

/* ========== 设计令牌扩展 ========== */
:root {
  /* 高级渐变 */
  --gradient-aurora: linear-gradient(135deg, 
    rgba(144, 202, 249, 0.15) 0%, 
    rgba(99, 102, 241, 0.1) 25%,
    rgba(139, 92, 246, 0.1) 50%,
    rgba(236, 72, 153, 0.05) 75%,
    rgba(245, 158, 11, 0.05) 100%);
  
  --gradient-mesh: 
    radial-gradient(at 40% 20%, rgba(144, 202, 249, 0.15) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
    radial-gradient(at 80% 50%, rgba(236, 72, 153, 0.05) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  
  --gradient-shine: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.1) 45%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 55%,
    transparent 60%
  );
  
  /* 霓虹光效 */
  --glow-primary: 0 0 20px rgba(144, 202, 249, 0.3), 0 0 40px rgba(144, 202, 249, 0.1);
  --glow-secondary: 0 0 30px rgba(99, 102, 241, 0.2);
  --glow-accent: 0 0 20px rgba(139, 92, 246, 0.25);
  
  /* 玻璃拟态 */
  --glass-bg: rgba(18, 18, 18, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(20px) saturate(180%);
  
  /* 精致阴影 */
  --shadow-elevated: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 8px 16px rgba(0, 0, 0, 0.2),
    0 16px 32px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  
  --shadow-floating:
    0 4px 6px rgba(0, 0, 0, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.25),
    0 24px 48px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 60px rgba(144, 202, 249, 0.05);
  
  /* 动画时间 */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== 网格背景 ========== */
.grid-background {
  position: relative;
}

.grid-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(144, 202, 249, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(144, 202, 249, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* 点阵背景 */
.dot-background {
  position: relative;
}

.dot-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
    circle at center,
    rgba(144, 202, 249, 0.15) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  pointer-events: none;
}

/* ========== 玻璃拟态卡片 ========== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent
  );
}

.glass-card:hover {
  border-color: rgba(144, 202, 249, 0.2);
  box-shadow: var(--shadow-floating);
}

/* ========== 霓虹边框卡片 ========== */
.neon-card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
}

.neon-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, 
    rgba(144, 202, 249, 0.5), 
    transparent 30%,
    transparent 70%,
    rgba(139, 92, 246, 0.3)
  );
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.neon-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow-primary);
}

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

/* ========== 渐变文字效果 ========== */
.gradient-text {
  background: linear-gradient(135deg, 
    #ffffff 0%, 
    #90caf9 25%, 
    #64b5f6 50%,
    #42a5f5 75%,
    #90caf9 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* 彩虹渐变文字 */
.rainbow-text {
  background: linear-gradient(90deg, 
    #90caf9, 
    #a78bfa, 
    #f472b6, 
    #fbbf24,
    #90caf9
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: rainbow-shift 4s linear infinite;
}

@keyframes rainbow-shift {
  to { background-position: 200% center; }
}

/* ========== 精致按钮样式 ========== */
.btn-premium {
  position: relative;
  padding: 14px 32px;
  background: linear-gradient(135deg, 
    rgba(144, 202, 249, 0.1),
    rgba(99, 102, 241, 0.05)
  );
  border: 1px solid rgba(144, 202, 249, 0.3);
  border-radius: var(--radius-xl);
  color: var(--md-sys-color-primary);
  font-weight: 500;
  letter-spacing: 0.5px;
  overflow: hidden;
  transition: all 0.3s var(--ease-out-expo);
}

.btn-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-shine);
  transition: left 0.6s ease;
}

.btn-premium::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, 
    rgba(144, 202, 249, 0.6),
    transparent 50%,
    rgba(139, 92, 246, 0.4)
  );
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
  border-color: rgba(144, 202, 249, 0.5);
}

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

.btn-premium:hover::after {
  opacity: 1;
}

/* 填充式高级按钮 */
.btn-premium-filled {
  background: linear-gradient(135deg, #90caf9, #64b5f6);
  border: none;
  color: #003258;
  box-shadow: 0 4px 15px rgba(144, 202, 249, 0.3);
}

.btn-premium-filled:hover {
  box-shadow: 0 8px 25px rgba(144, 202, 249, 0.4), var(--glow-primary);
}

/* ========== 悬浮光效 ========== */
.float-glow {
  position: relative;
}

.float-glow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(144, 202, 249, 0.2) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
}

.float-glow:hover::after {
  opacity: 1;
  animation: pulse-glow 2s ease-in-out infinite;
}

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

/* ========== 边框流动动画 ========== */
.border-flow-animated {
  position: relative;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.border-flow-animated::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(90deg, 
    transparent,
    rgba(144, 202, 249, 0.8),
    rgba(139, 92, 246, 0.8),
    rgba(236, 72, 153, 0.6),
    transparent
  );
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background-size: 200% 100%;
  animation: border-flow 3s linear infinite;
}

@keyframes border-flow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== 磁吸卡片效果 ========== */
.magnetic-card {
  transition: transform 0.3s var(--ease-out-expo);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.magnetic-card:hover {
  transform: translateY(-8px) rotateX(2deg);
}

/* ========== 堆叠卡片效果 ========== */
.stack-card {
  position: relative;
}

.stack-card::before,
.stack-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--radius-lg);
  border: 1px solid var(--md-sys-color-outline-variant);
  z-index: -1;
  transition: all 0.3s var(--ease-out-expo);
}

.stack-card::before {
  transform: translateY(8px) scale(0.96);
  opacity: 0.5;
}

.stack-card::after {
  transform: translateY(16px) scale(0.92);
  opacity: 0.3;
}

.stack-card:hover::before {
  transform: translateY(12px) scale(0.96);
}

.stack-card:hover::after {
  transform: translateY(24px) scale(0.92);
}

/* ========== 精致标签 ========== */
.tag-premium {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(144, 202, 249, 0.1);
  border: 1px solid rgba(144, 202, 249, 0.2);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  position: relative;
  overflow: hidden;
}

.tag-premium::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--md-sys-color-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--md-sys-color-primary);
}

/* ========== 分栏布局优化 ========== */
.section-divider {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent,
    rgba(144, 202, 249, 0.3),
    transparent
  );
  margin: 80px 0;
}

.section-divider::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--md-sys-color-surface);
  border: 1px solid rgba(144, 202, 249, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== 统计数据展示 ========== */
.stat-premium {
  text-align: center;
  padding: 32px 24px;
  position: relative;
}

.stat-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--md-sys-color-primary), transparent);
}

.stat-number-premium {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, #90caf9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label-premium {
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ========== 时间线设计 ========== */
.timeline-premium {
  position: relative;
  padding-left: 40px;
}

.timeline-premium::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg,
    transparent,
    rgba(144, 202, 249, 0.3) 10%,
    rgba(144, 202, 249, 0.3) 90%,
    transparent
  );
}

.timeline-item-premium {
  position: relative;
  padding: 24px 0;
}

.timeline-item-premium::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 28px;
  width: 10px;
  height: 10px;
  background: var(--md-sys-color-surface);
  border: 2px solid var(--md-sys-color-primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(144, 202, 249, 0.1);
}

/* ========== 引用块设计 ========== */
.quote-premium {
  position: relative;
  padding: 32px 32px 32px 64px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-left: 3px solid var(--md-sys-color-primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.8;
}

.quote-premium::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 24px;
  font-size: 4rem;
  font-family: Georgia, serif;
  color: var(--md-sys-color-primary);
  opacity: 0.3;
  line-height: 1;
}

/* ========== 代码块设计 ========== */
.code-premium {
  background: linear-gradient(135deg, #0d1117, #161b22);
  border: 1px solid rgba(144, 202, 249, 0.1);
  border-radius: var(--radius-md);
  padding: 20px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  overflow-x: auto;
  position: relative;
}

.code-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(180deg, rgba(144, 202, 249, 0.05), transparent);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ========== 悬浮操作按钮 ========== */
.fab-premium {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #90caf9, #64b5f6);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(144, 202, 249, 0.4);
  transition: all 0.3s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.fab-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fab-premium:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 25px rgba(144, 202, 249, 0.5), var(--glow-primary);
}

.fab-premium:hover::before {
  opacity: 1;
}

/* ========== 响应式优化 ========== */
@media (max-width: 768px) {
  .grid-background::before {
    background-size: 40px 40px;
  }
  
  .glass-card {
    backdrop-filter: blur(10px) saturate(150%);
  }
  
  .stat-number-premium {
    font-size: 2.5rem;
  }
  
  .btn-premium {
    padding: 12px 24px;
    font-size: 0.875rem;
  }
  
  .quote-premium {
    padding: 24px 24px 24px 48px;
    font-size: 1rem;
  }
  
  .quote-premium::before {
    font-size: 3rem;
    left: 16px;
  }
}

/* ========== 深色模式优化 ========== */
@media (prefers-color-scheme: dark) {
  :root {
    --glass-bg: rgba(18, 18, 18, 0.8);
  }
}

/* ========== 减少动画偏好 ========== */
@media (prefers-reduced-motion: reduce) {
  .gradient-text,
  .rainbow-text,
  .border-flow-animated::before {
    animation: none;
  }
  
  .float-glow:hover::after {
    animation: none;
  }
}
