/* =============================================
   page-faq · 问答中心专属样式
   所有选择器限定在 .page-faq 作用域内
   ============================================= */
.page-faq {
  --faq-max-width: 920px;
  --faq-card-bg: #1A1A32;
  --faq-card-border: rgba(255, 215, 0, 0.15);
  --faq-question-bg: rgba(255, 255, 255, 0.03);
  --faq-question-hover: rgba(255, 215, 0, 0.06);
  --faq-answer-bg: rgba(11, 29, 58, 0.4);
  --faq-toggle-color: #D32F2F;
  --faq-accent-gold: #FFD700;
  --faq-text-secondary: #B0B0C0;
  --faq-radius: 8px;
  --faq-icon-size: 80px;

  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: var(--spacing-lg, 2rem) var(--spacing-md, 1rem) var(--spacing-xl, 4rem);
  background: linear-gradient(165deg, #0B1D3A 0%, #0D0D1A 55%, #0F1028 100%);
  color: var(--color-white, #FFFFFF);
  font-family: var(--font-body, 'Noto Sans SC', sans-serif);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- 面包屑 ---------- */
.page-faq .breadcrumb {
  width: 100%;
  max-width: var(--faq-max-width);
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  color: var(--color-secondary-text, #A0A0B0);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-faq .breadcrumb a {
  color: var(--color-secondary-text, #A0A0B0);
  text-decoration: none;
  transition: color 0.2s;
}
.page-faq .breadcrumb a:hover {
  color: var(--faq-accent-gold);
}
.page-faq .breadcrumb .separator {
  color: var(--color-secondary-text, #A0A0B0);
  font-weight: 300;
}
.page-faq .breadcrumb [aria-current="page"] {
  color: var(--faq-accent-gold);
  font-weight: 500;
}

/* ---------- 英雄区 ---------- */
.page-faq .faq-hero {
  width: 100%;
  max-width: var(--faq-max-width);
  text-align: center;
  padding: 1.2rem 0 2rem;
}
.page-faq .faq-hero h1 {
  font-family: var(--font-heading, 'Inter', 'PingFang SC', sans-serif);
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
  color: var(--color-white, #FFFFFF);
  text-shadow: 0 2px 12px rgba(211, 47, 47, 0.15);
}
.page-faq .faq-subtitle {
  font-size: 1.05rem;
  color: var(--faq-text-secondary);
  max-width: 680px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

/* ---------- 搜索框 ---------- */
.page-faq .faq-search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}
.page-faq .faq-search-input {
  width: 100%;
  padding: 0.85rem 1.2rem 0.85rem 3rem;
  font-size: 0.95rem;
  font-family: var(--font-body, 'Noto Sans SC', sans-serif);
  color: var(--color-white, #FFFFFF);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 60px;
  outline: none;
  transition: all 0.3s;
  box-sizing: border-box;
}
.page-faq .faq-search-input::placeholder {
  color: rgba(160, 160, 176, 0.7);
}
.page-faq .faq-search-input:focus {
  border-color: var(--faq-accent-gold);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.08);
}
.page-faq .faq-search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--faq-accent-gold);
  opacity: 0.7;
  pointer-events: none;
  line-height: 1;
}

/* ---------- 分类容器 ---------- */
.page-faq .faq-categories {
  width: 100%;
  max-width: var(--faq-max-width);
  display: flex;
  flex-direction: column;
  gap: 2.8rem;
  margin-top: 1.2rem;
}

/* ---------- 单个分类 ---------- */
.page-faq .faq-category {
  background: var(--faq-card-bg);
  border: 1px solid var(--faq-card-border);
  border-radius: var(--faq-radius);
  padding: 1.8rem 1.6rem 1.2rem;
  transition: border-color 0.3s;
}
.page-faq .faq-category:hover {
  border-color: rgba(255, 215, 0, 0.3);
}

/* 分类头 */
.page-faq .category-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.4rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.08);
}
.page-faq .category-icon {
  width: var(--faq-icon-size);
  height: var(--faq-icon-size);
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  box-sizing: border-box;
}
.page-faq .category-title {
  font-family: var(--font-heading, 'Inter', 'PingFang SC', sans-serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--faq-accent-gold);
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.3;
}

/* ---------- 折叠面板 items ---------- */
.page-faq .category-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ---------- 单个问答项 (details) ---------- */
.page-faq .faq-item {
  border-radius: var(--faq-radius);
  overflow: hidden;
  background: var(--faq-question-bg);
  transition: background 0.2s;
}
.page-faq .faq-item:hover {
  background: var(--faq-question-hover);
}

/* 问题标题 (summary) */
.page-faq .faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  font-weight: 500;
  font-size: 1rem;
  color: var(--color-white, #FFFFFF);
  cursor: pointer;
  list-style: none;
  transition: color 0.2s;
  user-select: none;
  -webkit-user-select: none;
}
.page-faq .faq-question::-webkit-details-marker {
  display: none;
}
.page-faq .faq-question::marker {
  display: none;
  content: "";
}
.page-faq .faq-question:hover {
  color: var(--faq-accent-gold);
}

/* 展开/收起图标 */
.page-faq .faq-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
  color: var(--faq-toggle-color);
  font-weight: 300;
  font-size: 1.1rem;
  transition: transform 0.3s ease;
  border: 1px solid rgba(211, 47, 47, 0.3);
  border-radius: 50%;
  line-height: 1;
}
.page-faq .faq-toggle::before {
  content: "+";
  display: inline-block;
  transition: transform 0.3s ease;
}
.page-faq .faq-item[open] .faq-toggle::before {
  content: "–";
}

/* 答案内容 */
.page-faq .faq-answer {
  padding: 0 1.2rem 1.2rem;
  color: var(--faq-text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: var(--faq-answer-bg);
  border-radius: 0 0 var(--faq-radius) var(--faq-radius);
}
.page-faq .faq-answer p {
  margin: 0.8rem 0;
}
.page-faq .faq-answer a {
  color: var(--faq-accent-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s;
}
.page-faq .faq-answer a:hover {
  opacity: 0.8;
}

/* 答案中的图片 */
.page-faq .answer-img-wrap {
  margin: 1rem 0 0.8rem;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
}
.page-faq .answer-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 600 / 400;
  border-radius: 6px;
}

/* ---------- 底部 CTA ---------- */
.page-faq .faq-cta {
  width: 100%;
  max-width: var(--faq-max-width);
  margin-top: 3.6rem;
  padding: 2.4rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(211, 47, 47, 0.08), rgba(255, 215, 0, 0.04));
  border: 1px solid rgba(255, 215, 0, 0.12);
  border-radius: var(--faq-radius);
}
.page-faq .cta-heading {
  font-family: var(--font-heading, 'Inter', 'PingFang SC', sans-serif);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-white, #FFFFFF);
  margin: 0 0 0.5rem;
}
.page-faq .cta-text {
  color: var(--faq-text-secondary);
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0 auto 1.8rem;
  line-height: 1.7;
}
.page-faq .cta-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* 按钮复用（在 page-faq 作用域内定义） */
.page-faq .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.8rem;
  font-family: var(--font-body, 'Noto Sans SC', sans-serif);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 60px;
  text-decoration: none;
  transition: all 0.25s;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.4;
}
.page-faq .btn-primary {
  background: #D32F2F;
  color: #FFFFFF;
  border-color: #D32F2F;
}
.page-faq .btn-primary:hover {
  background: #B71C1C;
  border-color: #B71C1C;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(211, 47, 47, 0.3);
}
.page-faq .btn-outline {
  background: transparent;
  color: var(--faq-accent-gold);
  border-color: var(--faq-accent-gold);
}
.page-faq .btn-outline:hover {
  background: rgba(255, 215, 0, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.12);
}

/* ---------- 返回顶部 ---------- */
.page-faq .back-to-top-faq {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #D32F2F;
  color: #FFFFFF;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(211, 47, 47, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  z-index: 900;
  line-height: 1;
}
.page-faq .back-to-top-faq[data-visible] {
  opacity: 1;
  visibility: visible;
}
.page-faq .back-to-top-faq:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(211, 47, 47, 0.45);
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
  .page-faq {
    padding: 1.2rem 0.8rem 3rem;
  }
  .page-faq .breadcrumb {
    font-size: 0.78rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
  }
  .page-faq .faq-hero h1 {
    font-size: 1.6rem;
  }
  .page-faq .faq-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.4rem;
  }
  .page-faq .faq-search-input {
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    font-size: 0.88rem;
  }
  .page-faq .faq-search-icon {
    left: 0.9rem;
    font-size: 1.1rem;
  }
  .page-faq .faq-categories {
    gap: 1.8rem;
    margin-top: 0.6rem;
  }
  .page-faq .faq-category {
    padding: 1.2rem 1rem 0.8rem;
  }
  .page-faq .category-head {
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    flex-wrap: wrap;
  }
  .page-faq .category-icon {
    width: 48px;
    height: 48px;
  }
  .page-faq .category-title {
    font-size: 1.05rem;
  }
  .page-faq .faq-question {
    padding: 0.8rem 0.9rem;
    font-size: 0.92rem;
  }
  .page-faq .faq-toggle {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.95rem;
  }
  .page-faq .faq-answer {
    padding: 0 0.9rem 0.9rem;
    font-size: 0.88rem;
  }
  .page-faq .answer-img-wrap {
    margin: 0.6rem 0 0.6rem;
  }
  .page-faq .faq-cta {
    margin-top: 2.4rem;
    padding: 1.6rem 1.2rem;
  }
  .page-faq .cta-heading {
    font-size: 1.15rem;
  }
  .page-faq .cta-text {
    font-size: 0.88rem;
    margin-bottom: 1.2rem;
  }
  .page-faq .cta-links {
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
  }
  .page-faq .btn {
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    width: 100%;
    max-width: 260px;
  }
  .page-faq .back-to-top-faq {
    bottom: 1.2rem;
    right: 1.2rem;
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

/* ---------- 桌面端微调 ---------- */
@media (min-width: 641px) and (max-width: 1024px) {
  .page-faq {
    padding: 1.8rem 1.5rem 4rem;
  }
  .page-faq .faq-category {
    padding: 1.6rem 1.4rem 1rem;
  }
}

/* ---------- 搜索过滤高亮（JS 增强） ---------- */
.page-faq .faq-item[data-hidden] {
  display: none;
}
.page-faq .faq-item[data-matched] {
  background: rgba(255, 215, 0, 0.04);
  border-left: 3px solid var(--faq-accent-gold);
}
.page-faq .faq-item[data-matched] .faq-question {
  color: var(--faq-accent-gold);
}
