.faq-page {
  --faq-ink: #17212b;
  --faq-muted: #5c6874;
  --faq-soft: #f4f8fb;
  --faq-line: rgba(18, 48, 74, 0.1);
  --faq-blue: #1f70b2;
  --faq-navy: #12304a;
  --faq-amber: #a87300;
  --faq-green: #2f9d78;
  --faq-violet: #6a5acd;
}

.faq-page .faq-category-nav {
  position: relative;
  top: auto;
  z-index: 1;
  border-bottom: 0;
  box-shadow: none;
}

.faq-category-nav .inner-anchor-nav__inner {
  justify-content: space-between;
}

.faq-category-nav .inner-anchor-nav__links::after {
  display: block;
}

.faq-category-nav .inner-anchor-nav__links button {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: var(--inner-anchor-height);
  padding: 0;
  color: rgba(31, 41, 51, 0.86);
  font-size: var(--inner-anchor-font-size);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-standard),
    font-size var(--duration-normal) var(--ease-standard);
}

.faq-category-nav .inner-anchor-nav__links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: var(--inner-anchor-height);
  padding: 0;
  color: rgba(31, 41, 51, 0.86);
  font-size: var(--inner-anchor-font-size);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition:
    color var(--duration-fast) var(--ease-standard),
    font-size var(--duration-normal) var(--ease-standard);
}

.faq-category-nav .inner-anchor-nav__links a:hover,
.faq-category-nav .inner-anchor-nav__links a:focus-visible,
.faq-category-nav .inner-anchor-nav__links a.is-active,
.faq-category-nav .inner-anchor-nav__links a[aria-pressed="true"] {
  color: var(--faq-blue);
}

.faq-category-nav .inner-anchor-nav__links button:hover,
.faq-category-nav .inner-anchor-nav__links button:focus-visible,
.faq-category-nav .inner-anchor-nav__links button.is-active {
  color: var(--faq-blue);
}

.faq-category-nav .inner-anchor-nav__links button:focus-visible {
  outline: 2px solid rgba(31, 112, 178, 0.24);
  outline-offset: 6px;
}

.faq-content {
  background:
    radial-gradient(circle at 15% 8%, rgba(220, 240, 255, 0.64), rgba(220, 240, 255, 0) 34%),
    linear-gradient(180deg, #f7fbff 0%, #edf7ff 46%, #f8fbff 100%);
}

.faq-search {
  padding: clamp(38px, 4.4vw, 60px) 0 12px;
}

.faq-search__inner {
  display: grid;
  gap: 10px;
  width: calc(100% - (var(--page-gutter) * 2));
  margin: 0 auto;
}

.faq-search__count {
  margin: 0;
  color: rgba(35, 52, 71, 0.68);
  font-size: clamp(13px, 0.86vw, 15px);
  line-height: 1.6;
}

.faq-search__field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 16px 0 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(31, 112, 178, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 52px rgba(18, 48, 74, 0.08);
}

.faq-search__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--faq-blue);
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.faq-search__submit .iconify {
  display: block;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  background: transparent;
  color: currentColor;
}

.faq-search__submit .iconify svg {
  display: block;
  width: 1em;
  height: 1em;
  background: transparent;
}

.faq-search__field input {
  min-width: 0;
  flex: 1 1 auto;
  height: 58px;
  appearance: none;
  -webkit-appearance: none;
  color: var(--faq-ink);
  font-size: clamp(14px, 0.96vw, 16px);
  background: transparent;
  border: 0;
  outline: 0;
}

.faq-search__field input::-webkit-search-decoration,
.faq-search__field input::-webkit-search-results-button,
.faq-search__field input::-webkit-search-results-decoration {
  display: none;
  appearance: none;
  -webkit-appearance: none;
}

.faq-search__field input::placeholder {
  color: rgba(91, 102, 115, 0.66);
}

.faq-search__field input::-webkit-search-cancel-button {
  appearance: none;
  -webkit-appearance: none;
}

.faq-search__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--faq-muted);
  background: rgba(18, 48, 74, 0.06);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard);
}

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

.faq-search__clear:hover,
.faq-search__clear:focus-visible {
  color: var(--faq-blue);
  background: rgba(31, 112, 178, 0.12);
}

.faq-search__clear .iconify {
  width: 18px;
  height: 18px;
}

.faq-list-section {
  padding: 8px 0 clamp(58px, 6.4vw, 92px);
}

.faq-list-section__inner {
  width: calc(100% - (var(--page-gutter) * 2));
  margin: 0 auto;
}

.faq-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
}

.faq-item {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 1.6vw, 22px);
  padding: clamp(18px, 1.8vw, 26px);
  background: #ffffff;
  border: 1px solid rgba(18, 48, 74, 0.12);
  border-radius: 12px;
  transition:
    border-color var(--duration-normal) var(--ease-standard),
    box-shadow var(--duration-normal) var(--ease-standard),
    transform var(--duration-normal) var(--ease-standard);
}

.faq-item:hover,
.faq-item:focus-within {
  border-color: rgba(31, 112, 178, 0.24);
  box-shadow: 0 22px 54px rgba(18, 48, 74, 0.09);
  transform: translateY(-2px);
}

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

.faq-item__category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 30px;
  padding: 0 14px;
  color: var(--faq-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
  border: 1px solid rgba(18, 48, 74, 0.2);
  border-radius: 999px;
}

.faq-item__panel {
  flex: 1;
  padding: clamp(20px, 2vw, 30px);
  color: #ffffff;
  background: var(--faq-blue);
  border-radius: 10px;
}

/* 面板颜色按 FAQ 分类固定，不随问题排序改变。 */
.faq-item[data-faq-category="aftersales"] .faq-item__panel {
  background: var(--faq-green);
}

.faq-item[data-faq-category="technical"] .faq-item__panel {
  background: var(--faq-violet);
}

.faq-item[data-faq-category="oth"] .faq-item__panel {
  background: var(--faq-amber);
}

.faq-item__title {
  margin: 0 0 clamp(12px, 1.2vw, 16px);
  color: #ffffff;
  font-size: clamp(20px, 1.5vw, 26px);
  font-weight: 700;
  line-height: 1.32;
}

.faq-item__answer p,
.faq-item__answer p:last-child {
  max-width: none;
  margin: 0;
  color: inherit;
  font-size: clamp(13px, 0.9vw, 15px);
  line-height: 1.8;
}

/* 按钮样式参考 cases 页的 case-card__more（cta-pill 基础样式在 home.css） */
.faq-item__action {
  --cta-pill-size: 42px;
  --cta-pill-bg: #ffffff;
  --cta-pill-bg-hover: #ffffff;
  --cta-pill-icon-bg: #1f70b2;
  --cta-pill-icon-bg-hover: #155c97;
  --cta-pill-color: #142334;
  align-self: flex-start;
  isolation: isolate;
  width: fit-content;
  min-width: 132px;
  padding-right: 18px;
  padding-left: calc(var(--cta-pill-size) + 12px);
  border: 0;
  background: var(--cta-pill-bg);
  box-shadow: none;
  backdrop-filter: none;
}

.faq-item__action::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: calc(var(--cta-pill-size) / 2);
  z-index: 0;
  border: 1px solid rgba(31, 112, 178, 0.2);
  border-left: 0;
  border-radius: 0 999px 999px 0;
  pointer-events: none;
  transition: border-color var(--duration-normal) var(--ease-standard);
}

.faq-item__action .cta-pill__icon {
  z-index: 1;
  box-shadow: none;
}

.faq-item__action .cta-pill__text {
  position: relative;
  z-index: 1;
  color: #142334;
  font-size: 13px;
  font-weight: 400;
}

.faq-item__action:hover {
  background: var(--cta-pill-bg-hover);
}

.faq-item__action:hover::after {
  border-color: rgba(31, 112, 178, 0.36);
}

.faq-item__action:focus-visible {
  outline: 2px solid rgba(31, 112, 178, 0.28);
  outline-offset: 4px;
}

/* 按钮图标颜色同步对应的 FAQ 分类。 */
.faq-item[data-faq-category="aftersales"] .faq-item__action {
  --cta-pill-icon-bg: var(--faq-green);
  --cta-pill-icon-bg-hover: #267d60;
}

.faq-item[data-faq-category="technical"] .faq-item__action {
  --cta-pill-icon-bg: var(--faq-violet);
  --cta-pill-icon-bg-hover: #5346ae;
}

.faq-item[data-faq-category="oth"] .faq-item__action {
  --cta-pill-icon-bg: var(--faq-amber);
  --cta-pill-icon-bg-hover: #8a5d00;
}

.faq-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 240px;
  margin-top: 14px;
  padding: 46px 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed rgba(31, 112, 178, 0.26);
  border-radius: 8px;
}

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

.faq-empty .iconify {
  width: 42px;
  height: 42px;
  color: var(--faq-blue);
}

.faq-empty strong {
  color: var(--faq-ink);
  font-size: 20px;
}

.faq-empty p {
  margin: 0;
  color: var(--faq-muted);
  font-size: 15px;
  line-height: 1.7;
}

@media (min-width: 1181px) {
  .faq-page .faq-category-nav .inner-anchor-nav__inner,
  .faq-page .faq-search__inner,
  .faq-page .faq-list-section__inner {
    width: calc(100% - (var(--page-gutter) * 2));
    max-width: none;
    padding-left: var(--inner-page-align-offset);
    padding-right: var(--inner-page-align-offset);
  }
}

@media (max-width: 1180px) {
  .faq-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .faq-search {
    padding: 34px 0 10px;
  }

  .faq-search__inner {
    width: 100%;
    padding: 0 20px;
  }

  .faq-list-section {
    padding: 8px 0 58px;
  }

  .faq-list-section__inner {
    width: 100%;
    padding: 0 20px;
  }

  .faq-item__panel {
    padding: 20px;
  }
}

@media (max-width: 760px) {
  .faq-page .faq-category-nav {
    --inner-anchor-font-size: 12px;
    --inner-anchor-line-width: 42px;
  }

  .faq-page .faq-category-nav.is-stuck {
    --inner-anchor-font-size: 12px;
    --inner-anchor-line-width: 40px;
  }

  .faq-page .faq-category-nav .inner-anchor-nav__inner {
    overflow-x: auto;
    padding: 0 18px;
  }

  .faq-page .faq-category-nav .inner-anchor-nav__links {
    gap: 18px;
  }

  .faq-page .faq-category-nav .inner-anchor-nav__links a {
    font-size: 12px;
  }

  .faq-search__inner {
    width: 100%;
    padding: 0 18px;
  }

  .faq-search {
    padding-top: 30px;
    padding-bottom: 8px;
  }

  .faq-search__count {
    font-size: 12px;
    line-height: 1.5;
  }

  .faq-search__field {
    gap: 8px;
    min-height: 50px;
    padding: 0 10px 0 12px;
  }

  .faq-search__submit,
  .faq-search__submit .iconify {
    width: 18px;
    height: 18px;
  }

  .faq-search__field input {
    height: 48px;
    font-size: 12px;
  }

  .faq-search__clear {
    width: 30px;
    height: 30px;
  }

  .faq-list-section {
    padding: 8px 0 52px;
  }

  .faq-list-section__inner {
    padding: 0 18px;
  }

  .faq-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .faq-item__category {
    min-height: 26px;
    padding: 0 10px;
    font-size: 12px;
  }

  .faq-item__title {
    font-size: 18px;
  }

  .faq-item__answer p,
  .faq-item__answer p:last-child {
    font-size: 13px;
    line-height: 1.7;
  }
}

@media (max-width: 480px) {
  .faq-search {
    padding-top: 28px;
  }

  .faq-search__inner,
  .faq-list-section__inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .faq-page .faq-category-nav .inner-anchor-nav__inner {
    padding-right: 16px;
    padding-left: 16px;
  }

  .faq-page .faq-category-nav .inner-anchor-nav__links {
    gap: 16px;
  }

  .faq-list-section {
    padding-bottom: 48px;
  }

  .faq-item summary {
    gap: 6px 10px;
    padding: 22px 16px 10px;
  }

  .faq-item__answer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .faq-item details.is-open .faq-item__answer {
    padding-bottom: 24px;
  }
}
