:root {
    --bg: #0d1117;
    --card-bg: #161b22;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-muted: #8b949e;
    --blue: #58a6ff;
    --green: #238636;
    --green-hover: #2ea043;
    --console-bg: #010409;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html {
    scroll-behavior: smooth;
}

@view-transition {
    navigation: auto;
}

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

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.brand-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: opacity 0.15s ease;
}

.brand-link:hover {
    opacity: 0.9;
}

.brand-owner {
    color: var(--text-muted);
}

.brand-sep {
    color: var(--text-muted);
    margin: 0 2px;
}

.brand-name {
    color: var(--blue);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* GitHub Buttons */
.btn {
    appearance: none;
    background-color: #21262d;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    padding: 5px 16px;
    text-decoration: none !important;
    user-select: none;
    vertical-align: middle;
    white-space: nowrap;
    transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1),
                background-color 0.15s ease,
                border-color 0.15s ease,
                box-shadow 0.15s ease;
}

.btn:hover {
    background-color: #30363d;
    border-color: #8b949e;
    color: var(--text-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: scale(0.96) translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) inset;
}

.btn-sm {
    font-size: 12px;
    padding: 3px 12px;
    line-height: 20px;
}

.btn-primary {
    background-color: var(--green);
    border-color: rgba(240, 246, 252, 0.1);
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: var(--green-hover);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.35);
}

.btn-primary:active {
    transform: scale(0.96) translateY(1px);
}

.octicon {
    display: inline-block;
    vertical-align: text-bottom;
    fill: currentColor;
}

/* Page Entrance Animation */
@keyframes pageEntrance {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main */
.main {
    flex: 1;
    padding: 32px 16px;
    animation: pageEntrance 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.intro {
    margin-bottom: 24px;
}

.intro h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
}

.intro p {
    color: var(--text-muted);
    font-size: 14px;
}

.callout-row {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.directory-callout {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
}

.directory-label {
    color: var(--text-muted);
    font-weight: 500;
}

.directory-link {
    color: var(--blue);
    text-decoration: none;
    font-family: var(--font-mono);
}

.directory-link:hover {
    text-decoration: underline;
}

.directory-badge {
    background-color: rgba(110, 118, 129, 0.2);
    color: var(--text-primary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    font-family: var(--font-mono);
}

.privacy-callout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(35, 134, 54, 0.1);
    border: 1px solid rgba(57, 211, 83, 0.25);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
}

.privacy-badge {
    background-color: var(--green);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.privacy-text {
    color: var(--text-primary);
}

/* Tabs */
.UnderlineNav {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    gap: 8px;
}

.UnderlineNav-item {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    text-decoration: none !important;
    border-radius: 6px 6px 0 0;
    transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.UnderlineNav-item:hover {
    color: var(--text-primary);
    background-color: rgba(110, 118, 129, 0.12);
    border-bottom-color: var(--border);
}

.UnderlineNav-item:active {
    transform: scale(0.96);
}

.UnderlineNav-item.selected {
    color: var(--text-primary);
    border-bottom-color: #f78166;
    font-weight: 600;
}

/* Documentation */
.docs-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 72px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

.docs-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.docs-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.docs-nav-link {
    display: block;
    padding: 6px 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.docs-nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(110, 118, 129, 0.15);
    transform: translateX(4px);
}

.docs-nav-link:active {
    transform: scale(0.97) translateX(2px);
}

.docs-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 36px;
}

section[id], [id], .markdown-body h2, .markdown-body h3 {
    scroll-margin-top: 96px;
}

.markdown-body h1 {
    font-size: 26px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.markdown-body h2 {
    font-size: 20px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-top: 36px;
    margin-bottom: 16px;
}

.markdown-body h2:first-of-type {
    margin-top: 0;
}

.markdown-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.markdown-body p {
    color: var(--text-primary);
    line-height: 1.65;
    margin-bottom: 16px;
}

.markdown-body ul, .markdown-body ol {
    margin-left: 24px;
    margin-bottom: 16px;
    line-height: 1.65;
}

.markdown-body li {
    margin-bottom: 6px;
}

.markdown-body hr {
    height: 1px;
    background-color: var(--border);
    border: none;
    margin: 32px 0;
}

.markdown-body pre {
    background-color: var(--console-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    margin-bottom: 18px;
}

.markdown-body code {
    font-family: var(--font-mono);
    font-size: 12px;
    background-color: rgba(110, 118, 129, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 13px;
}

.markdown-body th, .markdown-body td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.markdown-body th {
    background-color: #010409;
    font-weight: 600;
}

.markdown-body tr:nth-child(even) {
    background-color: rgba(110, 118, 129, 0.05);
}

.markdown-body details {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background-color: #010409;
}

.markdown-body details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
}

.markdown-body details p {
    margin-top: 12px;
    margin-bottom: 0;
    color: var(--text-muted);
}

.docs-callout {
    background-color: var(--console-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.docs-callout-warning {
    border-left-color: #f78166;
}

@media (max-width: 900px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    .docs-sidebar {
        position: static;
        margin-bottom: 24px;
    }
}


/* Query Form */
.query-form {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.query-input {
    flex: 1;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
}

.query-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.3);
}

.submit-btn {
    background-color: var(--green);
    border: 1px solid rgba(240, 246, 252, 0.1);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    white-space: nowrap;
    transition: all 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.submit-btn:hover {
    background-color: var(--green-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.35);
}

.submit-btn:active {
    transform: scale(0.95) translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
}

/* Console */
.console-wrapper {
    background-color: var(--console-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.console-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.console-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.console-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3fb950;
}

.console-copy-btn {
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.console-copy-btn:hover {
    color: var(--text-primary);
    border-color: #8b949e;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.console-copy-btn:active {
    transform: scale(0.94) translateY(1px);
}

.console-body {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 320px;
    transition: opacity 0.15s ease;
}

.console-body.run-pulse {
    animation: consolePulse 0.22s ease-out;
}

@keyframes consolePulse {
    0% {
        opacity: 0.55;
        transform: translateY(3px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 16px;
    background-color: var(--card-bg);
    font-size: 12px;
    color: var(--text-muted);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-content a {
    color: var(--blue);
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .query-form {
        flex-direction: column;
    }
    .submit-btn {
        width: 100%;
    }
    .header-content, .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }
}
