/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --surface-hover: #242424;
    --border: #333;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #6c9fff;
    --accent-hover: #8bb4ff;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Navbar */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); }

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hero-subtitle { color: var(--text-muted); font-size: 1.2rem; margin-bottom: 0.25rem; }
.hero-stats { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 2rem; }

/* Search */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}
.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.search-btn:hover { background: var(--accent-hover); }

/* Sections */
.section { padding: 2rem 0; }
.section h2 { margin-bottom: 1rem; font-size: 1.5rem; }

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.category-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}
.category-card:hover { border-color: var(--accent); }
.category-name { font-weight: 600; color: var(--text); }
.category-count { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Topic List */
.topic-list { display: flex; flex-direction: column; gap: 0.75rem; }
.topic-card {
    display: block;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}
.topic-card:hover { border-color: var(--accent); }
.topic-card h3 { color: var(--text); font-size: 1.1rem; margin-bottom: 0.25rem; }
.topic-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.topic-meta { font-size: 0.8rem; color: var(--text-muted); }

/* Topic Detail */
.topic-detail { padding: 2rem 0; }
.topic-detail h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.topic-meta-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.badge {
    background: var(--accent);
    color: #000;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.summary-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* Answer Box */
.answer-box {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.answer-box h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.answer-content { line-height: 1.8; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
    color: var(--text-muted);
}

/* Not Found */
.not-found { text-align: center; padding: 4rem 0; }
.not-found h1 { margin-bottom: 0.5rem; }
.not-found p { color: var(--text-muted); margin-bottom: 1.5rem; }
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: #000;
    border-radius: var(--radius);
    font-weight: 600;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.75rem; }
    .search-form { flex-direction: column; }
    .category-grid { grid-template-columns: 1fr 1fr; }
}
