/* ==========================================================================*
   高级动画和微交互效果 - 亦涛教育专用
\\* ========================================================================== */

/* 渐变文字效果加强版 */
.gradient-text {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease infinite;
    position: relative;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 打字机效果加强版 */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--accent-color);
    white-space: nowrap;
    animation: typing 4s steps(40, end), blink-caret 0.75s step-end infinite;
    position: relative;
}

.typewriter::after {
    content: '亦涛';
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    font-weight: bold;
    opacity: 0.7;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-color); }
}

/* 高级微交互效果 */
.pulse-on-hover {
    transition: all 0.3s ease;
    position: relative;
}

.pulse-on-hover:hover {
    animation: pulse 0.6s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 鼠标跟随效果 */
.mouse-follow {
    position: relative;
    overflow: hidden;
}

.mouse-follow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(30, 58, 138, 0.1), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    pointer-events: none;
}

.mouse-follow:hover::before {
    width: 100%;
    height: 100%;
}

/* 粒子爆炸效果 */
.particle-explosion {
    position: relative;
    overflow: visible;
}

.particle-explosion::after {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0;
    opacity: 0;
    transition: all 0.6s ease;
    pointer-events: none;
}

.particle-explosion:hover::after {
    font-size: 2rem;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 霓虹发光效果 */
.neon-glow {
    color: var(--white);
    text-shadow: 
        0 0 5px var(--accent-color),
        0 0 10px var(--accent-color),
        0 0 15px var(--accent-color),
        0 0 20px var(--accent-color);
    animation: neonFlicker 2s infinite alternate;
}

@keyframes neonFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* 3D翻转卡片 */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    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%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--border-radius);
}

.flip-card-back {
    transform: rotateY(180deg);
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 磁铁吸引效果 */
.magnetic {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magnetic:hover {
    transform: scale(1.02) translateX(2px);
}

/* 波浪背景动画 */
.wave-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(30, 58, 138, 0.03) 50%, transparent 70%);
    animation: waveMove 8s ease-in-out infinite;
}

@keyframes waveMove {
    0%, 100% {
        transform: translateX(-100%) translateY(0);
    }
    50% {
        transform: translateX(100%) translateY(-20px);
    }
}

/* 粒子雨效果 */
.particle-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFall linear infinite;
}

@keyframes particleFall {
    from {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* 呼吸灯效果 */
.breathing {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { 
        opacity: 0.6;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.05);
    }
}

/* 故障效果 */
.glitch {
    position: relative;
    animation: glitch 2s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--accent-color);
    animation: glitch-1 0.5s infinite reverse alternate;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--secondary-color);
    animation: glitch-2 0.5s infinite alternate;
}

@keyframes glitch {
    0%, 100% {
        text-shadow: 
            0.05em 0 0 var(--primary-color),
            -0.05em -0.025em 0 var(--accent-color),
            0.025em 0.05em 0 var(--secondary-color);
    }
    50% {
        text-shadow: 
            -0.05em -0.025em 0 var(--primary-color),
            0.025em 0.025em 0 var(--accent-color),
            -0.05em -0.05em 0 var(--secondary-color);
    }
}

@keyframes glitch-1 {
    0%, 100% {
        clip-path: inset(0 0 100% 0);
    }
    50% {
        clip-path: inset(0 0 100% 0);
    }
}

@keyframes glitch-2 {
    0%, 100% {
        clip-path: inset(0 0 100% 0);
    }
    50% {
        clip-path: inset(0 0 100% 0);
    }
}

/* 滑入动画 */
.slide-in-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slide-in-left.active {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slide-in-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* 缩放旋转动画 */
.scale-rotate {
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scale-rotate:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(30, 58, 138, 0.2);
}

/* 亦涛教育专用品牌元素 */
.yitao-brand {
    position: relative;
    display: inline-block;
}

.yitao-brand::before {
    content: '亦';
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 5px;
    animation: yitaoPulse 2s ease-in-out infinite;
}

.yitao-brand::after {
    content: '涛';
    color: var(--secondary-color);
    font-weight: bold;
    animation: taoWave 3s ease-in-out infinite;
}

@keyframes yitaoPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.9;
    }
    50% { 
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes taoWave {
    0%, 100% { 
        transform: translateY(0);
        opacity: 1;
    }
    50% { 
        transform: translateY(-3px);
        opacity: 0.8;
    }
}

/* 亦涛教育徽章 */
.yitao-badge {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.yitao-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: badgeShine 3s linear infinite;
}

@keyframes badgeShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 亦涛教育旗帜 */
.yitao-flag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    border-radius: 25px;
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.yitao-flag-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

/* 亦涛教育印章 */
.yitao-seal {
    width: 80px;
    height: 80px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    position: relative;
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.2);
}

.yitao-seal::before {
    content: '亦涛';
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.yitao-seal::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 1px solid var(--secondary-color);
    border-radius: 50%;
    animation: sealRotate 20s linear infinite;
}

@keyframes sealRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 亦涛教育波浪背景 */
.yitao-wave-bg {
    position: relative;
    overflow: hidden;
}

.yitao-wave-bg::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,56 C200,56 350,20 600,56 C850,20 1000,56 1000,56 L1000,120 L0,120 Z' fill='%231e3a8a'/%3E%3C/svg%3E");
    background-size: 1200px 100px;
    animation: waveMove 10s linear infinite;
}

@keyframes waveMove {
    0% { background-position: 0 0; }
    100% { background-position: 1200px 0; }
}

/* 亦涛教育星光效果 */
.yitao-stars {
    position: relative;
    overflow: hidden;
}

.yitao-stars::before,
.yitao-stars::after {
    content: '✦';
    position: absolute;
    color: var(--secondary-color);
    animation: twinkle 3s ease-in-out infinite;
}

.yitao-stars::before {
    top: 20%;
    left: 10%;
    font-size: 1.5rem;
    animation-delay: 0s;
}

.yitao-stars::after {
    top: 60%;
    right: 15%;
    font-size: 1.2rem;
    animation-delay: 1.5s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 亦涛教育中文书法效果 */
.yitao-calligraphy {
    font-family: 'KaiTi', 'STKaiti', '华文楷体', serif;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.yitao-calligraphy::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--secondary-color);
    transform: scaleX(0);
    transition: transform 0.6s ease;
}

.yitao-calligraphy:hover::after {
    transform: scaleX(1);
}