/**
 * FTC21981 动画效果
 * Animations and transitions
 */

/* 淡入动画 */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* 滑入动画 */
@keyframes slideInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes slideInRight {
	from {
		opacity: 0;
		transform: translateX(30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* 缩放动画 */
@keyframes scaleIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* 脉冲动画 */
@keyframes pulse {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.05);
	}
}

/* 闪烁动画 */
@keyframes shimmer {
	0% {
		background-position: -1000px 0;
	}
	100% {
		background-position: 1000px 0;
	}
}

/* 应用淡入动画 */
.wp-block-group {
	animation: fadeIn 0.6s ease-out;
}

/* 列动画 */
.wp-block-columns .wp-block-column:nth-child(1) {
	animation: slideInLeft 0.8s ease-out;
}

.wp-block-columns .wp-block-column:nth-child(2) {
	animation: fadeIn 0.8s ease-out 0.2s backwards;
}

.wp-block-columns .wp-block-column:nth-child(3) {
	animation: slideInRight 0.8s ease-out 0.4s backwards;
}

/* 按钮脉冲效果 */
.wp-block-button {
	animation: scaleIn 0.5s ease-out;
}

/* 图片加载动画 */
.wp-block-image {
	animation: fadeIn 0.8s ease-out;
}

/* 标题动画 */
h1.wp-block-heading,
h2.wp-block-heading {
	animation: fadeIn 0.6s ease-out;
}

/* 光泽扫过效果 */
.wp-block-button__link {
	background-size: 200% 100%;
	background-image: linear-gradient(
		to right,
		transparent 0%,
		transparent 50%,
		rgba(255, 255, 255, 0.3) 50%,
		rgba(255, 255, 255, 0.3) 51%,
		transparent 51%,
		transparent 100%
	);
	background-position: 100% 0;
	transition: background-position 0.5s ease;
}

.wp-block-button__link:hover {
	background-position: 0 0;
}

/* 悬停时的阴影扩散 */
@keyframes shadowPulse {
	0% {
		box-shadow: 0 0 0 0 rgba(0, 115, 170, 0.4);
	}
	100% {
		box-shadow: 0 0 0 20px rgba(0, 115, 170, 0);
	}
}

.wp-block-button:hover .wp-block-button__link {
	animation: shadowPulse 1s infinite;
}

/* 加载骨架屏效果 */
.wp-block-image.is-loading {
	background: linear-gradient(
		90deg,
		#f0f0f0 0%,
		#e0e0e0 50%,
		#f0f0f0 100%
	);
	background-size: 200% 100%;
	animation: shimmer 1.5s infinite;
}

/* 页面滚动时的视差效果 */
@media (prefers-reduced-motion: no-preference) {
	.wp-block-cover,
	.wp-block-group.has-background {
		transition: transform 0.1s ease-out;
	}
}

/* 移动端禁用复杂动画 */
@media (max-width: 782px) {
	.wp-block-columns .wp-block-column {
		animation: fadeIn 0.5s ease-out !important;
	}
}

/* 尊重用户的减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

