/* ==========================================================================
   班牌端大屏：按 1600×900 设计稿绘制，运行时由 JS 等比缩放
   对应方案 7.1 —— 21.5 寸 1920×1080，Android 7.1 轻量 App（此处为 Web 全屏降级实现）
   ========================================================================== */
.board-viewport {
  position: relative; width: 100%; height: calc(100vh - 60px); min-height: 560px;
  background: #071726; overflow: hidden; display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}
.board-viewport.kiosk { height: 100vh; border-radius: 0; }
body.board-mode .board-viewport { height: 100vh; border-radius: 0; }
body.board-mode #content { overflow: hidden; }
body.kiosk-mode .board-hud { display: none; }
/* 大屏模式下把全局提示挪到左下角，避免遮挡右上角时钟与状态区 */
body.board-mode #toastHost { right: auto; left: 22px; top: auto; bottom: 72px; }
body.kiosk-mode #toastHost { bottom: 22px; }
.board-stage {
  position: absolute; left: 0; top: 0; width: 1600px; height: 900px;
  transform-origin: top left; overflow: hidden; color: #eaf6ff;
  background: radial-gradient(1200px 700px at 18% -10%, #17435c 0%, transparent 60%),
              radial-gradient(900px 600px at 100% 110%, #0d3a4a 0%, transparent 60%),
              linear-gradient(160deg, #071b2c 0%, #0a2336 55%, #081b2b 100%);
  font-family: var(--font);
}
.board-stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
}
.board-stage::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #19e0c0, #2f8bff, transparent); opacity: .85;
}
.bd-inner { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; padding: 26px 34px 24px; }

/* ---------- 顶栏 ---------- */
.bd-header { display: flex; align-items: center; justify-content: space-between; height: 74px; flex: none; border-bottom: 1px solid rgba(255,255,255,.1); }
.bd-brand { display: flex; align-items: center; gap: 14px; }
.bd-logo {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16c9ae, #2f8bff); font-weight: 800; font-size: 20px; color: #fff;
  box-shadow: 0 6px 22px rgba(22,201,174,.3);
}
.bd-school { font-size: 15px; color: #8fb4cc; letter-spacing: 2px; }
.bd-class { font-size: 28px; font-weight: 750; letter-spacing: 1px; line-height: 1.15; }
.bd-head-right { display: flex; align-items: center; gap: 22px; }
.bd-time { text-align: right; }
.bd-time .t { font-size: 34px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bd-time .d { font-size: 13px; color: #8fb4cc; letter-spacing: 1px; }
.bd-privacy {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 20px;
  background: rgba(22,201,174,.12); border: 1px solid rgba(22,201,174,.35); font-size: 13px; color: #6fe6cf;
}
.bd-status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #9fc2d6; }

/* ---------- 主区三栏 ---------- */
.bd-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 330px 1fr 330px; gap: 22px; padding-top: 22px; }
.bd-col { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.bd-panel {
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; padding: 18px 20px; backdrop-filter: blur(6px); min-height: 0;
}
.bd-panel.grow { flex: 1; overflow: hidden; }
.bd-panel-title { font-size: 15px; font-weight: 650; color: #b7d6e8; display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.bd-panel-title::before { content: ''; width: 4px; height: 15px; border-radius: 3px; background: #19e0c0; }
.bd-panel-title .more { margin-left: auto; font-size: 12px; color: #6f9ab4; font-weight: 400; }

/* 今日数据 */
.bd-metric { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,.09); }
.bd-metric:last-child { border-bottom: none; }
.bd-metric .k { flex: 1; font-size: 14px; color: #9dc0d4; }
.bd-metric .v { font-size: 25px; font-weight: 750; color: #fff; font-variant-numeric: tabular-nums; }
.bd-metric .u { font-size: 12px; color: #7fa6bd; }

/* 排行榜 */
.bd-rank { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(255,255,255,.08); font-size: 14px; }
.bd-rank:last-child { border-bottom: none; }
.bd-rank .no { width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.09); font-size: 12px; font-weight: 700; flex: none; }
.bd-rank.me { background: rgba(22,201,174,.14); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.bd-rank .no.gold { background: #ffb93e; color: #4a3000; }
.bd-rank .no.silver { background: #c6d6e2; color: #22384a; }
.bd-rank .no.bronze { background: #d99667; color: #40210b; }
.bd-rank .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-rank .vl { font-weight: 700; color: #5ce6c8; font-variant-numeric: tabular-nums; }

/* 任务 / 示范 */
.bd-task { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,.08); }
.bd-task:last-child { border-bottom: none; }
.bd-task .ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(47,139,255,.18); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.bd-task .tx { flex: 1; min-width: 0; }
.bd-task .t1 { font-size: 14px; font-weight: 600; }
.bd-task .t2 { font-size: 12px; color: #83a9c0; }
.bd-mini-progress { height: 5px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 6px; }
.bd-mini-progress i { display: block; height: 100%; background: linear-gradient(90deg, #19e0c0, #2f8bff); border-radius: 4px; }

/* ---------- 中央舞台 ---------- */
.bd-center {
  position: relative; border-radius: 18px; overflow: hidden; min-height: 0;
  background: linear-gradient(150deg, rgba(20,68,92,.55), rgba(8,30,46,.7));
  border: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column;
}
.bd-center::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 300px at 50% 20%, rgba(25,224,192,.12), transparent 70%);
}
.bd-scene { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 20px; text-align: center; }
.bd-eyebrow { font-size: 15px; letter-spacing: 3px; color: #6fe6cf; margin-bottom: 12px; }
.bd-h1 { font-size: 48px; font-weight: 800; letter-spacing: 2px; line-height: 1.25; margin: 0 0 12px; }
.bd-h2 { font-size: 30px; font-weight: 700; margin: 0 0 10px; }
.bd-desc { font-size: 16px; color: #9dc0d4; max-width: 620px; line-height: 1.8; }
.bd-hint { font-size: 14px; color: #7fa6bd; margin-top: 18px; }

/* NFC 刷卡视觉 */
.nfc-card {
  width: 250px; height: 156px; border-radius: 18px; margin: 26px auto 20px;
  background: linear-gradient(135deg, #126e8f, #0c3c68); border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 18px 50px rgba(0,0,0,.35); position: relative; display: flex;
  align-items: center; justify-content: center; flex-direction: column; gap: 6px;
}
.nfc-card .wave { font-size: 42px; color: #6fe6cf; animation: nfcPulse 1.6s infinite; }
.nfc-card .ct { font-size: 13px; color: #b9d8e8; letter-spacing: 1px; }
@keyframes nfcPulse { 0%,100% { opacity: .55; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.08); } }
.nfc-ring { position: absolute; width: 300px; height: 300px; border: 2px solid rgba(25,224,192,.22); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%,-50%); animation: ring 2.2s ease-out infinite; }
@keyframes ring { 0% { transform: translate(-50%,-50%) scale(.6); opacity: .8; } 100% { transform: translate(-50%,-50%) scale(1.35); opacity: 0; } }

/* 项目选择网格 */
.bd-projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; max-width: 700px; margin: 8px auto 0; }
.bd-project {
  border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 16px 10px;
  background: rgba(255,255,255,.05); transition: .18s; text-align: center; color: #eaf6ff;
}
.bd-project:hover { background: rgba(25,224,192,.16); border-color: #19e0c0; transform: translateY(-3px); }
.bd-project.disabled { opacity: .35; pointer-events: none; }
.bd-project .pi { font-size: 30px; display: block; margin-bottom: 6px; }
.bd-project .pn { font-size: 17px; font-weight: 700; }
.bd-project .pm { font-size: 11.5px; color: #8fb4cc; margin-top: 3px; }

/* 倒计时 */
.bd-count { font-size: 180px; font-weight: 800; line-height: 1; color: #fff; text-shadow: 0 0 60px rgba(25,224,192,.55); font-variant-numeric: tabular-nums; animation: countPop .9s ease-out; }
@keyframes countPop { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 运动进行中 */
.bd-run { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; position: relative; }
.bd-run-top { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.bd-run-name { font-size: 20px; font-weight: 700; }
.bd-counter { font-size: 132px; font-weight: 800; line-height: 1.05; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -3px; text-shadow: 0 0 50px rgba(25,224,192,.4); }
.bd-counter small { font-size: 26px; font-weight: 600; color: #6fe6cf; letter-spacing: 0; }
.bd-run-sub { font-size: 16px; color: #9dc0d4; }
.bd-run-timer { font-size: 22px; font-weight: 700; color: #ffb45e; font-variant-numeric: tabular-nums; }
.bd-skeleton-box {
  position: absolute; right: 24px; top: 14px; width: 186px; height: 230px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(3,20,32,.5); overflow: hidden;
}
.bd-skeleton-box .cap { position: absolute; top: 8px; left: 10px; font-size: 11px; color: #6fe6cf; letter-spacing: 1px; }
.bd-scanline { position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(25,224,192,.7), transparent); animation: scan 2.4s linear infinite; }
@keyframes scan { 0% { top: 0; } 100% { top: 100%; } }
.bd-live-stats { display: flex; gap: 26px; margin-top: 14px; }
.bd-live-stat { text-align: center; }
.bd-live-stat .k { font-size: 11.5px; color: #7fa6bd; letter-spacing: 1px; }
.bd-live-stat .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-run-actions { margin-top: 18px; display: flex; gap: 12px; }
.bd-btn {
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #eaf6ff;
  border-radius: 10px; padding: 10px 24px; font-size: 15px; font-weight: 650; transition: .16s;
}
.bd-btn:hover { background: rgba(255,255,255,.16); }
.bd-btn.primary { background: linear-gradient(135deg, #14b79f, #1f8ce6); border-color: transparent; }
.bd-btn.primary:hover { filter: brightness(1.12); }
.bd-btn.ghost { background: transparent; }
.bd-tipbar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-size: 13px; color: #8fb4cc; background: rgba(3,20,32,.55); border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 7px 18px; white-space: nowrap;
}

/* 成绩页 */
.bd-result-score { font-size: 138px; font-weight: 800; line-height: 1; color: #5ce6c8; font-variant-numeric: tabular-nums; text-shadow: 0 0 60px rgba(25,224,192,.4); }
.bd-result-score small { font-size: 28px; color: #cfeaf5; }
.bd-grade { display: inline-block; padding: 6px 20px; border-radius: 20px; background: rgba(255,180,94,.16); border: 1px solid rgba(255,180,94,.4); color: #ffc477; font-size: 17px; font-weight: 700; margin-top: 4px; }
.bd-result-grid { display: flex; gap: 34px; margin-top: 26px; }
.bd-result-item { text-align: center; min-width: 118px; }
.bd-result-item .k { font-size: 13px; color: #8fb4cc; }
.bd-result-item .v { font-size: 25px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.bd-new-record { color: #ffc477; font-size: 15px; margin-top: 12px; }

/* 等待排队 */
.bd-queue { margin-top: 16px; font-size: 15px; color: #ffb45e; }

/* 底部栏 */
.bd-footer { height: 42px; flex: none; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.09); margin-top: 18px; padding-top: 12px; font-size: 12.5px; color: #759bb2; }
.bd-footer .badges { display: flex; gap: 18px; }
.bd-footer b { color: #a9d3e5; font-weight: 600; }

/* 班牌端控制台（悬浮在舞台外，仅演示用） */
.board-hud {
  position: absolute; right: 16px; bottom: 16px; z-index: 5; display: flex; gap: 8px; align-items: center;
  background: rgba(9,28,43,.9); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 8px 10px;
  backdrop-filter: blur(8px);
}
.board-hud .hud-label { font-size: 11px; color: #8fb4cc; padding: 0 4px; }
.board-hud button {
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); color: #dff1fa;
  border-radius: 8px; padding: 6px 12px; font-size: 12px; transition: .15s;
}
.board-hud button:hover { background: rgba(25,224,192,.25); border-color: #19e0c0; }
.board-hud button.active { background: #19e0c0; color: #06202c; font-weight: 700; border-color: #19e0c0; }
.board-hud select { background: rgba(255,255,255,.07); color: #dff1fa; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.board-hud select option { color: #17263c; }

/* ==========================================================================
   刷脸识别（V2.1 身份核验双通道）
   取景框为纯 UI；真实摄像头画面只做本地预览，不上传、不截图、不保存
   ========================================================================== */
.bd-face-idle {
  position: relative; width: 320px; height: 208px; margin: 8px auto 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.bd-face-idle .fii-ring {
  position: absolute; width: 250px; height: 250px; border: 2px solid rgba(25,224,192,.22);
  border-radius: 50%; top: 38%; left: 50%; transform: translate(-50%,-50%);
  animation: ring 2.4s ease-out infinite; pointer-events: none;
}
.bd-face-idle .bd-face-portrait {
  width: 112px; height: 126px; position: relative; z-index: 1;
  filter: drop-shadow(0 0 18px rgba(25,224,192,.45));
}
.bd-face-idle .fii-label { font-size: 15px; color: #cfeaf5; margin-top: 8px; letter-spacing: 1px; z-index: 1; }
.bd-face-idle .fii-badge {
  margin-top: 8px; font-size: 11.5px; color: #6fe6cf; z-index: 1;
  background: rgba(22,201,174,.1); border: 1px solid rgba(22,201,174,.3);
  border-radius: 20px; padding: 5px 12px; display: flex; align-items: center; gap: 7px;
}

.bd-face-frame {
  position: relative; width: 360px; height: 250px; margin: 8px auto 4px;
  border: 2px solid rgba(25,224,192,.45); border-radius: 18px; overflow: hidden;
  background: radial-gradient(220px 160px at 50% 40%, rgba(25,224,192,.14), transparent 70%), rgba(3,20,32,.6);
  box-shadow: inset 0 0 40px rgba(0,0,0,.35); transition: border-color .25s, box-shadow .25s;
}
.bd-face-frame.ok { border-color: #19e0c0; box-shadow: 0 0 40px rgba(25,224,192,.3), inset 0 0 40px rgba(0,0,0,.3); }
.bd-face-frame.bad { border-color: #ff8d8d; }
.bd-face-frame.bad .fc { border-color: #ff8d8d; }
.bd-face-frame.bad .bd-face-portrait { opacity: .55; }
.bd-face-frame video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1); opacity: 0; z-index: 1; transition: opacity .25s;
}
.bd-face-frame video.on { opacity: .62; }
.bd-face-frame video.on ~ .bd-face-portrait { opacity: .28; }
.bd-face-frame .bd-face-portrait {
  position: absolute; width: 150px; height: 170px; left: 50%; top: 50%;
  transform: translate(-50%,-50%); z-index: 2; pointer-events: none;
}
.bd-face-frame .fc { position: absolute; width: 26px; height: 26px; border: 3px solid #19e0c0; z-index: 3; }
.bd-face-frame .fc.tl { left: 10px; top: 10px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.bd-face-frame .fc.tr { right: 10px; top: 10px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.bd-face-frame .fc.bl { left: 10px; bottom: 10px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.bd-face-frame .fc.br { right: 10px; bottom: 10px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.bd-face-scan {
  position: absolute; left: 0; right: 0; height: 2px; z-index: 4;
  background: linear-gradient(90deg, transparent, rgba(25,224,192,.9), transparent);
  animation: scan 2.2s linear infinite;
}
.bd-face-badge {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 5;
  font-size: 11.5px; letter-spacing: 1px; color: #6fe6cf; white-space: nowrap;
  background: rgba(3,20,32,.78); border: 1px solid rgba(25,224,192,.35);
  border-radius: 20px; padding: 5px 14px;
}
.bd-face-badge.ok { color: #a8ffe9; border-color: #19e0c0; background: rgba(14,120,100,.8); }
.bd-face-badge.bad { color: #ffc4c4; border-color: rgba(255,141,141,.65); background: rgba(120,32,42,.7); }

.bd-face-status { font-size: 15px; color: #cfeaf5; margin-top: 6px; min-height: 22px; }
.bd-face-metrics { display: flex; gap: 12px; margin-top: 8px; }
.bd-face-metrics .fm {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 6px 12px; min-width: 96px; text-align: center;
}
.bd-face-metrics .k { display: block; font-size: 11px; color: #7fa6bd; }
.bd-face-metrics .v { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-face-demo { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 11.5px; color: #7fa6bd; }
.bd-face-demo label { color: #9dc0d4; }
.bd-face-demo select {
  background: rgba(255,255,255,.07); color: #dff1fa; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 5px 8px; font-size: 12px;
}
.bd-face-demo select option { color: #17263c; }
.bd-face-actions { display: flex; gap: 12px; margin-top: 12px; }
.bd-face-actions .bd-btn { padding: 8px 18px; font-size: 14px; }
.bd-identity-tag { display: inline-block; margin: 0 0 10px; padding: 5px 16px; border-radius: 20px; font-size: 13px; }
.bd-identity-tag.face { background: rgba(22,201,174,.14); border: 1px solid rgba(22,201,174,.4); color: #6fe6cf; }
.bd-identity-tag.nfc { background: rgba(47,139,255,.14); border: 1px solid rgba(47,139,255,.4); color: #9cc8ff; }

/* 骨骼火柴人 */
.sk-joint { fill: #5ce6c8; }
.sk-line { stroke: #5ce6c8; stroke-width: 4; stroke-linecap: round; opacity: .85; }
.sk-body { transform-origin: 93px 110px; animation: skMove 1.1s ease-in-out infinite; }
@keyframes skMove { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
.sk-body.squat { animation: skSquat 1.4s ease-in-out infinite; }
@keyframes skSquat { 0%,100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(28px) scaleY(.72); } }
.sk-body.jumpjack { animation: skJack 1s ease-in-out infinite; }
@keyframes skJack { 0%,100% { transform: scaleX(.82); } 50% { transform: scaleX(1.18); } }
.sk-body.run { animation: skRun .55s ease-in-out infinite; }
@keyframes skRun { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }
.sk-body.plank { animation: none; transform: rotate(74deg) translate(20px, -10px); }
