/* 校园通 · 管理后台样式（品牌蓝 #2F54EB / #1E6FFF，大圆角、零边框、大留白） */
:root {
  --brand: #2f54eb;
  --brand-2: #1e6fff;
  --brand-soft: #eef2ff;
  --ink: #1a1f2e;
  --ink-2: #5b6478;
  --ink-3: #98a1b3;
  --line: #eef0f5;
  --bg: #f6f7fb;
  --ok: #12b76a;
  --warn: #f79009;
  --danger: #f04438;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(24, 39, 75, 0.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "PingFang SC", -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
#login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 20% 0%, #e8efff 0%, #f6f7fb 60%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 24px;
  padding: 40px 36px 32px;
  box-shadow: 0 20px 60px rgba(24, 39, 75, 0.1);
}
.login-card h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: .5px; }
.login-card p.sub { margin: 0 0 28px; color: var(--ink-3); font-size: 13px; }
.brand-dot {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; margin-bottom: 18px;
}

/* ---------- 表单元素 ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  outline: none;
  transition: border-color .15s, background .15s;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); background: #fff; }
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 600; transition: opacity .15s, transform .05s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; padding: 13px; font-size: 15px; }
.btn.ghost { background: var(--brand-soft); color: var(--brand); }
.btn.line { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.warn { background: var(--warn); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 10px; font-weight: 500; }

/* ---------- 布局 ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: 0 0 216px;
  background: #101728; color: #cfd6e6;
  display: flex; flex-direction: column;
  padding: 22px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.sidebar .logo b { color: #fff; font-size: 15px; letter-spacing: .4px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 12px; border-radius: 12px; cursor: pointer;
  color: #aab3c7; margin-bottom: 4px; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 600; }
.nav-item .badge {
  background: rgba(255,255,255,.18); border-radius: 999px;
  padding: 1px 7px; font-size: 11px; min-width: 20px; text-align: center;
}
.sidebar .foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar .foot .who { font-size: 12.5px; color: #8b94a8; margin-bottom: 10px; line-height: 1.6; }
.sidebar .foot .who b { color: #fff; }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.topbar h2 { margin: 0; font-size: 20px; letter-spacing: .3px; }
.topbar .desc { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }

.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
  margin-bottom: 18px;
}
.card > h3 { margin: 0 0 16px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card > h3 .tag {
  font-size: 11px; font-weight: 500; color: var(--brand);
  background: var(--brand-soft); padding: 2px 8px; border-radius: 999px;
}

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.stat .v.b { color: var(--brand); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-3); font-weight: 500; font-size: 12px; white-space: nowrap; background: #fbfcfe; }
tr:last-child td { border-bottom: none; }
td .clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--ink-3); }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; color: var(--ink-2); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; }
.pill.gray { background: #f1f3f8; color: var(--ink-2); }
.pill.blue { background: var(--brand-soft); color: var(--brand); }
.pill.ok { background: #e7f8ef; color: var(--ok); }
.pill.warn { background: #fef3e6; color: var(--warn); }
.pill.danger { background: #fdeceb; color: var(--danger); }

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

/* ---------- 工具条 ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { margin: 0; }
.toolbar .field.grow { flex: 1; min-width: 180px; }

.empty { text-align: center; color: var(--ink-3); padding: 36px 0; font-size: 13px; }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 23, 40, .42);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50;
}
.modal {
  background: #fff; border-radius: 20px; width: 100%; max-width: 560px;
  max-height: 88vh; overflow: auto; padding: 26px; box-shadow: 0 30px 80px rgba(16,23,40,.28);
}
.modal h3 { margin: 0 0 18px; font-size: 17px; }
.modal .close { float: right; cursor: pointer; color: var(--ink-3); font-size: 20px; line-height: 1; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; font-size: 13px; margin-bottom: 18px; }
.kv .k { color: var(--ink-3); }
.kv .v { color: var(--ink); word-break: break-all; }

.photo-box { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 18px; }
.photo-box figure { margin: 0; background: #f6f7fb; border-radius: 12px; padding: 10px; text-align: center; }
.photo-box img { width: 100%; max-height: 220px; object-fit: contain; border-radius: 8px; display: block; }
.photo-box figcaption { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }

/* ---------- 勾选组 ---------- */
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checks input { margin-top: 2px; }

/* ---------- 提示 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: #101728; color: #fff; padding: 11px 20px; border-radius: 12px;
  font-size: 13px; z-index: 100; opacity: 0; transition: opacity .2s, bottom .2s; pointer-events: none;
  max-width: 80vw;
}
#toast.show { opacity: 1; bottom: 52px; }
#toast.err { background: var(--danger); }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: -220px; z-index: 60; transition: left .2s; }
  .sidebar.open { left: 0; }
  .main { padding: 18px 16px 50px; }
  .checks { grid-template-columns: 1fr; }
  .photo-box { grid-template-columns: 1fr; }
}
