#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--blue);
    z-index: 9999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

.toc-mobile-wrap {
    display: none;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    background: var(--paper);
}

.toc-mobile-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--page);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    text-align: start;
}

.toc-mobile-btn .toc-chevron {
    margin-inline-start: auto;
    transition: transform 0.25s ease;
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

.toc-mobile-btn[aria-expanded="true"] .toc-chevron {
    transform: rotate(180deg);
}

.toc-mobile-nav {
    padding: 8px 0 12px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.toc-mobile-nav a {
    display: block;
    padding: 6px 16px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    line-height: 1.45;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-mobile-nav a:hover,
.toc-mobile-nav a.toc-active {
    color: var(--primary-color, #3b82f6);
    background: #eff6ff;
}

.toc-mobile-nav a.toc-h3 {
    padding-inline-start: 30px;
    font-size: 13.5px;
}

main.container {
    width: 100%;
    box-sizing: border-box;
}

.post-layout {
    display: block;
    width: var(--wrap);
    margin: 1.5rem auto 3rem;
    box-sizing: border-box;
}

.post-main {
    width: 100%;
    max-width: 820px;
    margin-inline: auto;
    box-sizing: border-box;
}

.post-sidebar {
    display: none;
    position: fixed;
    top: 118px;
    width: 220px;
    max-height: calc(100vh - 138px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #e2e8f0) transparent;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.post-sidebar.is-parked {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.post-sidebar::-webkit-scrollbar {
    width: 4px;
}

.post-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.post-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color, #e2e8f0);
    border-radius: 2px;
}

.toc-wrap {
    background: #fff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 18px 0 14px;
    overflow: hidden;
}

.toc-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #64748b);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 8px;
}

.toc-nav a {
    display: block;
    padding: 5px 18px;
    font-size: 13px;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    line-height: 1.45;
    border-inline-start: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toc-nav a:hover {
    color: var(--primary-color, #3b82f6);
    background: #f8fafc;
}

.toc-nav a.toc-active {
    color: var(--primary-color, #3b82f6);
    border-inline-start-color: var(--primary-color, #3b82f6);
    background: #eff6ff;
    font-weight: 600;
}

.toc-nav a.toc-h3 {
    padding-inline-start: 32px;
    font-size: 12.5px;
}

.article-container {
    width: 100%;
    box-sizing: border-box;
    padding-bottom: 32px;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.article-container pre,
.article-container code,
.article-container kbd {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

.article-header {
    margin-bottom: 28px;
    padding-bottom: 8px;
    border-bottom: none;
    position: relative;
}

.article-header::before {
    content: "";
    position: absolute;
    top: -6px;
    inset-inline: -12px;
    bottom: 0;
    background: radial-gradient(ellipse at 20% 50%,
            rgba(59, 130, 246, 0.1) 0%,
            rgba(45, 212, 191, 0.07) 45%,
            transparent 70%);
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
}

.article-header:hover::before {
    opacity: 1;
}

.article-header h1 {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--navy);
    word-break: break-word;
}

.article-content {
    font-size: 16.5px;
    line-height: 1.85;
    color: #334155;
    overflow-x: auto;
    overflow-wrap: break-word;
    word-break: break-word;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    scroll-margin-top: 80px;
}

.article-content h1 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 2rem 0 0.7rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #dbeafe;
    background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #2dd4bf));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary-color, #3b82f6);
}

[dir="rtl"] .article-content h1 {
    background: linear-gradient(135deg, var(--accent-color, #2dd4bf), var(--primary-color, #3b82f6));
    color: var(--primary-color, #3b82f6);
    border-bottom: 2px solid #dbeafe;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.article-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 2rem 0 0.6rem;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: #1e293b;
    color: #1e293b;
    border: none;
    padding: 0;
}

.article-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 1.5rem 0 0.5rem;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: #1e293b;
    color: #1e293b;
}

.article-content h4,
.article-content h5,
.article-content h6 {
    font-weight: 700;
    line-height: 1.4;
    margin: 1.2rem 0 0.4rem;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: #1e293b;
    color: #1e293b;
}

.article-content h4 {
    font-size: 1rem;
}

.article-content h5 {
    font-size: 0.95rem;
}

.article-content h6 {
    font-size: 0.9rem;
}

.article-content p {
    margin-bottom: 1.15rem;
    text-align: justify;
}

[dir="rtl"] .article-content p {
    text-align: justify;
}

.article-content strong {
    color: #1e293b;
}

.article-content a {
    color: var(--primary-color, #3b82f6);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.article-content a:hover {
    color: var(--accent-color, #2dd4bf);
}

.article-content ul,
.article-content ol {
    padding-inline-start: 1.5rem;
    margin-bottom: 1.15rem;
}

.article-content li {
    margin-bottom: 0.35rem;
    line-height: 1.75;
    color: #334155;
}

.article-content blockquote {
    border-inline-start: 4px solid var(--accent-color, #2dd4bf);
    background: rgba(45, 212, 191, 0.06);
    padding: 14px 20px;
    margin: 1.5rem 0;
    border-radius: 0 10px 10px 0;
    color: var(--text-muted, #64748b);
    font-style: italic;
    font-size: 16px;
}

[dir="rtl"] .article-content blockquote {
    border-radius: 10px 0 0 10px;
}

.article-content blockquote p {
    margin-bottom: 0;
    text-align: justify;
}

.article-content hr {
    border: none;
    border-top: 2px solid var(--border-color, #e2e8f0);
    margin: 2rem 0;
}

.article-content pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 18px 22px;
    font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.65;
    max-width: 100%;
    direction: ltr;
    text-align: left;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    border: none;
}

.article-content code {
    background: #eff6ff;
    color: var(--primary-color, #3b82f6);
    border-radius: 5px;
    padding: 2px 6px;
    font-size: 13px;
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    border: 1px solid #dbeafe;
    direction: ltr;
    unicode-bidi: embed;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.2rem 0;
    display: block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.article-content th {
    background: #eff6ff;
    color: var(--primary-color, #3b82f6);
    font-weight: 700;
    padding: 10px 14px;
    text-align: start;
    border-bottom: 2px solid #dbeafe;
}

.article-content td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    color: #334155;
}

.article-content tr:last-child td {
    border-bottom: none;
}

.article-content tr:nth-child(even) td {
    background: #f8fafc;
}

[data-theme="dark"] .article-content {
    color: var(--ink);
}

[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .article-content h4,
[data-theme="dark"] .article-content h5,
[data-theme="dark"] .article-content h6 {
    color: var(--ink);
    -webkit-text-fill-color: var(--ink);
}

[data-theme="dark"] .article-content strong,
[data-theme="dark"] .article-content li,
[data-theme="dark"] .article-content td {
    color: var(--ink);
}

[data-theme="dark"] .article-content blockquote {
    color: var(--muted);
    background: rgba(142, 192, 234, 0.08);
}

[data-theme="dark"] .article-content h1,
[data-theme="dark"] [dir="rtl"] .article-content h1 {
    border-bottom-color: #334155;
}

[data-theme="dark"] .article-content :not(pre) > code {
    background: #1e293b;
    border-color: #334155;
    color: var(--navy);
}

[data-theme="dark"] .article-content pre code {
    background: none;
    border: none;
    color: inherit;
    padding: 0;
}

[data-theme="dark"] .article-content th {
    background: #1e293b;
}

[data-theme="dark"] .article-content tr:nth-child(even) td {
    background: #1e293b;
}

[data-theme="dark"] .article-author-end strong {
    color: var(--ink);
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    margin: 0.4rem 0 0;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    color: var(--text-muted);
}

.article-meta time {
    font-weight: 500;
}

.article-meta-sep {
    color: var(--line);
    user-select: none;
}

.post-byline {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin: 0.85rem 0 0;
}

.byline-avatar {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.byline-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    min-width: 0;
}

.byline-end {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-inline-start: auto;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-muted);
    white-space: nowrap;
}

.byline-sep {
    color: var(--line);
    user-select: none;
    font-weight: 400;
    opacity: 0.7;
}

.byline-date {
    font-weight: 500;
}

.category-pill {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary-color, #3b82f6);
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 1px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    -webkit-text-fill-color: var(--primary-color, #3b82f6);
    transition: background 0.2s, color 0.2s;
}

.category-pill:hover {
    background: var(--primary-color, #3b82f6);
    color: #fff;
    -webkit-text-fill-color: #fff;
    border-color: transparent;
}

.share-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.share-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-inline-end: 4px;
}

.share-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #64748b);
    -webkit-text-fill-color: var(--text-muted, #64748b);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #2dd4bf));
    color: #fff;
    -webkit-text-fill-color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.article-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.kw-tag {
    display: inline-block;
    background: #f8fafc;
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-muted, #64748b);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 500;
}

.cover-wrap {
    margin-bottom: 28px;
}

.article-cover-img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.1);
}

.video-embed-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 28px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
}

.video-embed-wrap iframe {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 14px;
}

.article-author-end {
    text-align: end;
    font-size: 13px;
    color: var(--text-muted, #64748b);
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    font-style: italic;
}

.article-author-end strong {
    color: #1e293b;
    font-weight: 700;
    font-style: normal;
}

.post-main h4,
.comments-section>h3,
.comment-form-wrap>h4 {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    -webkit-text-fill-color: #1e293b;
    background: none;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    position: relative;
}

.post-main h4::after,
.comments-section>h3::after,
.comment-form-wrap>h4::after {
    content: "";
    position: absolute;
    bottom: -2px;
    inset-inline-start: 0;
    width: 44px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color, #3b82f6), var(--accent-color, #2dd4bf));
    border-radius: 2px;
}

.post-nav {
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.post-nav-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #1e293b;
    padding: 16px 18px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    min-width: 0;
}

.post-nav-btn:hover {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: #1e293b;
}

.post-nav-btn i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #2dd4bf));
    color: #fff;
    -webkit-text-fill-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

[dir="rtl"] .post-nav-btn i {
    transform: scaleX(-1);
}

.post-nav-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.post-nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

.post-nav-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-nav-next {
    justify-content: flex-end;
}

[dir="rtl"] .post-nav-next {
    justify-content: flex-start;
}

.post-nav-spacer {
    display: none;
}

.related-posts {
    width: 100%;
    box-sizing: border-box;
    margin-top: 40px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.related-post-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.related-post-card:hover {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.11);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.related-post-thumb img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.related-post-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px 14px;
    flex: 1;
}

.related-post-date {
    font-size: 11px;
    color: var(--text-muted, #64748b);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.related-post-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comments-section {
    width: 100%;
    box-sizing: border-box;
    margin-top: 40px;
}

.comment-card {
    background: #fff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-card:hover {
    border-color: var(--accent-color, #2dd4bf);
    box-shadow: 0 4px 14px rgba(45, 212, 191, 0.09);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #2dd4bf));
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.22);
}

.comment-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.comment-author {
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
}

.comment-date {
    color: var(--text-muted, #64748b);
    font-size: 11px;
    display: block;
}

.comment-body {
    color: #475569;
    font-size: 14px;
    line-height: 1.75;
    margin: 0 0 10px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.comment-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #f8fafc;
}

.btn-delete-request {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #ea580c;
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-delete-request:hover {
    background: #ffedd5;
}

.comment-form-wrap {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 2px solid var(--border-color, #e2e8f0);
}

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

.form-group {
    margin-bottom: 14px;
}

.comment-form-wrap label {
    display: block;
    color: #1e293b;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
}

.comment-form-wrap .form-control {
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    background: #fff;
    color: #1e293b;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-form-wrap .form-control:focus {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.comment-form-wrap textarea.form-control {
    min-height: 110px;
    resize: vertical;
}

.comment-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #2dd4bf));
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 11px 26px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.28);
    transition: filter 0.2s, transform 0.2s;
    cursor: pointer;
    display: inline-block;
}

.btn-gradient:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    color: #fff;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 2px solid var(--border-color, #e2e8f0);
    color: var(--text-muted, #64748b);
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
    border-color: var(--primary-color, #3b82f6);
    color: var(--primary-color, #3b82f6);
}

.dr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
}

.dr-modal {
    background: #fff;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 1.75rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.13);
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.dr-modal h4 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    -webkit-text-fill-color: #1e293b;
    background: none;
    padding-bottom: 0;
    border-bottom: none;
}

.dr-modal h4::after {
    display: none;
}

.dr-info {
    font-size: 13px;
    color: var(--text-muted, #64748b);
    margin-bottom: 18px;
    line-height: 1.6;
}

.dr-type-options {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 4px;
}

.dr-type-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    cursor: pointer;
    padding: 9px 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
}

.dr-type-label:hover {
    border-color: var(--primary-color, #3b82f6);
    background: #eff6ff;
}

.dr-type-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary-color, #3b82f6);
}

.dr-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.dr-actions .btn {
    background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #2dd4bf));
    color: #fff;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

.dr-actions .btn:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    color: #fff;
}

.dr-actions .btn-secondary {
    background: #f8fafc;
    color: var(--text-muted, #64748b);
    border: 1px solid var(--border-color, #e2e8f0);
}

.dr-actions .btn-secondary:hover {
    background: var(--border-color, #e2e8f0);
    filter: none;
    transform: none;
    color: #1e293b;
}

.dr-modal .form-group {
    margin-bottom: 12px;
}

.dr-modal label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

.dr-modal .form-control {
    width: 100%;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 10px 13px;
    font-size: 13.5px;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dr-modal .form-control:focus {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.dr-modal textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.question-modal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 8px;
    padding: 9px 13px;
    font-size: 13px;
    margin-bottom: 12px;
}

.back-to-top {
    position: fixed;
    bottom: 28px;
    inset-inline-end: 28px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #2dd4bf));
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
    transition: transform 0.2s, opacity 0.2s;
    z-index: 500;
    opacity: 1;
}

.back-to-top.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

.back-to-top:hover {
    transform: translateY(-2px);
}

[dir="rtl"] .post-nav {
    direction: rtl;
}

[dir="rtl"] .toc-mobile-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .toc-mobile-btn .toc-chevron {
    margin-inline-start: 0;
    margin-inline-end: auto;
}

@media (min-width: 1380px) {
    .toc-mobile-wrap {
        display: none;
    }

    .post-sidebar {
        display: block;
        inset-inline-start: max(12px, calc(50vw - 410px - 24px - 220px));
    }
}

@media (max-width: 1379px) {
    .toc-mobile-wrap {
        display: block;
    }
}

@media (max-width: 900px) {
    .post-nav {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .post-nav-next {
        justify-content: flex-start;
    }

    [dir="rtl"] .post-nav-next {
        justify-content: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }


    [dir="rtl"] .article-header h1 {
        font-weight: 900;
    }
}

@media (max-width: 768px) {
    .article-container {
        padding-bottom: 20px;
    }

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

    .article-header h1 {
        font-size: clamp(1.35rem, 5.5vw, 1.85rem);
    }

    [dir="rtl"] .article-header h1 {
        font-weight: 900;
    }

    .post-byline {
        gap: 0.75rem;
        margin-top: 0.7rem;
    }

    .article-content {
        font-size: 15px;
        line-height: 1.78;
    }

    .article-content h1 {
        font-size: 1.35rem;
    }

    .article-content h2 {
        font-size: 1.1rem;
    }

    .article-content h3 {
        font-size: 1rem;
    }

    .article-content h4 {
        font-size: 0.95rem;
    }

    .article-content h5 {
        font-size: 0.9rem;
    }

    .article-content h6 {
        font-size: 0.85rem;
    }

    .article-content pre {
        padding: 13px 15px;
        font-size: 12px;
    }

    .article-cover-img {
        max-height: 220px;
        border-radius: 10px;
    }

    .video-embed-wrap {
        border-radius: 10px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .comment-card {
        padding: 12px 14px;
    }

    .back-to-top {
        bottom: 20px;
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .article-header h1 {
        font-size: clamp(1.25rem, 6vw, 2rem);
    }

    .byline-end {
        font-size: 0.75rem;
    }

    .article-content {
        font-size: 14.5px;
        line-height: 1.75;
    }

    .article-content h1 {
        font-size: 1.2rem;
    }

    .article-content h2 {
        font-size: 1.05rem;
    }

    .article-content h3 {
        font-size: 0.95rem;
    }

    .article-content h4 {
        font-size: 0.9rem;
    }

    .article-content h5,
    .article-content h6 {
        font-size: 0.85rem;
    }

    .article-content img {
        border-radius: 7px;
    }

    .article-cover-img {
        max-height: 190px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .comment-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-gradient,
    .btn-ghost {
        text-align: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .dr-modal {
        padding: 1.1rem;
    }

    .dr-actions {
        flex-direction: column;
    }

    .dr-actions .btn {
        text-align: center;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .back-to-top {
        bottom: 16px;
    }
}

@media (min-width: 1440px) {
    .post-main {
        max-width: 880px;
    }

    .article-content {
        font-size: 18.5px;
    }

    .post-sidebar {
        inset-inline-start: max(12px, calc(50vw - 440px - 24px - 220px));
    }
}

@media (min-width: 1920px) {
    .post-main {
        max-width: 1020px;
    }

    .article-content {
        font-size: 20px;
    }

    .post-sidebar {
        width: 260px;
        inset-inline-start: max(12px, calc(50vw - 510px - 24px - 260px));
    }
}

@media (min-width: 2560px) {
    .post-main {
        max-width: 1200px;
    }

    .article-content {
        font-size: 22px;
    }

    .post-sidebar {
        width: 300px;
        inset-inline-start: max(12px, calc(50vw - 600px - 24px - 300px));
    }
}