/*
# geometric-bg.css
# Written by: 广州羲驭科技有限公司
# Description: Styles for the geometric background system.
# Copyright: © 2024-2025 广州羲驭科技有限公司. All rights reserved. | 粤ICP备2025458335号
*/

/* ===== Vista Geometric Glass 几何背景系统 ===== */

/* ===== 基础几何背景 ===== */
.geometric-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* ===== 几何形状基础类 ===== */
.geometric-shape {
  position: absolute;
  transition: all var(--animation-ultra-slow) var(--ease-out-smooth);
  will-change: transform, opacity;
}

/* 圆形几何形状 */
.geo-circle {
  border-radius: 50%;
  background: var(--geo-gradient-1);
  box-shadow: 0 0 40px rgba(59, 139, 199, 0.4);
  animation: floatCircle 20s ease-in-out infinite;
}

.geo-circle-small {
  width: var(--geo-size-sm);
  height: var(--geo-size-sm);
  animation-duration: 15s;
}

.geo-circle-medium {
  width: var(--geo-size-md);
  height: var(--geo-size-md);
  animation-duration: 25s;
}

.geo-circle-large {
  width: var(--geo-size-lg);
  height: var(--geo-size-lg);
  animation-duration: 30s;
}

.geo-circle-xlarge {
  width: var(--geo-size-xl);
  height: var(--geo-size-xl);
  animation-duration: 35s;
}

/* 三角形几何形状 */
.geo-triangle {
  width: 0;
  height: 0;
  background: transparent;
  animation: rotateTriangle 40s linear infinite;
}

.geo-triangle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-style: solid;
  filter: blur(2px);
}

.geo-triangle-teal::before {
  border-left: 40px solid transparent;
  border-right: 40px solid transparent;
  border-bottom: 70px solid rgba(0, 217, 199, 0.6);
  box-shadow: 0 0 30px rgba(0, 217, 199, 0.4);
}

.geo-triangle-blue::before {
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 50px solid rgba(59, 139, 199, 0.6);
  box-shadow: 0 0 25px rgba(59, 139, 199, 0.4);
}

.geo-triangle-accent::before {
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-bottom: 45px solid rgba(63, 174, 42, 0.5);
  box-shadow: 0 0 20px rgba(63, 174, 42, 0.3);
}

/* 六边形几何形状 */
.geo-hexagon {
  width: var(--geo-size-md);
  height: var(--geo-size-lg);
  background: var(--geo-gradient-2);
  position: relative;
  margin: var(--space-8) 0;
  box-shadow: 0 0 30px rgba(0, 217, 199, 0.3);
  animation: floatHexagon 25s ease-in-out infinite;
}

.geo-hexagon::before,
.geo-hexagon::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-left: calc(var(--geo-size-md) / 2) solid transparent;
  border-right: calc(var(--geo-size-md) / 2) solid transparent;
}

.geo-hexagon::before {
  bottom: 100%;
  border-bottom: calc(var(--geo-size-md) / 3) solid rgba(0, 217, 199, 0.6);
}

.geo-hexagon::after {
  top: 100%;
  border-top: calc(var(--geo-size-md) / 3) solid rgba(0, 217, 199, 0.6);
}

/* 正方形几何形状 */
.geo-square {
  width: var(--geo-size-md);
  height: var(--geo-size-md);
  background: var(--geo-gradient-3);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 25px rgba(63, 174, 42, 0.4);
  animation: rotateSquare 30s linear infinite;
}

.geo-square-rotated {
  transform: rotate(45deg);
  animation: rotateSquareReverse 25s linear infinite;
}

/* 线条几何形状 */
.geo-line {
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--geo-secondary), transparent);
  border-radius: var(--radius-full);
  animation: linePulse 3s ease-in-out infinite;
}

.geo-line-vertical {
  width: 2px;
  height: 100px;
  background: linear-gradient(180deg, transparent, var(--geo-primary), transparent);
}

/* ===== 几何网格背景 ===== */
.geo-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(59, 139, 199, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 139, 199, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.3;
  animation: gridMove 20s linear infinite;
}

/* ===== 粒子系统 ===== */
.geo-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.geo-particle {
  position: absolute;
  width: var(--particle-size);
  height: var(--particle-size);
  background: var(--geo-primary);
  border-radius: 50%;
  opacity: var(--particle-opacity);
  animation: particleFloat 15s ease-in-out infinite;
}

/* ===== 几何组合 ===== */
.geo-composition {
  position: absolute;
  width: 300px;
  height: 300px;
  animation: compositionRotate 60s linear infinite;
}

.geo-composition-shape {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--geo-secondary), transparent);
  opacity: 0.6;
  animation: compositionPulse 4s ease-in-out infinite;
}

/* ===== 动画定义 ===== */

/* 浮动动画 */
@keyframes floatCircle {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-30px) translateX(20px);
  }
  50% {
    transform: translateY(20px) translateX(-30px);
  }
  75% {
    transform: translateY(-20px) translateX(-20px);
  }
}

@keyframes floatHexagon {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  33% {
    transform: translateY(-40px) rotate(120deg);
  }
  66% {
    transform: translateY(30px) rotate(240deg);
  }
}

/* 旋转动画 */
@keyframes rotateTriangle {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotateSquare {
  from {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes rotateSquareReverse {
  from {
    transform: rotate(45deg) scale(1);
  }
  50% {
    transform: rotate(225deg) scale(0.9);
  }
  to {
    transform: rotate(405deg) scale(1);
  }
}

/* 脉冲动画 */
@keyframes linePulse {
  0%, 100% {
    opacity: 0.3;
    transform: scaleX(0.8);
  }
  50% {
    opacity: 0.8;
    transform: scaleX(1.2);
  }
}

@keyframes compositionPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

/* 粒子动画 */
@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: var(--particle-opacity);
  }
  90% {
    opacity: var(--particle-opacity);
  }
  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

/* 网格动画 */
@keyframes gridMove {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(50px, 50px);
  }
}

/* 组合动画 */
@keyframes compositionRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== 鼠标交互效果 ===== */
.geo-interactive {
  transition: all var(--animation-fast) var(--ease-out-smooth);
}

.geo-interactive:hover {
  transform: scale(1.1);
  box-shadow: 0 0 60px rgba(0, 217, 199, 0.6);
}

/* ===== 背景层次 ===== */
.geo-layer-bg {
  z-index: -10;
  opacity: 0.1;
}

.geo-layer-mid {
  z-index: -5;
  opacity: 0.3;
}

.geo-layer-fg {
  z-index: -1;
  opacity: 0.6;
}

/* ===== 响应式几何 ===== */
@media (max-width: 768px) {
  .geo-hexagon {
    width: calc(var(--geo-size-md) * 0.8);
    height: calc(var(--geo-size-lg) * 0.8);
  }

  .geo-square {
    width: calc(var(--geo-size-md) * 0.8);
    height: calc(var(--geo-size-md) * 0.8);
  }

  .geo-composition {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 640px) {
  .geo-hexagon {
    width: calc(var(--geo-size-md) * 0.6);
    height: calc(var(--geo-size-lg) * 0.6);
  }

  .geo-square {
    width: calc(var(--geo-size-md) * 0.6);
    height: calc(var(--geo-size-md) * 0.6);
  }

  .geo-composition {
    width: 150px;
    height: 150px;
  }

  .geo-grid {
    background-size: 30px 30px;
  }
}

/* ===== 性能优化 ===== */
@media (prefers-reduced-motion: reduce) {
  .geometric-shape {
    animation: none !important;
  }

  .geo-grid {
    animation: none !important;
  }
}

/* ===== 高对比度模式 ===== */
@media (prefers-contrast: high) {
  .geo-circle,
  .geo-hexagon,
  .geo-square {
    opacity: 0.8;
  }

  .geo-particle {
    opacity: 0.9;
  }
}

/* ===== 暗色主题适配 ===== */
@media (prefers-color-scheme: dark) {
  .geo-circle {
    background: linear-gradient(45deg,
      rgba(59, 139, 199, 0.9),
      rgba(0, 217, 199, 0.7));
  }

  .geo-hexagon {
    background: linear-gradient(135deg,
      rgba(0, 217, 199, 0.8),
      rgba(59, 139, 199, 0.6));
  }

  .geo-square {
    background: linear-gradient(225deg,
      rgba(63, 174, 42, 0.8),
      rgba(255, 107, 0, 0.6));
  }
}

/* ===== 特殊效果 ===== */
.geo-glow {
  filter: blur(1px);
  box-shadow:
    0 0 40px rgba(59, 139, 199, 0.6),
    0 0 80px rgba(0, 217, 199, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.geo-morphing {
  animation: morphShape 10s ease-in-out infinite;
}

@keyframes morphShape {
  0%, 100% {
    border-radius: 50%;
    transform: scale(1) rotate(0deg);
  }
  25% {
    border-radius: 20%;
    transform: scale(1.1) rotate(90deg);
  }
  50% {
    border-radius: 30%;
    transform: scale(0.9) rotate(180deg);
  }
  75% {
    border-radius: 10%;
    transform: scale(1.05) rotate(270deg);
  }
}
