/* ==========================================
   图形点阵样式
   Graphic Dot Matrix Styles
   ========================================== */

/* Graphic dot matrix container with 3D perspective */
.graphic-matrix-container {
  perspective: 1200px;
  perspective-origin: center center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.graphic-matrix-container .dot-matrix {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
  transform: rotateX(var(--rotateX, 0deg)) rotateY(var(--rotateY, 0deg));
  will-change: transform;
}

/* Graphic dot base style */
.dot.graphic {
  transition: all var(--transition-normal);
  transform-style: preserve-3d;
}

/* Layer Z-axis positioning */
.dot.graphic.layer-1 {
  transform: translateZ(0px);
}

.dot.graphic.layer-2 {
  transform: translateZ(20px);
}

.dot.graphic.layer-3 {
  transform: translateZ(40px);
}

.dot.graphic.ripple {
  transform: translateZ(60px);
  font-weight: var(--font-weight-bold);
}

/* Hover layer separation - increase Z-axis distance */
.graphic-matrix-container:hover .dot.graphic.layer-1 {
  transform: translateZ(0px);
}

.graphic-matrix-container:hover .dot.graphic.layer-2 {
  transform: translateZ(40px);
}

.graphic-matrix-container:hover .dot.graphic.layer-3 {
  transform: translateZ(80px);
}

.graphic-matrix-container:hover .dot.graphic.ripple {
  transform: translateZ(120px);
}

/* Ripple pulse animation */
@keyframes ripplePulse {
  0%,
  100% {
    transform: translateZ(60px) scale(1);
    opacity: var(--dot-opacity);
  }
  50% {
    transform: translateZ(60px) scale(1.15);
    opacity: calc(var(--dot-opacity) * 1.2);
  }
}

.dot.graphic.ripple {
  animation: ripplePulse 2.5s ease-in-out infinite;
  animation-delay: calc(var(--ripple-index) * 0.3s);
}

/* Mobile optimization - disable 3D */
@media (max-width: 768px) {
  .graphic-matrix-container {
    perspective: none;
  }

  .graphic-matrix-container .dot-matrix {
    transform-style: flat;
  }

  .dot.graphic {
    transform: none !important;
  }

  .graphic-matrix-container:hover .dot.graphic {
    transform: scale(1.1) !important;
  }

  .dot.graphic.ripple {
    animation: none;
  }
}

/* Small screen layout adjustment */
@media (max-width: 480px) {
  .graphic-matrix-container {
    padding: var(--spacing-lg) 0;
  }

  .graphic-matrix-container .dot-matrix {
    transform: scale(0.85);
  }
}

/* Reduced Motion support */
@media (prefers-reduced-motion: reduce) {
  .dot.graphic.ripple {
    animation: none;
  }

  .graphic-matrix-container:hover .dot.graphic,
  .graphic-matrix-container:hover .dot-matrix {
    transform: none !important;
  }
}

