.AI-Search {
  padding: 60px 0;
}
.ai-search {
  max-width: 1200px;
  margin: 40px auto;
  padding: 10px;
  background: white;
  border-radius: 32px;
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  transition: all 0.2s;
}

.ai-search__header {
  padding: 24px 28px 0 28px;
}

.ai-search__header h1 {
  font-size: 1.8rem;
  font-weight: 650;
  margin: 0 0 6px 0;
  background: linear-gradient(135deg, #1e2b6e, #2b4c9e);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  letter-spacing: -0.3px;
}

.ai-search__header p {
  font-size: 0.9rem;
  color: #5a6874;
  margin: 0 0 8px 0;
}

.ai-search__form {
  display: flex;
  gap: 12px;
  padding: 12px 28px 24px 28px;
  border-bottom: 1px solid #eef2f6;
  flex-wrap: wrap;
  align-items: center;
}

.input-wrapper {
  flex: 1;
  min-width: 180px;
}

#ai-question {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  font-size: 1rem;
  border: 1px solid #dce3e9;
  border-radius: 40px;
  background: #ffffff;
  transition: all 0.2s;
  outline: none;
  font-family: inherit;
}

#ai-question:focus {
  border-color: #2b6ef0;
  box-shadow: 0 0 0 3px rgba(43, 110, 240, 0.1);
}

.action-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  height: 52px;
  border: none;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#ai-submit {
  background: #1a5be8;
  color: white;
  box-shadow: 0 2px 6px rgba(26, 91, 232, 0.2);
}

#ai-submit:hover:not(:disabled) {
  background: #0f4ac7;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(26, 91, 232, 0.3);
}

#stop-btn {
  background: #f0f2f6;
  color: #d32f2f;
  border: 1px solid #ffcdd2;
}

#stop-btn:hover:not(:disabled) {
  background: #ffeaea;
  border-color: #f44336;
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== Tab 样式 ===== */
.tab-bar {
  display: flex;
  gap: 0;
  padding: 0 28px;
  border-bottom: 1px solid #eef2f6;
  background: #fafcff;
  border-radius: 24px 24px 0 0;
  margin: 0;
  position: relative;
}
.tab-btn {
  padding: 16px 24px 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #1a5be8;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  letter-spacing: 0.3px;
  position: relative;
}

.tab-btn:hover {
  color: #1f2a3e;
  background: #f0f4fe;
}

.tab-btn.active {
  color: #1a5be8;
  /* border-bottom-color: #1a5be8; */
  background: transparent;
}

.tab-btn .badge {
  display: inline-block;
  background: #eef2f6;
  color: #5a6874;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 10px;
  border-radius: 30px;
  margin-left: 8px;
  vertical-align: middle;
}

.tab-btn.active .badge {
  background: #dce7fe;
  color: #1a5be8;
}

.tab-content {
  padding: 0;
  background: #fafcff;
  border-radius: 0 0 24px 24px;
}

.tab-panel {
  /* display: none; */
  padding: 0px 28px 10px 28px;
  animation: fadeIn 0.25s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== AI 结果 (原有样式) ===== */
#ai-result {
  background: #fafcff;
  border-radius: 24px;
  border: 1px solid #eef2f9;
  padding: 24px 28px;
  min-height: 100px;
  max-height: 520px;
  overflow-y: auto;
  line-height: 1.65;
  font-size: 16px;
  color: #1f2a3e;
  scroll-behavior: smooth;
  transition: all 0.1s;
}

#ai-result h1,
#ai-result h2,
#ai-result h3 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  font-weight: 600;
}

#ai-result h1 {
  font-size: 1.6rem;
  border-left: 4px solid #2b6ef0;
  padding-left: 16px;
}

#ai-result h2 {
  font-size: 1.4rem;
  border-left: 3px solid #6c8fc0;
  padding-left: 14px;
}

#ai-result h3 {
  font-size: 1.2rem;
}

#ai-result p {
  margin: 0.8em 0;
}

#ai-result ul,
#ai-result ol {
  margin: 0.6em 0;
  padding-left: 1.8em;
}

#ai-result li {
  margin: 0.3em 0;
}

#ai-result code {
  background: #f0f2f5;
  padding: 0.2em 0.4em;
  border-radius: 6px;
  font-family: 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 0.88em;
}

#ai-result pre {
  background: #f0f2f5;
  padding: 14px;
  border-radius: 14px;
  overflow-x: auto;
}

#ai-result pre code {
  background: none;
  padding: 0;
}

#ai-result blockquote {
  border-left: 4px solid #cdd9ed;
  margin: 0.8em 0;
  padding-left: 1em;
  color: #4a627a;
}

#ai-result table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

#ai-result th,
#ai-result td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
}

#ai-result th {
  background: #f1f5f9;
  font-weight: 600;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background-color: #2b6ef0;
  vertical-align: middle;
  margin-left: 3px;
  border-radius: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  background: #7c8b9c;
  border-radius: 50%;
  display: inline-block;
  animation: wave 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes wave {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ===== FAQ 面板 ===== */
#faq-panel {
  padding: 0px 28px 32px 28px;
}

.faq-stats {
  font-size: 0.85rem;
  color: #6f7e91;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eef2f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.faq-stats .count {
  font-weight: 500;
  color: #1f2a3e;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 200px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.faq-item {
  padding: 12px 18px;
  border-radius: 14px;
  background: white;
  border: 1px solid #f0f2f6;
  transition: all 0.2s ease;
  cursor: pointer;
}

.faq-item:hover {
  background: #f5f9ff;
  border-color: #c8d8f0;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.faq-item a {
  color: #1f2a3e;
  text-decoration: none;
  font-weight: 500;
  font-size: 17px;
  display: block;
  transition: color 0.2s;
}

.faq-item a:hover {
  color: #1a5be8;
}

.faq-item .faq-meta {
  font-size: 14px;
  color: #a0b0c4;
  margin-top: 4px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.faq-item .faq-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.faq-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  color: #8f9bb3;
  text-align: center;
}

.faq-empty .icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.faq-empty p {
  margin: 4px 0;
}

.faq-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 50px 20px;
  color: #6f7e91;
}

/* ===== 分页控件 ===== */
.faq-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eef2f6;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #dce3e9;
  background: white;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1f2a3e;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  background: #f0f4fe;
  border-color: #b9d0ff;
  transform: translateY(-1px);
}

.pagination-btn.active {
  background: #1a5be8;
  border-color: #1a5be8;
  color: white;
  box-shadow: 0 2px 8px rgba(26, 91, 232, 0.25);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.pagination-btn.arrow {
  padding: 0 18px;
  font-size: 0.8rem;
}

.pagination-info {
  font-size: 0.8rem;
  color: #6f7e91;
  margin: 0 8px;
  white-space: nowrap;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 38px;
  color: #8f9bb3;
  font-size: 0.9rem;
}

/* ===== 其他 ===== */
.info-tip {
  font-size: 0.75rem;
  color: #8f9eb2;
  margin-top: 18px;
  text-align: center;
  border-top: 1px solid #eff3f8;
  padding-top: 18px;
}

.example-queries {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 0 28px 10px 28px;
}

.example-chip {
  background: #f0f4fe;
  border-radius: 30px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: #1a5be8;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.example-chip:hover {
  background: #e2eaff;
  border-color: #b9d0ff;
  transform: translateY(-1px);
}

@media (max-width: 620px) {
  .ai-search__form {
    flex-direction: column;
    align-items: stretch;
  }
  .action-buttons {
    justify-content: flex-end;
  }
  .btn {
    padding: 0 18px;
  }
  .ai-search__header h1 {
    font-size: 1.5rem;
  }
  .tab-btn {
    padding: 12px 14px 10px 14px;
    font-size: 0.85rem;
  }
  .tab-btn .badge {
    font-size: 0.6rem;
    padding: 0 8px;
    margin-left: 4px;
  }
  .faq-pagination {
    gap: 4px;
  }
  .pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 0.75rem;
  }
  .pagination-btn.arrow {
    padding: 0 12px;
  }
  .faq-item {
    padding: 10px 14px;
  }
  .faq-item a {
    font-size: 0.88rem;
  }
}

/* 滚动条美化 */
.faq-list::-webkit-scrollbar,
#ai-result::-webkit-scrollbar {
  width: 5px;
}
.faq-list::-webkit-scrollbar-track,
#ai-result::-webkit-scrollbar-track {
  background: #f0f2f6;
  border-radius: 10px;
}
.faq-list::-webkit-scrollbar-thumb,
#ai-result::-webkit-scrollbar-thumb {
  background: #cdd7e6;
  border-radius: 10px;
}
.faq-list::-webkit-scrollbar-thumb:hover,
#ai-result::-webkit-scrollbar-thumb:hover {
  background: #b0c0d4;
}
