/*
 * newscontent.css - 共用的知识库/新闻文章内容样式
 *
 * 用于:
 *   - themes/clientarea/default/knowledgebaseview.tpl
 *   - themes/clientarea/ZdsjuM1/knowledgebaseview.tpl
 *   - themes/clientarea/default/newsview.tpl
 *   - themes/clientarea/ZdsjuM1/newsview.tpl
 *
 * 设计原则:
 *   1. 中性样式，不带主题特有色彩
 *   2. 覆盖 Bootstrap 默认 + 浏览器默认（特别是 <pre>）
 *   3. 兼容 ZJMF 3.5.8/3.7.6 框架
 *
 * 创建: 2026-06-26 (狄仁杰 P1 抽离)
 */

/* ===== 容器基础 ===== */
.newscontent {
    color: #333;
    line-height: 1.7;
    font-size: 15px;
    word-wrap: break-word;
}

/* ===== 段落 ===== */
.newscontent p {
    display: block !important;
    white-space: normal;
    margin-bottom: 1rem;
}

/* ===== 标题 ===== */
.newscontent h1,
.newscontent h2,
.newscontent h3,
.newscontent h4,
.newscontent h5,
.newscontent h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
}
.newscontent h1 { font-size: 1.75rem; }
.newscontent h2 { font-size: 1.5rem; }
.newscontent h3 { font-size: 1.25rem; }
.newscontent h4 { font-size: 1.1rem; }
.newscontent h5 { font-size: 1rem; }
.newscontent h6 { font-size: 0.95rem; }

/* ===== 预格式化文本 (覆盖 Bootstrap + 浏览器默认) ===== */
.newscontent pre,
.newscontent .newscontent pre {
    font-family: inherit;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0 0 1rem 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: visible;
    font-size: 100%;
    color: inherit;
    max-width: 100%;
}

/* newsview iframe 注入版本 */
.newscontent iframe pre,
.newscontent .newscontent iframe pre {
    max-width: 100%;
    word-break: break-all;
    white-space: pre-wrap;
}

/* ===== 内联代码 ===== */
.newscontent code {
    background: #f5f5f5;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
    color: #d6336c;
}

.newscontent pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* ===== 图片 ===== */
.newscontent img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 4px;
}

.newscontent iframe img {
    width: 90%;
    height: 50%;
}

/* ===== 列表 ===== */
.newscontent ul,
.newscontent ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}
.newscontent li {
    margin-bottom: 0.25rem;
}

/* ===== 链接 ===== */
.newscontent a {
    color: #0d6efd;
    text-decoration: none;
    border-bottom: 1px dashed rgba(13, 110, 253, 0.5);
    transition: all 0.2s;
}
.newscontent a:hover {
    color: #0a58ca;
    border-bottom-style: solid;
}

/* ===== 引用 ===== */
.newscontent blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid #dee2e6;
    color: #6c757d;
    background: #f8f9fa;
}
.newscontent blockquote p:last-child {
    margin-bottom: 0;
}

/* ===== 表格 ===== */
.newscontent table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95em;
}
.newscontent table th,
.newscontent table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.newscontent table th {
    background: #f8f9fa;
    font-weight: 600;
}
.newscontent table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* ===== 分隔线 ===== */
.newscontent hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #dee2e6;
}

/* ===== 强调 ===== */
.newscontent strong { font-weight: 600; }
.newscontent em { font-style: italic; }

/* ===== 杂项 ===== */
.newscontent span,
.newscontent div {
    max-width: 100%;
}

.newscontent iframe {
    border: none;
    width: 100%;
}
