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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.header-inner {
    text-align: center;
}

.site-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.site-title a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.site-title a:hover {
    opacity: 0.9;
}

.site-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 300;
}

@media (max-width: 640px) {
    .site-title {
        font-size: 2rem;
    }
    
    .site-subtitle {
        font-size: 1rem;
    }
}

.main-nav {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 0;
    scrollbar-width: none;
}

.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-list li {
    flex-shrink: 0;
}

.nav-list a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.nav-list a:hover {
    background: var(--primary-color);
    color: white;
}

.nav-list a.active {
    background: var(--primary-color);
    color: white;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

.search-section {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box button {
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.search-box button:active {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        width: 100%;
    }
}

.resources-section {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.resource-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.resources-list {
    display: grid;
    gap: 1.5rem;
}

.resource-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 1.5rem;
}

.resource-card-image {
    width: 200px;
    height: 150px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.resource-card:hover .resource-card-image img {
    transform: scale(1.05);
}

.resource-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.5rem 1.5rem 1.5rem 1.5rem;
}

.resource-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

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

.resource-card:hover::before {
    transform: scaleY(1);
}

.resource-card.pinned {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: var(--accent-color);
}

.resource-card.pinned::before {
    background: var(--accent-color);
    transform: scaleY(1);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.resource-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

.resource-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.resource-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.resource-card.pinned .resource-category {
    background: var(--accent-color);
}

.resource-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.resource-summary {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.resource-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.resource-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.resource-tag {
    padding: 0.25rem 0.5rem;
    background: var(--background);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.resource-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.resource-stats svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 640px) {
    .resources-section {
        padding: 1rem;
    }
    
    .resource-card {
        padding: 10px;
        flex-direction: column;
    }
    
    .resource-card-image {
        width: 100%;
        height: 150px;
    }
    
    .resource-card-content {
        padding: 1rem;
    }
    
    .resource-header {
        flex-direction: column;
    }
    
    .resource-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '/';
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.breadcrumb-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-list a:hover {
    color: var(--primary-color);
}

.breadcrumb-list li:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.resource-detail {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.detail-image {
    width: 100%;
    max-width: 600px;
    height: 300px;
    margin: 0 auto 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-meta-item svg {
    width: 16px;
    height: 16px;
}

.detail-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.detail-content {
    margin-bottom: 2rem;
}

.detail-description {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1rem;
}

.detail-description p {
    margin-bottom: 1rem;
}

.detail-link-section {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    border: 2px dashed var(--primary-color);
}

.detail-link-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.detail-link {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    word-break: break-all;
}

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

.detail-tags {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.detail-tags-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.detail-tags-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-tag {
    padding: 0.375rem 0.75rem;
    background: var(--background);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.detail-tag:hover {
    background: var(--primary-color);
    color: white;
}

@media (max-width: 640px) {
    .resource-detail {
        padding: 1rem;
    }
    
    .detail-image {
        height: 200px;
        margin-bottom: 1.5rem;
    }
    
    .detail-title {
        font-size: 1.5rem;
    }
    
    .detail-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .detail-link-section {
        padding: 1.5rem;
    }
    
    .detail-link {
        width: 100%;
        padding: 0.875rem 1rem;
    }
}

.site-footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-text {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.footer-notice {
    font-size: 0.75rem;
    opacity: 0.7;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 0.875rem;
}