/* ========================================
   谷谷AI智影 - 交互动画样式
   ======================================== */

/* ==========================================
   1. 滚动触发动画基础样式
   ========================================== */
.reveal-on-scroll,
.service-card,
.choose-card,
.portfolio-item,
.info-card {
    will-change: opacity, transform;
}

.revealed {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ==========================================
   4. 打字机光标效果
   ========================================== */
.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ==========================================
   10. 波纹效果样式
   ========================================== */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 按钮相对定位（支持波纹效果） */
.btn,
.filter-btn,
button[type="submit"] {
    position: relative;
    overflow: hidden;
}

/* ==========================================
   表单输入抖动动画（验证失败）
   ========================================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ==========================================
   表单输入焦点增强
   ========================================== */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--neon-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
    transition: all 0.3s ease;
}

/* ==========================================
   图片加载优化
   ========================================== */
img {
    will-change: opacity;
}

img[loading="lazy"] {
    background: linear-gradient(
        90deg,
        rgba(26, 31, 58, 0.2) 0%,
        rgba(26, 31, 58, 0.3) 50%,
        rgba(26, 31, 58, 0.2) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

img[loading="lazy"].loaded {
    animation: none;
    background: none;
}

/* ==========================================
   3D卡片倾斜准备
   ========================================== */
.service-card,
.choose-card,
.info-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

/* ==========================================
   页面过渡动画
   ========================================== */
body {
    transition: opacity 0.5s ease;
}

/* ==========================================
   按钮悬停增强
   ========================================== */
.btn {
    transition: all 0.3s ease;
}

.btn:active {
    transform: translateY(1px) !important;
}

/* ==========================================
   筛选按钮激活动画
   ========================================== */
.filter-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn.active {
    animation: pulse-once 0.5s ease;
}

@keyframes pulse-once {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ==========================================
   数字滚动动画准备
   ========================================== */
.stat-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    will-change: contents;
}

/* ==========================================
   卡片悬停增强（配合3D倾斜）
   ========================================== */
.service-card,
.choose-card,
.info-card {
    will-change: transform;
}

.service-card::after,
.choose-card::after,
.info-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(168, 85, 247, 0.1),
        rgba(236, 72, 153, 0.1)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.service-card:hover::after,
.choose-card:hover::after,
.info-card:hover::after {
    opacity: 1;
}

/* ==========================================
   作品集卡片动画延迟（依次出现效果）
   ========================================== */
.portfolio-item:nth-child(1) { transition-delay: 0.1s; }
.portfolio-item:nth-child(2) { transition-delay: 0.15s; }
.portfolio-item:nth-child(3) { transition-delay: 0.2s; }
.portfolio-item:nth-child(4) { transition-delay: 0.25s; }
.portfolio-item:nth-child(5) { transition-delay: 0.3s; }
.portfolio-item:nth-child(6) { transition-delay: 0.35s; }
.portfolio-item:nth-child(7) { transition-delay: 0.4s; }
.portfolio-item:nth-child(8) { transition-delay: 0.45s; }

/* ==========================================
   服务卡片动画延迟
   ========================================== */
.service-card:nth-child(1) { transition-delay: 0.1s; }
.service-card:nth-child(2) { transition-delay: 0.2s; }
.service-card:nth-child(3) { transition-delay: 0.3s; }
.service-card:nth-child(4) { transition-delay: 0.4s; }
.service-card:nth-child(5) { transition-delay: 0.5s; }
.service-card:nth-child(6) { transition-delay: 0.6s; }

/* ==========================================
   选择理由卡片动画延迟
   ========================================== */
.choose-card:nth-child(1) { transition-delay: 0.1s; }
.choose-card:nth-child(2) { transition-delay: 0.2s; }
.choose-card:nth-child(3) { transition-delay: 0.3s; }

/* ==========================================
   联系信息卡片动画延迟
   ========================================== */
.info-card:nth-child(1) { transition-delay: 0.1s; }
.info-card:nth-child(2) { transition-delay: 0.2s; }
.info-card:nth-child(3) { transition-delay: 0.3s; }
.info-card:nth-child(4) { transition-delay: 0.4s; }

/* ==========================================
   性能优化 - 移动端禁用部分动画
   ========================================== */
@media (max-width: 768px) {
    .service-card,
    .choose-card,
    .info-card {
        transform: none !important;
    }
    
    .service-card::after,
    .choose-card::after,
    .info-card::after {
        display: none;
    }
}

/* ==========================================
   减少动画模式（尊重用户偏好）
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .typing-cursor::after {
        animation: none;
    }
}

/* ==========================================
   滚动行为优化
   ========================================== */
html {
    scroll-behavior: smooth;
}

/* ==========================================
   加载状态通用样式
   ========================================== */
.loading-skeleton {
    background: linear-gradient(
        90deg,
        rgba(26, 31, 58, 0.2) 0%,
        rgba(26, 31, 58, 0.3) 50%,
        rgba(26, 31, 58, 0.2) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

/* ==========================================
   触摸设备优化
   ========================================== */
@media (hover: none) {
    .btn:hover {
        transform: none;
    }
}

