/* ==========================================================================
   Wiki Article — modern document layout matching the wiki index + home theme
   --------------------------------------------------------------------------
   Breadcrumb + clean header, then a two-column layout: prose body + a sticky
   sidebar (Contents / Information / Related). Tokens (--qr-*) from qubitrp.css.
   ========================================================================== */

.article-page {
    background: #0b0f13;
    padding: 40px 0 96px;
    min-height: calc(100vh - 78px);
}

/* ---------------------------------------------------------------- Breadcrumb */
.article-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #6f7883;
    margin-bottom: 28px;
}

.article-breadcrumb a {
    color: #9aa3ad;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-breadcrumb a:hover { color: var(--qr-green); }
.article-breadcrumb .sep { color: #3a424b; }
.article-breadcrumb .current { color: #eaf6ff; }

/* -------------------------------------------------------------------- Header */
.article-head {
    max-width: 820px;
    margin: 0 auto 8px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--qr-border);
    text-align: center;
}

.article-cat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    margin-bottom: 22px;
    border: 1px solid rgba(43, 189, 246, 0.4);
    border-radius: 999px;
    background: var(--qr-green-soft);
    color: var(--qr-green-bright);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.article-cat:hover {
    color: var(--qr-green-bright);
    background: rgba(43, 189, 246, 0.18);
}

.article-heading {
    margin: 0 0 18px;
    color: #ffffff;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.5px;
    font-size: clamp(2rem, 4.5vw, 3.1rem);
}

.article-lead {
    max-width: 640px;
    margin: 0 auto 26px;
    color: rgba(233, 246, 255, 0.6);
    font-size: 1.15rem;
    font-style: italic;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
}

.article-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8b939c;
    font-size: 0.9rem;
}

.article-meta__item i { color: var(--qr-green); font-size: 0.85rem; }

/* -------------------------------------------------------------------- Layout */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
    max-width: 1160px;
    margin: 40px auto 0;
}

/* ---------------------------------------------------------------- Prose body */
.article-body {
    background: linear-gradient(180deg, #1b222b 0%, #161c24 100%);
    border: 1px solid var(--qr-border);
    border-radius: 18px;
    padding: 40px 44px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    min-width: 0;
}

.prose {
    color: #c4ccd4;
    font-size: 1.02rem;
    line-height: 1.8;
}

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #ffffff;
    font-weight: 700;
    line-height: 1.25;
    scroll-margin-top: 96px;
}

.prose h1 { font-size: 1.9rem; margin: 2.2rem 0 1rem; }
.prose h2 {
    font-size: 1.55rem;
    margin: 2.4rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--qr-border);
}
.prose h3 { font-size: 1.25rem; margin: 1.8rem 0 0.8rem; }
.prose h4 { font-size: 1.08rem; margin: 1.5rem 0 0.6rem; }

.prose p { margin: 0 0 1.25rem; }

.prose a {
    color: var(--qr-green);
    text-decoration: none;
    border-bottom: 1px solid rgba(43, 189, 246, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
}
.prose a:hover { color: var(--qr-green-bright); border-color: var(--qr-green-bright); }

.prose strong { color: #eef3f8; font-weight: 700; }
.prose em { color: #d7dee6; }

.prose ul, .prose ol { margin: 0 0 1.25rem; padding-left: 1.4rem; }
.prose li { margin-bottom: 0.5rem; }
.prose ul li::marker { color: var(--qr-green); }
.prose ol li::marker { color: var(--qr-green); font-weight: 700; }

.prose blockquote {
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    border-left: 3px solid var(--qr-green);
    background: var(--qr-green-soft);
    border-radius: 0 10px 10px 0;
    color: #d7dee6;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--qr-border);
    border-radius: 6px;
    padding: 0.12em 0.42em;
    font-size: 0.9em;
    color: #8fe0ff;
}

.prose pre {
    background: #0a0d11;
    border: 1px solid var(--qr-border);
    border-radius: 12px;
    padding: 18px 20px;
    overflow-x: auto;
    margin: 0 0 1.5rem;
}
.prose pre code { background: none; border: 0; padding: 0; color: #c4ccd4; }

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--qr-border);
    margin: 1rem 0;
}

.prose hr { border: 0; border-top: 1px solid var(--qr-border); margin: 2rem 0; }

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}
.prose th, .prose td {
    padding: 10px 14px;
    border: 1px solid var(--qr-border);
    text-align: left;
}
.prose th { background: rgba(255, 255, 255, 0.04); color: #eef3f8; font-weight: 600; }

/* --------------------------------------------------------------- Body actions */
.article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--qr-border);
}

.art-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.art-btn--ghost {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(43, 189, 246, 0.6);
    color: #eaf1f8;
}
.art-btn--ghost:hover {
    color: #ffffff;
    border-color: rgba(43, 189, 246, 0.6);
    background: var(--qr-green-soft);
    transform: translateY(-2px);
}

.art-btn--primary {
    background: linear-gradient(135deg, var(--qr-green) 0%, var(--qr-green-bright) 100%);
    color: #03212e;
    border: none;
}
.art-btn--primary:hover { color: #03212e; filter: brightness(1.05); transform: translateY(-2px); }

/* ------------------------------------------------------------------- Sidebar */
.article-aside {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aside-card {
    background: linear-gradient(180deg, #1b222b 0%, #161c24 100%);
    border: 1px solid var(--qr-border);
    border-radius: 16px;
    padding: 20px 22px;
}

.aside-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}
.aside-title i { color: var(--qr-green); }

/* Information list */
.aside-info { margin: 0; }
.aside-info__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--qr-border);
}
.aside-info__row:last-child { border-bottom: 0; padding-bottom: 0; }
.aside-info__row:first-child { padding-top: 0; }
.aside-info dt { color: #8b939c; font-size: 0.82rem; }
.aside-info dd { margin: 0; color: #eaf6ff; font-size: 0.88rem; font-weight: 600; text-align: right; }

/* Contents (TOC) */
.aside-toc { list-style: none; margin: 0; padding: 0; }
.aside-toc__item a {
    display: block;
    padding: 7px 0;
    color: #9aa3ad;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}
.aside-toc__item a:hover { color: var(--qr-green); padding-left: 4px; }
.aside-toc__item.is-sub a { padding-left: 14px; font-size: 0.85rem; color: #7c848d; }
.aside-toc__item.is-sub a:hover { padding-left: 18px; color: var(--qr-green); }

/* Related */
.aside-related { list-style: none; margin: 0; padding: 0; }
.aside-related li + li { margin-top: 4px; }
.aside-related a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin: 0 -10px;
    border-radius: 8px;
    color: #d7dee6;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.aside-related a:hover { background: var(--qr-green-soft); color: #ffffff; }
.aside-related__dot {
    width: 6px; height: 6px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--qr-green);
    box-shadow: 0 0 6px rgba(43, 189, 246, 0.6);
}

/* ------------------------------------------------------------------ Mobile */
@media (max-width: 991.98px) {
    .article-layout { grid-template-columns: 1fr; }
    .article-aside { position: static; }
    .article-body { padding: 28px 22px; }
}
