/* ==================== 知识库 ==================== */

/* 图片轮播横幅 */
.knowledge-banner {
  position: relative;
  overflow: hidden;
  height: 200px;
  border-radius: 12px;
  margin: 0 0 10px;
  padding: 0;
  background: #ffffff;
  border: 1px solid #ececec;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.knowledge-banner .banner-carousel {
  overflow: hidden;
  position: relative;
  height: 100%;
}

.banner-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-item {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.carousel-item.active { opacity: 1; }

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-indicators {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
  background: transparent;
}

.carousel-indicators .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.carousel-indicators .indicator.active {
  width: 20px;
  border-radius: 4px;
  background: #fff;
}

/* 搜索框 */
.knowledge-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 12px;
  margin: 0 0 12px;
  border: 1px solid #ececec;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 20;
}

.knowledge-search-icon {
  flex: 0 0 auto;
  color: #999;
}

.knowledge-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #333;
  height: 22px;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.knowledge-search-input::-webkit-search-cancel-button,
.knowledge-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.knowledge-search-input::placeholder {
  color: #bbb;
}

.knowledge-search-clear {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.knowledge-search-clear:hover {
  opacity: 0.7;
}

/* 分类导航 */
.knowledge-categories {
  display: flex;
  justify-content: space-around;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  border-radius: 12px;
  margin: 0 0 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.knowledge-categories .category-item:last-child {
  order: -1;
}

.category-item .category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1;
  text-align: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #4ecdc4 0%, #44a3aa 100%);
  box-shadow: none;
  transition: transform 0.3s ease;
}

.category-item .category-icon svg {
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  display: block;
}

.category-item[data-color="#4ecdc4"] .category-icon {
  background: linear-gradient(135deg, #6be7de 0%, #4ecdc4 100%);
}

.category-item[data-color="#ff6b6b"] .category-icon {
  background: linear-gradient(135deg, #ff8e8e 0%, #ff6b6b 100%);
}

.category-item[data-color="#ffd93d"] .category-icon {
  background: linear-gradient(135deg, #ffe66b 0%, #ffd93d 100%);
  color: #fff;
}

.category-item[data-color="#ff9f43"] .category-icon {
  background: linear-gradient(135deg, #ffbe76 0%, #ff9f43 100%);
}

.category-item[data-color="#6c5ce7"] .category-icon {
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.category-item span {
  font-size: 12px;
  color: #666;
}

.category-item.active {
  background: transparent;
}

.category-item.active .category-icon {
  transform: translateY(-2px) scale(1.05);
}

.category-item.active span {
  color: #4ecdc4;
  font-weight: 600;
}

.category-item:hover .category-icon {
  transform: translateY(-3px) scale(1.08);
}

/* 知识库问答详情页 */
#pageKnowledgeDetail.is-hidden {
  display: none;
}

#pageKnowledgeDetail:not(.is-hidden) {
  display: block;
}

#pageKnowledgeDetail .detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  min-height: 48px;
}

#pageKnowledgeDetail .detail-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #333;
  border-radius: 50%;
  transition: background 0.2s;
}

#pageKnowledgeDetail .detail-back-btn:hover {
  background: #f5f5f5;
}

#pageKnowledgeDetail .detail-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

#pageKnowledgeDetail .detail-header-spacer {
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 知识库列表 */
.knowledge-section {
  padding: 0;
}

.knowledge-section .home-flight-list.knowledge-list {
  padding: 0;
}

.knowledge-section .home-section-header {
  margin-left: 0;
  margin-right: 0;
}

.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.knowledge-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s ease;
}

.knowledge-question {
  display: flex;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

.knowledge-arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.knowledge-item.open .knowledge-arrow {
  transform: rotate(90deg);
}

.knowledge-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: #f8f9fa;
  padding: 0 16px;
}

.knowledge-item.open .knowledge-answer {
  max-height: 500px;
  padding: 16px;
}

.knowledge-answer p {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
  margin-bottom: 8px;
}

.knowledge-answer p:last-child {
  margin-bottom: 0;
}

@media (prefers-color-scheme: dark) {
  .knowledge-item {
    background: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .knowledge-question {
    color: #e0e0e0;
  }

  .knowledge-answer {
    background: #16162a;
  }

  .knowledge-answer p {
    color: #b0b0b0;
  }
}
