/* ============ 后台管理样式 ============ */
:root {
  --brand: #5b6cff;
  --brand-deep: #3f4ee0;
  --brand-soft: #eef0ff;
  --mint: #2fd4a7;
  --danger: #ff5470;
  --ink: #1c2033;
  --ink-2: #5a6079;
  --ink-3: #9aa0b8;
  --line: #e8eaf4;
  --bg: #f5f6fb;
  --card: #fff;
  --radius: 16px;
  --shadow: 0 12px 32px -16px rgba(43,52,122,.28);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* [hidden] 兜底：防止 class 里的 display 覆盖浏览器默认的 display:none */
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    linear-gradient(rgba(91,108,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,108,255,.05) 1px, transparent 1px),
    radial-gradient(700px 380px at 50% -10%, #e6e9ff, transparent),
    radial-gradient(500px 300px at 100% 100%, #e2fbf3, transparent), var(--bg);
  background-size: 26px 26px, 26px 26px, auto, auto, auto;
}
.login-card {
  position: relative;
  width: 100%; max-width: 360px; background: var(--card); border-radius: 20px;
  padding: 34px 28px 30px; box-shadow: var(--shadow); text-align: center;
  border: 1px solid rgba(255,255,255,.9);
  overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), #ff6b9d, #ffb01f, var(--mint));
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px;
  background: linear-gradient(135deg, var(--brand), #8b7bff); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; box-shadow: 0 10px 22px -10px rgba(91,108,255,.8);
}
.login-title { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.login-sub { margin: 0 0 22px; color: var(--ink-3); font-size: 12.5px; }
.login-err { color: var(--danger); font-size: 13px; margin: 0 0 12px; }

/* ---------- 表单元素 ---------- */
.fld { margin-bottom: 15px; text-align: left; }
.fld > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.fld .req { color: var(--danger); }
.fld input[type=text], .fld input[type=password], .fld input[type=number], .fld select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fbfbff;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.fld input:focus, .fld select:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(91,108,255,.13);
}
.fld .help { display: block; margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.fld-row { display: flex; gap: 12px; }
.fld-row .fld { flex: 1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 11px; border: 1.5px solid transparent;
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  background: #fff; color: var(--ink-2); transition: all .16s;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px rgba(91,108,255,.9); }
.btn-primary:hover { background: var(--brand-deep); }
.btn-line { border-color: var(--line); background: #fff; }
.btn-line:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { color: var(--danger); border-color: #ffd7de; }
.btn-danger:hover { background: #fff5f7; border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }

/* ---------- 主框架 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
}
.tb-left { display: flex; align-items: center; gap: 11px; }
.tb-logo {
  width: 38px; height: 38px; border-radius: 11px; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), #8b7bff);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.tb-left strong { display: block; font-size: 15px; }
.tb-left small { color: var(--ink-3); font-size: 12px; }
.tb-right { display: flex; gap: 8px; }

.main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 50px; }
.toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.toolbar-info h2 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.toolbar-info p { margin: 0; color: var(--ink-3); font-size: 12.5px; }

/* ---------- Tab 导航 ---------- */
.tabs {
  position: sticky; top: 63px; z-index: 19;
  display: flex; gap: 4px; padding: 0 20px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 13px 16px 12px; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 700; color: var(--ink-3);
  border-bottom: 2.5px solid transparent; transition: color .16s, border-color .16s;
}
.tab .ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: var(--ink-2); }
.tab-on { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- 工具条右侧 ---------- */
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.flt {
  padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); background: #fff;
  cursor: pointer; min-width: 130px;
}
.flt:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(91,108,255,.13); }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 11px; align-items: flex-start;
  background: linear-gradient(135deg, #f1f3ff, #f0fbf7);
  border: 1px solid #e3e7ff; border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 18px;
}
.notice .ico { width: 18px; height: 18px; flex: none; margin-top: 2px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notice strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.notice p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.65; }

/* ---------- 校区卡片 ---------- */
.campus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.campus-card {
  position: relative; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9);
  padding: 18px 18px 16px; overflow: hidden;
}
.campus-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), #ff6b9d, #ffb01f, var(--mint));
}
.campus-card.is-off { opacity: .62; }
.cc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cc-name { margin: 0 0 4px; font-size: 16.5px; font-weight: 800; }
.cc-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cc-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 700; color: var(--brand-deep);
  background: var(--brand-soft); padding: 2px 8px; border-radius: 6px;
}
.cc-count { font-size: 12px; color: var(--ink-3); }

.cc-link-row { margin-top: 13px; }
.cc-link-label { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; display: block; }
.cc-link {
  display: flex; align-items: center; gap: 8px;
  background: #fafbff; border: 1px solid #eef0fa; border-radius: 11px;
  padding: 9px 11px;
}
.cc-link code {
  flex: 1; font-size: 12.5px; color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all; line-height: 1.45;
}
.cc-copy {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 5px 11px; font-size: 12px; font-weight: 700; color: var(--brand);
  font-family: inherit; cursor: pointer; transition: all .16s;
}
.cc-copy:hover { border-color: var(--brand); background: var(--brand-soft); }
.cc-copy.done { color: #0f9d76; border-color: #b8ecd9; background: #eafaf4; }
.cc-ops { display: flex; gap: 7px; margin-top: 15px; padding-top: 14px; border-top: 1px solid #f2f3fa; }

/* ---------- 表格 ---------- */
.table-shell { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid rgba(255,255,255,.9); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left; padding: 13px 14px; font-size: 12.5px; font-weight: 700;
  color: var(--ink-2); background: #fafbff; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid #f2f3fa; vertical-align: middle; font-size: 13.5px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fbfcff; }
.bname { font-weight: 700; }
.bname .bz { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.muted { color: var(--ink-3); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.tag-on { background: #e6fbf3; color: #0f9d76; }
.tag-off { background: #f1f2f7; color: var(--ink-3); }
.tag-warn { background: #fff3e0; color: #d97706; }
.thumb { width: 56px; height: 56px; border-radius: 10px; border: 1px solid var(--line); object-fit: contain; background: #fff; cursor: zoom-in; }
.thumb-empty { width: 56px; height: 56px; border-radius: 10px; border: 1.5px dashed var(--line); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ink-3); }
.ops { display: flex; gap: 6px; flex-wrap: nowrap; }
.empty { text-align: center; padding: 54px 20px; }
.empty-emoji { font-size: 40px; margin-bottom: 10px; }
.empty p { color: var(--ink-3); margin: 0; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(24,28,48,.45); backdrop-filter: blur(2px); }
.modal-box {
  position: relative; width: 100%; max-width: 520px; background: #fff; border-radius: 18px;
  box-shadow: 0 26px 60px -20px rgba(20,25,60,.5); max-height: 92vh; display: flex; flex-direction: column;
  animation: pop .24s cubic-bezier(.2,.9,.3,1.15);
}
.modal-sm { max-width: 380px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-x { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 0 4px; }
.modal-body { padding: 4px 20px 6px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
.modal-err { color: var(--danger); font-size: 13px; margin: 4px 0 0; }

/* ---------- 上传 ---------- */
.uploader { display: flex; gap: 14px; align-items: flex-start; }
.up-preview {
  width: 108px; height: 108px; flex: 0 0 108px; border-radius: 13px; border: 1.5px dashed var(--line);
  background: #fbfbff; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.up-preview img { width: 100%; height: 100%; object-fit: contain; }
.up-empty { font-size: 12px; color: var(--ink-3); }
.up-side { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.up-side .help { flex-basis: 100%; }
.up-progress { flex-basis: 100%; height: 6px; background: var(--brand-soft); border-radius: 999px; overflow: hidden; }
.up-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--mint)); transition: width .2s; }

/* ---------- 图片预览 ---------- */
.imgview { position: fixed; inset: 0; z-index: 80; background: rgba(15,18,35,.85); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.imgview img { max-width: 100%; max-height: 100%; border-radius: 14px; background: #fff; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(28,32,51,.94); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px; z-index: 90; box-shadow: 0 12px 30px -12px rgba(0,0,0,.5);
  animation: toastIn .22s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 手机端显式隐藏滚轮条 */
.table-shell { scrollbar-width: none; -ms-overflow-style: none; }
.table-shell::-webkit-scrollbar { display: none; }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .main { padding: 16px 12px 40px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { flex-direction: column; align-items: stretch; }
  .flt { width: 100%; }
  .table-shell { overflow-x: auto; }
  .tbl { min-width: 820px; }
  .topbar { padding: 10px 14px; }
  .tb-left strong { font-size: 14px; }
  .tabs { top: 59px; padding: 0 10px; overflow-x: auto; }
  .tab { padding: 12px 12px 11px; font-size: 13.5px; white-space: nowrap; }
  .campus-grid { grid-template-columns: 1fr; }
  .modal { padding: 12px; align-items: flex-end; }
  .modal-box { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 94vh; }
  .uploader { flex-direction: row; }
}
