/* ============================================================
   炫酷增强层 fx.css —— 叠加在经典酒红皮肤之上
   设计原则：一个难忘元素（会呼吸的太阳）+ 有编排的配角动画
   全部动效尊重 prefers-reduced-motion；无 JS 时页面内容照常显示
   ============================================================ */

/* ---------- 0. 渐进增强开关：只有 JS 就位后才隐藏待揭示元素 ---------- */
.fx-ready .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.22,.9,.28,1), transform .7s cubic-bezier(.22,.9,.28,1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.fx-ready .reveal.in { opacity: 1; transform: none; }

/* ---------- 1. 难忘元素：会呼吸、会旋转的太阳 ---------- */
@keyframes fx-spin { to { rotate: 360deg; } }
@keyframes fx-spin-rev { to { rotate: -360deg; } }
@keyframes fx-breathe {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: .95; transform: scale(1.06); }
}
@keyframes fx-halo {
  0%, 100% { opacity: .35; scale: 1; }
  50%      { opacity: .7;  scale: 1.08; }
}

/* 首屏光芒：极慢顺时针自转 + 明暗呼吸（rotate 独立属性，不影响定位 transform） */
.hero-rays {
  animation: fx-spin 80s linear infinite, fx-breathe 9s ease-in-out infinite;
  transform-origin: 50% 50%;
}
/* 自持电站光芒：反向自转，与首屏呼应 */
.self-rays {
  animation: fx-spin-rev 110s linear infinite, fx-breathe 11s ease-in-out infinite;
  transform-origin: 50% 50%;
}

/* Logo 环：正圆旋转金环 + 柔和呼吸光晕，精确套住左侧的圆形 GX 徽标。
   Logo 本体是横向宽图（徽标在左、文字在右），光环用 inset 贴边会变成歪斜椭圆，
   用 inset:0 居中又会套到文字上 —— 改为定位到徽标中心（约距左 27%、垂直居中），
   固定正圆 + translate 定位；rotate / scale 用独立属性，不影响定位。 */
.hero-logo-ring { position: relative; isolation: isolate; }
.fx-ready .hero-logo-ring::after {
  content: "";
  position: absolute; left: 27%; top: 50%; transform: translate(-50%, -50%);
  width: min(40%, 188px); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.9) 0%, rgba(250,240,226,.55) 48%, rgba(217,138,43,.1) 66%, transparent 76%);
  animation: fx-halo 6s ease-in-out infinite;
  z-index: -2;
  pointer-events: none;
}

/* ---------- 2. 渐变流光标题：酒红 → 橙金 → 酒红 ---------- */
@keyframes fx-shine {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.fx-ready .hero h1 .accent,
.fx-ready .so-head h2 {
  background: linear-gradient(100deg, var(--wine) 0%, var(--wine) 28%, var(--gold) 50%, var(--gold-light) 58%, var(--wine) 82%, var(--wine) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: fx-shine 7s linear infinite;
}
/* 自持区标题在深色底上，用更亮的金 */
.fx-ready .so-head h2 {
  background: linear-gradient(100deg, #fff 0%, #fff 26%, var(--gold-light) 48%, #fff 70%, #fff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* 渐变文字标题：入场只用透明度，且必须清掉 will-change/transform，
   否则 Chrome 会令 background-clip:text 失效、文字消失只剩一条渐变色块 */
.fx-ready .hero h1.reveal,
.fx-ready .so-head h2.reveal {
  transform: none;
  will-change: auto;
}

/* ---------- 3. 顶部滚动进度条 ---------- */
.fx-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  z-index: 90; pointer-events: none;
  background: linear-gradient(90deg, var(--wine), var(--gold), var(--gold-light));
  box-shadow: 0 0 10px rgba(217,138,43,.5);
  transition: width .08s linear;
}

/* ---------- 4. 按钮流光扫过 + 微浮 ---------- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute; top: 0; left: -75%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.42), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
  pointer-events: none;
}
.btn:hover::after { left: 135%; }
@keyframes fx-floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.fx-ready .btn-gold { animation: fx-floaty 3.4s ease-in-out infinite; }

/* ---------- 5. 数字：渐变 + 轻微字距呼吸 ---------- */
.fx-ready .stat strong,
.fx-ready .so-numbers strong,
.fx-ready .services-total strong,
.fx-ready .local-big strong {
  background: linear-gradient(135deg, var(--wine), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.fx-ready .so-numbers strong,
.fx-ready .services-total strong {
  background: linear-gradient(135deg, var(--gold-light), #fff8ec);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 6. 卡片：聚光跟随（JS 写入 --mx / --my）+ 悬浮描边 ---------- */
.fx-spot { position: relative; isolation: isolate; }
.fx-spot::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(217,138,43,.16), transparent 65%);
  opacity: 0; transition: opacity .35s ease;
  pointer-events: none; z-index: -1;
}
.fx-spot:hover::before { opacity: 1; }

/* 案例卡缩略图：hover 时斜向光泽扫过 */
.project-thumb { overflow: hidden; }
.fx-spot .project-thumb::before {
  content: "";
  position: absolute; top: 0; left: -80%; width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg);
  transition: left .7s ease;
  z-index: 3; pointer-events: none;
}
.fx-spot:hover .project-thumb::before { left: 130%; }

/* ---------- 7. 首屏漂浮光点（JS 生成） ---------- */
@keyframes fx-float-up {
  0%   { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; }
  12%  { opacity: .9; }
  88%  { opacity: .7; }
  100% { transform: translate3d(var(--drift, 20px), -260px, 0) scale(1.15); opacity: 0; }
}
.fx-particle-field {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1;
}
.fx-particle {
  position: absolute; bottom: -12px; width: var(--sz, 6px); height: var(--sz, 6px);
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-light), rgba(217,138,43,.15));
  box-shadow: 0 0 8px rgba(217,138,43,.5);
  animation: fx-float-up var(--dur, 9s) linear var(--delay, 0s) infinite;
}

/* ---------- 8. 区块入场：标题、卡片依次浮现 ---------- */
.fx-ready .section-head,
.fx-ready .so-head,
.fx-ready .stat,
.fx-ready .so-value,
.fx-ready .so-numbers > div,
.fx-ready .service-card,
.fx-ready .adv-item,
.fx-ready .brand-card,
.fx-ready .honor-card,
.fx-ready .project-card,
.fx-ready .about-text > p,
.fx-ready .local-banner { will-change: opacity, transform; }

/* ---------- 9. 减少动态偏好：一键安抚所有动画 ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-ready .reveal,
  .fx-ready .section-head, .fx-ready .so-head, .fx-ready .stat,
  .fx-ready .so-value, .fx-ready .so-numbers > div, .fx-ready .service-card,
  .fx-ready .adv-item, .fx-ready .brand-card, .fx-ready .honor-card,
  .fx-ready .project-card, .fx-ready .about-text > p, .fx-ready .local-banner {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  .hero-rays, .self-rays, .hero-logo-ring::after,
  .hero h1 .accent, .so-head h2, .btn-gold, .fx-particle { animation: none !important; }
  .fx-particle-field { display: none; }
  .btn::after, .fx-spot::before { display: none; }
}

/* ---------- 10. 移动端：克制，去掉聚光与光泽，保留缓慢自转 ---------- */
@media (max-width: 640px) {
  .fx-spot::before, .fx-spot .project-thumb::before { display: none; }
  .fx-particle-field { opacity: .6; }
  .hero-rays { animation-duration: 120s, 12s; }
  .self-rays { animation-duration: 150s, 14s; }
}
