:root {
  --brand: #4f7cff;
  --brand-dark: #3a63d8;
  --brand-soft: #eef2ff;
  --text: #1f2430;
  --text-2: #5b6475;
  --text-3: #8b93a4;
  --line: #e6e9f0;
  --bg: #f4f6fa;
  --card: #ffffff;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --ok: #1a9b6c;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(31, 41, 66, 0.06);
  --shadow-lg: 0 12px 36px rgba(31, 41, 66, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

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

a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #c9d2e4; background: #fbfcfe; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 124, 255, 0.24);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(31, 41, 66, 0.06); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #f3c9ca; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: #eeaeb0; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn-lg { height: 46px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }

.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  font-family: inherit;
  transition: 0.15s ease;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.12);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #98a1b3 50%), linear-gradient(135deg, #98a1b3 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.checkbox-line { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.checkbox-line input { width: 16px; height: 16px; accent-color: var(--brand); }

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

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translate(-50%, 20px);
  background: rgba(28, 33, 44, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 999;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #ccd4e3; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .btn { height: 38px; padding: 0 14px; }
}