.lib-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: stretch;
    padding-bottom: 50px;
}

.lib-article-main {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
}

.lib-sidebar.detail-sidebar {
    width: 100%;
    min-width: 0;
}

@media (min-width: 992px) {
    .lib-detail-layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .lib-sidebar.detail-sidebar {
        flex: 0 0 360px;
        width: 360px;
        max-width: 360px;
    }
}

.article-body h2,
.article-body h3 {
    scroll-margin-top: 90px;
}

.article-body ul,
.article-body ol {
    margin: 16px 0;
    padding-left: 22px;
}

.article-body li {
    margin: 6px 0;
    padding: 5px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    list-style-position: inside;
}

.article-body ol {
    padding-left: 0;
    counter-reset: article-ol-counter;
}

.article-body ol > li {
    list-style: none;
    position: relative;
    padding: 10px 14px 10px 44px;
    min-height: 42px;
}

.article-body ol > li::before {
    content: counter(article-ol-counter);
    counter-increment: article-ol-counter;
    position: absolute;
    left: 12px;
    top: 10px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #2c7fb8 0%, #2563eb 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
}

/* Article Table Styling */
.article-body table {
    width: 100%;
    margin: 24px 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #dbe7f3;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-body table thead tr th,
.article-body table thead tr td {
    background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
    color: #0f2942;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 12px 14px;
    border-bottom: 1px solid #dbe7f3;
    white-space: nowrap;
}

.article-body table tbody tr td,
.article-body table tbody tr th {
    padding: 11px 14px;
    color: #1f2937;
    font-size: 0.92rem;
    border-bottom: 1px solid #edf2f7;
    vertical-align: top;
    background: #ffffff;
}

.article-body table tbody tr:nth-child(even) td,
.article-body table tbody tr:nth-child(even) th {
    background: #fbfdff;
}

.article-body table tbody tr:hover td,
.article-body table tbody tr:hover th {
    background: #f3f8ff;
}

.article-body table tr:last-child td,
.article-body table tr:last-child th {
    border-bottom: 0;
}

.article-body table th,
.article-body table td {
    min-width: 120px;
}

/* Breadcrumb Styling */
.breadcrumb-mini {
    margin-bottom: 24px;
    color: #64748b;
    font-size: 0.875rem;
}

.breadcrumb-mini a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-mini a:hover {
    color: #1976d2;
}

.breadcrumb-mini .sep {
    margin: 0 8px;
    color: #cbd5e1;
}

.lib-full-article {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

/* Article Header Styling */
.article-header {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 16px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.article-body h2,
.article-body h3 {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.article-body h2 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.article-body h3 {
    font-size: 1.38rem;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.8rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 0.85rem;
}

.meta-item svg {
    color: #94a3b8;
}

.article-featured-img {
    margin-bottom: 32px;
    width: 100%;
    max-width: 100%;
}

.article-featured-img picture {
    display: block;
    width: 100%;
    max-width: 100%;
}

.article-featured-img img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
}

@media (max-width: 768px) {
    .lib-page-wrapper .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .breadcrumb-mini {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin-bottom: 14px;
        padding-bottom: 2px;
    }

    .breadcrumb-mini::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .breadcrumb-mini a,
    .breadcrumb-mini .sep,
    .breadcrumb-mini span {
        flex: 0 0 auto;
    }

    .lib-full-article {
        padding: 14px;
        border-radius: 16px;
    }

    .article-header {
        margin-bottom: 14px;
        padding-bottom: 14px;
    }

    .article-header h1 {
        font-size: clamp(2rem, 7.8vw, 2.45rem);
        line-height: 1.1;
        margin-bottom: 10px;
        letter-spacing: -0.03em;
    }

    .article-meta {
        gap: 8px 14px;
        margin-top: 0;
    }

    .meta-item {
        font-size: 0.92rem;
        gap: 5px;
    }

    .article-featured-img {
        margin-bottom: 18px;
    }

    .article-featured-img img {
        border-radius: 12px;
    }

    .lib-comments {
        margin-top: 26px;
    }

    .lib-comments h3 {
        font-size: 1.22rem;
        margin-bottom: 14px;
    }

    .lib-comment-list {
        gap: 12px;
    }

    .comment-item {
        padding: 14px;
        border-radius: 12px;
    }

    .lib-comment-form {
        margin-top: 18px;
        padding: 16px 14px;
        border-radius: 14px;
    }

    .lib-comment-form h4 {
        font-size: 1.15rem;
        margin-bottom: 14px;
    }

    .lib-comment-form form {
        gap: 12px;
    }

    .lib-comment-form .form-row {
        gap: 12px;
    }

    .lib-comment-form input,
    .lib-comment-form textarea {
        padding: 11px 14px;
        border-radius: 10px;
        font-size: 0.94rem;
    }

    .lib-comment-form textarea {
        min-height: 120px;
    }

    .lib-comment-form button {
        padding: 11px 22px;
    }
}

/* Comments Section */
.lib-comments {
    margin-top: 48px;
}

.lib-comments h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
}

.lib-comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
    transition: transform 0.2s;
}

.comment-item:hover {
    transform: translateY(-2px);
}

.c-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 2px solid #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.c-content {
    flex: 1;
}

.c-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.c-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.c-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

.c-text {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.6;
    margin: 0;
}

/* Comment Form Styling */
.lib-comment-form {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 24px;
    margin-top: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.lib-comment-form h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 20px;
}

.lib-comment-form form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lib-comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .lib-comment-form .form-row {
        grid-template-columns: 1fr;
    }
}

.lib-comment-form input,
.lib-comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.lib-comment-form input:focus,
.lib-comment-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.lib-comment-form button {
    align-self: flex-start;
    padding: 12px 32px;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.lib-comment-form button:hover {
    background: #0077b3;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-msg {
    background: #fff;
    color: #333;
    padding: 14px 20px;
    border-radius: 8px;
    border-left: 4px solid #52c41a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
    pointer-events: auto;
}

.toast-msg.success {
    border-left-color: #52c41a;
}

.toast-msg.error {
    border-left-color: #ff4d4f;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}
