.container {
  padding: 0;
}

.loading,
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #9ca3af;
  font-size: 14px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;

  h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
  }
}

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

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.cardHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;

  h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
  }
}

.status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;

  &--gray {
    background: #f3f4f6;
    color: #4b5563;
  }
  &--green {
    background: #dcfce7;
    color: #15803d;
  }
  &--yellow {
    background: #fef3c7;
    color: #b45309;
  }
}

.desc {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 12px;
}

.conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

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

.groupLogic {
  font-size: 11px;
  font-weight: 600;
  color: #3b82f6;
  text-transform: uppercase;
}

.conditionItems {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.condition {
  font-size: 12px;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 4px;
  color: #374151;

  em {
    font-style: normal;
    color: #9ca3af;
    margin: 0 4px;
  }
}

.meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;

  button {
    padding: 4px 12px;
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;

    &:hover {
      background: #f3f4f6;
      color: #111827;
    }
  }
}

// 表单样式
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.formGroup {
  display: flex;
  flex-direction: column;
  gap: 6px;

  label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
  }

  input,
  textarea,
  select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;

    &:focus {
      border-color: #3b82f6;
    }
  }
}

.conditionsSection {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  background: #f9fafb;
}

.conditionsSectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;

  label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
  }
}

.groupsLogic {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;

  select {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
  }
}

.conditionGroupEdit {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}

.groupHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}

.groupControls {
  display: flex;
  gap: 8px;

  select {
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
  }

  button {
    padding: 4px 8px;
    font-size: 11px;
    color: #dc2626;
    background: transparent;
    border: none;
    cursor: pointer;

    &:hover {
      text-decoration: underline;
    }
  }
}

.conditionsList {
  padding: 12px;
}

.conditionRow {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;

  select,
  input {
    flex: 1;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    min-width: 0;

    &:focus {
      border-color: #3b82f6;
    }
  }
}

.removeBtn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;

  &:hover {
    background: #fee2e2;
  }
}

.addCondBtn {
  padding: 6px 12px;
  font-size: 12px;
  color: #3b82f6;
  background: transparent;
  border: 1px dashed #93c5fd;
  border-radius: 4px;
  cursor: pointer;

  &:hover {
    background: #eff6ff;
  }
}

.addGroupBtn {
  padding: 8px 16px;
  font-size: 12px;
  color: #3b82f6;
  background: #fff;
  border: 1px dashed #93c5fd;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;

  &:hover {
    background: #eff6ff;
  }
}

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