/* 全局变量 */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --background-color: #f8fafc;
    --text-color: #1f2937;
    --secondary-text: #4b5563;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --hover-color: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* 页面头部样式 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 8rem 2rem 4rem;
    color: white;
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.page-description {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* 搜索框样式 */
.search-box {
    max-width: 600px;
    margin: 0 auto;
}

.search-box form {
    display: flex;
    width: 100%;
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
    outline: none;
}

.search-box button {
    padding: 1rem 2rem;
    background: var(--primary-dark);
    border: none;
    color: white;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: var(--primary-color);
}

/* 主容器样式 */
.resource-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 资源区块样式 */
.resource-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    font-size: 1.2em;
}

/* 资源网格样式 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* 资源卡片样式 */
.resource-item {
    background: var(--hover-color);
    padding: 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.resource-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.resource-item h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.resource-item p {
    color: var(--secondary-text);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* 标签样式 */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--card-background);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
}

/* 链接样式 */
a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-dark);
}

/* 图标样式 */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--hover-color);
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header {
        padding: 6rem 1rem 3rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-description {
        font-size: 1rem;
    }

    .resource-container {
        padding: 1rem;
    }

    .resource-section {
        padding: 1.5rem;
    }

    .resource-grid {
        grid-template-columns: 1fr;
    }

    .search-box {
        padding: 0 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resource-section {
    animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-text);
}

.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.hidden {
    display: none;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 打印样式 */
@media print {
    .resource-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .search-box,
    .tag-list {
        display: none;
    }
}

/* 回到顶部按钮样式 */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 适配移动端 */
@media (max-width: 768px) {
    .back-to-top {
        right: 20px;
        bottom: 20px;
        width: 40px;
        height: 40px;
    }
}

/* 分类导航样式 */
.category-nav {
    background: white;
    padding: 1rem 2rem;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    max-width: 1200px;
}

.category-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    list-style: none;
}

.category-nav-item {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: var(--background-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-nav-item:hover {
    background: var(--primary-color);
    color: white;
}

/* 适配移动端 */
@media (max-width: 768px) {
    .category-nav {
        padding: 1rem;
        margin: 1rem;
    }
    
    .category-nav-list {
        gap: 0.5rem;
    }
    
    .category-nav-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
} 