/* ============================================
   components.less - 公共组件（按钮、卡片、表单、标签等）
   ============================================ */
/* ---------- 按钮组件 ---------- */
.dji-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 32px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 9999px;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  gap: 8px;
  /* 主要按钮 */
  /* 次要按钮 */
  /* 轮廓按钮 */
  /* 幽灵按钮 */
  /* 危险按钮 */
  /* 成功按钮 */
  /* 渐变按钮 */
  /* 加载中状态 */
}
.dji-btn svg {
  width: 16px;
  height: 16px;
}
.dji-btn.dji-btn-sm {
  height: 32px;
  padding: 0 16px;
  font-size: 14px;
}
.dji-btn.dji-btn-lg {
  height: 52px;
  padding: 0 48px;
  font-size: 18px;
}
.dji-btn.dji-btn-block {
  display: flex;
  width: 100%;
}
.dji-btn.dji-btn-primary {
  color: #ffffff;
  background-color: #2979ff;
}
.dji-btn.dji-btn-primary:hover {
  background-color: #5c99ff;
  box-shadow: 0 0 20px rgba(41, 121, 255, 0.3);
  color: #ffffff;
}
.dji-btn.dji-btn-primary:active {
  background-color: #1069ff;
}
.dji-btn.dji-btn-primary.is-disabled,
.dji-btn.dji-btn-primary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.dji-btn.dji-btn-secondary {
  color: #e8e8f0;
  background-color: transparent;
  border: 1px solid #2a2a40;
}
.dji-btn.dji-btn-secondary:hover {
  border-color: #2979ff;
  color: #2979ff;
}
.dji-btn.dji-btn-secondary.is-disabled,
.dji-btn.dji-btn-secondary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.dji-btn.dji-btn-outline {
  color: #2979ff;
  background-color: transparent;
  border: 1px solid #2979ff;
}
.dji-btn.dji-btn-outline:hover {
  background-color: #2979ff;
  color: #ffffff;
}
.dji-btn.dji-btn-ghost {
  color: #8888a0;
  background-color: transparent;
}
.dji-btn.dji-btn-ghost:hover {
  color: #e8e8f0;
  background-color: rgba(255, 255, 255, 0.05);
}
.dji-btn.dji-btn-danger {
  color: #ffffff;
  background-color: #ff5252;
}
.dji-btn.dji-btn-danger:hover {
  background-color: #ff8585;
}
.dji-btn.dji-btn-success {
  color: #ffffff;
  background-color: #00c853;
}
.dji-btn.dji-btn-success:hover {
  background-color: #00fb68;
}
.dji-btn.dji-btn-gradient {
  color: #ffffff;
  background: linear-gradient(135deg, #2979ff 0%, #00e5ff 100%);
  border: none;
}
.dji-btn.dji-btn-gradient:hover {
  box-shadow: 0 0 20px rgba(41, 121, 255, 0.3);
  transform: translateY(-1px);
}
.dji-btn.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.dji-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
/* ---------- 标签组件 ---------- */
.dji-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 16px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
  transition: all 0.15s ease;
  /* 可关闭标签 */
}
.dji-tag.dji-tag-primary {
  color: #2979ff;
  background-color: rgba(41, 121, 255, 0.1);
}
.dji-tag.dji-tag-cyan {
  color: #00e5ff;
  background-color: rgba(0, 229, 255, 0.1);
}
.dji-tag.dji-tag-success {
  color: #00c853;
  background-color: rgba(0, 200, 83, 0.1);
}
.dji-tag.dji-tag-warning {
  color: #ffab40;
  background-color: rgba(255, 171, 64, 0.1);
}
.dji-tag.dji-tag-danger {
  color: #ff5252;
  background-color: rgba(255, 82, 82, 0.1);
}
.dji-tag.dji-tag-ghost {
  color: #8888a0;
  background-color: transparent;
  border: 1px solid #2a2a40;
}
.dji-tag.dji-tag-closable {
  padding-right: 4px;
}
.dji-tag .dji-tag-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.dji-tag .dji-tag-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
/* ---------- 徽章组件 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9999px;
  line-height: 1;
}
.badge.dji-badge-primary {
  color: #ffffff;
  background-color: #2979ff;
}
.badge.dji-badge-danger {
  color: #ffffff;
  background-color: #ff5252;
}
.badge.dji-badge-success {
  color: #ffffff;
  background-color: #00c853;
}
.badge.dji-badge-dot {
  min-width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
}
/* ---------- 表单组件 ---------- */
.dji-form-group {
  margin-bottom: 24px;
}
.dji-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #e8e8f0;
  margin-bottom: 8px;
}
.dji-form-label-required::after {
  content: " *";
  color: #ff5252;
}
.dji-form-input {
  width: 100%;
  height: 44px;
  padding: 0 24px;
  font-size: 16px;
  color: #e8e8f0;
  background-color: #1c1c2e;
  border: 1px solid #2a2a40;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.dji-form-input::placeholder {
  color: #55556a;
}
.dji-form-input:focus {
  border-color: #2979ff;
  box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.15);
}
.dji-form-input.is-error {
  border-color: #ff5252;
}
.dji-form-input.is-error:focus {
  box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.15);
}
.dji-form-textarea {
  min-height: 100px;
  padding: 16px 24px;
  resize: vertical;
}
.dji-form-select {
  height: 44px;
  padding: 0 32px 0 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  appearance: none;
  cursor: pointer;
}
.dji-form-error {
  font-size: 12px;
  color: #ff5252;
  margin-top: 4px;
}
.dji-form-hint {
  font-size: 12px;
  color: #55556a;
  margin-top: 4px;
}
/* 复选框 */
.dji-form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #8888a0;
}
.dji-form-checkbox-input {
  width: 18px;
  height: 18px;
  border: 2px solid #2a2a40;
  border-radius: 3px;
  appearance: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dji-form-checkbox-input:checked {
  background-color: #2979ff;
  border-color: #2979ff;
}
/* 单选按钮 */
.dji-form-radio-input {
  width: 18px;
  height: 18px;
  border: 2px solid #2a2a40;
  border-radius: 50%;
  appearance: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dji-form-radio-input:checked {
  border-color: #2979ff;
  background-color: transparent;
  box-shadow: inset 0 0 0 3px #2979ff;
}
/* ---------- 模态框 ---------- */
.dji-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.dji-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}
.dji-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  background-color: #1c1c2e;
  border: 1px solid #2a2a40;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow: hidden;
}
.dji-modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.dji-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px;
  border-bottom: 1px solid #1a1a2e;
}
.dji-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #e8e8f0;
}
.dji-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #55556a;
  transition: all 0.15s ease;
  cursor: pointer;
}
.dji-modal-close:hover {
  color: #e8e8f0;
  background-color: rgba(255, 255, 255, 0.05);
}
.dji-modal-body {
  padding: 32px;
  overflow-y: auto;
  max-height: calc(80vh - 130px);
}
.dji-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 32px;
  border-top: 1px solid #1a1a2e;
}
/* ---------- Toast提示 ---------- */
.dji-toast-container {
  position: fixed;
  top: 32px;
  right: 32px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dji-toast {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  background-color: #1c1c2e;
  border: 1px solid #2a2a40;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: fadeInRight 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}
.dji-toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.dji-toast-icon.dji-toast-icon-success {
  color: #00c853;
}
.dji-toast-icon.dji-toast-icon-error {
  color: #ff5252;
}
.dji-toast-icon.dji-toast-icon-warning {
  color: #ffab40;
}
.dji-toast-icon.dji-toast-icon-info {
  color: #2979ff;
}
.dji-toast-message {
  flex: 1;
  font-size: 14px;
  color: #e8e8f0;
}
.dji-toast-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #55556a;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  transition: background-color 0.15s ease;
}
.dji-toast-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
/* ---------- 进度条 ---------- */
.dji-progress {
  width: 100%;
  height: 4px;
  background-color: #1c1c2e;
  border-radius: 9999px;
  overflow: hidden;
}
.dji-progress-bar {
  height: 100%;
  background-color: #2979ff;
  border-radius: 9999px;
  transition: width 0.3s ease;
}
.dji-progress-bar.dji-progress-bar-success {
  background-color: #00c853;
}
.dji-progress-bar.dji-progress-bar-warning {
  background-color: #ffab40;
}
.dji-progress-bar.dji-progress-bar-danger {
  background-color: #ff5252;
}
/* ---------- 分页组件 ---------- */
.dji-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.dji-pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  font-size: 14px;
  color: #8888a0;
  background-color: #1c1c2e;
  border: 1px solid #1a1a2e;
  border-radius: 8px;
  transition: all 0.15s ease;
  cursor: pointer;
}
.dji-pagination-item:hover {
  border-color: #2a2a40;
  color: #e8e8f0;
}
.dji-pagination-item.is-active {
  color: #ffffff;
  background-color: #2979ff;
  border-color: #2979ff;
}
.dji-pagination-item.is-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
/* ---------- 工具提示（Tooltip） ---------- */
.dji-tooltip {
  position: relative;
  display: inline-flex;
}
.dji-tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  font-size: 12px;
  color: #e8e8f0;
  background-color: #1c1c2e;
  border: 1px solid #2a2a40;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 700;
}
.dji-tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1c1c2e;
}
.dji-tooltip:hover .dji-tooltip-content {
  opacity: 1;
  visibility: visible;
}
/* ---------- 选项卡（独立组件） ---------- */
.dji-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #1a1a2e;
}
.dji-tab-item {
  padding: 16px 32px;
  font-size: 14px;
  font-weight: 500;
  color: #8888a0;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}
.dji-tab-item:hover {
  color: #e8e8f0;
}
.dji-tab-item.is-active {
  color: #2979ff;
  border-bottom-color: #2979ff;
}
/* ---------- 通知栏 ---------- */
.dji-notice-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 32px;
  font-size: 14px;
  background-color: rgba(41, 121, 255, 0.08);
  color: #2979ff;
  text-align: center;
}
.dji-notice-bar.dji-notice-bar-warning {
  background-color: rgba(255, 171, 64, 0.08);
  color: #ffab40;
}
.dji-notice-bar.dji-notice-bar-danger {
  background-color: rgba(255, 82, 82, 0.08);
  color: #ff5252;
}
