/* ============================================
   GSAP 动画系统 — 增量样式
   与 style.css 共存，不覆盖原有样式
   ============================================ */

/* ---------- 1. 基础 Reveal 系统 ---------- */
[data-animate] {
    will-change: transform, opacity;
}

.reveal-up {
    opacity: 0;
    transform: translateY(40px);
}
.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
}
.reveal-right {
    opacity: 0;
    transform: translateX(60px);
}
.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
}
.reveal-clip {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
}

/* ---------- 2. 浮动装饰粒子 ---------- */
.float-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    filter: blur(1px);
}

/* ---------- 3. 3D 卡片翻转系统 ---------- */
.flip-card {
    perspective: 1200px;
    transform-style: preserve-3d;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
}
.flip-card-back {
    transform: rotateY(180deg);
    background: var(--primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #fff;
}

/* ---------- 4. 磁性按钮 ---------- */
.magnetic-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}
.magnetic-btn::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(240,200,77,0.25), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.magnetic-btn:hover::before {
    opacity: 1;
}

/* ---------- 5. 文字拆分动画 ---------- */
.split-char {
    display: inline-block;
    will-change: transform, opacity;
}

/* ---------- 6. 滚动进度条 ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), #D4A843);
    z-index: 99999;
    transition: width 0.1s linear;
}

/* ---------- 7. 视差图层 ---------- */
.parallax-layer {
    will-change: transform;
}

/* ---------- 8. 毛玻璃面板 ---------- */
.glass-panel {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
}

/* ---------- 9. 光晕跟随光标 ---------- */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240,200,77,0.08), transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: left 0.15s ease-out, top 0.15s ease-out;
}

/* ---------- 10. 产品卡片 3D Tilt ---------- */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}
.tilt-card .product-image {
    transform: translateZ(30px);
}
.tilt-card .product-info {
    transform: translateZ(20px);
}

/* ---------- 11. 图片揭示遮罩 ---------- */
.img-reveal-mask {
    position: relative;
    overflow: hidden;
}
.img-reveal-mask::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    transform-origin: right;
}

/* ---------- 12. 波纹按钮 ---------- */
.ripple-btn {
    position: relative;
    overflow: hidden;
}
.ripple-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transform: scale(0);
    animation: rippleAnim 0.6s linear;
    pointer-events: none;
}
@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ---------- 13. 暗角暗场特效 (Vignette) ---------- */
.vignette-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
}

/* ---------- 14. 噪点纹理 ---------- */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99998;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ---------- 15. 章节计数器 ---------- */
.section-counter {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Playfair Display', serif;
    font-size: 8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.03);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

/* ---------- 16. 发光边框 ---------- */
.glow-border {
    position: relative;
}
.glow-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent-gold), transparent, var(--accent-gold));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}
.glow-border:hover::before {
    opacity: 0.6;
}

/* ---------- 17. 打字机光标 ---------- */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent-gold);
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
    vertical-align: text-bottom;
}
@keyframes blink {
    50% { opacity: 0; }
}

/* ---------- 18. 幕帘揭示 ---------- */
.curtain-reveal {
    position: relative;
    overflow: hidden;
}
.curtain-reveal .curtain {
    position: absolute;
    inset: 0;
    background: var(--primary);
    z-index: 2;
}

/* ---------- 19. 响应式隐藏 ---------- */
@media (max-width: 768px) {
    .cursor-glow,
    .noise-overlay,
    .section-counter {
        display: none !important;
    }
}
