/* 所有样式都限制在 .article-content 作用域内 */

/* 基础文本样式 - 提升可读性 */
.article-content {
    line-height: 1.8;
    letter-spacing: 0.01em;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.article-content p {
    margin-bottom: 0.5em;
    line-height: 1.8;
    word-spacing: 0.05em;
}

/* 标题样式 - 增强层次感 */
.article-content h1 {
    font-size: 2em;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.4em;
    margin-bottom: 0.8em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #e5e7eb;
}

.article-content h2 {
    font-size: 1.6em;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1em;
    margin-bottom: 0.7em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #e5e7eb;
}

.article-content h3 {
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.4em;
    margin-bottom: 0.6em;
}

.article-content h4 {
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 1.2em;
    margin-bottom: 0.5em;
}

.article-content h5 {
    font-size: 1.05em;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.article-content h6 {
    font-size: 1em;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

/* 列表样式 - 增加间距和可读性 */
.article-content ul,
.article-content ol {
    margin-top: 1em;
    margin-bottom: 1.5em;
    padding-left: 2em;
    line-height: 1.8;
    max-width: 100%;
    overflow-wrap: break-word;
}

.article-content li {
    margin-bottom: 0.6em;
    line-height: 1.8;
}

.article-content ul li {
    list-style-type: disc;
}

.article-content ol li {
    list-style-type: decimal;
}

.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* 代码块样式 - 仅保留字体大小，其他由 Prism.js 处理 */
.article-content pre {
    font-size: 0.9em;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    word-wrap: normal;
    word-break: normal;
}

.article-content pre code {
    font-size: inherit;
    padding-top: 1em;
    padding-bottom: 1em;
    background-color: #fdfdfd;
    display: block;
    white-space: pre;
    overflow-x: auto;
    word-break: normal !important;
    overflow-wrap: normal !important;
    word-wrap: normal !important;
}

/* 行内代码样式（代码块内的 code 由上面的规则处理） */
.article-content code:not(pre code) {
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 引用块样式 - 与代码块风格协调 */
.article-content blockquote {
    position: relative;
    padding: 1em 1em !important;
    margin: 0 0 1.5em!important;
    font-size: 1.05em;
    line-height: 1.8;
    border-left: 10px solid #3b82f6 !important;
    box-shadow: -1px 0px 0px 0px #3b82f6, 0px 0px 0px 1px #dfdfdf;
    background-color: #fdfdfd;
    border-radius: 0;
    margin-left: 0 !important;
    font-style: normal;
    color: inherit;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-content blockquote p {
    margin-bottom: 0.8em;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* 分隔线样式 */
.article-content hr {
    margin-top: 2.5em;
    margin-bottom: 2.5em;
    border: 0;
    border-top: 2px solid #e5e7eb;
    height: 0;
}

/* 链接样式 */
.article-content a {
    color: #0d6efd;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
    word-break: break-all;
    overflow-wrap: break-word;
}

.article-content a:hover {
    color: #0a58ca;
    text-decoration-thickness: 2px;
}

.article-content a:focus {
    color: #0a58ca;
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 2px;
}

.article-content a:active {
    color: #0854b3;
}

/* 图片样式 - 增加间距 */
.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2em auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 表格样式 */
.article-content table {
    width: 100%;
    max-width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.95em;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content table th,
.article-content table td {
    padding: 0.75em 1em;
    border: 1px solid #e5e7eb;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}

.article-content table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.article-content table tr:nth-child(even) {
    background-color: #f9fafb;
}

/* 强调文本 */
.article-content strong {
    font-weight: 600;
    color: inherit;
}

.article-content em {
    font-style: italic;
}

/* 首段样式 */
.article-content > p:first-child {
    font-size: 1.1em;
    line-height: 1.9;
    color: #374151;
}