/* Premium GSAP Effect Base */
.sweep-effect {
    position: relative;
    overflow: hidden;
}

/* --- Preloader --- */
#particle-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}
#particle-loader.hidden {
    opacity: 0;
    visibility: hidden;
}
#loader-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
#loader-text {
    position: relative;
    z-index: 2;
    color: #0ba2e3;
    font-size: 14px;
    margin-top: 120px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 4px;
    text-transform: uppercase;
}
#loader-text::after {
    content: '|';
    animation: blinkCursor 0.7s infinite;
}
@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Hero Banner Animations --- */
.hero-slider .swiper-slide img, .hero-slider .swiper-slide video {
    transition: transform 6s ease-out; /* 使用 ease-out 减轻 GPU 负担，延长过度时间让画面更平滑 */
    transform: scale(1);
    /* 移除 translateZ 和 will-change，大面积图片的 3D 渲染反而会导致低端显卡或复杂 DOM 下出现严重掉帧卡顿 */
}
.hero-slider .swiper-slide.is-animating img, .hero-slider .swiper-slide.is-animating video {
    transform: scale(1.05);
}

.hero-content h1 span.char {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
}
.hero-content p {
    opacity: 0;
    transform: translateY(20px);
}
.hero-content .btn {
    opacity: 0;
}

/* --- CTA Flowing Border --- */
.btn-glow {
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none !important;
}
.btn-glow::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(90deg, #0ba2e3, #eb6100, #0ba2e3, #eb6100);
    background-size: 400%;
    z-index: -1;
    border-radius: inherit;
    animation: glowingBorder 3s linear infinite;
    opacity: 0.8;
    transition: opacity 0.3s;
}
.btn-glow::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    background: inherit;
    border-radius: inherit;
    z-index: -1;
}
.btn-glow:hover::before {
    opacity: 1;
}
@keyframes glowingBorder {
    0% { background-position: 0 0; }
    100% { background-position: 400% 0; }
}

/* Base states for GSAP animation */
.sweep-effect .group-intro-flex {
    visibility: hidden;
}
.sweep-effect .group-intro-text {
    opacity: 0;
    transform: translateX(-60px);
}
.sweep-effect .group-intro-image {
    opacity: 0;
    transform: translateX(-60px);
}
.sweep-effect .group-intro-image img {
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

/* --- 3D Flip Cards --- */
.flip-card-container {
    perspective: 1200px;
    height: 400px;
    width: 100%;
    cursor: pointer;
    position: relative;
}
/* 我们在 js 中使用 fromTo 替代了 css 的初始位移，删除了 .from-left 和 .from-right 避免冲突 */

.flip-card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); /* Elastic feel */
    transform-style: preserve-3d;
    will-change: transform;
}

.flip-card-container:hover .flip-card {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    /* 修复 3D 翻转时边缘出现的黑色锯齿 (Anti-aliasing fix) */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    outline: 1px solid transparent;
}

.flip-card-front {
    background: #000;
}
.flip-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.4s;
    /* 防止图片边缘出现缝隙 */
    transform: scale(1.02);
}
/* PC 端 hover 状态下的蒙版变深 */
@media (min-width: 769px) {
    .flip-card-container:hover .flip-card-front img {
        opacity: 0.5;
    }
}
.flip-card-front h3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    text-align: center;
    color: #fff;
    font-size: 26px;
    margin: 0;
    text-shadow: 0 2px 15px rgba(0,0,0,0.8);
    z-index: 2;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: #000;
    border: none;
}

.flip-card-back .back-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    filter: blur(10px);
    transform: scale(1.1); /* Prevents dark edges caused by blur */
    z-index: 0;
}

.flip-card-back-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 40px 30px;
}

.flip-card-back-content h3 {
    font-size: 22px;
    color: #fff;
    margin-bottom: 15px;
}
.flip-card-back-content p {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    margin-bottom: 30px;
    /* 限制行数：正文过长时截断，保证标题和按钮始终可见 */
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.flip-card-back-content .btn {
    margin-top: auto;
    align-self: flex-start;
}

.btn-orange {
    background: #eb6100;
    color: #fff;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.btn-orange:hover {
    background: #ff751a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(235, 97, 0, 0.4);
}
.btn-orange::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: all 0.6s ease;
}
.btn-orange:hover::after {
    left: 200%;
}

/* Diagonal Orange Sweep Effect (Hygeia Orange 0.1) - Repeats every ~4 seconds */
.sweep-effect.is-animating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(235, 97, 0, 0) 35%,
        rgba(235, 97, 0, 0.1) 45%,
        rgba(235, 97, 0, 0.1) 55%,
        rgba(235, 97, 0, 0) 65%
    );
    z-index: 10;
    pointer-events: none;
    transform: translate(-100%, -100%);
    animation: diagonalOrangeSweep 6s infinite ease-in-out;
}

@keyframes diagonalOrangeSweep {
    0% { transform: translate(-100%, -100%); }
    33.33% { transform: translate(100%, 100%); } /* Takes 2s to sweep (33.33% of 6s) */
    100% { transform: translate(100%, 100%); } /* Pauses for 4s */
}