.article-hero {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, rgba(15, 23, 42, .6), rgba(30, 58, 95, .5)), url('/assets/imgs/bg.webp') center/cover no-repeat;
    overflow: hidden;
}

.article-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 780px;
    padding: 52px 24px;
}

.article-hero-tag {
    display: inline-block;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .15);
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 13px;
    color: #93c5fd;
    font-weight: 700;
    margin-bottom: 16px;
}

.article-hero h1 {
    font-size: clamp(24px, 3.4vw, 38px);
    font-weight: 900;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 14px;
}

.article-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, .6);
    font-weight: 500;
    flex-wrap: wrap;
}

.article-hero-meta i {
    margin-left: 5px;
}

.article-layout {
    max-width: 1160px;
    margin: 0 auto;
    padding: 36px 24px 80px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 44px;
    align-items: start;
}

.article-main {
    min-width: 0;
}

.article-featured-img {
    width: 100%;
    border-radius: 14px;
    margin-bottom: 28px;
    aspect-ratio: 16/9;
    object-fit: cover;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
}

.article-featured-img-placeholder {
    width: 100%;
    border-radius: 14px;
    margin-bottom: 28px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.article-featured-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body {
    font-size: 16px;
    color: #334155;
    line-height: 1.9;
}

.article-body h2 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 38px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    scroll-margin-top: 100px;
}

.article-body h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 28px;
    margin-bottom: 10px;
}

.article-body h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-top: 22px;
    margin-bottom: 8px;
}

.article-body h5 {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-top: 18px;
    margin-bottom: 6px;
}

.article-body h6 {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-top: 14px;
    margin-bottom: 6px;
}

.article-body p {
    margin-bottom: 16px;
}

.article-body ul, .article-body ol {
    margin-bottom: 16px;
    padding-right: 20px;
}

.article-body li {
    margin-bottom: 6px;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}

.article-body th {
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    padding: 12px 16px;
    text-align: right;
    font-size: 13px;
}

.article-body td {
    padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.article-body tr:nth-child(even) td {
    background: #f8fafc;
}

.article-body tr:last-child td {
    border-bottom: 0;
}

.article-body blockquote {
    border-right: 4px solid #2563eb;
    padding: 16px 22px;
    margin: 20px 0;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 0 12px 12px 0;
    color: #475569;
    font-style: italic;
    font-size: 15px;
}

.article-body img {
    max-width: 100%;
    border-radius: 10px;
    margin: 20px 0;
}

.article-body a {
    color: #2563eb;
    text-decoration: underline;
}

.article-share {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid #e2e8f0;
}

.article-share-label {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin-left: 8px;
}

.article-share a {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 15px;
}

.article-share a:hover {
    background: #2563eb;
    color: #fff;
    transform: translateY(-2px);
}

.article-sidebar {
    position: sticky;
    top: 90px;
}

.toc-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 14px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    background: linear-gradient(135deg, #f8fafc, #fff);
    border-bottom: 1px solid #e2e8f0;
}

.toc-header .toc-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.toc-header .toc-count {
    margin-right: auto;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 20px;
}

.toc-list {
    list-style: none;
    padding: 6px 0;
    margin: 0;
}

.toc-list li {
    margin: 0;
    display: flex;
    align-items: stretch;
}

.toc-list .toc-num {
    width: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    transition: color 0.15s;
}

.toc-list a {
    flex: 1;
    display: block;
    padding: 8px 0 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    border-right: 3px solid transparent;
    transition: all 0.15s;
    line-height: 1.5;
}

.toc-list li.has-sub a {
    font-weight: 600;
}

.toc-list a:hover {
    color: #2563eb;
    border-right-color: #bfdbfe;
}

.toc-list a.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    font-weight: 700;
    border-right-color: #2563eb;
}

.toc-list a.active+.toc-num,
.toc-list li:has(a.active) .toc-num {
    color: #2563eb;
}

.toc-progress {
    height: 3px;
    background: #e2e8f0;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

.toc-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    width: 0%;
    transition: width 0.15s ease;
    border-radius: 0 2px 2px 0;
}

.sidebar-related {
    margin-top: 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
}

.sidebar-related-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 14px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    background: linear-gradient(135deg, #f8fafc, #fff);
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-related-header .rel-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.sidebar-related-items {
    padding: 4px 0;
}

.sidebar-related-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid #f8fafc;
}

.sidebar-related-item:last-child {
    border-bottom: 0;
}

.sidebar-related-item:hover {
    background: #f8fafc;
}

.sidebar-related-item:hover .title {
    color: #2563eb;
}

.sidebar-related-thumb {
    width: 72px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-related-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sidebar-related-info .title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.sidebar-related-info .meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    font-size: 11px;
    color: #94a3b8;
}

.sidebar-related-info .meta i {
    font-size: 10px;
}

@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .article-sidebar {
        position: static;
        order: -1;
    }

    .toc-list {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px 12px;
    }

    .toc-list li {
        display: inline-flex;
        align-items: center;
    }

    .toc-list .toc-num {
        display: none;
    }

    .toc-list a {
        border-right: 0;
        padding: 5px 10px;
        background: #f8fafc;
        border-radius: 6px;
        font-size: 12px;
    }

    .toc-list a.active {
        background: #dbeafe;
        border-right: 0;
    }

    .sidebar-related {
        display: none;
    }

    .toc-progress {
        display: none;
    }
}

@media (max-width: 640px) {
    .article-layout {
        padding: 20px 14px 60px;
    }

    .article-body {
        font-size: 15px;
    }

    .article-body table {
        font-size: 13px;
    }

    .article-body th, .article-body td {
        padding: 8px 10px;
    }
}