/* FAQ page */
.page-faq {
  --faq-sidebar-bg: #f1ebe3;
  background-color: var(--bg);
  background-image: url("../assets/bg-texture-large.jpg");
  background-size: cover;
  background-attachment: scroll;
}

.page-faq .footer-grid::before {
  background-image: url("../assets/contact/footer-bg.jpg");
}

/* Hero — match services-hero sizing & background */
.faq-hero {
  position: relative;
  padding: 0.5rem 0 40px;
  text-align: center;
  overflow: visible;
}

.faq-hero-inner {
  position: relative;
  z-index: 1;
}

.faq-hero-tree {
  position: absolute;
  inset: -1.5rem 0 -2rem;
  z-index: 0;
  background: url("../assets/services/waist-tree.jpg") calc(50% + 5rem) calc(50% + 3rem) / min(792px, 101.2%) auto no-repeat;
  opacity: 0.42;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(
    ellipse 70% 72% at calc(50% + 5rem) calc(48% + 3rem),
    #000 20%,
    transparent 78%
  );
  mask-image: radial-gradient(
    ellipse 70% 72% at calc(50% + 5rem) calc(48% + 3rem),
    #000 20%,
    transparent 78%
  );
}

.faq-hero-inner > *:not(.faq-hero-tree) {
  position: relative;
  z-index: 1;
}

.faq-hero h1 {
  font-family: var(--font-brand);
  font-size: clamp(2.35rem, 5.5vw, 3.35rem);
  font-weight: 500;
  margin: 50px 0 0.5rem;
}

.faq-hero .deco-line {
  width: 200px;
  margin: 0 auto 0.85rem;
}

.faq-hero-sub {
  margin: 0 auto;
  max-width: 640px;
  color: #4b4b4b;
  font-size: 15px;
  line-height: 1.55;
}

/* Main layout — waist background band */
.faq-main {
  position: relative;
  overflow: hidden;
  padding: 2rem 0 4rem;
  background-color: var(--paper);
}

.faq-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/home/bg-waist.png") center top / 100% auto repeat-y;
  pointer-events: none;
  z-index: 0;
}

.faq-main > .wrap {
  position: relative;
  z-index: 1;
}

.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* Sidebar categories */
.faq-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.faq-categories {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(176, 164, 149, 0.55);
  border-radius: 4px;
  background: var(--faq-sidebar-bg);
  overflow: hidden;
}

.faq-cat {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 0.85rem 0.75rem 0.75rem;
  border: none;
  border-left: 6px solid transparent;
  border-bottom: 1px solid rgba(176, 164, 149, 0.45);
  background: transparent;
  font-family: var(--font-brand);
  font-size: 18px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.faq-cat:last-child {
  border-bottom: none;
}

.faq-cat img {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  object-fit: contain;
}

.faq-cat:hover {
  color: var(--accent);
}

.faq-cat.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.45);
  font-weight: 700;
}

/* Help card */
.faq-help {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--faq-sidebar-bg);
  border: 1px solid rgba(176, 164, 149, 0.55);
  border-radius: 4px;
  padding: 1.25rem 1.1rem 1.35rem;
  text-align: center;
}

.faq-help-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.faq-help-icon img {
  width: 38px;
  height: 38px;
}

.faq-help h2 {
  font-family: var(--font-brand);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.45;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  color: var(--ink);
}

.faq-help-deco {
  width: 2.75rem;
  height: 2px;
  margin: 0.55rem auto 0.75rem;
  background: var(--line-red);
}

.faq-help p {
  margin: 0 auto 1rem;
  width: 100%;
  max-width: 100%;
  font-size: 15px;
  line-height: 1.5;
  color: #4b4b4b;
  text-align: center;
}

.faq-help-btn {
  display: inline-block;
  min-width: 140px;
  padding: 0.55rem 1.25rem;
  background: #e8dfd0;
  border: 1px solid #cfbaa4;
  border-radius: 4px;
  color: var(--brown);
  font-family: var(--font-brand);
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.faq-help-btn:hover {
  background: #ddd2c0;
  text-decoration: none;
}

/* Accordion */
.faq-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(176, 164, 149, 0.55);
  border-radius: 4px;
  background: transparent;
  padding: 0 1.25rem;
}

.faq-q-item {
  border-bottom: 1px solid rgba(176, 164, 149, 0.45);
}

.faq-q-item:first-child {
  border-top: none;
}

.faq-q-item:last-child {
  border-bottom: none;
}

.faq-q-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem 0;
  border: none;
  background: transparent;
  font-family: var(--font-brand);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  line-height: 1.4;
}

.faq-q-text {
  font-size: 18px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.75);
}

.faq-q-item.is-open .faq-q-toggle {
  color: var(--accent);
}

.faq-q-icon {
  flex-shrink: 0;
  width: 1.25rem;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  text-align: center;
}

.faq-q-item.is-open .faq-q-icon {
  color: var(--accent);
}

.faq-q-answer {
  padding: 0 0 1rem;
}

.faq-q-answer[hidden] {
  display: none;
}

.faq-q-answer p {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--faq-sidebar-bg);
  border: 1px solid rgba(176, 164, 149, 0.55);
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.faq-landscape {
  display: none;
}

/* Responsive */
@media (max-width: 860px) {
  /* 手机端仍保持：左分类 | 右问答 */
  .faq-layout {
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
  }

  .faq-categories {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .faq-cat {
    padding: 0.55rem 0.45rem;
    font-size: clamp(0.72rem, 2.6vw, 0.88rem);
    border-left: 4px solid transparent;
    border-bottom: 1px solid rgba(176, 164, 149, 0.45);
    gap: 0.4rem;
  }

  .faq-cat:last-child {
    border-bottom: none;
  }

  .faq-cat.is-active {
    border-left-color: var(--accent);
    border-bottom-color: rgba(176, 164, 149, 0.45);
    background: rgba(255, 255, 255, 0.45);
  }

  .faq-cat img {
    width: clamp(28px, 7vw, 40px);
    height: clamp(28px, 7vw, 40px);
    flex-shrink: 0;
  }

  .faq-panel {
    min-width: 0;
  }

  .faq-help {
    align-items: center;
    text-align: center;
    padding: 0.85rem 0.55rem 1rem;
  }

  .faq-help h2 {
    width: 100%;
    font-size: clamp(0.95rem, 3.5vw, 1.25rem);
    text-align: center;
  }

  .faq-help p {
    width: 100%;
    font-size: clamp(0.72rem, 2.8vw, 0.88rem);
    text-align: center;
  }

  .faq-help-deco {
    margin-left: auto;
    margin-right: auto;
  }

  .faq-help-icon {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .faq-layout {
    grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
    gap: 0.65rem;
  }

  .faq-cat {
    padding: 0.45rem 0.35rem;
    font-size: 0.7rem;
    gap: 0.3rem;
  }

  .faq-cat img {
    width: 26px;
    height: 26px;
  }
}
