/* ============================================
   Article Page — Premium Typography
   ============================================ */
.article {
    max-width: var(--content-max-width);
}

.article-header {
    margin-bottom: 40px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    margin-bottom: 16px;
    letter-spacing: 0.01em;
}

.breadcrumb a {
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--ease-in-out);
}

.breadcrumb a:hover {
    color: var(--color-text);
    text-decoration: none;
}

.breadcrumb .separator {
    color: var(--color-text-tertiary);
    font-size: 0.75rem;
}

.article-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--color-text);
}

/* Article Content — Block Styles */
.article-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    letter-spacing: -0.003em;
}

.article-content > * {
    margin-bottom: 24px;
}

.article-content > *:last-child {
    margin-bottom: 0;
}

/* ============================================
   Paragraph
   ============================================ */
.block-paragraph {
    color: var(--color-text);
}

/* Alignment */
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }

/* Inline formatting */
.article-content code:not(.hljs) {
    padding: 0.15em 0.4em;
    background: var(--color-inline-code-bg);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.85em;
    font-weight: 450;
    color: var(--color-inline-code-text);
    border: 1px solid var(--color-inline-code-border);
}
pre code,
.api-body-code code {
    padding: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    border: none !important;
}

.article-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--color-primary-subtle);
    transition: text-decoration-color var(--duration-fast) var(--ease-in-out);
}

.article-content a:hover {
    text-decoration-color: var(--color-primary);
}

/* Inline formatting: bold, italic, mark */
.article-content strong {
    font-weight: 600;
    color: var(--color-text);
}

.article-content mark {
    background: var(--color-mark);
    padding: 0.05em 0.15em;
    border-radius: 2px;
}

/* ============================================
   Headings — Tight tracking, clear hierarchy
   ============================================ */
.block-heading {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-text);
    scroll-margin-top: 80px;
    line-height: 1.25;
}

h1.block-heading { font-size: 2rem; margin-top: 48px; }
h2.block-heading { font-size: 1.5rem; margin-top: 40px; }
h3.block-heading { font-size: 1.25rem; margin-top: 32px; }
h4.block-heading { font-size: 1.125rem; margin-top: 28px; }
h5.block-heading { font-size: 1rem; margin-top: 24px; }
h6.block-heading { font-size: 0.875rem; margin-top: 24px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-secondary); }

/* First heading after header shouldn't have extra top margin */
.article-content > .block-heading:first-child {
    margin-top: 0;
}

/* Anchor link beside each heading. Hidden by default; appears on
   hover of the heading. Click copies the absolute URL to clipboard
   (handled by static/js/anchor.js). */
.block-heading-anchor {
    margin-left: 0.5rem;
    color: hsl(var(--muted-foreground));
    font-weight: 400;
    text-decoration: none;
    opacity: 0;
    transition: opacity 150ms ease, color 150ms ease;
    user-select: none;
}
.block-heading:hover .block-heading-anchor,
.block-heading-anchor:focus-visible,
.block-heading-anchor.is-copied {
    opacity: 1;
}
.block-heading-anchor:hover {
    color: hsl(var(--foreground));
}
.block-heading-anchor.is-copied::after {
    content: " copied";
    color: hsl(142 70% 60%);
    font-size: 0.75em;
    margin-left: 0.25rem;
}

/* ============================================
   Quote — 6 styles × 6 colors
   ============================================ */
.block-quote {
    position: relative;
}

.block-quote p {
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 0;
    font-size: 1.125rem;
    line-height: 1.7;
}

.block-quote cite {
    display: block;
    font-size: 0.8125rem;
    font-style: normal;
    font-weight: 500;
    margin-top: 12px;
    letter-spacing: 0.01em;
}

/* Style: classic */
.quote-style-classic {
    border-left: 3px solid var(--color-border);
    padding: 8px 0 8px 20px;
}

/* Style: modern */
.quote-style-modern {
    border-radius: var(--radius-xl);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.quote-style-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0 2px 2px 0;
}

.quote-style-modern p {
    font-style: normal;
    font-weight: 500;
    padding-left: 16px;
}

.quote-style-modern cite {
    padding-left: 16px;
}

/* Style: elegant */
.quote-style-elegant {
    padding: 32px 40px;
}

.quote-style-elegant p {
    font-size: 1.25rem;
    padding-top: 24px;
    padding-left: 16px;
    line-height: 1.65;
}

.quote-style-elegant .quote-mark {
    position: absolute;
    font-size: 5rem;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1;
    user-select: none;
    opacity: 0.6;
}

.quote-style-elegant .quote-open { top: 0; left: 0; }
.quote-style-elegant .quote-close { bottom: 0; right: 16px; transform: rotate(180deg); }
.quote-style-elegant cite { padding-left: 16px; }

/* Style: bold */
.quote-style-bold {
    border-radius: var(--radius-lg);
    padding: 24px;
    color: white;
    box-shadow: var(--shadow-md);
}

.quote-style-bold p {
    font-style: normal;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    line-height: 1.5;
}

.quote-style-bold cite {
    color: rgba(255,255,255,0.75);
}

/* Style: minimal */
.quote-style-minimal {
    padding: 16px 0;
}

.quote-style-minimal p {
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 16px;
}

/* Style: speech */
.quote-style-speech { padding: 0; }
.quote-style-speech .speech-bubble { border-radius: var(--radius-xl); padding: 20px; position: relative; }
.quote-style-speech .speech-bubble p { font-style: normal; }
.quote-style-speech .speech-tail { position: absolute; bottom: -12px; left: 32px; width: 24px; height: 24px; transform: rotate(45deg); }
.quote-style-speech .speech-author { margin-top: 16px; margin-left: 16px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.01em; }

/* Color: neutral */
.quote-color-neutral cite { color: var(--color-text-secondary); }
.quote-style-classic.quote-color-neutral { border-left-color: var(--color-text-tertiary); }
.quote-style-modern.quote-color-neutral { background: var(--color-surface); }
.quote-style-modern.quote-color-neutral::before { background: var(--color-text-secondary); }
.quote-style-elegant.quote-color-neutral .quote-mark { color: var(--color-border); }
.quote-style-bold.quote-color-neutral { background: var(--color-text); }
.quote-style-minimal.quote-color-neutral p { border-bottom-color: var(--color-text-tertiary); }
.quote-style-speech.quote-color-neutral .speech-bubble { background: var(--color-surface); }
.quote-style-speech.quote-color-neutral .speech-tail { background: var(--color-surface); }
.quote-style-speech.quote-color-neutral .speech-author { color: var(--color-text-secondary); }

/* Color: blue */
.quote-color-blue cite { color: #2563eb; }
.quote-style-classic.quote-color-blue { border-left-color: #3b82f6; }
.quote-style-modern.quote-color-blue { background: #eff6ff; }
.quote-style-modern.quote-color-blue::before { background: #2563eb; }
.quote-style-elegant.quote-color-blue .quote-mark { color: #bfdbfe; }
.quote-style-bold.quote-color-blue { background: #2563eb; }
.quote-style-minimal.quote-color-blue p { border-bottom-color: #3b82f6; }
.quote-style-speech.quote-color-blue .speech-bubble { background: #eff6ff; }
.quote-style-speech.quote-color-blue .speech-tail { background: #eff6ff; }
.quote-style-speech.quote-color-blue .speech-author { color: #2563eb; }

/* Color: green */
.quote-color-green cite { color: #059669; }
.quote-style-classic.quote-color-green { border-left-color: #10b981; }
.quote-style-modern.quote-color-green { background: #ecfdf5; }
.quote-style-modern.quote-color-green::before { background: #059669; }
.quote-style-elegant.quote-color-green .quote-mark { color: #a7f3d0; }
.quote-style-bold.quote-color-green { background: #059669; }
.quote-style-minimal.quote-color-green p { border-bottom-color: #10b981; }
.quote-style-speech.quote-color-green .speech-bubble { background: #ecfdf5; }
.quote-style-speech.quote-color-green .speech-tail { background: #ecfdf5; }
.quote-style-speech.quote-color-green .speech-author { color: #059669; }

/* Color: purple */
.quote-color-purple cite { color: #9333ea; }
.quote-style-classic.quote-color-purple { border-left-color: #a855f7; }
.quote-style-modern.quote-color-purple { background: #faf5ff; }
.quote-style-modern.quote-color-purple::before { background: #9333ea; }
.quote-style-elegant.quote-color-purple .quote-mark { color: #e9d5ff; }
.quote-style-bold.quote-color-purple { background: #9333ea; }
.quote-style-minimal.quote-color-purple p { border-bottom-color: #a855f7; }
.quote-style-speech.quote-color-purple .speech-bubble { background: #faf5ff; }
.quote-style-speech.quote-color-purple .speech-tail { background: #faf5ff; }
.quote-style-speech.quote-color-purple .speech-author { color: #9333ea; }

/* Color: orange */
.quote-color-orange cite { color: #ea580c; }
.quote-style-classic.quote-color-orange { border-left-color: #f97316; }
.quote-style-modern.quote-color-orange { background: #fff7ed; }
.quote-style-modern.quote-color-orange::before { background: #ea580c; }
.quote-style-elegant.quote-color-orange .quote-mark { color: #fed7aa; }
.quote-style-bold.quote-color-orange { background: #ea580c; }
.quote-style-minimal.quote-color-orange p { border-bottom-color: #f97316; }
.quote-style-speech.quote-color-orange .speech-bubble { background: #fff7ed; }
.quote-style-speech.quote-color-orange .speech-tail { background: #fff7ed; }
.quote-style-speech.quote-color-orange .speech-author { color: #ea580c; }

/* Color: rose */
.quote-color-rose cite { color: #e11d48; }
.quote-style-classic.quote-color-rose { border-left-color: #f43f5e; }
.quote-style-modern.quote-color-rose { background: #fff1f2; }
.quote-style-modern.quote-color-rose::before { background: #e11d48; }
.quote-style-elegant.quote-color-rose .quote-mark { color: #fecdd3; }
.quote-style-bold.quote-color-rose { background: #e11d48; }
.quote-style-minimal.quote-color-rose p { border-bottom-color: #f43f5e; }
.quote-style-speech.quote-color-rose .speech-bubble { background: #fff1f2; }
.quote-style-speech.quote-color-rose .speech-tail { background: #fff1f2; }
.quote-style-speech.quote-color-rose .speech-author { color: #e11d48; }

/* Dark mode adjustments for quote backgrounds */
[data-theme="dark"] .quote-style-modern.quote-color-blue { background: rgba(37, 99, 235, 0.1); }
[data-theme="dark"] .quote-style-modern.quote-color-green { background: rgba(5, 150, 105, 0.1); }
[data-theme="dark"] .quote-style-modern.quote-color-purple { background: rgba(147, 51, 234, 0.1); }
[data-theme="dark"] .quote-style-modern.quote-color-orange { background: rgba(234, 88, 12, 0.1); }
[data-theme="dark"] .quote-style-modern.quote-color-rose { background: rgba(225, 29, 72, 0.1); }
[data-theme="dark"] .quote-style-speech.quote-color-blue .speech-bubble,
[data-theme="dark"] .quote-style-speech.quote-color-blue .speech-tail { background: rgba(37, 99, 235, 0.1); }
[data-theme="dark"] .quote-style-speech.quote-color-green .speech-bubble,
[data-theme="dark"] .quote-style-speech.quote-color-green .speech-tail { background: rgba(5, 150, 105, 0.1); }
[data-theme="dark"] .quote-style-speech.quote-color-purple .speech-bubble,
[data-theme="dark"] .quote-style-speech.quote-color-purple .speech-tail { background: rgba(147, 51, 234, 0.1); }
[data-theme="dark"] .quote-style-speech.quote-color-orange .speech-bubble,
[data-theme="dark"] .quote-style-speech.quote-color-orange .speech-tail { background: rgba(234, 88, 12, 0.1); }
[data-theme="dark"] .quote-style-speech.quote-color-rose .speech-bubble,
[data-theme="dark"] .quote-style-speech.quote-color-rose .speech-tail { background: rgba(225, 29, 72, 0.1); }
[data-theme="dark"] .quote-style-elegant.quote-color-blue .quote-mark { color: rgba(59, 130, 246, 0.3); }
[data-theme="dark"] .quote-style-elegant.quote-color-green .quote-mark { color: rgba(16, 185, 129, 0.3); }
[data-theme="dark"] .quote-style-elegant.quote-color-purple .quote-mark { color: rgba(168, 85, 247, 0.3); }
[data-theme="dark"] .quote-style-elegant.quote-color-orange .quote-mark { color: rgba(249, 115, 22, 0.3); }
[data-theme="dark"] .quote-style-elegant.quote-color-rose .quote-mark { color: rgba(244, 63, 94, 0.3); }

/* Backwards compatibility */
.quote-style-line { border-left: 3px solid var(--color-border); padding: 8px 0 8px 20px; }
.quote-style-card {
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
}
.quote-style-card p { font-style: normal; }
.quote-style-card.quote-color-neutral { background: var(--color-surface); border-color: var(--color-border); }
.quote-style-card.quote-color-blue { background: #eff6ff; border-color: #bfdbfe; }
.quote-style-card.quote-color-green { background: #ecfdf5; border-color: #a7f3d0; }
.quote-style-card.quote-color-purple { background: #faf5ff; border-color: #e9d5ff; }
.quote-style-card.quote-color-orange { background: #fff7ed; border-color: #fed7aa; }
.quote-style-card.quote-color-rose { background: #fff1f2; border-color: #fecdd3; }
.quote-style-quotes { padding: 32px 40px; }
.quote-style-boxed { border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--color-border); }

[data-theme="dark"] .quote-style-card.quote-color-blue { background: rgba(37, 99, 235, 0.08); border-color: rgba(59, 130, 246, 0.2); }
[data-theme="dark"] .quote-style-card.quote-color-green { background: rgba(5, 150, 105, 0.08); border-color: rgba(16, 185, 129, 0.2); }
[data-theme="dark"] .quote-style-card.quote-color-purple { background: rgba(147, 51, 234, 0.08); border-color: rgba(168, 85, 247, 0.2); }
[data-theme="dark"] .quote-style-card.quote-color-orange { background: rgba(234, 88, 12, 0.08); border-color: rgba(249, 115, 22, 0.2); }
[data-theme="dark"] .quote-style-card.quote-color-rose { background: rgba(225, 29, 72, 0.08); border-color: rgba(244, 63, 94, 0.2); }

/* ============================================
   Code Block
   ============================================ */
.block-code {
    background-color: var(--color-code-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-code-border);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background-color: var(--color-code-header);
    border-bottom: 1px solid var(--color-code-border);
}

.code-header-left { display: flex; align-items: center; gap: 12px; }
.code-filename { font-size: 12px; font-weight: 500; color: var(--color-code-filename); letter-spacing: 0.01em; }
.code-language { font-size: 11px; color: var(--color-code-lang); text-transform: uppercase; letter-spacing: 0.04em; }

.code-copy {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--color-code-copy);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-in-out);
}

.code-copy:hover {
    color: var(--color-code-copy-hover);
    background: rgba(255, 255, 255, 0.08);
}

.code-body { display: flex; overflow-x: auto; }

.code-line-numbers {
    flex-shrink: 0;
    padding: 16px;
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--color-code-border);
}

.code-line-numbers div {
    font-size: 12px;
    line-height: 20px;
    color: var(--color-code-line-num);
    font-family: var(--font-mono);
}

.code-content {
    flex: 1;
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    background: transparent;
}

.code-content code {
    font-size: 13px;
    line-height: 20px;
    color: var(--color-code-text);
    font-family: var(--font-mono);
    white-space: pre;
    background: transparent;
    -webkit-font-smoothing: auto;
}

.code-line-numbers + .code-content { padding-left: 16px; }

/* ============================================
   Image
   ============================================ */
.block-image { margin: 28px 0; }
.block-image img { width: 100%; height: auto; border-radius: var(--radius); transition: box-shadow var(--duration) var(--ease-in-out); }
.block-image figcaption { margin-top: 10px; font-size: 0.8125rem; color: var(--color-text-secondary); text-align: center; line-height: 1.5; }

.image-float-none { clear: both; }
.image-float-none img { width: 100%; }
.image-float-left { float: left; margin-right: 24px; margin-bottom: 16px; margin-top: 4px; }
.image-float-right { float: right; margin-left: 24px; margin-bottom: 16px; margin-top: 4px; }
.image-width-small { width: 33.333%; }
.image-width-medium { width: 50%; }
.image-width-large { width: 66.666%; }
.image-width-full { width: 100%; }

.article-content::after { content: ""; display: table; clear: both; }

.block-code, .block-callout, .block-toggle, .block-divider,
.block-columns, .block-media-text, .block-table-wrapper, .block-tabs, .block-steps { clear: both; }

/* ============================================
   Video
   ============================================ */
.block-video { margin: 32px 0; clear: both; }
.video-wrapper { position: relative; padding-bottom: 56.25%; border-radius: var(--radius-md); overflow: hidden; background: #000; box-shadow: var(--shadow-sm); }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.video-caption { margin-top: 12px; font-size: 0.8125rem; color: var(--color-text-secondary); text-align: center; }

/* ============================================
   Callout — Refined border + background
   ============================================ */
.block-callout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left-width: 3px;
    border-left-style: solid;
}

.callout-icon { flex-shrink: 0; margin-top: 1px; }
.callout-icon svg { width: 18px; height: 18px; }
.callout-body { flex: 1; min-width: 0; }
.callout-title { font-weight: 600; font-size: 0.9375rem; margin-bottom: 3px; color: var(--color-text); letter-spacing: -0.005em; }
.callout-content { font-size: 0.9375rem; line-height: 1.6; color: var(--color-text-secondary); }
.callout-content code:not(.hljs) { padding: 0.1em 0.35em; background: rgba(0, 0, 0, 0.05); border-radius: 3px; font-family: var(--font-mono); font-size: 0.85em; }

[data-theme="dark"] .callout-content code:not(.hljs) { background: rgba(255, 255, 255, 0.08); }

.callout-note { background-color: var(--color-surface); border-left-color: var(--color-text-tertiary); }
.callout-note .callout-icon { color: var(--color-text-secondary); }

.callout-tip { background-color: rgba(5, 150, 105, 0.06); border-left-color: #10b981; }
.callout-tip .callout-icon { color: var(--color-success); }

.callout-warning { background-color: rgba(217, 119, 6, 0.06); border-left-color: #f59e0b; }
.callout-warning .callout-icon { color: var(--color-warning); }

.callout-danger { background-color: rgba(220, 38, 38, 0.06); border-left-color: #ef4444; }
.callout-danger .callout-icon { color: var(--color-danger); }

.callout-info { background-color: rgba(37, 99, 235, 0.06); border-left-color: #3b82f6; }
.callout-info .callout-icon { color: var(--color-info); }

.callout-error { background-color: rgba(220, 38, 38, 0.06); border-left-color: #ef4444; }
.callout-error .callout-icon { color: var(--color-danger); }

/* ============================================
   List — Clean bullets and numbers
   ============================================ */
.block-list { padding-left: 24px; }
.block-list li { margin-bottom: 6px; padding-left: 4px; }
.block-list li::marker { color: var(--color-text-tertiary); }
.list-numbered { list-style-type: decimal; }
.list-bullet { list-style-type: disc; }

.list-todo { padding-left: 0; }
.todo-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; cursor: pointer; padding: 2px 0; transition: opacity var(--duration-fast) var(--ease-in-out); }
.todo-item input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; cursor: pointer; accent-color: var(--color-primary); border-radius: 3px; }
.todo-item.checked span { text-decoration: line-through; color: var(--color-text-tertiary); }

/* ============================================
   Toggle — Smooth expand/collapse
   ============================================ */
.block-toggle {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.block-toggle summary {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    list-style: none;
    transition: background var(--duration-fast) var(--ease-in-out);
    padding: 12px 16px;
    background-color: var(--color-surface);
}

.block-toggle summary:hover { opacity: 0.85; }
.block-toggle summary::-webkit-details-marker { display: none; }
.block-toggle summary::marker { display: none; content: ''; }

.block-toggle summary span:last-child { font-weight: 500; color: var(--color-text); font-size: 0.9375rem; }

.toggle-icon { flex-shrink: 0; transition: transform var(--duration) var(--ease-out); }
.toggle-icon-dot { width: 8px; height: 8px; border-radius: 50%; transition: transform var(--duration) var(--ease-out); }

.block-toggle[open] .toggle-icon-dot { transform: scale(1.5); }
.block-toggle[open] .toggle-icon-chevron { transform: rotate(90deg); }
.block-toggle[open] .toggle-icon-plus { transform: rotate(45deg); }
.block-toggle[open] .toggle-icon-arrow { transform: rotate(180deg); }

.toggle-content {
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    line-height: 1.65;
}

/* Style: minimal */
.toggle-style-minimal { border: none; border-left: 2px solid var(--color-border); border-radius: 0; }
.toggle-style-minimal summary { background: transparent; padding: 8px 0 8px 16px; }
.toggle-style-minimal .toggle-content { padding: 8px 0 8px 24px; border-top: none; }

/* Style: card */
.toggle-style-card { border: 1px solid var(--color-border); box-shadow: var(--shadow-xs); transition: box-shadow var(--duration) var(--ease-in-out); }
.toggle-style-card:hover { box-shadow: var(--shadow-sm); }
.toggle-style-card summary { background: transparent; padding: 12px 16px; }
.toggle-style-card .toggle-content { padding: 12px 16px; background: var(--color-surface); border-top: none; }

/* Style: gradient */
.toggle-style-gradient { border: none; border-radius: var(--radius); overflow: hidden; }
.toggle-style-gradient summary { background: transparent; padding: 12px 16px; }
.toggle-style-gradient .toggle-content { background: var(--color-surface-raised); margin: 0 8px 8px 8px; padding: 12px 16px; border-radius: var(--radius); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border-top: none; }

/* Icon colors */
.toggle-color-neutral .toggle-icon { color: var(--color-text-tertiary); }
.toggle-color-neutral .toggle-icon-dot { background: var(--color-text-tertiary); }
.toggle-color-blue .toggle-icon { color: #3b82f6; }
.toggle-color-blue .toggle-icon-dot { background: #3b82f6; }
.toggle-color-green .toggle-icon { color: #10b981; }
.toggle-color-green .toggle-icon-dot { background: #10b981; }
.toggle-color-purple .toggle-icon { color: #a855f7; }
.toggle-color-purple .toggle-icon-dot { background: #a855f7; }
.toggle-color-orange .toggle-icon { color: #f97316; }
.toggle-color-orange .toggle-icon-dot { background: #f97316; }

/* Minimal border colors */
.toggle-style-minimal.toggle-color-neutral { border-left-color: var(--color-border); }
.toggle-style-minimal.toggle-color-blue { border-left-color: #3b82f6; }
.toggle-style-minimal.toggle-color-green { border-left-color: #10b981; }
.toggle-style-minimal.toggle-color-purple { border-left-color: #a855f7; }
.toggle-style-minimal.toggle-color-orange { border-left-color: #f97316; }

/* Gradient backgrounds */
.toggle-style-gradient.toggle-color-neutral { background: linear-gradient(to right, var(--color-surface), var(--color-surface-inset)); }
.toggle-style-gradient.toggle-color-blue { background: linear-gradient(to right, rgba(37, 99, 235, 0.06), rgba(99, 102, 241, 0.06)); }
.toggle-style-gradient.toggle-color-green { background: linear-gradient(to right, rgba(5, 150, 105, 0.06), rgba(20, 184, 166, 0.06)); }
.toggle-style-gradient.toggle-color-purple { background: linear-gradient(to right, rgba(147, 51, 234, 0.06), rgba(236, 72, 153, 0.06)); }
.toggle-style-gradient.toggle-color-orange { background: linear-gradient(to right, rgba(234, 88, 12, 0.06), rgba(245, 158, 11, 0.06)); }

/* ============================================
   Divider
   ============================================ */
.block-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 40px 0;
}

/* ============================================
   Steps — 5 styles
   ============================================ */
.block-steps { margin: 24px 0; }
.steps-list { list-style: none; padding: 0; margin: 0; }
.step { display: flex; gap: 16px; }
.step-marker { flex-shrink: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 0.8125rem; font-weight: 600; }
.step-marker svg { width: 14px; height: 14px; }
.step-content { flex: 1; padding-bottom: 20px; }
.step:last-child .step-content { padding-bottom: 0; }
.step-title { font-weight: 600; font-size: 0.9375rem; margin-bottom: 4px; color: var(--color-text); letter-spacing: -0.005em; }
.step-text { font-size: 0.875rem; color: var(--color-text-secondary); line-height: 1.65; }

.steps-style-numbered .step-marker { background: var(--color-text); color: var(--color-bg); border-radius: 50%; font-size: 0.75rem; }
.steps-style-checkmarks .step-marker { background: var(--color-success); color: white; border-radius: 50%; }
.steps-style-minimal .step-marker { background: transparent; color: var(--color-text-tertiary); font-size: 0.9375rem; }
.steps-style-minimal .step-content { border-bottom: 1px solid var(--color-border-subtle); }
.steps-style-minimal .step:last-child .step-content { border-bottom: none; }

.steps-style-timeline .step { position: relative; padding-left: 8px; }
.steps-style-timeline .step::before { content: ''; position: absolute; left: 14px; top: 28px; bottom: 0; width: 2px; background: var(--color-border); }
.steps-style-timeline .step:last-child::before { display: none; }
.steps-style-timeline .step-marker { background: var(--color-bg); border: 2px solid var(--color-text); color: var(--color-text); border-radius: 50%; z-index: 1; font-size: 0.75rem; }

.steps-style-cards .step { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
.steps-style-cards .step:last-child { margin-bottom: 0; }
.steps-style-cards .step-marker { background: var(--color-text); color: var(--color-bg); border-radius: var(--radius); font-size: 0.75rem; }
.steps-style-cards .step-content { padding-bottom: 0; }

/* ============================================
   Table — 5 styles × 5 header colors
   ============================================ */
.block-table-wrapper { overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
.block-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; line-height: 1.5; }
.block-table th, .block-table td { padding: 10px 16px; border: 1px solid var(--color-border); }
.block-table th { font-weight: 600; font-size: 0.8125rem; letter-spacing: 0.01em; }
.block-table td { color: var(--color-text-secondary); }
/* Cell content goes through markdown, which wraps every block in <p>.
   Strip the first/last <p>'s vertical margins so single-paragraph
   cells sit flush against the cell padding instead of stacking
   visible whitespace at top/bottom. */
.block-table th > p:first-child,
.block-table td > p:first-child { margin-top: 0; }
.block-table th > p:last-child,
.block-table td > p:last-child { margin-bottom: 0; }

.table-align-left th, .table-align-left td { text-align: left; }
.table-align-center th, .table-align-center td { text-align: center; }
.table-align-right th, .table-align-right td { text-align: right; }

.table-header-neutral { background-color: var(--color-surface-inset); color: var(--color-text-secondary); }
.table-header-blue { background-color: rgba(37, 99, 235, 0.08); color: #1e40af; }
.table-header-green { background-color: rgba(5, 150, 105, 0.08); color: #065f46; }
.table-header-purple { background-color: rgba(147, 51, 234, 0.08); color: #6b21a8; }
.table-header-orange { background-color: rgba(234, 88, 12, 0.08); color: #9a3412; }

[data-theme="dark"] .table-header-blue { color: #93bbfd; }
[data-theme="dark"] .table-header-green { color: #6ee7b7; }
[data-theme="dark"] .table-header-purple { color: #d8b4fe; }
[data-theme="dark"] .table-header-orange { color: #fdba74; }

.table-compact .block-table th, .table-compact .block-table td { padding: 6px 10px; font-size: 0.8125rem; }

.table-style-default .block-table th, .table-style-default .block-table td { border: 1px solid var(--color-border); }
.table-style-striped .block-table th, .table-style-striped .block-table td { border: 1px solid var(--color-border); }
.table-style-striped .row-odd td { background-color: var(--color-surface); }
.table-style-bordered .block-table { border: 2px solid var(--color-border); }
.table-style-bordered .block-table th, .table-style-bordered .block-table td { border: 2px solid var(--color-border); }
.table-style-minimal .block-table th, .table-style-minimal .block-table td { border: none; border-bottom: 1px solid var(--color-border); }
.table-style-minimal .block-table tr:last-child td { border-bottom: none; }
.table-style-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.table-style-card .block-table th, .table-style-card .block-table td { border: none; border-bottom: 1px solid var(--color-border-subtle); }
.table-style-card .block-table tr:last-child td { border-bottom: none; }

.block-table tbody tr { transition: background var(--duration-fast) var(--ease-in-out); }
.block-table tbody tr:hover { background-color: var(--color-surface-inset); }

/* ============================================
   Tabs — 5 styles × 5 colors
   ============================================ */
.block-tabs { margin: 24px 0; }
.tabs-header { display: flex; }
.tab-btn { padding: 10px 16px; font-size: 0.8125rem; font-weight: 500; color: var(--color-text-tertiary); background: transparent; border: none; cursor: pointer; transition: all var(--duration-fast) var(--ease-in-out); letter-spacing: 0.005em; }
.tab-btn:hover { color: var(--color-text-secondary); }
.tab-panel { display: none; padding: 16px; font-size: 0.875rem; line-height: 1.65; color: var(--color-text-secondary); white-space: pre-wrap; }
.tab-panel.active { display: block; }

.tabs-style-default { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.tabs-style-default .tabs-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.tabs-style-default .tab-btn { border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-style-default .tab-btn.active { color: var(--color-text); border-bottom-color: var(--color-text); background: var(--color-bg); }

.tabs-style-pills { border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.tabs-style-pills .tabs-header { gap: 6px; padding: 10px 12px; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.tabs-style-pills .tab-btn { border-radius: 9999px; padding: 6px 14px; font-size: 0.8125rem; }
.tabs-style-pills .tab-btn.active { color: white; box-shadow: var(--shadow-xs); }

.tabs-style-underline .tabs-header { gap: 4px; border-bottom: 1px solid var(--color-border); }
.tabs-style-underline .tab-btn { border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-style-underline .tab-btn.active { border-bottom-color: currentColor; }
.tabs-style-underline .tab-panel { padding: 16px 0; }

.tabs-style-boxed { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.tabs-style-boxed .tabs-header { gap: 4px; padding: 8px; background: var(--color-surface); }
.tabs-style-boxed .tab-btn { border: 1px solid var(--color-border); background: var(--color-bg); border-radius: var(--radius-sm); font-size: 0.8125rem; }
.tabs-style-boxed .tab-btn.active { color: white; border-color: transparent; box-shadow: var(--shadow-xs); }

.tabs-style-minimal .tabs-header { gap: 16px; border-bottom: 1px solid var(--color-border-subtle); padding-bottom: 4px; }
.tabs-style-minimal .tab-btn { color: var(--color-text-tertiary); }
.tabs-style-minimal .tab-btn.active { font-weight: 600; }
.tabs-style-minimal .tab-panel { padding: 16px 0; }

/* Tab colors */
.tabs-color-neutral .tab-btn.active { color: var(--color-text); }
.tabs-style-pills.tabs-color-neutral .tab-btn.active { background: var(--color-text); color: var(--color-bg); }
.tabs-style-boxed.tabs-color-neutral .tab-btn.active { background: var(--color-text); }
.tabs-style-underline.tabs-color-neutral .tab-btn.active { color: var(--color-text); border-bottom-color: var(--color-text); }
.tabs-style-minimal.tabs-color-neutral .tab-btn.active { color: var(--color-text); }

.tabs-color-blue .tab-btn.active { color: #2563eb; }
.tabs-style-pills.tabs-color-blue .tab-btn.active { background: #2563eb; color: white; }
.tabs-style-boxed.tabs-color-blue .tab-btn.active { background: #2563eb; }
.tabs-style-underline.tabs-color-blue .tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; }
.tabs-style-minimal.tabs-color-blue .tab-btn.active { color: #2563eb; }

.tabs-color-green .tab-btn.active { color: #059669; }
.tabs-style-pills.tabs-color-green .tab-btn.active { background: #059669; color: white; }
.tabs-style-boxed.tabs-color-green .tab-btn.active { background: #059669; }
.tabs-style-underline.tabs-color-green .tab-btn.active { color: #059669; border-bottom-color: #059669; }
.tabs-style-minimal.tabs-color-green .tab-btn.active { color: #059669; }

.tabs-color-purple .tab-btn.active { color: #9333ea; }
.tabs-style-pills.tabs-color-purple .tab-btn.active { background: #9333ea; color: white; }
.tabs-style-boxed.tabs-color-purple .tab-btn.active { background: #9333ea; }
.tabs-style-underline.tabs-color-purple .tab-btn.active { color: #9333ea; border-bottom-color: #9333ea; }
.tabs-style-minimal.tabs-color-purple .tab-btn.active { color: #9333ea; }

.tabs-color-orange .tab-btn.active { color: #f97316; }
.tabs-style-pills.tabs-color-orange .tab-btn.active { background: #f97316; color: white; }
.tabs-style-boxed.tabs-color-orange .tab-btn.active { background: #f97316; }
.tabs-style-underline.tabs-color-orange .tab-btn.active { color: #f97316; border-bottom-color: #f97316; }
.tabs-style-minimal.tabs-color-orange .tab-btn.active { color: #f97316; }

/* ============================================
   Media + Text
   ============================================ */
.block-media-text { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; margin: 32px 0; }
.block-media-text.media-right { direction: rtl; }
.block-media-text.media-right > * { direction: ltr; }
.media-side img { border-radius: var(--radius); }

/* ============================================
   Columns
   ============================================ */
.block-columns { display: grid; gap: 24px; margin: 32px 0; }
.layout-2-equal { grid-template-columns: 1fr 1fr; }
.layout-3-equal { grid-template-columns: 1fr 1fr 1fr; }
.layout-2-left { grid-template-columns: 2fr 1fr; }
.layout-2-right { grid-template-columns: 1fr 2fr; }

/* ============================================
   File Download — 4 styles
   ============================================ */
.file-wrapper { display: flex; margin: 16px 0; }
.file-align-left { justify-content: flex-start; }
.file-align-center { justify-content: center; }
.file-align-right { justify-content: flex-end; }
.block-file { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; transition: all var(--duration-fast) var(--ease-in-out); }
.block-file:hover { text-decoration: none; }
.file-icon { flex-shrink: 0; width: 20px; height: 20px; color: var(--color-text-secondary); }
.file-icon svg { width: 100%; height: 100%; }

.file-ext-pdf .file-icon, .file-icon.file-ext-pdf { color: #ef4444; }
.file-ext-doc .file-icon, .file-ext-docx .file-icon, .file-icon.file-ext-doc, .file-icon.file-ext-docx { color: #2563eb; }
.file-ext-xls .file-icon, .file-ext-xlsx .file-icon, .file-ext-csv .file-icon { color: #16a34a; }
.file-ext-zip .file-icon, .file-ext-rar .file-icon, .file-ext-7z .file-icon { color: #d97706; }
.file-ext-png .file-icon, .file-ext-jpg .file-icon, .file-ext-jpeg .file-icon, .file-ext-gif .file-icon { color: #a855f7; }
.file-ext-mp4 .file-icon, .file-ext-mov .file-icon, .file-ext-avi .file-icon { color: #ec4899; }
.file-ext-mp3 .file-icon, .file-ext-wav .file-icon { color: #6366f1; }

.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-weight: 500; font-size: 0.875rem; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 0.75rem; color: var(--color-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-download { flex-shrink: 0; display: flex; align-items: center; gap: 6px; color: var(--color-text-tertiary); transition: color var(--duration-fast) var(--ease-in-out); }
.file-download svg { width: 16px; height: 16px; }

.file-style-default { padding: 12px 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); transition: all var(--duration-fast) var(--ease-in-out); }
.file-style-default:hover { background: var(--color-surface-inset); border-color: var(--color-border); box-shadow: var(--shadow-xs); }

.file-style-minimal { padding: 4px 0; }
.file-style-minimal .file-info { flex-direction: row; align-items: center; gap: 8px; }
.file-style-minimal .file-meta { color: var(--color-text-tertiary); }
.file-style-minimal .file-meta::before { content: "("; }
.file-style-minimal .file-meta::after { content: ")"; }
.file-style-minimal .file-download { display: none; }
.file-style-minimal:hover .file-name { color: var(--color-text); }

.file-style-card { padding: 16px; background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); transition: all var(--duration) var(--ease-in-out); }
.file-style-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-border); }
.file-style-card .file-icon { width: 40px; height: 40px; padding: 10px; background: var(--color-surface-inset); border-radius: var(--radius); }
.file-style-card .file-name { font-weight: 600; font-size: 0.9375rem; }
.file-style-card .file-meta { font-size: 0.8125rem; }
.file-style-card .file-download { padding: 6px 12px; background: var(--color-text); color: var(--color-bg); border-radius: var(--radius); font-size: 0.75rem; font-weight: 500; transition: background var(--duration-fast) var(--ease-in-out); }
.file-style-card:hover .file-download { opacity: 0.9; }

.file-style-button { display: inline-flex; padding: 8px 16px; background: var(--color-text); color: var(--color-bg); border-radius: var(--radius); transition: background var(--duration-fast) var(--ease-in-out); }
.file-style-button .file-icon { display: none; }
.file-style-button .file-info { flex-direction: row; align-items: center; gap: 8px; }
.file-style-button .file-name { color: var(--color-bg); font-weight: 500; }
.file-style-button .file-meta { color: rgba(255,255,255,0.6); font-size: 0.75rem; }
.file-style-button .file-download { color: var(--color-bg); order: -1; }
.file-style-button:hover { opacity: 0.9; }

/* ============================================
   Bookmark
   ============================================ */
.block-bookmark { display: block; padding: 16px 20px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); transition: all var(--duration) var(--ease-in-out); }
.block-bookmark:hover { border-color: var(--color-text-secondary); box-shadow: var(--shadow-sm); text-decoration: none; }
.bookmark-title { font-weight: 600; color: var(--color-text); margin-bottom: 4px; font-size: 0.9375rem; }
.bookmark-desc { font-size: 0.8125rem; color: var(--color-text-secondary); margin-bottom: 8px; line-height: 1.5; }
.bookmark-url { font-size: 0.75rem; color: var(--color-text-tertiary); }

/* ============================================
   Embed
   ============================================ */
.block-embed iframe { width: 100%; min-height: 400px; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.embed-caption { margin-top: 12px; font-size: 0.8125rem; color: var(--color-text-secondary); text-align: center; }

/* ============================================
   API Block
   ============================================ */
.block-api { margin: 24px 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.api-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.api-method { padding: 3px 8px; font-size: 0.6875rem; font-weight: 700; border-radius: var(--radius-sm); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; background: var(--color-text); color: var(--color-bg); }
.api-endpoint { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--color-text); font-weight: 500; }
.api-desc { padding: 12px 16px; font-size: 0.875rem; color: var(--color-text-secondary); border-bottom: 1px solid var(--color-border); line-height: 1.6; }
.api-bodies { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
@media (max-width: 640px) { .api-bodies { grid-template-columns: 1fr; } }
.api-body-section { border-right: 1px solid var(--color-border); }
.api-body-section:last-child { border-right: none; }
@media (max-width: 640px) { .api-body-section { border-right: none; border-bottom: 1px solid var(--color-border); } .api-body-section:last-child { border-bottom: none; } }
.api-body-label { padding: 8px 16px; font-size: 0.6875rem; font-weight: 600; color: var(--color-text-secondary); background: var(--color-surface); border-bottom: 1px solid var(--color-border); text-transform: uppercase; letter-spacing: 0.05em; }
.api-body-code { margin: 0; padding: 12px 16px; font-size: 0.75rem; font-family: var(--font-mono); background: var(--color-code-bg); color: var(--color-code-text); overflow-x: auto; white-space: pre; line-height: 1.6; }
.api-auth-badge { margin-left: auto; padding: 2px 8px; font-size: 0.6875rem; font-weight: 600; border-radius: var(--radius-sm); background: var(--color-surface-inset); color: var(--color-text-secondary); letter-spacing: 0.02em; border: 1px solid var(--color-border); }
.api-params { border-bottom: 1px solid var(--color-border); }
.api-params-section { }
.api-params-label { padding: 8px 16px; font-size: 0.6875rem; font-weight: 600; color: var(--color-text-secondary); background: var(--color-surface); border-bottom: 1px solid var(--color-border); text-transform: uppercase; letter-spacing: 0.05em; }
.api-params-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.api-params-table th { padding: 8px 16px; text-align: left; font-size: 0.6875rem; font-weight: 600; color: var(--color-text-secondary); background: var(--color-surface); border-bottom: 1px solid var(--color-border); text-transform: uppercase; letter-spacing: 0.05em; }
.api-params-table td { padding: 8px 16px; border-bottom: 1px solid var(--color-border); color: var(--color-text); vertical-align: top; }
.api-params-table tr:last-child td { border-bottom: none; }
.api-params-table code { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; color: var(--color-text); }
.api-param-required { font-size: 0.6875rem; font-weight: 600; color: #ef4444; }
.api-status-codes { border-top: 1px solid var(--color-border); }
.api-status-label { padding: 8px 16px; font-size: 0.6875rem; font-weight: 600; color: var(--color-text-secondary); background: var(--color-surface); border-bottom: 1px solid var(--color-border); text-transform: uppercase; letter-spacing: 0.05em; }
.api-status-list { padding: 8px 16px; }
.api-status-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.api-status-item:not(:last-child) { border-bottom: 1px solid var(--color-border); }
.api-status-badge { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; min-width: 36px; }
.api-status-2xx { color: #16a34a; }
.api-status-3xx { color: #0891b2; }
.api-status-4xx { color: #d97706; }
.api-status-5xx { color: #dc2626; }
.api-status-desc { font-size: 0.8125rem; color: var(--color-text); }

/* ============================================
   Feedback Widget
   ============================================ */
.article-feedback { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 0; margin-top: 40px; border-top: 1px solid var(--color-border); }
.feedback-question { font-size: 0.875rem; font-weight: 500; color: var(--color-text-secondary); margin: 0; }
.feedback-buttons { display: flex; align-items: center; gap: 12px; }
.feedback-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text-secondary); cursor: pointer; transition: all 0.15s ease; font-size: 0.8125rem; }
.feedback-btn:hover { border-color: var(--color-text-secondary); color: var(--color-text); }
.feedback-btn.voted { border-color: var(--color-success); color: var(--color-success); background: rgba(5, 150, 105, 0.05); }
.feedback-btn.voted.feedback-btn-down { border-color: var(--color-text-secondary); color: var(--color-text-secondary); background: var(--color-surface-inset); }
.feedback-btn svg { flex-shrink: 0; }
.feedback-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.feedback-thanks { font-size: 0.8125rem; color: var(--color-success); font-weight: 500; margin: 0; }

/* ============================================
   Article Navigation (Prev/Next)
   ============================================ */
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--color-border); }
.article-nav-link { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; text-decoration: none; transition: color 0.15s ease; }
.article-nav-link:hover .article-nav-title { text-decoration: underline; }
.article-nav-prev { align-items: flex-start; }
.article-nav-next { align-items: flex-end; text-align: right; }
.article-nav-label { font-size: 0.6875rem; font-weight: 500; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.article-nav-title { font-size: 0.875rem; font-weight: 600; color: var(--color-text); }
@media (max-width: 640px) { .article-nav { grid-template-columns: 1fr; } }

/* ============================================
   Social Links
   ============================================ */
.block-social-links { margin: 0; }
.social-links-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.social-links-icons .social-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-sm); color: var(--color-text-secondary); transition: color 0.15s, background 0.15s; text-decoration: none; }
.social-links-icons .social-link:hover { color: var(--color-text); background: var(--color-surface-inset); }
.social-links-pills .social-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--color-border); border-radius: 9999px; font-size: 0.8125rem; color: var(--color-text-secondary); text-decoration: none; transition: all 0.15s; }
.social-links-pills .social-link:hover { border-color: var(--color-text-secondary); color: var(--color-text); background: var(--color-surface); }
.social-links-pills .social-link svg { flex-shrink: 0; }
.social-links-buttons .social-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--color-surface-inset); border-radius: var(--radius-md); font-size: 0.8125rem; font-weight: 500; color: var(--color-text); text-decoration: none; transition: background 0.15s; }
.social-links-buttons .social-link:hover { background: var(--color-border); }
.social-links-buttons .social-link svg { flex-shrink: 0; }

/* ============================================
   Article Footer (Global)
   ============================================ */
.article-footer { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--color-border); }

/* ============================================
   Keyboard Shortcuts
   ============================================ */
.block-keyboard { display: inline-flex; align-items: center; gap: 8px; }
.keyboard-keys { display: flex; align-items: center; gap: 4px; }
kbd { display: inline-flex; align-items: center; justify-content: center; padding: 3px 8px; font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500; background: var(--color-surface-inset); border: 1px solid var(--color-border); border-bottom-width: 2px; border-radius: var(--radius-sm); color: var(--color-text-secondary); line-height: 1.4; }
.key-plus { color: var(--color-text-tertiary); font-size: 0.6875rem; }
.key-desc { font-size: 0.8125rem; color: var(--color-text-secondary); }

/* ============================================
   Changelog
   ============================================ */
.block-changelog { padding: 20px; border-radius: var(--radius-md); }

.changelog-dark { background: var(--color-code-bg); border: 1px solid var(--color-code-border); }
.changelog-dark .changelog-version { color: white; }
.changelog-dark .changelog-date { color: var(--color-code-lang); }
.changelog-dark .changelog-items li { color: var(--color-code-text); }

.changelog-light { background: var(--color-surface); border: 1px solid var(--color-border); }
.changelog-light .changelog-version { color: var(--color-text); }
.changelog-light .changelog-date { color: var(--color-text-secondary); }
.changelog-light .changelog-items li { color: var(--color-text-secondary); }

.changelog-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.changelog-version { font-weight: 700; font-size: 1.125rem; font-family: var(--font-mono); letter-spacing: -0.01em; }
.changelog-date { font-size: 0.8125rem; }
.changelog-items { list-style: none; }
.changelog-items li { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; font-size: 0.875rem; line-height: 1.55; }

.change-label { padding: 2px 7px; font-size: 0.6875rem; font-weight: 600; border-radius: var(--radius-sm); flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 1px; }
.change-added .change-label { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.change-changed .change-label { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.change-fixed .change-label { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.change-removed .change-label { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.change-deprecated .change-label { background: rgba(115, 115, 115, 0.12); color: var(--color-text-secondary); }

/* ============================================
   Math
   ============================================ */
.block-math { text-align: center; padding: 16px 0; overflow-x: auto; }

/* ============================================
   Mermaid
   ============================================ */
.block-mermaid { text-align: center; margin: 32px 0; }
.mermaid-caption { margin-top: 12px; font-size: 0.8125rem; color: var(--color-text-secondary); }

/* ============================================
   Link Cards
   ============================================ */
.block-link-cards { margin: 32px 0; }
.link-cards-title { font-size: 1.125rem; font-weight: 600; color: var(--color-text); margin-bottom: 16px; letter-spacing: -0.01em; }
.link-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.link-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--color-border); border-radius: var(--radius-md); text-decoration: none; color: var(--color-text); transition: border-color 0.15s ease, box-shadow 0.15s ease; position: relative; }
.link-card:hover { border-color: var(--color-text-secondary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-decoration: none; }
.link-card-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--color-surface-inset); color: var(--color-text); flex-shrink: 0; }
.link-card-icon svg { width: 20px; height: 20px; }
.link-card-title { font-size: 0.9375rem; font-weight: 600; color: var(--color-text); line-height: 1.3; }
.link-card-desc { font-size: 0.8125rem; color: var(--color-text-secondary); line-height: 1.5; }
.link-card-arrow { position: absolute; top: 20px; right: 20px; color: var(--color-text-secondary); opacity: 0; transition: opacity 0.15s ease, transform 0.15s ease; }
.link-card:hover .link-card-arrow { opacity: 1; transform: translate(2px, -2px); }
.link-card-arrow svg { width: 16px; height: 16px; }

/* ============================================
   Unknown block fallback
   ============================================ */
.block-unknown { padding: 16px; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: var(--radius); color: var(--color-warning); font-size: 0.875rem; }
