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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 导航栏样式 */
#navbar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* 按钮样式 */
button:focus, a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 图片懒加载 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1;
}

/* 动画类 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 作品详情模态框 */
#project-modal {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#project-modal.active {
    opacity: 1;
    visibility: visible;
}

#project-modal .bg-white {
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#project-modal.active .bg-white {
    transform: scale(1);
}

/* 表单样式 */
input, textarea {
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    transform: translateY(-1px);
}

/* 响应式调整 */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 60px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
}

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

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

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

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

/* 打印样式 */
@media print {
    #navbar, #mobile-menu, .filter-buttons, .view-details, .social-links, .contact-form {
        display: none !important;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    .work-item {
        break-inside: avoid;
    }
}

/* 无障碍焦点样式 */
@media (prefers-reduced-motion: no-preference) {
    .focus-visible:focus {
        transition: outline-offset 0.2s ease;
    }
}

/* 金色发光文本效果 */
.golden-text {
    color: #ffd700;
    font-weight: 500;
    position: relative;
    display: inline-block;
}

.golden-text::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent 0%, 
        rgba(255, 215, 0, 0.4) 50%, 
        transparent 100%
    );
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 3s infinite linear;
}

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

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .border {
        border-width: 2px;
    }
    
    button, a {
        border: 1px solid currentColor;
    }
}