/* Apple-inspired color palette */
:root {
    --apple-blue: #007AFF;
    --apple-gray: #8E8E93;
    --apple-light-gray: #F2F2F7;
    --apple-green: #34C759;
    --apple-red: #FF3B30;
    --apple-dark: #1D1D1F;
    --apple-white: #FFFFFF;
    --apple-off-white: #F5F5F7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    color: var(--apple-dark);
    background-color: var(--apple-off-white);
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
}

/* 性能优化：减少重排重绘 */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    will-change: transform;
}

/* Header Styles */
header {
    background-color: var(--apple-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--apple-dark);
}

.logo p {
    color: var(--apple-gray);
    font-size: 13px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--apple-dark);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--apple-blue);
}

/* Hero Section */
.hero {
    background-color: var(--apple-blue);
    color: var(--apple-white);
    padding: 50px 0;
    text-align: center;
}

.hero h1 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 25px auto;
    padding: 0 10px;
}

.category-tab {
    padding: 8px 15px;
    background-color: var(--apple-light-gray);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.category-tab:hover, .category-tab.active {
    background-color: var(--apple-blue);
    color: var(--apple-white);
}

/* Resource Sections */
.resource-section {
    padding: 40px 0;
}

.resource-section:nth-child(even) {
    background-color: var(--apple-white);
}

.resource-section h2 {
    text-align: center;
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--apple-dark);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Resource Card Styles */
.resource-card {
    background-color: var(--apple-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 18px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 230px;
    /* 性能优化 */
    contain: content;
    will-change: transform;
}

.resource-section:nth-child(even) .resource-card {
    background-color: var(--apple-off-white);
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.card-content {
    flex-grow: 1;
}

.resource-icon {
    text-align: center;
    margin-bottom: 12px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resource-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
}

/* 加载中样式 */
.resource-icon img:not([src]) {
    opacity: 0;
}

.resource-icon img[src] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.resource-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--apple-dark);
}

.resource-card p {
    color: var(--apple-gray);
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.card-action {
    margin-top: auto;
}

.resource-card a {
    display: inline-block;
    width: 100%;
    padding: 8px 12px;
    background-color: var(--apple-blue);
    color: var(--apple-white);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    transition: background-color 0.3s ease;
    text-align: center;
    will-change: background-color;
}

.resource-card a:hover {
    background-color: #0062cc;
}

/* Footer Styles */
footer {
    background-color: var(--apple-dark);
    color: var(--apple-white);
    padding: 25px 0;
    text-align: center;
    font-size: 14px;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 992px) {
    .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .hero h1 {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 15px;
        justify-content: center;
        gap: 15px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .resource-section {
        padding: 35px 0;
    }
    
    .resource-section h2 {
        font-size: 26px;
        margin-bottom: 25px;
    }
    
    .resource-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .category-tab {
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 600px) {
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    nav ul {
        gap: 12px;
    }
    
    .hero h1 {
        font-size: 26px;
    }
    
    .hero p {
        font-size: 15px;
    }
    
    .resource-card {
        min-height: 200px;
        padding: 15px;
    }
    
    .category-tabs {
        gap: 8px;
        margin: 20px auto;
    }
    
    .category-tab {
        font-size: 12px;
        padding: 5px 10px;
        border-radius: 15px;
    }
}

/* 针对小屏幕的特殊处理 */
@media (max-width: 380px) {
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .resource-card {
        min-height: auto;
    }
} 