/* ============ 活动现场签到系统 · 通用样式 ============ */
:root {
  --brand: #12395b;
  --accent: #c8a24a;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: #e3e8ef;
  --border-strong: #cbd5e1;
  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --warn: #b91c1c;
  --warn-bg: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 2px 10px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 32px rgba(15, 23, 42, .10);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }
.hidden { display: none !important; }
.en { color: var(--faint); font-size: .78em; letter-spacing: .04em; font-weight: 500; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: var(--r-sm);
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  background: var(--brand); color: #fff;
  transition: filter .15s, transform .08s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-lg { height: 56px; font-size: 17px; width: 100%; border-radius: 10px; }
.btn-ghost {
  background: #fff; color: var(--text);
  border: 1px solid var(--border-strong); box-shadow: none;
}
.btn-ghost:hover { background: #f8fafc; border-color: var(--faint); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 7px; }
.btn-danger { background: var(--warn); }
.btn-ok { background: var(--ok); }

/* ============ 表单 ============ */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 13px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px; letter-spacing: .01em;
}
.input, select.input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: 16px; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 34px; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 57, 91, .10); }
.input::placeholder { color: #b6c2d1; }

/* ============ 卡片 ============ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.card-hd {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-hd h3 { font-size: 15px; }
.card-bd { padding: 16px 18px; }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  background: #f1f5f9; color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.brand { background: rgba(18, 57, 91, .08); color: var(--brand); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============ 提示条 ============ */
.alert {
  padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px;
  border: 1px solid; margin-bottom: 14px; line-height: 1.5;
}
.alert.err { background: var(--warn-bg); border-color: #fecaca; color: var(--warn); }
.alert.ok { background: var(--ok-bg); border-color: #bbf7d0; color: var(--ok); }
.alert.info { background: #f0f7ff; border-color: #d6e6f7; color: var(--brand); }

/* ================================================================
   签到页（手机端）
   ================================================================ */
body.checkin-page {
  background:
    radial-gradient(1200px 420px at 50% -8%, rgba(18, 57, 91, .09), transparent 70%),
    var(--bg);
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 16px 40px;
}
.ck-shell { width: 100%; max-width: 460px; }

.ck-head { padding: 30px 0 22px; text-align: center; }
.ck-logo {
  max-height: 42px; max-width: 158px; object-fit: contain;
  margin: 0 auto 12px; display: block;
}
.ck-logo-ph {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 12px;
  background: var(--brand); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 19px; font-weight: 700; letter-spacing: -.02em;
}
.ck-head h1 { font-size: 23px; letter-spacing: -.02em; }
.ck-head .en-name {
  font-size: 11.5px; letter-spacing: .22em; color: var(--faint);
  font-weight: 600; margin-top: 7px; text-transform: uppercase;
}
.ck-head .sub { font-size: 13px; color: var(--muted); margin-top: 10px; }

.ck-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 26px 22px;
}
.ck-title { font-size: 18px; text-align: center; }
.ck-title-en { text-align: center; font-size: 11px; letter-spacing: .16em; color: var(--faint); margin-top: 5px; font-weight: 600; text-transform: uppercase; }
.ck-hr { height: 1px; background: var(--border); margin: 20px 0; }

.ck-input-wrap { position: relative; }
.ck-input {
  width: 100%; height: 58px; padding: 0 16px; text-align: center;
  font-size: 21px; font-weight: 600; letter-spacing: .06em;
  border: 1.5px solid var(--border-strong); border-radius: 10px;
  background: #fbfcfd; color: var(--text); text-transform: uppercase;
}
.ck-input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(18, 57, 91, .09); }
.ck-input::placeholder { text-transform: none; font-weight: 400; letter-spacing: 0; color: #c3cdd9; font-size: 16px; }
.ck-hint { text-align: center; font-size: 12.5px; color: var(--faint); margin-top: 10px; line-height: 1.6; }

/* 员工信息 */
.emp-box {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--r); background: #f8fafc;
  border: 1px solid var(--border);
}
.emp-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 19px; font-weight: 600;
}
.emp-name { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.emp-id { font-size: 13px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* 领取清单 */
.list-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase; margin: 20px 0 10px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.list-title .en { font-weight: 600; }
.gift-list { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.gift-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 15px; border-bottom: 1px solid var(--border); gap: 12px;
  background: #fff;
}
.gift-row:last-child { border-bottom: none; }
.gift-row.zero { opacity: .38; }
.gift-name { font-size: 15px; font-weight: 500; }
.gift-name .en { display: block; margin-top: 2px; font-size: 11px; }
.gift-qty {
  flex-shrink: 0; min-width: 40px; height: 26px; padding: 0 9px;
  border-radius: 6px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.gift-qty.txt { background: #eef2f7; color: var(--text); font-weight: 600; font-size: 13px; }

/* 成功态 */
.done-wrap { text-align: center; padding: 8px 0 4px; }
.done-ring {
  width: 92px; height: 92px; margin: 6px auto 20px; border-radius: 50%;
  background: var(--ok-bg); display: flex; align-items: center; justify-content: center;
  animation: pop .45s cubic-bezier(.2, 1.4, .5, 1);
}
.done-ring svg { width: 46px; height: 46px; color: var(--ok); }
.done-ring path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: draw .45s .18s ease forwards; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-h { font-size: 24px; font-weight: 700; color: var(--ok); letter-spacing: -.01em; }
.done-sub { font-size: 12px; letter-spacing: .14em; color: var(--faint); margin-top: 7px; font-weight: 600; text-transform: uppercase; }
.done-name { font-size: 17px; margin-top: 16px; font-weight: 600; }
.done-time { font-size: 13px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* 已签到（重复扫码/重复查工号）—— 整体转红色，与「签到成功」的绿色一眼区分 */
.is-already .done-ring { background: var(--warn-bg); }
.is-already .done-ring svg { color: var(--warn); }
.is-already .done-h { color: var(--warn); }
.is-already .done-sub { color: var(--warn); opacity: .72; }
.is-already .done-time { color: var(--warn); font-weight: 600; }

.ck-foot { text-align: center; margin-top: 22px; font-size: 12px; color: var(--faint); line-height: 1.8; }

/* ================================================================
   后台
   ================================================================ */
body.admin-page { background: var(--bg); min-height: 100vh; }

.ad-top {
  background: var(--brand); color: #fff;
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  position: sticky; top: 0; z-index: 50;
}
.ad-top .brandline { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ad-top .logo-mini {
  width: 32px; height: 32px; border-radius: 8px; object-fit: contain;
  background: rgba(255, 255, 255, .14); padding: 3px; flex-shrink: 0;
}
.ad-top .logo-mini.ph { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; padding: 0; }
.ad-top h1 { font-size: 15.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-top .sub { font-size: 11px; opacity: .6; letter-spacing: .1em; margin-top: 1px; }
.ad-top .actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ad-top .tb {
  height: 34px; padding: 0 13px; border-radius: 7px; font-size: 13px; font-weight: 500;
  color: rgba(255, 255, 255, .92); background: rgba(255, 255, 255, .12);
  display: inline-flex; align-items: center; gap: 6px; transition: background .15s;
}
.ad-top .tb:hover { background: rgba(255, 255, 255, .22); }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.ad-wrap { max-width: 1380px; margin: 0 auto; padding: 16px 24px 40px; }

/* 统计卡 */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px 18px 15px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi .k-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.kpi .k-label .en { display: block; font-size: 10px; letter-spacing: .1em; margin-top: 3px; text-transform: uppercase; }
.kpi .k-val {
  font-size: 29px; font-weight: 700; margin-top: 8px; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.kpi .k-val small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi.ok .k-val { color: var(--ok); }
.kpi.pend .k-val { color: var(--muted); }
.kpi.rate .k-val { color: var(--brand); }
.kpi::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border);
}
.kpi.ok::after { background: var(--ok); }
.kpi.rate::after { background: var(--accent); }

.progress-wrap { height: 6px; background: #eef2f7; border-radius: 3px; margin-top: 12px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 3px; transition: width .5s ease; }

/* 布局 */
.ad-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.ad-grid > * { min-width: 0; }

/* 工具栏 */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.search-box { position: relative; flex: 1; min-width: 180px; max-width: 300px; }
.search-box input {
  width: 100%; height: 38px; padding: 0 12px 0 34px;
  border: 1px solid var(--border-strong); border-radius: 7px; font-size: 14px; background: #fff;
}
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 57, 91, .09); }
.search-box svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; opacity: .4; }

.seg { display: inline-flex; background: #f1f5f9; border-radius: 7px; padding: 3px; gap: 2px; }
.seg button {
  height: 32px; padding: 0 14px; border-radius: 5px; font-size: 13px; font-weight: 600;
  color: var(--muted); transition: all .15s;
}
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* 表格 */
.tbl-scroll { overflow-x: auto; max-width: 100%; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
table.tbl th {
  text-align: left; padding: 8px 8px; font-size: 10.5px; font-weight: 700;
  color: var(--muted); letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
table.tbl th .en { display: block; font-size: 8.5px; font-weight: 600; letter-spacing: .02em; margin-top: 2px; }
table.tbl td {
  padding: 10px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}
table.tbl tbody tr:hover { background: #fafbfc; }
table.tbl tbody tr.done { background: rgba(21, 128, 61, .035); }
table.tbl tbody tr.done:hover { background: rgba(21, 128, 61, .07); }
table.tbl tbody tr.flash { animation: flash 1.6s ease; }
@keyframes flash {
  0% { background: #fef9c3; } 60% { background: #fefce8; } 100% { background: transparent; }
}
td.num { font-variant-numeric: tabular-nums; text-align: center; }
td.id-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
td.name-cell { font-weight: 500; }
.zero-cell { color: #cbd5e1; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: .62; transition: opacity .15s; }
.row-actions .btn { height: 25px; padding: 0 7px; font-size: 11.5px; border-radius: 6px; }
tr:hover .row-actions { opacity: 1; }
table.tbl td .badge { height: 20px; padding: 0 7px; font-size: 11px; }

.empty-state { padding: 56px 20px; text-align: center; color: var(--faint); font-size: 14px; }
.empty-state svg { width: 40px; height: 40px; opacity: .3; margin-bottom: 12px; }

/* 侧栏 */
.side-stack { display: flex; flex-direction: column; gap: 14px; }
.qr-holder { display: flex; flex-direction: column; align-items: center; padding: 2px 0 0; }
.qr-holder img { width: 124px; height: 124px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.qr-url {
  margin-top: 8px; font-size: 11.5px; color: var(--brand); font-weight: 600;
  word-break: break-all; text-align: center; line-height: 1.5;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; width: 100%;
}
.qr-note { font-size: 11px; color: var(--faint); margin-top: 6px; text-align: center; line-height: 1.6; }

/* 物品发放横向摘要条 */
.gift-strip {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 9px 18px; margin-bottom: 16px;
}
.gift-strip .gs-hd {
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .04em; white-space: nowrap; flex-shrink: 0;
}
.gift-strip .gs-hd .en { display: block; font-size: 9.5px; letter-spacing: .1em; color: var(--faint); }
.gs-flow { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; flex: 1; min-width: 0; }
.gs-item { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.gs-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.gs-name .en { display: none; }
.gs-val { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--faint); white-space: nowrap; }
.gs-val b { color: var(--ok); font-size: 14px; font-weight: 700; }
.gs-flow .gs-empty { color: var(--faint); font-size: 12.5px; }

/* 日志 */
.log-list { max-height: 110px; overflow-y: auto; display: flex; flex-direction: column; }
.log-item {
  display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.log-item:last-child { border-bottom: none; }
.log-item .t { color: var(--faint); font-variant-numeric: tabular-nums; flex-shrink: 0; font-size: 12px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 620px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: modalIn .22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal-hd {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-hd h3 { font-size: 16px; }
.modal-bd { padding: 22px; overflow-y: auto; flex: 1; }
.modal-ft {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; background: #fafbfc;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.close-x {
  width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 19px; line-height: 1;
}
.close-x:hover { background: #f1f5f9; color: var(--text); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] {
  width: 46px; height: 40px; border: 1px solid var(--border-strong);
  border-radius: 7px; padding: 3px; background: #fff; cursor: pointer;
}
.color-row input[type=text] { flex: 1; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 7px; font-size: 14px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #cbd5e1; border-radius: 13px; transition: .2s; cursor: pointer;
}
.switch .slider::before {
  content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm);
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.import-drop {
  border: 2px dashed var(--border-strong); border-radius: var(--r);
  padding: 34px 20px; text-align: center; transition: all .18s; cursor: pointer; background: #fafbfc;
}
.import-drop:hover, .import-drop.over { border-color: var(--brand); background: #f0f7ff; }
.import-drop svg { width: 36px; height: 36px; opacity: .35; margin-bottom: 12px; }
.import-drop .t1 { font-size: 15px; font-weight: 600; }
.import-drop .t2 { font-size: 12.5px; color: var(--faint); margin-top: 6px; line-height: 1.6; }

.field-map { margin-top: 18px; }
.field-map table { width: 100%; border-collapse: collapse; font-size: 13px; }
.field-map th { text-align: left; padding: 8px 10px; background: #f8fafc; font-size: 11px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.field-map td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; }
.field-map code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(900px 400px at 50% 0%, rgba(18, 57, 91, .10), transparent 65%), var(--bg);
}
.login-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 38px 34px; width: 100%; max-width: 380px;
}
.login-card .lg-logo {
  width: 52px; height: 52px; border-radius: 13px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
  margin: 0 auto 20px;
}
.login-card h2 { text-align: center; font-size: 19px; }
.login-card .sub { text-align: center; font-size: 12px; color: var(--faint); letter-spacing: .1em; margin-top: 7px; font-weight: 600; text-transform: uppercase; }

/* 大屏签到墙 */
body.board-page { background: var(--brand); color: #fff; min-height: 100vh; overflow: hidden; }
.bd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 40px 18px; border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.bd-head h1 { font-size: 26px; color: #fff; }
.bd-head .en { color: rgba(255, 255, 255, .5); font-size: 12px; letter-spacing: .2em; margin-top: 6px; font-weight: 600; }
.bd-stats { display: flex; gap: 44px; }
.bd-stat .v { font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.bd-stat .l { font-size: 12px; color: rgba(255, 255, 255, .55); margin-top: 8px; letter-spacing: .08em; }
.bd-stat.gold .v { color: var(--accent); }
.bd-stat.green .v { color: #4ade80; }
.bd-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px; padding: 26px 40px; max-height: calc(100vh - 200px); overflow-y: auto;
}
.bd-card {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px; padding: 13px 15px; animation: bdIn .5s cubic-bezier(.2, 1.2, .4, 1);
}
@keyframes bdIn { from { opacity: 0; transform: translateY(14px) scale(.94); } }
.bd-card .n { font-size: 17px; font-weight: 600; color: #fff; }
.bd-card .i { font-size: 12px; color: rgba(255, 255, 255, .5); margin-top: 4px; font-variant-numeric: tabular-nums; }
.bd-card .t { font-size: 11px; color: rgba(255, 255, 255, .35); margin-top: 6px; font-variant-numeric: tabular-nums; }
.bd-card.latest { background: var(--accent); border-color: var(--accent); }
.bd-card.latest .n, .bd-card.latest .i, .bd-card.latest .t { color: #fff; }
.bd-empty { grid-column: 1 / -1; text-align: center; padding: 80px 0; color: rgba(255, 255, 255, .35); font-size: 17px; }

/* 提示 */
.toast-wrap {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 400; display: flex; flex-direction: column; gap: 9px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #0f172a; color: #fff; padding: 11px 20px; border-radius: 9px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease; max-width: 90vw;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }

/* 响应式 */
@media (max-width: 1080px) {
  .ad-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ad-wrap { padding: 16px 14px 50px; }
  .ad-top { padding: 0 14px; height: 56px; }
  .ad-top h1 { font-size: 14px; }
  .ad-top .tb span.txt { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .k-val { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { padding: 12px; }
  .search-box { max-width: none; }
  .bd-head { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .bd-stats { gap: 26px; }
  .bd-stat .v { font-size: 30px; }
  .bd-grid { padding: 18px 20px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* 矮屏（笔记本）进一步压缩侧栏 */
@media (max-height: 860px) {
  .qr-holder img { width: 104px; height: 104px; }
  .qr-url { display: none; }
  .log-list { max-height: 88px; }
  .card-hd { padding: 10px 16px; }
  .card-bd { padding: 12px 16px; }
  .kpi { padding: 11px 16px 13px; }
  .kpi .k-val { font-size: 26px; margin-top: 6px; }
}

/* 表格文本列 / 时间列 */
.txt-cell { font-size: 11.5px; line-height: 1.35; word-break: break-word; }
.time-cell { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============ 场次切换（后台顶部） ============ */
.stage-tabs {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.stage-tab {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 999px;
  padding: 7px 16px 7px 13px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.stage-tab:hover { border-color: var(--border-strong); }
.stage-tab:active { transform: translateY(1px); }
.stage-tab .st-flag {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, .12);
}
.stage-tab .st-name { font-size: 14px; font-weight: 700; color: var(--text); }
.stage-tab .st-num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-tab .st-num b { color: var(--text); font-size: 14px; }
.stage-tab .st-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--ok); background: var(--ok-bg); border-radius: 999px; padding: 2px 7px;
}
.stage-tab.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 57, 91, .10); }
.stage-tab.active .st-flag { box-shadow: 0 0 0 3px rgba(21, 128, 61, .22); }
.stage-tab.closed .st-flag { background: var(--faint); box-shadow: 0 0 0 3px rgba(148, 163, 184, .16); }
.stage-tab.closed .st-tag { color: var(--warn); background: var(--warn-bg); }
.stage-tab.closed .st-name { color: var(--muted); }
.stage-hint { font-size: 12px; color: var(--faint); margin-left: 2px; }

/* 二维码卡片上的场次标签 */
.qr-stage-tag {
  font-size: 12px; font-weight: 700; color: var(--brand);
  background: #f1f5f9; border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 12px; margin-bottom: 10px;
}

/* ============ 设置弹窗里的场次配置块 ============ */
#stageCfgList { display: flex; flex-direction: column; gap: 12px; }
.stage-cfg {
  border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px;
  background: #fbfcfd;
}
.stage-cfg .sc-row { display: flex; align-items: center; gap: 10px; }
.stage-cfg .sc-id {
  font-size: 12px; font-weight: 700; color: var(--brand); background: #eef2f7;
  border-radius: 6px; padding: 4px 8px; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.stage-cfg .sc-name { flex: 1; min-width: 0; height: 40px; font-weight: 600; }
.stage-cfg .sc-open-txt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stage-cfg .sc-sub { margin-top: 9px; height: 40px; }
.stage-cfg .sc-tip {
  margin-top: 8px; font-size: 11.5px; color: var(--faint); line-height: 1.6;
  word-break: break-all;
}

@media (max-width: 640px) {
  .stage-tabs { gap: 8px; }
  .stage-tab { padding: 6px 12px 6px 10px; }
  .stage-tab .st-tag, .stage-hint { display: none; }
  .stage-cfg .sc-row { flex-wrap: wrap; }
  .stage-cfg .sc-name { flex-basis: 100%; order: 3; }
}
