/* 增强动画效果 */

/* ==================== 粒子背景效果 ==================== */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(200, 169, 110, 0.3);
  border-radius: 50%;
  animation: particleFloat 15s infinite;
}

@keyframes particleFloat {
  0%, 100% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ==================== 鼠标跟随光效 ==================== */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 169, 110, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
}

/* ==================== 文字打字机效果 ==================== */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--color-accent);
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--color-accent); }
}

/* ==================== 3D卡片翻转效果 ==================== */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
}

.flip-card-back {
  transform: rotateY(180deg);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

/* ==================== 脉冲动画 ==================== */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(200, 169, 110, 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 20px rgba(200, 169, 110, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(200, 169, 110, 0);
  }
}

/* ==================== 摇摆动画 ==================== */
.swing {
  animation: swing 2s ease-in-out infinite;
}

@keyframes swing {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

/* ==================== 发光边框效果 ==================== */
.glow-border {
  position: relative;
}

.glow-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--color-accent), var(--color-primary), var(--color-accent));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.glow-border:hover::before {
  opacity: 1;
  animation: glowRotate 3s linear infinite;
}

@keyframes glowRotate {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* ==================== 磁性按钮效果 ==================== */
.magnetic-btn {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ==================== 视差滚动增强 ==================== */
.parallax-layer {
  will-change: transform;
}

/* ==================== 模糊加载效果 ==================== */
.blur-load {
  background-size: cover;
  background-position: center;
}

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

.blur-load > img {
  opacity: 0;
  transition: opacity 200ms ease-in-out;
}

/* ==================== 霓虹文字效果 ==================== */
.neon-text {
  color: var(--color-accent);
  text-shadow: 
    0 0 5px rgba(200, 169, 110, 0.5),
    0 0 10px rgba(200, 169, 110, 0.3),
    0 0 20px rgba(200, 169, 110, 0.2);
  animation: neonFlicker 3s infinite alternate;
}

@keyframes neonFlicker {
  0%, 100% {
    text-shadow: 
      0 0 5px rgba(200, 169, 110, 0.5),
      0 0 10px rgba(200, 169, 110, 0.3),
      0 0 20px rgba(200, 169, 110, 0.2);
  }
  50% {
    text-shadow: 
      0 0 10px rgba(200, 169, 110, 0.8),
      0 0 20px rgba(200, 169, 110, 0.5),
      0 0 40px rgba(200, 169, 110, 0.3);
  }
}

/* ==================== 滚动进度条 ==================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
  z-index: 10000;
  transition: width 0.1s ease;
}

/* ==================== 波纹点击效果 ==================== */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.5s;
}

.ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

/* ==================== 悬停上浮阴影增强 ==================== */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 20px 40px -5px rgba(0, 0, 0, 0.15),
    0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

/* ==================== 渐变边框动画 ==================== */
.gradient-border {
  position: relative;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(45deg, var(--color-accent), var(--color-primary), var(--color-accent));
  -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;
  animation: borderRotate 4s linear infinite;
}

@keyframes borderRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==================== 数字滚动增强 ==================== */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ==================== 页面过渡效果 ==================== */
.page-transition {
  animation: pageEnter 0.6s ease-out;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.card-stack::before,
.card-stack::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.card-stack::before {
  z-index: -1;
  transform: translate(8px, 8px);
}

.card-stack::after {
  z-index: -2;
  transform: translate(16px, 16px);
}

.card-stack:hover::before {
  transform: translate(12px, 12px);
}

.card-stack:hover::after {
  transform: translate(24px, 24px);
}

/* ==================== 文字渐变效果 ==================== */
.text-gradient {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 50%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==================== 玻璃拟态效果 ==================== */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== 加载骨架屏 ==================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-neutral-200) 25%,
    var(--color-neutral-300) 50%,
    var(--color-neutral-200) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

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

/* ==================== 3D倾斜效果 ==================== */
.tilt-3d {
  transform-style: preserve-3d;
  transform: perspective(1000px);
}

.tilt-3d:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* ==================== 滚动显示动画 ==================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease;
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease;
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s ease;
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* ==================== 图标旋转效果 ==================== */
.icon-spin {
  transition: transform 0.5s ease;
}

.icon-spin:hover {
  transform: rotate(360deg);
}

/* ==================== 下划线动画 ==================== */
.underline-animation {
  position: relative;
  display: inline-block;
}

.underline-animation::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.underline-animation:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* ==================== 背景图案动画 ==================== */
.animated-bg {
  background: 
    radial-gradient(circle at 20% 50%, rgba(200, 169, 110, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(200, 169, 110, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(10, 31, 63, 0.05) 0%, transparent 50%);
  background-size: 100% 100%;
  animation: bgShift 20s ease infinite;
}

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