:root {
    --primary: #4f46e5;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --border: #e2e8f0;
    --radius: 8px;
    --gap: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.4;
    padding: 1rem;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.search-module {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.search-grid {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
}

#searchInput {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
}

#engineSelect {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
    min-width: 100px;
}

#searchButton {
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap);
}

.category-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.category-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.nav-item {
    display: flex;
}

.nav-link {
    display: block;
    width: 100%;
    padding: 0.4rem 0.75rem;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(79, 70, 229, 0.1);
    border-color: rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    padding: 1.5rem 0;
    text-align: center;
}

.footer-line {
    margin: 0.5rem 0;
    color: #64748b;
    font-size: 0.9rem;
}

.footer-line a {
    color: #64748b;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s;
}

.footer-line a:hover {
    color: var(--primary);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .search-grid {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .nav-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .nav-link {
        font-size: 0.8rem;
    }
}