/* ===== 全局背景 ===== */
body {
  background: #07070d;
  color: #e0e0e8;
  font-family: 'JetBrains Mono', monospace;
  overflow-x: hidden;
}

/* ===== 网格背景 ===== */
.grid-bg {
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
}

.grid-bg-fine {
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ===== 扫描线 ===== */
.scanlines::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 240, 255, 0.015) 2px,
    rgba(0, 240, 255, 0.015) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ===== 霓虹文字 ===== */
.neon-cyan { color: #00f0ff; text-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 20px rgba(0, 240, 255, 0.3); }
.neon-magenta { color: #ff0080; text-shadow: 0 0 10px rgba(255, 0, 128, 0.5), 0 0 20px rgba(255, 0, 128, 0.3); }
.neon-green { color: #00ff9d; text-shadow: 0 0 10px rgba(0, 255, 157, 0.5), 0 0 20px rgba(0, 255, 157, 0.3); }
.neon-purple { color: #8b5cf6; text-shadow: 0 0 10px rgba(139, 92, 246, 0.5), 0 0 20px rgba(139, 92, 246, 0.3); }

/* ===== Orbitron 标题字体 ===== */
.font-display {
  font-family: 'Orbitron', sans-serif;
}

/* ===== 故障文字效果 ===== */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
}
.glitch::before {
  color: #00f0ff;
  animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}
.glitch::after {
  color: #ff0080;
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}
@keyframes glitch-anim-1 {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(-1px, -1px); }
  60% { transform: translate(1px, 1px); }
  80% { transform: translate(2px, -1px); }
  100% { transform: translate(0); }
}
@keyframes glitch-anim-2 {
  0% { transform: translate(0); }
  20% { transform: translate(2px, -1px); }
  40% { transform: translate(1px, 1px); }
  60% { transform: translate(-1px, -1px); }
  80% { transform: translate(-2px, 1px); }
  100% { transform: translate(0); }
}

/* ===== 霓虹边框卡片 ===== */
.cyber-card {
  background: linear-gradient(135deg, rgba(18, 18, 42, 0.9), rgba(13, 13, 26, 0.95));
  border: 1px solid rgba(0, 240, 255, 0.2);
  position: relative;
  transition: all 0.3s ease;
}
.cyber-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cyber-card:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15), inset 0 0 20px rgba(0, 240, 255, 0.05);
  transform: translateY(-4px);
}
.cyber-card:hover::before {
  opacity: 1;
  background: linear-gradient(135deg, #00f0ff, #8b5cf6, #ff0080);
}

/* ===== 角落装饰 ===== */
.corner-deco {
  position: relative;
}
.corner-deco::before,
.corner-deco::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid #00f0ff;
}
.corner-deco::before {
  top: -1px; left: -1px;
  border-right: none; border-bottom: none;
}
.corner-deco::after {
  bottom: -1px; right: -1px;
  border-left: none; border-top: none;
}

/* ===== 脉冲光点 ===== */
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.6); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(0, 255, 157, 0); }
}

/* ===== 浮动动画 ===== */
.float {
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ===== 数据流动画 ===== */
.data-stream {
  animation: dataFlow 3s linear infinite;
}
@keyframes dataFlow {
  0% { transform: translateY(100%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

/* ===== 滚动渐入 ===== */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 霓虹按钮 ===== */
.btn-cyber {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}
.btn-cyber::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.3), transparent);
  transition: left 0.5s ease;
}
.btn-cyber:hover::before {
  left: 100%;
}

/* ===== 产品卡片悬停 ===== */
.product-card {
  transition: all 0.3s ease;
}
.product-card:hover .product-img {
  transform: scale(1.08);
}
.product-card:hover .product-overlay {
  opacity: 1;
}

/* ===== 分类标签 ===== */
.category-tab {
  transition: all 0.25s ease;
  position: relative;
}
.category-tab.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(139, 92, 246, 0.2));
  border-color: #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

/* ===== 粒子背景 ===== */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ===== 全息渐变文字 ===== */
.holo-text {
  background: linear-gradient(135deg, #00f0ff 0%, #8b5cf6 33%, #ff0080 66%, #00f0ff 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: holoShift 5s ease infinite;
}
@keyframes holoShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== 竖排标签 ===== */
.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ===== 代码终端效果 ===== */
.terminal-line::before {
  content: '> ';
  color: #00ff9d;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #07070d; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00f0ff, #8b5cf6);
  border-radius: 4px;
}

/* ===== 选中文本 ===== */
::selection {
  background: rgba(0, 240, 255, 0.3);
  color: #fff;
}

/* ===== 响应式调整 ===== */
@media (max-width: 640px) {
  .glitch::before, .glitch::after { display: none; }
}
