:root {
    --bg-color: #f4f7f6;
    --text-color: #333;
    --header-bg: #4a90e2;
    --header-text: #ffffff;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 8px rgba(0,0,0,0.1);
    --link-color: #4a90e2;
    --link-hover-color: #357abd;
    --footer-text: #777;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-bg: #1e1e1e;
    --header-text: #ffffff;
    --card-bg: #1e1e1e;
    --card-shadow: 0 4px 8px rgba(0,0,0,0.4);
    --link-color: #8ab4f8;
    --link-hover-color: #bbe1fa;
    --footer-text: #aaa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

main {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.category {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.category h2 {
    font-size: 1.5rem;
    color: var(--link-color);
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--header-bg);
    padding-bottom: 0.5rem;
}

.category ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.category li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

[data-theme="dark"] .category li {
    border-bottom: 1px solid #333;
}


.category li:last-child {
    border-bottom: none;
}

.category li:hover {
    background-color: rgba(74, 144, 226, 0.1);
}

.category a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: 500;
    display: block;
    word-break: break-all;
    transition: color 0.2s;
}

.category a:hover {
    color: var(--link-hover-color);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--footer-text);
    font-size: 0.9rem;
}
