:root {
  --brand: #177a5c;
  --brand-2: #0f5c45;
  --brand-soft: #e6f4ee;
  --accent: #f2a33c;
  --danger: #d9483b;
  --ok: #2e9e6b;
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e6e9ec;
  --text: #1c2b2a;
  --muted: #7b8a90;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(20, 60, 50, .07);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.6;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 78px; }

/* ---------- 登录 ---------- */
.login-wrap { padding: 40px 22px 30px; }
.login-logo {
  width: 66px; height: 66px; border-radius: 18px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--brand), #2aa37a);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 700; letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(23, 122, 92, .28);
}
.login-title { text-align: center; font-size: 21px; font-weight: 700; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.seg { display: flex; background: #e9edf0; border-radius: 11px; padding: 4px; margin-bottom: 18px; }
.seg div { flex: 1; text-align: center; padding: 9px 0; border-radius: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg div.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.field { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.field input, .field select, .field textarea {
  width: 100%; border: none; outline: none; font-size: 15px; color: var(--text);
  background: transparent; font-family: inherit;
}
.field textarea { resize: vertical; min-height: 58px; }
.btn {
  display: block; width: 100%; padding: 13px; border: none; border-radius: 12px;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn:active { opacity: .85; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.gray { background: #eef1f3; color: var(--muted); }
.btn.danger { background: var(--danger); }
.btn.small { display: inline-block; width: auto; padding: 7px 15px; font-size: 13px; border-radius: 9px; }
.btn.mini { display: inline-block; width: auto; padding: 5px 11px; font-size: 12px; border-radius: 8px; }
/* 登录页的「学生刷卡查询」入口：做成醒目的绿色块级按钮 */
a.btn.kiosk {
  display: block; width: 100%; margin-top: 14px; text-align: center; text-decoration: none;
  background: #12a05c; color: #fff; font-size: 16px; font-weight: 700; padding: 14px;
  box-shadow: 0 4px 12px rgba(18, 160, 92, .25);
}
a.btn.kiosk:active { opacity: .85; }
.link { text-align: center; margin-top: 16px; color: var(--brand); font-size: 14px; cursor: pointer; }
.tip { background: #fff8ea; border: 1px solid #f5dfae; color: #8a6414; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; margin-top: 16px; }

/* ---------- 头部 ---------- */
.header {
  background: linear-gradient(135deg, var(--brand), #24a37b); color: #fff;
  padding: 18px 18px 62px; position: relative;
}
.header .h-row { display: flex; align-items: center; justify-content: space-between; }
.header .h-name { font-size: 17px; font-weight: 600; }
.header .h-sub { font-size: 12.5px; opacity: .88; margin-top: 1px; }
.header .h-points { text-align: right; }
.header .h-points b { font-size: 26px; display: block; line-height: 1.1; }
.header .h-points span { font-size: 11.5px; opacity: .85; }
.badge { display: inline-block; background: rgba(255,255,255,.22); padding: 2px 9px; border-radius: 20px; font-size: 11.5px; margin-left: 6px; }

.body-shift { margin-top: -48px; padding: 0 14px; position: relative; z-index: 2; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px; margin-bottom: 13px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; }
.card-title .more { font-size: 12.5px; color: var(--muted); font-weight: 400; cursor: pointer; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.grid4 b { display: block; font-size: 20px; color: var(--brand); }
.grid4 span { font-size: 11.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.stat-mini { background: var(--brand-soft); border-radius: 11px; padding: 10px; text-align: center; }
.stat-mini b { display: block; font-size: 18px; color: var(--brand-2); }
.stat-mini span { font-size: 11.5px; color: var(--muted); }

/* ---------- 待办 ---------- */
.todo-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.todo-item:last-child { border-bottom: none; }
.todo-item .t-l { font-size: 14.5px; }
.todo-item .t-l small { display: block; color: var(--muted); font-size: 12px; }
.pill { background: var(--danger); color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 20px; }
.pill.zero { background: #dfe4e7; color: var(--muted); }

/* ---------- 列表 ---------- */
.row { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.row:last-child { border-bottom: none; }
.avatar { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-2); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; }
.row-main { flex: 1; min-width: 0; }
.row-main .n { font-size: 14.5px; font-weight: 500; }
.row-main .s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-right { text-align: right; flex: none; }
.row-right .v { font-size: 16px; font-weight: 700; }
.row-right .up { color: var(--danger); }      /* 加分为红 */
.row-right .down { color: var(--ok); }        /* 扣分为绿 */
.row-actions { display: flex; gap: 7px; flex: none; }

.tag { display: inline-block; font-size: 11.5px; padding: 1.5px 8px; border-radius: 6px; background: #eef1f3; color: var(--muted); margin-right: 5px; }
.tag.pending { background: #fff3e0; color: #c47a12; }
.tag.approved { background: #e6f4ee; color: var(--ok); }
.tag.rejected { background: #fdecea; color: var(--danger); }
.tag.done { background: #e8f0fd; color: #2f6fd0; }

.empty { text-align: center; color: var(--muted); font-size: 13.5px; padding: 26px 10px; }

/* ---------- 班级分组标题 ---------- */
.grp { display: flex; align-items: center; gap: 8px; padding: 11px 0 8px; cursor: pointer; user-select: none; }
.grp b { font-size: 14.5px; }
.grp span { flex: 1; font-size: 12px; color: var(--muted); }
.grp i { font-style: normal; font-size: 12px; color: var(--muted); }
.grp.folded { border-bottom: 1px solid var(--line); }
.grp:not(:first-child) { border-top: 1px solid var(--line); margin-top: 6px; }

/* ---------- 权限开关 ---------- */
.switch { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.switch:last-child { border-bottom: none; }
.sw { width: 44px; height: 25px; border-radius: 20px; background: #dfe3e6; position: relative; transition: .2s; flex: none; cursor: pointer; }
.sw i { position: absolute; width: 21px; height: 21px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.sw.on { background: var(--brand); }
.sw.on i { left: 21px; }

/* ---------- 奖品 ---------- */
.prize { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.prize:last-child { border-bottom: none; }
.prize-img { width: 52px; height: 52px; border-radius: 12px; background: linear-gradient(135deg,#fdf1dc,#f6dfb6); display: flex; align-items: center; justify-content: center; font-size: 19px; color: #b5822c; flex: none; font-weight: 700; }
.prize-main { flex: 1; min-width: 0; }
.prize-main .p-n { font-size: 14.5px; font-weight: 500; }
.prize-main .p-d { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prize-main .p-c { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 2px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar div { flex: 1; text-align: center; padding: 8px 0 7px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.tabbar div.on { color: var(--brand); font-weight: 600; }
.tabbar div .ico { display: block; font-size: 18px; line-height: 1.3; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,35,30,.44); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 22px; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 18px; max-height: 82vh; overflow: auto; }
.modal-title { font-size: 16.5px; font-weight: 600; margin-bottom: 13px; }
.modal-body { font-size: 14px; margin-bottom: 15px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

.toast {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  background: rgba(28,45,40,.93); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 14px; z-index: 99; opacity: 0; pointer-events: none; transition: .22s; max-width: 78%;
  text-align: center; line-height: 1.5;
}
.toast.show { opacity: 1; }

/* ---------- 学生搜索选择框 ---------- */
.pick { position: relative; }
.pick-input { width: 100%; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--line); font-size: 14px; outline: none; background: #fff; }
.pick-input:focus { border-color: var(--brand); }
.pick-list {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 8px 24px rgba(15, 35, 30, .16); max-height: 240px; overflow-y: auto;
}
.pick-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 13px;
  border-bottom: 1px solid #f2f4f5; font-size: 14px; cursor: pointer;
}
.pick-item:last-child { border-bottom: none; }
.pick-item:active { background: #f2f6ff; }
.pick-item b { font-weight: 600; flex: none; }
.pick-item .s { font-size: 12px; color: var(--muted); }
.pick-pts { margin-left: auto; color: var(--brand); font-weight: 600; font-size: 13px; white-space: nowrap; }
.pick-none { padding: 13px; color: var(--muted); font-size: 12.5px; text-align: center; }

.quick-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.quick-btns span { padding: 6px 13px; border-radius: 9px; background: #eef1f3; font-size: 13.5px; cursor: pointer; }
.quick-btns span.on { background: var(--brand); color: #fff; }
.search-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.search-bar input { flex: 1; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--line); font-size: 14px; outline: none; background: #fff; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* ---- 班级统一加减分（手机端） ---- */
.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;
}
.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: 10px; font-size: 13px; color: var(--muted); }
.cls-sum b { color: var(--brand); }

/* ---------- 兑换商城（重设计） ---------- */
.shop-hero {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--brand), #2aa37a);
  border-radius: 16px; padding: 18px 20px; color: #fff; margin-bottom: 12px;
}
.shop-hero .sh-num { font-size: 30px; font-weight: 700; line-height: 1.1; }
.shop-hero .sh-num2 { font-size: 22px; font-weight: 700; line-height: 1.2; text-align: right; }
.shop-hero .sh-num2 small { font-size: 13px; font-weight: 400; opacity: .8; }
.shop-hero .sh-t { font-size: 11.5px; opacity: .85; margin-top: 2px; }
.shop-hero .sh-r { text-align: right; opacity: .95; }
.shop-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.shop-chips .cls-chip { padding: 6px 13px; border-radius: 16px; border: 1px solid #dde4e8;
  background: #fff; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.shop-chips .cls-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.prize { display: flex; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: center; }
.prize:last-child { border-bottom: none; }
.prize.off { opacity: .55; }
.ptag { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 6px; margin-left: 6px; vertical-align: 1px; }
.ptag.exc { background: #fff3e0; color: #c47a12; }
.ptag.vir { background: #e8f0fd; color: #2f6fd0; }
.ptag.real { background: #e6f4ee; color: var(--ok); }
.prize-main .p-n { font-size: 14.5px; font-weight: 600; }
.prize-main .p-d { font-size: 12px; color: var(--muted); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-meta { display: flex; align-items: baseline; gap: 10px; margin-top: 5px; }
.p-cost { font-size: 16px; color: var(--accent); font-weight: 700; }
.p-cost::after { content: ''; }
.p-stock { font-size: 11.5px; color: var(--muted); }
.p-stock.low { color: var(--danger); font-weight: 600; }
.p-stock.zero { color: var(--muted); }
.p-exc { font-size: 11px; color: #c47a12; background: #fff8ec; border-radius: 6px;
  padding: 2px 8px; margin-top: 5px; display: inline-block; }

/* ---------- 老师端兑换审批卡片 ---------- */
.rd-item { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 10px; background: #fff; }
.rd-item:last-child { margin-bottom: 0; }
.rd-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rd-top .rd-name { font-size: 14.5px; }
.rd-top .rd-sub { font-size: 11.5px; color: var(--muted); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-top .rd-cost { font-size: 15px; color: var(--accent); font-weight: 700; }
.rd-prize { margin-top: 6px; font-size: 13.5px; }
.rd-note { margin-top: 6px; font-size: 12px; color: #8a6d3b; background: #fff8ec;
  border-radius: 8px; padding: 6px 9px; line-height: 1.5; }
.rd-ops { display: flex; gap: 8px; justify-content: flex-end; margin-top: 9px; }
.rd-ops .btn { flex: 1; }

/* ---------- 记录页：日期筛选 / 分页 / 可点姓名 ---------- */
.rec-date { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.rec-date input[type="date"] {
  flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--text); font-size: 14px;
  font-family: inherit; outline: none;
}
.rec-date input[type="date"]:focus { border-color: var(--brand); }
.rec-date span { font-size: 13px; color: var(--muted); flex: none; }
.rec-quick { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.rec-quick .cls-chip { padding: 5px 12px; font-size: 12.5px; }
.rec-sum {
  font-size: 12.5px; color: var(--muted); background: #f7f9fa; border-radius: 9px;
  padding: 7px 11px; margin-bottom: 4px;
}
.rec-sum b { font-size: 13.5px; }
.rec-sum .up { color: var(--danger); }    /* 加分为红 */
.rec-sum .down { color: var(--ok); }      /* 扣分为绿 */
.lnk { color: var(--brand); border-bottom: 1px dashed rgba(23,122,92,.45); cursor: pointer; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 0 2px; }
.pager .pg-info { font-size: 12.5px; color: var(--muted); }
.pager .btn:disabled { opacity: .45; }
