/* ===========================================================
   培森题库 · 管理后台
   =========================================================== */
body.admin-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: #f6fafb; }

.atop {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); z-index: 30;
}
.atop .brand img { height: 28px; }
.atop .brand b { font-size: 15px; }
.atop .tag-admin {
  font-size: 11px; font-weight: 700; color: #fff; background: #16242c;
  padding: 2px 8px; border-radius: 5px; letter-spacing: .6px;
}
.atop .grow { flex: 1; }

.awrap { flex: 1; display: flex; min-height: 0; }

.aside {
  width: 190px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 3px;
}
.aside button {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 11px;
  border: none; background: transparent; border-radius: 9px; font-size: 13.5px;
  color: var(--ink-2); cursor: pointer; text-align: left; width: 100%;
}
.aside button:hover { background: #f2f8f8; }
.aside button.on { background: var(--pri-l); color: var(--pri-dd); font-weight: 600; }
.aside button svg { width: 16px; height: 16px; flex-shrink: 0; }
.aside .sp { flex: 1; }
.aside .hint { font-size: 11.5px; color: var(--muted); padding: 8px 11px; line-height: 1.7; }

.amain { flex: 1; min-width: 0; overflow: auto; padding: 22px 24px 40px; }
.panel { display: none; }
.panel.on { display: block; }

.ph { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ph h2 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.ph p { margin: 0; font-size: 13px; color: var(--muted); }
.ph .grow { flex: 1; }

/* 统计卡 */
.agrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 22px; }
.scard {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  position: relative; overflow: hidden;
}
.scard b { display: block; font-size: 27px; letter-spacing: -1px; line-height: 1.2; }
.scard span { font-size: 12.5px; color: var(--muted); }
.scard.warn b { color: var(--warn); }
.scard.danger b { color: var(--danger); }
.scard.ok b { color: var(--pri-dd); }
.scard .ic {
  position: absolute; right: 14px; top: 14px; width: 28px; height: 28px; border-radius: 9px;
  background: #f4f9f9; display: grid; place-items: center; color: var(--muted);
}
.scard .ic svg { width: 15px; height: 15px; }

/* 工具条 */
.abar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.abar .grow { flex: 1; }
.abar input.search {
  height: 34px; width: 240px; border: 1px solid var(--line-2); border-radius: 9px;
  padding: 0 12px; font-size: 13.5px; outline: none;
}
.abar input.search:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(16,179,163,.1); }
.abar .sel-mini { height: 34px; border-radius: 9px; }

/* 表格 */
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
table.ut { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.ut th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted);
  padding: 11px 12px; background: #fafcfc; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.ut td { padding: 11px 12px; border-bottom: 1px solid #f1f6f7; vertical-align: middle; }
table.ut tr:last-child td { border-bottom: none; }
table.ut tbody tr:hover { background: #fbfdfd; }
table.ut .u { font-weight: 600; }
table.ut .sub { font-size: 11.5px; color: var(--muted); }
table.ut .acts { display: flex; gap: 2px; justify-content: flex-end; }
table.ut .acts button {
  height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; font-size: 12px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
table.ut .acts button:hover { border-color: var(--pri); color: var(--pri-dd); background: var(--pri-l2); }
table.ut .acts button.danger:hover { border-color: #eab4b6; color: var(--danger); background: var(--danger-l); }

.st {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  padding: 2px 8px; border-radius: 6px; font-weight: 500; white-space: nowrap;
}
.st.ok { background: #e7f7ef; color: #0c7a45; }
.st.warn { background: #fdf4dc; color: #8a6310; }
.st.exp { background: #fdeeee; color: #b4262b; }
.st.off { background: #f1f5f6; color: #6b7c85; }
.st i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.badge-role { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: #eef1ff; color: #5b66d6; font-weight: 600; }
.badge-role.user { background: #f2f7f8; color: var(--ink-2); }

.apager { display: flex; justify-content: center; gap: 6px; padding: 16px 0 0; }

/* 设置表单 */
.set-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  max-width: 640px;
}
.set-card .field:last-child { margin-bottom: 0; }
.switch {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
}
.switch input { display: none; }
.switch .tr {
  width: 40px; height: 22px; border-radius: 999px; background: #dde7e9; position: relative; transition: .18s;
}
.switch .tr::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.switch input:checked + .tr { background: var(--pri); }
.switch input:checked + .tr::after { transform: translateX(18px); }

.qr-set { display: flex; gap: 14px; align-items: center; }
.qr-set img {
  width: 76px; height: 76px; object-fit: cover; object-position: center 60%;
  border-radius: 10px; border: 1px solid var(--line); background: #f8fbfb;
}

/* 批量结果 */
.batch-result { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.batch-result table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.batch-result td { padding: 6px 10px; border-bottom: 1px solid #f1f6f7; font-family: var(--mono); }
.batch-result td:first-child { color: var(--ink); }

@media (max-width: 900px) {
  .aside { width: 56px; padding: 10px 6px; }
  .aside button span { display: none; }
  .aside button { justify-content: center; padding: 0; }
  .aside .hint { display: none; }
  .amain { padding: 14px; }
  table.ut { font-size: 12.5px; }
  .agrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .scard { padding: 13px 14px; }
  .scard b { font-size: 23px; }
  .atop { padding: 0 10px; gap: 8px; }
  .atop .brand b { display: none; }
  .atop .tag-admin { display: none; }
  .atop .user-chip { display: none; }
  .atop .btn { height: 30px; padding: 0 9px; font-size: 12.5px; }
  .tbl-wrap { overflow-x: auto; }
  .tbl-wrap table.ut { min-width: 720px; }
  .ph h2 { font-size: 17px; }
  .abar input.search { width: 100%; }
  .set-card { padding: 16px; }
}
