:root {
  --ink: #12352A;
  --brand: #1B7A45;
  --brand-2: #2E9E62;
  --bg: #F3F7F4;
  --card: #FFFFFF;
  --line: #E3EAE5;
  --muted: #6B7C74;
  --danger: #C0392B;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 53, 42, .04), 0 8px 24px rgba(18, 53, 42, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 20px 16px 64px; }
.wrap-narrow { max-width: 520px; margin: 0 auto; padding: 20px 16px 64px; }

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: .5px; font-weight: 700; overflow-wrap: anywhere; }
h2 { font-size: 16px; margin: 0 0 14px; font-weight: 700; }
.sub { color: var(--muted); font-size: 13px; margin: 0; overflow-wrap: anywhere; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px; min-width: 0;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.topbar .brand > div { min-width: 0; }
.topbar .dot { flex: none; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-2); box-shadow: 0 0 0 4px rgba(46, 158, 98, .15);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 13px; color: var(--muted);
  margin-bottom: 6px; font-weight: 600;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
  background: #FBFDFC;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(46, 158, 98, .12);
  background: #fff;
}
.input::placeholder { color: #A9B7B0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px;
  font-size: 15px; font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s, background .15s, border-color .15s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:active { transform: scale(.985); }
.btn:hover { border-color: #CFDBD4; }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(27, 122, 69, .22);
}
.btn-primary:hover { background: #17683C; border-color: #17683C; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; padding: 15px 18px; font-size: 17px; border-radius: 12px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-danger { color: var(--danger); border-color: #F0D6D3; }
.btn-danger:hover { background: #FDF3F2; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }

.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.err { color: var(--danger); font-size: 13.5px; margin-top: 10px; min-height: 20px; }

/* 场次列表 */
.session {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.session .title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.session .meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.session .stats { display: flex; gap: 18px; margin-bottom: 14px; }
.session .stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.session .stat span { font-size: 12px; color: var(--muted); display: block; }
.session.closed { opacity: .62; }
.session .row > * { flex: 1 1 118px; }
.badge {
  display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 99px;
  background: #EAF4EE; color: var(--brand); font-weight: 600; margin-left: 8px;
  vertical-align: 2px;
}
.badge.off { background: #F2F2F0; color: #8A9691; }

/* 二维码页 */
.qr-stage {
  text-align: center;
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 28px 20px 24px;
  box-shadow: var(--shadow);
}
.qr-stage img {
  width: 100%; max-width: 420px; height: auto;
  border-radius: 12px; display: block; margin: 0 auto 18px;
}
.qr-code-text {
  font-size: 13px; color: var(--muted); letter-spacing: 3px;
  font-weight: 700; margin-bottom: 4px;
}
.qr-count {
  font-size: 56px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--brand); letter-spacing: -1px;
}
.qr-count-label { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* 名单表 */
.stats-bar {
  display: flex; gap: 10px; margin-bottom: 16px;
}
.stats-bar .box {
  flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; text-align: center; box-shadow: var(--shadow);
}
.stats-bar .box b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stats-bar .box span { font-size: 12px; color: var(--muted); }

table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td {
  padding: 11px 10px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--line);
}
table.list th {
  font-size: 12.5px; color: var(--muted); font-weight: 600;
  background: #FAFCFB; position: sticky; top: 0;
}
table.list tr.done td { background: #F4FAF6; }
table.list td.num { font-variant-numeric: tabular-nums; color: var(--muted); width: 48px; }
.check {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #CFDBD4;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; background: #fff; transition: all .15s;
}
.check.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.check.on::after { content: "✓"; font-size: 14px; font-weight: 800; }

/* 签到成功 */
.ok-panel { text-align: center; padding: 34px 20px; }
.ok-icon {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 20px;
  background: linear-gradient(135deg, #2E9E62, #1B7A45);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 40px; font-weight: 300;
  box-shadow: 0 12px 28px rgba(27, 122, 69, .28);
}
.ok-panel h2 { font-size: 21px; margin-bottom: 6px; }
.ok-meta {
  margin: 22px auto 0; max-width: 340px; text-align: left;
  border-top: 1px solid var(--line); padding-top: 16px;
}
.ok-meta div { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14.5px; }
.ok-meta div span { color: var(--muted); }
.ok-meta div b { font-weight: 600; }

/* 学校搜索下拉 */
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(18, 53, 42, .14);
  max-height: 260px; overflow-y: auto; z-index: 30; display: none;
}
.combo-list.open { display: block; }
.combo-list div {
  padding: 12px 14px; font-size: 15px; cursor: pointer; border-bottom: 1px solid #F2F6F4;
}
.combo-list div:last-child { border-bottom: none; }
.combo-list div:hover, .combo-list div.active { background: #F0F8F3; color: var(--brand); }
.combo-list div.empty { color: var(--muted); cursor: default; font-size: 14px; }

.hide { display: none !important; }

@media (max-width: 560px) {
  .wrap, .wrap-narrow { padding: 14px 12px 56px; }
  .card { padding: 16px; border-radius: 12px; }
  h1 { font-size: 19px; }
  .qr-count { font-size: 46px; }
  .session .row .btn { flex: 1 1 auto; }
  .hide-sm { display: none !important; }
}
