/* 博客内容样式 - 处理从富文本编辑器转换的内容 */

/* 内容区域基础样式 */
.atf-blog-details .content-section {
    margin-bottom: 1.5rem;
}

/* 高亮区域 */
.atf-blog-details .highlight-section {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-left: 4px solid var(--thm-base);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 8px;
}

.atf-blog-details .highlight-section h3 {
    color: var(--thm-black);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* 编号列表样式 */
.atf-blog-details .numbered-item {
    display: flex;
    align-items: flex-start;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.atf-blog-details .numbered-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.atf-blog-details .numbered-item .number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--thm-base);
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
}

.atf-blog-details .numbered-item .text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--thm-p);
}

/* 清理空的div和section */
.atf-blog-details .content-section:empty,
.atf-blog-details div:empty:not(.group-empty) {
    display: none;
}

/* 图片样式优化 - 兼容 picture 标签和 img 标签 */
.atf-blog-details img,
.atf-blog-details picture {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
    display: block;
}

/* picture 标签内的 img 继承样式 */
.atf-blog-details picture img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 段落样式优化 */
.atf-blog-details p {
    line-height: 1.8;
    margin-bottom: 1.2rem;
    color: var(--thm-p);
}

.atf-blog-details p strong {
    color: var(--thm-black);
    font-weight: 600;
}

.atf-blog-details p span {
    display: inline;
}

/* 强调文字 */
.atf-blog-details em {
    background: linear-gradient(120deg, #fffacd 0%, #fff8dc 100%);
    padding: 2px 4px;
    border-radius: 3px;
    font-style: normal;
}

/* 分隔线样式 */
.atf-blog-details .group-empty {
    height: 1px;
    background: linear-gradient(90deg, transparent, #dee2e6, transparent);
    margin: 2rem 0;
}

/* 列表项样式 */
.atf-blog-details ul li,
.atf-blog-details ol li,
.atf-post-content ul li,
.atf-post-content ol li {
    font-size: 16px;
    line-height: 24px;
    color: var(--thm-p);
    margin-bottom: 0.8rem;
}

.atf-blog-details figcaption,
.atf-post-content figcaption,
.atf-blog-details .wp-element-caption,
.atf-post-content .wp-element-caption {
    font-size: 14px;
    line-height: 22px;
    color: var(--thm-p);
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

/* 引用块样式 */
.atf-blog-details blockquote,
.atf-post-content blockquote {
    margin: 1.5rem 0;
    padding: 0;
    border: 0 !important;
    border-left: 0 !important;
    border-radius: 0;
    background: transparent;
    color: var(--v2-text-body, #4b5563);
    font-style: normal;
    text-align: left;
    text-indent: 0;
    box-shadow: none;
    outline: 0;
}

.atf-post-details.atf-style1 .atf-blog-details blockquote,
.atf-post-details.atf-style1 .atf-post-content blockquote {
    margin: 1.5rem 0;
    padding: 0;
    border: 0 !important;
    border-left: 0 !important;
    border-radius: 0;
    background: transparent;
    color: var(--v2-text-body, #4b5563);
    font-style: normal;
    text-align: left;
    text-indent: 0;
    box-shadow: none;
    outline: 0;
}

.atf-blog-details blockquote::before,
.atf-blog-details blockquote::after,
.atf-post-content blockquote::before,
.atf-post-content blockquote::after,
.atf-post-details.atf-style1 blockquote::before,
.atf-post-details.atf-style1 blockquote::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    border-left: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.atf-blog-details blockquote > p,
.atf-blog-details blockquote > cite,
.atf-blog-details blockquote > small,
.atf-post-content blockquote > cite,
.atf-post-content blockquote > small,
.atf-post-content blockquote > p,
.atf-post-details.atf-style1 blockquote > cite,
.atf-post-details.atf-style1 blockquote > small,
.atf-post-details.atf-style1 blockquote > p,
.atf-blog-details blockquote cite,
.atf-post-content blockquote cite,
.atf-post-details.atf-style1 blockquote cite,
.atf-blog-details blockquote small,
.atf-post-content blockquote small,
.atf-post-details.atf-style1 blockquote small {
    border: 0 !important;
    border-left: 0 !important;
    margin-left: 0;
    padding-left: 0;
    background: transparent;
    box-shadow: none;
    text-indent: 0;
}

/* 代码块样式 */
.atf-blog-details pre {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.atf-blog-details code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

/* 表格样式 */
.atf-blog-details table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.atf-blog-details table th,
.atf-blog-details table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.atf-blog-details table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .atf-blog-details .highlight-section {
        padding: 1rem;
    }

    .atf-blog-details .numbered-item {
        padding: 0.75rem;
    }

    .atf-blog-details .numbered-item .number {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .atf-blog-details img,
    .atf-blog-details picture {
        margin: 1rem 0;
    }

    .atf-blog-details figcaption,
    .atf-post-content figcaption,
    .atf-blog-details .wp-element-caption,
    .atf-post-content .wp-element-caption {
        margin-top: 0.5rem;
    }
}

/* 修复内容中的错误闭合标签 */
.atf-blog-details h1:empty,
.atf-blog-details h2:empty,
.atf-blog-details h3:empty,
.atf-blog-details h4:empty,
.atf-post-content h1:empty,
.atf-post-content h2:empty,
.atf-post-content h3:empty,
.atf-post-content h4:empty {
    display: none;
}

/* 清理多余的空白 */
.atf-blog-details br + br {
    display: none;
}

/* 特殊高亮文字 */
.atf-blog-details span:has-text("SkyEye"),
.atf-blog-details span:has-text("ToupTek") {
    color: var(--thm-base);
    font-weight: 500;
}

/* Keep editorial quotes as plain text without a left accent. */
body .atf-post-details.atf-style1 .atf-blog-details blockquote,
body .atf-post-details.atf-style1 .atf-post-content blockquote,
body .atf-blog-details blockquote,
body .atf-post-content blockquote {
    border: 0 !important;
    border-left: 0 !important;
    border-left-width: 0 !important;
    border-left-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
}

body .atf-post-details.atf-style1 blockquote::before,
body .atf-post-details.atf-style1 blockquote::after,
body .atf-blog-details blockquote::before,
body .atf-blog-details blockquote::after,
body .atf-post-content blockquote::before,
body .atf-post-content blockquote::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    border-left: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body .atf-post-details.atf-style1 blockquote > p,
body .atf-post-details.atf-style1 blockquote cite,
body .atf-blog-details blockquote > p,
body .atf-blog-details blockquote cite,
body .atf-post-content blockquote > p,
body .atf-post-content blockquote cite {
    border: 0 !important;
    border-left: 0 !important;
    border-left-width: 0 !important;
    border-left-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
