.container {
  display: flex;
  gap: 24px;
  height: calc(100vh - 280px);
  min-height: 500px;
}

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

// 左侧分类列表
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.sidebarHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;

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

.addBtn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;

  &:hover {
    background: #2563eb;
  }
}

.categoryList {
  padding: 8px;
  overflow-y: auto;
  max-height: calc(100% - 60px);
}

.categoryItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  transition: background 0.15s;

  &:hover {
    background: #f3f4f6;
  }

  &.active {
    background: #eff6ff;
    color: #2563eb;
  }
}

.count {
  font-size: 12px;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
}

.categoryActions {
  display: none;
  gap: 8px;

  .categoryItem:hover & {
    display: flex;
  }

  button {
    padding: 2px 6px;
    font-size: 12px;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;

    &:hover {
      color: #3b82f6;
    }
  }
}

// 右侧标签列表
.main {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 16px;
  overflow-y: auto;
}

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

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

.tagGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tagCard {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  transition: box-shadow 0.15s;

  &:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
}

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

.tagColor {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.tagName {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  flex: 1;
}

.tagType {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;

  &--blue {
    background: #dbeafe;
    color: #1d4ed8;
  }
  &--green {
    background: #dcfce7;
    color: #15803d;
  }
  &--purple {
    background: #f3e8ff;
    color: #7c3aed;
  }
  &--gray {
    background: #f3f4f6;
    color: #4b5563;
  }
}

.tagCode {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.tagDesc {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
  line-height: 1.4;
}

.tagMeta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.adBadge {
  background: #fef3c7;
  color: #b45309;
  padding: 2px 6px;
  border-radius: 4px;
}

.tagActions {
  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;
    transition: border-color 0.15s;

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

  textarea {
    resize: vertical;
  }
}

.formRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.colorBtn {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.1s;

  &:hover {
    transform: scale(1.1);
  }

  &.selected {
    border-color: #111827;
  }
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;

  input {
    width: 16px;
    height: 16px;
    cursor: pointer;
  }

  span {
    font-weight: 400;
  }
}

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

// 用户ID输入
.userIdsInput {
  font-family: monospace;
  font-size: 13px;
  line-height: 1.6;
  min-height: 120px;
}

.formHint {
  font-size: 12px;
  color: #9ca3af;
}

// 用户列表
.usersList {
  min-height: 200px;
}

.usersHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  color: #6b7280;
}

.usersTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;

  th,
  td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
  }

  th {
    font-weight: 500;
    color: #6b7280;
    background: #f9fafb;
  }

  td {
    color: #374151;
  }

  tr:hover td {
    background: #f9fafb;
  }
}

.removeBtn {
  padding: 4px 8px;
  font-size: 12px;
  color: #ef4444;
  background: transparent;
  border: 1px solid #fecaca;
  border-radius: 4px;
  cursor: pointer;

  &:hover {
    background: #fef2f2;
  }
}
