/* ==========================================================================
 * HBC FAQ Categories — 分类问答（顶部分类按钮 + 折叠 FAQ）
 *
 * 结构:
 *   <div.hbc-cf>
 *     <div.hbc-cf__categories>      (顶部按钮，CSS Grid)
 *       <a.hbc-cf__category>
 *         <span.hbc-cf__category-icon><img/></span>
 *         <span.hbc-cf__category-title>
 *         <span.hbc-cf__category-arrow>
 *     <div.hbc-cf__sections>        (问答分组容器)
 *       <section.hbc-cf__section id="...">
 *         <hN.hbc-cf__section-title>
 *         <div.hbc-cf__divider>
 *         <div.hbc-cf__qa-list>
 *           <div.hbc-cf__qa[.is-open]>
 *             <button.hbc-cf__qa-question>
 *               <span.hbc-cf__qa-text>
 *               <span.hbc-cf__qa-icon>     (CSS 绘制 + / − )
 *             <div.hbc-cf__qa-answer[hidden]>
 *               <div.hbc-cf__qa-answer-inner>
 * ========================================================================== */

/* ==========================================================================
 *  容器
 * ========================================================================== */
.hbc-cf {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

.hbc-cf * {
	box-sizing: border-box;
}

/* ==========================================================================
 *  顶部分类按钮
 * ========================================================================== */
.hbc-cf__categories {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4px;
	width: 100%;
	margin-bottom: 60px;
}

.hbc-cf__category {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 14px;
	padding: 20px 24px;
	min-height: 130px;
	background-color: #15154A;
	color: #FFFFFF;
	text-decoration: none;
	border-radius: 0;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
	position: relative;
}

.hbc-cf__category:hover,
.hbc-cf__category:focus-visible {
	background-color: #1F1F65;
	color: #FFFFFF;
	text-decoration: none;
}

.hbc-cf__category:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: -4px;
}

.hbc-cf__category-icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.hbc-cf__category-icon img {
	display: block;
	width: 36px;
	height: auto;
	max-height: 60px;
	object-fit: contain;
}

.hbc-cf__category-title {
	flex: 1;
	min-width: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.25;
	color: inherit;
	word-break: break-word;
}

.hbc-cf__category-arrow {
	flex-shrink: 0;
	font-size: 14px;
	line-height: 1;
	color: inherit;
	opacity: 0.85;
	margin-left: auto;
}

/* ==========================================================================
 *  问答分组容器
 * ========================================================================== */
.hbc-cf__sections {
	width: 100%;
	max-width: 80%;
}

.hbc-cf__section {
	scroll-margin-top: 80px; /* 默认值；JS 会基于 data-scroll-offset 覆盖 */
}

.hbc-cf__section-title {
	margin: 40px 0 12px;
	padding: 0;
	font-size: 26px;
	font-weight: 600;
	line-height: 1.3;
	color: #15154A;
}

.hbc-cf__divider {
	height: 1px;
	background-color: #15154A;
	width: 100%;
}

/* ==========================================================================
 *  Q&A 列表
 * ========================================================================== */
.hbc-cf__qa-list {
	display: flex;
	flex-direction: column;
}

.hbc-cf__qa {
	border-top: 1px solid transparent; /* 第一项无可视分隔，下面用 +n 选择器加 */
}

.hbc-cf__qa + .hbc-cf__qa {
	border-top: 1px solid #15154A;
}

/* 编辑器中显示空数据提示 */
.hbc-cf__empty {
	margin: 16px 0;
	padding: 12px 14px;
	background: #FFF8E1;
	color: #7A5A00;
	font-size: 13px;
	border-radius: 4px;
}

/* ==========================================================================
 *  问题（按钮形态）
 * ========================================================================== */
.hbc-cf__qa-question {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 16px;
	padding: 18px 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
}

.hbc-cf__qa-question:focus-visible {
	outline: 2px solid #15154A;
	outline-offset: 2px;
}

.hbc-cf__qa-text {
	flex: 1;
	min-width: 0;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
	color: #15154A;
	transition: color 0.2s ease;
}

.hbc-cf__qa-question:hover .hbc-cf__qa-text {
	opacity: 0.85;
}

/* 加号 / 减号图标（CSS 纯绘制，避免依赖图标字体） */
.hbc-cf__qa-icon {
	flex-shrink: 0;
	position: relative;
	display: inline-block;
	width: 22px;
	height: 22px;
	color: #E91E84;
}

.hbc-cf__qa-icon::before,
.hbc-cf__qa-icon::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	background-color: currentColor;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

/* 横线：水平 */
.hbc-cf__qa-icon::before {
	width: 100%;
	height: 2px;
	transform: translate(-50%, -50%);
}

/* 竖线：垂直，展开后旋转隐藏成减号 */
.hbc-cf__qa-icon::after {
	width: 2px;
	height: 100%;
	transform: translate(-50%, -50%);
}

.hbc-cf__qa.is-open .hbc-cf__qa-icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
	opacity: 0;
}

/* ==========================================================================
 *  答案（折叠 / 展开动画）
 * ========================================================================== */
.hbc-cf__qa-answer {
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.3s ease;
}

.hbc-cf__qa-answer[hidden] {
	display: none;
}

.hbc-cf__qa.is-open .hbc-cf__qa-answer {
	/* JS 运行时设置精确 max-height；这里给个备用上限 */
	max-height: 1000px;
}

.hbc-cf__qa-answer-inner {
	padding: 0 0 20px;
	font-size: 15px;
	line-height: 1.7;
	color: #444444;
}

.hbc-cf__qa-answer-inner > *:first-child { margin-top: 0; }
.hbc-cf__qa-answer-inner > *:last-child  { margin-bottom: 0; }

/* ==========================================================================
 *  响应式
 * ========================================================================== */
@media ( max-width: 1024px ) {
	.hbc-cf__categories {
		grid-template-columns: repeat(2, 1fr);
	}

	.hbc-cf__sections {
		max-width: 92%;
	}

	.hbc-cf__category {
		min-height: 110px;
	}

	.hbc-cf__category-title {
		font-size: 16px;
	}

	.hbc-cf__section-title {
		font-size: 22px;
	}
}

@media ( max-width: 600px ) {
	.hbc-cf__categories {
		grid-template-columns: 1fr;
		margin-bottom: 36px;
	}

	.hbc-cf__sections {
		max-width: 100%;
	}

	.hbc-cf__category {
		min-height: 86px;
		padding: 14px 18px;
	}

	.hbc-cf__category-title {
		font-size: 15px;
	}

	.hbc-cf__qa-text {
		font-size: 15px;
	}

	.hbc-cf__qa-question {
		padding: 14px 0;
	}
}

/* ==========================================================================
 *  Elementor 编辑器：不阻断点击事件（避免编辑时被 a 标签锁定）
 * ========================================================================== */
.elementor-editor-active .hbc-cf__category {
	pointer-events: none;
}
