:root {
    --bg:         #0f0f11;
    --surface:    #17171a;
    --surface2:   #1e1e23;
    --border:     #2a2a31;
    --border-hi:  #3d3d48;
    --accent:     #e8ff47;
    --accent-dim: #b8cc2e;
    --text:       #e8e8ec;
    --text-dim:   #7a7a8a;
    --text-muted: #45454f;
    --danger:     #ff4d4d;
    --radius:     6px;
    --radius-lg:  12px;
    --font-ui:    'Syne', sans-serif;
    --font-mono:  'DM Mono', monospace;
    --font-body:  'Lora', Georgia, serif;
    --content-w:  720px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.75;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--text);
}
.logo-icon { font-size: 20px; color: var(--accent); line-height: 1; }
.logo-text strong { color: var(--accent); }
.header-actions { display: flex; gap: 10px; align-items: center; }

.btn {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn svg { flex-shrink: 0; overflow: hidden; }
.btn-lg { font-size: 15px; padding: 12px 28px; }
.btn-primary { background: var(--accent); color: #0f0f11; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface2); }

.breadcrumb {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 6px;
    align-items: center;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-muted); }

.article-wrap {
    display: grid;
    grid-template-columns: 1fr min(var(--content-w), 100%) 1fr;
    padding: 60px 20px 100px;
    gap: 0;
}
.article-wrap > * { grid-column: 2; }
.article-wrap > .full-bleed { grid-column: 1 / -1; }

.article-hero { margin-bottom: 48px; }
.article-category {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    display: inline-block;
    margin-bottom: 16px;
}
.article-title {
    font-family: var(--font-ui);
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 20px;
}
.article-title em { font-style: normal; color: var(--accent); }
.article-lead {
    font-size: 18px;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 28px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.meta-item {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.meta-item svg { flex-shrink: 0; }

.toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin: 40px 0;
}
.toc-title {
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.toc ol { list-style: none; counter-reset: toc; }
.toc li {
    counter-increment: toc;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 4px 0;
}
.toc li::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent);
    flex-shrink: 0;
}
.toc a {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}
.toc a:hover { color: var(--accent); }

.article-body h2 {
    font-family: var(--font-ui);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 56px 0 16px;
    scroll-margin-top: 80px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.article-body h2 .h-num {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-radius: 4px;
    padding: 2px 7px;
}
.article-body h3 {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 32px 0 10px;
    scroll-margin-top: 80px;
}
.article-body p { margin-bottom: 18px; color: var(--text-dim); font-size: 16px; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--accent-dim); }

.steps { margin: 32px 0; display: flex; flex-direction: column; gap: 2px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 0 16px; align-items: start; }
.step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.step-connector { grid-column: 1; width: 1.5px; min-height: 32px; background: var(--border); margin: 0 auto; }
.step-content { padding: 8px 0 24px; }
.step-title { font-family: var(--font-ui); font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.step-desc { font-size: 15px; color: var(--text-dim); margin: 0; }

.callout {
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin: 28px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.callout-tip {
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.callout-warn {
    background: color-mix(in srgb, #ff9a00 7%, transparent);
    border: 1px solid color-mix(in srgb, #ff9a00 25%, transparent);
}
.callout-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.callout-body { font-size: 14px; color: var(--text-dim); }
.callout-body strong { color: var(--text); display: block; margin-bottom: 2px; }

.screenshot {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 28px 0;
    width: 100%;
}
.screenshot img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}
.screenshot-cap {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    padding: 10px 14px;
    border-top: 1px solid var(--border);
}
.screenshot-placeholder {
    aspect-ratio: 16 / 7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}
.screenshot-placeholder svg { opacity: 0.3; }

.feature-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--text-dim); }
.feature-list li::before { content: '✦'; color: var(--accent); font-size: 10px; margin-top: 4px; flex-shrink: 0; }

.faq { margin: 20px 0; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    padding: 16px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    list-style: none;
    user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q .faq-arrow { font-size: 12px; color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
details[open] .faq-arrow { transform: rotate(180deg); }
.faq-a { font-size: 15px; color: var(--text-dim); padding-bottom: 16px; padding-right: 24px; }

.cta-block {
    margin: 60px 0 40px;
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
    pointer-events: none;
}
.cta-title { font-family: var(--font-ui); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; position: relative; }
.cta-sub { font-size: 15px; color: var(--text-dim); margin-bottom: 28px; position: relative; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; }
.cta-actions a.btn-primary { background: var(--accent); color: #0f0f11; border-color: var(--accent); text-decoration: none; }
.cta-actions a.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #0f0f11; }
.cta-actions a.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); text-decoration: none; }
.cta-actions a.btn-ghost:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface2); }
.cta-actions a svg { fill: #0f0f11; }
.cta-actions .btn { text-decoration: none !important; color: #0f0f11 !important; }
.cta-actions .btn-ghost { color: var(--text-dim) !important; }

.related { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border); }
.related-title {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.related-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-decoration: none;
    display: block;
    transition: border-color 0.15s, transform 0.15s;
}
.related-card:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.related-card-cat { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 8px; }
.related-card-title { font-family: var(--font-ui); font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.35; }

.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    z-index: 200;
    width: 0%;
    transition: width 0.1s linear;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }

@media (max-width: 640px) {
    .article-wrap { padding: 36px 0 80px; }
    .cta-block { padding: 28px 20px; }
    .app-header { padding: 12px 16px; }
    .breadcrumb { padding: 10px 16px; }
}