/* =========================================
   关键词混合器 - Keyword Mixer
   动画效果和过渡样式
   ========================================= */

/* 页面加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-animation > * {
    opacity: 0;
}

.stagger-animation > *:nth-child(1) { animation: fadeInUp 0.5s ease-out 0.1s forwards; }
.stagger-animation > *:nth-child(2) { animation: fadeInUp 0.5s ease-out 0.2s forwards; }
.stagger-animation > *:nth-child(3) { animation: fadeInUp 0.5s ease-out 0.3s forwards; }
.stagger-animation > *:nth-child(4) { animation: fadeInUp 0.5s ease-out 0.4s forwards; }
.stagger-animation > *:nth-child(5) { animation: fadeInUp 0.5s ease-out 0.5s forwards; }
.stagger-animation > *:nth-child(6) { animation: fadeInUp 0.5s ease-out 0.6s forwards; }
.stagger-animation > *:nth-child(7) { animation: fadeInUp 0.5s ease-out 0.7s forwards; }

/* 浮动动画效果 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.float {
    animation: float 6s ease-in-out infinite;
}

.float-delayed {
    animation: float 6s ease-in-out 1s infinite;
}

/* 缓慢旋转动画 */
@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.slow-rotate {
    animation: slowRotate 30s linear infinite;
}

/* 闪烁动画 */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.pulse {
    animation: pulse 3s ease-in-out infinite;
}

/* 波纹效果 */
@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%) scale(0);
    animation: ripple 1s ease-out;
}

/* 渐变背景动画 */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-animation {
    background: linear-gradient(-45deg, #0071e3, #5ac8fa, #5e5ce6, #9e29ff);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
}

/* 按钮悬停效果 */
.btn-hover-effect {
    transition: all 0.3s cubic-bezier(0.42, 0, 0.58, 1);
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
                transparent, 
                rgba(255, 255, 255, 0.2), 
                transparent);
    transition: all 0.6s;
    z-index: 1;
}

.btn-hover-effect:hover::before {
    left: 100%;
}

/* 鼠标悬停效果 */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 打字机效果 */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-color) }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--accent-color);
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* 关键词项动画效果 */
.keyword-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.keyword-item.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.keyword-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* 新添加的关键词动画 */
@keyframes highlightNew {
    0% { background-color: rgba(0, 113, 227, 0.2); }
    100% { background-color: transparent; }
}

.keyword-new {
    animation: highlightNew 1.5s ease-out;
}

/* 背景装饰元素动画 */
.decoration {
    position: absolute;
    z-index: -1;
    opacity: 0.1;
}

.decoration-1 {
    top: 20%;
    left: 10%;
    width: 100px;
    height: 100px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.decoration-2 {
    top: 60%;
    right: 15%;
    width: 80px;
    height: 80px;
    background: var(--secondary-gradient);
    border-radius: 20px;
    animation: float 6s ease-in-out 2s infinite;
}

.decoration-3 {
    bottom: 20%;
    left: 20%;
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: 30px;
    animation: float 10s ease-in-out 4s infinite;
}

/* 滚动动画 */
@keyframes scrollHighlight {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

.collection-content::-webkit-scrollbar-thumb,
.results-container::-webkit-scrollbar-thumb {
    animation: scrollHighlight 2s ease-in-out infinite;
}

/* Logo动画 */
.logo-animation {
    transition: transform 0.3s ease;
}

.logo-animation:hover {
    transform: scale(1.1) rotate(5deg);
}

/* 滚动进度条 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary-gradient);
    z-index: 999;
    transition: width 0.3s ease;
}

/* 加载动画和旋转器 */
.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    color: var(--light-text);
}

.loading-animation p {
    margin-top: var(--spacing-sm);
    font-size: 0.9rem;
}

/* 旋转器动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 113, 227, 0.1);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 淡入效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 按钮点击效果 */
.clicked {
    animation: buttonClick 0.3s ease-out;
}

@keyframes buttonClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Flash动画效果 */
.flash {
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0% { background-color: rgba(0, 113, 227, 0.1); }
    50% { background-color: rgba(0, 113, 227, 0.3); }
    100% { background-color: rgba(0, 113, 227, 0.1); }
}

/* 高亮效果 */
.highlight {
    animation: highlight 0.5s ease-out;
}

@keyframes highlight {
    0% { background-color: rgba(52, 199, 89, 0.1); }
    50% { background-color: rgba(52, 199, 89, 0.3); }
    100% { background-color: rgba(52, 199, 89, 0.1); }
} 