:root {

    --bg: #f6f7f9;
    --surface: #ffffff;

    --text: #222222;
    --muted: #666666;

    --border: #d7dce2;

    --link: #1f4f99;
    --link-hover: #2b6ad1;

    --sidebar-width: 260px;

    --content-width: 900px;

    --font-body:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

* {
    box-sizing: border-box;
}

body {

    margin: 0;

    background: var(--bg);

    color: var(--text);

    font-family: var(--font-body);

    line-height: 1.6;
}

a {

    color: var(--link);

    text-decoration: none;
}

a:hover {

    color: var(--link-hover);

    text-decoration: underline;
}

.site-header {

    background: white;

    border-bottom: 1px solid var(--border);
}

.header-inner {

    width: 100%;

    padding: 0.75rem 1.5rem;

    display: flex;

    align-items: center;

    justify-content: space-between;
}

.site-brand img {

    max-height: 48px;
}

.top-nav {

    display: flex;

    gap: 1.5rem;

    font-size: 0.95rem;
}

.page-shell {

    width: 100%;

    display: flex;

    gap: 2rem;

    padding: 1.5rem;
}

.sidebar {

    width: var(--sidebar-width);

    flex-shrink: 0;
}

.sidebar-section {

    background: var(--surface);

    border: 1px solid var(--border);

    margin-bottom: 1rem;

    padding: 1rem;
}

.sidebar-section h3 {

    margin-top: 0;

    font-size: 1rem;
}

.sidebar ul {

    margin: 0;

    padding-left: 1.2rem;
}

.keyword-list {

    display: flex;

    flex-wrap: wrap;

    gap: 0.5rem;
}

.keyword-tag {

    background: #e7edf7;

    border-radius: 3px;

    padding: 0.2rem 0.5rem;

    font-size: 0.85rem;
}

.content {

    min-width: 0;

    flex: 1;
}

.topic-content {

    background: var(--surface);

    border: 1px solid var(--border);

    padding: 2rem;

    width: 100%;
}

.breadcrumbs {

    font-size: 0.9rem;

    color: var(--muted);

    margin-bottom: 1rem;
}

.topic-header h1 {

    margin-top: 0;

    margin-bottom: 0.5rem;

    line-height: 1.2;
}

.topic-meta {

    color: var(--muted);

    font-size: 0.95rem;

    margin-bottom: 2rem;
}

.media-embed {

    margin-bottom: 2rem;
}

.media-embed iframe {

    max-width: 100%;
}

.topic-body img {

    max-width: 100%;

    height: auto;
}

.topic-body table {

    width: 100%;

    border-collapse: collapse;
}

.topic-body th,
.topic-body td {

    border: 1px solid var(--border);

    padding: 0.5rem;
}

.site-footer {

    margin-top: 3rem;

    padding: 2rem;

    text-align: center;

    color: var(--muted);

    font-size: 0.9rem;
}

@media (max-width: 900px) {

    .page-shell {

        flex-direction: column;
    }

    .sidebar {

        width: auto;
    }

    .topic-content {

        padding: 1.25rem;
    }
}

.page-shell {

    display: flex;

    width: 100%;

    min-height: calc(100vh - 70px);

    position: relative;
}

.sidebar {

    width: 260px;

    flex-shrink: 0;

    transition:
        width 0.25s ease,
        padding 0.25s ease,
        opacity 0.25s ease;

    overflow-x: hidden;
}

.content {

    flex: 1;

    min-width: 0;

    transition: all 0.25s ease;
}

body.sidebar-collapsed .sidebar {

    width: 0;

    padding: 0;

    opacity: 0;
}

body.sidebar-collapsed .content {

    width: 100%;
}

.sidebar-toggle {

    position: fixed;

    top: 0.75rem;

    left: 0.75rem;

    z-index: 1000;

    border: 1px solid #cccccc;

    background: white;

    padding: 0.45rem 0.7rem;

    cursor: pointer;

    font-size: 1.1rem;

    border-radius: 4px;
}

.site-header {

    padding-left: 4rem;
}

.metadata-panel {

    margin-top: 2rem;

    border-top: 1px solid var(--border);

    padding-top: 1rem;
}

.metadata-panel summary {

    cursor: pointer;

    font-weight: 600;

    margin-bottom: 1rem;
}

.metadata-table {

    width: 100%;

    border-collapse: collapse;
}

.metadata-table th,
.metadata-table td {

    border: 1px solid var(--border);

    padding: 0.5rem;

    vertical-align: top;
}

.metadata-table th {

    width: 220px;

    text-align: left;

    background: #f3f5f7;
}