/* 图标选择器样式 */
.icon-picker-container {
  position: relative;
}

.icon-picker-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ced4da;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  background-color: #fff;
  transition: border-color 0.2s;
}

.icon-picker-preview:hover {
  border-color: var(--primary-color);
}

.icon-picker-preview i {
  font-size: 1.2rem;
  color: var(--primary-color);
}

.icon-picker-preview-text {
  flex: 1;
  color: var(--text-secondary);
}

.icon-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-width: 500px;
  z-index: 1000;
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  margin-top: 0.5rem;
  display: none;
  overflow: hidden;
  max-height: 400px;
}

.icon-picker-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

.icon-picker-search {
  margin-bottom: 1rem;
  position: relative;
}

.icon-picker-search input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  font-size: 0.9rem;
}

.icon-picker-search i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.icon-picker-body {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 6px;
}

.icon-picker-body::-webkit-scrollbar {
  width: 5px;
}

.icon-picker-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.icon-picker-body::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 10px;
}

.icon-picker-body::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 12px 6px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}

.icon-item:hover {
  background: rgba(112, 73, 240, 0.05);
}

.icon-item.selected {
  background: rgba(112, 73, 240, 0.1);
  box-shadow: 0 0 0 1px var(--primary-color) inset;
}

.icon-item i {
  font-size: 1.5rem;
  margin-bottom: 5px;
  color: var(--primary-color);
}

.icon-item span {
  font-size: 0.7rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.icon-picker-footer {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
}

.icon-picker-footer .btn {
  padding: 4px 12px;
  font-size: 0.85rem;
}

.icon-picker-categories {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.icon-category-btn {
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  background: #f5f5f5;
  border: 1px solid transparent;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-category-btn:hover {
  background: #eee;
  color: var(--text-primary);
}

.icon-category-btn.active {
  background: rgba(112, 73, 240, 0.1);
  color: var(--primary-color);
  border-color: rgba(112, 73, 240, 0.2);
}

.icon-preview-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: var(--primary-gradient);
  box-shadow: 0 2px 8px rgba(112, 73, 240, 0.15);
}

.icon-preview-box i {
  font-size: 1.8rem;
  color: white;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .icon-picker-body {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 576px) {
  .icon-picker-body {
    grid-template-columns: repeat(4, 1fr);
  }
}
