:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --background-color: #F7F9FC;
    --text-color: #1C1C1E;
    --card-background: #FFFFFF;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --shadow: 0 2px 10px rgba(0,0,0,0.05);
    --hover-shadow: 0 10px 20px rgba(0,0,0,0.1);
    --card-border: 1px solid #E5E9F2;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Header Styles */
header {
    padding: 0.5rem 0;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    height: 50px;
}

.logo {
    color: white;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-weight: 600;
    text-decoration: none;
}

.language-switch {
    display: flex;
    gap: 10px;
}

.lang-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(5px);
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.lang-btn:hover {
    background: white;
    color: var(--primary-color);
}

/* Search Box Styles */
.hero-section {
    background: transparent;
    padding: 1.5rem 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-section .container {
    width: 100%;
    padding: 0;
}

.search-wrapper {
    width: 100%;
    max-width: 650px;
    position: relative;
    z-index: 2;
}

.search-box {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 100px;
    padding: 0.4rem;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    width: 100%;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 18px 35px rgba(0,0,0,0.2);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    background: transparent;
}

.search-box input:focus {
    outline: none;
}

.search-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Category Grid Styles */
.category-grid {
    padding: 1.2rem 1rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    flex: 1;
}

.category {
    height: calc(100vh - 230px);
    min-height: 300px;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.category h2 {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    position: relative;
    justify-content: center;
    text-align: center;
}

.category-icon {
    font-size: 1.2em;
    margin-right: 0.5rem;
}

.category-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-count {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Resource Card Styles */
.resource-card {
    padding: 0.8rem;
    margin-bottom: 0.7rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    text-align: center;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.resource-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    color: var(--text-color);
}

.resource-card h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.resource-card h3 a:hover {
    color: var(--primary-color);
}

.resource-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.tag {
    background: linear-gradient(135deg, #f0f7ff, #e6f0ff);
    border: 1px solid rgba(0,122,255,0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.tag:hover {
    background: linear-gradient(135deg, #e6f0ff, #dae9ff);
    transform: translateY(-1px);
}

/* 2. 添加推荐/热门标识 */
.resource-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-hot {
    background: linear-gradient(135deg, #ff4e50, #f9d423);
    color: white;
}

.badge-recommend {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: white;
}

/* Footer Styles */
footer {
    background: transparent;
    padding: 0.5rem 0 0.75rem;
    text-align: center;
    color: rgba(255,255,255,0.9);
    z-index: 10;
    margin-top: 0;
}

footer p {
    margin: 0;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .category-grid {
        flex-wrap: wrap;
    }
    
    .category {
        flex: 1 1 calc(50% - 0.5rem);
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 1rem;
    }
    
    .search-wrapper {
        max-width: 95%;
    }

    .search-box {
        padding: 0.5rem;
    }

    .search-box input,
    .search-btn {
        padding: 0.5rem 1rem;
    }

    .category-grid {
        padding: 1rem 0.75rem 0;
    }
    
    .category {
        height: auto;
        min-height: 250px;
        max-height: 350px;
    }

    .category h2 {
        padding: 1.5rem;
    }

    .category-grid::after {
        display: none;
    }

    footer {
        padding: 0.75rem 0;
        margin-top: 0.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1C1C1E;
        --text-color: #FFFFFF;
        --card-background: #2C2C2E;
    }

    .resource-card {
        background: rgba(255,255,255,0.05);
        backdrop-filter: blur(10px);
    }

    .resource-card p {
        color: #EBEBF0;
    }

    .tag {
        background: linear-gradient(135deg, rgba(0,122,255,0.1), rgba(88,86,214,0.1));
        border-color: rgba(255,255,255,0.1);
        color: #fff;
    }

    .search-box {
        background: rgba(255,255,255,0.15);
        border-color: rgba(255,255,255,0.1);
    }
    
    .search-box input {
        color: white;
    }

    .search-box input::placeholder {
        color: rgba(255,255,255,0.7);
    }

    footer p {
        color: #EBEBF0;
    }

    .category h2 {
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    }

    .category::after {
        background: rgba(255,255,255,0.1);
    }

    main {
        background: var(--background-color);
    }
}

/* Animation Effects */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resource-card {
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, 
        #f0f0f0 25%, 
        #e0e0e0 50%, 
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* 资源列表容器 */
.resource-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
}

/* 美化滚动条 */
.resource-list::-webkit-scrollbar {
    width: 4px;
}

.category-grid::-webkit-scrollbar {
    height: 6px;
    background: transparent;
}

.category-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
    opacity: 0.5;
}

.category-grid:hover::-webkit-scrollbar-thumb {
    opacity: 1;
}

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

/* 添加资源卡片加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resource-card {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

/* 为不同卡片设置延迟 */
.resource-card:nth-child(2) { animation-delay: 0.1s; }
.resource-card:nth-child(3) { animation-delay: 0.2s; }
.resource-card:nth-child(4) { animation-delay: 0.3s; }

/* 添加网格视图切换功能 */
.view-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

.view-switcher {
    background: white;
    padding: 0.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.view-switcher button {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    color: #666;
}

.view-switcher button.active {
    background: var(--primary-color);
    color: white;
}

/* 添加分类间的视觉分隔 */
.category::after {
    content: '';
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--background-color);
    border-radius: 2px;
}

/* 添加滚动指示器 */
.category-grid::after {
    display: none;
}

/* 主内容区域自适应 */
main {
    background: var(--background-color);
    border-radius: 20px 20px 0 0;
    margin-top: 0.25rem;
    flex: 1;
    overflow: hidden;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
} 