/* base.css - 设计系统（与 C 端品牌视觉一致：浅色 + 紫粉渐变） */
:root {
  --pink: #d946ef;
  --purple: #8b5cf6;
  --purple-soft: #6366f1;
  --mint: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --line: #e7e5f8;
  --line-soft: #efedf9;
  --text-main: #1f2430;
  --text-soft: #6b7280;
  --text-faint: #9ca3af;
  --bg: #f7f5ff;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 14px 40px rgba(99, 102, 241, 0.1);
  --shadow-sm: 0 6px 18px rgba(99, 102, 241, 0.08);
  --font: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  color: var(--text-main);
  background: linear-gradient(160deg, #f6f4ff 0%, #fdf7ff 60%, #f4f7ff 100%);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--purple);
  text-decoration: none;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 9px 20px;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.98);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  box-shadow: 0 8px 20px rgba(217, 70, 239, 0.22);
}
.btn-primary:hover {
  opacity: 0.92;
}
.btn-ghost {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--purple);
  color: var(--purple);
}
.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.06);
}
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}
.btn-block {
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
}

/* ---------- 表单 ---------- */
.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font: inherit;
  color: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.textarea {
  resize: vertical;
  min-height: 74px;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-faint);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
  padding: 22px 24px;
}

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover {
  border-color: var(--purple);
  color: var(--purple);
}
.chip.is-active {
  border-color: rgba(217, 70, 239, 0.45);
  background: rgba(217, 70, 239, 0.08);
  color: var(--pink);
  font-weight: 600;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.1);
  color: var(--purple);
}
.badge-mint {
  background: rgba(34, 197, 94, 0.12);
  color: var(--mint);
}
.badge-gray {
  background: var(--line-soft);
  color: var(--text-soft);
}
.badge-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

/* ---------- toast ---------- */
#toast-root {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(31, 36, 48, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease;
  max-width: 80vw;
}
.toast.is-error {
  background: rgba(220, 38, 38, 0.94);
}
.toast.is-success {
  background: rgba(22, 163, 74, 0.94);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(31, 36, 48, 0.45);
  backdrop-filter: blur(2px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.15s ease;
}
.modal {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.modal-close:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
}
.modal-body {
  padding: 6px 22px 22px;
  overflow: auto;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- empty ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}
.empty-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.38);
}
::-webkit-scrollbar-track {
  background: transparent;
}
