/* ============================================
   古腾堡内容在 Bricks 主题下的排版修复
   作用域：.brxe-post-content（文章正文区域）
   ============================================ */

/* 1. 恢复标题块默认样式 */
.brxe-post-content .wp-block-heading {
    font-size: revert;
    line-height: revert;
    margin: revert;
    color: revert;
}

/* 2. 恢复段落间距（覆盖 Bricks 的 p:last-of-type { margin-block-end: 0 }） */
.brxe-post-content p,
.brxe-post-content .wp-block-paragraph {
    margin-block-start: 0;
    margin-block-end: 1.5em; /* 段落之间保持 1.5em 间距，按需调整 */
}

/* 关键：强制覆盖 Bricks 的 :where(p:last-of-type) */
.brxe-post-content p:last-of-type,
.brxe-post-content .wp-block-paragraph:last-of-type {
    margin-block-end: 1.5em !important; /* 文章流里最后一段也要有底部间距 */
}

/* 3. 空段落不占用空间（古腾堡经常产生空 p 标签） */
.brxe-post-content p:empty,
.brxe-post-content .wp-block-paragraph:empty {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    display: none; /* 或者保留 display:block 但无间距，根据需求选 */
}

/* 4. 图片块上下间距 */
.brxe-post-content .wp-block-image {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

/* 5. figure 标签默认样式清理（古腾堡图片包裹在 figure 里） */
.brxe-post-content figure {
    margin: 0; /* 清除浏览器默认 figure margin */
}

.brxe-post-content figure img {
    display: block;      /* 消除图片底部幽灵空白 */
    max-width: 100%;
    height: auto;
}

/* 6. 图片与相邻段落的间距细化 */
/* 图片前面是段落时，段落下边距 + 图片上边距可能太大，可以取其一 */
.brxe-post-content p + .wp-block-image,
.brxe-post-content .wp-block-paragraph + .wp-block-image {
    margin-top: 1em; /* 段落后面紧跟图片时，稍微紧凑一点 */
}

/* 图片后面紧跟段落时 */
.brxe-post-content .wp-block-image + p,
.brxe-post-content .wp-block-image + .wp-block-paragraph {
    margin-top: 1em;
}

/* 7. 其他常见古腾堡块的基础间距（可选，建议保留） */
.brxe-post-content .wp-block-list,
.brxe-post-content .wp-block-quote,
.brxe-post-content .wp-block-table {
    margin-bottom: 1.5em;
}

.brxe-post-content .wp-block-quote p {
    margin-bottom: 0.5em; /* 引用块内部段落间距小一点 */
}

.brxe-post-content .wp-block-quote p:last-of-type {
    margin-bottom: 0;
}


/* 开始 菜单控制 */
.my-nav-top-section .brxe-dropdown .brx-submenu-toggle a,
.my-nav-top-section .brxe-dropdown .brx-submenu-toggle span {
font-weight: 500;
transition: color 0.3s ease; /* 添加颜色过渡效果 */
color: var(--color-gray-925);
}
.my-nav-top-section .brxe-dropdown:hover .brx-submenu-toggle a,
.my-nav-top-section .brxe-dropdown:hover .brx-submenu-toggle span {
color: var(--bricks-color-primary-base);
}
.my-nav-top-section .brxe-dropdown .brx-submenu-toggle button {
display: none;
}
.my-nav-top-section .brxe-dropdown .normal-content {
box-shadow: 0 10px 24px 0 rgba(149, 157, 165, 0.1);
border-radius: 10px;
min-width: fit-content !important;
width: max-content !important;
}
.my-nav-top-section .brxe-dropdown .normal-content > li:not(:last-child) {
border-bottom: 1px solid #f2f2f2;
}
.my-nav-top-section .brxe-dropdown .normal-content > li > a {
justify-content: center;
padding: 10px 10px; 
border-radius: 10px;
margin: 6px;
white-space: nowrap;
transition: 0.3s; 
}
.my-nav-top-section .brxe-dropdown .normal-content > li > a:hover {
background-color: var(--color-gray-300); 
color: var(--bricks-color-primary-base);
}

.my-nav-top-section .brxe-dropdown .mega-content {
background-color: transparent !important;
}
.my-nav-top-section .brxe-dropdown .mega-content .mega-content-box {
box-shadow: 0 10px 24px 0 rgba(149, 157, 165, 0.1);
border-radius: 10px;
}

.my-nav-top-section .brxe-dropdown .mega-content .mega-content-box .menu-box1 .brxe-text-basic {
transition: all 0.3s;
}
.my-nav-top-section .brxe-dropdown .mega-content .mega-content-box .menu-box1:hover .brxe-text-basic {
color: #98cb45 !important;
}
/* 按钮 悬停 线条动画 */
.my-nav-top-section .brxe-dropdown {
position: relative;
}

.my-nav-top-section .brxe-dropdown::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 3px;
background-color: var(--bricks-color-primary-base);
transition: width 0.5s ease-out, 
            left 0.5s ease-out; /* 多个过渡属性分行显示，更易读 */
}

.my-nav-top-section .brxe-dropdown:hover::after {
width: 100%;
left: 0;
}

/* 结束 菜单控制 */