/* =========================================
   Rich Content Unified Style
   ========================================= */

.markdown-body {
    --mb-primary: #0ea5e9;
    --mb-primary-dark: #0284c7;
    --mb-primary-soft: #eff6ff;
    --mb-primary-border: #bfdbfe;
    --mb-text-main: #0f172a;
    --mb-text-sub: #475569;
    --mb-border: #e2e8f0;
    --mb-bg-soft: #f8fafc;

    font-size: 0.96rem;
    line-height: 1.9;
    color: var(--mb-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.85) transparent;
}

.markdown-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.markdown-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.85);
    border-radius: 999px;
}

.markdown-body::-webkit-scrollbar-track {
    background: transparent;
}

.markdown-body > *:first-child {
    margin-top: 0 !important;
}

.markdown-body > *:last-child {
    margin-bottom: 0 !important;
}

.markdown-body > * + * { margin-top: 1.25rem; }
.markdown-body ::selection { background: rgba(14, 165, 233, 0.16); color: var(--mb-text-main); }

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    font-weight: 900;
    line-height: 1.35;
    color: var(--mb-text-main);
    scroll-margin-top: 6rem;
    letter-spacing: -0.02em;
    margin: 1.15rem 0 0.7rem;
}

.markdown-body h1 {
    font-size: 1.95rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.markdown-body h2 {
    position: relative;
    font-size: 1.55rem;
    padding-left: 1rem;
}

.markdown-body h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18rem;
    bottom: 0.18rem;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--mb-primary) 0%, var(--mb-primary-dark) 100%);
}

.markdown-body h3 {
    font-size: 1.26rem;
}

.markdown-body h4 {
    font-size: 1.05rem;
}

.markdown-body p { margin: 0.85rem 0; color: var(--mb-text-sub); }
.markdown-body strong { font-weight: 800; color: var(--mb-text-main); }
.markdown-body em { font-style: italic; color: var(--mb-text-sub); font-weight: 500; }
.markdown-body p:empty { display: none; }

.markdown-body .italic,
.markdown-body i { font-style: italic; }

.markdown-body :is(p, li, blockquote, td, th) a:not(.btn):not(.button):not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-info):not([role="button"]):not(.is-button),
.markdown-body :is(p, li, blockquote, td, th) .text-link {
    color: #0f766e;
    text-decoration: none;
    font-weight: 800;
    position: relative;
    padding: 0.04rem 0.18rem;
    border-radius: 0.45rem;
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.92) 0%, rgba(236, 254, 255, 0.68) 100%);
    box-shadow: inset 0 -0.18rem 0 rgba(45, 212, 191, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.markdown-body :is(p, li, blockquote, td, th) a:not(.btn):not(.button):not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-info):not([role="button"]):not(.is-button)::after,
.markdown-body :is(p, li, blockquote, td, th) .text-link::after {
    content: "↗";
    display: inline-block;
    margin-left: 0.18rem;
    font-size: 0.82em;
    opacity: 0.62;
    transform: translateY(-0.03em);
}

.markdown-body :is(p, li, blockquote, td, th) a:not(.btn):not(.button):not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-info):not([role="button"]):not(.is-button):hover,
.markdown-body :is(p, li, blockquote, td, th) .text-link:hover {
    color: #134e4a;
    background: linear-gradient(180deg, rgba(153, 246, 228, 0.7) 0%, rgba(207, 250, 254, 0.72) 100%);
    box-shadow: inset 0 -0.2rem 0 rgba(20, 184, 166, 0.28), 0 10px 18px -18px rgba(20, 184, 166, 0.45);
    transform: translateY(-1px);
}

.markdown-body :is(p, li, blockquote, td, th) a:not(.btn):not(.button):not(.btn-primary):not(.btn-secondary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-info):not([role="button"]):not(.is-button):focus-visible,
.markdown-body :is(p, li, blockquote, td, th) .text-link:focus-visible {
    outline: 2px solid rgba(20, 184, 166, 0.35);
    outline-offset: 3px;
}

.markdown-body ul,
.markdown-body ol,
.markdown-body > ul,
.markdown-body > ol,
.markdown-body p + ul,
.markdown-body p + ol,
.markdown-body blockquote ul,
.markdown-body blockquote ol,
.markdown-body li ul,
.markdown-body li ol {
    margin: 1rem 0;
    padding-inline-start: 1.8rem;
    padding-inline-end: 0.8rem;
    padding-block: 0.7rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.18);
    list-style-position: outside;
}

.markdown-body ul,
.markdown-body > ul,
.markdown-body p + ul,
.markdown-body blockquote ul,
.markdown-body li ul {
    list-style: none;
    padding-inline-start: 1.6rem;
}

.markdown-body ul > li,
.markdown-body ol > li {
    margin: 0.34rem 0;
    color: var(--mb-text-sub);
    line-height: 1.75;
    position: relative;
    padding-left: 0.15rem;
}

.markdown-body ul > li::before {
    content: "";
    position: absolute;
    left: -0.85rem;
    top: 0.92em;
    width: 0.34rem;
    height: 0.34rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--mb-primary) 0%, #22c55e 100%);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.08);
}

.markdown-body ol {
    counter-reset: mb-item;
}

.markdown-body ol > li {
    counter-increment: mb-item;
}

.markdown-body ol > li::before {
    content: counter(mb-item, decimal-leading-zero);
    position: absolute;
    left: -1.5rem;
    top: 0.15rem;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--mb-primary-dark) 0%, #7c3aed 100%);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1.2rem;
    text-align: center;
    box-shadow: 0 8px 14px -12px rgba(2, 132, 199, 0.38);
}

.markdown-body ul ul,
.markdown-body ol ol,
.markdown-body ul ol,
.markdown-body ol ul {
    margin: 0.55rem 0 0.15rem;
    padding: 0.45rem 0.65rem 0.45rem 1.35rem;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.92);
    box-shadow: none;
}

.markdown-body ul ul > li::before {
    background: linear-gradient(135deg, #22c55e 0%, #06b6d4 100%);
    width: 0.28rem;
    height: 0.28rem;
    left: -0.78rem;
}

.markdown-body ol ol > li::before {
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
}

.markdown-body blockquote {
    position: relative;
    margin: 1.15rem 0;
    padding: 1rem 1.05rem 1rem 1.15rem;
    border-radius: 18px;
    border: 1px solid rgba(191, 219, 254, 0.88);
    border-left: 4px solid var(--mb-primary);
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.92) 0%, rgba(248, 250, 252, 0.95) 100%);
    color: var(--mb-text-sub);
    box-shadow: 0 18px 32px -28px rgba(2, 132, 199, 0.34);
}

.markdown-body blockquote p:last-child { margin-bottom: 0; }

.markdown-body pre {
    margin: 1.15rem 0;
    padding: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #1f2937;
    box-shadow: 0 24px 45px -32px rgba(15, 23, 42, 0.55);
    position: relative;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

.markdown-body .code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.8rem 0.95rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    user-select: none;
    flex-shrink: 0;
}

.markdown-body .code-block-dots { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.markdown-body .code-block-dots span { width: 10px; height: 10px; border-radius: 999px; display: inline-block; opacity: 0.95; }

.markdown-body .code-block-lang {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
    padding: 0 10px;
}

.markdown-body .code-block-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.68rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1;
    white-space: nowrap;
}

.markdown-body .code-block-copy:hover { background: #2563eb; color: #fff; border-color: #2563eb; }
.markdown-body .code-block-copy.copied { background: #22c55e; color: #052e16; border-color: #22c55e; }

.markdown-body pre code,
.markdown-body pre code.hljs {
    display: block;
    padding: 1rem 1.05rem 1.1rem;
    background: transparent !important;
    color: #e2e8f0 !important;
    font-size: 0.86rem;
    line-height: 1.72;
    overflow-x: auto;
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

.markdown-body pre code::-webkit-scrollbar { height: 6px; }
.markdown-body pre code::-webkit-scrollbar-track { background: transparent; }
.markdown-body pre code::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.45); border-radius: 999px; }
.markdown-body pre code::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.75); }

.markdown-body code.md-inline,
.markdown-body p code,
.markdown-body li code,
.markdown-body td code,
.markdown-body th code {
    font-size: 0.92em;
    padding: 0.18rem 0.42rem;
    border-radius: 0.6rem;
    background-color: var(--mb-primary-soft);
    border: 1px solid rgba(191, 219, 254, 0.9);
    color: var(--mb-text-main);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-weight: 700;
    vertical-align: baseline;
    margin: 0 0.15rem;
}

.markdown-body img {
    display: block;
    max-width: 100%;
    border-radius: 18px;
    margin: 0.9rem auto;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 24px 40px -34px rgba(15, 23, 42, 0.32);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: zoom-in;
}

.markdown-body img:hover { transform: translateY(-2px); box-shadow: 0 28px 46px -34px rgba(15, 23, 42, 0.42); }

.markdown-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
    font-size: 0.92rem;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(191, 219, 254, 0.95);
    background: #fff;
    box-shadow: 0 18px 34px -28px rgba(15, 23, 42, 0.18);
}

.markdown-body table th,
.markdown-body table td {
    padding: 0.78rem 0.9rem;
    text-align: left;
    border-right: 1px solid rgba(226, 232, 240, 0.95);
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
    vertical-align: top;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.markdown-body table th:last-child,
.markdown-body table td:last-child {
    border-right: none;
}

.markdown-body table tbody tr:last-child td {
    border-bottom: none;
}

.markdown-body table th {
    background: #f8fafc;
    font-weight: 900;
    color: #334155;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: relative;
}

.markdown-body table thead th {
    background: #f8fafc;
    color: #0f172a;
    border-bottom: 2px solid rgba(191, 219, 254, 0.95);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.9);
}

.markdown-body table thead th:first-child {
    border-top-left-radius: 14px;
}

.markdown-body table thead th:last-child {
    border-top-right-radius: 14px;
}

.markdown-body table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 14px;
}

.markdown-body table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 14px;
}

.markdown-body table tbody td:hover {
    background: rgba(14, 165, 233, 0.06);
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.08);
}

.markdown-body hr {
    height: 1px;
    border: none;
    background: linear-gradient(to right, transparent, var(--mb-border), transparent);
    margin: 1.2rem 0;
}

@media (max-width: 640px) {
    .markdown-body {
        font-size: 0.9rem;
        line-height: 1.82;
    }

    .markdown-body h1 {
        font-size: 1.55rem;
    }

    .markdown-body h2 {
        font-size: 1.28rem;
    }

    .markdown-body h3 {
        font-size: 1.08rem;
    }

    .markdown-body .code-block-header {
        padding: 0.72rem 0.78rem;
    }

    .markdown-body pre code,
    .markdown-body pre code.hljs {
        padding: 0.9rem 0.85rem 1rem;
        font-size: 0.8rem;
    }

    .markdown-body table th,
    .markdown-body table td {
        padding: 0.62rem 0.68rem;
        font-size: 12px;
    }
}

.md-skeleton {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.md-skeleton-row {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-size: 200% 100%;
    animation: md-skeleton-shimmer 1.4s ease-in-out infinite;
}
.md-skeleton-title { height: 18px; width: 58%; margin-bottom: 14px; }
.md-skeleton-row + .md-skeleton-row { margin-top: 10px; }

@keyframes md-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 帖子详情页音乐播放器美化 */
.markdown-body .music-block {
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(129, 140, 248, 0.25);
    background: linear-gradient(135deg, #ffffff 0%, #f4f6ff 100%);
    box-shadow: 0 16px 35px -28px rgba(79, 70, 229, 0.4);
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: stretch;
    gap: 0;
    min-height: 140px;
}

.markdown-body .music-cover {
    position: relative;
    min-height: 140px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(99, 102, 241, 0.2), rgba(15, 23, 42, 0.25));
}

.markdown-body .music-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.05);
}

.markdown-body .music-cover-fallback {
    width: 100%;
    height: 100%;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.markdown-body .music-play-btn {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px -12px rgba(15, 23, 42, 0.6);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.markdown-body .music-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 16px 30px -14px rgba(79, 70, 229, 0.6);
}

.markdown-body .music-body {
    padding: 16px 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.markdown-body .music-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}

.markdown-body .music-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.3);
    padding: 4px 10px;
    border-radius: 999px;
    width: fit-content;
}

.markdown-body .music-progress {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.25);
    overflow: hidden;
    cursor: pointer;
}

.markdown-body .music-progress-bar {
    position: absolute;
    inset: 0;
    width: 0;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    box-shadow: 0 4px 10px -6px rgba(79, 70, 229, 0.6);
}

.markdown-body .music-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}

.markdown-body .music-audio {
    display: none;
}

@media (max-width: 640px) {
    .markdown-body .music-block {
        grid-template-columns: 72px 1fr;
        min-height: 60px;
    }
    .markdown-body .music-cover {
        min-height: 60px;
    }
    .markdown-body .music-cover-img,
    .markdown-body .music-cover-fallback {
        min-height: 60px;
        font-size: 18px;
    }
    .markdown-body .music-body {
        padding: 6px 10px;
        gap: 4px;
    }
    .markdown-body .music-title {
        font-size: 12px;
    }
    .markdown-body .music-meta {
        font-size: 9px;
        padding: 2px 6px;
    }
    .markdown-body .music-progress {
        height: 4px;
    }
    .markdown-body .music-time {
        font-size: 9px;
    }
    .markdown-body .music-play-btn {
        right: 6px;
        bottom: 6px;
        width: 24px;
        height: 24px;
    }
}

/* 视频播放器 - 直链视频 */
.markdown-body .video-block {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(244, 63, 94, 0.2);
    background: #fff;
    box-shadow: 0 12px 30px -20px rgba(244, 63, 94, 0.3);
}

.markdown-body .video-native-header,
.markdown-body .video-embed-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fff1f2 0%, #fce7f3 100%);
    border-bottom: 1px solid rgba(244, 63, 94, 0.1);
}

.markdown-body .video-native-icon,
.markdown-body .video-embed-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px -4px rgba(244, 63, 94, 0.5);
}

.markdown-body .video-native-title,
.markdown-body .video-embed-title {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.markdown-body .video-native-wrapper {
    position: relative;
    background: #000;
}

.markdown-body .video-native-wrapper video {
    display: block;
    width: 100%;
    max-height: 520px;
    outline: none;
}

.markdown-body .video-embed-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}

.markdown-body .video-embed-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 640px) {
    .markdown-body .video-block {
        border-radius: 16px;
    }
    .markdown-body .video-native-header,
    .markdown-body .video-embed-header {
        padding: 10px 14px;
        gap: 8px;
    }
    .markdown-body .video-native-icon,
    .markdown-body .video-embed-icon {
        width: 26px;
        height: 26px;
        border-radius: 8px;
        font-size: 11px;
    }
    .markdown-body .video-native-title,
    .markdown-body .video-embed-title {
        font-size: 12px;
    }
    .markdown-body .video-native-wrapper video {
        max-height: 280px;
    }
}

/* 图片预览器（现代移动优先） */
body.no-scroll {
    overflow: hidden;
    touch-action: none;
}
.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: imageViewerFadeIn 0.2s ease;
}
.image-viewer.hidden {
    display: none;
}
.image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.78) 0%, rgba(2, 6, 23, 0.9) 100%);
    backdrop-filter: blur(10px);
}
.image-viewer-panel {
    position: relative;
    width: min(95vw, 1160px);
    height: min(90vh, 860px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.28) 0%, rgba(15, 23, 42, 0.1) 100%);
    box-shadow: 0 26px 80px -32px rgba(2, 6, 23, 0.78);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.image-viewer.drag-dismiss .image-viewer-panel {
    transform: translateY(calc(var(--viewer-drag, 0) * 1px)) scale(0.98);
    opacity: calc(1 - (var(--viewer-drag, 0) / 420));
}
.image-viewer-topbar {
    position: absolute;
    z-index: 30;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.55) 0%, rgba(2, 6, 23, 0) 100%);
}
.image-viewer-counter {
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.image-viewer-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}
.image-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.18s ease;
    will-change: transform;
}
.image-viewer-img.dragging {
    cursor: grabbing;
    transition: none;
}
.image-viewer-close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 14px 24px -18px rgba(2, 6, 23, 0.9);
}
.image-viewer-nav {
    position: absolute;
    z-index: 30;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.56);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.image-viewer-nav.prev { left: 14px; }
.image-viewer-nav.next { right: 14px; }
.image-viewer-nav.disabled {
    opacity: 0.32;
    pointer-events: none;
}
.image-viewer-bottombar {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px 14px;
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.6) 0%, rgba(2, 6, 23, 0) 100%);
}
.image-viewer-caption {
    color: rgba(255, 255, 255, 0.84);
    font-size: 12px;
    line-height: 1.4;
    min-height: 20px;
    max-width: min(60%, 560px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.image-viewer-toolbar {
    display: inline-flex;
    gap: 6px;
    background: rgba(15, 23, 42, 0.66);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 5px;
    border-radius: 999px;
}
.image-viewer-toolbar button {
    border: none;
    background: transparent;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    font-size: 12px;
    min-width: 34px;
    height: 30px;
    border-radius: 999px;
}
.image-viewer-toolbar button:hover {
    background: rgba(255, 255, 255, 0.14);
}
.image-viewer-save-tip {
    position: absolute;
    z-index: 35;
    top: 54px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(15, 23, 42, 0.58);
    color: rgba(255, 255, 255, 0.92);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.image-viewer-save-tip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.clickable-image {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.clickable-image:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -14px rgba(15, 23, 42, 0.5);
}

@keyframes imageViewerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .image-viewer-panel {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
        background: rgba(2, 6, 23, 0.72);
    }

    .image-viewer-topbar {
        padding: max(10px, env(safe-area-inset-top)) 10px 8px;
    }

    .image-viewer-save-tip {
        top: calc(max(10px, env(safe-area-inset-top)) + 42px);
        font-size: 10px;
        padding: 5px 9px;
    }

    .image-viewer-counter {
        font-size: 11px;
        padding: 5px 9px;
    }

    .image-viewer-close {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .image-viewer-nav {
        width: 38px;
        height: 38px;
        top: auto;
        bottom: max(72px, calc(58px + env(safe-area-inset-bottom)));
        transform: none;
        background: rgba(15, 23, 42, 0.66);
    }
    .image-viewer-nav.prev { left: 10px; }
    .image-viewer-nav.next { right: 10px; }

    .image-viewer-bottombar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 10px max(12px, env(safe-area-inset-bottom));
    }

    .image-viewer-caption {
        max-width: 100%;
        font-size: 11px;
    }

    .image-viewer-toolbar {
        justify-content: center;
        width: 100%;
        border-radius: 14px;
        padding: 4px;
        background: rgba(15, 23, 42, 0.72);
    }

    .image-viewer-toolbar button {
        flex: 1;
        height: 34px;
        border-radius: 10px;
        font-size: 12px;
    }
}

/* 评论区表情：按文字流内联显示（不走 markdown 图片样式） */
.comment-content img.comment-smilie,
.markdown-body img.smilie-inline {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    max-width: none;
    margin: 0 0.1em;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    vertical-align: text-bottom;
    cursor: default;
    transform: none;
}

.comment-content img.comment-smilie:hover,
.markdown-body img.smilie-inline:hover {
    transform: none;
    box-shadow: none;
}

