:root {
    --bg-primary: #18212b;
    --bg-secondary: #1e2a36;
    --bg-panel: rgba(34, 48, 63, 0.95);
    --bg-hover: #2a3a4a;
    --text-primary: #e8edf2;
    --text-secondary: #b8c4cf;
    --text-muted: #8d9dab;
    --accent: #c9a84c;
    --accent-hover: #e0c468;
    --border: #2e3f50;
    --radius: 8px;
}

* { box-sizing: border-box; }
html { overflow-y: scroll; scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    line-height: 1.6;
    cursor: url('../template/images/default.cur'), auto;
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary) url('../template/images/main_bg.png') no-repeat center center / cover;
    z-index: -1;
    pointer-events: none;
}
a { cursor: url('../template/images/text.cur'), text; }
button, .btn, input[type="submit"], select { cursor: url('../template/images/pointer.cur'), pointer; }
input:not([type="submit"]), textarea { cursor: url('../template/images/text.cur'), text; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 24px;
    border-bottom: 2px solid #a07828;
    background: rgba(30, 42, 54, .5);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
    backdrop-filter: blur(8px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    height: 50px;
    margin: 0 auto;
}
.header-logo { display: flex; align-items: center; gap: 12px; }
.header-logo-text { color: var(--text-primary); font-size: 1.15rem; font-weight: 700; margin-left: 162.5px !important; }
.nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.nav a { padding: 8px 14px; border-radius: var(--radius); color: var(--text-secondary); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav a.active { color: var(--accent); background: rgba(201, 168, 76, .1); }

.page-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    flex: 1;
    max-width: 1076px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}
.sidebar { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    width: 100%;
    max-width: 700px;
}
.sidebar-card, .article-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .22);
}
.sidebar-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: .95rem;
    font-weight: 700;
}
.sidebar-card__title .icon { display: inline-block; flex-shrink: 0; width: 16px; height: 16px; }
.section-nav { display: flex; flex-direction: column; padding: 8px; }
.section-nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: .9rem;
}
.section-nav a::before { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); content: ''; }
.section-nav a:hover, .section-nav a.active { background: var(--bg-hover); color: var(--text-primary); }

.social-badges { position: absolute; top: 0; right: -230px; z-index: 10; display: flex; flex-direction: column; gap: 10px; }
.social-badges .wumpus-badge { position: static; }
.wumpus-badge { position: absolute; top: 0; right: -230px; z-index: 10; }
.wumpus-badge img { display: block; width: auto; height: 40px; transition: transform .25s ease; }
.wumpus-badge:hover img { transform: scale(1.15); }
.social-badge { display: block; width: 40px; height: 40px; transition: transform .25s ease; }
.social-badge:hover { transform: scale(1.15); }
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(120, 45, 145, 0.15) 0%, transparent 60%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    will-change: left, top;
}
.article-card { font-size: .9rem; line-height: 1.7; }
.article-card-header {
    position: relative;
    padding: 14px 20px;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.6;
}
.article-card-header::after {
    position: absolute;
    right: 0;
    bottom: .5px;
    left: 0;
    height: 1px;
    background: var(--border);
    content: '';
    pointer-events: none;
}
.article-card-body { padding: 20px; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 400;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.article-title { margin: 0; color: var(--text-primary); font-size: 1.6rem; line-height: 1.15; }
.article-lead { margin: 10px 0 0; color: var(--text-secondary); font-size: .85rem; line-height: 1.6; }
.article-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.article-section h2 { margin: 0 0 12px; color: var(--accent); font-size: 1.1rem; }
.article-section p { margin: 0 0 14px; }
.article-section ul, .article-section ol { margin: 0 0 14px; padding-left: 22px; }
.article-section li + li { margin-top: 5px; }
.article-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 18px auto 4px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #101820;
}
.article-image--narrow { max-width: 540px; }
.note {
    margin: 18px 0 0;
    padding: 12px 14px;
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    background: rgba(201, 168, 76, .09);
    color: var(--text-secondary);
    font-size: .9rem;
}
.data-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .9rem; }
.data-table th, .data-table td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; }
.data-table th { color: var(--accent); background: rgba(0, 0, 0, .16); }
.back-link {
    display: inline-flex;
    align-items: center;
    margin-top: 30px;
    padding: 2px 0;
    border-bottom: 1px solid #c99b55;
    color: #d8bd82;
    font-size: .88rem;
    font-weight: 600;
}
.back-link:hover { border-bottom-color: #f0d291; color: #f0d291; }

.footer {
    margin-top: auto;
    padding: 10px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    text-align: center;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 1200px; margin: 0 auto; }
.footer-links { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.footer-links a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: .85rem; }
.footer-links a:hover { color: var(--accent); }
.footer-links img { width: auto; height: 28px; }
.footer-copyright { color: var(--text-muted); font-size: .82rem; }

@media (max-width: 900px) {
    .page-shell { grid-template-columns: 1fr; padding: 20px 16px 32px; }
    .sidebar { order: 2; }
    .content { order: 1; }
    .nav { display: none; }
    .header-inner { flex-direction: column; height: auto; padding: 8px 0; gap: 6px; }
}

@media (max-width: 460px) {
    .section-nav { display: grid; grid-template-columns: 1fr; gap: 2px; }
}

@media (min-width: 1200px) {
    html { font-size: 110%; }
}

/* Полоса прокрутки совпадает с главной страницей. */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
