
/* ============ 美化阅读目录 ============ */
.toc-wrap {
    display: none; /* 默认隐藏，JS检测到标题后显示 */
    position: sticky;
    top: 20px;
    width: 240px;
    flex-shrink: 0;
    align-self: flex-start;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    padding: 0;
    transition: box-shadow 0.3s, border-color 0.3s;
    z-index: 10;
}
.toc-wrap:hover {
    box-shadow: 0 2px 8px rgba(37,99,235,0.08), 0 8px 24px rgba(0,0,0,0.06);
}
/* 目录粘性吸顶状态 - 滚动时增强视觉 */
.toc-wrap.toc-stuck {
    border-color: #bfdbfe;
    box-shadow: 0 4px 16px rgba(37,99,235,0.10), 0 2px 6px rgba(0,0,0,0.06);
}
.toc-wrap::-webkit-scrollbar { width: 3px; }
.toc-wrap::-webkit-scrollbar-track { background: transparent; }
.toc-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.toc-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 目录头部 */
.toc-header {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.toc-header-icon {
    width: 18px;
    height: 18px;
    color: rgba(255,255,255,0.9);
}
.toc-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.03em;
}
.toc-count {
    margin-left: auto;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.2);
    padding: 1px 8px;
    border-radius: 10px;
}

/* 阅读进度条 */
.toc-progress-bar {
    height: 2px;
    background: #e2e8f0;
    position: relative;
}
.toc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    width: 0%;
    transition: width 0.2s;
    border-radius: 1px;
}

/* 目录列表 */
.toc-list-wrap {
    padding: 8px 0;
}
.toc-list, .toc-list ul { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0; padding: 0; }
.toc-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px 7px 16px;
    font-size: 0.8rem;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.45;
    position: relative;
    border-left: 2px solid transparent;
}
.toc-list a:hover {
    color: #2563eb;
    background: #f8fafc;
    border-left-color: #93c5fd;
}
.toc-list a.toc-active {
    color: #1d4ed8;
    font-weight: 500;
    background: linear-gradient(90deg, #eff6ff, #f8fafc);
    border-left-color: #2563eb;
}
.toc-list a.toc-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #2563eb;
    border-radius: 1px;
}

/* 目录层级缩进 */
.toc-list .toc-h1 a { padding-left: 16px; font-weight: 500; font-size: 0.82rem; color: #334155; }
.toc-list .toc-h2 a { padding-left: 28px; }
.toc-list .toc-h3 a { padding-left: 40px; font-size: 0.78rem; }
.toc-list .toc-h4 a { padding-left: 52px; font-size: 0.75rem; color: #94a3b8; }

/* 目录序号 */
.toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 4px;
    flex-shrink: 0;
}
.toc-list a.toc-active .toc-num {
    color: #2563eb;
    background: #dbeafe;
}

/* ============ PC端：图片/视频美化（默认样式，不在媒体查询内） ============ */

/* 图片美化：与文本区分 - 更吸引人 */
.article-content img:not(.chart-img):not(.lb-enabled) {
    display: block;
    margin: 1.5rem auto !important;
    border-radius: 14px;
    box-shadow:
        0 6px 24px rgba(0,0,0,0.08),
        0 2px 8px rgba(0,0,0,0.04),
        0 0 0 1px rgba(0,0,0,0.03);
    border: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: zoom-in;
    position: relative;
}
.article-content img:not(.chart-img):not(.lb-enabled):hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow:
        0 12px 40px rgba(0,0,0,0.12),
        0 4px 12px rgba(0,0,0,0.06),
        0 0 0 2px rgba(37,99,235,0.08);
}
/* 图片灯箱启用时样式 */
.article-content img.lb-enabled {
    cursor: zoom-in;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    position: relative;
}
.article-content img.lb-enabled:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 10px 36px rgba(0,0,0,0.13),
        0 0 0 2px rgba(37,99,235,0.12);
    filter: brightness(1.02);
}
.article-content img.lb-enabled:active {
    transform: scale(0.99);
    transition: transform 0.12s ease;
}

/* 视频：简洁样式+适度圆角 */
.article-content video {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 8px;
    background: transparent !important;
    cursor: pointer;
}
/* 竖版视频：限制最大宽度和高度，避免过大 */
.article-content video.vp-portrait {
    width: auto !important;
    max-width: 420px !important;
    max-height: 55vh !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* iframe视频美化（B站等平台嵌入） */
.article-content iframe {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin: 1rem auto !important;
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.12),
        0 2px 8px rgba(0,0,0,0.06);
    border: none;
    background: #000;
    min-height: 240px;
}

/* ============ 文章主体布局（PC端默认） ============ */
/* 文章主体布局 */
.article-body-wrap {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.article-body-wrap > .flex-1 {
    flex: 1;
    min-width: 0;
}
/* 右侧边栏 */
.article-right-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}
/* 作者信息卡片 */
.author-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.author-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
}
.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 14px;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
    border: 3px solid #bfdbfe;
}
.author-company {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}
.author-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 6px 0;
    font-size: 0.82rem;
    color: #475569;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    transition: all 0.2s;
}
.author-contact:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}
.author-contact i {
    color: #3b82f6;
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}
.author-contact span {
    word-break: break-all;
}

/* 最新文章列表 */
.latest-articles {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s, border-color 0.3s;
}
.latest-articles:hover {
    box-shadow: 0 2px 8px rgba(37,99,235,0.08), 0 8px 24px rgba(0,0,0,0.06);
}
.latest-header {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.latest-header-icon {
    width: 18px;
    height: 18px;
    color: rgba(255,255,255,0.9);
}
.latest-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.03em;
}
.latest-count {
    margin-left: auto;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.2);
    padding: 1px 8px;
    border-radius: 10px;
}

/* 移动端不显示目录 */
@media (max-width: 1024px) {
    .toc-wrap { display: none !important; }
}

/* 移动端文章内容区适配 */
@media (max-width: 767px) {
    /* 只在 html 上隐藏水平滚动条，防止橡皮筋回弹导致的空白 */
    html { overflow-x: hidden; }

    /* body 和 main 占满全宽，但不加 overflow-x 避免裁剪内容 */
    body, main {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 强制文章页所有顶层容器占满全宽 */
    .article-hero,
    .article-hero > div,
    main > div {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    .article-body-wrap { flex-direction: column; }
    /* flex子元素需要显式设置min-width:0才能正确收缩 */
    .flex-1.min-w-0 { min-width: 0 !important; }

    /* 文章内容区域：强制占满、文本自动换行 */
    .article-content {
        padding-right: 0 !important;
        min-width: 0;
        width: 100% !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    /* ===== 防止任何元素撑破容器导致空白 ===== */
    .article-content * {
        max-width: 100% !important;
    }
    /* 表格包裹器、pre、code 保留自己的滚动行为 */
    .article-content .table-wrap,
    .article-content .table-wrap *,
    .article-content pre,
    .article-content pre *,
    .article-content code {
        max-width: none !important;
    }
    /* 强制所有文本元素正常换行（防止 white-space:nowrap 导致溢出） */
    .article-content p,
    .article-content span:not(.toc-num):not(.latest-num),
    .article-content div:not(.table-wrap):not(.table-scroll-hint):not(.table-scroll-label),
    .article-content li,
    .article-content td,
    .article-content th,
    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4,
    .article-content h5,
    .article-content h6,
    .article-content strong,
    .article-content em,
    .article-content a {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }
    /* 保留 pre/code 格式 */
    .article-content pre,
    .article-content pre *,
    .article-content code {
        white-space: pre !important;
        overflow-x: auto !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        max-width: 100% !important;
    }
    /* 图片视频等已单独处理 max-width，这里再兜底 */
    .article-content img,
    .article-content video,
    .article-content iframe,
    .article-content embed,
    .article-content object {
        max-width: 100% !important;
        height: auto !important;
    }
}

.latest-header-icon {
    width: 16px;
    height: 16px;
    color: rgba(255,255,255,0.9);
}
.latest-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
}
.latest-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    flex: 1;
}
.latest-list li {
    margin: 0;
    padding: 0;
}
.latest-list a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 14px;
    font-size: 0.78rem;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.45;
    border-left: 2px solid transparent;
}
.latest-list a:hover {
    color: #2563eb;
    background: #f8fafc;
    border-left-color: #93c5fd;
}
.latest-list a.latest-active {
    color: #1d4ed8;
    font-weight: 500;
    background: linear-gradient(90deg, #eff6ff, #f8fafc);
    border-left-color: #2563eb;
}
.latest-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}
.latest-list a.latest-active .latest-num {
    color: #2563eb;
    background: #dbeafe;
}
.latest-list a.latest-hidden {
    display: none !important;
}

/* 移动端公司信息卡片（封面图下方，≤1280px 显示） */
.article-mobile-author {
    display: none;
    margin-bottom: 1.5rem;
}
.article-mobile-author .mobile-author-inner {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 50%, #2563eb 100%);
    border-radius: 14px;
    padding: 20px 24px;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(37,99,235,0.18);
    position: relative;
    overflow: hidden;
}
/* 装饰光效 */
.article-mobile-author .mobile-author-inner::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -8%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.article-mobile-author .mobile-company-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
}
.article-mobile-author .mobile-company-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}
.article-mobile-author .mobile-company-icon i {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
}
.article-mobile-author .mobile-company-info {
    flex: 1;
    min-width: 0;
}
.article-mobile-author .mobile-company-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
    line-height: 1.4;
    text-align: center;
}
.article-mobile-author .mobile-company-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
    text-align: center;
}
.article-mobile-author .mobile-contact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.article-mobile-author .mobile-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.82rem;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.article-mobile-author .mobile-contact-item:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.25);
    transform: translateY(-1px);
    color: #ffffff;
}
.article-mobile-author .mobile-contact-item i {
    font-size: 0.78rem;
    color: rgba(147,197,253,0.9);
    flex-shrink: 0;
}

/* 移动端隐藏右侧栏 */
@media (max-width: 1280px) {
    .article-right-sidebar { display: none !important; }
    .article-mobile-author { display: block; }
}

/* 防止文章内容中的宽元素撑破容器 */
.article-content img,
.article-content iframe,
.article-content embed,
.article-content object {
    max-width: 100% !important;
    height: auto !important;
}
/* 视频播放器内的video不受全局height:auto限制（竖视频需显式高度） */
.article-content .video-player video {
    max-width: 100%;
    height: auto;
}
.article-content pre,
.article-content code {
    max-width: 100% !important;
    overflow-x: auto;
}

/* ============ 文章内容文字颜色统一 ============ */
.article-content,
.article-content *,
.article-content a,
.article-content strong,
.article-content b,
.article-content span,
.article-content em,
.article-content mark,
.article-content code {
    color: inherit !important;
}
.article-content {
    color: #374151 !important;
}
.article-content a {
    color: #2563eb !important;
}

/* ============ 标题美化 + 段落间距 ============ */
.article-content h2 {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: #1e3a5f !important;
    margin-top: 2em !important;
    margin-bottom: 0.7em !important;
    padding: 0.5em 0.9em 0.5em 1em !important;
    background: linear-gradient(135deg, #eff6ff 0%, #f8faff 100%) !important;
    border-left: 4px solid #2563eb !important;
    border-bottom: 1px solid #dbeafe !important;
    border-radius: 0 8px 8px 0 !important;
    line-height: 1.4 !important;
}
.article-content h3 {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #1e40af !important;
    margin-top: 1.6em !important;
    margin-bottom: 0.55em !important;
    padding-left: 0.7em !important;
    border-left: 3px solid #60a5fa !important;
    line-height: 1.4 !important;
}
.article-content h4 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #374151 !important;
    margin-top: 1.4em !important;
    margin-bottom: 0.4em !important;
}
/* 正文段落间距 */
.article-content p {
    margin-bottom: 1.1em !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    font-size: 1.0rem !important;
}
/* 列表样式 */
.article-content ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin-bottom: 1em !important;
}
.article-content ul > li {
    padding-left: 1.4em !important;
    position: relative !important;
    margin-bottom: 0.4em !important;
    line-height: 1.75 !important;
}
.article-content ul > li::before {
    content: '▸' !important;
    color: #3b82f6 !important;
    position: absolute !important;
    left: 0 !important;
    font-size: 0.85em !important;
}
.article-content ol {
    padding-left: 1.6em !important;
    margin-bottom: 1em !important;
}
.article-content ol > li {
    margin-bottom: 0.4em !important;
    line-height: 1.75 !important;
}
/* 引用块 */
.article-content blockquote {
    border-left: 4px solid #93c5fd !important;
    background: #f0f9ff !important;
    padding: 0.8em 1.2em !important;
    margin: 1.2em 0 !important;
    border-radius: 0 8px 8px 0 !important;
    color: #1e40af !important;
    font-style: italic !important;
}
/* strong/em */
.article-content strong, .article-content b {
    color: #1e293b !important;
    font-weight: 700 !important;
}
.article-content em {
    color: #475569 !important;
}

/* ============ 文章表格样式（首行H1取消顶部间距 + 表格紧凑+蓝色表头） ============ */
.article-content h1:first-child {
    margin-top: 0 !important;
}
.article-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    display: table !important;
}
.article-content table th,
.article-content table td {
    border: 1px solid #e2e8f0 !important;
    padding: 0.6rem 0.8rem !important;
    text-align: center !important;
}
.article-content table th {
    font-weight: 700 !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    border-color: #2563eb !important;
}
.article-content table td {
    color: #334155 !important;
}
.article-content table tbody tr:nth-child(even) {
    background-color: #f8fafc !important;
}
.article-content table tbody tr:hover {
    background-color: #eff6ff !important;
}

/* 表格横向滚动容器 */
.article-content .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    position: relative;
}
.article-content .table-wrap table {
    margin: 0 !important;
    min-width: 100% !important;
}

/* 表格滚动提示箭头 */
.table-scroll-hint {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95) 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s;
}
.table-scroll-hint svg {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    animation: tableScrollHint 1.5s ease-in-out infinite;
}
.table-scroll-hint.hidden { opacity: 0; }

@keyframes tableScrollHint {
    0%, 100% { transform: translateX(0); opacity: 0.6; }
    50% { transform: translateX(4px); opacity: 1; }
}

/* 移动端表格底部滚动提示文字 */
.table-scroll-label {
    display: none;
    text-align: center;
    padding: 4px 0;
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
@media (max-width: 768px) {
    .table-scroll-label { display: block; }
}

/* ============ 文章底部信息栏 ============ */
.article-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}
.article-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    color: #2563eb;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid #bfdbfe;
}
.article-back-top {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 22px;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 8px rgba(37, 99, 235, 0.25),
        0 0 0 1px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.03em;
}
.article-back-top::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.article-back-top:hover::before {
    transform: translateX(100%);
}
.article-back-top:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 40%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(37, 99, 235, 0.35),
        0 0 0 1px rgba(124, 58, 237, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.article-back-top:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}
.article-back-top svg {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.article-back-top:hover svg {
    transform: translateY(-2px);
}
/* ============ 页面美化增强 ============ */

/* 文章头部 Hero 区域 */
.article-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 35%, #1e40af 65%, #2563eb 100%);
    padding: 0.5rem 0 0.5em;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.article-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -8%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
    animation: heroFloat 12s ease-in-out infinite;
}
.article-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    pointer-events: none;
    animation: heroFloat2 15s ease-in-out infinite;
}
@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-15px, 10px); }
}
@keyframes heroFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(12px, -8px); }
}
.article-hero-inner {
    position: relative;
    z-index: 1;
}
.article-hero .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1.25rem;
}
.article-hero .breadcrumb a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: color 0.2s;
}
.article-hero .breadcrumb a:hover { color: #ffffff; }
.article-hero .breadcrumb .sep { color: rgba(255,255,255,0.35); }
.article-hero .breadcrumb .current { color: rgba(255,255,255,0.9); }

.article-hero-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0;
}
.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
    padding: 5px 14px;
    border-radius: 9999px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.08);
    transition: background 0.2s, transform 0.2s;
}
.article-meta span:hover {
    background: rgba(255,255,255,0.17);
    transform: translateY(-1px);
}
.article-meta i { color: rgba(147,197,253,0.9); font-size: 0.78rem; }

/* 文章正文卡片 */
.article-main-card {
    background: #ffffff;
    border: 1px solid #e8ecf1;
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.03),
        0 8px 32px rgba(0,0,0,0.025);
    transition: box-shadow 0.35s ease;
    animation: cardEntry 0.5s ease both;
}
@keyframes cardEntry {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.article-main-card:hover {
    box-shadow:
        0 4px 16px rgba(0,0,0,0.05),
        0 16px 48px rgba(0,0,0,0.04),
        0 0 0 1px rgba(37,99,235,0.05) inset;
}

/* 页面元素淡入动画 */
.fade-in-up {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}
.fade-in-up-d1 { transition-delay: 0.08s; }
.fade-in-up-d2 { transition-delay: 0.16s; }
.fade-in-up-d3 { transition-delay: 0.24s; }

/* ============ 社交分享按钮 ============ */
.social-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    flex-shrink: 0;
}
.social-share-btn:hover { transform: translateY(-2px); }
.social-share-btn.wechat-btn:hover {
    background: #07c160;
    border-color: #07c160;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(7,193,96,0.3);
}
.social-share-btn.weibo-btn:hover {
    background: #e6162d;
    border-color: #e6162d;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(230,22,45,0.3);
}
.social-share-btn.copy-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.social-share-btn.qq-btn:hover {
    background: #12B7F5;
    border-color: #12B7F5;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(18,183,245,0.3);
}

/* 微信分享二维码弹窗 */
.wechat-qr-modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 9999;
    justify-content: center; align-items: center;
}
.wechat-qr-modal.show { display: flex; }
.wechat-qr-card {
    background: #fff; border-radius: 16px; padding: 32px 28px;
    text-align: center; max-width: 320px; width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: qrPopIn 0.3s ease;
}
@keyframes qrPopIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.wechat-qr-card .qr-title {
    font-size: 1rem; font-weight: 700; color: #07c160; margin-bottom: 4px;
}
.wechat-qr-card .qr-subtitle {
    font-size: 0.78rem; color: #94a3b8; margin-bottom: 16px;
}
.wechat-qr-card .qr-wrap {
    width: 200px; height: 200px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: #fafafa; border-radius: 8px; overflow: hidden;
}
.wechat-qr-card .qr-loading {
    color: #94a3b8; font-size: 0.82rem;
}
.wechat-qr-card .qr-close {
    display: inline-block; padding: 8px 28px; background: #f1f5f9;
    color: #64748b; border: none; border-radius: 8px;
    font-size: 0.82rem; cursor: pointer; transition: all 0.2s;
}
.wechat-qr-card .qr-close:hover { background: #e2e8f0; color: #334155; }

/* Toast提示 */
.toast-msg {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============ B站播放器组件 ============ */
.bilibili-player {
    max-width: 780px;
    width: 100%;
    margin: 1em auto;
    box-sizing: border-box;
}
/* 封面容器 */
.bilibili-cover {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s ease;
    line-height: 0; /* 消除图片下方间隙 */
}
.bilibili-cover:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0,0,0,0.18);
}
.bilibili-cover:active {
    transform: scale(0.98);
}
/* 播放按钮 */
.bilibili-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(231,76,60,0.88);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 4px 14px rgba(231,76,60,0.35);
}
.bilibili-cover:hover .bilibili-play-btn {
    background: rgba(220,53,69,0.95);
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 0 6px 22px rgba(220,53,69,0.5);
}
/* iframe容器（默认16:9，竖屏视频JS动态覆盖 → scale-to-fit裁剪黑边） */
.bilibili-iframe-wrap {
    display: none;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    background: #000;
}
.bilibili-iframe-wrap.loaded {
    display: block;
}
.bilibili-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    /* JS会对竖屏视频设置 transform-origin + scale, 但用 width/left 更简单 */
}
/* ★ 竖屏视频：放大iframe让视频填满容器，裁掉左右黑边 */
.bilibili-player.scaled .bilibili-iframe-wrap {
    /* padding-bottom 由JS动态设置 = videoRatio*100% */
    /* width保持外层max-width约束 */
}
.bilibili-player.scaled .bilibili-iframe-wrap iframe {
    /* width 和 left 由JS动态计算 */
}
/* Loading Spinner */
.bilibili-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #000;
    color: #fff;
    font-size: 14px;
    z-index: 1;
}
.bilibili-loading.hidden {
    display: none;
}
.bilibili-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: biliSpin 0.7s linear infinite;
}
@keyframes biliSpin {
    to { transform: rotate(360deg); }
}
/* 容器内video/iframe不受全局margin影响 */
.article-content .video-player video,
.article-content .bilibili-player video,
.article-content .bilibili-player iframe {
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 12px !important;
    transform: none !important;
}
.article-content .video-player iframe {
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}
/* ============ 直链视频播放器（七牛云等） ============ */
.video-player {
    max-width: 780px;
    width: 100%;
    margin: 0 auto !important;
    background: transparent !important;
    padding: 0;
}
.video-player video {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: fill;
    display: block;
    background: transparent !important;
}
/* 竖版视频容器 */
.video-player.vp-vertical {
    max-width: 420px;
    margin: 0 auto !important;
    background: transparent !important;
    padding: 0;
}
/* 移动端视频自适应 */
@media (max-width: 768px) {
    .video-player {
        max-width: 100%;
    }
    .video-player video {
        border-radius: 0;
    }
    /* 移动端竖屏视频：限制最大高度，避免过高 */
    .article-content video.vp-portrait {
        max-height: 50vh !important;
    }
}
/* 降级状态：iframe加载失败 */
.bilibili-player.failed .bilibili-iframe-wrap {
    display: none !important;
}
/* 移动端 */
@media (max-width: 768px) {
    .bilibili-player {
        max-width: 100%;
    }
    .bilibili-cover {
        border-radius: 10px;
    }
    .bilibili-play-btn {
        width: 52px;
        height: 52px;
    }
    .bilibili-play-btn svg {
        width: 22px;
        height: 22px;
    }
    .bilibili-iframe-wrap {
        border-radius: 10px;
    }
    .bilibili-loading {
        font-size: 12px;
    }
}

/* ============ 视频/图片灯箱 ============ */
.lightbox-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.25s ease;
    cursor: zoom-out;
}
.lightbox-overlay.active { opacity: 1; }
.lightbox-overlay .lb-close {
    position: absolute; top: 18px; right: 22px;
    background: rgba(255,255,255,0.15); color: #fff;
    border: none; border-radius: 50%;
    width: 40px; height: 40px; font-size: 22px;
    cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.lightbox-overlay .lb-close:hover { background: rgba(255,255,255,0.30); }
.lightbox-overlay .lb-content {
    max-width: 95vw; max-height: 95vh;
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 8px 60px rgba(0,0,0,0.5);
    cursor: default;
}
.lightbox-overlay .lb-content video,
.lightbox-overlay .lb-content iframe {
    width: 100%; height: 100%;
    max-width: 95vw; max-height: 95vh;
    display: block; background: #000;
}
.lightbox-overlay .lb-content img {
    max-width: 95vw; max-height: 95vh;
    display: block; border-radius: 4px;
}
/* 全屏按钮 */
.bilibili-fs-btn, .video-fs-btn {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.65); color: #fff;
    border: none; border-radius: 6px;
    padding: 5px 12px; font-size: 13px;
    cursor: pointer; z-index: 5;
    display: flex; align-items: center; gap: 4px;
    transition: background 0.2s; pointer-events: auto;
}
.bilibili-fs-btn:hover, .video-fs-btn:hover { background: rgba(0,0,0,0.85); }

/* 文章图片可点击放大 */
.article-content img {
    cursor: zoom-in; transition: box-shadow 0.2s;
}
.article-content img:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

/* ============ 评论区样式 v2 — 美化版 ============ */
.comments-section {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899) 1;
}
.comments-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}
.comments-section-title i {
    color: #3b82f6;
    font-size: 1.1rem;
}
.comments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    padding: 0 7px;
    box-shadow: 0 2px 8px rgba(59,130,246,0.25);
    letter-spacing: 0;
}

/* ---- 评论表单卡片 ---- */
.comment-form-wrap {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
    transition: box-shadow 0.3s ease;
}
.comment-form-wrap:focus-within {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 30px rgba(59,130,246,0.08);
    border-color: #cbd5e1;
}
.comment-form-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-form-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #3b82f6, #6366f1);
    border-radius: 2px;
}

/* 信息行 */
.comment-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}
@media (max-width: 640px) {
    .comment-info-row { grid-template-columns: 1fr; }
}
.comment-info-row input {
    width: 100%;
    padding: 0.7rem 0.95rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #1e293b;
    background: #fafbfc;
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}
.comment-info-row input:hover {
    border-color: #cbd5e1;
    background: #fff;
}
.comment-info-row input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.08);
}
.comment-info-row input.error {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 4px rgba(239,68,68,0.06);
}
.comment-info-row input::placeholder {
    color: #94a3b8;
}
.comment-logged-in-info {
    font-size: 0.9rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.comment-logged-in-info i {
    color: #3b82f6;
    font-size: 1.1rem;
}
.comment-logged-in-label {
    font-size: 0.7rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 想法框 */
.comment-form-textarea {
    margin-bottom: 0.15rem;
    position: relative;
}
.comment-form-textarea textarea {
    width: 100%;
    min-height: 130px;
    padding: 0.9rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.92rem;
    color: #1e293b;
    background: #fafbfc;
    outline: none;
    resize: vertical;
    font-family: inherit;
    line-height: 1.7;
    box-sizing: border-box;
    transition: all 0.25s ease;
}
.comment-form-textarea textarea:hover {
    border-color: #cbd5e1;
    background: #fff;
}
.comment-form-textarea textarea:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.08);
}
.comment-form-textarea textarea.error {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 4px rgba(239,68,68,0.06);
}
.comment-form-textarea textarea::placeholder {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* 手机号/邮箱实时警告 */
.comment-contact-warn {
    font-size: 0.8rem;
    color: #f59e0b;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    animation: warnShake 0.4s ease;
}
@keyframes warnShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* 底部操作栏 */
.comment-form-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.comment-form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}
.comment-submit-btn {
    padding: 0.65rem 1.75rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(37,99,235,0.2);
    letter-spacing: 0.01em;
}
.comment-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.comment-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(37,99,235,0.2);
}
.comment-submit-btn:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.comment-cancel-reply {
    font-size: 0.84rem;
    color: #64748b;
    cursor: pointer;
    border: none;
    background: #f1f5f9;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s;
    font-weight: 500;
}
.comment-cancel-reply:hover {
    color: #3b82f6;
    background: #eff6ff;
}
.comment-form-error {
    color: #ef4444;
    font-size: 0.84rem;
    margin-top: 0.6rem;
    display: none;
    padding: 0.5rem 0.85rem;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}
.comment-form-success {
    color: #10b981;
    font-size: 0.84rem;
    margin-top: 0.6rem;
    display: none;
    padding: 0.5rem 0.85rem;
    background: #f0fdf4;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
}

/* ---- 评论列表项 ---- */
.comment-list-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}
.comment-list-item:hover {
    background: #fafbfd;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 8px;
}
.comment-list-item:last-child { border-bottom: none; }
.comment-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
}
/* 头像颜色变体 —— JS 中通过内联 style 控制 */
.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}
.comment-author-badge {
    font-size: 0.62rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 5px;
    letter-spacing: 0.05em;
}
.comment-time {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: auto;
    flex-shrink: 0;
}
.comment-body {
    font-size: 0.92rem;
    line-height: 1.72;
    color: #334155;
    padding-left: 50px;
    word-break: break-word;
}
.comment-body .reply-to {
    display: inline-block;
    color: #6366f1;
    font-weight: 500;
    font-size: 0.82rem;
    background: #eef2ff;
    border-radius: 6px;
    padding: 1px 8px;
    margin-bottom: 4px;
    margin-right: 4px;
    line-height: 1.6;
}
.comment-body .reply-to em {
    font-style: normal;
    font-weight: 700;
    color: #4f46e5;
}
.comment-actions {
    padding-left: 50px;
    margin-top: 0.45rem;
    display: flex;
    gap: 1.2rem;
}
.comment-action-btn {
    font-size: 0.8rem;
    color: #94a3b8;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.comment-action-btn:hover {
    color: #3b82f6;
    background: #eff6ff;
}
.comment-action-btn.del-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* 子回复 — 聊天线程风格 */
.comment-replies {
    margin-left: 26px;
    margin-top: 0.5rem;
    padding: 0.5rem 0 0.5rem 1rem;
    border-left: 3px solid #dbeafe;
    background: linear-gradient(90deg, rgba(219,234,254,0.25) 0%, rgba(255,255,255,0) 100%);
    border-radius: 0 10px 10px 0;
}
.comment-reply-item {
    padding: 0.65rem 0 0.65rem 0.35rem;
    border-bottom: 1px dashed #f0f4ff;
    position: relative;
}
.comment-reply-item::before {
    content: '';
    position: absolute;
    left: -1.15rem;
    top: 18px;
    width: 8px;
    height: 8px;
    background: #93c5fd;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dbeafe;
}
.comment-reply-item:last-child { border-bottom: none; }
.comment-reply-item .comment-header { margin-bottom: 0.3rem; }
.comment-reply-item .comment-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
}
.comment-reply-item .comment-body { padding-left: 40px; font-size: 0.87rem; }
.comment-reply-item .comment-actions { padding-left: 40px; }

/* 加载状态 */
.comments-loading {
    text-align: center;
    padding: 3rem 0;
    color: #94a3b8;
    font-size: 0.9rem;
}
.comments-loading i {
    font-size: 1.5rem;
    color: #3b82f6;
    display: block;
    margin-bottom: 0.6rem;
}
.comments-empty {
    text-align: center;
    padding: 3.5rem 1rem;
    color: #94a3b8;
}
.comments-empty i {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
    color: #e2e8f0;
    transition: transform 0.3s ease;
}
.comments-empty:hover i {
    transform: scale(1.1);
}
.comments-empty p { margin: 0; font-size: 0.9rem; }

/* 加载失败 */
.comments-load-error {
    text-align: center;
    padding: 3rem 1rem;
}
.comments-load-error i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    color: #f59e0b;
}
.comments-load-error p {
    margin: 0 0 1rem 0;
    font-size: 0.92rem;
    color: #64748b;
}
.comment-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.4rem;
    background: #fff;
    color: #3b82f6;
    border: 1.5px solid #3b82f6;
    border-radius: 10px;
    font-size: 0.87rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}
.comment-retry-btn:hover {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 12px rgba(59,130,246,0.25);
    transform: translateY(-1px);
}

/* 分页 */
.comments-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
.comments-page-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}
.comments-page-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}
.comments-page-btn.active {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59,130,246,0.2);
}
.comments-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 回复表单（内联） */
.inline-reply-form {
    margin-top: 0.5rem;
    padding-left: 48px;
}
.inline-reply-form textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.87rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
    background: #fafbfc;
    box-sizing: border-box;
    transition: all 0.25s ease;
}
.inline-reply-form textarea:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.06);
}
.inline-reply-form .reply-form-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.inline-reply-form .reply-form-row input {
    flex: 1;
    padding: 0.5rem 0.7rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.82rem;
    outline: none;
    background: #fafbfc;
    box-sizing: border-box;
    transition: all 0.2s;
}
.inline-reply-form .reply-form-row input:focus {
    border-color: #3b82f6;
    background: #fff;
}
.inline-reply-form .reply-form-row input.error {
    border-color: #ef4444;
    background: #fef2f2;
}
.reply-submit-btn {
    padding: 0.5rem 1.1rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}
.reply-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* 评论区移动端适配 */
@media (max-width: 768px) {
    .comments-section {
        margin-top: 2.5rem;
        padding-top: 1.75rem;
    }
    .comment-form-wrap {
        padding: 1.25rem;
        border-radius: 12px;
    }
    .comment-form-textarea textarea {
        min-height: 110px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    .comment-info-row input {
        font-size: 16px; /* 防止iOS缩放 */
    }
    .comment-list-item {
        padding: 1rem 0;
    }
    .comment-list-item:hover {
        margin: 0 -0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .comment-body {
        padding-left: 44px;
        font-size: 0.88rem;
    }
    .comment-actions {
        padding-left: 44px;
    }
    .comment-replies {
        margin-left: 18px;
        padding: 0.35rem 0 0.35rem 0.65rem;
    }
    .comment-reply-item::before {
        left: -0.85rem;
        width: 6px;
        height: 6px;
    }
    .comment-reply-item .comment-body {
        padding-left: 34px;
    }
    .comment-reply-item .comment-actions {
        padding-left: 34px;
    }
    .comment-submit-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
    }
    .comments-empty i {
        font-size: 2.5rem;
    }
}

/* ============ 媒体模式（纯图片/视频文章）沉浸式浏览 ============ */
.media-heavy .article-hero {
    padding: 0.3rem 0 0.3em !important;
    margin-bottom: 0.5rem !important;
    background: #ffffff !important;
}
.media-heavy .article-hero-title {
    font-size: 1.15rem !important;
    color: #1e293b !important;
    text-shadow: none !important;
    margin-bottom: 0.4rem !important;
}
.media-heavy .article-hero .breadcrumb {
    margin-bottom: 0.4rem !important;
}
.media-heavy .article-hero .breadcrumb a,
.media-heavy .article-hero .breadcrumb span,
.media-heavy .article-hero .breadcrumb .current {
    color: #64748b !important;
}
.media-heavy .article-hero .breadcrumb a:hover { color: #2563eb !important; }
.media-heavy .article-meta { display: none !important; }
.media-heavy .article-right-sidebar { display: none !important; }
.media-heavy .toc-wrap { display: none !important; }
.media-heavy .article-body-wrap { gap: 0 !important; }
.media-heavy .article-body-wrap > .flex-1 { max-width: 100% !important; }
.media-heavy .flex-1.min-w-0 > img.w-full.rounded-xl {
    border-radius: 0 !important;
    margin-bottom: 0.25rem !important;
    box-shadow: none !important;
    max-height: none !important;
}
.media-heavy .article-main-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    animation: none !important;
}
.media-heavy .article-main-card:hover {
    box-shadow: none !important;
}
.media-heavy .article-footer-bar {
    border-top: 1px solid #f1f5f9 !important;
    margin-top: 1.5rem !important;
    padding-top: 1rem !important;
}
/* 媒体模式下图片/视频最大化 */
.media-heavy .article-content img {
    display: block;
    margin: 0.25rem auto !important;
    border-radius: 0.25rem;
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.media-heavy .article-content img:hover {
    transform: scale(1.01);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.media-heavy .article-content video,
.media-heavy .article-content iframe {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.25rem auto !important;
}
/* 媒体模式下的移动端作者卡片 */
.media-heavy .article-mobile-author { display: none !important; }

/* ============ 图片/视频灯箱 ============ */
.media-lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.96);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    animation: lbFadeIn .35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}
.media-lightbox.show { display: flex; }

@keyframes lbFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(10px); }
}

/* 图片样式优化 */
.media-lightbox img {
    max-width: 94vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 12px;
    cursor: default;
    animation: lbImgIn .4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 12px 48px rgba(0,0,0,0.6),
        0 0 0 1px rgba(255,255,255,0.08);
    user-select: none;
    -webkit-user-drag: none;
}
@keyframes lbImgIn {
    from { opacity: 0; transform: scale(0.9) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 灯箱内的视频样式优化 */
.media-lightbox .lb-video-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 92vw;
    max-width: 1100px;
    animation: lbVidIn .4s cubic-bezier(0.4, 0, 0.2, 1);
}
.media-lightbox .lb-video-wrap video {
    width: 100%;
    max-height: 92vh;
    border-radius: 16px;
    box-shadow:
        0 16px 56px rgba(0,0,0,0.7),
        0 0 0 2px rgba(255,255,255,0.06);
    animation: lbVidIn .4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes lbVidIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 关闭按钮优化 */
.media-lightbox .lb-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    backdrop-filter: blur(8px);
}
.media-lightbox .lb-close:hover {
    background: rgba(255,80,80,0.75);
    transform: scale(1.12) rotate(90deg);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 4px 16px rgba(255,80,80,0.3);
}

/* 导航按钮优化 */
.media-lightbox .lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.06);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    backdrop-filter: blur(8px);
}
.media-lightbox .lb-nav:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.1);
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 4px 16px rgba(255,255,255,0.1);
}
.media-lightbox .lb-prev { left: 20px; }
.media-lightbox .lb-next { right: 20px; }

/* 计数器优化 */
.media-lightbox .lb-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 500;
    background: rgba(0,0,0,0.55);
    padding: 7px 20px;
    border-radius: 24px;
    backdrop-filter: blur(10px);
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.06);
    letter-spacing: 0.08em;
}

/* 移动端灯箱适配优化 */
@media (max-width: 768px) {
    .media-lightbox .lb-close {
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
        font-size: 22px;
    }
    .media-lightbox .lb-nav {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    .media-lightbox .lb-prev { left: 12px; }
    .media-lightbox .lb-next { right: 12px; }
    .media-lightbox img {
        max-width: 98vw;
        max-height: 90vh;
        border-radius: 8px;
    }
    .media-lightbox .lb-video-wrap {
        width: 96vw;
    }
    .media-lightbox .lb-video-wrap video {
        border-radius: 10px;
    }
    .media-lightbox .lb-counter {
        font-size: 12px;
        padding: 5px 16px;
        bottom: 18px;
    }
}

/* 灯箱启用时，文章内图片显示可点击手势 */
.article-content img.lb-enabled {
    cursor: zoom-in;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.article-content img.lb-enabled:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 10px 36px rgba(0,0,0,0.13),
        0 0 0 2px rgba(37,99,235,0.12);
    filter: brightness(1.02);
}
