/* FAQ Page Styles - Redesigned with full responsive */
:root {
  --faq-primary: #1a56e8;
  --faq-primary-dark: #1240b5;
  --faq-secondary: #ff6b35;
  --faq-bg: #f5f7ff;
  --faq-card: #ffffff;
  --faq-text: #1a2340;
  --faq-text-light: #5a6a8a;
  --faq-border: #e2e8f8;
}

/* ====== FAQ Page Header ====== */
/* FAQ page uses standard light header - no overrides needed */
/* ====== Hero ====== */
.faq-hero {
  background: #f5f7fb;
  border-bottom: 1px solid #e2e6f0;
  padding: 32px 32px 28px;
  text-align: center;
  color: var(--faq-text);
  margin-bottom: 0;
}
.faq-hero-badge {
  display: inline-block;
  background: var(--faq-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.faq-hero h1 {
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--faq-text);
}
.faq-hero p {
  font-size: 13px;
  color: var(--faq-text-light);
  margin-bottom: 20px;
}
.faq-hero-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.faq-stat-pill {
  background: #fff;
  border: 1px solid #e2e6f0;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--faq-text);
  box-shadow: 0 1px 2px rgba(0,0,50,0.04);
}
.faq-stat-pill span {
  color: var(--faq-primary);
  margin-right: 3px;
}
.faq-hero-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.faq-hero-tags span {
  background: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  color: var(--faq-text-light);
  border: 1px solid #e2e6f0;
  transition: all 0.15s;
}
.faq-hero-tags span:hover {
  color: var(--faq-primary);
  border-color: var(--faq-primary);
}

/* ====== Layout ====== */
.faq-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 900px) {
  .faq-layout {
    grid-template-columns: 220px 1fr;
  }
}

/* ====== Sidebar ====== */
.faq-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: var(--faq-border) transparent;
}
.faq-sidebar::-webkit-scrollbar { width: 4px; }
.faq-sidebar::-webkit-scrollbar-track { background: transparent; }
.faq-sidebar::-webkit-scrollbar-thumb { background: var(--faq-border); border-radius: 4px; }
.faq-sidebar::-webkit-scrollbar-thumb:hover { background: var(--faq-text-light); }
@media (min-width: 900px) {
  .faq-sidebar { display: block; }
}
.faq-sidebar-inner {
  background: var(--faq-card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 50, 0.06);
}
.faq-sidebar-inner h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--faq-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.faq-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.faq-cat-list li {
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: block;
  transition: all 0.15s;
  margin-bottom: 2px;
  color: var(--faq-text);
}
.faq-cat-list li:hover {
  background: #eef2ff;
  color: var(--faq-primary);
}
.faq-cat-list li.active {
  background: #e0e7ff;
  color: var(--faq-primary);
  font-weight: 600;
}
.faq-cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.faq-cat-count {
  margin-left: auto;
  background: #e8ecf8;
  color: var(--faq-text-light);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}
.faq-cat-list li.active .faq-cat-count {
  background: var(--faq-primary);
  color: #fff;
}
.faq-sidebar-cta {
  background: linear-gradient(135deg, var(--faq-primary), #6366f1);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  box-shadow: 0 4px 16px rgba(26, 86, 232, 0.25);
}
.faq-sidebar-cta h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.faq-sidebar-cta p {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 12px;
  line-height: 1.5;
}
.faq-sidebar-cta-btn {
  display: block;
  background: #fff;
  color: var(--faq-primary);
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  width: 100%;
}
.faq-sidebar-cta-btn:hover { opacity: 0.9; }

/* ====== Mobile Category Bar ====== */
.faq-mobile-cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 12px;
  background: var(--faq-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 50, 0.06);
  margin-bottom: 12px;
}
.faq-mobile-cats::-webkit-scrollbar { display: none; }
@media (min-width: 900px) {
  .faq-mobile-cats { display: none; }
}
.faq-mobile-cats a {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid var(--faq-border);
  background: var(--faq-bg);
  color: var(--faq-text-light);
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.faq-mobile-cats a.active {
  background: var(--faq-primary);
  border-color: var(--faq-primary);
  color: #fff;
}

/* ====== Main Content ====== */
.faq-content {
  min-width: 0;
}
.faq-search-bar {
  background: var(--faq-card);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 50, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq-search-bar .faq-search-icon {
  color: var(--faq-text-light);
  font-size: 14px;
}
.faq-search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--faq-text);
  background: transparent;
  font-family: inherit;
}
.faq-search-bar input::placeholder { color: var(--faq-text-light); }
.faq-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.faq-results-count {
  font-size: 12px;
  color: var(--faq-text-light);
}
.faq-results-count strong { color: var(--faq-primary); }

/* ====== FAQ List ====== */
.faq-list {
  background: var(--faq-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 50, 0.06);
  overflow: hidden;
}
.faq-item {
  border-bottom: 1px solid var(--faq-border);
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background 0.15s;
}
.faq-question:hover { background: #fafbff; }
.faq-num {
  background: var(--faq-bg);
  border: 1px solid var(--faq-border);
  color: var(--faq-text-light);
  font-size: 11px;
  font-weight: 700;
  min-width: 30px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.faq-title-area {
  flex: 1;
  min-width: 0;
}
.faq-cat-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
  margin-bottom: 4px;
}
.faq-q-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--faq-text);
  line-height: 1.5;
}
.faq-chevron {
  color: var(--faq-text-light);
  font-size: 12px;
  transition: transform 0.25s;
  flex-shrink: 0;
  margin-top: 4px;
}
.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--faq-primary);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 20px 0 62px;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 2000px;
  padding: 0 20px 16px 62px;
}
.faq-a-text {
  font-size: 13px;
  color: #475569;
  line-height: 1.75;
}

/* ====== Structured Answer ====== */
.faq-structured {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.faq-block {
  font-size: 13px;
  color: #475569;
  line-height: 1.75;
}
.faq-block-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--faq-text);
  margin-bottom: 6px;
}
.faq-block-content p {
  margin: 0 0 8px;
}
.faq-block-content p:last-child {
  margin-bottom: 0;
}
/* intro - 问题分析，无标题，自然段落 */
.faq-block-intro .faq-block-content {
  color: #334155;
}
/* steps - 建议动作，有序列表 */
.faq-block-steps .faq-block-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-block-steps .faq-block-list li {
  padding-left: 22px;
  position: relative;
  color: #334155;
}
.faq-block-steps .faq-block-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faq-primary);
}
.faq-block-steps .faq-block-list li strong {
  color: var(--faq-text);
}
/* summary - 品效云观点，淡色背景 */
.faq-block-summary {
  background: #f0f4ff;
  border-radius: 8px;
  padding: 12px 14px;
}
.faq-block-summary .faq-block-title {
  color: var(--faq-primary);
}
.faq-block-summary .faq-block-content {
  color: #475569;
}
/* pitfall - 常见误区，可折叠 */
.faq-block-pitfall {
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0;
  background: #fef2f2;
}
.faq-block-pitfall summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #dc2626;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.faq-block-pitfall summary::before {
  content: '⚠';
  font-size: 13px;
}
.faq-block-pitfall summary::-webkit-details-marker { display: none; }
.faq-block-pitfall-body {
  padding: 0 14px 12px;
  color: #7f1d1d;
  font-size: 12px;
  line-height: 1.7;
}
/* divider */
.faq-answer-divider {
  height: 1px;
  background: var(--faq-border);
  margin: 4px 0;
}
/* cta */
.faq-block-cta {
  text-align: left;
}
.faq-cta-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--faq-text-light);
  margin-bottom: 6px;
}
.faq-cta-text {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 10px;
  line-height: 1.6;
}
.faq-cta-actions {
  display: flex;
  gap: 8px;
}
.faq-cta-btn {
  background: var(--faq-primary);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.faq-cta-btn:hover {
  background: var(--faq-primary-dark);
}

/* ====== Load More ====== */
.faq-load-more {
  padding: 12px 20px;
  text-align: center;
  border-top: 1px solid var(--faq-border);
}
.faq-load-more button {
  background: var(--faq-bg);
  border: 1.5px solid var(--faq-border);
  color: var(--faq-primary);
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.faq-load-more button:hover {
  background: var(--faq-primary);
  color: #fff;
  border-color: var(--faq-primary);
}

/* ====== AI Typing Dots ====== */
.faq-ai-dots span {
  animation: faqDotBounce 1.4s infinite ease-in-out both;
  font-size: 16px;
  line-height: 1;
}
.faq-ai-dots span:nth-child(1) { animation-delay: 0s; }
.faq-ai-dots span:nth-child(2) { animation-delay: 0.16s; }
.faq-ai-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes faqDotBounce {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

/* ====== Empty State ====== */
.faq-empty {
  background: var(--faq-card);
  border-radius: 12px;
  padding: 48px 20px;
  text-align: center;
  color: var(--faq-text-light);
  box-shadow: 0 2px 8px rgba(0, 0, 50, 0.06);
  display: none;
}
.faq-empty.visible { display: block; }
.faq-empty .faq-empty-icon { font-size: 36px; margin-bottom: 12px; }
.faq-empty p { font-size: 13px; margin-bottom: 12px; }
.faq-empty a {
  color: var(--faq-primary);
  font-size: 13px;
  font-weight: 600;
}

/* ====== CTA Section ====== */
.faq-cta {
  background: var(--faq-primary);
  border-radius: 12px;
  padding: 32px 28px;
  margin-top: 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(26, 86, 232, 0.15);
}
.faq-cta h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.faq-cta p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 18px;
}
.faq-cta-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.faq-cta-primary {
  background: var(--faq-secondary);
  color: #fff;
  padding: 11px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.faq-cta-primary:hover { background: #e85a25; }
.faq-cta-secondary {
  background: transparent;
  color: #fff;
  padding: 11px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s;
}
.faq-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

/* ====== Floating AI Button ====== */
.faq-ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--faq-primary), #6366f1);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(26, 86, 232, 0.35);
  transition: all 0.2s;
}
.faq-ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(26, 86, 232, 0.45);
}
.faq-ai-fab-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.faq-ai-fab-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--faq-secondary);
  border-radius: 50%;
  border: 2px solid #fff;
}
.faq-ai-fab-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--faq-secondary);
  opacity: 0.4;
  animation: faqPulse 2s infinite;
}
@keyframes faqPulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2); opacity: 0; }
}

/* ====== AI Chat Modal ====== */
.faq-ai-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 31, 92, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 20px;
}
.faq-ai-backdrop.open { display: flex; }
.faq-ai-modal {
  background: var(--faq-card);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  height: min(560px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 50, 0.25);
  overflow: hidden;
  animation: faqModalIn 0.25s ease-out;
}
@keyframes faqModalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.faq-ai-header {
  background: linear-gradient(135deg, var(--faq-primary), #6366f1);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.faq-ai-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.faq-ai-title { flex: 1; }
.faq-ai-title h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.faq-ai-title p { font-size: 11px; opacity: 0.8; }
.faq-ai-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.faq-ai-close:hover { background: rgba(255, 255, 255, 0.25); }

.faq-ai-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-ai-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.faq-ai-msg-user { justify-content: flex-end; }
.faq-ai-msg-ai { justify-content: flex-start; }
.faq-ai-bubble {
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 85%;
  word-break: break-word;
}
.faq-ai-bubble-user {
  background: #1a56e8;
  color: #fff;
  border-radius: 12px 12px 4px 12px;
}
.faq-ai-bubble-wrap {
  background: var(--faq-bg);
  color: var(--faq-text);
  border-radius: 12px 12px 12px 4px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 85%;
  word-break: break-word;
  overflow-wrap: break-word;
}
.faq-ai-msg-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--faq-primary), #6366f1);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.faq-ai-streaming-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--faq-text);
}

/* AgentResponseRenderer integration inside FAQ modal */
.faq-ai-bubble-wrap .agent-response-root {
  font-size: 13px;
  line-height: 1.6;
}
.faq-ai-bubble-wrap .pxy-answer-section { margin: 0; }
.faq-ai-bubble-wrap .pxy-answer-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
.faq-ai-bubble-wrap .pxy-answer-direct {
  font-size: 13px;
  line-height: 1.6;
  color: var(--faq-text);
}
.faq-ai-bubble-wrap .pxy-handoff-card {
  margin-top: 8px;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
}
.faq-ai-bubble-wrap .pxy-answer-actions {
  margin-top: 6px;
  gap: 4px;
}
.faq-ai-bubble-wrap .pxy-answer-actions button,
.faq-ai-bubble-wrap .pxy-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 14px;
  min-height: 28px;
}
.faq-ai-bubble-wrap .pxy-answer-list li {
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 3px;
}
.faq-ai-bubble-wrap .pxy-message-feedback {
  margin-top: 6px;
  font-size: 10px;
}

.faq-ai-quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.faq-ai-quick button {
  background: #fff;
  border: 1px solid var(--faq-border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--faq-primary);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
}
.faq-ai-quick button:hover {
  background: #eef2ff;
  border-color: var(--faq-primary);
}

/* ====== Action buttons bar (reuses thinktank-response-actions) ====== */
.faq-ai-bubble-wrap .thinktank-response-actions,
.faq-response-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.faq-ai-bubble-wrap .thinktank-response-actions button,
.faq-response-actions button {
  background: #fff;
  border: 1px solid var(--faq-border);
  color: var(--faq-primary);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  min-height: 32px;
}
.faq-ai-bubble-wrap .thinktank-response-actions button:hover,
.faq-response-actions button:hover {
  background: var(--faq-primary);
  color: #fff;
  border-color: var(--faq-primary);
}
.faq-ai-bubble-wrap .thinktank-response-actions button:disabled,
.faq-response-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ====== Message feedback (reuses thinktank-message-feedback) ====== */
.faq-ai-bubble-wrap .thinktank-message-feedback {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.faq-ai-bubble-wrap .thinktank-message-feedback button {
  background: transparent;
  border: 1px solid var(--faq-border);
  color: var(--faq-text-light);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.faq-ai-bubble-wrap .thinktank-message-feedback button:hover {
  border-color: var(--faq-primary);
  color: var(--faq-primary);
}
.faq-ai-bubble-wrap .thinktank-message-feedback button.is-active {
  background: var(--faq-primary);
  color: #fff;
  border-color: var(--faq-primary);
}
.faq-ai-bubble-wrap .thinktank-message-feedback button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ====== Handoff form (reuses thinktank-handoff-form classes) ====== */
.faq-ai-bubble-wrap .thinktank-handoff-form,
.faq-handoff-form {
  margin-top: 10px;
  padding: 12px;
  background: #f8faff;
  border: 1px solid var(--faq-border);
  border-radius: 10px;
}
.faq-ai-bubble-wrap .thinktank-handoff-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--faq-text);
  margin-bottom: 4px;
}
.faq-ai-bubble-wrap .thinktank-handoff-desc {
  font-size: 11px;
  color: var(--faq-text-light);
  margin-bottom: 8px;
  line-height: 1.5;
}
.faq-ai-bubble-wrap .thinktank-handoff-type-group {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.faq-ai-bubble-wrap .thinktank-handoff-type-btn {
  padding: 4px 10px;
  border: 1px solid var(--faq-border);
  background: #fff;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  color: var(--faq-text-light);
}
.faq-ai-bubble-wrap .thinktank-handoff-type-btn.active {
  background: var(--faq-primary);
  color: #fff;
  border-color: var(--faq-primary);
}
.faq-ai-bubble-wrap .thinktank-handoff-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--faq-border);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  margin-bottom: 4px;
}
.faq-ai-bubble-wrap .thinktank-handoff-input:focus {
  border-color: var(--faq-primary);
}
.faq-ai-bubble-wrap .thinktank-handoff-input.is-invalid {
  border-color: #ef4444;
}
.faq-ai-bubble-wrap .thinktank-handoff-error {
  font-size: 11px;
  color: #ef4444;
  margin: 2px 0 6px;
  min-height: 14px;
}
.faq-ai-bubble-wrap .thinktank-handoff-error.is-visible {
  display: block;
}
.faq-ai-bubble-wrap .thinktank-handoff-submit {
  width: 100%;
  padding: 8px;
  background: var(--faq-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.faq-ai-bubble-wrap .thinktank-handoff-submit:hover {
  background: var(--faq-primary-dark);
}
.faq-ai-bubble-wrap .thinktank-handoff-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.faq-ai-bubble-wrap .thinktank-handoff-success {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: #22c55e;
  font-weight: 600;
}

/* ====== AgentResponseRenderer integration ====== */
.faq-ai-bubble-wrap .agent-response-root {
  width: 100%;
}
.faq-ai-bubble-wrap .pxy-answer-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
.faq-ai-bubble-wrap .pxy-answer-section {
  margin: 0;
}
.faq-ai-bubble-wrap .pxy-answer-direct {
  font-size: 13px;
  line-height: 1.6;
  color: var(--faq-text);
}
.faq-ai-bubble-wrap .pxy-handoff-card {
  margin-top: 8px;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
}
.faq-ai-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--faq-border);
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fafbff;
}
.faq-ai-footer input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--faq-border);
  border-radius: 20px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  background: #fff;
}
.faq-ai-footer input:focus { border-color: var(--faq-primary); }
.faq-ai-send {
  background: var(--faq-primary);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.faq-ai-send:hover { background: var(--faq-primary-dark); }
.faq-ai-hint {
  padding: 0 16px 10px;
  font-size: 10px;
  color: var(--faq-text-light);
  text-align: center;
  background: #fafbff;
}

/* ====== Responsive - Tablet (768px-899px) ====== */
@media (min-width: 768px) and (max-width: 899px) {
  .faq-hero {
    padding: 32px 24px;
  }
  .faq-hero h1 {
    font-size: 22px;
  }
  .faq-hero-tags span {
    font-size: 10px;
    padding: 3px 10px;
  }
  .faq-stat-pill {
    font-size: 11px;
    padding: 4px 12px;
  }
  .faq-question {
    padding: 14px 16px;
  }
  .faq-answer {
    padding: 0 16px 14px 58px;
  }
  .faq-cta {
    padding: 24px 20px;
  }
}

/* ====== Responsive - Mobile (<768px) ====== */
@media (max-width: 767px) {
  .faq-hero {
    padding: 28px 16px;
    border-radius: 0 0 16px 16px;
    margin-bottom: 16px;
  }
  .faq-hero h1 {
    font-size: 20px;
  }
  .faq-hero p {
    font-size: 12px;
    margin-bottom: 14px;
  }
  .faq-hero-stats {
    gap: 8px;
  }
  .faq-stat-pill {
    font-size: 11px;
    padding: 4px 10px;
  }
  .faq-hero-tags {
    gap: 4px;
  }
  .faq-hero-tags span {
    font-size: 10px;
    padding: 3px 8px;
  }
  .faq-mobile-cats {
    padding: 8px 10px;
    gap: 4px;
    margin-bottom: 10px;
  }
  .faq-mobile-cats span {
    font-size: 11px;
    padding: 5px 10px;
  }
  .faq-search-bar {
    padding: 10px 12px;
    margin-bottom: 12px;
  }
  .faq-search-bar input { font-size: 13px; }
  .faq-question {
    padding: 14px 14px;
    gap: 8px;
  }
  .faq-num {
    min-width: 26px;
    height: 20px;
    font-size: 10px;
    border-radius: 4px;
  }
  .faq-cat-tag {
    font-size: 9px;
    padding: 1px 6px;
  }
  .faq-q-text {
    font-size: 13px;
  }
  .faq-answer {
    padding: 0 14px 14px 48px;
  }
  .faq-a-text {
    font-size: 12px;
    line-height: 1.7;
  }
  .faq-cta {
    padding: 24px 18px;
    border-radius: 12px;
  }
  .faq-cta h2 { font-size: 16px; }
  .faq-cta p { font-size: 12px; }
  .faq-cta-buttons {
    flex-direction: column;
    gap: 8px;
  }
  .faq-cta-primary, .faq-cta-secondary {
    width: 100%;
    text-align: center;
    padding: 11px 20px;
  }
  /* Mobile AI modal: full screen */
  .faq-ai-backdrop {
    padding: 0;
  }
  .faq-ai-modal {
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
  .faq-ai-header {
    padding: 12px 16px;
    flex-shrink: 0;
    cursor: default;
  }
  .faq-ai-body {
    padding: 12px 14px;
    gap: 10px;
  }
  .faq-ai-bubble-wrap .pxy-answer-actions button,
  .faq-ai-bubble-wrap .pxy-chip {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 12px;
  }
  .faq-ai-footer {
    padding: 10px 14px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .faq-ai-hint {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  /* Mobile: hide FAB, use sidebar CTA / bottom CTA instead */
  .faq-ai-fab {
    display: none;
  }
}

/* ====== Responsive - Small mobile (<375px) ====== */
@media (max-width: 374px) {
  .faq-hero {
    padding: 20px 12px;
  }
  .faq-hero h1 { font-size: 18px; }
  .faq-hero-stats { gap: 6px; }
  .faq-stat-pill { font-size: 10px; padding: 3px 8px; }
  .faq-question { padding: 12px 10px; gap: 6px; }
  .faq-num { min-width: 24px; height: 18px; font-size: 9px; }
  .faq-q-text { font-size: 12px; }
  .faq-answer { padding: 0 10px 12px 40px; }
  .faq-a-text { font-size: 12px; }
}

/* ====== Reduced motion ====== */
@media (prefers-reduced-motion: reduce) {
  .faq-ai-modal { animation: none; }
  .faq-chevron { transition: none; }
  .faq-ai-dots span { animation: none; opacity: 1; }
  .faq-ai-fab-pulse::after { animation: none; }
  .faq-ai-fab { transition: none; }
}

/* ====== Theme Toggle Button (关灯) ====== */
.faq-theme-toggle {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--faq-border);
  background: var(--faq-card);
  box-shadow: 0 2px 8px rgba(0,0,50,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s;
}
.faq-theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,50,0.15);
}
@media (max-width: 768px) {
  .faq-theme-toggle { top: 76px; right: 12px; width: 36px; height: 36px; font-size: 16px; }
}

/* ====== Dark Mode (关灯模式) ====== */
body.faq-dark {
  --faq-bg: #0f172a;
  --faq-card: #1e293b;
  --faq-text: #e2e8f0;
  --faq-text-light: #94a3b8;
  --faq-border: #334155;
  --faq-primary: #3b82f6;
  --faq-primary-dark: #2563eb;
  background: #0f172a;
  color: #e2e8f0;
}

/* Hero */
body.faq-dark .faq-hero { background: #0f172a; border-bottom-color: #1e293b; }
body.faq-dark .faq-stat-pill { background: #1e293b; border-color: #334155; box-shadow: none; }
body.faq-dark .faq-hero-tags span { background: #1e293b; border-color: #334155; color: #94a3b8; }

/* Sidebar */
body.faq-dark .faq-sidebar-inner { background: #1e293b; border-color: #334155; }
body.faq-dark .faq-cat-list li { color: #cbd5e1; }
body.faq-dark .faq-cat-list li:hover { background: #334155; }
body.faq-dark .faq-cat-list li.active { background: #1e293b; color: #3b82f6; }
body.faq-dark .faq-cat-count { background: #334155; color: #cbd5e1; }
body.faq-dark .faq-sidebar-cta { background: #1e293b; border-color: #334155; }

/* Search */
body.faq-dark .faq-search-bar { background: #1e293b; border-color: #334155; }
body.faq-dark .faq-search-bar input { color: #e2e8f0; }
body.faq-dark .faq-search-bar input::placeholder { color: #64748b; }

/* FAQ items */
body.faq-dark .faq-question:hover { background: #1e293b; }
body.faq-dark .faq-num { background: #0f172a; border-color: #334155; color: #94a3b8; }
body.faq-dark .faq-q-text { color: #e2e8f0; }
body.faq-dark .faq-chevron { color: #64748b; }
body.faq-dark .faq-answer { background: #0f172a; }
body.faq-dark .faq-a-text { color: #cbd5e1; }

/* Structured answer blocks */
body.faq-dark .faq-structured { color: #cbd5e1; }
body.faq-dark .faq-block-summary { background: #1e293b; }
body.faq-dark .faq-block-pitfall { background: #3b1a1a; border-color: #7f1d1d; }
body.faq-dark .faq-block-pitfall .faq-block-title { color: #fca5a5; }
body.faq-dark .faq-block-steps .faq-block-list li::before { background: #3b82f6; }

/* CTA */
body.faq-dark .faq-cta { background: #1e3a8a; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
body.faq-dark .faq-cta h2 { color: #fff; }
body.faq-dark .faq-cta p { color: rgba(255,255,255,0.8); }
body.faq-dark .faq-cta-primary { background: #ea580c; color: #fff; }
body.faq-dark .faq-cta-primary:hover { background: #c2410c; }
body.faq-dark .faq-cta-secondary { color: #fff; border-color: rgba(255,255,255,0.4); }
body.faq-dark .faq-cta-secondary:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

/* AI Modal */
body.faq-dark .faq-ai-modal { background: #1e293b; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
body.faq-dark .faq-ai-header { background: #0f172a; border-bottom-color: #334155; }
body.faq-dark .faq-ai-title h4 { color: #e2e8f0; }
body.faq-dark .faq-ai-title p { color: #94a3b8; }
body.faq-dark .faq-ai-body { background: #0f172a; }
body.faq-dark .faq-ai-bubble { background: #1e293b; color: #e2e8f0; border-color: #334155; }
body.faq-dark .faq-ai-msg-user .faq-ai-bubble { background: #1e3a8a; color: #e2e8f0; }
body.faq-dark .faq-ai-footer { background: #1e293b; border-top-color: #334155; }
body.faq-dark .faq-ai-footer input { background: #0f172a; color: #e2e8f0; border-color: #334155; }
body.faq-dark .faq-ai-quick button { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.faq-dark .faq-ai-hint { background: #0f172a; color: #64748b; }
body.faq-dark .faq-ai-streaming-text { color: #e2e8f0; }

/* Theme toggle button in dark mode */
body.faq-dark .faq-theme-toggle { background: #1e293b; border-color: #334155; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

/* ====== SSR Sidebar Links ====== */
.faq-cat-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
}
.faq-mobile-cats a {
  text-decoration: none;
  color: inherit;
}
.faq-mobile-cats a.active {
  background: var(--faq-primary);
  border-color: var(--faq-primary);
  color: #fff;
}

/* ====== Pagination ====== */
.faq-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--faq-border);
  background: var(--faq-card);
  color: var(--faq-text);
  transition: all 0.15s;
}
.faq-page-btn:hover {
  border-color: var(--faq-primary);
  color: var(--faq-primary);
}
.faq-page-btn.active {
  background: var(--faq-primary);
  border-color: var(--faq-primary);
  color: #fff;
}

/* Dark mode pagination */
body.faq-dark .faq-page-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
body.faq-dark .faq-page-btn:hover { border-color: #3b82f6; color: #3b82f6; }
body.faq-dark .faq-page-btn.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* ====== 关灯模式：覆盖全站 header/footer Tailwind 类（仅 FAQ 页面生效）====== */
/* class 加在 <html> 上，所以 html.faq-dark 作用域覆盖 header（sticky 导航）和 footer */
html.faq-dark { background-color: #0f172a; }
html.faq-dark body,
html.faq-dark body.bg-background,
html.faq-dark main.bg-background,
html.faq-dark [class*="bg-background"] { background-color: #0f172a !important; color: #e2e8f0; }

/* Header 背景（bg-surface / bg-surface/90 等所有 bg-surface 开头的类）*/
html.faq-dark [class*="bg-surface"] { background-color: #0f172a !important; }
/* Surface container 系列稍浅一档 */
html.faq-dark [class*="bg-surface-container"] { background-color: #1e293b !important; }
/* Primary container（移动端导航按钮背景）*/
html.faq-dark [class*="bg-primary-container"] { background-color: #1e3a8a !important; }
/* Primary 背景（按钮）保持品牌蓝但调暗 */
html.faq-dark .bg-primary { background-color: #1e40af !important; }

/* 文字颜色 */
html.faq-dark .text-on-surface { color: #e2e8f0 !important; }
html.faq-dark .text-on-surface-variant { color: #94a3b8 !important; }
html.faq-dark .text-on-primary-container { color: #bfdbfe !important; }
html.faq-dark .text-primary { color: #60a5fa !important; }

/* 边框 */
html.faq-dark [class*="border-outline"] { border-color: #334155 !important; }

/* Header logo 文字 */
html.faq-dark header a,
html.faq-dark header span,
html.faq-dark header button { color: #e2e8f0; }
html.faq-dark header a.text-primary { color: #60a5fa !important; }

/* Footer */
html.faq-dark footer { background-color: #0f172a !important; color: #cbd5e1; }
html.faq-dark footer a { color: #94a3b8; }
html.faq-dark footer a:hover { color: #60a5fa; }
