:root {
  --bg: #f5f6fa;
  --bg-soft: #eef1f7;
  --card: #ffffff;
  --line: #e6e8f0;
  --line-soft: #f0f2f7;
  --text: #171a24;
  --text-2: #5b6472;
  --text-3: #98a1b0;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef0ff;
  --teal: #0d9488;
  --teal-soft: #e6f7f4;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --rose: #be123c;
  --rose-soft: #ffe6ec;
  --violet: #6d28d9;
  --violet-soft: #f1e9ff;
  --blue: #1d4ed8;
  --blue-soft: #e5edff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 48px rgba(16, 24, 40, .16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--primary); text-decoration: none; }

.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-outline { border-color: var(--line); background: #fff; color: var(--text-2); }
.btn-outline:hover { border-color: #cfd4e2; color: var(--text); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-soft);
  color: var(--text-2);
}
.pill-soft { background: var(--primary-soft); color: var(--primary); }
.pill-teal { background: var(--teal-soft); color: var(--teal); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-rose { background: var(--rose-soft); color: var(--rose); }
.pill-violet { background: var(--violet-soft); color: var(--violet); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: #b9bdf3;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
textarea { resize: vertical; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 90;
  max-width: 78vw;
  padding: 10px 16px;
  border-radius: 10px;
  background: #171a24;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease;
}
.toast.error { background: #9f1239; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 24, 40, .38);
  backdrop-filter: blur(3px);
}
.modal-card {
  width: 100%;
  max-width: 420px;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.modal-card h3 { font-size: 17px; margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
