/* =====================================================================
   文章正文统一样式（微信公众号阅读风格）
   应用于四个栏目的详情页：本网讯 / 信息发布 / 校园戏剧 / 编剧必备
   与后台 UEditor 编辑区样式（/static/common/ueditor/themes/iframe.css）保持一致，
   实现"后台编辑看到什么，前端就显示什么"。
   用法：正文容器 <div class="article-content">{$内容|raw}</div>
   ===================================================================== */

.article-content {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: justify;
}

.article-content p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    font-size: 16px;
}

/* 后台"单倍行距"(line-height: normal)统一渲染为明确的行距值，避免随字体飘忽
   normal 在微软雅黑下约等于 1.32 倍字号，观感偏大且不可控。
   此规则把 normal 显示为 1.5 倍（内联样式需 !important 才能覆盖）；
   后台设置 1.5/2/3 等具体倍数的仍按设定值显示，不受影响。
   注意：正文文字常包在 <span style="font-size:18px"> 里，而 p 自身字号是 16px，
   line-height 无单位值按元素自身字号计算——若只设在 p 上，1.5×16=24px，
   对 18px 字仅 1.33 倍，与 normal(1.32) 几乎无差别。故对 span 也设 1.5，
   按真实字号(18px)计算=27px，行框取较大值，行距才真正变成 1.5 倍。 */
.article-content p[style*="line-height: normal"],
.article-content p[style*="line-height:normal"] {
    line-height: 1.5 !important;
}
.article-content p[style*="line-height: normal"] span,
.article-content p[style*="line-height:normal"] span {
    line-height: 1.5 !important;
}

/* 压缩空行段落（<p><br/></p> 或空 <p>）：避免段落间出现大空隙 */
.article-content p:empty {
    margin: 0;
    line-height: 0.5;
}
.article-content p:has(> br:only-child) {
    margin: 0;
    line-height: 0.5;
}
.article-content p:has(> br:only-child) br {
    display: none;
}

/* 首段缩进（中文阅读习惯） */
.article-content > p:first-child {
    text-indent: 2em;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    font-weight: 600;
    color: #222222;
    margin: 24px 0 12px 0;
    line-height: 1.4;
}
.article-content h1 { font-size: 22px; }
.article-content h2 { font-size: 20px; }
.article-content h3 { font-size: 18px; }
.article-content h4 { font-size: 17px; }
.article-content h5,
.article-content h6 { font-size: 16px; }

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px auto;
    border-radius: 4px;
}

.article-content a {
    color: #3586bf;
    text-decoration: none;
    word-break: break-all;
}
.article-content a:hover { text-decoration: underline; }

.article-content blockquote {
    margin: 16px 0;
    padding: 10px 16px;
    border-left: 4px solid #38a3ff;
    background: #f8f8f8;
    color: #555555;
    font-size: 15px;
    line-height: 1.7;
}

.article-content ul,
.article-content ol {
    margin: 0 0 16px 0;
    padding-left: 2em;
}
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li {
    margin: 4px 0;
    line-height: 1.6;
}

.article-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}
.article-content table th,
.article-content table td {
    border: 1px solid #dddddd;
    padding: 8px 12px;
    text-align: left;
}
.article-content table th {
    background: #f5f5f5;
    font-weight: 600;
}

.article-content pre,
.article-content code {
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    background: #f5f5f5;
    border-radius: 3px;
}
.article-content pre {
    padding: 12px 16px;
    overflow-x: auto;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}
.article-content code { padding: 2px 5px; }
.article-content pre code { padding: 0; background: none; }

.article-content hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 24px 0;
}

.article-content iframe,
.article-content video {
    max-width: 100%;
    display: block;
    margin: 12px auto;
}

/* 兼容从其他编辑器粘贴带 class 的内容 */
.article-content .ql-align-center { text-align: center; }
.article-content .ql-align-right { text-align: right; }
.article-content .ql-align-justify { text-align: justify; }

/* ========== 移动端适配 ========== */
@media screen and (max-width: 768px) {
    .article-content {
        font-size: 15px;
        line-height: 1.6;
    }
    .article-content p {
        font-size: 15px;
        margin-bottom: 12px;
        line-height: 1.6;
    }
    .article-content img {
        height: auto;
    }
    .article-content table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}
