.blog-shell {
    --blog-max: 1280px;
    --blog-gap: 1.5rem;
    width: 100%;
    max-width: var(--blog-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.blog-search-hero {
    max-width: 720px;
    margin: 0 auto 1.75rem;
}

.blog-google-search {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 52px;
    padding: 0.35rem 0.4rem 0.35rem 1.1rem;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 999px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.18);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.blog-google-search:hover,
.blog-google-search:focus-within {
    border-color: transparent;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.blog-google-search-icon {
    color: #9aa0a6;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.blog-google-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0.55rem 0.4rem;
    font-size: 1.05rem;
    outline: none;
    color: #202124;
}

.blog-google-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: #70757a;
    text-decoration: none;
    border-radius: 50%;
    flex-shrink: 0;
}

.blog-google-search-clear:hover {
    background: #f1f3f4;
    color: #202124;
}

.blog-google-search-submit {
    flex-shrink: 0;
    border: 0;
    background: #1a73e8;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 999px;
    padding: 0.5rem 1.15rem;
    margin-right: 0.1rem;
}

.blog-google-search-submit:hover {
    background: #1557b0;
}

.blog-search-trending {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding: 0 0.5rem;
}

.blog-search-trending-label {
    flex-shrink: 0;
    color: #80868b;
    font-size: 0.8rem;
    font-weight: 600;
    padding-top: 0.28rem;
    white-space: nowrap;
}

.blog-search-trending-label i {
    color: #ea4335;
}

.blog-hot-chip.is-active {
    background: #e8f0fe;
    color: #1967d2;
}

.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--blog-gap);
    align-items: start;
}

.blog-col-left { order: 2; }
.blog-col-main { order: 1; min-width: 0; }
.blog-col-right { order: 3; }

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.blog-widget {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 1rem;
    padding: 1rem 1.1rem 1.1rem;
}

.blog-widget-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.95rem;
    font-weight: 700;
    color: #212529;
}

.blog-widget-title i {
    color: #2563eb;
}

.blog-widget-empty {
    margin: 0;
    color: #adb5bd;
    font-size: 0.85rem;
}

.blog-hot-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.blog-hot-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.blog-hot-chip:hover {
    background: #e7f0ff;
    color: #2563eb;
}

.blog-hot-chip.is-pinned {
    background: #fff4e5;
    color: #c2410c;
}

.blog-hot-chip.is-pinned:hover {
    background: #ffe8cc;
    color: #9a3412;
}

.blog-cat-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: 22rem;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.blog-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    color: #495057;
    text-decoration: none;
    font-size: 0.9rem;
}

.blog-cat-item:hover {
    background: #f8f9fa;
    color: #2563eb;
}

.blog-cat-item.active {
    background: #e7f0ff;
    color: #1d4ed8;
    font-weight: 600;
}

.blog-cat-count {
    font-size: 0.75rem;
    color: #868e96;
    background: #f1f3f5;
    border-radius: 999px;
    min-width: 1.5rem;
    text-align: center;
    padding: 0.05rem 0.4rem;
}

.blog-cat-item.active .blog-cat-count {
    background: #fff;
    color: #2563eb;
}

.blog-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blog-rank-list li {
    display: grid;
    grid-template-columns: 1.4rem minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.45rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed #f1f3f5;
}

.blog-rank-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.blog-rank-index {
    font-size: 0.75rem;
    font-weight: 700;
    color: #868e96;
    line-height: 1.5;
}

.blog-rank-list li:nth-child(1) .blog-rank-index { color: #e03131; }
.blog-rank-list li:nth-child(2) .blog-rank-index { color: #f76707; }
.blog-rank-list li:nth-child(3) .blog-rank-index { color: #f59f00; }

.blog-rank-list a {
    color: #212529;
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-rank-list a:hover {
    color: #2563eb;
}

.blog-rank-meta {
    color: #adb5bd;
    font-size: 0.75rem;
    white-space: nowrap;
    padding-top: 0.1rem;
}

.blog-wordcloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.7rem;
    min-height: 6rem;
    padding: 0.25rem 0;
    line-height: 1.35;
}

.blog-cloud-word {
    text-decoration: none;
    font-weight: 600;
    opacity: 0.88;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.blog-cloud-word:hover,
.blog-cloud-word.active {
    opacity: 1;
    transform: scale(1.08);
    text-decoration: underline;
}

.blog-page-header {
    margin-bottom: 1.25rem;
}

.blog-page-title {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.blog-page-subtitle {
    color: #6c757d;
    margin: 0;
    font-size: 0.95rem;
}

.blog-page-subtitle a {
    text-decoration: none;
}

.post-row {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.06);
}

.post-row-thumb {
    display: block;
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f1f3f5;
    aspect-ratio: 16 / 10;
}

.post-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-row:hover .post-row-thumb img {
    transform: scale(1.05);
}

.post-row-pin {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
}

.post-row-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-row-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.4rem;
}

.post-row-title a {
    color: #212529;
    text-decoration: none;
}

.post-row-title a:hover {
    color: #2563eb;
}

.post-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 0.45rem;
}

.post-row-meta a {
    color: #2563eb;
    text-decoration: none;
}

.post-row-excerpt {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-row-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.post-row-tags a {
    color: #6c757d;
    font-size: 0.78rem;
    text-decoration: none;
}

.post-row-tags a:hover {
    color: #2563eb;
}

.blog-article {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 1rem;
    padding: 1.5rem 1.6rem 1.75rem;
    min-width: 0;
}

.blog-article .breadcrumb {
    margin-bottom: 0.75rem;
}

.article-page {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.article-page.has-toc {
    max-width: 1120px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

.article-toc {
    z-index: 2;
}

.article-page-alerts {
    grid-column: 1 / -1;
}

.article-title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.85rem;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    scroll-margin-top: calc(var(--site-nav-height) + 16px);
}

.article-toc-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 1rem;
    padding: 0.9rem 0.85rem 1rem;
}

.article-toc-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.65rem;
    padding: 0 0.35rem 0.55rem;
    border-bottom: 1px solid #f1f3f5;
}

.article-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    max-height: 40vh;
    overflow-y: auto;
}

.article-toc-link {
    display: block;
    color: #495057;
    text-decoration: none;
    font-size: 0.86rem;
    line-height: 1.45;
    padding: 0.32rem 0.45rem;
    border-radius: 0.4rem;
    border-left: 2px solid transparent;
}

.article-toc-link:hover {
    background: #f8f9fa;
    color: #2563eb;
}

.article-toc-link.is-active {
    background: #e7f0ff;
    color: #1d4ed8;
    font-weight: 600;
    border-left-color: #2563eb;
}

.article-toc-link--h3 {
    padding-left: 1.1rem;
    font-size: 0.82rem;
}

.article-toc-link--h4 {
    padding-left: 1.75rem;
    font-size: 0.8rem;
    color: #6c757d;
}

@media (max-width: 575.98px) {
    .blog-google-search {
        padding-left: 0.85rem;
    }

    .blog-google-search input {
        font-size: 1rem;
    }

    .blog-google-search-submit {
        padding: 0.45rem 0.85rem;
    }

    .blog-search-trending {
        flex-direction: column;
        gap: 0.4rem;
    }

    .post-row {
        grid-template-columns: 1fr;
        padding: 0.85rem;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .blog-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
    }

    .blog-col-main { order: 1; }
    .blog-col-right { order: 2; }
    .blog-col-left {
        order: 3;
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
        align-items: start;
    }

    .blog-col-left .blog-sidebar {
        display: contents;
    }
}

@media (min-width: 1200px) {
    .blog-layout {
        grid-template-columns: 240px minmax(0, 1fr) 260px;
    }

    .blog-col-left { order: 1; }
    .blog-col-main { order: 2; }
    .blog-col-right { order: 3; }

    .blog-sidebar--sticky {
        position: sticky;
        top: calc(var(--site-nav-height) + 1rem);
    }
}

@media (min-width: 768px) {
    .article-page.has-toc {
        grid-template-columns: minmax(0, 1fr) 240px;
    }

    .article-toc {
        position: sticky;
        top: calc(var(--site-nav-height, 72px) + 1rem);
        align-self: start;
        max-height: calc(100vh - var(--site-nav-height, 72px) - 2rem);
    }

    .article-toc-card {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - var(--site-nav-height, 72px) - 2rem);
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    }

    .article-toc-nav {
        max-height: none;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }
}
