:root {
    --bg-color: #050505;
    --surface: #0d0d0d;
    --surface-raised: #141414;
    --text-primary: #f4f1ea;
    --text-secondary: #a8a29a;
    --accent: #56D4E8;
    --accent-muted: #2f3a2f;
    --border: #242424;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-stack);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.site-header {
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: 0;
}

.logo a {
    color: inherit;
    text-decoration: none;
}

.search-box {
    display: flex;
    background: var(--surface);
    border-radius: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    flex-grow: 1;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 7px 6px;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
}

.search-box button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.filter-wrapper {
    position: relative;
}

.btn-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-filter:hover,
.btn-filter[aria-expanded="true"] {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    max-width: 90vw;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 8px;
    z-index: 102;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 500px) {
    .filter-menu {
        grid-template-columns: repeat(2, 1fr);
        min-width: 300px;
    }
}

@media (min-width: 800px) {
    .filter-menu {
        grid-template-columns: repeat(3, 1fr);
        min-width: 450px;
    }
}

.filter-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}

.filter-item:hover,
.filter-item.active {
    background: rgba(200, 164, 93, 0.12);
    color: var(--accent);
}

.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99;
    display: none;
    background: transparent;
}

.filter-overlay.active {
    display: block;
}

.resource-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 0;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    grid-column: 1 / -1;
    width: fit-content;
}

.btn-back-home:hover {
    color: var(--accent);
    background-color: var(--surface-raised);
    border-color: var(--accent);
}

@media (min-width: 640px) {
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .resource-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: var(--surface);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    background: var(--surface-raised);
    border-color: #3b3324;
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #000;
    border-bottom: 1px solid var(--border);
}

.card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
    letter-spacing: 0;
    font-weight: 500;
    margin-bottom: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.card-tag:hover {
    color: var(--accent);
    background: rgba(200, 164, 93, 0.08);
    border-color: var(--accent);
}

.card-title {
    font-size: 1rem;
    font-weight: 550;
    margin-bottom: 0;
    color: var(--text-primary);
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.card-title a {
    color: var(--accent);
    text-decoration: none;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.card-title a:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 30px 0 50px;
}

.pagination button,
.pagination .page-number {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.pagination .page-number.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #080808;
    font-weight: 600;
}

.pagination .page-number:hover:not(.active) {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination .dots {
    color: var(--text-secondary);
    padding: 0 4px;
}

.pagination .page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination .page-input {
    width: 60px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    outline: none;
}

.pagination .page-input:focus {
    border-color: var(--accent);
}

.pagination .page-input::-webkit-inner-spin-button,
.pagination .page-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 640px) {
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination .page-jump {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 8px;
    }
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--text-secondary);
    gap: 16px;
    animation: fadeIn 0.3s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(200, 164, 93, 0.14);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 80px 20px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 6px;
    margin: 20px 0;
    animation: fadeIn 0.5s ease;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-text {
    color: var(--text-secondary);
    max-width: 300px;
    font-size: 0.95rem;
}

.btn-reset-search {
    margin-top: 24px;
    padding: 10px 20px;
    background: var(--surface);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-reset-search:hover {
    background: var(--accent);
    color: #080808;
}

.error {
    text-align: center;
    padding: 40px;
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.18);
    border-radius: 6px;
    margin: 20px 0;
}

.hidden {
    display: none !important;
}
