/*!
 * 富文本正文作用域样式（:where(.rt-body)）
 *
 * 用途：案例详情、百科文章详情等由后台富文本编辑器录入的正文区。
 * 约定：编辑只需写语义标签（h2 / p / ul / ol / blockquote / table），样式自动统一，
 *       不需要手写任何 class，也就不存在样式走形的风险。
 *
 * 可选增强 class（在编辑器「源码」模式给 ul 加上即可）：
 *   <ul class="cards">  两列卡片 + 警示图标（如「办理难点」）
 *   <ul class="checks"> 对勾图标列表（如「办理成果」）
 *
 * 颜色取自站点品牌变量：brand #0A6B64 / brand-dark #07544F / ink #1F2937
 *                        sub #646C79 / surface #F4F7FA / line #E3E9F0
 */

:where(.rt-body) {
    color: #1F2937;
    font-size: 16px;
    line-height: 1.9;
    word-break: break-word;
}

@media (min-width: 768px) {
    :where(.rt-body) { font-size: 17px; }
}

/* ---------- 板块标题：左侧品牌色竖条 ---------- */

:where(.rt-body) h2:not([class]) {
    margin: 40px 0 0;
    padding-left: 12px;
    border-left: 4px solid #0A6B64;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.5;
    color: #07544F;
}

@media (min-width: 768px) {
    :where(.rt-body) h2:not([class]) { font-size: 24px; padding-left: 16px; }
}

/* ---------- 小标题 ---------- */

:where(.rt-body) h3:not([class]) {
    margin: 24px 0 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
    color: #07544F;
}

@media (min-width: 768px) {
    :where(.rt-body) h3:not([class]) { font-size: 20px; }
}

:where(.rt-body) h4:not([class]) {
    margin: 20px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #07544F;
}

/* ---------- 正文段落 ---------- */

:where(.rt-body) p:not([class]) {
    margin: 10px 0 0;
    color: #1F2937;
    line-height: 2;
}

/* 标题紧跟的段落收紧间距 */
:where(.rt-body) h2:not([class]) + p:not([class]),
:where(.rt-body) h3:not([class]) + p:not([class]),
:where(.rt-body) h4:not([class]) + p:not([class]) { margin-top: 12px; }

/* ---------- 无序列表：圆点 ---------- */

:where(.rt-body) ul:not([class]) {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

:where(.rt-body) ul:not([class]) > li:not([class]) {
    position: relative;
    margin-top: 10px;
    padding-left: 18px;
    font-size: 16px;
    line-height: 1.85;
    color: #1F2937;
}

:where(.rt-body) ul:not([class]) > li:not([class])::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #0A6B64;
}

@media (min-width: 768px) {
    :where(.rt-body) ul:not([class]) > li:not([class]) { font-size: 17px; }
}

/* ---------- 列表变体：两列卡片 + 警示三角（办理难点） ---------- */

:where(.rt-body) ul.cards {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    :where(.rt-body) ul.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

:where(.rt-body) ul.cards > li {
    position: relative;
    display: block;
    margin: 0;
    padding: 16px 16px 16px 38px;
    background: #F4F7FA;
    border-radius: 6px;
}

:where(.rt-body) ul.cards > li::before {
    content: "";
    position: absolute;
    /* 与第一行文字视觉居中：padding-top 16px + 行高一半(0.95em) - 三角半高 5.5px */
    top: 26px;
    left: 16px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 11px solid #0A6B64;
    border-radius: 0;
    background: transparent;
}

/* ---------- 列表变体：对勾图标（办理成果） ---------- */

:where(.rt-body) ul.checks {
    margin-top: 20px;
}

:where(.rt-body) ul.checks > li {
    position: relative;
    padding-left: 28px;
}

:where(.rt-body) ul.checks > li::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 2px;
    width: 11px;
    height: 6px;
    border-radius: 0;
    background: transparent;
    border-left: 2px solid #0A6B64;
    border-bottom: 2px solid #0A6B64;
    transform: rotate(-45deg);
}

/* ---------- 有序列表：编号步骤（服务过程） ---------- */

:where(.rt-body) ol:not([class]) {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: rtstep;
}

:where(.rt-body) ol:not([class]) > li:not([class]) {
    counter-increment: rtstep;
    position: relative;
    margin-top: 16px;
    padding: 0 0 16px 52px;
    border-bottom: 1px solid #E3E9F0;
}

:where(.rt-body) ol:not([class]) > li:not([class])::before {
    content: counter(rtstep);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #0A6B64;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

@media (min-width: 768px) {
    :where(.rt-body) ol:not([class]) > li:not([class]) { padding-left: 60px; }
    :where(.rt-body) ol:not([class]) > li:not([class])::before { width: 36px; height: 36px; font-size: 14px; }
}

/* 步骤内的标题与说明 */
:where(.rt-body) ol:not([class]) > li:not([class]) h3 { margin: 0; }
:where(.rt-body) ol:not([class]) > li:not([class]) p {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.75;
    color: #646C79;
}

/* 案例正文：段落容器内首个元素不另加外边距（段间距由外层 space-y 提供） */
:where(.rt-body) section > :first-child { margin-top: 0; }

/* 客户评价图注容器（figure > blockquote + cite） */
:where(.rt-body) figure { margin-top: 20px; }

/* ---------- 引用：客户评价 ---------- */

:where(.rt-body) blockquote:not([class]) {
    margin: 24px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid #E3E9F0;
    font-size: 15px;
    line-height: 2;
    color: #1F2937;
}

:where(.rt-body) blockquote:not([class]) p { margin: 0; }

:where(.rt-body) blockquote:not([class]) cite {
    display: block;
    margin-top: 16px;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    color: #07544F;
}

:where(.rt-body) blockquote:not([class]) cite span {
    margin-left: 8px;
    font-weight: 400;
    color: #646C79;
}

/* ---------- 表格（办理成果对照等） ---------- */

:where(.rt-body) table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    font-size: 14px;
}

:where(.rt-body) th,
:where(.rt-body) td {
    padding: 10px 12px;
    border: 1px solid #E3E9F0;
    text-align: left;
    line-height: 1.7;
}

:where(.rt-body) th {
    background: #F4F7FA;
    font-weight: 600;
    color: #07544F;
}

/* ---------- 行内元素与图片 ---------- */

:where(.rt-body) a:not([class]) {
    color: #0A6B64;
    text-decoration: underline;
}

:where(.rt-body) strong { font-weight: 700; color: #07544F; }

:where(.rt-body) img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px 0 0;
    border-radius: 8px;
}

:where(.rt-body) hr {
    margin: 32px 0 0;
    border: 0;
    border-top: 1px solid #E3E9F0;
}

/* 首个元素不留上边距（由外层容器控制） */
:where(.rt-body) > *:first-child { margin-top: 0; }

/* 正文包裹层 .bk-content：让 {$content} 与页面自带模块（标题/meta/目录/信息卡）隔离，
   补上原来 rt-body > *:first-child 的首元素去上边距 */
.bk-content > *:first-child{margin-top:0}

/* 案例正文容器 .case-content：与百科 .bk-content 对齐；
   正文内 h2/h3 比 .case-h2（20px）降一档，避免正文小标题压过区块标题 */
.case-content > *:first-child{margin-top:0}
.case-content h2:not([class]){font-size:18px;line-height:1.6}
.case-content h3:not([class]){font-size:16px;line-height:1.6}
