/* 现代浅色设计系统：统一登录、账号、扫码与日志页面的视觉。 */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --text: #161b26;
  --text-2: #4b5565;
  --muted: #7c8698;
  --line: #e8ebf1;
  --line-2: #dce1ea;
  --brand: #335cff;
  --brand-600: #2a4ce0;
  --brand-soft: #eef2ff;
  --ok: #177a4c;
  --ok-soft: #e9f8f0;
  --danger: #c13a33;
  --danger-soft: #fdf0ef;
  --warn: #94600a;
  --warn-soft: #fff6e5;
  --violet: #6d28d9;
  --violet-soft: #f3edff;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 18px 40px -20px rgba(16, 24, 40, .28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI Emoji",
          "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(900px 480px at 92% -10%, rgba(51, 92, 255, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(51, 92, 255, .16); }
a { color: var(--brand-600); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand); }
h1 { font-size: 26px; line-height: 1.25; margin: 0; letter-spacing: -.02em; font-weight: 750; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 14px; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 650; }
code {
  background: #eef1f7; border: 1px solid #e3e7ef; padding: 1px 6px;
  border-radius: 6px; font-size: .92em;
}
pre { margin: 0; }

.checkin-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 28px; font-weight: 800; color: #0c1322; letter-spacing: -.02em;
}
.checkin-title::before {
  content: ""; width: 6px; height: 26px; border-radius: 4px;
  background: linear-gradient(180deg, #5b7cff, var(--brand-600));
  box-shadow: 0 4px 12px -4px rgba(51, 92, 255, .7);
}

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: rgba(255, 255, 255, .84);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  color: var(--text); font-weight: 750; font-size: 15.5px; letter-spacing: -.01em;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.topbar nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  color: var(--text-2); font-size: 14px; font-weight: 550;
  padding: 7px 12px; border-radius: 999px; transition: background .15s, color .15s;
}
.topbar nav a:hover { background: #f1f3f8; color: var(--text); }
.topbar nav a.checkin-link {
  background: var(--brand-soft); color: var(--brand-600); font-weight: 700;
}
.topbar nav a.checkin-link:hover { background: #e4eaff; }

.container { max-width: 1120px; margin: 0 auto; padding: 28px 22px 72px; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.big { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.warn { color: var(--danger); }

/* 账号卡片 */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px; margin-top: 18px;
}
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card { padding: 18px; transition: transform .18s, box-shadow .18s, border-color .18s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #dfe4ee; }
.card.off { opacity: .62; filter: grayscale(.08); }
.card .name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.seat-line { margin: 12px 0 8px; color: var(--text-2); font-size: 13.5px; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.card-actions form { display: inline; }

.sched {
  margin: 14px 0 6px; padding: 12px 16px; border-radius: 14px;
  font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.sched.on {
  background: linear-gradient(180deg, #f3fbf7, #eaf8f1);
  color: #126b45; border: 1px solid #d3efdf;
}
.sched.off { background: var(--danger-soft); color: var(--danger); border: 1px solid #f3cfcb; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.on { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: #f0f2f6; color: var(--muted); }
.badge.dispatch { background: var(--violet-soft); color: var(--violet); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 15px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.btn:hover { background: var(--surface-soft); border-color: #cfd6e2; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--brand); border-color: transparent; color: #fff;
  box-shadow: 0 8px 18px -10px rgba(51, 92, 255, .8);
}
.btn.primary:hover { background: var(--brand-600); }
.btn.danger { color: var(--danger); border-color: #f0cbc7; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
a.btn { line-height: 1; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.flash {
  background: var(--warn-soft); border: 1px solid #f2dcae; color: #7a5200;
  padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px;
}
.empty {
  padding: 56px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: #fbfcfe;
}

/* 表单 */
label { display: block; margin: 12px 0; color: #3d4655; font-size: 13px; font-weight: 550; }
input[type=text], input[type=password], input[type=time], input[type=datetime-local],
textarea, select {
  width: 100%; margin-top: 6px; padding: 0 12px; height: 40px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: #fbfcfe; color: var(--text); font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select {
  padding-right: 10px; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px rgba(51, 92, 255, .12);
}
input[type=file] { display: block; margin: 10px 0; font-size: 14px; }
details summary {
  cursor: pointer; color: var(--brand-600); font-size: 14px; font-weight: 600;
  margin-top: 10px; list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; color: var(--muted); }
details[open] summary::before { content: "▾ "; }

.panel { margin-top: 18px; padding: 22px; }
.panel:first-child { margin-top: 0; }
.panel h2 { display: flex; align-items: center; gap: 8px; }
.panel h2::before {
  content: ""; width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, #6d89ff, var(--brand-600));
}
.help {
  background: #fafbff; border: 1px solid var(--line);
  border-radius: 14px; padding: 4px 16px 16px; margin-top: 16px;
}
.help h3 { margin: 14px 0 6px; }
.help code { word-break: break-all; }
.checkin-help { margin: 12px 0 18px; }
.checkin-help summary { margin-top: 0; padding: 12px 0; }
.checkin-help p { margin: 4px 0 8px; }

.picker { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.picker label { margin: 0; min-width: 180px; flex: 0 0 auto; }
.picker select { min-width: 180px; }
.picked { margin: 0 0 8px; color: var(--text-2); font-size: 14px; }

/* 座位网格 */
.seat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px; margin: 16px 0; max-height: 420px; overflow: auto; padding-right: 4px;
}
.seat {
  padding: 10px 6px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface-soft); color: var(--text-2);
  cursor: pointer; font: 600 13px/1.3 var(--font);
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.seat:hover { transform: translateY(-1px); border-color: #cbd3e0; }
.seat.free { background: #eefaf3; color: var(--ok); border-color: #cdeedd; }
.seat.free:hover { background: #e2f6eb; }
.seat.busy {
  background: #f1f3f7; color: #9aa3b2; border-color: #e3e7ee;
  cursor: not-allowed; opacity: 1;
}
.seat.busy:hover { transform: none; }
.seat.busy.pickable { cursor: pointer; border-style: dashed; border-color: #cfd8e6; }
.seat.busy.pickable:hover { border-color: #7bbf9a; background: #f4f8f6; }
.seat.sel {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 8px 18px -10px rgba(51, 92, 255, .8);
}
.seat.mine { background: var(--violet-soft); color: var(--violet); border-color: #dfcdfa; }
.seat.mine:hover { background: #ece2ff; }
.seat.mine .mine-tag { display: block; font-size: 10px; font-weight: 600; opacity: .85; margin-top: 2px; }
.seat-legend {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 12px 0 4px; font-size: 12.5px; color: var(--muted);
}
.seat-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.seat-legend .dot.free { background: #eefaf3; border: 1px solid #cdeedd; }
.seat-legend .dot.busy { background: #f1f3f7; border: 1px solid #dbe0e9; }
.seat-legend .dot.mine { background: var(--violet-soft); border: 1px solid #dfcdfa; }
.seat-legend #seatHint, .seat-legend #svSeatHint { margin-left: auto; }

/* 输出与日志 */
.output {
  background: #0f172a; color: #c9d6ee; padding: 14px 16px; border-radius: 12px;
  border: 1px solid #1e293b; min-height: 60px; overflow: auto; white-space: pre-wrap;
  word-break: break-all; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.output.log { max-height: 72vh; }

/* 登录页 */
.login-body {
  display: grid; place-items: center; min-height: 100vh; padding: 24px;
  background:
    radial-gradient(900px 600px at 12% -12%, #e6ecff 0%, transparent 58%),
    radial-gradient(820px 520px at 104% -4%, #eaf7ff 0%, transparent 55%),
    var(--bg);
}
.login-box {
  width: 380px; max-width: 100%; padding: 32px;
  background: rgba(255, 255, 255, .94); border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 22px; box-shadow: 0 30px 70px -30px rgba(16, 24, 40, .38);
  backdrop-filter: blur(10px);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-logo {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #335cff, #6d28d9);
  box-shadow: 0 12px 26px -14px rgba(51, 92, 255, .9);
}
.login-logo svg { width: 22px; height: 22px; }
.login-box h1 { font-size: 20px; font-weight: 700; letter-spacing: .2px; margin: 0; }
.login-caption { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.login-tip { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.login-foot {
  margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px; text-align: center; line-height: 1.5;
}
.login-sub { font-size: 14px; font-weight: 650; color: var(--text-2); margin: 18px 0 10px; }
.login-sub::before { content: none; }
.login-box .btn { width: 100%; height: 42px; margin-top: 6px; }
.admin-login { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.admin-login summary { color: var(--muted); font-size: 13px; }
.admin-login input { margin-top: 8px; }
.cap-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.cap-row input { margin-top: 0; }
.captcha {
  height: 42px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--line-2); background: #fff;
}

/* 图库（旧功能保留） */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.thumb { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.thumb img { width: 100%; height: 124px; object-fit: cover; border-radius: 10px; display: block; background: #f2f4f8; }
.thumb .meta { font-size: 11.5px; color: var(--muted); margin: 8px 0; word-break: break-all; }
.thumb .btn { width: 100%; }
.bm-wrap { margin: 10px 0; }
.bm {
  display: inline-block; padding: 9px 18px; border-radius: var(--r-sm);
  background: var(--brand); color: #fff !important; font-weight: 650; cursor: grab;
  border: 1px dashed rgba(255, 255, 255, .8);
  box-shadow: 0 8px 18px -10px rgba(51, 92, 255, .8);
}

/* 扫码页 */
#qrBatch:not(:empty) { margin-bottom: 12px; }
#qrBatch .warn { font-weight: 600; }
.qr-scanner { margin: 14px 0; }
.qr-scanner video {
  width: 100%; max-height: 62vh; background: #000;
  border-radius: 16px; object-fit: cover;
  border: 1px solid #111827; box-shadow: var(--shadow-md);
}
#qrDiag { overflow-wrap: anywhere; user-select: text; }
.qr-steps { padding-left: 24px; margin: 10px 0; }
.qr-steps li { margin: 4px 0; }
.qr-state { overflow-wrap: anywhere; }
.qr-state.succeeded { color: var(--ok); }
.qr-state.failed { color: var(--danger); }
.qr-state.unknown, .qr-state.blocked { color: var(--warn); }
.qr-state.running, .qr-state.processing { color: var(--brand-600); }
.qr-history {
  display: block; width: 100%; text-align: left; margin: 6px 0;
  background: var(--surface-soft); border-color: var(--line);
}
.qr-history:hover { background: #f2f5fb; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1000;
  max-width: min(92vw, 540px); padding: 14px 18px; border-radius: 14px;
  font-weight: 600; line-height: 1.45; white-space: pre-wrap; color: #fff;
  background: rgba(17, 24, 39, .92); backdrop-filter: blur(10px);
  box-shadow: 0 22px 50px -20px rgba(0, 0, 0, .55); cursor: pointer;
}
.toast.succeeded { background: rgba(21, 122, 76, .95); }
.toast.failed, .toast.blocked { background: rgba(193, 58, 51, .95); }
.toast.unknown, .toast.warn { background: rgba(148, 96, 10, .95); }

@media (max-width: 860px) {
  .container { padding: 22px 16px 64px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  h1 { font-size: 22px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .topbar nav { gap: 2px; }
  .topbar nav a { padding: 6px 9px; font-size: 13px; }
  .cards { grid-template-columns: 1fr; }
  .seat-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .picker label, .picker select { min-width: 140px; flex: 1 1 140px; }
  .seat-legend #seatHint { margin-left: 0; flex-basis: 100%; }
}

/* 二课系统 */
.warn-banner {
  margin: 12px 0 4px; padding: 11px 15px; border-radius: 12px;
  background: var(--warn-soft); border: 1px solid #f2dcae; color: #7a5200;
  font-size: 13px; line-height: 1.5;
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 16px; }
.tab-btn {
  height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  font: 600 13.5px/1 var(--font); transition: background .15s, color .15s;
}
.tab-btn:hover { background: #f1f3f8; color: var(--text); }
.tab-btn.active { background: var(--brand-soft); color: var(--brand-600); }
a.tab-btn { display: inline-flex; align-items: center; text-decoration: none; }
.quick-admin {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin-top: 10px;
}
.quick-admin select, .quick-admin input[type="number"] {
  height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font: inherit;
}
.quick-admin input[type="number"] { width: 78px; }
.quick-admin label { display: flex; align-items: center; gap: 4px; }
.tabs-sub { margin: -4px 0 12px; }
.tabs-sub .tab-btn { height: 30px; padding: 0 11px; font-size: 12.5px; }
.tab-count {
  display: inline-block; min-width: 20px; margin-left: 2px; padding: 0 6px;
  border-radius: 999px; background: rgba(22, 27, 38, .06);
  color: var(--text-2); font-size: 11.5px; line-height: 18px; text-align: center;
}
.tab-btn.active .tab-count { background: rgba(51, 92, 255, .14); color: var(--brand-600); }

.admin-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 640px; margin: 16px 0 14px; padding: 5px 8px 5px 14px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 14px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.admin-search:focus-within {
  border-color: #b9c6ff; box-shadow: 0 0 0 4px rgba(51, 92, 255, .10);
}
.admin-search svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.admin-search input {
  flex: 1; min-width: 0; height: 38px; border: 0; outline: 0;
  background: transparent; color: var(--text); font: inherit;
}
.admin-search input::placeholder { color: var(--muted); }
.admin-search input::-webkit-search-cancel-button { display: none; }
.admin-search kbd {
  flex: none; padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-soft);
  color: var(--muted); font: 600 11px/1.5 var(--font);
}
.admin-search-clear {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 19px; line-height: 1;
  cursor: pointer;
}
.admin-search-clear:hover { background: var(--surface-soft); color: var(--text); }
.card-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.status-line.warn { color: var(--danger); }

@media (max-width: 640px) {
  .admin-search kbd { display: none; }
}

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.toolbar input, .toolbar select { width: auto; min-width: 170px; margin-top: 0; }
.toolbar input[type=text] { min-width: 200px; }

.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 660px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { background: #fafbfe; color: var(--text-2); font-weight: 650; font-size: 12.5px; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f8fafd; }
.data-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-row { text-align: center !important; padding: 26px !important; color: var(--muted); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

.tag {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tag.blue { background: var(--brand-soft); color: var(--brand-600); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.orange { background: var(--warn-soft); color: var(--warn); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.gray { background: #f0f2f6; color: var(--muted); }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 14px 0 4px;
}
.stat-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  background: linear-gradient(180deg, #fbfcff, #f7f9fd);
}
.stat-card b { display: block; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.stat-card span { color: var(--muted); font-size: 12.5px; }

.pager {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  flex-wrap: wrap; margin-top: 12px;
}
.pager select { width: auto; min-width: 120px; margin-top: 0; }

.modal {
  border: none; padding: 24px; width: min(600px, 92vw); max-height: 88vh;
  overflow: auto; border-radius: 20px; background: #fff; color: var(--text);
  box-shadow: 0 40px 90px -30px rgba(16, 24, 40, .55);
}
.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(4px); }
.modal-wide { width: min(1020px, 94vw); }
.modal h2 { margin-bottom: 12px; }
.modal h2::before { content: none; }
.modal h3 { margin: 18px 0 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.wechat-row {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  padding: 12px; margin-top: 6px; border-radius: 12px; background: var(--surface-soft);
}
.wechat-row label { flex: 1 1 260px; margin: 0; }
.wechat-row input { margin-top: 4px; }

.activity-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px; margin: 8px 0 20px; max-height: 46vh; overflow: auto; padding-right: 4px;
}
.activity-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.activity-card:hover { border-color: #d7deea; box-shadow: var(--shadow-sm); }
.activity-card h4 { margin: 0 0 8px; font-size: 14px; line-height: 1.4; }
.activity-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.activity-head h4 { margin: 0; }
#erkeSquareGrid { max-height: none; }
.me-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  max-width: 560px;
}
.me-card .name { font-size: 18px; }
.me-card .seat-line { margin: 0; }
.me-card p { margin: 0; }
.me-card .btn { margin-top: 6px; }
.bind-panel > summary { cursor: pointer; font-weight: 700; list-style: none; }
.bind-panel > summary::-webkit-details-marker { display: none; }
.bind-panel > summary::before { content: "▸ "; color: var(--muted); }
.bind-panel[open] > summary::before { content: "▾ "; }
.bind-grid {
  display: grid; grid-template-columns: 240px 1fr; gap: 22px;
  align-items: start; margin-top: 14px;
}
.qr-image {
  width: 100%; max-width: 240px; display: block; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
}
.bind-qr p { margin: 8px 0 0; }
.bind-steps ol { margin: 0 0 12px; padding-left: 20px; color: var(--text-2); font-size: 13.5px; }
.bind-steps li { margin: 4px 0; }
.bind-steps input { margin-bottom: 10px; }
.auto-bind { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.auto-bind-box { margin-top: 14px; text-align: center; }
.auto-bind-box .qr-image { margin: 0 auto 10px; }
.auto-bind-box a { display: inline-block; margin-bottom: 6px; }
.bind-result h1 { font-size: 20px; }
.bind-result.ok h1 { color: var(--ok); }
.bind-result.bad h1 { color: var(--danger); }
.sv-photo { margin: 16px 0; }
.sv-preview {
  display: block; max-width: 100%; max-height: 360px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.sv-confirm {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 14px 0; font-size: 13px; color: var(--text-2);
}
.sv-confirm input { width: auto; margin-top: 3px; }
#svMessage.ok { color: var(--ok); font-weight: 600; }
.help-steps { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; align-items: flex-start; }
.help-steps figure { margin: 0; flex: 0 1 auto; max-width: 300px; text-align: center; }
.help-steps img {
  width: auto; max-width: 100%; max-height: 360px; display: block;
  margin: 0 auto; border: 1px solid var(--line);
  border-radius: 12px; background: #fff;
}
.help-steps img.tall {
  width: 180px; height: 360px; object-fit: cover; object-position: top;
}
.help-steps figcaption {
  margin-top: 8px; color: var(--text-2); font-size: 12.5px; line-height: 1.5;
  text-align: left;
}
@media (max-width: 720px) {
  .help-steps { flex-direction: column; align-items: center; }
  .help-steps figure { max-width: 320px; }
  .help-steps img { max-height: 320px; }
  .help-steps img.tall { width: 160px; height: 320px; }
}
@media (max-width: 720px) {
  .bind-grid { grid-template-columns: 1fr; }
  .bind-qr { text-align: center; }
  .qr-image { margin: 0 auto; }
}
.activity-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.activity-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .toolbar input[type=text], .toolbar input, .toolbar select { min-width: 140px; flex: 1 1 140px; }
  .modal { padding: 18px; border-radius: 16px; }
  .activity-grid { grid-template-columns: 1fr; max-height: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .pager { justify-content: space-between; }
  #tab-students .data-table, #tab-golden .data-table { min-width: 0; }
  #tab-students .data-table th:nth-child(3), #tab-students .data-table td:nth-child(3),
  #tab-students .data-table th:nth-child(4), #tab-students .data-table td:nth-child(4),
  #tab-students .data-table th:nth-child(5), #tab-students .data-table td:nth-child(5),
  #tab-golden .data-table th:nth-child(4), #tab-golden .data-table td:nth-child(4) {
    display: none;
  }
  #tab-students .data-table th:nth-child(1), #tab-students .data-table td:nth-child(1),
  #tab-students .data-table th:nth-child(2), #tab-students .data-table td:nth-child(2) {
    white-space: nowrap;
  }
  .data-table .actions { flex-wrap: nowrap; gap: 4px; }
  .data-table th, .data-table td { padding: 9px 8px; }
  .btn.sm { padding: 0 8px; font-size: 12px; }
}
