    .rtl-text {
        direction: rtl;
        text-align: right;
    }


    .rtl-text * {
        direction: rtl;
        text-align: right;
    }


    .rtl-text pre,
    .rtl-text code,
    .rtl-text pre *,
    .rtl-text code * {
        direction: ltr !important;
        text-align: left !important;
    }


    .ltr-text {
        direction: ltr;
        text-align: left;
    }

    .markdown-body table {
        width: 100%;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-collapse: collapse;
    }

    table{

        width: auto;
}

    .markdown-body th,
    .markdown-body td {
        border: 1px solid #dee2e6;
        padding: 0.75rem;
    }

    .markdown-body th {
        background-color: #f8f9fa;
    }

    .markdown-body table {
        direction: ltr;
    }
:root {
    --primary-blue: #0078ff;
    --light-blue: #e6f2ff;
    --shadow: 0 4px 15px rgba(0, 120, 255, 0.1);
    --border-color: #d1e3ff;
}
hr {
    border: none;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--primary-blue), transparent);
    margin: 50px 0;
    position: relative;
    overflow: visible;
}

hr::after {
    content: "✦";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 0 15px;
    color: var(--primary-blue);
    font-size: 18px;
}


.markdown-body ul, ol {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.markdown-body li {
    background: #ffffff;
    border-inline-start: 4px solid #0078ff;
    margin-bottom: 12px;
    padding: 15px 25px;
    border-radius: 8px;


    display: block;
    position: relative;

    box-shadow: 0 2px 15px rgba(0, 120, 255, 0.08);
    transition: all 0.3s ease;
    color: #333;
    line-height: 1.8;
    text-align: justify;
}

.markdown-body li:hover {

    transform: translateX(calc(var(--dir, 1) * -5px));
    box-shadow: 0 5px 20px rgba(0, 120, 255, 0.15);
    background-color: #f0f7ff;
}


[dir="rtl"] li:hover { --dir: 1; }
[dir="ltr"] li:hover { --dir: -1; }

.markdown-body ol { counter-reset: my-counter; }
.markdown-body ol li { counter-increment: my-counter; position: relative; }

.markdown-body ol li::before {
    content: counter(my-counter);
    background: #0078ff;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: block;
    align-items: center;
    justify-content: center;
    margin-inline-end: 15px;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.markdown-body ul li::before {
    content: "";
    width: 10px;
    height: 10px;
    background: #0078ff;
    border-radius: 50%;
    margin-inline-end: 15px;
    display: inline-block;
    flex-shrink: 0;
}

.markdown-body h1, h2, h3, h4, h5, h6 {
    position: relative;
    display: inline-block;
    margin-bottom: 25px;
    padding: 0 10px;
    color: #1a1a1a;
    z-index: 1;
}

.markdown-body h1::after,.markdown-body h2::after,.markdown-body h3::after,.markdown-body h4::after,.markdown-body h5::after,.markdown-body h6::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 60%;
    background: #0078ff;
    opacity: 0.15;
    z-index: -1;


    clip-path: polygon(0% 15%, 15% 0%, 85% 10%, 100% 5%, 95% 80%, 80% 100%, 20% 90%, 0% 95%);


    filter: blur(2px);
    transition: all 0.4s ease;
}


.markdown-body h1:hover::after,.markdown-body h2:hover::after,.markdown-body h3:hover::after {
    opacity: 0.25;
    transform: scaleX(1.05) skewX(-2deg);
}


.markdown-body blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background: linear-gradient(to var(--gradient-dir, left), rgba(0, 120, 255, 0.05), transparent);
    border-inline-start: 5px solid #0078ff;
    border-radius: 8px;
    position: relative;
    font-style: italic;
    color: #444;
    line-height: 1.8;
    box-shadow: 0 4px 15px rgba(0, 120, 255, 0.05);
}


.markdown-body blockquote::before {
    content: "\201C";
    position: absolute;
    top: -10px;
    inset-inline-start: 15px;
    font-size: 60px;
    color: #0078ff;
    opacity: 0.15;
    font-family: serif;
}


[dir="rtl"] .markdown-body blockquote {
    --gradient-dir: left;
}

[dir="ltr"] .markdown-body blockquote {
    --gradient-dir: right;
}


.markdown-body blockquote cite {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    color: #0078ff;
    font-style: normal;
    font-size: 0.9em;
}


.markdown-body blockquote:hover {
    background: linear-gradient(to var(--gradient-dir, left), rgba(0, 120, 255, 0.08), transparent);
    transition: background 0.3s ease;
}


        div.code-toolbar {
            position: relative;
            padding-top: 40px;
            background-color: #2d2d2d;
            border-radius: 8px;
            overflow: hidden;
            margin: 20px 0;
        }


        div.code-toolbar>.toolbar {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 40px;
            background: #1a1a1a !important;
            display: flex !important;
            align-items: center !important;
            padding: 0 15px !important;
            opacity: 1 !important;
            border-bottom: 1px solid #444;
            direction: ltr;
        }

        div.code-toolbar>.toolbar .toolbar-item:nth-child(2) {
            order: 1;
            margin-right: auto;
        }

        div.code-toolbar>.toolbar .toolbar-item:nth-child(1) {
            order: 2;
        }

        div.code-toolbar>.toolbar button {
            background: #333 !important;
            border: 1px solid #555 !important;
            color: #fff !important;
            padding: 4px 12px !important;
            border-radius: 4px !important;
            font-size: 0.75rem !important;
            cursor: pointer;
            transition: background 0.2s;
        }

        div.code-toolbar>.toolbar button:hover {
            background: #444 !important;
            color: #5ab0f0 !important;
            border-color: #5ab0f0 !important;
        }

        div.code-toolbar>.toolbar .toolbar-item span {
            color: #888 !important;
            font-family: monospace;
            font-size: 0.8rem;
            text-transform: uppercase;
        }

        pre[class*="language-"]:hover {
            background: #2d2d2d !important;
        }

        p code,
        li code {
            background-color: rgba(255, 255, 255, 0.1);
            color: #e74c3c !important;
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 0.95em;
            border: 1px solid rgba(255, 255, 255, 0.1);

            direction: ltr !important;
            display: inline-block !important;
            unicode-bidi: embed;

            margin: 0 2px;
            vertical-align: middle;
        }

        @media (max-width: 768px) {
            table {
                display: block;
                width: 100%;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
        }

        @media (min-width: 769px) {
            table {
                display: table;
                width: 100%;
                table-layout: auto;
            }
        }

        table {
            border-collapse: collapse;
            margin: 1.5rem 0;
        }

        table th,
        table td {
            border: 1px solid #444;
            padding: 12px;
            text-align: center;
        }

        table th {
            background-color: rgba(255, 255, 255, 0.1);
            color: #5ab0f0;
        }


        .katex,
        .katex-display,
        .katex-html,
        .katex-display>.katex {
            direction: ltr !important;
            unicode-bidi: bidi-override !important;
            display: inline-block;
            text-align: left;
        }

        .katex-display {
            display: flex !important;
            justify-content: center;
            align-items: center;
            margin: 1.5em 0 !important;
            width: 100%;
        }

        span.katex {
            padding: 0 4px !important;
            white-space: nowrap;
        }

        .katex {
            font-size: 1.1em;
            line-height: 1.2;
        }

        .katex .base {
            direction: ltr !important;
            unicode-bidi: isolate !important;
        }

        article table {
            width: 100% !important;
            min-width: 100%;
            display: table;
            border-collapse: collapse;
            margin: 1rem 0;
        }

        @media (max-width: 768px) {

            article {
                overflow-x: hidden;
            }

            article table {
                display: block;
                overflow-x: auto;
                width: 100%;
                -webkit-overflow-scrolling: touch;
            }

            article table th,
            article table td {
                min-width: 150px;
                width: 33%;
                text-align: center;
            }
        }
    .author-thank-card {
        background: rgba(255, 255, 255, 0.75);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(0, 120, 255, 0.12);
        padding: 22px 25px;
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 120, 255, 0.04);
        position: relative;
        max-width: 400px;
        margin: 40px auto 20px auto !important;

        animation: floatingCard 4s ease-in-out infinite;
        transition: all 0.3s ease;
    }

    .author-thank-card:hover {
        border-color: rgba(0, 120, 255, 0.35);
        box-shadow: 0 12px 35px rgba(0, 120, 255, 0.12);
    }

    .avatar-wrapper {
        position: relative;
        width: 75px;
        height: 75px;
        margin: 0 auto 12px auto;
    }

    .avatar-wrapper::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: rgba(0, 120, 255, 0.2);
        z-index: -1;
        animation: pulseGlow 2s ease-out infinite;
    }

    .avatar-wrapper .avatar {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border: 3px solid #ffffff;
        box-shadow: 0 4px 15px rgba(0, 120, 255, 0.1);
    }

    .author-name {
        display: block;
        font-size: 1.05rem;
        font-weight: 700;
        color: #1a1a1a;
        margin-bottom: 6px;
    }

    .thank-text {
        font-size: 0.9rem;
        color: #555;
        font-style: italic;
        line-height: 1.6;
        margin: 0;
    }


    @keyframes floatingCard {
        0% {
            transform: translateY(0px);
        }

        50% {
            transform: translateY(-6px);
        }

        100% {
            transform: translateY(0px);
        }
    }

    @keyframes pulseGlow {
        0% {
            transform: scale(1);
            opacity: 1;
        }

        100% {
            transform: scale(1.25);
            opacity: 0;
        }
    }

    /* تنظیمات پایه پاراگراف برای خوانایی فوق‌العاده */
.markdown-body p {
    font-size: 1.1rem; /* اندازه کاملاً استاندارد برای صفحات نمایش (حدود 17px تا 18px) */
    line-height: 1.85; /* فاصله خطوط ایده‌آل برای جلوگیری از خستگی چشم */
    color: #2d3748; /* یک خاکستری خیلی تیره و نرم (بسیار خواناتر از مشکی مطلق) */
    margin-bottom: 24px; /* فضای تنفس عالی بین پاراگراف‌ها */
    text-align: justify; /* مرتب شدن لبه‌های متن */
    text-justify: inter-word;
    font-weight: 400;
    letter-spacing: var(--p-spacing, normal);
}

/* افکت ظریف و مدرن برای اولین پاراگراف نوشته (انتخابی) */
.markdown-body p:first-of-type {
    font-size: 1.15rem;
    color: #1a202c;
    position: relative;
}

/* هایلایت کردن متون مهم (تگ strong یا b) داخل پاراگراف‌ها با تم آبی */
.markdown-body p strong {
    color: #0078ff;
    font-weight: 700;
    background: rgba(0, 120, 255, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
}

/* انتخابگر هوشمند دو زبانه */
/* تنظیمات اختصاصی برای متن‌های فارسی */
[dir="rtl"] .markdown-body p {
    word-spacing: 0.5px; /* کمک به روانی خوانش فونت‌های فارسی */
    --p-spacing: normal;
}

/* تنظیمات اختصاصی برای متن‌های انگلیسی */
[dir="ltr"] .markdown-body p {
    word-spacing: normal;
    --p-spacing: 0.3px; /* بازتر کردن جزیی حروف انگلیسی برای مدرن‌تر شدن ظاهر */
}
