@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    --bg: #0b0f14;
    --panel: #0d1117;
    --panel-alt: #0f141b;
    --panel-elevated: #161b22;
    --text: #c9d1d9;
    --muted: #8b949e;
    --border: #30363d;
    --accent: #58a6ff;
    --accent-strong: #1f6feb;
    --success: #3fb950;
    --warning: #d29922;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: radial-gradient(1200px 800px at 20% -10%, rgba(88, 166, 255, 0.12), transparent 60%),
        radial-gradient(900px 600px at 90% -20%, rgba(63, 185, 80, 0.12), transparent 60%),
        var(--bg);
    color: var(--text);
}

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

a:hover {
    color: #8cc0ff;
}

.app-header {
    background: rgba(13, 17, 23, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-badge {
    background: var(--panel-elevated);
    color: var(--accent);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.button {
    border: 1px solid var(--border);
    background: var(--panel-elevated);
    color: var(--text);
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.button:hover {
    border-color: rgba(88, 166, 255, 0.7);
    background: rgba(88, 166, 255, 0.12);
    transform: translateY(-1px);
}

.button-accent {
    background: linear-gradient(120deg, #1f6feb, #58a6ff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 30px rgba(31, 111, 235, 0.25);
}

.button-accent:hover {
    background: linear-gradient(120deg, #2a7fff, #79b8ff);
}

.search-shell {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.search-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem 1.5rem;
}

.search-input {
    width: 100%;
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: rgba(88, 166, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.25);
}

.search-results {
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    margin-top: 0.5rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.search-results a {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(48, 54, 61, 0.7);
    color: var(--text);
    transition: background 0.2s ease;
}

.search-results a:last-child {
    border-bottom: none;
}

.search-results a:hover {
    background: rgba(88, 166, 255, 0.12);
}

.shell {
    display: flex;
    min-height: calc(100vh - 120px);
}

.sidebar {
    width: 300px;
    max-width: 100%;
    background: var(--panel-alt);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
    overflow-y: auto;
}

.sidebar h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: var(--text);
}

.sidebar-toggle {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0.5rem 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar-group a {
    display: block;
    padding: 0.45rem 0.75rem;
    border-radius: 0.6rem;
    color: var(--muted);
}

.sidebar-group a:hover {
    background: rgba(88, 166, 255, 0.12);
    color: var(--text);
}

.main {
    flex: 1;
    padding: 2rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.panel-highlight {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(63, 185, 80, 0.08));
    border: 1px solid rgba(88, 166, 255, 0.3);
}

.breadcrumbs {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.footer {
    border-top: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    text-align: center;
    padding: 1.25rem;
    font-size: 0.85rem;
}

.markdown-shell {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
}

.markdown-shell pre {
    background: var(--panel-elevated);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 1rem;
}

.tip-modal {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
}

@media (max-width: 960px) {
    .shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .main {
        padding: 1.5rem;
    }
}
