/* ============================================
   龙虾出海 · Luxury Editorial 动效系统
   PC + H5 全覆盖 · 慢速丝滑克制
   ============================================ */

/* ---------- Particle Canvas ---------- */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
  transition: opacity 0.6s ease;
}

/* ---------- Luxury Scroll Reveal (慢速丝滑) ---------- */
[data-animate] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Depth Reveal (纵深感) */
[data-animate="depth"] {
  opacity: 0;
  transform: scale(0.96) translateY(32px);
  filter: blur(8px);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1.1s cubic-bezier(0.22, 1, 0.36, 1),
              filter 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-animate="depth"].visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: blur(0);
}

/* Fade Left/Right */
[data-animate="fade-left"] {
  transform: translateX(-40px);
}
[data-animate="fade-left"].visible {
  transform: translateX(0);
}
[data-animate="fade-right"] {
  transform: translateX(40px);
}
[data-animate="fade-right"].visible {
  transform: translateX(0);
}

/* Zoom (克制版) */
[data-animate="zoom"] {
  transform: scale(0.94);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-animate="zoom"].visible {
  transform: scale(1);
}

/* Clip Reveal (奢侈品感) */
[data-animate="clip"] {
  opacity: 1;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-animate="clip"].visible {
  clip-path: inset(0 0 0 0);
}

/* Stagger Children (错位入场) */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-stagger].visible > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger].visible > *:nth-child(2) { transition-delay: 0.12s; }
[data-stagger].visible > *:nth-child(3) { transition-delay: 0.19s; }
[data-stagger].visible > *:nth-child(4) { transition-delay: 0.26s; }
[data-stagger].visible > *:nth-child(5) { transition-delay: 0.33s; }
[data-stagger].visible > *:nth-child(6) { transition-delay: 0.40s; }
[data-stagger].visible > *:nth-child(7) { transition-delay: 0.47s; }
[data-stagger].visible > *:nth-child(8) { transition-delay: 0.54s; }
[data-stagger].visible > *:nth-child(9) { transition-delay: 0.61s; }
[data-stagger].visible > *:nth-child(10) { transition-delay: 0.68s; }
[data-stagger].visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Parallax Layers (分层视差) */
[data-parallax] {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ---------- 高级交互动效 ---------- */
/* 按钮压缩反馈 (Luxury) */
button, .btn-lg, .btn-sm, .btn-orange, .btn-ghost, .btn-primary, .btn-outline {
  transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.2s ease,
              box-shadow 0.2s ease,
              border-color 0.2s ease;
}
button:active, .btn-lg:active, .btn-sm:active {
  transform: scale(0.98) !important;
}

/* 卡片微位移 hover (克制版) */
.user-card, .price-card, .cap-card, .demo-card, .track-card, 
.provide-card, .why-card, .plan-card, .service-item, .path-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.25s ease;
}
.user-card:hover, .price-card:hover, .cap-card:hover, .demo-card:hover,
.track-card:hover, .provide-card:hover, .why-card:hover, .plan-card:hover {
  transform: translateY(-2px);
}

/* ---------- Button Pulse ---------- */
.btn-pulse {
  position: relative;
  overflow: visible;
}
.btn-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid rgba(249,115,22,0.5);
  animation: btnPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes btnPulse {
  0%   { opacity: .9; transform: scale(1); }
  70%  { opacity: 0; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.2); }
}

/* ---------- Glowing Card ---------- */
.glow-card {
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.glow-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(249,115,22,0.3), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}
.glow-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(249,115,22,0.12);
}
.glow-card:hover::before {
  opacity: 1;
}

/* ---------- Counter Animation ---------- */
.count-up {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ---------- Typewriter ---------- */
.typewriter-wrap {
  display: inline-block;
  position: relative;
}
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #f97316;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blinkCursor 0.9s step-end infinite;
}
@keyframes blinkCursor {
  0%,100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---------- Floating Glow Orbs (hero bg) ---------- */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: orbFloat 8s ease-in-out infinite alternate;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(249,115,22,0.08), transparent 70%);
  top: -150px; left: -100px;
  animation-duration: 10s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.06), transparent 70%);
  top: 0; right: -100px;
  animation-duration: 12s;
  animation-delay: -4s;
}
@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.1); }
}

/* ---------- Progress Bar Shimmer ---------- */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer-line {
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(249,115,22,0.8) 40%,
    rgba(249,115,22,0.8) 60%,
    transparent 100%);
  background-size: 200% auto;
  animation: shimmer 2.5s linear infinite;
}

/* ---------- H5 Mobile Nav ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: #94a3b8;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: #f97316;
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: #f97316;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 61px; left: 0; right: 0;
  background: rgba(11,17,32,0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 16px 20px 24px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.mobile-menu.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}
.mobile-menu a {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  color: #94a3b8;
  font-family: 'Inter','PingFang SC',sans-serif;
  text-decoration: none;
  transition: all 0.15s ease;
}
.mobile-menu a:hover, .mobile-menu a.active {
  color: #f1f5f9;
  background: #111827;
}
.mobile-menu .mobile-btns {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.mobile-menu .mobile-btns a {
  flex: 1;
  text-align: center;
  padding: 11px;
  font-size: 13px;
  font-weight: 700;
}
.mobile-menu .mobile-btns .m-outline {
  border: 1px solid rgba(249,115,22,0.4);
  color: #f97316;
  background: transparent;
}
.mobile-menu .mobile-btns .m-primary {
  background: #f97316;
  color: #fff;
}

/* ---------- 导航滚动态 (微光边框) ---------- */
nav {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
nav.scrolled {
  border-bottom-color: rgba(249,115,22,0.15);
  box-shadow: 0 4px 24px rgba(249,115,22,0.04);
}

/* ---------- H5 触摸优化 ---------- */
@media (max-width: 900px) {
  .hamburger { display: flex; }
  .nav-links  { display: none !important; }
  .nav-actions { display: none !important; }
  
  /* H5 动效性能优化 */
  [data-animate] {
    transform: translateY(24px);
    transition-duration: 0.65s;
  }
  [data-animate="depth"] {
    filter: none; /* H5 去掉 blur 提升性能 */
    transform: scale(0.98) translateY(20px);
    transition-duration: 0.8s;
  }
  [data-stagger] > * {
    transform: translateY(20px);
    transition-duration: 0.55s;
  }
  
  /* H5 触摸反馈 */
  button:active, .btn-lg:active, .btn-sm:active,
  a:active {
    transform: scale(0.96) !important;
    opacity: 0.85;
  }
  
  /* H5 卡片 hover 改为 active */
  .user-card:active, .price-card:active, .cap-card:active,
  .demo-card:active, .track-card:active {
    transform: scale(0.98);
  }
  
  /* H5 粒子背景降低透明度 */
  #particle-canvas {
    opacity: 0.15;
  }
  
  /* H5 禁用视差（性能） */
  [data-parallax] {
    transform: none !important;
  }
}

/* ---------- 性能优化 (减少重绘) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-animate], [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- Page Loader ---------- */
#page-loader {
  position: fixed;
  inset: 0;
  background: #05090f;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-claw {
  font-size: 36px;
  animation: loaderSpin 0.8s ease-in-out infinite alternate;
}
@keyframes loaderSpin {
  from { transform: rotate(-15deg) scale(0.9); }
  to   { transform: rotate(15deg) scale(1.1); }
}

/* ---------- Toast Notification ---------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: #0d1526;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 14px;
  color: #f1f5f9;
  font-family: 'Inter','PingFang SC',sans-serif;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(.22,1,.36,1);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 320px;
}
.toast.show {
  transform: translateX(0);
}
.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.toast.success { border-left: 3px solid #22c55e; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.info    { border-left: 3px solid #f97316; }
