/* ============================================================
   Nexus.css — 前沿设计系统
   基于 UX 指南 100 条规则审计，针对二次元赛博朋克风格网站
   2025-2026 趋势：Scroll-driven · Glassmorphism 2.0 · Micro-interactions
   ============================================================ */

/* ============================================================
   PART 1: 字体系统升级
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* 模块化字号比例 (Major Third: 1.25) */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
  --text-5xl:  3rem;      /* 48px */
  --text-6xl:  3.75rem;   /* 60px */

  /* 行高系统 */
  --leading-tight:   1.25;
  --leading-snug:    1.375;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;

  /* 间距系统 (4px base) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* 字重映射 */
  --font-light:    300;
  --font-normal:   400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;
  --font-extrabold:800;
  --font-black:    900;

  /* 字体族 */
  --font-display:  'Orbitron', 'JetBrains Mono', monospace;
  --font-body:     'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Code', monospace;
  --font-jp:       'Noto Sans JP', 'Hiragino Sans', sans-serif;
}

/* 全局字体应用 */
body {
  font-family: var(--font-body);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  letter-spacing: 0.02em;
  line-height: var(--leading-tight);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

/* ============================================================
   PART 2: 可访问性基础
   规则 #28 #36 #41 #99: focus-visible, contrast, motion
   ============================================================ */

/* 焦点可见指示器 */
*:focus-visible {
  outline: 2px solid var(--accent-cyan, #00d4ff);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 跳过导航链接 */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-primary, #ff6b9d);
  color: white;
  padding: var(--space-3) var(--space-6);
  border-radius: 0 0 var(--radius-md, 16px) var(--radius-md, 16px);
  z-index: 10000;
  font-weight: var(--font-semibold);
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
}

/* ============================================================
   PART 3: 玻璃质感 2.0
   多层毛玻璃 + 动态渐变边框 + 噪声纹理
   ============================================================ */

.glass-panel {
  background: rgba(26, 21, 64, 0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 24px);
  position: relative;
  overflow: hidden;
}

/* 噪声纹理叠加 */
.glass-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 256px;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}

.glass-panel > * {
  position: relative;
  z-index: 1;
}

/* 动态渐变边框 */
.glass-border-animated {
  position: relative;
  background: rgba(26, 21, 64, 0.7);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg, 24px);
}

.glass-border-animated::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    #ff6b9d,
    #6a5af9,
    #00d4ff,
    #ff6b9d
  );
  background-size: 400% 400%;
  animation: gradient-border-rotate 8s ease infinite;
  z-index: -1;
  opacity: 0.6;
}

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

/* ============================================================
   PART 4: 滚动驱动叙事
   规则 #1 smooth-scroll + Intersection Observer 交错揭示
   ============================================================ */

html {
  scroll-behavior: smooth;
}

/* 滚动进度条 */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #ff6b9d, #6a5af9, #00d4ff);
  z-index: 1001;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(255, 107, 157, 0.5);
}

/* 滚动揭示动画 */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* 交错延迟变体 */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* 方向变体 */
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-left.revealed,
.reveal-right.revealed,
.reveal-scale.revealed {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* ============================================================
   PART 5: 微交互系统
   规则 #8 #29 #30: 150-300ms 过渡 + hover/active/press 反馈
   ============================================================ */

/* 磁吸按钮 */
.magnetic-btn {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* 涟漪效果容器 */
.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 数字滚动计数 */
.counter-value {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

/* 悬停光条扫描 (规则 #29: hover 反馈) */
.hover-scan {
  position: relative;
  overflow: hidden;
}

.hover-scan::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}

.hover-scan:hover::after {
  left: 150%;
}

/* 按压回弹 (规则 #30: active 状态) */
.pressable {
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pressable:active {
  transform: scale(0.96);
}

/* ============================================================
   PART 6: 自定义光标体验
   ============================================================ */

.custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 107, 157, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transition: width 0.3s, height 0.3s, background 0.3s, border-color 0.3s;
  mix-blend-mode: difference;
}

.custom-cursor-dot {
  position: fixed;
  width: 4px;
  height: 4px;
  background: #ff6b9d;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  transition: transform 0.15s ease;
}

/* 光标状态变化 */
.custom-cursor.hover-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 107, 157, 0.15);
  border-color: rgba(255, 107, 157, 0.9);
}

.custom-cursor.hover-text {
  width: 8px;
  height: 24px;
  border-radius: 4px;
  border-color: rgba(255, 255, 255, 0.7);
}

/* 光标尾迹粒子 */
.cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: trail-fade 0.8s ease-out forwards;
}

@keyframes trail-fade {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

/* ============================================================
   PART 7: 骨架屏加载
   规则 #10: 用骨架屏替代空白等待
   ============================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(106, 90, 249, 0.06) 25%,
    rgba(106, 90, 249, 0.15) 50%,
    rgba(106, 90, 249, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm, 10px);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 骨架屏组件 */
.skeleton-card {
  padding: var(--space-8);
  background: var(--bg-card, rgba(26, 21, 64, 0.5));
  border-radius: var(--radius-lg, 24px);
  border: 1px solid var(--border-color, rgba(106, 90, 249, 0.1));
}

.skeleton-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md, 16px);
}

.skeleton-title {
  width: 70%;
  height: 24px;
  margin-bottom: var(--space-4);
}

.skeleton-text {
  width: 100%;
  height: 14px;
  margin-bottom: var(--space-3);
}

.skeleton-text:last-child {
  width: 50%;
}

.skeleton-tag {
  display: inline-block;
  width: 60px;
  height: 24px;
  border-radius: 12px;
  margin-right: var(--space-2);
}

/* 图片渐进加载 */
.img-blur-load {
  position: relative;
  overflow: hidden;
}

.img-blur-load::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  background-size: cover;
  filter: blur(20px);
  transform: scale(1.1);
  transition: opacity 0.5s ease;
}

.img-blur-load.loaded::before {
  opacity: 0;
}

.img-blur-load img {
  transition: opacity 0.5s ease;
  opacity: 0;
}

.img-blur-load.loaded img {
  opacity: 1;
}

/* ============================================================
   PART 8: 导航增强
   规则 #2 #3: 粘性导航 + 活动状态高亮
   ============================================================ */

/* 活动导航指示器 */
.nav-indicator {
  position: absolute;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #ff6b9d, #6a5af9, #00d4ff);
  border-radius: 2px;
  transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 移动端底部导航栏 */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 12, 41, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid rgba(255, 107, 157, 0.2);
  z-index: 999;
  padding: var(--space-2) var(--space-4);
  padding-bottom: env(safe-area-inset-bottom, var(--space-2));
}

.mobile-bottom-nav .nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mobile-bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted, #7a6aaa);
  font-size: 0.65rem;
  padding: var(--space-2);
  border-radius: var(--radius-sm, 10px);
  transition: all 0.2s ease;
  text-decoration: none;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

.mobile-bottom-nav .nav-item i {
  font-size: 1.25rem;
}

.mobile-bottom-nav .nav-item.active {
  color: var(--accent-primary, #ff6b9d);
  background: rgba(255, 107, 157, 0.1);
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: block;
  }

  /* 补偿底部导航高度 */
  .main-content {
    padding-bottom: 80px;
  }

  /* 移动端隐藏桌面端导航中的链接文字 */
  .nav-link span { display: none; }
}

/* ============================================================
   PART 9: 3D 深度增强
   ============================================================ */

/* 深度阴影系统 */
.shadow-depth-1 {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24);
}

.shadow-depth-2 {
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.12);
}

.shadow-depth-3 {
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.15),
    0 3px 6px rgba(0, 0, 0, 0.10);
}

.shadow-depth-4 {
  box-shadow:
    0 14px 28px rgba(255, 107, 157, 0.12),
    0 10px 10px rgba(106, 90, 249, 0.08);
}

.shadow-depth-5 {
  box-shadow:
    0 19px 38px rgba(255, 107, 157, 0.15),
    0 15px 12px rgba(106, 90, 249, 0.10);
}

/* 悬浮抬升 */
.lift-on-hover {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
}

.lift-on-hover:hover {
  transform: translateY(-8px);
  box-shadow:
    0 20px 40px rgba(255, 107, 157, 0.15),
    0 8px 16px rgba(106, 90, 249, 0.1);
}

/* ============================================================
   PART 10: 动效叙事增强
   ============================================================ */

/* 文本渐入动画 */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  animation: text-reveal-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes text-reveal-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 霓虹闪烁增强版 */
.neon-text-enhanced {
  color: #fff;
  text-shadow:
    0 0 7px #fff,
    0 0 10px #fff,
    0 0 21px #fff,
    0 0 42px #ff6b9d,
    0 0 82px #ff6b9d,
    0 0 92px #ff6b9d,
    0 0 102px #ff6b9d,
    0 0 151px #ff6b9d;
  animation: neon-pulse-enhanced 1.5s ease-in-out infinite alternate;
}

@keyframes neon-pulse-enhanced {
  0% {
    text-shadow:
      0 0 4px #fff,
      0 0 8px #fff,
      0 0 18px #fff,
      0 0 38px #ff6b9d,
      0 0 73px #ff6b9d;
  }
  100% {
    text-shadow:
      0 0 7px #fff,
      0 0 10px #fff,
      0 0 21px #fff,
      0 0 42px #6a5af9,
      0 0 82px #6a5af9,
      0 0 92px #6a5af9,
      0 0 102px #6a5af9,
      0 0 151px #6a5af9;
  }
}

/* 背景粒子连线 */
.particle-lines-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* 视差层 */
.parallax-layer {
  will-change: transform;
}

.parallax-slow {
  transform: translateZ(-10px) scale(1.5);
}

.parallax-mid {
  transform: translateZ(-5px) scale(1.25);
}

/* ============================================================
   PART 11: Toast 通知 & 弹窗增强
   规则 #34 #82: 3-5秒自动消失 + 成功确认
   ============================================================ */

.toast-enhanced {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 12, 41, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(106, 90, 249, 0.3);
  border-radius: 50px;
  padding: var(--space-4) var(--space-6);
  color: white;
  font-weight: var(--font-medium);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: 0 10px 40px rgba(106, 90, 249, 0.3);
  animation: toast-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-enhanced.leaving {
  animation: toast-leave 0.3s ease forwards;
}

.toast-enhanced.success { border-color: rgba(16, 185, 129, 0.5); }
.toast-enhanced.error   { border-color: rgba(239, 68, 68, 0.5); }

@keyframes toast-enter {
  to { transform: translateX(-50%) translateY(0); }
}

@keyframes toast-leave {
  to { transform: translateX(-50%) translateY(100px); opacity: 0; }
}

/* ============================================================
   PART 12: 响应式增强
   规则 #64 #65 #67: mobile-first + 多断点测试
   ============================================================ */

@media (max-width: 375px) {
  :root {
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
  }

  .section {
    padding: var(--space-8) 0;
  }

  .container {
    padding: 0 var(--space-4);
  }
}

@media (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }

  :root {
    --text-6xl: 4.5rem;
    --text-5xl: 3.5rem;
  }
}

/* ============================================================
   PART 13: 暗色主题下的特殊处理
   ============================================================ */

[data-theme="dark"] .glass-panel {
  background: rgba(26, 21, 64, 0.7);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .lift-on-hover:hover {
  box-shadow:
    0 20px 40px rgba(106, 90, 249, 0.25),
    0 8px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .custom-cursor {
  mix-blend-mode: normal;
  border-color: rgba(255, 107, 157, 0.8);
}