/* 增强样式 - 额外的优化效果 */

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 动画类 */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

/* 悬停效果增强 */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s;
}

.service-card:hover::before {
    left: 100%;
}

/* 按钮增强效果 */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::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, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* 导航栏滚动效果 */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* 统计数字动画 */
.stat-number {
    display: inline-block;
    position: relative;
}

.stat-number.animate {
    animation: countUp 2s ease-out;
}

@keyframes countUp {
    from {
        transform: scale(1.2);
        opacity: 0.5;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 表单增强 */
.form-group {
    position: relative;
}

.form-group input:focus + label,
.form-group textarea:focus + label {
    transform: translateY(-20px) scale(0.8);
    color: #2563eb;
}

/* 卡片阴影增强 */
.service-card,
.portfolio-item,
.advantage-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover,
.portfolio-item:hover,
.advantage-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* 渐变背景动画 */
.hero {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 滚动指示器增强 */
.scroll-indicator {
    cursor: pointer;
    transition: all 0.3s ease;
}

.scroll-indicator:hover {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
}

/* 技术标签增强 */
.tech-tag {
    transition: all 0.3s ease;
    cursor: default;
}

.tech-tag:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-2px);
}

/* 联系信息增强 */
.contact-item {
    transition: all 0.3s ease;
    padding: 1rem;
    border-radius: 8px;
}

.contact-item:hover {
    background: rgba(37, 99, 235, 0.05);
    transform: translateX(5px);
}

/* 页脚链接增强 */
.footer-section ul li a {
    position: relative;
    padding-left: 0;
    transition: all 0.3s ease;
}

.footer-section ul li a::before {
    content: '→';
    position: absolute;
    left: -15px;
    opacity: 0;
    transition: all 0.3s ease;
}

.footer-section ul li a:hover::before {
    opacity: 1;
    left: -10px;
}

.footer-section ul li a:hover {
    padding-left: 10px;
}

/* 响应式增强 */
@media (max-width: 768px) {
    .hero-features {
        justify-content: center;
        gap: 1rem;
    }
    
    .feature-item {
        background: rgba(255, 255, 255, 0.1);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        backdrop-filter: blur(10px);
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* 深色模式增强 */
@media (prefers-color-scheme: dark) {
    .service-card::before {
        background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.1), transparent);
    }
    
    .contact-item:hover {
        background: rgba(96, 165, 250, 0.1);
    }
    
    .tech-tag:hover {
        background: #60a5fa;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        animation: none;
    }
}

/* 焦点可见性增强 */
.btn:focus,
.nav-link:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
}

/* 无障碍增强 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 打印样式增强 */
@media print {
    .hero {
        background: white !important;
        color: black !important;
        min-height: auto;
        padding: 2rem 0;
    }
    
    .service-card,
    .portfolio-item,
    .advantage-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn {
        border: 1px solid #000;
        background: white !important;
        color: black !important;
    }
} 