/* ── Reset & Root ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:       #5a9e00;
  --green-light: #7dc900;
  --green-bg:    #f0f9e0;
  --orange:      #ff6b00;
  --white:       #ffffff;
  --bg:          #f7f8fa;
  --bg2:         #eef0f4;
  --card:        #ffffff;
  --border:      #e2e5ea;
  --border2:     #d0d4dc;
  --text:        #111827;
  --text2:       #374151;
  --muted:       #6b7280;
  --muted2:      #9ca3af;
  --red:         #ef4444;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow:      0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   20px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
img { max-width: 100%; display: block; }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.container-sm { max-width: 900px; margin: 0 auto; padding: 0 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--green);
  color: #fff;
}
.btn-primary:hover { background: var(--green-light); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-outline {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}
.btn-outline:hover { background: var(--green-bg); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border2); color: var(--text); }

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.fade-up { animation: fadeUp 0.4s ease forwards; }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, #f0f1f3 50%, var(--bg2) 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

/* ── Loading center ───────────────────────────────────────────────────────── */
.page-center {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ── Notice / Alert ───────────────────────────────────────────────────────── */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.notice-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.notice-success { background: var(--green-bg); color: #3a5e00; border: 1px solid #bbf7d0; }
.notice-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

@media (max-width: 768px) {
  .container, .container-sm { padding: 0 16px; }
}