/* ==========================================================================*
   页面加载和过渡动画 - 亦涛教育专用
\\* ========================================================================== */

/* 页面加载动画 */
.page-loading {
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #1e40af 100%);
}

.page-loading::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: loadingPulse 1s ease-in-out infinite;
    z-index: 9999;
}

.page-loading::after {
    content: '亦涛教育';
    position: fixed;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--white);
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    opacity: 0;
    animation: loadingText 2s ease-in-out infinite;
    z-index: 9999;
}

@keyframes loadingPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        border-color: var(--accent-color);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        border-color: var(--secondary-color);
    }
}

@keyframes loadingText {
    0%, 100% { opacity: 0; transform: translate(-50%, -30%) scale(0.8); }
    50% { opacity: 1; transform: translate(-50%, -30%) scale(1); }
}

/* 页面已加载状态 */
.page-loaded {
    opacity: 1;
    transition: all 0.8s ease;
}

.page-loaded .page-loading::before,
.page-loaded .page-loading::after {
    opacity: 0;
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* 页面离开动画 */
.page-exit {
    opacity: 0;
    transition: opacity 0.5s ease-out;
    background: var(--primary-color);
}

/* 浮动粒子 */
.floating-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
}

/* 图片加载效果 */
img {
    opacity: 0;
    transition: opacity 0.6s ease;
}

img.loaded {
    opacity: 1;
}

/* 内容渐入 */
.content-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.content-fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

/* 页面过渡 */
.page-transition-enter {
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateX(0);
}

.page-transition-exit {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateX(-100px);
}

/* 亦涛教育专属加载屏 */
.yitao-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #1e40af 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.yitao-loading-content {
    text-align: center;
    color: var(--white);
}

.yitao-loading-logo {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    animation: logoGlow 2s ease-in-out infinite alternate;
}

.yitao-loading-text {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 30px;
}

.yitao-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 渐入动画增强 */
.slide-in-up {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slide-in-up.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.slide-in-down {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slide-in-down.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(50px) scale(0.9);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slide-in-left.active {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* 交错动画 */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stagger-animation.active > * {
    opacity: 1;
    transform: translateY(0);
}

.stagger-animation.active > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-animation.active > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-animation.active > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-animation.active > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-animation.active > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-animation.active > *:nth-child(6) { transition-delay: 0.6s; }

/* 视差滚动效果 */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    transform: translateY(0);
    will-change: transform;
}

/* 光标跟随增强 */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--accent-color), transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}

/* 闪光效果 */
.flash-effect {
    position: relative;
    overflow: hidden;
}

.flash-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 300%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 70%
    );
    transform: rotate(45deg) translateX(-50%);
    transition: all 0.6s ease;
    opacity: 0;
}

.flash-effect.active::before {
    opacity: 1;
    transform: rotate(45deg) translateX(100%);
}