/**
 * Article Enhancement Styles
 * 文章增强样式 - TOC、作者卡片、版权信息等
 *
 * @package Developer_Starter
 * @since 1.0.0
 */

/* ==========================================================================
   Post Main Content Wrapper - 正文区域样式
   ========================================================================== */

.post-main-content {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

/* 覆盖 sidebar.css 中的默认宽度，使外框适应内容宽度 */
.post-layout .post-main-content {
    max-width: calc(var(--post-content-width, 800px) + 42px);
    width: 100%;
}

/* 无侧边栏时居中显示 */
.post-layout.no-sidebar {
    display: flex;
    justify-content: center;
}

.post-layout.no-sidebar .post-main-content {
    margin: 0 auto;
}

/* 居中对齐内容 */
.entry-content {
    margin: 0 auto;
}

[data-theme="dark"] .post-main-content {
    background: var(--dark-bg-secondary, #1e293b);
    border-color: var(--dark-border, #334155);
}

/* ==========================================================================
   Content Style Variables (applied via inline style)
   ========================================================================== */

.entry-content {
    max-width: 100%;
    font-size: var(--post-font-size, 18px);
    line-height: var(--post-line-height, 1.8);
    margin: 0 auto;
    width: 100%;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.entry-content p {
    margin-bottom: var(--post-paragraph-spacing, 1.5em);
}

.entry-content img {
    max-width: var(--post-image-max-width, 100%);
    height: auto;
    display: block;
    margin: 1.5em auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.entry-content iframe,
.entry-content embed,
.entry-content object,
.entry-content video,
.entry-content table,
.entry-content pre,
.entry-content blockquote,
.entry-content .wp-block-image,
.entry-content .wp-block-embed,
.entry-content .wp-block-table {
    max-width: 100%;
}

.entry-content iframe,
.entry-content embed,
.entry-content object {
    width: 100%;
}

.entry-content pre {
    overflow-x: auto;
}

.entry-content table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    border-spacing: 0;
    margin-bottom: 1.5em;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.entry-content table th,
.entry-content table td {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    text-align: left;
    min-width: 100px;
    /* Ensure columns don't collapse too much on mobile */
}

.entry-content table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.entry-content table tr:nth-child(even) {
    background-color: #f8fafc;
}

.entry-content img.ds-zoomable-image {
    cursor: zoom-in;
}

.ds-img-viewer {
    border: none;
    padding: 0;
    background: rgba(15, 23, 42, 0.55);
    max-width: 94vw;
    max-height: 94vh;
    width: 94vw;
    height: 94vh;
    border-radius: 16px;
    overflow: hidden;
}

.ds-img-viewer[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ds-img-viewer::backdrop {
    background: rgba(2, 6, 23, 0.75);
}

.ds-img-viewer__img {
    display: block;
    max-width: 86vw;
    max-height: 86vh;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    background: #0f172a;
    object-fit: contain;
}

.ds-img-close,
.ds-img-prev,
.ds-img-next {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(15, 23, 42, 0.8);
    color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ds-img-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 22px;
    line-height: 1;
}

.ds-img-prev,
.ds-img-next {
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 999px;
}

.ds-img-prev {
    left: 18px;
}

.ds-img-next {
    right: 18px;
}

.ds-img-close:hover,
.ds-img-prev:hover,
.ds-img-next:hover {
    background: rgba(56, 189, 248, 0.85);
    color: #0f172a;
}

.ds-img-prev:disabled,
.ds-img-next:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ==========================================================================
   Article Meta Stats
   ========================================================================== */

.post-meta-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.meta-stat svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.ds-interaction-btn {
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.ds-interaction-btn.is-active {
    color: var(--color-primary, #2563eb);
}

/* ==========================================================================
   Table of Contents (TOC)
   ========================================================================== */

.article-toc {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

/* Sidebar position */
.toc-sidebar .article-toc {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

/* Before content position */
.toc-before-content .article-toc {
    margin-bottom: 40px;
    max-width: 100%;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.toc-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.toc-toggle {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #64748b;
    border-radius: 4px;
    transition: all 0.2s;
}

.toc-toggle:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.toc-toggle.collapsed svg {
    transform: rotate(-90deg);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc.collapsed .toc-list {
    display: none;
}

.toc-item {
    margin-bottom: 8px;
}

.toc-item.toc-level-2 {
    padding-left: 0;
}

.toc-item.toc-level-3 {
    padding-left: 16px;
}

.toc-item.toc-level-4 {
    padding-left: 32px;
}

.toc-link {
    display: block;
    padding: 6px 12px;
    font-size: 0.9rem;
    color: #475569;
    text-decoration: none;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.toc-link:hover {
    background: #f8fafc;
    color: var(--color-primary, #2563eb);
    border-left-color: var(--color-primary, #2563eb);
}

.toc-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    color: var(--color-primary, #2563eb);
    border-left-color: var(--color-primary, #2563eb);
    font-weight: 500;
}

/* ==========================================================================
   Author Box
   ========================================================================== */

.author-box {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    margin: 40px 0;
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.author-info {
    flex: 1;
}

.author-name {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
}

.author-bio {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
}

.author-social {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    position: relative;
}

.social-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.social-link .social-label {
    font-size: 0.85rem;
}

.social-link:hover {
    background: var(--color-primary, #2563eb);
    color: #fff;
    border-color: var(--color-primary, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.social-link:hover svg {
    fill: #fff;
    stroke: #fff;
}

/* WeChat QR Code Popup */
.social-wechat-qr {
    position: relative;
}

.social-wechat-qr .wechat-qr-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.social-wechat-qr .wechat-qr-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #fff;
}

.social-wechat-qr .wechat-qr-popup img {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    display: block;
}

.social-wechat-qr:hover .wechat-qr-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Copyright Box
   ========================================================================== */

.post-copyright {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 12px;
    margin: 40px 0;
    color: #fff;
}

.copyright-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.copyright-icon svg {
    stroke: #fff;
    opacity: 0.9;
}

.copyright-content {
    flex: 1;
}

.copyright-text {
    margin: 0 0 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.copyright-text strong {
    color: #fff;
}

.copyright-notice {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Code Blocks Enhancement
   ========================================================================== */

.entry-content pre {
    margin: 1.5em 0;
    border-radius: 12px;
    overflow: hidden;
}

.entry-content pre code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

/* Dark theme for code */
.entry-content pre[class*="language-"] {
    background: #1e293b;
}

/* ==========================================================================
   Dark Mode - Combined selectors for compatibility
   ========================================================================== */

/* Post Main Content Dark Mode */
html.dark-mode .post-main-content,
[data-theme="dark"] .post-main-content {
    background: var(--dm-bg-card, #1e293b);
    border-color: var(--dm-border, #334155);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Single Post Page Background */
html.dark-mode .single-post,
[data-theme="dark"] .single-post {
    background: var(--dm-bg, #0f172a);
}

/* Entry Content Dark Mode */
html.dark-mode .entry-content,
[data-theme="dark"] .entry-content {
    color: var(--dm-text, #e2e8f0);
}

html.dark-mode .entry-content p,
html.dark-mode .entry-content li,
[data-theme="dark"] .entry-content p,
[data-theme="dark"] .entry-content li {
    color: var(--dm-text, #e2e8f0);
}

html.dark-mode .entry-content h1,
html.dark-mode .entry-content h2,
html.dark-mode .entry-content h3,
html.dark-mode .entry-content h4,
html.dark-mode .entry-content h5,
html.dark-mode .entry-content h6,
[data-theme="dark"] .entry-content h1,
[data-theme="dark"] .entry-content h2,
[data-theme="dark"] .entry-content h3,
[data-theme="dark"] .entry-content h4,
[data-theme="dark"] .entry-content h5,
[data-theme="dark"] .entry-content h6 {
    color: #f1f5f9;
}

html.dark-mode .entry-content a,
[data-theme="dark"] .entry-content a {
    color: var(--color-primary-light, #60a5fa);
}

html.dark-mode .entry-content a:hover,
[data-theme="dark"] .entry-content a:hover {
    color: var(--color-primary, #3b82f6);
}

html.dark-mode .entry-content blockquote,
[data-theme="dark"] .entry-content blockquote {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--color-primary, #2563eb);
    color: #94a3b8;
}

html.dark-mode .entry-content code,
[data-theme="dark"] .entry-content code {
    background: #334155;
    color: #f97316;
}

html.dark-mode .entry-content pre,
[data-theme="dark"] .entry-content pre {
    background: #1e293b !important;
    border: 1px solid #334155;
}

html.dark-mode .entry-content table,
[data-theme="dark"] .entry-content table {
    border-color: #334155;
}

html.dark-mode .entry-content th,
[data-theme="dark"] .entry-content th {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

html.dark-mode .entry-content td,
[data-theme="dark"] .entry-content td {
    border-color: #334155;
    color: #e2e8f0;
}

html.dark-mode .entry-content tr:nth-child(even),
[data-theme="dark"] .entry-content tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

html.dark-mode .entry-content hr,
[data-theme="dark"] .entry-content hr {
    border-color: #334155;
}

/* Post Tags Dark Mode */
html.dark-mode .post-tags,
[data-theme="dark"] .post-tags {
    border-top-color: var(--dm-border, #334155);
}

html.dark-mode .post-tags strong,
[data-theme="dark"] .post-tags strong {
    color: var(--dm-text, #e2e8f0);
}

html.dark-mode .post-tags a,
[data-theme="dark"] .post-tags a {
    background: var(--dm-bg-card, #334155) !important;
    color: var(--dm-text-muted, #94a3b8) !important;
    border: 1px solid var(--dm-border, #475569);
}

html.dark-mode .post-tags a:hover,
[data-theme="dark"] .post-tags a:hover {
    background: var(--color-primary, #2563eb) !important;
    color: #fff !important;
    border-color: var(--color-primary, #2563eb);
}

/* Post Navigation Dark Mode */
html.dark-mode .post-navigation,
[data-theme="dark"] .post-navigation {
    border-top-color: var(--dm-border, #334155) !important;
}

html.dark-mode .post-navigation span,
[data-theme="dark"] .post-navigation span {
    color: var(--dm-text-muted, #94a3b8) !important;
}

html.dark-mode .post-navigation a,
[data-theme="dark"] .post-navigation a {
    color: var(--dm-text, #e2e8f0) !important;
}

html.dark-mode .post-navigation a:hover,
[data-theme="dark"] .post-navigation a:hover {
    color: var(--color-primary-light, #60a5fa) !important;
}

/* Related Posts Section Dark Mode */
html.dark-mode .related-posts,
[data-theme="dark"] .related-posts {
    background: var(--dm-bg-secondary, #1e293b) !important;
}

html.dark-mode .related-posts .section-title,
[data-theme="dark"] .related-posts .section-title {
    color: #f1f5f9;
}

html.dark-mode .related-posts .news-card,
[data-theme="dark"] .related-posts .news-card {
    background: var(--dm-bg-card, #0f172a);
    border: 1px solid var(--dm-border, #334155);
}

html.dark-mode .related-posts .news-date,
[data-theme="dark"] .related-posts .news-date {
    color: var(--dm-text-muted, #94a3b8);
}

html.dark-mode .related-posts .news-title a,
[data-theme="dark"] .related-posts .news-title a {
    color: var(--dm-text, #e2e8f0);
}

html.dark-mode .related-posts .news-title a:hover,
[data-theme="dark"] .related-posts .news-title a:hover {
    color: var(--color-primary-light, #60a5fa);
}

/* TOC Dark Mode */
html.dark-mode .article-toc,
[data-theme="dark"] .article-toc {
    background: var(--dm-bg-card, #1e293b);
    border-color: var(--dm-border, #334155);
}

html.dark-mode .toc-header,
[data-theme="dark"] .toc-header {
    border-color: #334155;
}

html.dark-mode .toc-title,
[data-theme="dark"] .toc-title {
    color: #f1f5f9;
}

html.dark-mode .toc-toggle,
[data-theme="dark"] .toc-toggle {
    color: #94a3b8;
}

html.dark-mode .toc-toggle:hover,
[data-theme="dark"] .toc-toggle:hover {
    background: #334155;
    color: #f1f5f9;
}

html.dark-mode .toc-link,
[data-theme="dark"] .toc-link {
    color: #94a3b8;
}

html.dark-mode .toc-link:hover,
[data-theme="dark"] .toc-link:hover {
    background: #334155;
    color: var(--color-primary-light, #60a5fa);
}

html.dark-mode .toc-link.active,
[data-theme="dark"] .toc-link.active {
    background: rgba(37, 99, 235, 0.2);
    color: var(--color-primary-light, #60a5fa);
}

/* Author Box Dark Mode */
html.dark-mode .author-box,
[data-theme="dark"] .author-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

html.dark-mode .author-name,
[data-theme="dark"] .author-name {
    color: #f1f5f9;
}

html.dark-mode .author-bio,
[data-theme="dark"] .author-bio {
    color: #94a3b8;
}

html.dark-mode .author-avatar img,
[data-theme="dark"] .author-avatar img {
    border-color: #334155;
}

html.dark-mode .social-link,
[data-theme="dark"] .social-link {
    background: #334155;
    color: #94a3b8;
    border-color: #475569;
}

html.dark-mode .social-link:hover,
[data-theme="dark"] .social-link:hover {
    background: var(--color-primary, #2563eb);
    color: #fff;
    border-color: var(--color-primary, #2563eb);
}

html.dark-mode .wechat-qr-popup,
[data-theme="dark"] .wechat-qr-popup {
    background: #1e293b;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

html.dark-mode .wechat-qr-popup::after,
[data-theme="dark"] .wechat-qr-popup::after {
    border-top-color: #1e293b;
}

/* Comments Section Dark Mode */
html.dark-mode .comments-area,
[data-theme="dark"] .comments-area {
    background: var(--dm-bg-card, #1e293b);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--dm-border, #334155);
}

html.dark-mode .comments-title,
html.dark-mode .comment-reply-title,
[data-theme="dark"] .comments-title,
[data-theme="dark"] .comment-reply-title {
    color: #f1f5f9;
}

html.dark-mode .comment-list,
[data-theme="dark"] .comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

html.dark-mode .comment,
html.dark-mode .comment-body,
[data-theme="dark"] .comment,
[data-theme="dark"] .comment-body {
    background: var(--dm-bg, #0f172a);
    border: 1px solid var(--dm-border, #334155);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

html.dark-mode .comment-author .fn,
[data-theme="dark"] .comment-author .fn {
    color: #f1f5f9;
}

html.dark-mode .comment-author .fn a,
[data-theme="dark"] .comment-author .fn a {
    color: #f1f5f9;
}

html.dark-mode .comment-metadata,
html.dark-mode .comment-metadata a,
[data-theme="dark"] .comment-metadata,
[data-theme="dark"] .comment-metadata a {
    color: var(--dm-text-muted, #94a3b8);
}

html.dark-mode .comment-content,
html.dark-mode .comment-content p,
[data-theme="dark"] .comment-content,
[data-theme="dark"] .comment-content p {
    color: var(--dm-text, #e2e8f0);
}

html.dark-mode .comment-reply-link,
[data-theme="dark"] .comment-reply-link {
    color: var(--color-primary-light, #60a5fa);
}

html.dark-mode .comment-respond,
[data-theme="dark"] .comment-respond {
    background: var(--dm-bg, #0f172a);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--dm-border, #334155);
    margin-top: 30px;
}

html.dark-mode .comment-form label,
[data-theme="dark"] .comment-form label {
    color: var(--dm-text, #e2e8f0);
}

html.dark-mode .comment-form input[type="text"],
html.dark-mode .comment-form input[type="email"],
html.dark-mode .comment-form input[type="url"],
html.dark-mode .comment-form textarea,
[data-theme="dark"] .comment-form input[type="text"],
[data-theme="dark"] .comment-form input[type="email"],
[data-theme="dark"] .comment-form input[type="url"],
[data-theme="dark"] .comment-form textarea {
    background: var(--dm-bg-card, #1e293b);
    border: 1px solid var(--dm-border, #334155);
    color: var(--dm-text, #e2e8f0);
    border-radius: 8px;
    padding: 12px 16px;
}

html.dark-mode .comment-form input:focus,
html.dark-mode .comment-form textarea:focus,
[data-theme="dark"] .comment-form input:focus,
[data-theme="dark"] .comment-form textarea:focus {
    border-color: var(--color-primary, #2563eb);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

html.dark-mode .comment-form input::placeholder,
html.dark-mode .comment-form textarea::placeholder,
[data-theme="dark"] .comment-form input::placeholder,
[data-theme="dark"] .comment-form textarea::placeholder {
    color: var(--dm-text-muted, #64748b);
}

/* Post Thumbnail Dark Mode */
html.dark-mode .post-thumbnail img,
[data-theme="dark"] .post-thumbnail img {
    border: 1px solid var(--dm-border, #334155);
}

/* Post Sidebar Dark Mode */
html.dark-mode .post-sidebar .widget,
[data-theme="dark"] .post-sidebar .widget {
    background: var(--dm-bg-card, #1e293b);
    border: 1px solid var(--dm-border, #334155);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

html.dark-mode .post-sidebar .widget-title,
[data-theme="dark"] .post-sidebar .widget-title {
    color: #f1f5f9;
    border-bottom-color: var(--dm-border, #334155);
}

html.dark-mode .post-sidebar .widget a,
[data-theme="dark"] .post-sidebar .widget a {
    color: var(--dm-text, #e2e8f0);
}

html.dark-mode .post-sidebar .widget a:hover,
[data-theme="dark"] .post-sidebar .widget a:hover {
    color: var(--color-primary-light, #60a5fa);
}

/* bg-light class override for dark mode */
html.dark-mode .bg-light,
[data-theme="dark"] .bg-light {
    background: var(--dm-bg-secondary, #1e293b) !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .toc-sidebar .article-toc {
        position: static;
        max-height: none;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-social {
        justify-content: center;
    }

    .post-copyright {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .entry-content {
        font-size: calc(var(--post-font-size, 18px) - 2px);
    }
}

/* ==========================================================================
   Gallery Mode Styles
   文章相册模式样式
   ========================================================================== */

.gallery-mode-viewer {
    position: relative;
    max-width: 100%;
    margin: 20px auto;
    text-align: center;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.gallery-mode-viewer img {
    max-width: 100%;
    height: auto;
    max-height: 80vh;
    /* 防止过高 */
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* 更柔和的投影 */
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: zoom-in;
    vertical-align: middle;
}

/* 导航按钮 */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0.8;
    z-index: 20;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.gallery-nav-btn:hover {
    background: #fff;
    color: var(--color-primary, #2563eb);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gallery-nav-prev {
    left: 20px;
}

.gallery-nav-next {
    right: 20px;
}

/* 翻页指示器/分页 */
.gallery-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.gallery-page-item {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.gallery-page-item:hover {
    border-color: var(--color-primary-light, #60a5fa);
    color: var(--color-primary, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.gallery-page-item.current {
    background: var(--color-primary, #2563eb);
    color: #fff;
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 省略号样式 */
span.gallery-page-item {
    border: none;
    background: transparent;
    color: #94a3b8;
    box-shadow: none !important;
    transform: none !important;
}

/* 图片点击区域（隐形） */
.gallery-click-area {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    cursor: pointer;
    /* 虽然是隐形的，但显示手指光标提示可点击 */
    z-index: 10;
    /* 调试用：background: rgba(255,0,0,0.1); */
}

.gallery-click-prev {
    left: 0;
    cursor: w-resize;
    /* 向左的光标 */
}

.gallery-click-next {
    right: 0;
    cursor: e-resize;
    /* 向右的光标 */
}

/* 文本内容区域 */
.gallery-text-content {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px dashed #e2e8f0;
    color: #475569;
}

/* Dark Mode Support */
html.dark-mode .gallery-mode-viewer,
[data-theme="dark"] .gallery-mode-viewer {
    background: transparent;
    border: none;
    box-shadow: none;
}

html.dark-mode .gallery-mode-viewer img,
[data-theme="dark"] .gallery-mode-viewer img {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

html.dark-mode .gallery-nav-btn,
[data-theme="dark"] .gallery-nav-btn {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark-mode .gallery-nav-btn:hover,
[data-theme="dark"] .gallery-nav-btn:hover {
    background: var(--color-primary, #2563eb);
    color: #fff;
}

html.dark-mode .gallery-page-item,
[data-theme="dark"] .gallery-page-item {
    background: var(--dm-bg-card, #1e293b);
    border-color: var(--dm-border, #334155);
    color: #94a3b8;
}

html.dark-mode .gallery-page-item:hover,
[data-theme="dark"] .gallery-page-item:hover {
    border-color: var(--color-primary, #2563eb);
    color: #fff;
    background: var(--dm-border, #334155);
}

html.dark-mode .gallery-page-item.current,
[data-theme="dark"] .gallery-page-item.current {
    background: var(--color-primary, #2563eb);
    color: #fff;
    border-color: var(--color-primary, #2563eb);
}

html.dark-mode .gallery-text-content,
[data-theme="dark"] .gallery-text-content {
    border-top-color: var(--dm-border, #334155);
    color: var(--dm-text, #e2e8f0);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .gallery-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        opacity: 0.9;
        /* 移动端常显 */
    }

    .gallery-nav-prev {
        left: 10px;
    }

    .gallery-nav-next {
        right: 10px;
    }

    .gallery-mode-viewer {
        padding: 10px;
        margin: 15px auto;
        border-radius: 12px;
    }

    .gallery-pagination {
        margin-top: 25px;
    }

    .gallery-page-item {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
    }
}