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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #1a1a2e;
    color: #f8f9fa;
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: #16213e;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #36bffb;
}

/* 导航栏样式 */
#navbar {
    background-color: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#navbar.scrolled {
    background-color: rgba(26, 26, 46, 0.95);
    padding-top: 10px;
    padding-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 渐变动画 */
@keyframes gradientBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-bg {
    background: linear-gradient(-45deg, #0066ff, #36bffb, #00cc88);
    background-size: 400% 400%;
    animation: gradientBackground 15s ease infinite;
}

/* 发光效果 */
.glow-text {
    text-shadow: 0 0 10px rgba(0, 102, 255, 0.5), 0 0 20px rgba(0, 102, 255, 0.3);
}

.glow-border {
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.3);
}

/* 项目卡片动画 */
.project-card {
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.project-card:hover {
    transform: translateY(-5px);
}

/* 服务卡片动画 */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.1);
}

/* 按钮动画 */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.btn-primary:hover:before {
    left: 100%;
}

/* 图片悬停效果 */
.img-hover {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.img-hover:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

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

/* 加载动画 */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #0066ff;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

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

/* 数字增长动画 */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.counter {
    animation: countUp 0.6s ease-out forwards;
}

/* 视差效果 */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 响应式媒体查询 */
@media (max-width: 1200px) {
    html {
        scroll-padding-top: 70px;
    }
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* 表单样式 */
.form-input:focus,
.form-textarea:focus {
    border-color: #0066ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

/* 标签动画 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag:hover {
    transform: scale(1.05);
}

/* 轮播控制 */
.testimonial-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.testimonial-dot.active {
    background-color: #0066ff;
    width: 32px;
    border-radius: 6px;
}

/* 渐变边框 */
.gradient-border {
    position: relative;
    border-radius: 0.5rem;
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #0066ff, #36bffb, #00cc88, #0066ff);
    border-radius: 0.6rem;
    z-index: -1;
    animation: borderRotate 4s linear infinite;
}

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

/* 悬浮效果 */
.float-effect {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* 波纹效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple:after {
    content: '';
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.8s;
}

.ripple:active:after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

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

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

/* 背景网格动画 */
.bg-grid-animate {
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: grid-animation 15s linear infinite;
}

@keyframes grid-animation {
    0% { background-position: 0 0; }
    100% { background-position: 30px 30px; }
}

/* 文本出现动画 */
.text-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.text-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* 卡片翻转效果 */
.card-flip {
    perspective: 1000px;
}

.card-flip-inner {
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
    transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* 动态模糊效果 */
.dynamic-blur {
    backdrop-filter: blur(8px);
    transition: backdrop-filter 0.3s ease;
}

.dynamic-blur:hover {
    backdrop-filter: blur(12px);
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 0.15em solid #0066ff;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #0066ff; }
}

/* 辉光按钮 */
.glow-button {
    transition: all 0.3s ease;
}

.glow-button:hover {
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.5), 0 0 30px rgba(0, 102, 255, 0.3);
}

/* 磨砂玻璃效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 3D 变换效果 */
.rotate-3d {
    transition: transform 0.5s ease;
}

.rotate-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg) scale(1.02);
}

/* 粒子效果容器 */
.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* 响应式排版 */
.responsive-text {
    font-size: clamp(1rem, 3vw, 2rem);
}

/* 暗色模式优化 */
.dark-mode {
    color-scheme: dark;
}

/* 性能优化 */
.content-visibility-auto {
    content-visibility: auto;
}

/* 焦点样式 */
.focus-visible {
    outline: 2px solid #0066ff;
    outline-offset: 2px;
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .high-contrast {
        border: 2px solid currentColor;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}