/* ============================================================
   流光溢彩效果层 —— 全站动态光效（黑金主题）
   依赖 theme.css 变量；本文件最后加载以覆盖同优先级规则
   v2：金色线条光影流动 + 金色文字动态光影
   ============================================================ */

/* ---------- 1. 极光流彩背景（JS 注入 .fx-aurora 到 body 首位） ---------- */
.fx-aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.fx-aurora i {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform;
}

.fx-aurora i:nth-child(1) {
    width: 56vw;
    height: 56vw;
    top: -18vw;
    right: -14vw;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.10), transparent 68%);
    animation: fxAuroraA 32s ease-in-out infinite alternate;
}

.fx-aurora i:nth-child(2) {
    width: 46vw;
    height: 46vw;
    bottom: -16vw;
    left: -12vw;
    background: radial-gradient(circle, rgba(184, 134, 11, 0.09), transparent 68%);
    animation: fxAuroraB 40s ease-in-out infinite alternate;
}

.fx-aurora i:nth-child(3) {
    width: 38vw;
    height: 38vw;
    top: 34vh;
    left: 38vw;
    background: radial-gradient(circle, rgba(201, 142, 82, 0.06), transparent 70%);
    animation: fxAuroraC 46s ease-in-out infinite alternate;
}

@keyframes fxAuroraA {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-9vw, 7vh, 0) scale(1.18); }
}
@keyframes fxAuroraB {
    from { transform: translate3d(0, 0, 0) scale(1.12); }
    to   { transform: translate3d(10vw, -8vh, 0) scale(0.92); }
}
@keyframes fxAuroraC {
    from { transform: translate3d(0, 0, 0) scale(0.9); }
    to   { transform: translate3d(-8vw, -10vh, 0) scale(1.25); }
}

/* ---------- 2. 金色文字动态光影 ----------
   主标题：底色流金 + 独立高光带扫过 + 金色辉光呼吸
   次级金色标题：流金 + 静态金辉光（控制性能开销）            */

.hero h1,
.slider-content h1,
.section-title,
.stat-number {
    background-image:
        linear-gradient(100deg,
            #c9a233 0%, #d4af37 18%, #f4e3a1 30%, #fff8e2 38%,
            #f4e3a1 46%, #d4af37 62%, #a67c1a 78%, #e8c968 100%),
        linear-gradient(105deg,
            transparent 42%, rgba(255, 252, 238, 0.92) 50%, transparent 58%);
    background-size: 250% 100%, 300% 100%;
    background-position: 0% 50%, -120% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 14px rgba(212, 175, 55, 0.20);
    animation:
        fxTextFlow 8s ease-in-out infinite alternate,
        fxTextGlow 3.8s ease-in-out infinite;
}

@keyframes fxTextFlow {
    from { background-position: 0% 50%, -120% 50%; }
    to   { background-position: 100% 50%, 220% 50%; }
}

@keyframes fxTextGlow {
    0%, 100% { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 14px rgba(212, 175, 55, 0.20); }
    50%      { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 36px rgba(232, 201, 104, 0.50); }
}

/* 次级金色标题：流金 + 静态金辉光 */
.service-card h3,
.case-content h3,
.news-card h3,
.about-text h2,
.contact-info h2,
.contact-form h3,
.footer-section h3 {
    background-image: linear-gradient(100deg,
        #c9a233 0%, #e8c968 28%, #fff8e2 40%, #e8c968 52%, #c9a233 100%);
    background-size: 250% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 8px rgba(212, 175, 55, 0.18);
    animation: fxTextFlowLite 7s ease-in-out infinite alternate;
}

@keyframes fxTextFlowLite {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}

/* ---------- 3. 卡片鼠标跟随光晕 + 流光描边 ---------- */
.card.fx-glow,
.service-card.fx-glow,
.case-card.fx-glow,
.news-card.fx-glow,
.contact-info.fx-glow,
.contact-form.fx-glow {
    position: relative;
    z-index: 0;
}

.fx-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: -1;
    background: radial-gradient(
        320px circle at var(--mx, 50%) var(--my, 50%),
        rgba(232, 201, 104, 0.16),
        rgba(212, 175, 55, 0.05) 42%,
        transparent 68%
    );
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}

.fx-glow:hover::before {
    opacity: 1;
}

.fx-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        115deg,
        rgba(212, 175, 55, 0) 8%,
        rgba(247, 233, 160, 0.95) 30%,
        rgba(212, 175, 55, 0.15) 48%,
        rgba(232, 201, 104, 0.9) 66%,
        rgba(212, 175, 55, 0) 92%
    );
    background-size: 300% 300%;
    background-position: 0% 50%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.fx-glow:hover::after {
    opacity: 1;
    animation: fxBorderFlow 5s linear infinite;
}

@keyframes fxBorderFlow {
    from { background-position: 0% 50%; }
    to   { background-position: 300% 50%; }
}

/* ---------- 4. 按钮：周期性光泽扫掠 ---------- */
.btn::after {
    animation: fxSweep 5.5s ease-in-out infinite;
}

@keyframes fxSweep {
    0%   { left: -80%; }
    26%  { left: 130%; }
    100% { left: 130%; }
}

/* ---------- 5. 金色线条光影（光点沿线游走 + 辉光脉冲） ---------- */
nav::after {
    background-image:
        linear-gradient(90deg,
            transparent 0%, rgba(212, 175, 55, 0.75) 22%,
            rgba(212, 175, 55, 0.95) 50%, rgba(212, 175, 55, 0.75) 78%, transparent 100%),
        radial-gradient(circle at center,
            rgba(255, 250, 232, 0.95), rgba(232, 201, 104, 0.45) 45%, transparent 72%);
    background-size: 250% 100%, 150px 400%;
    background-repeat: repeat-x, no-repeat;
    background-position: 0% 50%, -150px 50%;
    filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.35));
    animation:
        fxLineTravel 6s linear infinite,
        fxLineGlow 3.2s ease-in-out infinite;
}

footer::before {
    background-image:
        linear-gradient(90deg,
            transparent 0%, rgba(212, 175, 55, 0.75) 22%,
            rgba(212, 175, 55, 0.95) 50%, rgba(212, 175, 55, 0.75) 78%, transparent 100%),
        radial-gradient(circle at center,
            rgba(255, 250, 232, 0.95), rgba(232, 201, 104, 0.45) 45%, transparent 72%);
    background-size: 250% 100%, 150px 400%;
    background-repeat: repeat-x, no-repeat;
    background-position: 0% 50%, calc(100% + 150px) 50%;
    filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.35));
    animation:
        fxLineTravelRev 7s linear infinite,
        fxLineGlow 3.6s ease-in-out infinite;
}

.hero-ornament::before,
.section-title::after {
    background-image:
        linear-gradient(90deg, transparent 0%, #d4af37 22%, #d4af37 78%, transparent 100%),
        radial-gradient(circle at center,
            rgba(255, 250, 232, 0.95), rgba(232, 201, 104, 0.45) 45%, transparent 72%);
    background-size: 100% 100%, 90px 400%;
    background-repeat: no-repeat, no-repeat;
    background-position: 0% 50%, -90px 50%;
    filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.4));
    animation:
        fxLineTravelSm 3.6s linear infinite,
        fxLineGlow 3s ease-in-out infinite;
}

.nav-links a::after {
    background-image:
        linear-gradient(90deg, #b8860b, #f7e9a0, #d4af37),
        radial-gradient(circle at center,
            rgba(255, 252, 238, 0.95), rgba(232, 201, 104, 0.45) 45%, transparent 72%);
    background-size: 200% 100%, 60px 400%;
    background-repeat: repeat-x, no-repeat;
    background-position: 0% 50%, -60px 50%;
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5));
    animation:
        fxLineTravelXs 2.8s linear infinite,
        fxLineGlow 2.6s ease-in-out infinite;
}

.footer-section h3::after {
    background-image:
        linear-gradient(90deg, #b8860b, #f7e9a0, #d4af37),
        radial-gradient(circle at center,
            rgba(255, 252, 238, 0.95), rgba(232, 201, 104, 0.45) 45%, transparent 72%);
    background-size: 200% 100%, 70px 400%;
    background-repeat: repeat-x, no-repeat;
    background-position: 0% 50%, -70px 50%;
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5));
    animation:
        fxLineTravelXs 3.2s linear infinite,
        fxLineGlow 3s ease-in-out infinite;
}

@keyframes fxLineTravel {
    from { background-position: 0% 50%, -150px 50%; }
    to   { background-position: 250% 50%, calc(100% + 150px) 50%; }
}

@keyframes fxLineTravelRev {
    from { background-position: 0% 50%, calc(100% + 150px) 50%; }
    to   { background-position: -250% 50%, -150px 50%; }
}

@keyframes fxLineTravelSm {
    from { background-position: 0% 50%, -90px 50%; }
    to   { background-position: 0% 50%, calc(100% + 90px) 50%; }
}

@keyframes fxLineTravelXs {
    from { background-position: 0% 50%, -60px 50%; }
    to   { background-position: 200% 50%, calc(100% + 60px) 50%; }
}

@keyframes fxLineGlow {
    0%, 100% { filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.35)); }
    50%      { filter: drop-shadow(0 0 11px rgba(232, 201, 104, 0.8)); }
}

/* ---------- 6. 菱形装饰呼吸光 ---------- */
.hero-ornament::after,
.section-title::before {
    animation: fxDiamondPulse 3.2s ease-in-out infinite;
}

@keyframes fxDiamondPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.55);
        transform: translate(-50%, -50%) rotate(45deg) scale(1);
    }
    50% {
        box-shadow: 0 0 24px rgba(232, 201, 104, 0.95);
        transform: translate(-50%, -50%) rotate(45deg) scale(1.14);
    }
}

.section-title::before {
    animation-name: fxDiamondPulseTitle;
}

@keyframes fxDiamondPulseTitle {
    0%, 100% {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.55);
        transform: translateX(-50%) rotate(45deg) scale(1);
    }
    50% {
        box-shadow: 0 0 24px rgba(232, 201, 104, 0.95);
        transform: translateX(-50%) rotate(45deg) scale(1.14);
    }
}

/* ---------- 7. 轮播指示点呼吸 ---------- */
.slider-indicator.active {
    animation: goldPulse 2.6s ease-in-out infinite;
}

/* ---------- 8. 顶部阅读进度流光条（JS 注入 .fx-progress） ---------- */
.fx-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 3000;
    pointer-events: none;
}

.fx-progress i {
    display: block;
    height: 100%;
    width: 0;
    background-image: linear-gradient(90deg, #8f6d15, #d4af37, #f7e9a0, #fff8e2, #f7e9a0, #d4af37);
    background-size: 200% 100%;
    animation: fxSweepLine 3s linear infinite;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.55);
    transition: width 0.15s linear;
}

@keyframes fxSweepLine {
    from { background-position: 0% 50%; }
    to   { background-position: 250% 50%; }
}

/* ---------- 9. Hero 金粒漂浮画布（JS 注入 .fx-particles） ---------- */
.slider,
.hero {
    position: relative;
    overflow: hidden;
}

.fx-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.slider-content,
.hero > .container {
    position: relative;
    z-index: 2;
}

/* ---------- 10. 无动画偏好：全部降级为静态 ---------- */
@media (prefers-reduced-motion: reduce) {
    .fx-aurora,
    .fx-particles {
        display: none;
    }
    .hero h1,
    .slider-content h1,
    .section-title,
    .stat-number,
    .service-card h3,
    .case-content h3,
    .news-card h3,
    .about-text h2,
    .contact-info h2,
    .contact-form h3,
    .footer-section h3,
    .hero p,
    .btn::after,
    nav::after,
    footer::before,
    .hero-ornament::before,
    .hero-ornament::after,
    .section-title::after,
    .section-title::before,
    .nav-links a::after,
    .footer-section h3::after,
    .slider-indicator.active,
    .fx-progress i {
        animation: none !important;
    }
    .fx-glow:hover::after {
        animation: none;
        background-position: 50% 50%;
    }
}
