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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

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

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

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

/* 导航栏滚动效果 */
nav.scrolled {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 响应式菜单 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 6px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    padding: 80px 20px;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu a {
    display: block;
    padding: 15px 0;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu a:hover {
    color: #007bff;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,123,255,0.2);
}

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

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

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

.hobby-card:hover img {
    transform: scale(1.1);
}

/* 表单输入效果 */
.form-control {
    transition: all 0.3s ease;
}

.form-control:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

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

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

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

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

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 100px;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
    }
    
    .py-20 {
        padding-top: 100px;
        padding-bottom: 100px;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .bg-white {
        background-color: #2d2d2d;
    }
    
    .bg-gray-50 {
        background-color: #1a1a1a;
    }
    
    .bg-gray-900 {
        background-color: #121212;
    }
    
    .text-gray-900 {
        color: #e0e0e0;
    }
    
    .text-gray-700 {
        color: #c0c0c0;
    }
    
    .text-gray-600 {
        color: #a0a0a0;
    }
    
    .text-gray-500 {
        color: #808080;
    }
    
    .border-gray-300 {
        border-color: #404040;
    }
    
    .border-gray-800 {
        border-color: #303030;
    }
    
    .bg-blue-100 {
        background-color: rgba(0,123,255,0.2);
    }
    
    .bg-gray-100 {
        background-color: #303030;
    }
    
    .shadow-sm {
        box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }
    
    .shadow-md {
        box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    }
    
    .shadow-lg {
        box-shadow: 0 10px 15px rgba(0,0,0,0.5);
    }
}