/* ============================================
   项目资源库样式表 - 现代化设计
   ============================================ */

:root {
    /* 主色调 */
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #eef2ff;
    --secondary-color: #7209b7;
    --accent-color: #f72585;
    --success-color: #4cc9f0;
    
    /* 中性色 */
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 间距 */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* 过渡效果 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 字体 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== 导航栏 ========== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--space-sm) 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--dark-color);
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.search-container {
    flex: 1;
    max-width: 500px;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    background: var(--gray-100);
    transition: all var(--transition-normal);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: var(--gray-100);
}

.search-result-item:last-child {
    border-bottom: none;
}

.nav-links {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.admin-link {
    background: var(--primary-color);
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.admin-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: 0.5rem;
}

/* ========== 英雄区域 ========== */
.hero {
    position: relative;
    padding: var(--space-2xl) var(--space-lg);
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.hero h2 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.highlight {
    color: #ffd166;
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(255, 209, 102, 0.3);
    z-index: -1;
    border-radius: 4px;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--space-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.stat {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 160px;
}

.stat i {
    font-size: 2rem;
    color: #ffd166;
}

.stat div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.count {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat span:not(.count) {
    font-size: 0.875rem;
    opacity: 0.8;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -100px;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -50px;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 70%;
}

/* ========== 主要内容区 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg) var(--space-2xl);
    flex: 1;
}

.section {
    margin-bottom: var(--space-2xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.section-header h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-header h3 i {
    color: var(--primary-color);
}

.view-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: gap var(--transition-normal);
}

.view-all:hover {
    gap: 0.75rem;
}

.filter-controls {
    display: flex;
    gap: var(--space-sm);
}

.filter-controls select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: white;
    font-size: 0.95rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 160px;
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* ========== 项目网格 ========== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
}

/* ========== 项目卡片 ========== */
.project-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.project-card.featured::before {
    content: '推荐';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1;
}

.project-thumbnail {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.project-card:hover .project-thumbnail img {
    transform: scale(1.05);
}

.project-thumbnail .default-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), white);
    color: var(--primary-color);
    font-size: 3rem;
}

.project-content {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-header {
    margin-bottom: var(--space-md);
}

.project-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-description {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-100);
}

.project-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.project-info span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.project-info i {
    font-size: 0.875rem;
}

.project-actions {
    display: flex;
    gap: var(--space-sm);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    position: relative;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn.download:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.action-btn.preview:hover {
    background: var(--success-color);
    color: white;
}

.action-btn.info:hover {
    background: var(--gray-700);
    color: white;
}

.action-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    margin-bottom: 0.5rem;
    z-index: 10;
}

.action-btn:hover::after {
    opacity: 1;
    visibility: visible;
    margin-bottom: 0.75rem;
}

/* ========== 分类网格 ========== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-md);
    background: var(--primary-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.category-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--dark-color);
}

.category-count {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* ========== 统计网格 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-info h4 {
    font-size: 0.95rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: var(--space-xl);
}

.page-btn {
    min-width: 40px;
    height: 40px;
    border: 2px solid var(--gray-200);
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.page-btn:hover:not(.active):not(.disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(40px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-xl);
    max-height: calc(90vh - var(--space-xl) * 2);
    overflow-y: auto;
}

/* ========== 页脚 ========== */
.footer {
    background: var(--dark-color);
    color: var(--gray-300);
    padding-top: var(--space-2xl);
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-section h4 {
    color: white;
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
    font-weight: 600;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.footer-logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.footer-logo h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-logo p {
    font-size: 0.875rem;
    opacity: 0.7;
}

.footer-description {
    opacity: 0.7;
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--gray-300);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.footer-contact i {
    width: 20px;
    color: var(--primary-color);
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.7;
}

.footer-bottom strong {
    color: white;
    font-weight: 600;
}

#currentTime {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.5;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .hero h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        margin-top: var(--space-md);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .search-container {
        order: 3;
        width: 100%;
        margin-top: var(--space-md);
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat {
        width: 100%;
        max-width: 300px;
    }
    
    .section-header {
        flex-direction: column;
        gap: var(--space-md);
        align-items: flex-start;
    }
    
    .filter-controls {
        width: 100%;
    }
    
    .filter-controls select {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .nav-container,
    .container,
    .footer-content {
        padding: 0 var(--space-md);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: var(--space-md);
        padding: 0;
    }
}