/* =========================================================
   E-Cloud · 科技感增强样式 (tech.css)
   粒子背景 / 自定义光标 / 滚动进度 / 滚动渐显 / 数字计数 /
   卡片 3D 倾斜 / 磁吸按钮 / Demo 流式输出
   ========================================================= */

/* ---------- 粒子背景画布 ---------- */
#tech-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* 让内容与导航始终在粒子之上 */
.container { z-index: 2; }

/* ---------- 滚动进度条 ---------- */
.tech-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: var(--gradient-1, linear-gradient(135deg, #3b82f6, #8b5cf6));
  box-shadow: 0 0 12px rgba(99,102,241,0.7);
  transition: width 0.08s linear;
}

/* ---------- 自定义光标 ---------- */
.tech-cursor,
.tech-cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}
.tech-cursor {
  width: 7px; height: 7px;
  background: var(--accent-light, #60a5fa);
  box-shadow: 0 0 10px var(--accent-light, #60a5fa);
}
.tech-cursor-ring {
  width: 34px; height: 34px;
  border: 1.5px solid rgba(96,165,250,0.5);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.tech-cursor-ring.is-active {
  width: 56px; height: 56px;
  border-color: rgba(139,92,246,0.8);
  background: rgba(99,102,241,0.08);
}
@media (hover: none), (pointer: coarse) {
  .tech-cursor, .tech-cursor-ring { display: none; }
}

/* ---------- 滚动渐显 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- 数据计数条 ---------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 30px;
}
.stat {
  background: var(--bg-card, #0f1629);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: var(--radius-lg, 20px);
  padding: 30px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition, 0.3s);
}
.stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 0%, rgba(59,130,246,0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.stat:hover::before { opacity: 1; }
.stat:hover { transform: translateY(-4px); border-color: var(--border-hover, rgba(255,255,255,0.12)); }
.stat-num {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-text, linear-gradient(135deg, #60a5fa, #a78bfa));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.stat-num .suffix { font-size: 0.5em; -webkit-text-fill-color: var(--text-secondary); margin-left: 2px; }
.stat-label {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary, #8894b0);
  font-weight: 500;
}
@media (max-width: 768px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* ---------- 卡片 3D 倾斜 ---------- */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
  will-change: transform;
}
.tilt .tilt-inner { transform: translateZ(40px); }

/* ---------- 磁吸按钮 ---------- */
.magnetic { display: inline-flex; transition: transform 0.18s ease; will-change: transform; }

/* ---------- Hero 动态光环 ---------- */
.hero-aura {
  position: absolute;
  top: 50%; left: 50%;
  width: 620px; height: 620px;
  max-width: 90vw; max-height: 90vw;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(59,130,246,0.0), rgba(99,102,241,0.18), rgba(139,92,246,0.0), rgba(6,182,212,0.16), rgba(59,130,246,0.0));
  filter: blur(60px);
  animation: aura-spin 14s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes aura-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ---------- 区块标题装饰线发光 ---------- */
.section-label::after {
  content: '';
  display: block;
  width: 46px; height: 3px;
  margin-top: 12px;
  background: var(--gradient-1, linear-gradient(135deg, #3b82f6, #8b5cf6));
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(99,102,241,0.6);
}

/* ---------- Demo 流式输出 ---------- */
.demo-result.loading {
  position: relative;
  color: var(--text-muted, #5a6680);
}
.demo-result.loading::after {
  content: '';
  display: inline-block;
  width: 7px; height: 1.1em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--accent-light, #60a5fa);
  box-shadow: 0 0 8px var(--accent-light, #60a5fa);
  animation: caret-blink 1s steps(2) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.demo-result.typing { border-right: 2px solid var(--accent-light, #60a5fa); }
.demo-result.stream-in { animation: stream-in 0.5s ease; }
@keyframes stream-in {
  from { opacity: 0; filter: blur(6px); transform: translateY(6px); }
  to { opacity: 1; filter: none; transform: none; }
}
/* 生成完成的小标 */
.gen-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--accent-light, #60a5fa);
  margin-bottom: 10px;
  opacity: 0.85;
}
.gen-badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-dot 1.6s infinite;
}

/* ---------- 顶部回到顶部按钮 ---------- */
.tech-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-1, linear-gradient(135deg, #3b82f6, #8b5cf6));
  color: #fff;
  cursor: pointer;
  border: none;
  z-index: 150;
  opacity: 0; transform: translateY(20px) scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 8px 24px rgba(59,130,246,0.4);
  font-size: 1.2rem;
}
.tech-top.show { opacity: 1; transform: translateY(0) scale(1); }
.tech-top:hover { transform: translateY(-3px) scale(1.05); }

/* ---------- AI 引擎状态徽标 ---------- */
.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px auto 0;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.3px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.08);
  color: #a5b4fc;
  backdrop-filter: blur(6px);
}
#demo .ai-status { display: flex; width: fit-content; }
.ai-status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
}
.ai-status .dot.on {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.9);
  animation: aiPulse 1.6s ease-in-out infinite;
}
.ai-status .dot.mock {
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
  animation: aiPulse 1.6s ease-in-out infinite;
}
.ai-status .dot.off { background: #64748b; }
.ai-status.online { border-color: rgba(52, 211, 153, 0.4); color: #6ee7b7; background: rgba(52, 211, 153, 0.07); }
.ai-status.mock { border-color: rgba(251, 191, 36, 0.4); color: #fcd34d; background: rgba(251, 191, 36, 0.07); }
@keyframes aiPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}
