/* 自定义全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    scroll-behavior: smooth;
}

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

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

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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

/* 自定义按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: #4361ee;
    color: white;
    box-shadow: 0 4px 14px 0 rgba(67, 97, 238, 0.39);
}

.btn-primary:hover {
    background-color: #3a56d4;
    box-shadow: 0 6px 20px 0 rgba(67, 97, 238, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: white;
    color: #4361ee;
    border: 2px solid #4361ee;
}

.btn-secondary:hover {
    background-color: #f8faff;
    transform: translateY(-2px);
}

/* 自定义卡片样式 */
.card {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-5px);
}

/* 自定义输入框样式 */
.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-input::placeholder {
    color: #a0aec0;
}

/* 自定义标题样式 */
.section-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #64748b;
    margin-bottom: 3rem;
}

/* 自定义背景样式 */
.bg-gradient-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
}

.bg-gradient-accent {
    background: linear-gradient(135deg, #f72585 0%, #4361ee 100%);
}

/* 自定义文本样式 */
.text-gradient-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 自定义间距 */
.section-padding {
    padding-top: clamp(3rem, 8vw, 6rem);
    padding-bottom: clamp(3rem, 8vw, 6rem);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* 加载动画 */
.loading-spinner {
    border: 3px solid rgba(67, 97, 238, 0.1);
    border-radius: 50%;
    border-top: 3px solid #4361ee;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

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

/* 工具类 */
.text-balance {
    text-wrap: balance;
}

.content-auto {
    content-visibility: auto;
}

/* 回到顶部按钮 */
#scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: #4361ee;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(67, 97, 238, 0.39);
    transition: all 0.3s ease;
    z-index: 100;
}

#scroll-to-top:hover {
    background-color: #3a56d4;
    transform: translateY(-5px);
}

/* 滚动进度指示器 */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 9999;
}

.progress-bar {
    height: 4px;
    background: #4361ee;
    width: 0%;
}

/* 确保平滑过渡 */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
}

/* 防止图片变形 */
.aspect-video {
    aspect-ratio: 16 / 9;
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

/* 骨架屏样式 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 确保可访问性 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a202c;
        color: #f7fafc;
    }
    .card {
        background-color: #2d3748;
        border: 1px solid #4a5568;
    }
    .form-input {
        background-color: #4a5568;
        border-color: #718096;
        color: #f7fafc;
    }
    .form-input::placeholder {
        color: #a0aec0;
    }
}