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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

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

/* 按钮点击效果 */
button {
    cursor: pointer;
    outline: none;
    border: none;
}

button:active {
    transform: scale(0.98);
}

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

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

/* 链接样式 */
a {
    text-decoration: none;
    transition: color 0.2s ease;
}

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

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

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

::-webkit-scrollbar-track {
    background: transparent;
}

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

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* 图片懒加载 */
img.lazy {
    filter: blur(8px);
    transition: filter 0.3s ease;
}

img.lazy.loaded {
    filter: blur(0);
}

/* 移动端适配 */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 移动端字体放大 */
    body {
        font-size: 16px;
    }
    
    .text-sm {
        font-size: 14px !important;
    }
    
    .text-xs {
        font-size: 12px !important;
    }
    
    /* 按钮点击区域放大 */
    button, .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* 输入框高度适配 */
    input, textarea, select {
        min-height: 44px;
        padding: 0.75rem;
        font-size: 16px !important; /* 避免iOS缩放 */
    }
    
    /* 卡片间距调整 */
    .card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    /* 导航栏适配 */
    nav {
        padding: 0.75rem 0;
    }
}

/* 黑暗模式过渡 */
html.dark,
html.dark * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 分享图片样式 */
.share-image {
    font-family: sans-serif;
}
