/* ── Reset & base ───────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --black:      #0a0a0a;
    --white:      #ffffff;
    --grey-50:    #f8fafc;
    --grey-100:   #f1f5f9;
    --grey-200:   #e2e8f0;
    --grey-300:   #cbd5e1;
    --grey-500:   #64748b;
    --grey-700:   #334155;
    --blue-500:   #3b82f6;
    --blue-700:   #1d4ed8;
    --blue-900:   #1e3a8a;
    --indigo-900: #1e1b4b;
    --teal-700:   #0f766e;
    --green-50:   #f0fdf4;
    --green-100:  #dcfce7;
    --green-400:  #4ade80;
    --green-600:  #16a34a;
    --green-800:  #166534;
    --amber-100:  #fef3c7;
    --amber-400:  #fbbf24;
    --amber-800:  #92400e;

    --grad-hero:    linear-gradient(135deg, var(--indigo-900), #1e40af, var(--teal-700));
    --grad-primary: linear-gradient(135deg, var(--black), #1e40af);
    --grad-logo:    linear-gradient(135deg, var(--black), var(--blue-500));

    --shadow-sm:  0 2px 8px  rgba(0,0,0,.06);
    --shadow-md:  0 4px 20px rgba(0,0,0,.08);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.12);
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  20px;

    --font-body:    'Inter',   sans-serif;
    --font-display: 'Poppins', sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--grey-50);
    color: var(--black);
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ── Reading progress ────────────────────────────────────────────── */
.progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--black), var(--blue-500), #8b5cf6);
    z-index: 9999;
    transition: width .1s linear;
}

/* ── Nav ─────────────────────────────────────────────────────────── */
#navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--grey-200);
}
nav.breadcrumb {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: transparent;
}
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: .875rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--black);
}
.logo-icon {
    width: 40px; height: 40px;
    background: var(--grad-logo);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: .9rem;
    flex-shrink: 0;
}
.nav-actions { display: flex; gap: .75rem; align-items: center; }
.nav-btn {
    padding: .55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .25s;
}
.nav-btn-ghost {
    background: none;
    color: var(--grey-500);
}
.nav-btn-ghost:hover { color: var(--black); background: var(--grey-100); }
.nav-btn-primary {
    background: var(--grad-primary);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.nav-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,.2);
}

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
    background: var(--grad-hero);
    position: relative;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hero-bg::before {
    content: '';
    position: absolute;
    top: -40%; right: -20%;
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-bg::after {
    content: '';
    position: absolute;
    bottom: -30%; left: -10%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 3rem;
    position: relative;
    z-index: 1;
    color: var(--white);
}

/* breadcrumb */
.breadcrumb {
    font-size: .82rem;
    margin-bottom: 1.5rem;
    opacity: .8;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { opacity: .6; }

/* meta pills */
.hero-tags {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.hero-tag {
    padding: .35rem .85rem;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
}

/* hero title, series info, excerpt */
.hero-title {
    margin-bottom: 1.25rem;
}
.hero-title h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -.02em;
}
.series-info {
    font-size: .78rem;
    opacity: .8;
    margin-top: 5px;
}
.series-info a {
    font-size: .78rem;
}
.series-info:hover a {
    text-decoration: .1px underline;
}
.hero-excerpt {
    font-size: 1.075rem;
    opacity: .88;
    line-height: 1.75;
    margin-bottom: 2rem;
    max-width: 700px;
}

/* author + stats row */
.hero-meta {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: .88rem;
    opacity: .9;
}

.hero-author { display: flex; align-items: center; gap: .85rem; }
.hero-avatar {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.05rem;
    border: 2.5px solid rgba(255,255,255,.3);
    flex-shrink: 0;
    overflow: hidden;
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-author-name  { font-weight: 700; font-size: .95rem; }
.hero-author-date  { font-size: .8rem; opacity: .72; margin-top: .15rem; }
.hero-stats        { display: flex; gap: 1.5rem; }
.hero-stat         { display: flex; align-items: center; gap: .4rem; }

/* ── Page layout ─────────────────────────────────────────────────── */
.page-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

/* ── Article body ────────────────────────────────────────────────── */
.article-body {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-md);
    line-height: 1.9;
    font-size: 1.05rem;
    color: #374151;
}
.article-body h2 {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--black);
    margin: 2.5rem 0 1rem;
    letter-spacing: -.02em;
}
.article-body h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--black);
    margin: 2rem 0 .85rem;
}
.article-body h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--black);
    margin: 1.5rem 0 .6rem;
}
.article-body p { margin-bottom: 1.25rem; }
.article-body p:last-child { margin-bottom: 0; }
.article-body a:not(a.btn-primary) { color: var(--blue-500); text-decoration: underline; }
.article-body a:hover { color: var(--blue-700); }
.article-body blockquote {
    border-left: 4px solid var(--blue-500);
    background: #eff6ff;
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 1.75rem 0;
    font-style: italic;
    color: #1e3a8a;
    font-size: 1rem;
}
.article-body ul, .article-body ol {
    margin: 1rem 0 1.25rem 1.5rem;
}
.article-body li { margin-bottom: .6rem; }
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    display: block;
}

/* ── Media players (audio & video content types) ─────────────────────────── */
.media-player {
    margin: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
}

/* Audio player */
.media-player--audio {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-color: #c4b5fd;
}

.media-player__icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 4px 16px rgba(109, 40, 217, .25);
}

.media-player__body {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.media-player__title {
    font-size: 1rem;
    font-weight: 700;
    color: #3b0764;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-player__meta {
    font-size: .85rem;
    color: #6d28d9;
    margin: 0;
}

.media-player__element {
    width: 100%;
    margin-top: .25rem;
    border-radius: var(--radius-sm);
    accent-color: #7c3aed;
}

/* Video player */
.media-player--video .media-player__element {
    display: block;
    width: 100%;
    max-height: 540px;
    background: #000;
    border-radius: 0;
}

@media (max-width: 640px) {
    .media-player--audio {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.25rem;
    }
}

/* ── Article body loading animation ─────────────────────────────── */
.article-body-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .5rem;
    padding: 4rem 2rem;
}

.article-body-loader .abl-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--grey-300);
    animation: ablPulse 1.2s ease-in-out infinite;
}

.article-body-loader { flex-direction: row; gap: .5rem; }

.abl-dot:nth-child(1) { animation-delay: 0s; }
.abl-dot:nth-child(2) { animation-delay: .2s; }
.abl-dot:nth-child(3) { animation-delay: .4s; }

@keyframes ablPulse {
    0%, 80%, 100% { transform: scale(.8); opacity: .4; }
    40%           { transform: scale(1.2); opacity: 1; background: var(--blue-500); }
}

/* ── Gated content panels ────────────────────────────────────────── */
.gate-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--grey-200);
    background: var(--grey-50);
    margin: 1rem 0;
}

.gate-icon {
    font-size: 3rem;
    line-height: 1;
}

.gate-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--black);
    margin: 0;
}

.gate-desc {
    font-size: .95rem;
    color: var(--grey-500);
    max-width: 420px;
    line-height: 1.65;
    margin: 0;
}

.gate-form {
    display: flex;
    gap: .75rem;
    width: 100%;
    max-width: 400px;
    flex-wrap: wrap;
    justify-content: center;
}

.gate-input {
    flex: 1;
    min-width: 0;
    padding: .75rem 1rem;
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: var(--font-body);
    background: var(--white);
    transition: border-color .2s;
    outline: none;
}

.gate-input:focus {
    border-color: var(--black);
}

.gate-action-btn {
    display: inline-flex;
    align-items: center;
    padding: .75rem 1.5rem;
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: none;
    transition: opacity .2s, transform .2s;
}

.gate-action-btn:hover  { opacity: .85; transform: translateY(-1px); }
.gate-action-btn:active { transform: translateY(0); }

.gate-action-btn--gold {
    background: linear-gradient(135deg, #b45309, #d97706);
    box-shadow: 0 4px 14px rgba(180, 83, 9, .3);
}

.gate-action-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.gate-error {
    font-size: .85rem;
    color: #dc2626;
    margin: 0;
    font-weight: 500;
}

/* Protected panel — amber tint */
.gate-panel--protected {
    border-color: #fcd34d;
    background: linear-gradient(135deg, #fffbeb, var(--white));
}

/* Premium panel — gold tint */
.gate-panel--premium {
    border-color: #d97706;
    background: linear-gradient(135deg, #fef3c7, var(--white));
}

/* Gate note */
.gate-note {
    font-size: .85rem;
    color: var(--grey-500);
    max-width: 420px;
    line-height: 1.65;
    margin: 0;
}

/* Error panel */
.gate-panel--error {
    border-color: #fca5a5;
    background: #fff5f5;
}

.gate-panel--error .gate-msg {
    font-size: 1rem;
    color: #7f1d1d;
    font-weight: 500;
    margin: 0;
}

@media (max-width: 520px) {
    .gate-panel { padding: 2rem 1.25rem; }
    .gate-form  { flex-direction: column; align-items: stretch; }
    .gate-input,
    .gate-action-btn { width: 100%; justify-content: center; }
}

/* call-out boxes */
.highlight-box {
    background: linear-gradient(135deg, var(--green-50), var(--green-100));
    border: 2px solid var(--green-400);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 2rem 0;
}
.highlight-box h4 { color: var(--green-800); margin: 0 0 .5rem; }
.highlight-box p  { color: #15803d; margin: 0; }
.info-box {
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 2rem 0;
}
.info-box h4 { color: var(--blue-700); margin: 0 0 .5rem; }
.info-box p  { color: #1e40af; margin: 0; font-size: .95rem; }

/* stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}
.stat-box {
    background: var(--grey-50);
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
}
.stat-num   { font-size: 1.75rem; font-weight: 800; color: var(--black); display: block; }
.stat-label { font-size: .8rem; color: var(--grey-500); margin-top: .3rem; }

/* ── Article footer ──────────────────────────────────────────────── */
.article-footer {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--grey-100);
}
.article-tags {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}
.art-tag {
    padding: .4rem .9rem;
    background: var(--grey-100);
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--grey-700);
    transition: all .25s;
}
.art-tag:hover { background: var(--black); color: var(--white); }

/* author card */
.author-card {
    background: linear-gradient(135deg, var(--grey-50), var(--white));
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.author-card-avatar {
    width: 68px; height: 68px;
    background: linear-gradient(135deg, var(--blue-500), #8b5cf6);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.author-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card-body h4 { font-size: 1.075rem; font-weight: 700; margin-bottom: .3rem; }
.author-card-body p  { font-size: .875rem; color: var(--grey-500); line-height: 1.55; }
.author-card-btn {
    display: inline-block;
    margin-top: .85rem;
    padding: .5rem 1.1rem;
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    font-family: var(--font-body);
}
.author-card-btn:hover { background: var(--blue-700); }

/* ── Reactions bar ───────────────────────────────────────────────── */
.reactions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.5rem;
    box-shadow: var(--shadow-md);
    margin: 1.5rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}
.reactions-left { display: flex; gap: .5rem; flex-wrap: wrap; }
.react-btn {
    padding: .5rem .95rem;
    border: 2px solid var(--grey-200);
    border-radius: 20px;
    background: var(--white);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--grey-700);
}
.react-btn:hover  { border-color: var(--grey-700); background: var(--grey-50); }
.react-btn.active { border-color: var(--black); background: var(--black); color: var(--white); }
.react-btn.active .react-count { color: rgba(255,255,255,.75); }
.react-count { font-size: .8rem; color: var(--grey-500); }
.bookmark-btn {
    padding: .5rem 1.1rem;
    border: 2px solid var(--grey-200);
    border-radius: 20px;
    background: var(--white);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    font-family: var(--font-body);
    color: var(--grey-700);
    display: flex;
    align-items: center;
    gap: .4rem;
}
.bookmark-btn:hover, .bookmark-btn.saved {
    border-color: var(--blue-500);
    background: #eff6ff;
    color: var(--blue-700);
}

/* ── Comments ────────────────────────────────────────────────────── */
.comments-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-md);
    margin-top: 1.5rem;
}
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--grey-100);
}
.comments-header h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}
.comment-count { color: var(--grey-500); font-weight: 500; }
.comment-sort {
    padding: .45rem .9rem;
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--white);
    color: var(--grey-700);
    transition: border-color .2s;
}
.comment-sort:focus { outline: none; border-color: var(--black); }

/* comment input */
.comment-input-card {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--grey-50);
    border-radius: var(--radius-md);
    border: 2px solid var(--grey-200);
}
.current-user-avatar {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--blue-500), #8b5cf6);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: .95rem;
    flex-shrink: 0;
}
.comment-input-wrapper { flex: 1; }
.comment-input-wrapper textarea {
    width: 100%;
    padding: .875rem 1rem;
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .92rem;
    resize: vertical;
    min-height: 95px;
    background: var(--white);
    color: var(--black);
    transition: border-color .2s;
}
.comment-input-wrapper textarea:focus { outline: none; border-color: var(--black); }
.comment-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .65rem;
}
.input-tools { display: flex; gap: .4rem; }
.tool-btn {
    width: 30px; height: 30px;
    border: 2px solid var(--grey-200);
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: .82rem;
    transition: all .2s;
    font-family: var(--font-body);
    display: flex; align-items: center; justify-content: center;
}
.tool-btn:hover { border-color: var(--black); background: var(--grey-50); }
.comment-submit {
    padding: .55rem 1.3rem;
    background: var(--grad-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    transition: all .25s;
}
.comment-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.comment-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* sign-in prompt */
.comment-signin-prompt {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--grey-50);
    border: 2px dashed var(--grey-300);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: .9rem;
    color: var(--grey-500);
}
.comment-signin-prompt a {
    color: var(--blue-500);
    font-weight: 600;
    text-decoration: underline;
}
.comment-signin-prompt a:hover { color: var(--blue-700); }

/* comment list */
.comments-list { margin-bottom: 1.5rem; }
.comment {
    display: flex;
    gap: 1rem;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--grey-100);
}
.comment:last-child { border-bottom: none; }
.comment-avatar {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--blue-500), #8b5cf6);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    font-size: .9rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.comment-content { flex: 1; }
.comment-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .45rem;
}
.comment-author { font-size: .92rem; font-weight: 700; margin: 0; }
.comment-date   { font-size: .78rem; color: #9ca3af; }
.comment-text   { font-size: .9rem; color: #4b5563; line-height: 1.65; margin-bottom: .65rem; }
.comment-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.action-btn {
    padding: .35rem .7rem;
    border: none;
    background: var(--grey-100);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.action-btn:hover { background: var(--grey-200); color: var(--black); }
.action-btn.liked { background: #fef2f2; color: #dc2626; }
.comment-replies { margin-top: 1rem; padding-left: 1.5rem; }

.load-more-btn {
    width: 100%;
    padding: .9rem;
    background: var(--grey-50);
    border: 2px solid var(--grey-200);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: all .25s;
    color: var(--grey-700);
}
.load-more-btn:hover { background: var(--grey-100); border-color: var(--grey-300); }

/* ── Series navigation ─────────────────────────────────────────────────────── */
.series-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}
.series-nav {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: var(--white);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.series-nav:hover {
    transform: translateY(-2px);
    border-color: var(--grey-300);
    box-shadow: var(--shadow-sm);
}
.series-nav.previous {
    justify-content: flex-start;
}
.series-nav.next {
    justify-content: flex-end;
}
.series-nav i {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--grey-100);
    color: var(--primary);
    flex-shrink: 0;
}
.series-nav.next i {
    order: 2;
}
.series-nav.next div {
    text-align: right;
}
.series-nav div {
    max-width: calc(100% - 3rem);
}
.series-nav h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-top: .25rem;
    color: var(--black);
}
.nav-label {
    display: block;
    font-size: .8rem;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: .02em;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.side-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}
.side-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--grey-100);
}

/* share */
.share-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.share-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--grey-200);
    background: var(--white);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 1.05rem;
    transition: all .25s;
}
.share-btn:hover { border-color: var(--black); background: var(--black); color: var(--white); }

/* TOC */
#tocCard > ul { list-style: none; }
#tocCard > ul li { margin-bottom: .35rem; }
#tocCard > ul a {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem .6rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    color: var(--grey-700);
    transition: all .2s;
}
#tocCard > ul a:hover, #tocCard > ul a.active {
    background: var(--grey-100);
    color: var(--black);
}
.toc-num {
    font-size: .75rem;
    font-weight: 700;
    color: var(--blue-500);
    min-width: 24px;
    flex-shrink: 0;
}
.toc-sub { padding-left: 1.1rem; }

/* related */
.related-card {
    display: flex;
    gap: .85rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--grey-100);
    cursor: pointer;
    transition: transform .2s;
}
.related-card:last-child { border-bottom: none; }
.related-card:hover { transform: translateX(3px); }
.related-thumb {
    width: 68px; height: 68px;
    background: linear-gradient(135deg, var(--grey-200), var(--grey-300));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.related-info h4 {
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: .3rem;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-info span { font-size: .78rem; color: #9ca3af; }

/* newsletter */
.newsletter-box {
    background: var(--grad-primary);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    color: var(--white);
}
.newsletter-box h3 {
    color: var(--white);
    border-bottom-color: rgba(255,255,255,.2);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
}
.newsletter-box p   { font-size: .85rem; opacity: .85; margin-bottom: 1rem; }
.newsletter-input {
    width: 100%;
    padding: .65rem .8rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .875rem;
    margin-bottom: .55rem;
    background: rgba(255,255,255,.95);
    color: var(--black);
}
.newsletter-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}
.newsletter-btn {
    width: 100%;
    padding: .65rem;
    background: var(--white);
    color: var(--black);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .875rem;
    cursor: pointer;
    transition: background .2s;
}
.newsletter-btn:hover { background: var(--grey-100); }

/* ── Back to top ─────────────────────────────────────────────────── */
.back-top {
    position: fixed;
    bottom: 2rem; right: 2rem;
    width: 46px; height: 46px;
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all .25s;
    z-index: 200;
}
.back-top.visible { display: flex; }
.back-top:hover   { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.25); }

/* ── Toast ───────────────────────────────────────────────────────── */
#lcs-toast {
    position: fixed;
    bottom: 2rem; left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1a1a1a;
    color: var(--white);
    padding: .85rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: .88rem;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    white-space: nowrap;
    pointer-events: none;
}
#lcs-toast.show { transform: translateX(-50%) translateY(0); }

.code-block:not(.code-block > code) {
    background: linear-gradient(180deg, #1e1e2f 0%, #181825 100%);
    color: #f8f8f2;
    padding: 2em;
    font-family: "Fira Code", "Consolas", "Courier New", monospace;
    font-size: 0.95em;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    display: block;
    margin: 1rem 0;
    position: relative;
    border-radius: 0.35rem;
}
.code-block .copy-code {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: #f8f8f2;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.code-block .copy-code:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}
.code-block .copy-code:active {
    transform: translateY(0);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .page-layout { grid-template-columns: 1fr; }
    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}
@media (max-width: 680px) {
    .article-body       { padding: 1.75rem 1.25rem; }
    .hero-content       { padding: 2.5rem 1.25rem 2rem; }
    .stats-grid         { grid-template-columns: 1fr 1fr; }
    .sidebar            { grid-template-columns: 1fr; }
    .nav-actions .nav-btn-ghost { display: none; }
    .page-layout        { padding: 1.5rem 1rem 3rem; }
}