/* ========================================
   核心动画关键帧
   ======================================== */

/* 淡入上移 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 淡入下移 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 淡入缩放 */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 浮动效果 */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* 脉冲效果 */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* 摇晃效果 */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-5px);
    }

    40%,
    80% {
        transform: translateX(5px);
    }
}

/* 弹跳进入 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* 滑入左侧 */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 滑入右侧 */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 旋转进入 */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0);
    }

    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* 勾选圆圈动画 */
@keyframes checkmarkCircle {
    to {
        stroke-dashoffset: 0;
    }
}

/* 勾选动画 */
@keyframes checkmarkCheck {
    to {
        stroke-dashoffset: 0;
    }
}

/* 渐变流动 */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* 呼吸效果 */
@keyframes breathe {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(0, 122, 255, 0);
    }
}

/* ========================================
   页面切换动画
   ======================================== */
.page {
    will-change: transform, opacity;
}

.page.slide-in-right {
    animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page.slide-in-left {
    animation: slideInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ========================================
   元素入场动画
   ======================================== */

/* 表单组入场 */
.form-group {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.form-group:nth-child(1) {
    animation-delay: 0.1s;
}

.form-group:nth-child(2) {
    animation-delay: 0.15s;
}

.form-group:nth-child(3) {
    animation-delay: 0.2s;
}

.form-group:nth-child(4) {
    animation-delay: 0.25s;
}

.form-group:nth-child(5) {
    animation-delay: 0.3s;
}

.form-group:nth-child(6) {
    animation-delay: 0.35s;
}

/* 信息项入场 */
.info-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.info-item:nth-child(1) {
    animation-delay: 0.1s;
}

.info-item:nth-child(2) {
    animation-delay: 0.15s;
}

.info-item:nth-child(3) {
    animation-delay: 0.2s;
}

.info-item:nth-child(4) {
    animation-delay: 0.25s;
}

/* 福利项入场 */
.benefit-item {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
}

.benefit-item:nth-child(1) {
    animation-delay: 0.05s;
}

.benefit-item:nth-child(2) {
    animation-delay: 0.1s;
}

.benefit-item:nth-child(3) {
    animation-delay: 0.15s;
}

.benefit-item:nth-child(4) {
    animation-delay: 0.2s;
}

.benefit-item:nth-child(5) {
    animation-delay: 0.25s;
}

.benefit-item:nth-child(6) {
    animation-delay: 0.3s;
}

.benefit-item:nth-child(7) {
    animation-delay: 0.35s;
}

/* ========================================
   交互微动效
   ======================================== */

/* 输入框聚焦动画 */
.form-input,
.form-textarea {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus,
.form-textarea:focus {
    animation: pulse 0.3s ease-out;
}

/* 按钮悬停动画 */
.btn-primary,
.btn-secondary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before,
.btn-secondary:hover::before {
    width: 300px;
    height: 300px;
}

/* 按钮图标动画 */
.btn-primary svg,
.btn-secondary svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-secondary:hover svg {
    transform: translateX(-4px);
}

/* 开始按钮特殊动画 */
.btn-start {
    animation: breathe 2s infinite;
}

.btn-start:hover {
    animation: none;
}

/* ========================================
   进度条动画
   ======================================== */
.progress-fill {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
}

/* ========================================
   卡片悬停效果
   ======================================== */
.info-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.benefits-list {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.benefits-list:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

/* ========================================
   图标动画
   ======================================== */
.cover-icon svg {
    animation: float 3s ease-in-out infinite;
}

.info-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-item:hover .info-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary-gradient);
}

.info-item:hover .info-icon svg {
    stroke: white;
}

.benefit-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.benefit-item:hover .benefit-icon {
    transform: scale(1.1);
}

/* ========================================
   标签动画
   ======================================== */
.section-badge {
    animation: fadeInDown 0.5s ease-out;
}

.section-title {
    animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

/* ========================================
   页面导航动画
   ======================================== */
.page-nav {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out 0.4s forwards;
}

/* ========================================
   感谢页特殊动画
   ======================================== */
.thank-you-page .thank-title {
    animation: fadeInUp 0.6s ease-out 0.8s backwards;
}

.thank-you-page .thank-description {
    animation: fadeInUp 0.6s ease-out 1s backwards;
}

.thank-you-page .thank-actions {
    animation: fadeInUp 0.6s ease-out 1.2s backwards;
}

/* ========================================
   表单验证动画
   ======================================== */
.form-input.error,
.form-textarea.error {
    border-color: var(--error);
    animation: shake 0.4s ease-out;
}

.form-input.success,
.form-textarea.success {
    border-color: var(--success);
}

/* ========================================
   加载动画
   ======================================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   数字跳动动画
   ======================================== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-text span:first-child {
    display: inline-block;
    animation: countUp 0.3s ease-out;
}

/* ========================================
   禁用预加载闪烁
   ======================================== */
.preload * {
    transition: none !important;
    animation: none !important;
}