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

:root {
    --blue: #2563eb;
    --blue-light: #3b82f6;
    --blue-dark: #1d4ed8;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px;
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--blue);
}

.subtitle {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 400;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.filters {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 40px;
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.chip:hover {
    border-color: var(--blue-light);
    color: var(--blue);
}

.chip.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.search-box {
    margin-top: 4px;
}

.search-box input {
    width: 100%;
    max-width: 360px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: white;
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-900);
    outline: none;
    transition: border-color 0.15s;
}

.search-box input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-100);
}

.search-box input::placeholder {
    color: var(--gray-400);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.card-thumb {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--blue-50) 0%, var(--blue-100) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
    overflow: hidden;
}

.card-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(37,99,235,0.08));
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-subject {
    background: var(--blue-50);
    color: var(--blue);
}

.badge-level {
    background: var(--gray-100);
    color: var(--gray-500);
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    font-size: 12px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-400);
    font-size: 16px;
}

@media (max-width: 640px) {
    .header-inner {
        flex-direction: column;
        gap: 4px;
        padding: 20px 20px;
    }
    main {
        padding: 20px 16px;
    }
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .gallery {
        grid-template-columns: 1fr;
    }
}
