:root {
    --bg-color: #ffffff;
    --text-main: #000000;
    --text-muted: #666666;
    --accent-color: #ff3b30;
    --border-color: #e5e5e5;
    --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
}

.blog-header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    background: rgba(255,255,255,0.95);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.blog-header-inner {
    display: flex; justify-content: space-between; align-items: center;
    height: 72px; max-width: 1200px; margin: 0 auto; padding: 0 5vw;
}
.blog-logo {
    font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700;
    color: var(--text-main); display: flex; align-items: center; gap: 10px; letter-spacing: -0.02em;
}
.blog-logo-img { width: 24px; height: 24px; display: block; flex-shrink: 0; }
.blog-header-nav { display: flex; align-items: center; gap: 16px; }
.blog-back-btn {
    font-family: var(--font-mono); font-size: 13px; font-weight: 600;
    color: var(--text-main); text-transform: uppercase; letter-spacing: 0.5px;
    border: 1px solid var(--border-color); padding: 8px 20px;
    transition: border-color 0.2s ease;
}
.blog-back-btn:hover { border-color: var(--text-main); }

.article-hero { padding: 128px 0 48px; border-bottom: 1px solid var(--border-color); }
.article-hero-inner { max-width: 1200px; margin: 0 auto; padding: 0 5vw; }

.article-hero-breadcrumbs {
    font-family: var(--font-mono); font-size: 12px; font-weight: 600;
    color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; line-height: 1.8;
    margin-bottom: 32px;
}
.article-hero-breadcrumbs a { color: var(--text-muted); transition: color 0.2s ease; }
.article-hero-breadcrumbs a:hover { color: var(--text-main); }
.article-hero-breadcrumbs .sep { color: var(--border-color); }
.article-hero-breadcrumbs .current { color: var(--text-main); }

.article-hero-eyebrow {
    font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 2px;
    color: var(--text-muted); margin-bottom: 24px; display: flex; align-items: center; gap: 8px;
}

.article-hero-title {
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    font-weight: 400; color: var(--text-main); line-height: 1.15;
    letter-spacing: -0.02em; max-width: 900px; margin-bottom: 40px;
}
.article-hero-title em { font-style: normal; color: var(--accent-color); }

.article-hero-meta-row {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0;
    border-top: 1px solid var(--border-color); padding-top: 24px;
}
.author-meta-placeholder { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.author-avatar {
    width: 44px; height: 44px; background: #f5f5f5; color: var(--text-main);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700; font-family: var(--font-mono);
    border: 1px solid var(--border-color); flex-shrink: 0;
}
.author-name { font-weight: 700; font-size: 0.95rem; color: var(--text-main); line-height: 1.2; }
.author-role { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.post-date {
    font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
    border: 1px solid var(--border-color); padding: 4px 10px; margin-left: 16px; flex-shrink: 0;
}
.post-read-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-left: 12px; flex-shrink: 0; }

.article-layout {
    max-width: 1200px; margin: 0 auto; padding: 64px 5vw 100px; width: 100%;
}

.article-main { padding-bottom: 40px; }

.article-content { font-size: 1.05rem; color: var(--text-main); line-height: 1.85; }
.article-content p { margin-bottom: 26px; }
.article-content strong { font-weight: 700; }

.article-content a {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--border-color);
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.article-content a:hover { color: var(--accent-color); text-decoration-color: var(--accent-color); }

.article-content h2 { margin: 80px 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border-color); }
.article-content h2:first-child { margin-top: 0; }
.section-num {
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
    color: var(--text-muted); display: block; margin-bottom: 12px;
}
.section-heading { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; color: var(--text-main); display: block; }

.article-content h3 {
    font-size: 1.25rem; font-weight: 700; margin: 48px 0 18px;
    display: flex; align-items: center; gap: 10px;
}
.article-content h3::before { content: ''; width: 4px; height: 18px; background: var(--text-main); flex-shrink: 0; }

.article-content h4 { font-size: 1.02rem; font-weight: 700; margin: 32px 0 12px; padding-left: 12px; border-left: 3px solid var(--border-color); }
.article-content h5 {
    font-size: 0.85rem; font-weight: 700; margin: 24px 0 8px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-mono);
}

.article-content blockquote { margin: 48px 0; padding-left: 28px; border-left: 3px solid var(--text-main); }
.article-content blockquote p { font-size: 1.2rem; font-weight: 600; line-height: 1.6; color: var(--text-main); margin: 0; }

.article-content ul { margin-bottom: 28px; }
.article-content ul li { position: relative; padding-left: 22px; margin-bottom: 14px; line-height: 1.8; }
.article-content ul li::before { content: ''; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; background: var(--text-main); }
.article-content ul li:last-child { margin-bottom: 0; }

.article-content ol { margin-bottom: 28px; counter-reset: list-counter; }
.article-content ol li { position: relative; padding-left: 34px; margin-bottom: 14px; line-height: 1.8; counter-increment: list-counter; }
.article-content ol li::before {
    content: counter(list-counter, decimal-leading-zero);
    position: absolute; left: 0; top: 0;
    font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
}
.article-content ol li:last-child { margin-bottom: 0; }

.article-table-wrap { margin: 0 0 36px; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border-color); }
.article-content table.article-matrix {
    --matrix-col-label-min: 6rem;
    --matrix-col-label-max: 14rem;
    --matrix-col-data-min: 10rem;
    --matrix-col-data-max: 26rem;
    --matrix-col-tail-min: 4.5rem;
    --matrix-col-tail-max: 7rem;
    width: 100%; min-width: 100%; border-collapse: collapse;
    font-size: 0.92rem; color: var(--text-main); table-layout: auto;
}
.article-matrix-caption {
    caption-side: top; text-align: left;
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
    padding: 14px 20px; border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}
.article-content table.article-matrix th,
.article-content table.article-matrix td {
    border: 1px solid var(--border-color);
    padding: 14px 16px; vertical-align: top; line-height: 1.55; text-align: left;
    white-space: normal; word-break: keep-all; overflow-wrap: break-word;
    hyphens: auto; box-sizing: border-box;
}
.article-content table.article-matrix thead th {
    background: #fafafa; color: var(--text-muted);
    font-weight: 700; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.article-content table.article-matrix thead th:first-child,
.article-content table.article-matrix tbody th[scope="row"] {
    min-width: var(--matrix-col-label-min); max-width: var(--matrix-col-label-max);
    font-weight: 600; font-size: 0.88rem;
}
.article-content table.article-matrix tbody th[scope="row"] { background: #fafafa; color: var(--text-main); }
.article-content table.article-matrix thead th:not(:first-child),
.article-content table.article-matrix tbody td {
    min-width: var(--matrix-col-data-min); max-width: var(--matrix-col-data-max);
}
.article-content table.article-matrix:has(thead tr > th:nth-child(4)) { --matrix-col-label-max: 16rem; }
.article-content table.article-matrix:has(thead tr > th:nth-child(4)) thead th:nth-child(2),
.article-content table.article-matrix:has(thead tr > th:nth-child(4)) tbody td:nth-child(2) { min-width: 7rem; max-width: 11rem; }
.article-content table.article-matrix:has(thead tr > th:nth-child(4)) thead th:nth-child(3),
.article-content table.article-matrix:has(thead tr > th:nth-child(4)) tbody td:nth-child(3) { min-width: 8rem; max-width: 14rem; }
.article-content table.article-matrix:has(thead tr > th:nth-child(4)) thead th:last-child,
.article-content table.article-matrix:has(thead tr > th:nth-child(4)) tbody td:last-child { min-width: var(--matrix-col-tail-min); max-width: var(--matrix-col-tail-max); }
.article-content table.article-matrix td code,
.article-content table.article-matrix th code { word-break: break-all; overflow-wrap: anywhere; }
.article-content table.article-matrix tbody tr.article-matrix-row-emphasis td,
.article-content table.article-matrix tbody tr.article-matrix-row-emphasis th { background: var(--text-main); color: var(--bg-color); font-weight: 700; }

.article-content code {
    font-family: var(--font-mono); font-size: 0.85em; font-weight: 600;
    background: #f5f5f5; padding: 2px 7px; color: var(--text-main); border: 1px solid var(--border-color);
}

.terminal-block { margin: 48px 0; background: #0d0d0d; color: #fff; overflow: hidden; border: 1px solid #222; }
.terminal-block .term-header {
    background: #141414; padding: 12px 20px; font-size: 12px; font-weight: 600;
    color: #888; border-bottom: 1px solid #222; text-transform: uppercase;
    font-family: var(--font-mono); display: flex; align-items: center; gap: 8px;
}
.term-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.term-dot:nth-child(1) { background: #FF5F57; }
.term-dot:nth-child(2) { background: #FEBC2E; }
.term-dot:nth-child(3) { background: #28C840; }
.term-filename { margin-left: auto; color: #444; letter-spacing: 0.05em; }
.terminal-block pre {
    margin: 0; padding: 24px 28px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: pre; word-wrap: normal;
    font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.9; max-width: 100%;
}
.terminal-block pre code { background: transparent; padding: 0; border: none; color: #ccc; display: block; white-space: pre; }
.hl { color: var(--accent-color); font-weight: 700; }
.err { color: #FF5F57; font-weight: 700; }
.ok { color: #28C840; font-weight: 700; }
.dim { color: #555; }

.article-divider { border: none; border-top: 1px solid var(--border-color); margin: 80px 0; }

.article-cta {
    margin: 96px 0 0; border: 1px solid var(--border-color); border-top: 3px solid var(--text-main);
    padding: 48px 5vw; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px;
}
.article-cta-text { flex: 1 1 380px; min-width: 0; }
.article-cta-label {
    font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 2px;
    color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.article-cta-text h3 {
    font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 700; letter-spacing: -0.01em;
    margin-bottom: 10px; overflow-wrap: break-word;
}
.article-cta-text p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.7; overflow-wrap: break-word; }
.article-cta .btn {
    flex-shrink: 0; display: inline-block; padding: 16px 36px;
    background: var(--text-main); color: var(--bg-color); border: 1px solid var(--text-main);
    font-family: var(--font-mono); font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px; transition: 0.25s; white-space: nowrap;
}
.article-cta .btn:hover { background: transparent; color: var(--text-main); }

.floating-cta {
    position: fixed; bottom: 24px; right: 24px; z-index: 99; width: 280px;
    background: var(--bg-color); border: 1px solid var(--border-color); border-top: 3px solid var(--text-main);
    padding: 24px 22px;
}
.floating-cta .fc-label {
    font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.floating-cta .fc-desc { font-size: 0.92rem; color: var(--text-main); line-height: 1.6; margin-bottom: 18px; }
.floating-cta .fc-btn {
    display: block; text-align: center; padding: 12px; background: var(--text-main); color: var(--bg-color);
    font-family: var(--font-mono); font-weight: 600; text-transform: uppercase; font-size: 12px;
    letter-spacing: 1px; transition: 0.2s;
}
.floating-cta .fc-btn:hover { background: var(--accent-color); }

.faq-block { margin: 80px 0 0; }
.faq-item { border-bottom: 1px solid var(--border-color); }
.faq-question {
    font-weight: 600; font-size: 1rem; padding: 24px 0; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; color: var(--text-main);
    list-style: none; gap: 16px; user-select: none;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
    content: "+"; font-size: 1.3rem; font-weight: 700; color: var(--text-muted);
    flex-shrink: 0; line-height: 1; font-family: var(--font-mono);
}
details[open] > .faq-question::after { content: "\2212"; color: var(--accent-color); }
.faq-answer { padding: 0 0 24px; }
.faq-answer p { margin-bottom: 0; font-size: 0.95rem; color: var(--text-muted); line-height: 1.8; }

@media (max-width: 1440px) { .floating-cta { display: none; } }

@media (max-width: 768px) {
    .blog-header-inner { padding: 0 20px; }
    .article-hero { padding: 96px 0 40px; }
    .article-hero-inner { padding: 0 20px; }
    .article-hero-meta-row { flex-direction: column; align-items: flex-start; gap: 16px; }
    .post-date, .post-read-time { margin-left: 0; }
    .article-layout { padding: 32px 20px 72px; }
    .article-main { max-width: 100%; overflow: hidden; }
    .article-content { overflow-wrap: break-word; word-break: break-word; }
    .article-content table.article-matrix th,
    .article-content table.article-matrix td { word-break: keep-all; overflow-wrap: break-word; }
    .article-content table.article-matrix {
        --matrix-col-label-min: 5rem; --matrix-col-label-max: 11rem;
        --matrix-col-data-min: 8rem; --matrix-col-data-max: 20rem;
        --matrix-col-tail-min: 4rem; --matrix-col-tail-max: 6rem;
    }
    .article-content h2 { margin: 56px 0 24px; }
    .article-cta { padding: 40px 24px; flex-direction: column; align-items: stretch; text-align: left; }
    .article-cta .btn { width: 100%; text-align: center; white-space: normal; }
    .terminal-block pre { padding: 18px 16px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .article-cta { padding: 36px 20px; }
    .article-layout { padding: 24px 16px 64px; }
    .terminal-block pre { padding: 16px 14px; font-size: 0.78rem; }
}
