:root {
    --blog-ink: #10162f;
    --blog-indigo: #5367f2;
    --blog-violet: #7c5ce7;
    --blog-sky: #5ba8f5;
}

body[data-page-type^="blog"] {
    background:
        radial-gradient(circle at 8% 8%, rgba(91, 168, 245, .11), transparent 24rem),
        radial-gradient(circle at 92% 18%, rgba(124, 92, 231, .09), transparent 25rem),
        #f8faff;
}

body[data-page-type="blog-detail"] {
    background-color: #f7f9fc;
    background-image: linear-gradient(180deg, #fbfdff 0%, #f7f9fc 100%);
}

.blog-shell {
    flex: 1 1 auto;
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding-inline: 24px;
}

.blog-index-shell {
    padding-block: 48px 72px;
}

.blog-index-hero {
    width: var(--card-w);
    margin-inline: auto;
    min-height: 250px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: center;
    gap: 40px;
    padding: 40px 48px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at 82% 18%, rgba(79, 109, 246, .08), transparent 26rem),
        var(--panel);
    box-shadow: var(--shadow);
}

.blog-kicker {
    margin-bottom: 18px;
    color: var(--blog-indigo);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.blog-index-hero h1 {
    max-width: none;
    margin: 0;
    color: var(--blog-ink);
    font-size: clamp(36px, 3.5vw, 50px);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -.04em;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.blog-index-hero p {
    max-width: 720px;
    margin: 18px 0 0;
    color: #59627d;
    font-size: 16px;
    line-height: 1.65;
}

.blog-hero-mark {
    position: relative;
    width: min(180px, 18vw);
    aspect-ratio: 1;
    justify-self: center;
    display: grid;
    place-items: center;
}

.blog-hero-mark::before {
    content: "";
    position: absolute;
    inset: 14%;
    border-radius: 32%;
    border: 1px solid rgba(79, 109, 246, .16);
    background: linear-gradient(145deg, #e8f4ff, #edf0ff 50%, #f3edff);
    transform: rotate(12deg);
    box-shadow: 0 14px 32px rgba(42, 53, 98, .08);
}

.blog-hero-mark-core {
    position: relative;
    z-index: 2;
    color: var(--accent);
    font-size: clamp(34px, 4vw, 46px);
    font-weight: 850;
    letter-spacing: -.06em;
}

.blog-hero-mark-ring {
    position: absolute;
    border: 1px solid rgba(83, 103, 242, .14);
    border-radius: 50%;
}

.blog-hero-mark-ring--one { inset: 2%; }
.blog-hero-mark-ring--two { inset: -14%; opacity: .55; }

.blog-list {
    width: var(--card-w);
    margin-inline: auto;
    margin-top: 50px;
}

.blog-section-head {
    width: var(--card-w);
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.blog-section-head h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -.03em;
}

.blog-count {
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e9edff;
    color: #4055d5;
    font-size: 12px;
    font-weight: 800;
}

.blog-list-card {
    display: grid;
    grid-template-columns: minmax(220px, .58fr) minmax(0, 1.42fr);
    min-height: 220px;
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid #e0e5f2;
    border-radius: 24px;
    background: rgba(255, 255, 255, .88);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 12px 32px rgba(42, 53, 98, .06);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.blog-list-card:hover {
    transform: translateY(-4px);
    border-color: #c8d1ff;
    box-shadow: 0 24px 60px rgba(42, 53, 98, .13);
}

.blog-card-art {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    padding: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at 25% 20%, rgba(255,255,255,.7), transparent 24%),
        linear-gradient(145deg, #dceeff, #e1e6ff 50%, #ece4fa);
}

.blog-card-art::after {
    content: "";
    position: absolute;
    width: 210px;
    height: 210px;
    right: -52px;
    top: -58px;
    border: 28px solid rgba(79, 109, 246, .08);
    border-radius: 50%;
}

.blog-card-version {
    position: relative;
    z-index: 2;
    color: var(--accent);
    font-size: clamp(40px, 4vw, 54px);
    font-weight: 850;
    line-height: 1;
    letter-spacing: -.07em;
}

.blog-card-grid {
    position: absolute;
    inset: 0;
    opacity: .12;
    background-image: linear-gradient(rgba(79,109,246,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(79,109,246,.7) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: linear-gradient(135deg, transparent 10%, #000 100%);
}

.blog-card-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 36px;
}

.blog-card-meta,
.blog-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #788199;
    font-size: 13px;
    font-weight: 600;
}

.blog-new-badge {
    padding: 4px 9px;
    border-radius: 999px;
    background: #ebefff;
    color: #4055d5;
    font-size: 11px;
    font-weight: 850;
}

.blog-card-copy h3 {
    margin: 14px 0 10px;
    color: var(--blog-ink);
    font-size: clamp(23px, 2.4vw, 31px);
    line-height: 1.28;
    letter-spacing: -.03em;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.blog-card-copy p {
    max-width: 680px;
    margin: 0;
    color: #626b81;
    font-size: 15px;
    line-height: 1.75;
}

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 18px;
    color: #4158da;
    font-size: 14px;
    font-weight: 800;
}

.blog-list-card:hover .blog-read-more span:last-child { transform: translateX(4px); }
.blog-read-more span:last-child { transition: transform .2s ease; }

.blog-empty {
    padding: 56px;
    border: 1px dashed #cfd6e8;
    border-radius: 24px;
    background: rgba(255,255,255,.65);
    text-align: center;
}

.blog-detail-shell {
    padding-block: 38px 92px;
}

.blog-back-link {
    width: var(--card-w);
    margin-inline: auto;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 28px;
    color: #5d6680;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.blog-back-link:hover { color: var(--blog-indigo); }

.blog-article-hero {
    width: var(--card-w);
    margin-inline: auto;
    margin-bottom: 64px;
}

.blog-article-heading {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 430px;
    padding: 54px 58px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at 84% 4%, rgba(255, 255, 255, .72), transparent 24%),
        linear-gradient(145deg, var(--panel) 0%, #f7f9ff 72%, #f5f2ff 100%);
    box-shadow: var(--shadow);
}

.blog-article-heading::before,
.blog-article-heading::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(79, 109, 246, .12);
    border-radius: 50%;
    pointer-events: none;
}

.blog-article-heading::before { width: 360px; height: 360px; right: -150px; top: -190px; }
.blog-article-heading::after { width: 220px; height: 220px; right: 120px; bottom: -170px; }

.blog-article-heading > :not(.blog-article-version) {
    position: relative;
    z-index: 1;
}

.blog-article-heading .blog-kicker {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 22px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(79, 109, 246, .1);
    color: var(--accent);
    letter-spacing: .1em;
}

.blog-article-heading h1 {
    max-width: min(850px, calc(100% - 250px));
    margin: 0;
    color: var(--text);
    font-size: clamp(36px, 3.5vw, 54px);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -.04em;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.blog-article-summary {
    max-width: 760px;
    margin: 22px 0 28px;
    color: #5e6881;
    font-size: 18px;
    line-height: 1.75;
}

.blog-article-version {
    position: absolute;
    top: 50%;
    right: 58px;
    z-index: 0;
    color: rgba(79, 109, 246, .16);
    font-size: clamp(96px, 10vw, 150px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.09em;
    transform: translateY(-50%);
    pointer-events: none;
    user-select: none;
}

.blog-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    align-items: start;
    width: var(--card-w);
    margin-inline: auto;
}

.blog-prose { min-width: 0; }

.blog-markdown {
    color: #283044;
    font-size: 17px;
    line-height: 1.92;
}

.blog-markdown h2,
.blog-markdown h3 {
    scroll-margin-top: 96px;
    color: var(--blog-ink);
    letter-spacing: -.035em;
}

.blog-markdown h2 {
    margin: 64px 0 20px;
    padding-top: 10px;
    font-size: 31px;
    line-height: 1.3;
}

.blog-markdown h2:first-child { margin-top: 0; }
.blog-markdown h3 { margin: 42px 0 16px; font-size: 23px; }
.blog-markdown p { margin: 0 0 22px; }
.blog-markdown a { color: #4058d8; text-underline-offset: 3px; }
.blog-markdown a:hover { color: #263ec1; }

.blog-markdown img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 28px auto;
    border-radius: 16px;
}

.blog-markdown details {
    margin: 18px 0 30px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.blog-markdown details > summary {
    padding: 13px 16px;
    cursor: pointer;
    color: #334155;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.5;
    background: #f8fafc;
}

.blog-markdown details > summary::marker {
    color: #64748b;
}

.blog-markdown details[open] > summary {
    border-bottom: 1px solid #e2e8f0;
}

.blog-parse-comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
    padding: 12px;
}

.blog-parse-comparison img {
    width: 100%;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: zoom-in;
    transition: border-color .15s, box-shadow .15s;
}

.blog-parse-comparison img:hover {
    border-color: #94a3b8;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
}

.blog-parse-comparison img:focus-visible {
    outline: 3px solid rgba(79, 109, 246, .38);
    outline-offset: 3px;
}

.blog-image-viewer {
    box-sizing: border-box;
    width: min(96vw, 1800px);
    max-width: none;
    height: min(94vh, 1200px);
    max-height: none;
    padding: 54px 76px 42px;
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .34);
}

.blog-image-viewer[open] {
    display: grid;
    place-items: center;
}

.blog-image-viewer::backdrop {
    background: rgba(15, 23, 42, .82);
    backdrop-filter: blur(4px);
}

.blog-image-viewer-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
}

.blog-image-viewer-close,
.blog-image-viewer-nav {
    position: absolute;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: #334155;
    background: #f1f5f9;
    cursor: pointer;
}

.blog-image-viewer-close:hover,
.blog-image-viewer-nav:hover {
    color: #fff;
    background: #4058d8;
}

.blog-image-viewer-close:focus-visible,
.blog-image-viewer-nav:focus-visible {
    outline: 3px solid rgba(79, 109, 246, .38);
    outline-offset: 2px;
}

.blog-image-viewer-close {
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 28px;
    line-height: 1;
}

.blog-image-viewer-nav {
    top: 50%;
    width: 46px;
    height: 46px;
    font-size: 38px;
    line-height: 1;
    transform: translateY(-50%);
}

.blog-image-viewer-nav--previous { left: 16px; }
.blog-image-viewer-nav--next { right: 16px; }

.blog-image-viewer-label {
    position: absolute;
    bottom: 12px;
    left: 50%;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    transform: translateX(-50%);
}

.blog-markdown li { margin-block: 9px; }

.blog-toc-wrap {
    position: sticky;
    top: 100px;
    padding-left: 32px;
}

.blog-toc-card {
    padding: 23px 22px;
    border-left: 1px solid #dfe4f2;
}

.blog-toc-title {
    margin-bottom: 14px;
    color: #7a849b;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

#blogToc { display: grid; gap: 4px; }

#blogToc a {
    display: block;
    padding: 6px 0;
    color: #687189;
    font-size: 13px;
    line-height: 1.45;
    text-decoration: none;
    transition: color .15s, transform .15s;
}

#blogToc a:hover,
#blogToc a.is-active { color: #4058d8; transform: translateX(3px); }
#blogToc a[data-level="3"] { padding-left: 13px; font-size: 12px; }

@media (max-width: 960px) {
    .blog-shell { max-width: none; padding-inline: 18px; }
    .blog-index-hero,
    .blog-list { width: 100%; }
    .blog-section-head,
    .blog-back-link { width: 100%; }
    .blog-index-hero { grid-template-columns: 1fr; padding: 36px; }
    .blog-hero-mark { display: none; }
    .blog-article-heading h1 { max-width: calc(100% - 160px); }
    .blog-article-version { right: 32px; font-size: 110px; }
    .blog-article-hero { width: 100%; }
    .blog-article-layout { display: block; }
    .blog-toc-wrap { display: none; }
}

@media (max-width: 720px) {
    .blog-shell { padding-inline: 14px; }
    .blog-index-shell { padding-block: 24px 48px; }
    .blog-index-hero { min-height: 0; padding: 28px 24px; border-radius: 24px; }
    .blog-index-hero h1 { font-size: 34px; line-height: 1.18; }
    .blog-list { margin-top: 40px; }
    .blog-list-card { grid-template-columns: 1fr; border-radius: 22px; }
    .blog-card-art { min-height: 160px; }
    .blog-card-copy { padding: 24px; }
    .blog-detail-shell { padding-block: 25px 60px; }
    .blog-article-heading { min-height: 0; padding: 38px 27px; border-radius: 23px; }
    .blog-article-heading h1 { max-width: 100%; font-size: clamp(34px, 9vw, 42px); }
    .blog-article-summary { font-size: 16px; }
    .blog-article-version { top: 24px; right: 20px; color: rgba(79, 109, 246, .08); font-size: 76px; transform: none; }
    .blog-markdown { font-size: 16px; line-height: 1.85; }
    .blog-markdown h2 { margin-top: 50px; font-size: 27px; }
    .blog-image-viewer {
        width: 100vw;
        height: 100vh;
        padding: 54px 48px 42px;
        border-radius: 0;
    }
    .blog-image-viewer-nav { width: 38px; height: 38px; font-size: 32px; }
    .blog-image-viewer-nav--previous { left: 6px; }
    .blog-image-viewer-nav--next { right: 6px; }
}
