/* ===================================================
 * FAQ 折叠问答组件（列表页 / 首页通用）
 * 公共组件，由 card_helper.php renderFaqSection() 输出
 * 外层 <details> 整体可折叠（点击标题展开/收起）
 * 内层每个问题为 <a> 链接，点击跳转 /faq/{id}/ 详情页
 * =================================================== */

.faq-collapse-wrap {
  background: var(--white);
}
.faq-collapse-wrap.mobile-only {
  margin-bottom: 10px;
  padding: 15px;
}
.faq-collapse-wrap.desktop-faq-section {
  margin-bottom: 20px;
  padding: 24px;
  border-radius: 8px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- 折叠标题行（summary） ---- */
.faq-collapse-title {
  list-style: none;                 /* 隐藏原生三角（Firefox） */
  -webkit-appearance: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-deep);
  margin: 0 0 4px 0;
  position: relative;
  padding-left: 20px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
/* 隐藏原生三角（WebKit / 旧版） */
.faq-collapse-title::-webkit-details-marker { display: none; }

.faq-collapse-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--brand-primary);
  border-radius: 2px;
}
.faq-collapse-text { line-height: 1.4; }

/* 自定义箭头（默认指向右，展开后指向下） */
.faq-arrow {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);        /* 收起：向右箭头 */
  transition: transform 0.2s ease;
  margin-right: 6px;
  flex-shrink: 0;
}
.faq-collapse-wrap[open] > .faq-collapse-title .faq-arrow {
  transform: rotate(45deg);         /* 展开：向下箭头 */
}

/* ---- 问题列表网格 ---- */
.faq-collapse-wrap.mobile-only .faq-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
  margin-top: 12px;
}
.faq-collapse-wrap.desktop-faq-section .faq-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 32px;
  margin-top: 16px;
}

/* ---- 单个问答项（链接卡片） ---- */
.faq-item {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
  border-radius: 6px;
}
.faq-item:hover {
  background: rgba(23, 161, 230, 0.04);
}
.faq-item:active {
  background: rgba(23, 161, 230, 0.08);
}

/* ---- Q + 问题文字 同一行 ---- */
.faq-q-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Q 图标 */
.faq-q-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  background: var(--brand-primary);
  color: var(--white);
  border-radius: 50%;
  font-size: 12px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 问题文字 */
.faq-q-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}

/* 答案预览（最多 2 行，超出省略） */
.faq-a-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.6;
}

/* "查看详情" 提示 */
.faq-more {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--brand-primary);
  transition: transform 0.15s ease;
}
.faq-item:hover .faq-more {
  transform: translateX(3px);
}

/* ---- "查看全部问答" 链接 ---- */
.faq-more-btn {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--brand-primary);
  text-decoration: none;
  letter-spacing: 0.3px;
}
.faq-more-btn:hover {
  text-decoration: underline;
}
