// 页面容器
.knowledgePage {
  padding: 16px 10px 0 16px;
  min-height: 100vh;
}

// 提示横幅
.banner {
  background: linear-gradient(135deg, #e6f7ff 0%, #f0f5ff 100%);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #91d5ff;
}

.bannerIcon {
  font-size: 20px;
  color: #1890ff;
  flex-shrink: 0;
}

.bannerContent {
  flex: 1;
}

.bannerText {
  font-size: 14px;
  color: #333;
  line-height: 1.5;

  a {
    color: #1890ff;
    text-decoration: none;
    font-weight: 500;

    &:active {
      opacity: 0.7;
    }
  }
}

// 统计卡片区域
.statsContainer {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.statCard {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  text-align: center;
  border: 1px solid #f0f0f0;
}

.statValue {
  font-size: 28px;
  font-weight: 600;
  color: #1890ff;
  margin-bottom: 4px;
}

.statLabel {
  font-size: 13px;
  color: #888;
}

.statValueSuccess {
  color: #52c41a;
}

// 知识库卡片
.knowledgeCard {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #ececec;
  transition: all 0.2s ease;
  position: relative;
}

.knowledgeCard:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: #b3e5fc;
}

.cardHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cardLeft {
  flex: 1;
  min-width: 0;
}

.cardTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.cardIcon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.cardName {
  font-size: 17px;
  font-weight: 600;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.cardDescription {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cardRight {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cardSwitch {
  margin-right: 4px;
}

.cardMenu {
  font-size: 18px;
  color: #888;
  cursor: pointer;
  padding: 4px;
}

.cardStats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 10px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.statItem {
  flex: 1;
  text-align: center;
}

.statItemValue {
  font-size: 18px;
  font-weight: 600;
  color: #1890ff;
  margin-bottom: 4px;
}

.statItemLabel {
  font-size: 12px;
  color: #888;
}

.cardTags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  background: rgba(24, 144, 255, 0.1);
  color: #1890ff;
  border: 1px solid rgba(24, 144, 255, 0.2);
}

// 空状态
.empty {
  text-align: center;
  padding: 60px 20px;
  color: #bbb;
}

.emptyIcon {
  font-size: 64px;
  color: #d9d9d9;
  margin-bottom: 16px;
}

.emptyText {
  font-size: 15px;
  color: #999;
}

// 新建知识库弹窗样式
.modalContent {
  padding: 20px;
}

.modalTitle {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
}

.modalSubtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
}

.formItem {
  margin-bottom: 20px;
}

.formLabel {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
  font-weight: 500;
}

.formInput {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;

  &:focus {
    border-color: #1890ff;
  }
}

.formTextarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.checkboxWrapper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 12px;
}

.checkboxLabel {
  font-size: 14px;
  color: #333;
  flex: 1;
}

.promptHint {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  margin-top: 4px;
}

.modalFooter {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cancelButton {
  background: #f5f5f5;
  color: #666;

  &:active {
    background: #e8e8e8;
  }
}

.submitButton {
  background: #1890ff;
  color: #fff;

  &:active {
    background: #096dd9;
  }

  &:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
  }
}

// 统一提示词弹窗
.promptModal {
  .promptContent {
    padding: 20px;
  }

  .promptToggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 16px;
  }

  .promptToggleLabel {
    font-size: 15px;
    font-weight: 500;
    color: #333;
  }

  .promptTextarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 12px;

    &:focus {
      outline: none;
      border-color: #1890ff;
    }
  }

  .promptSection {
    margin-bottom: 16px;
  }

  .sectionTitle {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .sectionIcon {
    color: #1890ff;
  }

  .sectionContent {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;

    ul {
      margin: 0;
      padding-left: 20px;
    }

    li {
      margin-bottom: 4px;
    }
  }

  .warningBox {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
  }

  .warningTitle {
    font-size: 13px;
    font-weight: 500;
    color: #d46b08;
    margin-bottom: 6px;
  }

  .warningText {
    font-size: 12px;
    color: #ad6800;
    line-height: 1.5;
  }
}
