.modalTitle {
  font-size: 16px;
  font-weight: 500;
  color: #14161a;
}

.memoryModal {
  :global(.@{antPrefix}-modal-content) {
    height: 90vh;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    background-color: #fff;
  }

  :global(.@{antPrefix}-modal-body) {
    flex: 1;
    overflow: auto;
    padding: 24px;
  }

  :global(.@{antPrefix}-modal-header) {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 16px 24px;
  }
}

.container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.addButton {
  margin-bottom: 16px;
  height: 40px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border-color: #165dff;
  color: #165dff;

  &:hover,
  &:focus {
    border-color: #4080ff;
    color: #4080ff;
    background-color: #f0f7ff;
  }

  &:active {
    border-color: #0e42d2;
    color: #0e42d2;
  }
}

.tabsContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  :global(.@{antPrefix}-tabs-content-holder) {
    flex: 1;
    overflow: hidden;
  }

  :global(.@{antPrefix}-tabs-content) {
    height: 100%;
  }

  :global(.@{antPrefix}-tabs-tabpane) {
    height: 100%;
  }

  :global(.@{antPrefix}-tabs-nav) {
    margin-bottom: 0;
    padding-right: 220px; // 为搜索框留出空间
    position: relative;
    &::before {
      border-bottom: none !important;
    }
  }

  :global(.@{antPrefix}-tabs-tab) {
    font-size: 14px;
    padding: 8px 16px;
  }
}

.searchInput {
  position: absolute;
  top: 0;
  right: 0;
  width: 216px; // 与 commonStyles.searchInput 保持一致
  z-index: 10;
  display: flex;
  align-items: center;
}

.tabContent {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding-top: 16px;
}

.ruleList {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ruleCard {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  transition: all 0.2s ease;

  &:hover {
    border-color: #165dff;
    box-shadow: 0 2px 8px rgba(22, 93, 255, 0.1);
  }

  :global(.@{antPrefix}-card-body) {
    padding: 16px;
  }
}

.ruleContent {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.ruleLeft {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.ruleIcon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8f3ff;
  border-radius: 6px;
  color: #165dff;
  font-size: 20px;

  :global {
    .anticon,
    [class^='icon-'] {
      font-size: 20px;
    }
  }
}

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

.ruleName {
  font-size: 14px;
  font-weight: 500;
  color: #14161a;
  margin-bottom: 8px;
  line-height: 20px;
}

.ruleDescription {
  font-size: 13px;
  color: #666;
  line-height: 20px;
  margin-bottom: 12px;
  word-break: break-word;
}

.ruleFields {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fieldsLabel {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

.fieldsTags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fieldTag {
  margin: 0;
  padding: 2px 12px;
  height: 24px;
  line-height: 20px;
  border-radius: 12px;
  background-color: #e8f3ff;
  border: 1px solid #94bfff;
  color: #4080ff;
  font-size: 12px;
}

// .addRuleButton {
//   flex-shrink: 0;
//   height: 32px;
//   border-radius: 6px;
//   font-size: 14px;
//   padding: 0 16px;
// }

.emptyState {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #999;
  font-size: 14px;
}

// 新增记忆规则弹窗样式
.addModalTitle {
  font-size: 16px;
  font-weight: 500;
  color: #14161a;
}

.addRuleModal {
  :global(.@{antPrefix}-modal-body) {
    padding: 24px;
  }
}

.addRuleForm {
  :global(.@{antPrefix}-form-item-label > label) {
    font-size: 14px;
    color: #14161a;
  }
}

.extractionRulesTextArea {
  :global(.@{antPrefix}-input) {
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
  }
}

.addRuleFooter {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;

  :global(.@{antPrefix}-btn) {
    height: 40px;
    padding: 0 24px;
    border-radius: 6px;
    font-size: 14px;
  }
}
