/* 初见活动报名 · Web 管理后台 */
:root {
  --brand: #9ec900;
  --brand-dark: #7aa000;
  --text: #1f2937;
  --muted: #6b7280;
  --faint: #9ca3af;
  --border: #e5e7eb;
  --bg: #f5f7f5;
  --card: #ffffff;
  --danger: #ef4444;
  --orange: #f97316;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef7d9 0%, #f7fafc 60%);
}

.login-card {
  width: 380px;
  padding: 36px 32px 28px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.login-logo, .sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-title { margin: 0; font-size: 20px; font-weight: 800; }
.login-sub { margin: 2px 0 0; font-size: 13px; color: var(--faint); }

.field { display: block; margin-bottom: 16px; }
.field-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  font-size: 14px;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); background: #ffffff; }
.textarea { min-height: 88px; resize: vertical; line-height: 1.6; }

.login-error { min-height: 18px; margin: 0 0 10px; font-size: 13px; color: var(--danger); }
.login-tip { margin: 18px 0 0; font-size: 12px; line-height: 1.7; color: var(--faint); }
.login-tip code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo { width: 34px; height: 34px; border-radius: 9px; font-size: 16px; }
.sidebar-title { font-size: 15px; font-weight: 800; }

.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-item {
  display: block;
  padding: 10px 14px;
  margin-bottom: 2px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: #f3f4f6; }
.nav-item.active { background: rgba(158, 201, 0, 0.14); color: var(--brand-dark); font-weight: 700; }

.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.me { margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.me b { color: var(--text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.topbar-title { margin: 0; font-size: 18px; font-weight: 800; }
.topbar-actions { display: flex; gap: 8px; }

.content { flex: 1; padding: 22px 24px 40px; overflow-x: auto; }

/* ---------- 组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { opacity: 0.86; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #ffffff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #ffffff; }
.btn-ghost { background: transparent; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }

.icon-btn {
  width: 30px; height: 30px;
  border: none; background: transparent;
  font-size: 22px; line-height: 1; color: var(--faint);
  cursor: pointer; border-radius: 6px;
}
.icon-btn:hover { background: #f3f4f6; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { margin: 0; font-size: 15px; font-weight: 800; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stat {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-label { font-size: 12px; color: var(--faint); }
.stat-value { margin-top: 6px; font-size: 26px; font-weight: 800; color: var(--brand-dark); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; background: #fafafa; white-space: nowrap; }
td { color: var(--text); }
tbody tr:hover { background: #fafcf6; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-green { background: #ecfccb; color: #65a30d; }
.badge-purple { background: #f3e8ff; color: #9333ea; }
.badge-orange { background: #fff7ed; color: #ea580c; }
.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-red { background: #fee2e2; color: #dc2626; }

.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #f3f4f6; display: block; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.toolbar .input-search { min-width: 240px; flex: 1; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); }

.empty { padding: 50px 0; text-align: center; color: var(--faint); }
.muted { color: var(--faint); }
.small { font-size: 12px; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 90; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, 92vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  z-index: 100;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row-1 { grid-template-columns: 1fr; }
.form-section { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #f1f5f9; }
.form-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.form-section-title { margin: 0 0 12px; font-size: 14px; font-weight: 800; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline .input { flex: 1; }

.uploader { display: flex; flex-wrap: wrap; gap: 10px; }
.uploader-item { position: relative; width: 88px; height: 88px; }
.uploader-item img { width: 88px; height: 88px; border-radius: 8px; object-fit: cover; background: #f3f4f6; }
.uploader-item .del {
  position: absolute; right: -6px; top: -6px;
  width: 20px; height: 20px; border-radius: 10px;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 13px; line-height: 18px;
  text-align: center; cursor: pointer; border: none; padding: 0;
}
.uploader-add {
  width: 88px; height: 88px; border: 1px dashed #cbd5e1; border-radius: 8px;
  background: #fafafa; color: var(--faint); font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.file-tag { max-width: 200px; font-size: 12px; color: var(--muted); word-break: break-all; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; top: 30px;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.9);
  color: #ffffff;
  font-size: 13px;
  z-index: 200;
}
.toast.ok { background: #4d7c0f; }
.toast.err { background: #b91c1c; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
}
