/* 校园币管理系统 · 移动端通用样式（老师端 / 学生端共用） */
:root {
  --primary: #3b7ddd;
  --primary-dark: #2c62b0;
  --success: #22a06b;
  --danger: #e54d42;
  --warn: #e8a33d;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1f2733;
  --text-sub: #6b7684;
  --border: #e6eaf0;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.5;
  padding-bottom: 68px;
}
a { color: var(--primary); text-decoration: none; }

.appbar {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, #3b7ddd, #5b9bf3);
  color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 10px rgba(59,125,221,.22);
}
.appbar h1 { margin: 0; font-size: 17px; font-weight: 600; }
.appbar .sub { font-size: 12px; opacity: .88; margin-top: 2px; }
.appbar-btn { background: rgba(255,255,255,.2); border: 0; color: #fff; padding: 6px 12px; border-radius: 20px; font-size: 13px; }

.page { padding: 14px; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; box-shadow: 0 1px 6px rgba(30,45,70,.06);
}
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; }
.card-title .more { font-size: 13px; color: var(--primary); font-weight: 400; }

.hero {
  background: linear-gradient(135deg, #3b7ddd, #6aa9ff);
  color: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(59,125,221,.28);
}
.hero .label { font-size: 13px; opacity: .9; }
.hero .value { font-size: 38px; font-weight: 700; line-height: 1.15; margin: 4px 0; letter-spacing: -.5px; }
.hero .value small { font-size: 16px; font-weight: 500; margin-left: 4px; opacity: .9; }
.hero .meta { font-size: 12px; opacity: .85; display: flex; gap: 16px; flex-wrap: wrap; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: 0 1px 6px rgba(30,45,70,.06); }
.stat .n { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat .n.green { color: var(--success); }
.stat .n.orange { color: var(--warn); }
.stat .t { font-size: 12px; color: var(--text-sub); margin-top: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 12px 18px; font-size: 15px;
  background: var(--primary); color: #fff; font-weight: 500; width: 100%;
}
.btn:active { opacity: .85; }
.btn:disabled { opacity: .5; }
.btn.ghost { background: #eef3fb; color: var(--primary); }
.btn.success { background: var(--success); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 7px 14px; font-size: 13px; width: auto; border-radius: 8px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px;
  font-size: 15px; background: #fbfcfe; color: var(--text); font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); background: #fff;
}
.field .hint { font-size: 12px; color: #9aa4b2; margin-top: 5px; }

.list-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: 0; }
.list-item .ico { width: 38px; height: 38px; border-radius: 10px; background: #eef3fb; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .t1 { font-size: 14px; font-weight: 500; }
.list-item .t2 { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.list-item .amt { font-size: 16px; font-weight: 700; color: var(--success); white-space: nowrap; }
.list-item .amt.minus { color: var(--danger); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: #eef3fb; color: var(--primary); font-weight: 500; }
.badge.gray { background: #f0f2f5; color: #7a8699; }
.badge.green { background: #e6f6ee; color: var(--success); }
.badge.orange { background: #fdf3e4; color: var(--warn); }
.badge.red { background: #fdeceb; color: var(--danger); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(30,45,70,.06);
}
.tabbar .tab { flex: 1; text-align: center; padding: 4px 0; color: var(--text-sub); font-size: 11px; }
.tabbar .tab.active { color: var(--primary); font-weight: 600; }
.tabbar .tab .i { display: block; font-size: 20px; line-height: 1.2; }

.empty { text-align: center; padding: 40px 20px; color: #9aa4b2; font-size: 14px; }
.empty .i { font-size: 40px; display: block; margin-bottom: 10px; opacity: .5; }

.mask { position: fixed; inset: 0; background: rgba(15,23,36,.5); z-index: 500; display: flex; align-items: flex-end; }
.sheet { background: #fff; width: 100%; border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 86vh; overflow-y: auto; }
.sheet h3 { margin: 0 0 16px; font-size: 16px; }

.stud-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff;
}
.stud-item.sel { border-color: var(--primary); background: #f2f7ff; }
.stud-item .ck { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #cfd7e3; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.stud-item.sel .ck { background: var(--primary); border-color: var(--primary); }
.stud-item .nm { flex: 1; font-size: 14px; }
.stud-item .bal { font-size: 12px; color: var(--text-sub); }

.item-chip {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 8px;
}
.item-chip.sel { border-color: var(--primary); background: #f2f7ff; }
.item-chip .ico { font-size: 18px; }
.item-chip .nm { flex: 1; font-size: 14px; }
.item-chip .val { font-size: 13px; color: var(--primary); font-weight: 600; }

.rank-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.rank-item:last-child { border-bottom: 0; }
.rank-no { width: 26px; height: 26px; border-radius: 50%; background: #f0f2f5; color: #7a8699; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.rank-no.top1 { background: linear-gradient(135deg,#ffb800,#ffd260); color:#fff; }
.rank-no.top2 { background: linear-gradient(135deg,#b8c2d1,#d8dfe8); color:#fff; }
.rank-no.top3 { background: linear-gradient(135deg,#d0925a,#e5b483); color:#fff; }
.rank-item .nm { flex: 1; font-size: 14px; }
.rank-item .nm .sub { font-size: 12px; color: var(--text-sub); }
.rank-item .sc { font-size: 15px; font-weight: 700; color: var(--primary); }

.bar-wrap { height: 6px; background: #eef1f5; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar { height: 100%; background: linear-gradient(90deg,#3b7ddd,#6aa9ff); border-radius: 3px; transition: width .4s; }
.bar.warn { background: linear-gradient(90deg,#e8a33d,#f5c169); }
.bar.danger { background: linear-gradient(90deg,#e54d42,#f58b82); }

.login-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 24px 60px; background: linear-gradient(160deg,#3b7ddd 0%,#5b9bf3 45%,#f4f6fa 45%); }
.login-card { background: #fff; border-radius: 18px; padding: 28px 22px; box-shadow: 0 12px 40px rgba(30,45,70,.16); }
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .i { font-size: 44px; }
.login-logo h2 { margin: 8px 0 2px; font-size: 20px; }
.login-logo p { margin: 0; color: var(--text-sub); font-size: 13px; }
/* V16 学校选择入口 */
.school-tabs { display: flex; gap: 10px; margin: 0 0 10px; }
.school-tab { flex: 1; border: 1.5px solid var(--border); background: #fbfcfe; border-radius: 12px; padding: 10px 8px; cursor: pointer; text-align: center; transition: .15s; line-height: 1.3; }
.school-tab b { display: block; font-size: 14px; color: var(--text); }
.school-tab span { display: block; font-size: 11px; color: #9aa4b2; margin-top: 2px; }
.school-tab.on { border-color: #3b7ddd; background: #eef5ff; box-shadow: 0 2px 10px rgba(59,125,221,.18); }
.school-tab.on b { color: #2c62b8; }
.school-hint { font-size: 12px; color: var(--text-sub); margin: 0 0 16px; text-align: center; }
.school-hint b { color: #2c62b8; }
.quick-login { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.quick-login .t { font-size: 12px; color: #9aa4b2; margin-bottom: 8px; }
.quick-login .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-login .btns button { border: 1px solid var(--border); background: #fbfcfe; padding: 6px 12px; border-radius: 8px; font-size: 12px; color: var(--text-sub); }

.mask-center { align-items: center; padding: 24px; }
.dialog { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 380px; }
.dialog h3 { margin: 0 0 12px; font-size: 17px; }
.dialog .row { display: flex; gap: 10px; margin-top: 18px; }

/* ===== V17 学生端排行榜：我的名次卡片 ===== */
.me-rank-card{display:flex;align-items:center;justify-content:space-between;gap:12px;background:linear-gradient(112deg,#1e5eff,#4b83ff 62%,#6f9dff);color:#fff;border:none}
.me-rank-left{display:flex;align-items:center;gap:12px;min-width:0}
.me-ava{width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:17px;font-weight:700;flex-shrink:0}
.me-name{font-size:16px;font-weight:700}
.me-sub{font-size:11.5px;opacity:.88;margin-top:4px}
.me-rank-right{text-align:right;flex-shrink:0}
.me-no{font-size:34px;font-weight:800;line-height:1}
.me-no small{font-size:14px;font-weight:500;opacity:.75;margin-left:2px}
.me-tip{font-size:11.5px;opacity:.88;margin-top:5px}
.rank-item.mine{background:#f0f5ff;border-radius:10px}
