/* ==========================================================================
   FAQ 頁面專屬樣式
   ========================================================================== */

/* ---------- Hero ---------- */
.faq-hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
  text-align: center;
}
.faq-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 60% at 50% 0%, rgba(33, 133, 245, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.faq-hero > .container { position: relative; z-index: 1; }
.faq-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(33, 133, 245, 0.1);
  border: 1px solid rgba(33, 133, 245, 0.3);
  border-radius: 999px;
  font-size: 12.5px;
  color: #cde3ff;
  margin-bottom: 24px;
}
.faq-hero__badge svg { width: 14px; height: 14px; }

.faq-hero h1 {
  font-size: 48px;
  line-height: 1.15;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.faq-hero h1 span {
  background: linear-gradient(120deg, #2185F5 0%, #7bc3ff 60%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.faq-hero p {
  margin: 20px auto 0;
  max-width: 680px;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--color-text-dim);
}

/* ---------- 搜尋框 ---------- */
.faq-search {
  margin: 36px auto 0;
  max-width: 560px;
  position: relative;
}
.faq-search > svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-mute);
  pointer-events: none;
}
.faq-search input {
  width: 100%;
  padding: 16px 44px 16px 48px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: #fff;
  font-size: 14.5px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}
.faq-search input::placeholder { color: var(--color-text-mute); }
.faq-search input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(33, 133, 245, 0.15);
}
.faq-search__clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.faq-search__clear.is-visible { display: flex; }
.faq-search__clear:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- 主體佈局 ---------- */
.faq-main { padding: 40px 0 100px; }

.faq-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}

/* ---------- 側邊導航 ---------- */
.faq-nav {
  position: sticky;
  top: 96px;
  padding: 8px 0;
  border-left: 1px solid var(--color-border);
}
.faq-nav__title {
  font-size: 11px;
  color: var(--color-text-mute);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0 18px;
  margin-bottom: 14px;
}
.faq-nav a {
  display: block;
  padding: 9px 18px;
  font-size: 13.5px;
  color: var(--color-text-dim);
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: all 0.2s ease;
}
.faq-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}
.faq-nav a.is-active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  background: rgba(33, 133, 245, 0.06);
}

/* ---------- 分類塊 ---------- */
.faq-section {
  margin-bottom: 56px;
  scroll-margin-top: 96px;
}
.faq-section:last-child { margin-bottom: 0; }

.faq-section__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}
.faq-section__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(33, 133, 245, 0.12);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.faq-section__icon svg { width: 20px; height: 20px; }
.faq-section__title {
  font-size: 22px;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.faq-section__count {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-mute);
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

/* ---------- 摺疊項 ---------- */
.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.faq-item[open] {
  border-color: rgba(33, 133, 245, 0.35);
  background: var(--color-surface-2);
}
.faq-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: #e4e7ea;
  font-weight: 500;
  transition: color 0.2s ease;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:hover { color: #fff; }
.faq-item[open] > summary { color: #fff; }

.faq-item__toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.3s ease, background 0.2s ease;
}
.faq-item[open] .faq-item__toggle {
  transform: rotate(45deg);
  background: rgba(33, 133, 245, 0.2);
}
.faq-item__toggle svg { width: 14px; height: 14px; }

.faq-item__body {
  padding: 18px 22px 22px 22px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--color-text-dim);
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}
.faq-item__body p { margin-bottom: 10px; }
.faq-item__body p:last-child { margin-bottom: 0; }
.faq-item__body strong { color: #fff; font-weight: 600; }
.faq-item__body a { color: var(--color-primary); }
.faq-item__body a:hover { color: var(--color-primary-hover); text-decoration: underline; }
.faq-item__body ul,
.faq-item__body ol {
  margin: 10px 0 12px 4px;
  padding-left: 20px;
}
.faq-item__body li { margin-bottom: 6px; }
.faq-item__body code {
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  font-size: 12.5px;
  padding: 2px 7px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: #cde3ff;
  word-break: break-all;
}
.faq-item__body pre {
  margin: 12px 0;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow-x: auto;
}
.faq-item__body pre code {
  padding: 0;
  background: transparent;
  border: none;
  color: #cde3ff;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
}
.faq-item__body blockquote {
  margin: 10px 0;
  padding: 10px 16px;
  border-left: 2px solid rgba(33, 133, 245, 0.5);
  background: rgba(33, 133, 245, 0.04);
  color: #cdd1d5;
  font-size: 13.5px;
}

/* ---------- 無結果提示 ---------- */
.faq-empty {
  display: none;
  max-width: 720px;
  margin: 24px auto 0;
  padding: 48px 20px;
  text-align: center;
  color: var(--color-text-mute);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}
.faq-empty.is-visible { display: block; }
.faq-empty strong {
  display: block;
  color: #fff;
  margin-bottom: 6px;
  font-size: 16px;
}

/* ---------- 聯絡方塊 ---------- */
.faq-contact {
  margin-top: 64px;
  padding: 40px 36px;
  background:
    radial-gradient(60% 120% at 0% 0%, rgba(33, 133, 245, 0.16), transparent 60%),
    var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.faq-contact h3 {
  font-size: 22px;
  color: #fff;
  margin-bottom: 10px;
}
.faq-contact p {
  color: var(--color-text-dim);
  font-size: 14px;
  margin-bottom: 22px;
}
.faq-contact__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
  .faq-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .faq-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    border-left: none;
    border-bottom: 1px solid var(--color-border);
    padding: 0 0 4px;
    gap: 4px;
  }
  .faq-nav__title { display: none; }
  .faq-nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    white-space: nowrap;
    margin-left: 0;
  }
  .faq-nav a.is-active {
    border-bottom-color: var(--color-primary);
    border-left-color: transparent;
  }
  .faq-section__title { font-size: 18px; }
}

@media (max-width: 720px) {
  .faq-hero { padding: 56px 0 40px; }
  .faq-hero h1 { font-size: 34px; }
  .faq-hero p { font-size: 14px; }
  .faq-contact { padding: 32px 22px; }
}
