/* 深圳市华朗学校华朗币登记与兑换系统 —— 电脑端后台样式 */
:root {
  --brand: #1f6feb;
  --brand-dark: #14539f;
  --brand-soft: #eaf2ff;
  --ink: #1f2329;
  --ink-2: #4e5969;
  --ink-3: #86909c;
  --line: #e5e6eb;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ok: #00a870;
  --warn: #ff7d00;
  --danger: #e34d59;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(31, 35, 41, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---------------------------------------------------------- 登录 */
.login-wrap {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f6feb 0%, #14539f 100%);
}
.login-card {
  width: 380px; background: #fff; border-radius: 14px; padding: 34px 32px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.login-card h1 { font-size: 19px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--ink-3); font-size: 12px; margin-bottom: 22px; }
.login-card label { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 6px; }
.login-card input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--brand); }
.login-card .btn { width: 100%; margin-top: 20px; height: 42px; font-size: 15px; }
.login-tip { margin-top: 14px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ---------------------------------------------------------- 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex: 0 0 208px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line);
}
.sidebar .brand b { display: block; font-size: 15px; line-height: 1.4; }
.sidebar .brand span { font-size: 11px; color: var(--ink-3); }
.nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 9px 18px; color: var(--ink-2);
  font-size: 13.5px; border-left: 3px solid transparent; cursor: pointer; user-select: none;
}
.nav a:hover { background: #f7f8fa; color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand-dark); border-left-color: var(--brand); font-weight: 600; }
.nav a .tag {
  margin-left: auto; background: var(--danger); color: #fff; border-radius: 9px;
  font-size: 11px; padding: 0 6px; line-height: 17px; min-width: 18px; text-align: center;
}
.nav .sec { padding: 12px 18px 6px; font-size: 11px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 22px; gap: 14px;
  position: sticky; top: 0; z-index: 5;
}
.topbar h2 { font-size: 16px; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--ink-2); }
.topbar .who b { color: var(--ink); }
.content { padding: 20px 22px 40px; }

/* ---------------------------------------------------------- 组件 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px;
}
.card > h3 {
  font-size: 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.card > h3 .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, 1fr); } }

.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .t { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.stat.blue .n { color: var(--brand); }
.stat.green .n { color: var(--ok); }
.stat.orange .n { color: var(--warn); }
.stat.red .n { color: var(--danger); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.tbl th { background: #fafbfc; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
table.tbl tbody tr:hover { background: #fafbff; }
table.tbl td.num, table.tbl th.num { text-align: right; }
.tbl-wrap { overflow-x: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 32px; padding: 0 14px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(.94); color: #fff; }
.btn.danger { background: #fff; border-color: #f3c2c7; color: var(--danger); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

input.f, select.f, textarea.f {
  height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; background: #fff; outline: none; font-family: inherit;
}
textarea.f { height: auto; padding: 8px 10px; resize: vertical; }
input.f:focus, select.f:focus, textarea.f:focus { border-color: var(--brand); }
label.fl { font-size: 12.5px; color: var(--ink-2); display: block; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 160px; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px;
  background: #f2f3f5; color: var(--ink-2); margin: 0 4px 4px 0;
}
.pill.green { background: #e3f9f0; color: var(--ok); }
.pill.orange { background: #fff3e8; color: var(--warn); }
.pill.red { background: #fde8ea; color: var(--danger); }
.pill.blue { background: var(--brand-soft); color: var(--brand-dark); }
.pill.gray { background: #f2f3f5; color: var(--ink-3); }

.empty { padding: 34px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.plus { color: var(--ok); font-weight: 700; }
.minus { color: var(--danger); font-weight: 700; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs .tab {
  padding: 7px 14px; cursor: pointer; font-size: 13.5px; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none;
}
.tabs .tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs .tab .badge {
  background: var(--danger); color: #fff; border-radius: 9px; font-size: 11px;
  padding: 0 6px; margin-left: 5px;
}

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: #fff; border-radius: 12px; width: 560px; max-width: 92vw;
  max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal .hd { padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; display: flex; }
.modal .hd .x { margin-left: auto; cursor: pointer; color: var(--ink-3); font-size: 18px; line-height: 1; }
.modal .bd { padding: 18px 20px; }
.modal .ft { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 99;
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 70vw;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

/* 二维码区 */
.qr-box { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.qr-img { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.qr-img img { display: block; width: 220px; height: 220px; }
.qr-meta { flex: 1; min-width: 280px; }
.qr-url {
  font-size: 17px; font-weight: 600; color: var(--brand-dark); word-break: break-all;
  background: var(--brand-soft); padding: 8px 12px; border-radius: 8px; margin: 6px 0 12px;
}
.cand { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.cand .u { font-family: Consolas, monospace; font-size: 13px; }
.cand .d { color: var(--ink-3); font-size: 12px; }
.cand .spacer { flex: 1; }

/* 班级分组 */
.grp-hd {
  background: #f7f9fc; padding: 8px 12px; font-weight: 600; font-size: 13.5px;
  border-left: 3px solid var(--brand); margin: 14px 0 6px; display: flex; gap: 10px; align-items: center;
}
.grp-hd .spacer { flex: 1; }

.notice {
  background: #fff8e6; border: 1px solid #ffe0a3; color: #8a5a00;
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; line-height: 1.7;
}
.notice.info { background: var(--brand-soft); border-color: #c6dcff; color: var(--brand-dark); }

.kbd {
  display: inline-block; padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; background: #fafbfc; font-family: Consolas, monospace; font-size: 12px;
}
.swipe-input {
  height: 40px; font-size: 15px; letter-spacing: 1px; border: 2px solid var(--brand) !important;
  background: #f5faff; min-width: 220px;
}

/* ------------------------------------------------- 学生搜索选择框 */
.pick { position: relative; }
.pick-list {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 35, 41, .14); max-height: 260px; overflow-y: auto;
}
.pick-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid #f4f5f7; font-size: 13.5px;
}
.pick-item:last-child { border-bottom: none; }
.pick-item:hover, .pick-item.on { background: var(--brand-soft); }
.pick-item b { font-weight: 600; }
.pick-item .pick-pts { margin-left: auto; color: var(--brand-dark); font-weight: 600; white-space: nowrap; }
.pick-none { padding: 12px; color: var(--ink-3); font-size: 12.5px; text-align: center; }

/* ------------------------------------------------- 快捷兑换卡片 */
.pz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pz-card {
  text-align: left; font-family: inherit; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 14px 14px 12px; min-height: 104px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.pz-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.pz-card .pz-name { font-size: 15px; font-weight: 600; line-height: 1.4; }
.pz-card .pz-meta { display: flex; gap: 6px; }
.pz-card .pz-meta .pill { margin: 0; }
.pz-card .pz-foot { margin-top: auto; }
.pz-card.out { cursor: default; background: #fafbfc; opacity: .75; }
.pz-card.out:hover { border-color: var(--line); box-shadow: none; transform: none; }

/* ---- 班级统一加减分 ---- */
.cls-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cls-chip {
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px; background: #fff;
  font-size: 13.5px; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s, border-color .12s, color .12s;
}
.cls-chip:hover { border-color: var(--brand); }
.cls-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.cls-chip .n { font-size: 12px; opacity: .75; }
.cls-sum { margin-top: 12px; font-size: 13.5px; color: var(--ink-2); }
.cls-sum b { color: var(--brand); font-size: 15px; }

/* ---- 日期筛选 / 分页 / 可点击姓名 ---- */
.date-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fafbfc; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; margin: 4px 0 12px;
}
.date-bar .lb { font-size: 12.5px; color: var(--ink-3); }
.date-bar input[type="date"] {
  height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink); font-size: 13px; font-family: inherit;
}
.date-bar input[type="date"]:focus { outline: none; border-color: var(--brand); }
.pager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 12px 0 2px;
}
.pager .pg-info { font-size: 12.5px; color: var(--ink-3); }
.pager .pg-info b { color: var(--ink); font-weight: 600; }
.lnk { color: var(--brand); cursor: pointer; border-bottom: 1px dashed rgba(31,111,235,.45); }
.lnk:hover { color: var(--brand-dark); border-bottom-style: solid; }
