﻿/* ==========================================
   GoldenDict 第一部词典 - 紧凑舒适版（字号对齐）
   ========================================== */

/* 全局与主体基础重置 */
html,
body,
[class*="compact_remove"] {
    width: 100% !important;
}

body {
    background: url(data:image/png;base64,iVBORw0KGII=);
    font-size: 12px;
    color: #222;
    margin: 0;
}

/* 字体全局强制覆盖（确保京華老宋体生效） */
#article,
#article *,
[id*="article"],
[id*="article"] * {
    font-family:
        "KingHwa_OldSong Regular", "KingHwa_OldSong", "京華老宋体", Georgia,
        serif !important;
}

/* 链接样式 */
#article a:link,
#article a:visited,
#article a:hover,
#article a:active,
[id*="article"] a {
    color: #c7254e !important;
    text-decoration: none !important;
    font-weight: bold !important;
}

#article img,
[id*="article"] img {
    border: 0;
}

/* 标题基础样式框架 | 压缩上下间距，变细彩条 */
#article h1,
#article h2,
#article h3,
#article h4,
#article h5,
#article h6,
[id*="article"] h1,
[id*="article"] h2,
[id*="article"] h3,
[id*="article"] h4,
[id*="article"] h5,
[id*="article"] h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #222;
    font-style: normal;
    margin-bottom: 2px !important;
    margin-top: 8px !important; /* 匹配对齐第 2 部的 8px 上间距 */
    text-rendering: optimizeLegibility;

    /* 精简彩条：高度匹配第 2 部的 2px 线条 */
    border-bottom: none !important;
    background-image: linear-gradient(
        to right,
        #e75239 0%,
        #e75239 12.5%,
        #ff961c 12.5%,
        #ff961c 25%,
        #ffcc27 25%,
        #ffcc27 37.5%,
        #fce62f 37.5%,
        #fce62f 50%,
        #cde35b 50%,
        #cde35b 62.5%,
        #82cc33 62.5%,
        #82cc33 75%,
        #41bece 75%,
        #41bece 87.5%,
        #049cdb 87.5%,
        #049cdb 100%
    ) !important;
    background-position: left bottom !important;
    background-size: 100% 2px !important;
    background-repeat: no-repeat !important;
    padding-bottom: 1px !important;
    padding-top: 2px !important;
}

/* H2 标题字体大小校准 */
#article h2,
[id*="article"] h2 {
    font-size: 16px !important; /* 匹配第 2 部子标题 .fenxi 的 16px */
}
#article h2 a,
[id*="article"] h2 a {
    font-size: 28px !important; /* 匹配第 2 部词头 .hw 的 28px 亮橙粗体 */
    -webkit-user-select: none;
    user-select: none;
    color: orangered !important;
    text-decoration: none;
    font-weight: bold;
}

/* 连续 H2 标题之间的虚线分割线紧凑化 */
#article h2 + h2,
[id*="article"] h2 + h2 {
    margin-top: 8px !important;
    position: relative;
}
#article h2 + h2::before,
[id*="article"] h2 + h2::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -4px;
    border-top: 1px dashed #ccc;
    pointer-events: none;
}
#article h2:first-of-type,
[id*="article"] h2:first-of-type {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 正文段落与列表排版 | 完美对齐 15px 比例 */
#article p,
#article li,
[id*="article"] p,
[id*="article"] li {
    font-size: 15px !important; /* 完美对齐第 2 部 .def 和 .fenxi2 的 15px */
    line-height: 1.3 !important; /* 匹配 1.3 紧凑行高 */
    text-rendering: optimizeLegibility;
    margin-top: 0;
    margin-bottom: 1px;
}
#article code,
[id*="article"] code {
    font-size: 14px !important; /* 等比例微调 */
    line-height: 1.3 !important;
}
#article li p,
[id*="article"] li p {
    font-size: 100%;
}
#article ul,
[id*="article"] ul {
    margin-left: 1.2em !important;
}
#article ol,
[id*="article"] ol {
    margin-left: 2em !important;
    margin-right: 1em !important;
}
#article ol li,
[id*="article"] ol li {
    margin-bottom: 2px !important;
}

/* 清理空标签与异常换行 */
#article p:empty,
#article div:empty,
[id*="article"] p:empty,
[id*="article"] div:empty {
    display: none !important;
}
#article br + br,
[id*="article"] br + br {
    display: none !important;
}

/* 引用块（Blockquote）极致紧凑化 | 完美对齐第二部薄红边与 15px 字号 */
#article blockquote,
[id*="article"] blockquote,
.content blockquote {
    background-color: #f5f2f0 !important;
    padding: 3px 6px !important; /* 内边距减半 */
    margin: 2px 0 !important; /* 极小外间距 */
    border-radius: 4px !important; /* 4px 紧凑圆角 */
    border: none !important;
    border-left: 4px solid #e74c3c !important; /* 4px 侧边红色薄边 */
    text-shadow: 0 1px #fff;
    font-size: 15px !important; /* 完美对齐 15px */
    line-height: 1.3 !important;
}
#article blockquote p,
[id*="article"] blockquote p {
    color: #222 !important;
    margin-left: 4px !important;
}

/* 词条外框容器与 H2 自动章节编号 */
#article,
[id*="article"] {
    border: 1px solid #ccc;
    padding: 3px !important;
    margin-bottom: 4px;
    counter-reset: chapter;
}
#article h2::before,
[id*="article"] h2::before {
    counter-increment: chapter;
    content: counter(chapter) ". ";
}
