/* 通用组件：按钮、卡片、表单、徽标、进度、弹窗、提示 */

/* 按钮 */
.btn {
  --btn-color: var(--neon-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); color: var(--text); background: var(--panel-hi); box-shadow: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.btn[disabled]:hover { border-color: var(--line-strong); color: var(--text); }

.btn--primary {
  background: var(--neon-green);
  border-color: var(--neon-green);
  color: #04120a;
  font-weight: 700;
  box-shadow: none;
}
.btn--primary:hover {
  color: #04120a;
  background: #dcff9e;
  box-shadow: none;
  transform: translateY(-1px);
}

.btn--cyan { --btn-color: var(--neon-cyan); }
.btn--cyan.btn--solid {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  color: #02131a;
  font-weight: 700;
  box-shadow: none;
}
.btn--cyan.btn--solid:hover { color: #02131a; background: #acdedf; box-shadow: none; }
.btn--danger { --btn-color: var(--neon-pink); }
.btn--danger:hover { color: var(--neon-pink); border-color: var(--neon-pink); box-shadow: none; }
.btn--ghost { border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { color: var(--neon-green); background: rgba(57, 255, 20, 0.07); }
.btn--sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn--block { width: 100%; }

/* 卡片 */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: none;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.card--hover:hover {
  border-color: rgba(204, 255, 115, 0.24);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}
.card::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(57, 255, 20, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.card--hover:hover::after { opacity: 0; }

/* 徽标 / 标签 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  border: 1px solid var(--line-strong);
  color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.08);
}
.badge--green { color: var(--neon-green); background: rgba(204, 255, 115, 0.06); border-color: rgba(204, 255, 115, 0.15); }
.badge--pink { color: var(--neon-pink); background: rgba(255, 46, 151, 0.08); border-color: rgba(255, 46, 151, 0.3); }
.badge--dim { color: var(--text-dim); border-color: var(--line); background: rgba(255, 255, 255, 0.02); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.16s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-on {
  color: var(--neon-green);
  background: rgba(204, 255, 115, 0.08);
  border-color: rgba(204, 255, 115, 0.3);
  font-weight: 700;
  box-shadow: none;
}
.chip.is-on .chip__dot { background: var(--neon-green); }
.chip__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-dim); box-shadow: none; }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field__label {
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.input, .textarea, .select {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #15171a;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: all 0.16s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--neon-green);
  box-shadow: 0 0 0 3px rgba(204, 255, 115, 0.08);
}
.textarea { resize: vertical; min-height: 110px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; }
.select {
  appearance: none;
  cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2339ff14' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px 6px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--text-2);
}
.switch input { display: none; }
.switch__track {
  width: 40px; height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line);
  position: relative;
  transition: all 0.2s var(--ease);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.2s var(--ease);
}
.switch input:checked + .switch__track {
  background: rgba(57, 255, 20, 0.2);
  border-color: var(--neon-green);
}
.switch input:checked + .switch__track::after {
  left: 20px;
  background: var(--neon-green);
  box-shadow: var(--glow-green);
}

/* 进度条 */
.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  border-radius: 999px;
  background: var(--neon-green);
  box-shadow: none;
  transition: width 0.3s var(--ease);
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-dim);
}
.empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 8px; }

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 9, 0.72);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.18s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(57, 255, 20, 0.1);
  animation: modalIn 0.22s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal__title { font-size: 16px; }
.modal__body { padding: 22px; }
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}
.modal__close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
}
.modal__close:hover { color: var(--neon-pink); }

/* 提示条 */
.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 11px 17px;
  border-radius: var(--radius-sm);
  background: rgba(12, 14, 20, 0.94);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--neon-green);
  font-size: 13.5px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.22s var(--ease);
}
.toast--err { border-left-color: var(--neon-pink); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}

/* 工具类 */
.row { display: flex; align-items: center; gap: 12px; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.mono { font-family: var(--font-mono); }
.dim { color: var(--text-dim); }
.grow { flex: 1; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
