/* ─── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --primary:        #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-light:  #eff6ff;
  --danger:         #dc2626;
  --danger-hover:   #b91c1c;
  --success:        #16a34a;
  --bg:             #f8fafc;
  --surface:        #ffffff;
  --surface-2:      #f1f5f9;
  --border:         #e2e8f0;
  --border-hover:   #cbd5e1;
  --text:           #0f172a;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --radius:         8px;
  --radius-lg:      12px;
  --shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg:      0 4px 16px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.05);
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
       background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost     { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-hover); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-sm        { padding: 5px 12px; font-size: 13px; }
.btn-block     { width: 100%; }

/* ─── Forms ─────────────────────────────────────────────────────────────────── */
.form-group  { margin-bottom: 18px; }
.form-label  { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.form-input  {
  width: 100%; padding: 9px 12px; font-size: 15px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); outline: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ─── Alert ─────────────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* ─── Badge ─────────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #f0fdf4; color: var(--success); }
.badge-muted   { background: var(--surface-2); color: var(--text-muted); }

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-box { position: relative; background: var(--surface); border-radius: var(--radius-lg);
             padding: 28px 28px 24px; max-width: 400px; width: calc(100% - 32px); box-shadow: var(--shadow-lg); }
.modal-title  { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.modal-body   { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.7; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; }

/* ─── Utilities ─────────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.small      { font-size: 12px; }
