/* 页面加载动画 - 优化版 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #171717;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s cubic-bezier(0.645, 0.045, 0.355, 1), 
                visibility 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader {
    position: relative;
    width: 150px;
    height: 150px;
    transform-style: preserve-3d;
}

.tea-cup {
    position: absolute;
    width: 80px;
    height: 60px;
    background: linear-gradient(135deg, 
                var(--secondary-color) 0%, 
                rgba(200, 186, 164, 0.9) 100%);
    border-radius: 0 0 40px 40px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) perspective(100px);
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.tea {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
                var(--primary-color) 0%, 
                rgba(157, 182, 140, 0.9) 100%);
    border-radius: 0 0 40px 40px;
    animation: tea-fill 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
    transform-origin: bottom;
}

.tea-leaf {
    position: absolute;
    width: 15px;
    height: 15px;
    background: linear-gradient(135deg, 
                var(--primary-color) 0%, 
                rgba(110, 150, 110, 0.8) 100%);
    border-radius: 50% 0 50% 50%;
    opacity: 0.8;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.leaf1 {
    top: 30%;
    left: 20%;
    animation: leaf-float 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.leaf2 {
    top: 20%;
    left: 50%;
    animation: leaf-float 4s cubic-bezier(0.4, 0, 0.2, 1) infinite 0.5s;
}

.leaf3 {
    top: 40%;
    left: 70%;
    animation: leaf-float 4s cubic-bezier(0.4, 0, 0.2, 1) infinite 1s;
}

/* 首次访问欢迎动画 - 快速淡出版本 */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #171717;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.7s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.welcome-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.welcome-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.welcome-image {
    width: 100%;
    height: 100%;
    background-image: url('../assets/welcome/2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    animation: image-zoom 15s ease-in-out infinite alternate;
}

/* 确保图片覆盖整个屏幕 */
.welcome-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
                rgba(0, 0, 0, 0.4) 0%, 
                rgba(0, 0, 0, 0.2) 50%,
                rgba(0, 0, 0, 0.3) 100%);
}

/* 淡入淡出动画 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.fade-up {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.fade-up-delay-1 {
    animation-delay: 0.1s;
}

.fade-up-delay-2 {
    animation-delay: 0.2s;
}

.fade-up-delay-3 {
    animation-delay: 0.3s;
}

.fade-up-delay-4 {
    animation-delay: 0.4s;
}

/* 滚动触发动画 - 优化版 */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform, opacity;
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 浮动元素 - 优化版 */
.floating-elements {
    position: relative;
    width: 300px;
    height: 300px;
    transform-style: preserve-3d;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, 
                rgba(157, 182, 140, 0.2) 0%, 
                rgba(157, 182, 140, 0.05) 70%);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.el1 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 10%;
    animation: float-element 10s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.el2 {
    width: 70px;
    height: 70px;
    top: 60%;
    left: 60%;
    animation: float-element 12s cubic-bezier(0.4, 0, 0.2, 1) infinite reverse;
}

.el3 {
    width: 50px;
    height: 50px;
    top: 30%;
    left: 70%;
    animation: float-element 14s cubic-bezier(0.4, 0, 0.2, 1) infinite 2s;
}

/* 高级视差效果补充 */
.parallax-scroll {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

/* 光标跟随效果 */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, 
                var(--primary-color) 0%, 
                transparent 70%);
    pointer-events: none;
    opacity: 0.3;
    transform: translate(-50%, -50%);
    z-index: 9998;
    filter: blur(2px);
    transition: transform 0.1s ease-out, opacity 0.5s ease;
}

/* 页面滚动进度条 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, 
                var(--primary-color) 0%, 
                var(--secondary-color) 100%);
    z-index: 9999;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 10px rgba(157, 182, 140, 0.3);
}

/* 平滑的卷轴展开效果 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: all 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 材质化阴影效果 */
.material-shadow {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1),
                0 4px 8px rgba(0, 0, 0, 0.1),
                0 8px 16px rgba(0, 0, 0, 0.1),
                0 16px 32px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.material-shadow:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15),
                0 8px 16px rgba(0, 0, 0, 0.15),
                0 16px 32px rgba(0, 0, 0, 0.15),
                0 32px 64px rgba(0, 0, 0, 0.15);
}

/* 呼吸灯效果 */
.breathing-light {
    animation: breathing 3s ease-in-out infinite;
}

/* 涟漪效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.4);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.ripple:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

/* ===== 新增SVG动画关键帧 ===== */
@keyframes drawLogo {
    0% {
        stroke-dashoffset: 1000;
        opacity: 0.5;
    }
    50% {
        stroke-dashoffset: 500;
        opacity: 0.8;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes fillLogo {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(-15px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(1.2);
    }
}

@keyframes shimmerEffect {
    0%, 100% {
        opacity: 0;
        transform: translateX(-20px);
    }
    50% {
        opacity: 0.6;
        transform: translateX(20px);
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(157, 182, 140, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(157, 182, 140, 0.7));
    }
}

@keyframes fadeInUpEnhanced {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    70% {
        opacity: 0.9;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceEnhanced {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-15px);
    }
    60% {
        transform: translateX(-50%) translateY(-7px);
    }
}

@keyframes floatRandom {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* 原有的关键帧 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tea-fill {
    0% {
        height: 0;
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% {
        height: 100%;
        opacity: 0.8;
    }
}

@keyframes leaf-float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    25% {
        transform: translate(10px, -20px) rotate(90deg) scale(1.1);
        opacity: 1;
    }
    50% {
        transform: translate(-5px, -35px) rotate(180deg) scale(1.2);
        opacity: 0.9;
    }
    75% {
        transform: translate(-15px, -20px) rotate(270deg) scale(1.1);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    33% {
        transform: translateY(-25px) rotate(120deg) scale(1.05);
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    66% {
        transform: translateY(15px) rotate(240deg) scale(0.95);
        border-radius: 40% 60% 70% 30% / 40% 70% 30% 60%;
    }
}

@keyframes image-zoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

@keyframes float-element {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.6;
    }
    33% {
        transform: translate(25px, -25px) scale(1.15) rotate(120deg);
        opacity: 0.8;
    }
    66% {
        transform: translate(-15px, 20px) scale(0.9) rotate(240deg);
        opacity: 0.7;
    }
}

@keyframes breathing {
    0%, 100% {
        opacity: 0.6;
        transform: scale(0.98);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* 在animations.css中添加 */
.unified-card {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    animation: unifiedFadeIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes unifiedFadeIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    60% {
        opacity: 0.9;
        transform: translateY(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}