/* Font Display Optimization - Ensure text is always visible */
/* All @font-face declarations should use font-display: swap or optional */
/* This ensures text remains visible during font loading */
@font-face {
    font-family: 'font-display-swap';
    src: local('Arial');
    font-display: swap;
}

/* Optimize font loading for better text visibility */
/* Note: For external fonts (like Font Awesome from CDN), 
   the font-display property must be set in their @font-face rules.
   Consider self-hosting fonts or using a CDN that supports font-display: swap */

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
        "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif;
    color: #111;
    line-height: 1.5;
    font-size: 16px;
    overflow-wrap: break-word;
}

img {
    max-width: 100%;
    height: auto;
}

.inline-svg-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.12em;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout */
.site-container {
    display: grid;
    grid-template-columns: 180px 1fr;
    /* Sidebar width + Content */
    gap: 60px;
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
}

.main-content {
    min-width: 0;
    width: 100%;
}

.limiter {
    min-width: 0;
    width: 100%;
}

/* Mobile Sidebar Toggle (Public) */
.site-container .mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    color: #111;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-container .mobile-menu-btn:hover {
    background-color: #f5f5f5;
}

.site-container .mobile-menu-btn i {
    font-size: 18px;
}

.site-container .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.site-container .sidebar-overlay.overlay-visible {
    display: block;
    opacity: 1;
}

.site-container .sidebar-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.site-container .sidebar-close-btn {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #111;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 18px;
}

.site-container .sidebar-close-btn:hover {
    background-color: #f5f5f5;
}


/* Sidebar */
.sidebar-header h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

/* Navbar Search */
.navbar-search {
    margin-bottom: 1rem;
}

.search-form {
    display: flex;
}

.search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #c04000;
}

.search-input::placeholder {
    color: #999;
}

.sidebar-nav li {
    margin-top: 0.5rem;
    /* margin-bottom: 0.5rem; */
}

.sidebar-nav a {
    color: #555;
}

.sidebar-nav a:hover {
    color: #000;
    text-decoration: underline;
}

.sidebar-nav a.current {
    color: #c04000;
    font-weight: 700;
}

.social-links,
.sidebar-footer {
    margin-top: 2rem;
    /* display: none; */
    /* Hide for now to match image strictly, or keep if user wants */
}

/* Newsletter Subscription Form */
.newsletter-subscription {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.newsletter-form-group {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.newsletter-email-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.newsletter-email-input:focus {
    outline: none;
    border-color: #c04000;
}

.newsletter-submit-btn {
    padding: 8px 16px;
    background-color: #c04000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
}

.newsletter-submit-btn:hover:not(:disabled) {
    background-color: #a03000;
}

.newsletter-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.newsletter-message {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
    transition: opacity 0.3s ease;
}

.newsletter-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.newsletter-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Tag page subscription form */
.tag-subscription-form {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.tag-subscription-form p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.tag-subscription-form-inline {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.tag-subscription-form-inline .newsletter-email-input {
    flex: 1;
}

/* Inline tag subscription form (small, no background) */
.tag-subscription-inline {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.tag-subscription-form-inline-small {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
}

.newsletter-email-input-small {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    font-family: inherit;
    width: 200px;
    transition: border-color 0.2s;
}

.newsletter-email-input-small:focus {
    outline: none;
    border-color: #c04000;
}

.newsletter-submit-btn-small {
    padding: 4px 10px;
    background-color: #c04000;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.newsletter-submit-btn-small:hover:not(:disabled) {
    background-color: #a03000;
}

.newsletter-submit-btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.footer-content {
    width: 100%;
}

.footer-text {
    color: #666;
    font-size: 0.875rem;
    line-height: 1.5;
    display: block;
}

.footer-text p {
    margin: 0;
    color: inherit;
}

.footer-text a {
    color: #666;
    text-decoration: underline;
}

.footer-text a:hover {
    color: #c04000;
}

/* Article List - Twitter Card Style */
.article-list.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    padding-left: 0;
}

.article-list.timeline::before {
    content: none;
}

.timeline-item {
    position: relative;
    padding: 14px 16px;
    border: 1px solid #e6ecf0;
    border-radius: 16px;
    background-color: #fff;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.timeline-content {
    min-width: 0;
}

.timeline-item:hover {
    background-color: #f7f9f9;
    border-color: #d7dee3;
}

.timeline-marker {
    display: none;
}


/* Timeline header - datetime left, tags right */
.timeline-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-date {
    font-size: 0.85rem;
    color: #c04000;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.timeline-date a {
    color: inherit;
    text-decoration: none;
}

.timeline-date a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.post-title {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f1419;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.article-list.timeline.is-home .post-title {
    font-size: 1.35rem;
}

.article-list.timeline.is-home .post-title a {
    color: #c04000;
}

.post-description {
    color: #0f1419;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 1rem;
    line-height: 1.55;
}



.post-content-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-content-link:hover {
    opacity: 0.8;
}

.post-content {
    color: #0f1419;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 1rem;
    line-height: 1.55;
    margin-top: 6px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 16px 0;
}

.tag {
    display: inline-block;
    background-color: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.timeline-tags .tag {
    background: none;
    border: none;
    padding: 0;
    color: #1d9bf0;
    border-radius: 0;
    font-size: 0.9rem;
}

.timeline-tags .tag:hover {
    background: none;
    color: #1a8cd8;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.tag:hover {
    background-color: #e0e0e0;
    color: #333;
    text-decoration: none;
}

/* Comment Form */
.comment-form {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
}

.comment-form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-form-field {
    flex: 1;
    min-width: 0;
}

.comment-form-input,
.comment-form-textarea,
.comment-captcha-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
}

.comment-form-textarea {
    resize: vertical;
}

.comment-form-captcha {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.comment-form-submit {
    padding: 0.5rem 1.25rem;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.comment-form-cancel {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.article h1,
h2 {
    color: #c04000;
}

.article-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.25rem;
}

.article-header h2 {
    flex: 1;
    margin: 0;
    line-height: 1.25;
}

.article-meta {
    color: #777;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.article-meta-divider {
    color: #bbb;
}

.social-label {
    color: #888;
    font-weight: 600;
}

.social-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    border-radius: 4px;
    color: #666;
}

.social-icon-link:hover {
    color: #333;
    background-color: #f5f5f5;
}

/* Mobile: Article header/meta layout */
@media (max-width: 768px) {
    .article-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-header h2 {
        font-size: 1.6rem;
    }

    .article-meta {
        gap: 0.4rem 0.75rem;
        font-size: 0.875rem;
    }

    .article-meta-divider {
        display: none;
    }

    .share-container {
        flex-basis: 100%;
    }

    .share-button {
        justify-content: flex-start;
    }

    .share-menu {
        right: auto;
        left: 0;
        max-width: 90vw;
    }
}

.article-content {
    display: block;
    unicode-bidi: isolate;
    max-width: 800px;
}

.article-content pre,
.post-content pre {
    background-color: #f6f8fa;
    padding: 16px;
    overflow-x: auto;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
    margin: 16px 0;
}

.article-content pre code,
.post-content pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: inherit;
    color: inherit;
}

.article-content code,
.post-content code {
    word-break: break-word;
}

.article-content > code:not([class*="language-"]),
.post-content > code:not([class*="language-"]),
.article-content :not(pre) > code:not([class*="language-"]),
.post-content :not(pre) > code:not([class*="language-"]) {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    padding: 0.15em 0.35em;
}

.article-content img {
    max-width: 100%;
    height: auto;
}


/* Article Content - Link Styles */

.article-content a,
.post-content a,
.post-description a {
    color: #c04000 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

.article-content a:hover,
.post-content a:hover,
.post-description a:hover {
    color: #a03000 !important;
    text-decoration-thickness: 2px;
}

/* Source Reference (Article) */
.source-reference__quote {
    border: 0 solid #ccc;
    border-left-width: 0.3em;
    margin: 0 0 0.75rem 0.3em;
    padding-left: 0.6em;
}

.source-reference__quote[dir=rtl],
.source-reference [dir=rtl] .source-reference__quote {
    border-width: 0;
    border-right-width: 0.3em;
    margin: 0 0.3em 0.75rem 0;
    padding-left: 0;
    padding-right: 0.6em;
}

.source-reference__links {
    margin-top: 0.75rem;
}

/* Twitter tweet placeholder (loading state) */
.twitter-tweet-placeholder {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.twitter-tweet-placeholder--loading {
    opacity: 0.6;
}

.twitter-tweet-placeholder__loading {
    color: #666;
    font-size: 14px;
}

.twitter-tweet-placeholder__error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.twitter-tweet-placeholder__error p {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.twitter-tweet-placeholder__fallback-link {
    color: #1da1f2;
    text-decoration: none;
    font-size: 14px;
}

.twitter-tweet-placeholder__fallback-link:hover {
    text-decoration: underline;
}

[data-theme="dark"] .twitter-tweet-placeholder__loading {
    color: var(--text-secondary);
}

[data-theme="dark"] .twitter-tweet-placeholder__error {
    color: var(--text-secondary);
}

[data-theme="dark"] .twitter-tweet-placeholder__fallback-link {
    color: var(--accent-color);
}

.twitter-archive-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.twitter-archive-header {
    margin-bottom: 2rem;
}

.twitter-archive-header__eyebrow {
    margin: 0 0 0.5rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #666;
}

.twitter-archive-header__subtitle {
    margin: 0.75rem 0 0;
    color: #666;
}

.twitter-archive-header__meta {
    margin: 0.5rem 0 0;
    color: #666;
    font-size: 0.95rem;
}

.twitter-archive-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.twitter-archive-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
}

.twitter-archive-tab.active {
    background: #111827;
    color: #fff;
}

.twitter-archive-list {
    display: grid;
    gap: 1rem;
}

.twitter-archive-connection-list {
    margin: 0;
    padding-left: 1.5rem;
}

.twitter-archive-connection-item + .twitter-archive-connection-item {
    margin-top: 0.9rem;
}

.twitter-archive-connection-item__account-id {
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.twitter-archive-card {
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.twitter-archive-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    color: #666;
    font-size: 0.92rem;
}

.twitter-archive-card__body p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.twitter-archive-card__body p + p {
    margin-top: 0.9rem;
}

.twitter-archive-card__title {
    font-size: 1.1rem;
    font-weight: 700;
}

.twitter-archive-card__note {
    color: #666;
}

.twitter-archive-card__media {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.twitter-archive-card__media-item {
    overflow: hidden;
    border-radius: 14px;
    background: #f3f4f6;
}

.twitter-archive-card__media-item img,
.twitter-archive-card__media-item video {
    display: block;
    width: 100%;
    height: auto;
}

.twitter-archive-card__media-item--file {
    padding: 0.9rem 1rem;
}

.twitter-archive-card__media-item--file a {
    color: #111827;
    font-weight: 600;
}

.twitter-archive-card__actions {
    margin-top: 1rem;
}

.twitter-archive-card__actions a {
    color: #111827;
    font-weight: 600;
}

.twitter-archive-empty {
    padding: 1.5rem;
    border-radius: 18px;
    background: #f9fafb;
    color: #666;
}

[data-theme="dark"] .twitter-archive-header__eyebrow,
[data-theme="dark"] .twitter-archive-header__meta,
[data-theme="dark"] .twitter-archive-header__subtitle,
[data-theme="dark"] .twitter-archive-card__meta,
[data-theme="dark"] .twitter-archive-card__note,
[data-theme="dark"] .twitter-archive-empty {
    color: var(--text-secondary);
}

[data-theme="dark"] .twitter-archive-tab {
    background: #1f2937;
    color: #d1d5db;
}

[data-theme="dark"] .twitter-archive-tab.active {
    background: #f9fafb;
    color: #111827;
}

[data-theme="dark"] .twitter-archive-card {
    background: #111827;
    border-color: #374151;
    box-shadow: none;
}

[data-theme="dark"] .twitter-archive-connection-item__account-id {
    color: #f9fafb;
}

[data-theme="dark"] .twitter-archive-card__media-item {
    background: #1f2937;
}

[data-theme="dark"] .twitter-archive-card__media-item--file a,
[data-theme="dark"] .twitter-archive-card__actions a {
    color: #f9fafb;
}

@media (max-width: 640px) {
    .twitter-archive-page {
        padding: 2rem 1rem 3rem;
    }

    .twitter-archive-tab {
        width: 100%;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination em,
.pagination span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #555;
    text-decoration: none;
}

.pagination a:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.pagination .current {
    background-color: #c04000;
    color: #fff;
    border-color: #c04000;
    font-style: normal;
}

.pagination .disabled {
    color: #aaa;
    border-color: #eee;
    pointer-events: none;
}

/* Mobile Layout */
@media (max-width: 768px) {
    body {
        font-size: 17px;
    }

    .site-container {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 0 auto;
        width: 100%;
        padding: 3.5rem 16px 24px;
    }

    .site-container .mobile-menu-btn {
        display: flex;
    }

    .site-container .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: #fff;
        border-right: 1px solid #e5e7eb;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        padding: 0 0 16px;
        text-align: left;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .site-container .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .site-container .sidebar-header {
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .site-container .sidebar-close-btn {
        display: flex;
    }

    .sidebar-header h1 {
        font-size: 1.45rem;
        line-height: 1.2;
        margin-bottom: 0.35rem;
    }

    .sidebar-header .site-description {
        font-size: 0.9rem;
        color: #666;
        margin-top: 0.25rem;
    }

    .navbar-search {
        margin-bottom: 0.75rem;
    }

    .sidebar-nav {
        padding: 0.5rem 0;
    }

    .navbar-search {
        padding: 0 1rem;
    }

    .search-input {
        padding: 10px 12px;
        font-size: 0.95rem;
        border-radius: 6px;
    }

    .sidebar-nav ul {
        display: block;
        padding: 0;
    }

    .sidebar-nav li {
        margin-top: 0.25rem;
    }

    .sidebar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
        color: #555;
        text-decoration: none;
        transition: background-color 0.15s, color 0.15s;
    }

    .sidebar-nav .nav-link:hover {
        background-color: #f5f5f5;
        color: #111;
    }

    .social-links {
        margin-top: 0.75rem;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .social-links::-webkit-scrollbar {
        display: none;
    }

    .sidebar-footer {
        margin-top: 1rem;
        border-top: 1px solid #e5e7eb;
        padding: 0.75rem 1rem 0;
    }

    footer {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .main-content {
        width: 100%;
    }

    .limiter {
        width: 100%;
    }

    .newsletter-subscription {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .newsletter-form-group {
        gap: 6px;
    }

    .comment-form {
        padding: 0.75rem;
    }

    .comment-form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .comment-form-captcha {
        flex-wrap: wrap;
        align-items: flex-start;
    }

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

    .comment-form-submit,
    .comment-form-cancel {
        width: 100%;
    }

    .comment {
        margin-left: 0 !important;
        padding-left: 0 !important;
        border-left: none !important;
    }

    .replies {
        margin-left: 0.5rem;
        padding-left: 0.5rem;
        border-left: 2px solid #e0e0e0;
    }

    .reply-form-container {
        margin-left: 0 !important;
    }

    .tag-subscription-inline {
        width: 100%;
    }

    .tag-subscription-form-inline-small {
        flex-wrap: wrap;
        width: 100%;
    }

    .newsletter-email-input-small {
        width: 100%;
    }

    .article-list.timeline {
        gap: 10px;
    }

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

    .timeline-header {
        gap: 6px 10px;
    }

    .timeline-date {
        font-size: 0.85rem;
    }

    .timeline-tags .tag {
        font-size: 0.85rem;
    }

    .post-title {
        font-size: 1.1rem;
    }

    .post-description,
    .post-content {
        font-size: 1rem;
        line-height: 1.6;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .article-content iframe,
    .article-content video,
    .article-content embed,
    .post-content iframe,
    .post-content video,
    .post-content embed {
        max-width: 100%;
    }

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

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

}

/* Small mobile devices */
@media (max-width: 480px) {
    .site-container .mobile-menu-btn {
        top: 0.5rem;
        left: 0.5rem;
        width: 36px;
        height: 36px;
    }

    .site-container .sidebar {
        width: 100%;
        max-width: 320px;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    margin-top: 1rem;
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #555;
    padding: 0;
}

.theme-toggle-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
    color: #333;
}

.theme-toggle-btn i {
    font-size: 16px;
}

/* Dark Mode Styles */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f5f5f5;
    --text-secondary: #d0d0d0;
    --border-color: #333;
    --hover-bg: #2a2a2a;
    --accent-color: #ff6b35;
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* 确保所有文本元素在暗黑模式下都是亮色（继承body的颜色） */
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] label,
[data-theme="dark"] strong,
[data-theme="dark"] em,
[data-theme="dark"] b,
[data-theme="dark"] i {
    color: inherit;
}

/* Dark Mode - Navbar Search */
[data-theme="dark"] .search-input {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .search-input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .search-input:focus {
    border-color: var(--accent-color);
    outline: none;
}

[data-theme="dark"] .site-container .mobile-menu-btn {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .site-container .mobile-menu-btn:hover {
    background-color: #333;
}

[data-theme="dark"] .site-container .sidebar {
    background-color: var(--bg-color);
    border-right-color: var(--border-color);
}

[data-theme="dark"] .site-container .sidebar-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .site-container .sidebar-footer {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .site-container .sidebar-close-btn {
    color: var(--text-color);
}

[data-theme="dark"] .site-container .sidebar-close-btn:hover {
    background-color: var(--hover-bg);
}

[data-theme="dark"] .site-container .sidebar-nav .nav-link:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

[data-theme="dark"] .sidebar-nav a {
    color: var(--text-secondary);
}

[data-theme="dark"] .sidebar-nav a:hover {
    color: var(--text-color);
}

[data-theme="dark"] .sidebar-nav a.current {
    color: var(--accent-color);
}

[data-theme="dark"] .post-title {
    color: var(--text-color);
}

[data-theme="dark"] .post-title a {
    color: var(--text-color);
}

[data-theme="dark"] .post-title a:hover {
    color: var(--accent-color);
}

[data-theme="dark"] .post-description {
    color: var(--text-secondary);
}

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

[data-theme="dark"] .post-content p {
    color: var(--text-color);
}

[data-theme="dark"] .post-content li {
    color: var(--text-color);
}

[data-theme="dark"] .post-content code {
    background-color: #2a2a2a;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .post-content pre {
    background-color: #2a2a2a;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .post-content pre code {
    background-color: transparent;
    border: none;
}

[data-theme="dark"] .post-content blockquote {
    border-left-color: var(--accent-color);
    color: var(--text-color);
}

[data-theme="dark"] .post-content table {
    color: var(--text-color);
}

[data-theme="dark"] .post-content table th,
[data-theme="dark"] .post-content table td {
    border-color: var(--border-color);
    color: var(--text-color);
}

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

[data-theme="dark"] .tag {
    background-color: #2a2a2a;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .tag:hover {
    background-color: #3a3a3a;
    color: var(--text-color);
}

[data-theme="dark"] .timeline-tags .tag {
    background: none;
    border: none;
    color: #4aa3ff;
}

[data-theme="dark"] .timeline-tags .tag:hover {
    background: none;
    color: #4aa3ff;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

[data-theme="dark"] .article h1,
[data-theme="dark"] h1,
[data-theme="dark"] h2 {
    color: var(--accent-color);
}

[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-color);
}

/* Dark Mode - Article Content */
[data-theme="dark"] .article-content {
    color: var(--text-color);
}

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

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


[data-theme="dark"] .article-content a,
[data-theme="dark"] .post-content a,
[data-theme="dark"] .post-description a {
    color: var(--accent-color) !important;
}

[data-theme="dark"] .article-content a:hover,
[data-theme="dark"] .post-content a:hover,
[data-theme="dark"] .post-description a:hover {
    color: #ff8c5a !important;
}

[data-theme="dark"] .source-reference__quote {
    border-color: var(--accent-color);
}

[data-theme="dark"] .article-content > code:not([class*="language-"]),
[data-theme="dark"] .post-content > code:not([class*="language-"]),
[data-theme="dark"] .article-content :not(pre) > code:not([class*="language-"]),
[data-theme="dark"] .post-content :not(pre) > code:not([class*="language-"]) {
    background-color: #2a2a2a;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .article-content pre[class*="language-"],
[data-theme="dark"] .post-content pre[class*="language-"],
[data-theme="dark"] .article-content code[class*="language-"],
[data-theme="dark"] .post-content code[class*="language-"] {
    background-color: #0d1117;
    color: #c9d1d9;
    text-shadow: none;
}

[data-theme="dark"] .article-content pre[class*="language-"],
[data-theme="dark"] .post-content pre[class*="language-"] {
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .article-content pre[class*="language-"] code,
[data-theme="dark"] .post-content pre[class*="language-"] code,
[data-theme="dark"] .article-content pre code[class*="language-"],
[data-theme="dark"] .post-content pre code[class*="language-"] {
    background-color: transparent;
    border: none;
    color: inherit;
}

[data-theme="dark"] .article-content .token.comment,
[data-theme="dark"] .post-content .token.comment,
[data-theme="dark"] .article-content .token.prolog,
[data-theme="dark"] .post-content .token.prolog,
[data-theme="dark"] .article-content .token.doctype,
[data-theme="dark"] .post-content .token.doctype,
[data-theme="dark"] .article-content .token.cdata,
[data-theme="dark"] .post-content .token.cdata {
    color: #8b949e;
}

[data-theme="dark"] .article-content .token.punctuation,
[data-theme="dark"] .post-content .token.punctuation,
[data-theme="dark"] .article-content .token.operator,
[data-theme="dark"] .post-content .token.operator,
[data-theme="dark"] .article-content .token.entity,
[data-theme="dark"] .post-content .token.entity,
[data-theme="dark"] .article-content .token.url,
[data-theme="dark"] .post-content .token.url {
    color: #c9d1d9;
}

[data-theme="dark"] .article-content .token.boolean,
[data-theme="dark"] .post-content .token.boolean,
[data-theme="dark"] .article-content .token.number,
[data-theme="dark"] .post-content .token.number,
[data-theme="dark"] .article-content .token.constant,
[data-theme="dark"] .post-content .token.constant,
[data-theme="dark"] .article-content .token.property,
[data-theme="dark"] .post-content .token.property,
[data-theme="dark"] .article-content .token.symbol,
[data-theme="dark"] .post-content .token.symbol {
    color: #79c0ff;
}

[data-theme="dark"] .article-content .token.selector,
[data-theme="dark"] .post-content .token.selector,
[data-theme="dark"] .article-content .token.attr-name,
[data-theme="dark"] .post-content .token.attr-name,
[data-theme="dark"] .article-content .token.string,
[data-theme="dark"] .post-content .token.string,
[data-theme="dark"] .article-content .token.char,
[data-theme="dark"] .post-content .token.char,
[data-theme="dark"] .article-content .token.builtin,
[data-theme="dark"] .post-content .token.builtin,
[data-theme="dark"] .article-content .token.inserted,
[data-theme="dark"] .post-content .token.inserted,
[data-theme="dark"] .article-content .token.regex,
[data-theme="dark"] .post-content .token.regex {
    color: #a5d6ff;
}

[data-theme="dark"] .article-content .token.keyword,
[data-theme="dark"] .post-content .token.keyword,
[data-theme="dark"] .article-content .token.atrule,
[data-theme="dark"] .post-content .token.atrule,
[data-theme="dark"] .article-content .token.tag,
[data-theme="dark"] .post-content .token.tag,
[data-theme="dark"] .article-content .token.deleted,
[data-theme="dark"] .post-content .token.deleted {
    color: #ff7b72;
}

[data-theme="dark"] .article-content .token.function,
[data-theme="dark"] .post-content .token.function,
[data-theme="dark"] .article-content .token.class-name,
[data-theme="dark"] .post-content .token.class-name {
    color: #d2a8ff;
}

[data-theme="dark"] .article-content .token.important,
[data-theme="dark"] .post-content .token.important,
[data-theme="dark"] .article-content .token.variable,
[data-theme="dark"] .post-content .token.variable {
    color: #ffa657;
}

[data-theme="dark"] .article-content pre {
    background-color: #0d1117;
    border: 1px solid var(--border-color);
}

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

[data-theme="dark"] .article-content blockquote {
    border-left-color: var(--accent-color);
    color: var(--text-secondary);
}

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

[data-theme="dark"] .article-content table th,
[data-theme="dark"] .article-content table td {
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .article-header h2 {
    color: var(--text-color);
}

[data-theme="dark"] .article-meta {
    color: var(--text-secondary);
}

[data-theme="dark"] .article-meta a {
    color: var(--text-secondary);
}

[data-theme="dark"] .article-meta a:hover {
    color: var(--accent-color);
}

[data-theme="dark"] .article-meta-divider {
    color: var(--text-secondary);
}

[data-theme="dark"] .social-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .social-icon-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .social-icon-link:hover {
    color: var(--text-color);
    background-color: var(--hover-bg);
}

[data-theme="dark"] #comments-section h3 {
    color: var(--text-color) !important;
}

[data-theme="dark"] .pagination a,
[data-theme="dark"] .pagination em,
[data-theme="dark"] .pagination span {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .pagination a:hover {
    background-color: var(--hover-bg);
    border-color: #444;
    color: var(--text-color);
}

[data-theme="dark"] .pagination .current {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

[data-theme="dark"] .pagination .disabled {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .article-list.timeline::before {
    content: none;
}

[data-theme="dark"] .timeline-marker {
    display: none;
}

[data-theme="dark"] .timeline-item {
    background-color: var(--bg-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .timeline-item:hover {
    background-color: var(--hover-bg);
    border-color: #444;
}

[data-theme="dark"] .timeline-date {
    color: var(--accent-color);
}

[data-theme="dark"] footer {
    color: var(--text-secondary);
}

/* Footer text styles for dark theme */
[data-theme="dark"] .footer-text {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .footer-text p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .footer-text a {
    color: var(--text-secondary);
}

[data-theme="dark"] .footer-text a:hover {
    color: var(--accent-color);
}

[data-theme="dark"] .sidebar-header h1 {
    color: var(--text-color);
}

[data-theme="dark"] .sidebar-header h1 a {
    color: var(--text-color);
}

[data-theme="dark"] .sidebar-header h1 a:hover {
    color: var(--accent-color);
}

[data-theme="dark"] .sidebar-header .site-description {
    color: var(--text-secondary);
}

[data-theme="dark"] .theme-toggle-btn {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .theme-toggle-btn:hover {
    background-color: var(--hover-bg);
    border-color: #444;
    color: var(--text-color);
}

/* Dark Mode - Comments Section */
[data-theme="dark"] #comments-section h3 {
    color: var(--text-color) !important;
}

[data-theme="dark"] .comment {
    border-left-color: var(--border-color) !important;
}

[data-theme="dark"] .replies {
    border-left-color: var(--border-color);
}

[data-theme="dark"] .comment strong {
    color: var(--text-color) !important;
}

[data-theme="dark"] .comment a {
    color: var(--text-color) !important;
}

[data-theme="dark"] .comment span {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .comment small {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .comment div {
    color: var(--text-color) !important;
}

[data-theme="dark"] .reply-button {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .reply-button:hover {
    color: var(--text-color) !important;
}

/* Dark Mode - Comment Form */
[data-theme="dark"] .comment-form {
    background-color: #2a2a2a !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .comment-form input[type="text"],
[data-theme="dark"] .comment-form input[type="url"],
[data-theme="dark"] .comment-form textarea {
    background-color: #1a1a1a !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

[data-theme="dark"] .comment-form input[type="text"]::placeholder,
[data-theme="dark"] .comment-form input[type="url"]::placeholder,
[data-theme="dark"] .comment-form textarea::placeholder {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .comment-form input[type="text"]:focus,
[data-theme="dark"] .comment-form input[type="url"]:focus,
[data-theme="dark"] .comment-form textarea:focus {
    border-color: var(--accent-color) !important;
    outline: none;
}

[data-theme="dark"] .comment-form-cancel {
    background-color: var(--hover-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .comment-form-cancel:hover {
    background-color: #3a3a3a !important;
    color: var(--text-color) !important;
}

[data-theme="dark"] .comment-success-message {
    background-color: #2a2a2a !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}

[data-theme="dark"] .comment-form input[type="submit"] {
    background-color: var(--accent-color) !important;
    color: white !important;
}

[data-theme="dark"] .comment-form input[type="submit"]:hover {
    background-color: #ff8c5a !important;
}

/* Dark Mode - Newsletter Subscription */
[data-theme="dark"] .newsletter-subscription {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .newsletter-email-input {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .newsletter-email-input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .newsletter-email-input:focus {
    border-color: var(--accent-color);
    outline: none;
}

[data-theme="dark"] .newsletter-submit-btn {
    background-color: var(--accent-color);
    color: white;
}

[data-theme="dark"] .newsletter-submit-btn:hover:not(:disabled) {
    background-color: #ff8c5a;
}

[data-theme="dark"] .newsletter-message-success {
    background-color: #1e3a1e;
    color: #90ee90;
    border-color: #2d5a2d;
}

[data-theme="dark"] .newsletter-message-error {
    background-color: #3a1e1e;
    color: #ff6b6b;
    border-color: #5a2d2d;
}

[data-theme="dark"] .tag-subscription-form {
    background-color: #2a2a2a;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .tag-subscription-form p {
    color: var(--text-secondary);
}

[data-theme="dark"] .newsletter-email-input-small {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .newsletter-email-input-small::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .newsletter-email-input-small:focus {
    border-color: var(--accent-color);
    outline: none;
}

[data-theme="dark"] .newsletter-submit-btn-small {
    background-color: var(--accent-color);
    color: white;
}

[data-theme="dark"] .newsletter-submit-btn-small:hover:not(:disabled) {
    background-color: #ff8c5a;
}

/* Share Menu Styles */
.share-container {
    position: relative;
    display: inline-block;
}

.share-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: grey;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 24px;
    min-height: 24px;
    font-size: inherit;
    font-family: inherit;
}

.share-button:hover {
    color: #c04000;
    background-color: #f5f5f5;
}

[data-theme="dark"] .share-button:hover {
    background-color: var(--hover-bg);
}

.share-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
}

.share-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.share-menu-item:last-child {
    border-bottom: none;
}

.share-menu-item:hover {
    background-color: #f5f5f5;
    color: #c04000;
}

.share-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

/* Dark Mode - Share Menu */
[data-theme="dark"] .share-button {
    color: var(--text-secondary);
}

[data-theme="dark"] .share-button:hover {
    color: var(--accent-color);
}

[data-theme="dark"] .share-menu {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .share-menu-item {
    color: var(--text-color);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .share-menu-item:hover {
    background-color: var(--hover-bg);
    color: var(--accent-color);
}
