/* ===== 学校智慧管理平台 - 全局样式 ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --danger: #dc2626;
  --success: #16a34a;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f6fc;
  --card: #ffffff;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
}

/* ---- 顶部栏 ---- */
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
}
.topbar .brand {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1px;
}
.topbar .brand small {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
  margin-left: 10px;
}
.topbar .user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}
.topbar .user-info .uname { font-weight: 600; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-ghost { background: transparent; color: var(--text-light); }
.btn-ghost:hover { color: var(--text); background: rgba(0,0,0,0.05); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }

/* ---- 卡片/表单 ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
}
.container { max-width: 860px; margin: 0 auto; padding: 32px 20px 60px; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 32px 20px 60px; }

.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.form-row label .req { color: var(--danger); margin-left: 2px; }
.form-row label .hint { font-weight: 400; color: var(--text-light); font-size: 12px; margin-left: 8px; }
.input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.input.err { border-color: var(--danger); }

/* ---- 提示 ---- */
.alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #bfdbfe; }

/* ---- 登录页 ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(800px 400px at 10% -10%, rgba(37, 99, 235, 0.18), transparent),
    radial-gradient(600px 350px at 110% 110%, rgba(37, 99, 235, 0.15), transparent),
    var(--bg);
}
.login-card { width: 100%; max-width: 420px; }
.login-card h1 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 6px;
}
.login-card .sub {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 26px;
}
.login-card .tip {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-light);
  background: #f9fafb;
  border-radius: 8px;
  padding: 10px 14px;
  line-height: 1.7;
}
.login-card .tip b { color: var(--primary); }

/* ---- 用户主页：车牌/手机号 ---- */
.plate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .plate-grid { grid-template-columns: 1fr; } }

/* ---- 车牌三段式输入 ---- */
.plate-input-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.plate-select { width: 110px; }
.plate-number { flex: 1; min-width: 120px; text-transform: uppercase; }
.plate-ocr { white-space: nowrap; }

/* ---- 照片上传 ---- */
.bg-options { display: flex; gap: 14px; }
.bg-option {
  width: 76px;
  height: 60px;
  border-radius: 10px;
  border: 3px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  transition: border-color 0.15s;
}
.bg-option:hover { border-color: var(--primary); }
.bg-option.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.photo-box {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.photo-preview {
  width: 168px;
  height: 216px; /* 7:9 竖版，接近小二寸证件照比例 */
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
  color: var(--text-light);
  font-size: 13px;
  position: relative;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { flex: 1; min-width: 220px; }
.photo-actions .hint { font-size: 12.5px; color: var(--text-light); line-height: 1.8; margin-top: 10px; }

/* ---- 管理表格 ---- */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .search {
  flex: 1;
  min-width: 220px;
  position: relative;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
th {
  background: #f9fafb;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
tr:hover td { background: #fafcff; }
.thumb {
  width: 44px;
  height: 56px; /* 7:9 竖版证件照缩略图 */
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #f3f4f6;
}
.empty { text-align: center; color: var(--text-light); padding: 40px 0 !important; }
.mono { font-family: Consolas, monospace; font-size: 13px; }

/* ---- 弹窗 ---- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  padding: 26px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 { font-size: 18px; margin-bottom: 18px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---- 其他 ---- */
.muted { color: var(--text-light); font-size: 13px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.center { text-align: center; }
.section-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.badge-new {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
}
