/* ═══════════════════════════════════════════════════════════
   fx-enhance.css — 繁星桥前端视觉增强样式
   渐进增强：不破坏原有样式，只追加新效果
   ═══════════════════════════════════════════════════════════ */

/* ── 1. Google Fonts 注入 ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Serif+SC:wght@400;600;700&display=swap');

/* ── 2. 全局排版升级 ── */
body {
  font-family: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 3. 增强背景光晕 ── */
.fx-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.12;
  animation: fxGlowDrift 20s ease-in-out infinite alternate;
}
.fx-glow-1 {
  width: 600px; height: 600px;
  background: var(--accent, #a78bfa);
  top: -200px; right: -100px;
  animation-duration: 25s;
}
.fx-glow-2 {
  width: 500px; height: 500px;
  background: var(--accent3, #f9a8d4);
  bottom: -150px; left: -100px;
  animation-duration: 30s;
  animation-direction: alternate-reverse;
}
.fx-glow-3 {
  width: 400px; height: 400px;
  background: var(--accent2, #818cf8);
  top: 40%; left: 50%;
  transform: translateX(-50%);
  animation-duration: 22s;
  opacity: 0.06;
}
@keyframes fxGlowDrift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
  100% { transform: translate(10px, -10px) scale(1.02); }
}

/* ── 4. 滚动触发动画 ── */
.fx-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.fx-reveal.fx-visible {
  opacity: 1;
  transform: translateY(0);
}
.fx-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.fx-reveal-left.fx-visible {
  opacity: 1;
  transform: translateX(0);
}
.fx-reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.fx-reveal-scale.fx-visible {
  opacity: 1;
  transform: scale(1);
}
/* stagger 延迟 */
.fx-delay-1 { transition-delay: 0.1s; }
.fx-delay-2 { transition-delay: 0.2s; }
.fx-delay-3 { transition-delay: 0.3s; }
.fx-delay-4 { transition-delay: 0.4s; }
.fx-delay-5 { transition-delay: 0.5s; }

/* ── 5. 卡片增强 hover ── */
.fx-card-hover {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}
.fx-card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4),
              0 0 40px rgba(167,139,250,0.08);
}

/* ── 6. 按钮涟漪效果 ── */
.fx-ripple {
  position: relative;
  overflow: hidden;
}
.fx-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), 
    rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.fx-ripple:active::after {
  opacity: 1;
  transition: opacity 0s;
}

/* ── 7. 骨架屏 ── */
.fx-skeleton {
  background: linear-gradient(90deg, 
    rgba(167,139,250,0.06) 25%, 
    rgba(167,139,250,0.12) 50%, 
    rgba(167,139,250,0.06) 75%);
  background-size: 200% 100%;
  animation: fxShimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes fxShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.fx-skeleton-text {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 6px;
}
.fx-skeleton-text:last-child { width: 60%; }
.fx-skeleton-title {
  height: 22px;
  width: 70%;
  margin-bottom: 16px;
}
.fx-skeleton-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
}
.fx-skeleton-card {
  background: var(--bg-card, #141728);
  border: 1px solid var(--border, rgba(167,139,250,0.14));
  border-radius: 16px;
  padding: 20px;
}
.fx-skeleton-card .fx-skeleton-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  margin-bottom: 12px;
}

/* ── 8. 增强卡片玻璃效果 ── */
.fx-glass {
  background: rgba(20, 23, 40, 0.6);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(167,139,250,0.12);
}

/* ── 9. Hero 区增强 ── */
h1.fx-enhanced-title {
  font-family: 'Noto Serif SC', 'Inter', serif;
  letter-spacing: -0.02em;
}
.hero-badge.fx-enhanced {
  animation: fxBadgePulse 3s ease-in-out infinite;
}
@keyframes fxBadgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(167,139,250,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(167,139,250,0); }
}

/* ── 10. 导航增强 ── */
nav.fx-enhanced {
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
nav.fx-scrolled {
  background: rgba(11,13,25,0.92) !important;
  box-shadow: 0 4px 40px rgba(0,0,0,0.5) !important;
}

/* ── 11. 底部导航（移动端）── */
.fx-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(11,13,25,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(167,139,250,0.12);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.fx-mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.fx-mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted, #6e6c87);
  font-size: 10px;
  padding: 4px 12px;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
  min-width: 56px;
}
.fx-mobile-nav-item .fx-nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fx-mobile-nav-item.fx-active {
  color: var(--accent, #a78bfa);
}
.fx-mobile-nav-item.fx-active .fx-nav-icon {
  transform: scale(1.1);
}
.fx-mobile-nav-item:active .fx-nav-icon {
  transform: scale(0.9);
}

/* 移动端显示底部导航 */
@media (max-width: 768px) {
  .fx-mobile-nav { display: block; }
  /* 为底部导航留出空间 */
  footer { padding-bottom: 72px !important; }
  section:last-of-type { margin-bottom: 72px; }
}

/* ── 12. 汉堡菜单按钮 ── */
.fx-hamburger {
  display: none;
  width: 36px; height: 36px;
  background: none; border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 300;
}
.fx-hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.fx-hamburger.fx-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.fx-hamburger.fx-open span:nth-child(2) {
  opacity: 0;
}
.fx-hamburger.fx-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
@media (max-width: 768px) {
  .fx-hamburger { display: flex; }
}

/* ── 13. 移动端菜单面板 ── */
.fx-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.fx-mobile-menu.fx-open {
  opacity: 1;
  pointer-events: auto;
}
.fx-mobile-menu-panel {
  position: absolute;
  top: 0; right: 0;
  width: 280px;
  height: 100%;
  background: var(--bg-card, #141728);
  border-left: 1px solid var(--border, rgba(167,139,250,0.14));
  padding: 80px 24px 32px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.fx-mobile-menu.fx-open .fx-mobile-menu-panel {
  transform: translateX(0);
}
.fx-mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid var(--border, rgba(167,139,250,0.08));
  transition: color 0.2s, transform 0.2s;
}
.fx-mobile-menu-link:hover {
  color: var(--accent);
  transform: translateX(4px);
}
.fx-mobile-menu-link .fx-link-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
}
@media (max-width: 768px) {
  .fx-mobile-menu { display: block; }
}

/* ── 14. 文字渐变增强 ── */
.fx-gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #f9a8d4 50%, #818cf8 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fxGradientShift 4s ease infinite;
}
@keyframes fxGradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}

/* ── 15. Section 标题增强 ── */
.fx-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #a78bfa);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  padding: 6px 16px;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 50px;
}

/* ── 16. 统计数字动画 ── */
.fx-stat-value {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

/* ── 17. 减弱动效（无障碍）── */
@media (prefers-reduced-motion: reduce) {
  .fx-reveal,
  .fx-reveal-left,
  .fx-reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .fx-glow { animation: none !important; }
  .fx-gradient-text { animation: none !important; }
  .hero-badge.fx-enhanced { animation: none !important; }
  @keyframes fxShimmer { 0%, 100% { background-position: 0 0; } }
}

/* ── 18. 通用间距修正 ── */
@media (max-width: 768px) {
  .section-inner,
  [class*="section-inner"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}
