:root {
    --bg: #f8f9fa;
    --paper: #ffffff;
    --ink: #202122;
    --muted: #54595d;
    --line: #a2a9b1;
    --line-soft: #c8ccd1;
    --link: #0645ad;
    --link-visited: #0b0080;
    --link-hover: #0b6cff;
    --toc-bg: #f8f9fa;
    --infobox-bg: #f8f9fa;
    --max: 1280px;
    --serif: "Libre Baskerville", "Linux Libertine", Georgia, "Times New Roman", serif;
    --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.wk-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.wk-preview {
    background: #36c;
    color: #fff;
    text-align: center;
    padding: .45rem 1rem;
    font-size: .85rem;
}
.wk-preview a { color: #fff; text-decoration: underline; }

/* —— Header —— */
.wk-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line-soft);
}
.wk-header-inner {
    width: min(var(--max), calc(100% - 2rem));
    margin: 0 auto;
    min-height: 64px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: .55rem 0;
}
.wk-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: inherit;
    text-decoration: none;
}
.wk-brand:hover { text-decoration: none; color: inherit; }
.wk-globe {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, #fff 0 18%, transparent 19%),
        linear-gradient(90deg, transparent 46%, #36c 46% 54%, transparent 54%),
        linear-gradient(#36c, #36c);
    box-shadow: inset 0 0 0 2px #36c;
    background-color: #eaecf0;
}
.wk-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.wk-brand-text strong {
    font-family: var(--serif);
    font-size: 1.15rem;
}
.wk-brand-text small {
    color: var(--muted);
    font-size: .75rem;
}
.wk-search {
    display: flex;
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--paper);
    overflow: hidden;
}
.wk-search input {
    flex: 1;
    border: 0;
    outline: none;
    padding: .55rem .75rem;
    font: inherit;
    font-size: .95rem;
    background: transparent;
}
.wk-search button {
    border: 0;
    border-left: 1px solid var(--line-soft);
    background: #f8f9fa;
    padding: 0 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    color: var(--ink);
}
.wk-search button:hover { background: #eaecf0; }
.wk-topnav {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .85rem;
    justify-content: flex-end;
    font-size: .9rem;
}
.wk-topnav a.is-active { font-weight: 700; }

/* —— Shell —— */
.wk-shell {
    width: min(var(--max), calc(100% - 2rem));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1rem 0 2.5rem;
    align-items: start;
}
.wk-sidebar-toggle {
    display: none;
    width: 100%;
    margin-bottom: .5rem;
    border: 1px solid var(--line);
    background: var(--paper);
    padding: .5rem .75rem;
    font: inherit;
    cursor: pointer;
}
.wk-sidebar-panel {
    background: var(--paper);
    border: 1px solid var(--line-soft);
    padding: .75rem .9rem 1rem;
}
.wk-side-block + .wk-side-block {
    margin-top: .9rem;
    padding-top: .85rem;
    border-top: 1px solid var(--line-soft);
}
.wk-side-block h2 {
    margin: 0 0 .45rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.wk-side-block ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.wk-side-block li { margin: .28rem 0; font-size: .92rem; }
.wk-side-block p { margin: 0; font-size: .92rem; line-height: 1.4; }
.wk-side-block a.is-active { font-weight: 700; }

.wk-main { min-width: 0; }
.wk-content {
    background: var(--paper);
    border: 1px solid var(--line-soft);
    padding: 1.25rem 1.4rem 2rem;
}

.wk-page-head { margin-bottom: 1.25rem; }
.wk-page-head h1 {
    margin: 0 0 .5rem;
    font-family: var(--serif);
    font-size: clamp(1.7rem, 3vw, 2.15rem);
    font-weight: 700;
    line-height: 1.2;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: .4rem;
}
.wk-kicker {
    margin: 0 0 .25rem;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}
.wk-lead {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--muted);
}
.wk-article-from {
    margin: .35rem 0 0;
    font-size: .9rem;
    color: var(--muted);
}

.wk-panel {
    margin: 1.35rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--line-soft);
}
.wk-panel > h2 {
    margin: 0 0 .75rem;
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: .3rem;
}

.wk-welcome-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1.25rem;
    align-items: start;
}
.wk-welcome-grid .wk-panel {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.wk-featured {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 1rem;
}
.wk-featured-media {
    border: 1px solid var(--line-soft);
    background: #eaecf0;
}
.wk-featured-media img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}
.wk-featured h3 {
    margin: 0 0 .5rem;
    font-family: var(--serif);
    font-size: 1.15rem;
}
.wk-featured p { margin: 0 0 .65rem; line-height: 1.55; }

.wk-portals {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .65rem;
}
.wk-portal {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    border: 1px solid var(--line-soft);
    padding: .75rem .85rem;
    background: #f8f9fa;
    color: inherit;
    text-decoration: none;
}
.wk-portal:hover {
    border-color: var(--link);
    text-decoration: none;
}
.wk-portal strong { font-family: var(--serif); }
.wk-portal span { font-size: .8rem; color: var(--muted); }

.wk-results { display: grid; gap: 1rem; }
.wk-card {
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--line-soft);
}
.wk-card:last-child { border-bottom: 0; padding-bottom: 0; }
.wk-card h3 {
    margin: 0 0 .3rem;
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 700;
}
.wk-card-meta {
    margin: 0 0 .4rem;
    font-size: .85rem;
    color: var(--muted);
}
.wk-card-excerpt {
    margin: 0 0 .4rem;
    line-height: 1.55;
    color: var(--ink);
}
.wk-card-more { margin: 0; font-size: .9rem; }

.wk-bullet-list {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.65;
}
.wk-bullet-list li { margin: .35rem 0; }

/* —— Infobox —— */
.wk-infobox {
    border: 1px solid var(--line);
    background: var(--infobox-bg);
    font-size: .88rem;
}
.wk-infobox-title {
    background: #eaecf0;
    border-bottom: 1px solid var(--line);
    text-align: center;
    font-family: var(--serif);
    font-weight: 700;
    padding: .55rem .65rem;
}
.wk-infobox-media {
    margin: 0;
    padding: .65rem;
    border-bottom: 1px solid var(--line-soft);
}
.wk-infobox-media img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border: 1px solid var(--line-soft);
}
.wk-infobox-media figcaption {
    margin-top: .35rem;
    text-align: center;
    font-size: .75rem;
    color: var(--muted);
}
.wk-infobox table {
    width: 100%;
    border-collapse: collapse;
}
.wk-infobox th,
.wk-infobox td {
    border-top: 1px solid var(--line-soft);
    padding: .4rem .55rem;
    vertical-align: top;
    text-align: left;
}
.wk-infobox th {
    width: 38%;
    font-weight: 600;
    background: rgba(255,255,255,.45);
}
.wk-infobox-note {
    margin: 0;
    padding: .55rem .65rem;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: .8rem;
}

/* —— Article —— */
.wk-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 1.25rem;
    align-items: start;
}
.wk-toc {
    background: var(--toc-bg);
    border: 1px solid var(--line);
    padding: .75rem 1rem;
    margin: 0 0 1.25rem;
    display: inline-block;
    min-width: min(280px, 100%);
}
.wk-toc strong {
    display: block;
    margin-bottom: .4rem;
    font-size: .95rem;
}
.wk-toc ol {
    margin: 0;
    padding-left: 1.2rem;
    font-size: .9rem;
}
.wk-toc li { margin: .2rem 0; }
.wk-toc ol ol { margin-top: .15rem; }

.wk-prose {
    font-family: var(--serif);
    font-size: 1.02rem;
    line-height: 1.75;
}
.wk-prose h2,
.wk-prose h3 {
    font-family: var(--serif);
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: .25rem;
    margin: 1.6rem 0 .75rem;
    scroll-margin-top: 1rem;
}
.wk-prose h2 { font-size: 1.35rem; }
.wk-prose h3 { font-size: 1.15rem; border-bottom: 0; }
.wk-prose p { margin: 0 0 1rem; }
.wk-prose a { text-decoration: none; }
.wk-prose a:hover { text-decoration: underline; }
.wk-prose ul, .wk-prose ol { margin: 0 0 1rem; padding-left: 1.35rem; }
.wk-prose img {
    margin: 1rem auto;
    border: 1px solid var(--line-soft);
}
.wk-prose blockquote {
    margin: 1rem 0;
    padding: .25rem 0 .25rem 1rem;
    border-left: 3px solid var(--line);
    color: var(--muted);
}
.wk-see-also { margin-top: 2rem; }
.wk-see-also h2 {
    font-family: var(--serif);
    font-size: 1.25rem;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: .3rem;
}
.wk-source { margin-top: 1.5rem; font-size: .95rem; }
.wk-empty { color: var(--muted); padding: 1rem 0; }
.wk-empty-page { text-align: center; padding: 3rem 1.5rem; }
.wk-empty-page h1 { border: 0; }

.wk-footer {
    border-top: 1px solid var(--line-soft);
    background: var(--paper);
    padding: 1.25rem 0 2rem;
    color: var(--muted);
    font-size: .88rem;
}
.wk-footer-inner {
    width: min(var(--max), calc(100% - 2rem));
    margin: 0 auto;
}
.wk-footer p { margin: 0 0 .4rem; }
.wk-footer-copy { font-size: .8rem; }

@media (max-width: 980px) {
    .wk-welcome-grid,
    .wk-article-layout {
        grid-template-columns: 1fr;
    }
    .wk-infobox-home { order: -1; }
}
@media (max-width: 820px) {
    .wk-header-inner {
        grid-template-columns: 1fr;
        gap: .65rem;
    }
    .wk-topnav { justify-content: flex-start; }
    .wk-shell { grid-template-columns: 1fr; }
    .wk-sidebar-toggle { display: block; }
    .wk-sidebar-panel { display: none; }
    .wk-sidebar-panel.is-open { display: block; }
    .wk-featured { grid-template-columns: 1fr; }
}
