/* ============================================================
   H4 文章页配色 v3 · 大成紫主题（对齐 www.dacheng.com 品牌色）
   主紫 #792696（大成品牌紫）+ 国际语义色：
     紫=品牌/权威 · 橙=提醒/重点 · 绿=结论 · 黄荧光=重点标记
   纯 CSS 覆盖，只作用于 ht_kb 文章单页
   ============================================================ */

/* ---------- 配色变量（大成紫 + Tailwind 中性色） ---------- */
:root {
    --htx-purple: #792696;        /* 大成紫：标题/链接/表头/引用边 */
    --htx-purple-deep: #5f1e78;   /* 深紫：hover */
    --htx-purple-bg: #f5edfa;     /* 淡紫卡片底：引用块/标签 */
    --htx-purple-bg-2: #e2d0ee;   /* 浅紫边框 */
    --htx-faint: #faf6fc;         /* 极淡紫：斑马纹 */
    --htx-ink: #1e293b;           /* 深色 slate-800 */
    --htx-body: #374151;          /* 正文 gray-700 中性灰 */
    --htx-muted: #6b7280;         /* 次要 gray-500 */
    --htx-orange: #ea580c;        /* 强调橙 orange-600 */
    --htx-green: #059669;         /* 绿 emerald-600 */
    --htx-strong: #9a3412;        /* strong 文字 orange-800 深橙 */
    --htx-highlight: #fde047;     /* 荧光黄 yellow-300 */
}

/* ============================================================
   一、文章大标题 —— 大成紫
   ============================================================ */
.hkb-article__title {
    color: var(--htx-purple) !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
}

/* ============================================================
   二、正文标题 —— 大成紫/橙/绿 交叉分层
   ============================================================ */
.hkb-article__content h2,
.hkb-article__content h3,
.hkb-article__content h4 {
    font-weight: 600 !important;
    margin-top: 1.8em;
    margin-bottom: 0.7em;
}

.hkb-article__content h2 {
    color: var(--htx-purple) !important;        /* 紫：主层级 */
    border-left: 4px solid var(--htx-orange);   /* 橙竖条 */
    padding-left: 0.6em;
    font-size: 1.5em;
}

.hkb-article__content h3 {
    color: var(--htx-orange) !important;        /* 橙：次层级 */
    border-left: 3px solid var(--htx-purple);   /* 紫竖条 */
    padding-left: 0.6em;
    font-size: 1.25em;
}

.hkb-article__content h4 {
    color: var(--htx-green) !important;         /* 绿：三级 */
    font-size: 1.08em;
}

/* ============================================================
   三、正文段落 —— 中性灰
   ============================================================ */
.hkb-article__content {
    color: var(--htx-body);
    line-height: 1.85;
}

.hkb-article__content p {
    color: var(--htx-body);
}

.hkb-article__content a {
    color: var(--htx-purple) !important;
    text-decoration: none;
    border-bottom: 1px solid var(--htx-purple-bg-2);
    transition: color .15s ease, border-color .15s ease;
}

.hkb-article__content a:hover {
    color: var(--htx-purple-deep) !important;
    border-bottom-color: var(--htx-purple-deep);
}

/* ============================================================
   四、重点句 / 提醒字眼（strong）—— 深橙 + 黄荧光（与紫主色形成对比）
   ============================================================ */
.hkb-article__content strong {
    color: var(--htx-strong);
    font-weight: 700;
    background: linear-gradient(transparent 55%, rgba(253, 224, 71, 0.85) 55%);
    padding: 0 3px;
    border-radius: 2px;
}

/* ============================================================
   五、法规引用块（blockquote）—— 淡紫卡片 + 紫边
   ============================================================ */
.hkb-article__content blockquote {
    background: var(--htx-purple-bg);
    border-left: 4px solid var(--htx-purple);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 1.2em 0;
    color: var(--htx-body);
}

.hkb-article__content blockquote p {
    margin: 0;
    color: var(--htx-body);
}

/* ============================================================
   六、表格 —— 紫底表头 + 淡紫斑马纹
   ============================================================ */
.hkb-article__content table {
    border: 1px solid var(--htx-purple-bg-2);
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
}

.hkb-article__content table th,
.hkb-article__content table td {
    background: #fff;
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid var(--htx-purple-bg-2);
}

.hkb-article__content table thead th {
    background: var(--htx-purple) !important;
    color: #fff !important;
    font-weight: 600;
    border-bottom: 0;
}

.hkb-article__content table tbody tr:nth-child(even) td {
    background: var(--htx-faint);
}

.hkb-article__content table tbody tr:last-child td {
    border-bottom: 0;
}

/* ============================================================
   七、代码块 —— 深底浅字
   ============================================================ */
.hkb-article__content pre {
    background: var(--htx-ink);
    color: #e8edf7;
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 1.2em 0;
}

.hkb-article__content code {
    background: var(--htx-purple-bg);
    color: var(--htx-purple-deep);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9em;
}

.hkb-article__content pre code {
    background: transparent;
    color: #e8edf7;
    padding: 0;
}

/* ============================================================
   八、列表
   ============================================================ */
.hkb-article__content ul,
.hkb-article__content ol {
    margin: 0.8em 0 1.2em 1.4em;
}

.hkb-article__content li {
    margin-bottom: 0.45em;
    color: var(--htx-body);
}

/* ============================================================
   九、面包屑
   ============================================================ */
.hkb-breadcrumbs a {
    color: var(--htx-purple);
}

.hkb-breadcrumbs a:hover {
    color: var(--htx-purple-deep);
}

/* ============================================================
   十、文章标签 —— 淡紫药丸
   ============================================================ */
.hkb-article-tags a {
    display: inline-block;
    background: var(--htx-purple-bg);
    color: var(--htx-purple-deep);
    border-radius: 999px;
    padding: 3px 14px;
    margin: 0 6px 6px 0;
    font-size: 0.85em;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.hkb-article-tags a:hover {
    background: var(--htx-purple);
    color: #fff;
}

/* ============================================================
   十一、投票 / 反馈 / 更新日期
   ============================================================ */
.ht-voting a,
.hkb-feedback a {
    color: var(--htx-purple);
}

.ht-voting a:hover,
.hkb-feedback a:hover {
    color: var(--htx-orange);
}

.hkb-article__lastupdated {
    color: var(--htx-muted) !important;
    font-size: 0.9em;
}

/* ============================================================
   十二、相关文章 / 作者块
   ============================================================ */
.hkb-article-related__title,
.hkb-article-author__title {
    color: var(--htx-purple) !important;
}

.hkb-article-author__name {
    color: var(--htx-purple) !important;
}

.hkb-article-related a,
.hkb-article-author__name a {
    color: var(--htx-purple);
}

.hkb-article-related a:hover {
    color: var(--htx-purple-deep);
}

/* ============================================================
   十三、阅读进度条 + 回到顶部按钮
   ============================================================ */
.htx-read-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}

.htx-read-progress__bar {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--htx-purple), var(--htx-orange));
    transition: width 0.08s linear;
}

.htx-backtop {
    position: fixed;
    right: 16px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--htx-purple);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    border: none;
    box-shadow: 0 2px 12px rgba(121, 38, 150, 0.45);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.2s ease;
    z-index: 9998;
}

.htx-backtop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.htx-backtop:hover {
    background: var(--htx-orange);
}

/* ============================================================
   十四、文章开头作者署名
   ============================================================ */
.htx-byline {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.95em;
    color: var(--htx-muted);
    margin: 2px 0 22px;
}

.htx-byline__name {
    color: var(--htx-ink);   /* 深墨，与标题紫区分 */
    font-weight: 600;
}

.htx-byline__ai {
    color: var(--htx-orange);
    font-weight: 600;
}
