// 详情页容器
.detailPage {
  background: #f5f5f5;
  min-height: 100vh;
}

.detailContent {
  padding: 16px;
}

// 提示横幅
.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;
    cursor: pointer;

    &:active {
      opacity: 0.7;
    }
  }
}

// Tab容器
.tabContainer {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.tabs {
  display: flex;
  padding: 0 16px;
}

.tab {
  flex: 1;
  padding: 14px 0;
  text-align: center;
  font-size: 15px;
  color: #666;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border: none;
  outline: none;

  &:active {
    opacity: 0.7;
  }
}

.tabActive {
  color: #1890ff;
  font-weight: 600;
  border-bottom-color: #1890ff;
}

// 知识库信息卡片
.infoCard {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.infoHeader {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

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

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

.infoName {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

.systemPresetLabel {
  margin-left: 8px;
  font-size: 12px;
  color: #999;
  font-weight: normal;
}

.infoDescription {
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}

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

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

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

.statValueSuccess {
  color: #52c41a;
}

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

.infoTags {
  margin-bottom: 16px;
}

.tagTitle {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}

// 提示词生效规则
.promptRulesSection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.rulesList {
  margin: 12px 0 0 0;
  padding-left: 20px;
  font-size: 13px;
  color: #666;
  line-height: 1.8;

  li {
    margin-bottom: 8px;
  }
}

// 知识库独立提示词
.independentPromptSection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.promptDisplay {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
  min-height: 80px;
  max-height: 200px;
  overflow-y: auto;
}

.promptText {
  font-size: 13px;
  color: #333;
  line-height: 1.6;
  white-space: pre-wrap;
}

.promptEmpty {
  font-size: 13px;
  color: #999;
  text-align: center;
  padding: 20px 0;
}

// 上传素材区域
.uploadSection {
  margin: 16px 0;
}

// 库内素材区域
.materialsSection {
  margin-top: 16px;
}

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

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

// 配置区域
.configSection {
  margin-bottom: 16px;
}

.configItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;

  &:last-child {
    border-bottom: none;
  }
}

.configLabel {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #333;
}

.configIcon {
  font-size: 16px;
  color: #1890ff;
}

.configDescription {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

// 功能说明列表
.featureList {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 12px;
}

.featureItem {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 8px;

  &:last-child {
    margin-bottom: 0;
  }
}

.featureIcon {
  color: #52c41a;
  margin-top: 2px;
  flex-shrink: 0;
}

// 调用者名单
.callerSection {
  margin-top: 16px;
}

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

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

.sectionIcon {
  font-size: 16px;
  color: #1890ff;
}

.sectionCount {
  font-size: 13px;
  color: #888;
  font-weight: normal;
  margin-left: 4px;
}

.callerList {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 8px;
}

.callerItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #fff;
  border-radius: 6px;
  margin-bottom: 6px;

  &:last-child {
    margin-bottom: 0;
  }
}

.callerAvatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .anticon {
    font-size: 20px;
    color: #999;
  }
}

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

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

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

.callerTime {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

// 素材列表
.materialSection {
  padding: 12px 16px;
}

.uploadButton {
  width: 100%;
  margin-bottom: 16px;
}

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

.materialItem {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #ececec;
  display: flex;
  align-items: center;
  gap: 12px;
}

.materialIcon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.fileIcon {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: #fff;
}

.videoIcon {
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
  color: #fff;
}

.docIcon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
}

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

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

.materialName {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}

.materialMenu {
  font-size: 16px;
  color: #888;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}

.materialMeta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #888;
}

.materialSize {
  display: flex;
  align-items: center;
  gap: 4px;
}

.materialDate {
  display: flex;
  align-items: center;
  gap: 4px;
}

.materialTags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.materialTag {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.05);
  color: #666;
}

// 底部按钮组
.bottomActions {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  margin-top: 16px;
}

.editButton {
  flex: 1;
}

.deleteButton {
  flex: 1;
}

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

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

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

// 编辑提示词弹窗
.promptEditModal {
  .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;

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

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