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

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

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

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

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

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

/* 导航栏滚动效果 */
#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding-top: 10px;
    padding-bottom: 10px;
}

/* 按钮悬停效果 */
button, a {
    transition: all 0.3s ease;
}

/* 表单元素焦点效果 */
input:focus, textarea:focus {
    transform: translateY(-1px);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 元素显示动画 */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

.pulse {
    animation: pulse 2s infinite;
}

/* 懒加载图片动画 */
img {
    transition: opacity 0.5s ease;
}

img.lazy {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    /* 导航栏调整 */
    #navbar {
        padding: 16px 0;
    }
    
    /* 英雄区域调整 */
    #home {
        padding-top: 8rem;
    }
    
    /* 服务卡片调整 */
    #services .grid {
        gap: 6px;
    }
    
    /* 作品集调整 */
    #portfolio .grid {
        gap: 6px;
    }
    
    /* 联系表单调整 */
    #contact form {
        padding: 20px;
    }
}

/* 大分辨率屏幕调整 */
@media (min-width: 1280px) {
    /* 增加容器最大宽度 */
    .container {
        max-width: 1200px;
    }
    
    /* 为主要内容区域添加更多的左右边距 */
    #home .container,
    #services .container,
    #portfolio .container,
    #about .container,
    #testimonials .container,
    #contact .container {
        max-width: 1140px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* 导航栏调整 */
    #navbar .container {
        max-width: 1200px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0055ff;
        --text-color: #000000;
        --bg-color: #ffffff;
    }
}

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