/*!
 * 平衡桥主题 · WordPress 适配层
 *
 * 与 assets/css/theme.css 的分工：
 *   theme.css    —— 由原站构建产物蒸馏而来的皮肤层，保持来源可追溯，不在此修改
 *   theme-wp.css —— 本文件，只做「WordPress 输出结构 → 原站设计系统」的对接
 *
 * 处理三类事情：
 *   1. 模板部件、页面主体的包裹层不干扰原站的定位与节奏
 *   2. 解除 WordPress 默认的 constrained 布局宽度限制，改由 .wrap 控制
 *   3. 核心区块在主题皮肤下的细节修正
 */

/* =========================================================================
 * 1. 结构对接
 * ========================================================================= */

/* 模板部件的包裹 <div> 不产生盒子：.site-header 是 fixed，.site-footer 靠自身
   padding 控制间距，多一层 div 会干扰 .wrap 的宽度计算与 margin 折叠 */
.wp-block-template-part:has( > .site-header ),
.wp-block-template-part:has( > .site-footer ) {
	display: contents;
}

/* -------------------------------------------------------------------------
 * 1.1 板块外壳
 *
 * 原站用了几套不同的板块外壳类，分别控制上下留白与装饰：
 *   .section        72px 0        （≥760px 变 104px 0）—— 首页板块
 *   .section-first  顶部让开固定页头
 *   .section-deco   两块悬浮光斑装饰
 *   .idx-section    只有底部留白        —— 关于我们 / 生态合作 / 核心产品
 *   .supply-body    56px 0 72px         —— 供应链金融
 * 迁移后统一用 .section，这里按「是否页面首个板块」自动补上顶部留白，
 * 并按页面类型挂装饰，避免给每个 pattern 各写一套外壳。
 * ------------------------------------------------------------------------- */

/* 页面首个板块：让开固定页头（等价于原站 .section-first） */
.phq-main .section:first-child {
	padding-top: calc( var(--header-h) + 56px );
}

@media (min-width: 760px) {
	.phq-main .section:first-child {
		padding-top: calc( var(--header-h) + 86px );
	}
}

/* 首页与技术类内页的板块带两块悬浮光斑（原站 .section-deco） */
.phq-front .phq-main .section,
.phq-deco .phq-main .section {
	overflow: hidden;
	position: relative;
}

/* 板块之间的 1px 渐变分隔线（原站是 <div class="wrap"><div class="hairline">）
   用 border-top 占位 + 背景画线，保证高度与原站一致（各 +1px） */
.phq-main .section + .section {
	border-top: 1px solid transparent;
	background-image: linear-gradient( 90deg, #0000, #7ec4ff4d, #0000 );
	background-size: 100% 1px;
	background-position: top left;
	background-repeat: no-repeat;
}

.phq-front .phq-main .section::before,
.phq-deco .phq-main .section::before {
	content: "";
	pointer-events: none;
	background: radial-gradient( circle, #34c8f517, #0000 66% );
	border: 1px solid #7ec4ff1f;
	border-radius: 9999px;
	width: 440px;
	height: 440px;
	position: absolute;
	top: 70px;
	left: -150px;
	box-shadow: inset 0 0 90px #34c8f50d;
}

.phq-front .phq-main .section::after,
.phq-deco .phq-main .section::after {
	content: "";
	pointer-events: none;
	background: radial-gradient( circle, #1576e81c, #0000 66% );
	border: 1px solid #7ec4ff1a;
	border-radius: 9999px;
	width: 440px;
	height: 440px;
	position: absolute;
	bottom: 30px;
	right: -150px;
}

/* 页面主体：宽度完全交给各板块内部的 .wrap */
.phq-main {
	display: block;
	max-width: none;
	margin: 0;
	padding: 0;
}

/* 解除 WordPress 的 constrained 布局对子元素的 780px 限制 */
.phq-main .is-layout-constrained > *,
.phq-main .wp-block-post-content.is-layout-constrained > * {
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}

/* 页面正文不再额外套容器，由 pattern 决定留白 */
.phq-main .wp-block-post-content {
	padding: 0;
	margin: 0;
}

/* =========================================================================
 * 2. 首页：首屏是 fixed 页头下的全屏区块，不需要额外顶部留白
 * ========================================================================= */
.phq-main--front > .wp-block-post-content > :first-child {
	margin-top: 0;
}

/* =========================================================================
 * 3. 核心区块在主题皮肤下的细节修正
 * ========================================================================= */

/* 分组块与栏块默认不产生视觉，避免主题的 .glass 等类被覆盖 */
.wp-block-group.has-background {
	padding: initial;
}

/* 图片：避免 WordPress 默认加上的圆角和描边与 .wrap 内的设计冲突 */
.wp-block-image img {
	border-radius: inherit;
}

/* 按钮：核心按钮在主题里沿用 .btn 系列的观感 */
.wp-block-button__link {
	text-decoration: none;
}

/* 详情块（FAQ 与页脚折叠都用它）：去掉浏览器默认的三角标记 */
.wp-block-details > summary,
details.f-group > summary {
	list-style: none;
	cursor: pointer;
}

.wp-block-details > summary::-webkit-details-marker,
details.f-group > summary::-webkit-details-marker {
	display: none;
}

/* 页脚折叠面板中的链接 */
.f-panel a {
	display: block;
}

/* =========================================================================
 * 3.1 标题行高：theme.json 给 heading 设了统一行高，这里把原站各处
 *     由 --lh-* 变量带给具体元素的差异补回来
 * ========================================================================= */

/* 页脚「关注公众号」用小字行高（原站继承 body 的 --lh-sm:1.7） */
.f-qr h5 {
	line-height: 1.7;
}

/* 页脚品牌描述（原站 --lh-sm:1.7） */
.f-brand p {
	line-height: 1.9;
}

/* =========================================================================
 * 3.2 卡片内的文字链与价值主张
 *
 * 原站里 .plink 是 <span>、.val 是 <div>，既不被 `.pcard p` 的 flex:1 匹配，
 * 也不继承其 1.85 的行高；迁移到 WordPress 后它们由 core/paragraph 渲染成 <p>，
 * 会被误匹配，导致卡片被撑高（实测每张卡多 2.1px）。这里显式还原：
 *   flex: none         —— 不抢占正文的弹性空间
 *   line-height: 1.7   —— 回到原站继承自 body 的 --lh-sm
 * ========================================================================= */
.pcard p.plink,
.ncard p.plink,
.scn p.val {
	flex: none;
	line-height: 1.7;
}

/* =========================================================================
 * 3.3 常见问题：把 core/details 的输出适配到原站的 .faq-item / .faq-q / .faq-a
 *
 * 原站用的是 <button class="faq-q"> + <div class="faq-a"> 手写手风琴；
 * WordPress 里改用原生 <details>，语义更好、零 JS，但需要把 summary 与
 * 子段落还原成原站的视觉（内边距、字号、加号图标、展开态渐变）。
 * 浏览器原生控制展开，所以不再需要原站那套 grid-template-rows 高机动效。
 * ========================================================================= */
.faq-item {
	padding: 0;
	overflow: hidden;
}

.faq-item > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 20px 26px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	color: #fff;
	cursor: pointer;
	transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.faq-item > summary:hover {
	color: #8fe3ff;
}

/* 加号图标：对应原站的 <span class="fi"> */
.faq-item > summary::after {
	content: "+";
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 400;
	color: #8fe3ff;
	background: #34c8f51f;
	border: 1px solid #34c8f54d;
	transition: all .3s;
}

.faq-item[open] {
	border-color: #34c8f566;
	box-shadow: var(--el-2);
}

.faq-item[open] > summary::after {
	color: #fff;
	background: linear-gradient(135deg, #0b4fc4 0%, #1576e8 48%, #34c8f5 100%);
	border-color: transparent;
	transform: rotate(45deg);
}

/* 答案区：对应原站的 .faq-a p */
.faq-item > p,
.faq-item > div:not(.wp-block-details) {
	padding: 0 26px 22px;
	margin: 0;
	font-size: 14.5px;
	line-height: 1.9;
	color: rgb(143 169 204);
}

/* =========================================================================
 * 4. 新闻列表与详情
 * ========================================================================= */
.phq-back {
	margin-top: 40px;
}

.phq-back a {
	color: var( --wp--preset--color--accent );
	text-decoration: none;
}

.phq-back a:hover {
	color: var( --wp--preset--color--accent-light );
}

/* 文章正文的段落节奏 */
.phq-main .wp-block-post-content > p {
	line-height: 1.85;
	color: var( --wp--preset--color--ink-muted );
}

/* =========================================================================
 * 5. 后台编辑器的 iframe 预览里，固定定位会跑出画布，已在 editor.css 处理，
 *    这里兜底一次，避免误用
 * ========================================================================= */
.editor-styles-wrapper .site-header {
	position: relative;
}

/* =========================================================================
 * 6. 可访问性：跳过链接
 * ========================================================================= */
.phq-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: #fff;
	color: #0b4fc4;
	padding: 10px 18px;
	border-radius: 0 0 10px 0;
	font-size: 14px;
}

.phq-skip:focus {
	left: 0;
}
.has-sub:has(.sub-panel > a.active) > a{
  color:#156bf6;
  box-shadow:none;
  background:0 0;
  border-bottom:4px solid #156bf6;
  border-radius:10px 10px 0 0;
  padding-bottom:5px;
  font-weight:600
}

/* 移动端抽屉：父项高亮。
   ⚠️ 必须带 :not(.sub-i) —— 移动端 .m-group 下父项和子项是**扁平兄弟**结构
   （不像桌面端有 .sub-wrapper 包裹），若写成 `> a`，同组未选中子项
   （咨询热线 / 常见问题）会被一并误染成蓝色（实测 2026-10-12：
   误染后 rgb(21,107,246)，对照参照站应保持 rgb(95,123,160)）。
   加 :not(.sub-i) 后与参照站像素级一致。 */
.m-group:has(> .sub-i.active) > a:not(.sub-i){color:#156bf6}

