/* 全局样式和工具类 */

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

/* 导航栏滚动效果 */
.navbar-scrolled {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* 功能卡片悬停效果 */
.feature-card:hover {
    transform: translateY(-5px);
}

/* 团队成员卡片悬停效果 */
.team-card:hover .team-overlay {
    opacity: 1;
}

/* 表单输入框焦点效果 */
.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

/* 按钮悬停效果 */
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 回到顶部按钮动画 */
.back-to-top.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Flash消息淡入动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.animate-fade-in-down {
    animation: fadeInDown 0.3s ease-out forwards;
}

/* 缓慢弹跳动画 */
@keyframes bounceSlow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce-slow {
    animation: bounceSlow 3s ease-in-out infinite;
}

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

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

/* 延迟动画 */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* 表单输入框焦点样式 */
.form-input-focus:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* 表单验证动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-error {
    animation: shake 0.5s ease-in-out;
}

/* 提交按钮加载动画 */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem !important;
    }

    .section-title {
        font-size: 2rem !important;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem !important;
    }

    .section-title {
        font-size: 1.75rem !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .bg-light {
        background-color: #1a1a1a !important;
    }

    .text-dark {
        color: #f8fafc !important;
    }

    .bg-white {
        background-color: #2d3748 !important;
    }

    .text-gray-600 {
        color: #a0aec0 !important;
    }

    .border-gray-300 {
        border-color: #4a5568 !important;
    }

    .bg-gray-50 {
        background-color: #2d3748 !important;
    }
}

/* 打印样式 */
@media print {
    .navbar, .footer, .back-to-top, .flash-message {
        display: none !important;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #ffffff;
    }

    .nav-link {
        border-bottom: 2px solid transparent;
    }

    .nav-link:hover {
        border-bottom: 2px solid #3b82f6;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 表单字段样式 */
.form-field {
    transition: all 0.3s ease;
}

.form-field:focus-within {
    transform: translateY(-2px);
}

/* 链接悬停效果 */
a {
    transition: color 0.3s ease;
}

/* 图片悬停效果 */
img {
    transition: transform 0.3s ease;
}

/* 卡片阴影过渡 */
.card-shadow {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}
