﻿/* ===== 百优体育 · 考勤销课系统 - 视觉对齐主系统（css/style.css） ===== */
:root {
  /* 主色系 - Logo 深蓝 #003090 */
  --blue-700: #002080;
  --blue-600: #003090;
  --blue-500: #1A40A0;
  --blue-50:  #EFF4FC;

  /* 重点色 - Logo 橙 #F06000 */
  --orange-600: #E05500;
  --orange-500: #F06000;
  --orange-50:  #FFF5F0;

  /* 收支/状态色 */
  --emerald-600: #059669;
  --emerald-50:  #ECFDF5;
  --rose-600: #E11D48;
  --rose-50:  #FFF1F2;
  --amber: #D97706;

  /* 中性色 */
  --bg: #F5F7FA;
  --white: #FFFFFF;
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;

  /* 兼容别名（考勤子系统沿用） */
  --blue: var(--blue-600);
  --blue-dark: var(--blue-700);
  --orange: var(--orange-500);
  --green: var(--emerald-600);
  --red: var(--rose-600);
  --card: #fff;
  --line: var(--gray-200);
  --text: var(--gray-700);
  --muted: var(--gray-500);
  --soft: var(--blue-50);

  /* 圆角 / 阴影 */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --sidebar-w: 200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* 2026-08-19 v2: 兜底 HTML5 hidden 属性，防止任何 CSS reset 让 hidden 元素可见 */
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--blue-600);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  flex-shrink: 0;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.brand {
  min-height: 70px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.brand strong { display: block; font-size: 16px; line-height: 1.2; letter-spacing: .3px; white-space: nowrap; }
.brand span { display: none; }

nav { padding: 14px 8px; display: grid; gap: 2px; }
.nav-btn {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.85);
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all .15s ease;
  user-select: none;
  position: relative;
}
.nav-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-btn.active { background: var(--blue-700); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--orange-500); }
.side-note { margin-top: auto; padding: 14px 18px; color: rgba(255,255,255,.65); font-size: 11px; border-top: 1px solid rgba(255,255,255,.08); line-height: 1.7; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); min-height: 100vh; height: 100vh; overflow: auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.topbar h1 { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: var(--gray-800); letter-spacing: -.2px; }
.topbar p { margin: 0; color: var(--muted); font-size: 13px; }
.top-actions, .inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.page { display: none; padding: 20px 24px 40px; }
.page.active { display: block; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat, .card {
  background: var(--card);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat { padding: 18px 20px; }
.stat span { display: block; color: var(--muted); margin-bottom: 8px; font-weight: 500; font-size: 13px; }
.stat strong { font-size: 26px; color: var(--blue-600); letter-spacing: -.5px; font-weight: 700; }
.card { overflow: hidden; margin-bottom: 16px; }
.card-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--gray-800); }

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-weight: 500;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  transition: all .15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn.primary { background: var(--blue-600); color: #fff; }
.btn.primary:hover { background: var(--blue-700); }
.btn.secondary { background: var(--orange-500); color: #fff; }
.btn.secondary:hover { background: var(--orange-600); }
.btn.ghost { border-color: var(--gray-300); background: #fff; color: var(--blue-600); }
.btn.ghost:hover { background: var(--blue-50); }
.btn.big { width: 100%; margin-top: 16px; padding: 14px; font-size: 17px; font-weight: 600; }
.file-btn input { display: none; }

.toolbar { padding: 14px 18px; border-bottom: 1px solid var(--gray-200); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
input, select, textarea {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  background: #fff;
  min-height: 38px;
  font-family: var(--font);
  color: var(--gray-700);
  font-size: 14px;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-50); }
textarea { resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--gray-100); text-align: left; vertical-align: middle; }
th { background: var(--gray-50); color: var(--gray-500); font-weight: 600; white-space: nowrap; font-size: 12px; }
td { color: var(--gray-700); }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }
.empty { text-align: center; color: var(--muted); padding: 34px; font-size: 14px; }

.tag { display: inline-flex; padding: 3px 10px; border-radius: 12px; font-weight: 600; font-size: 12px; }
.tag.green { background: var(--emerald-50); color: var(--emerald-600); }
.tag.red { background: var(--rose-50); color: var(--rose-600); }
.tag.amber { background: var(--orange-50); color: var(--orange-600); }
.tag.blue { background: var(--blue-50); color: var(--blue-600); }

.camera-layout { display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(360px, .8fr); gap: 16px; align-items: start; }
.video-box {
  position: relative;
  margin: 18px;
  background: #0c1a2f;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
}
video, #snapshotCanvas { width: 100%; height: 100%; object-fit: cover; display: block; }
#snapshotCanvas { display: none; }
.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aab8ce;
  font-weight: 700;
}
.snapshot-strip { display: flex; gap: 12px; align-items: center; padding: 0 18px 18px; }
.snapshot-strip img {
  width: 120px;
  height: 76px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  display: none;
}

.form-grid { padding: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.student-summary {
  margin: 0 18px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  border: 1px solid var(--gray-200);
  color: var(--muted);
  line-height: 1.8;
}
.hint { color: var(--muted); padding: 0 18px 18px; margin: 10px 0 0; font-size: 13px; }

.chips { padding: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 999px; background: var(--blue-50); color: var(--blue-600); font-weight: 600; }
.chip button { border: 0; background: transparent; color: var(--rose-600); font-weight: 900; }
.add-line { padding: 0 18px 18px; display: flex; gap: 10px; }
.add-line input { flex: 1; }

dialog { border: 0; border-radius: 12px; padding: 0; box-shadow: var(--shadow-lg); max-width: 920px; width: calc(100% - 40px); }
dialog::backdrop { background: rgba(6, 22, 45, .45); }
.dialog-card { background: #fff; padding: 20px; }
.dialog-card h2 { margin: 0 0 10px; font-size: 16px; color: var(--gray-800); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 12px; }
.photo-dialog img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius-sm); background: #111; }

#toast {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 1000;
  display: grid;
  gap: 10px;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.toast.ok { background: var(--emerald-600); }
.toast.err { background: var(--rose-600); }
.toast.info { background: var(--blue-600); }

@media (max-width: 1100px) {
  body { display: block; }
  .sidebar { width: 100%; min-height: auto; position: static; height: auto; }
  .brand { height: auto; }
  nav { grid-template-columns: repeat(3, 1fr); }
  .main { margin-left: 0; height: auto; min-height: auto; }
  .stats-grid, .grid.two, .camera-layout { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
}

@media print {
  .sidebar, .topbar, .toolbar, .inline-actions, .btn { display: none !important; }
  .main { height: auto; overflow: visible; margin-left: 0; }
  .page { display: none; padding: 0; }
  #page-records { display: block; }
  .card { box-shadow: none; border: 0; }
}


.face-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}
.face-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--blue-50);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.face-card span { font-weight: 700; color: var(--blue-600); }
.face-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  display: none;
}
.face-card small { color: var(--muted); }
.student-photo-editor {
  margin: 14px 18px 0;
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--blue-50);
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
}
.student-photo-editor img, .student-photo-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: var(--gray-50);
}
.student-photo-editor img { width: 96px; height: 96px; display: none; }
.student-photo-editor p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.student-photo-empty {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.verify-ok { background: var(--emerald-50); color: var(--emerald-600); }
.verify-warn { background: var(--orange-50); color: var(--orange-600); }


.version-banner {
  margin-bottom: 18px;
  padding: 12px 20px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--blue-700), var(--blue-500));
  color: #fff;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,48,144,0.15);
  font-size: 13px;
}
.version-banner strong {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  background: var(--orange-500);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.version-banner span {
  line-height: 1.6;
}


.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-600);
  font-weight: 600;
  font-size: 13px;
}
.section-body { padding: 18px; }
.form-grid.flat { padding: 0; }
.hint-line { margin: 0 0 10px; color: var(--muted); line-height: 1.8; }
.login-dialog::backdrop { background: rgba(6, 22, 45, .65); }
.locked { opacity: .48; pointer-events: none; }
.role-pill { display:inline-flex; padding: 4px 9px; border-radius:999px; background:var(--blue-50); color:var(--blue-600); font-weight:600; font-size:12px; }


.login-panel {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6, 22, 45, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.login-panel .dialog-card {
  width: min(520px, 100%);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
}


.schedule-note {
  padding: 14px 18px;
  color: var(--muted);
  border-bottom: 1px solid var(--gray-200);
  line-height: 1.7;
}
.schedule-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(7, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.schedule-day {
  min-width: 180px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--blue-50);
  overflow: hidden;
}
.schedule-day h3 {
  margin: 0;
  padding: 12px;
  background: var(--blue-600);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.schedule-list {
  min-height: 180px;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.schedule-item {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}
.schedule-time { color: var(--blue-600); font-weight: 700; }
.schedule-student { font-weight: 700; color: var(--gray-800); }
.schedule-meta { color: var(--muted); font-size: 13px; line-height: 1.5; }
.schedule-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.schedule-actions .btn { padding: 5px 8px; font-size: 12px; }
.schedule-empty { color: var(--muted); text-align: center; padding: 26px 8px; font-weight: 700; }
.schedule-dialog-hint { padding: 0 18px; }

@media (max-width: 1100px) {
  .brand { justify-content: flex-start; }
  .schedule-grid { grid-template-columns: repeat(7, minmax(170px, 1fr)); }
}


.student-schedule-panel {
  margin: 0 18px 8px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--blue-50);
  overflow: hidden;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 0;
  color: var(--blue-600);
  font-weight: 700;
}
.check-row input { min-height: 0; width: 18px; height: 18px; }
.form-grid.compact { padding: 14px 16px 16px; }

@media (max-width: 760px) {
  .brand img { width: 36px; height: 36px; }
  .brand strong { font-size: 16px; }

  /* 登录/弹窗：单列布局，防止输入框跑出屏幕 */
  .login-panel { padding: 14px; align-items: flex-start; overflow-y: auto; }
  .login-panel .dialog-card {
    width: calc(100% - 4px);
    max-height: 92vh;
    overflow-y: auto;
    margin: auto 0;
  }
  .form-grid { grid-template-columns: 1fr !important; padding: 14px; }
  .form-grid.flat { padding: 0 0 4px; }
  .hint-line { font-size: 12px; line-height: 1.7; }
  .dialog-card { padding: 16px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .btn { flex: 1; min-width: 0; }
}


.stat-link { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.stat-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pulse-card { animation: pulseCard 1.1s ease; }
@keyframes pulseCard {
  0%, 100% { box-shadow: var(--shadow); }
  35% { box-shadow: 0 0 0 4px rgba(240,96,0,.22), var(--shadow-md); }
}
.toolbar label, .inline-actions label { color: var(--muted); font-weight: 600; display: grid; gap: 4px; font-size: 13px; }
.inline-actions label input { min-width: 150px; }

.dashboard-detail-card { margin-top: 18px; }
.stat-link.selected { box-shadow: inset 0 0 0 2px var(--orange-500), var(--shadow-md); }

.auto-check-panel {
  margin: 0 18px 18px;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  display: grid;
  gap: 4px;
  line-height: 1.6;
}
.auto-check-panel strong { color: var(--blue-700); }
.auto-check-panel.running { border-color: var(--gray-300); background: var(--bg); }
.auto-check-panel.ok { border-color: #b8efd4; background: var(--emerald-50); color: #0f7b45; }
.auto-check-panel.warn { border-color: #ffd79b; background: var(--orange-50); color: var(--orange-600); }

/* ===== 统计卡明细弹窗（2026-09-19 补齐，与总部 style.css 标准一致） ===== */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(31,41,55,0.4); z-index:1000; justify-content:center; align-items:flex-start; padding-top:60px; }
.modal-overlay.show { display:flex; }
.modal { background:#fff; border-radius:12px; width:540px; max-width:92vw; max-height:85vh; overflow-y:auto; box-shadow:0 20px 50px rgba(0,0,0,0.25); }
.modal-header { padding:16px 20px; border-bottom:1px solid #e5e7eb; display:flex; justify-content:space-between; align-items:center; }
.modal-header h3 { font-size:16px; font-weight:700; color:#1f2937; margin:0; }
.modal-close { background:none; border:none; font-size:20px; cursor:pointer; color:#9ca3af; line-height:1; width:28px; height:28px; border-radius:6px; display:flex; align-items:center; justify-content:center; transition:all .15s; }
.modal-close:hover { color:#374151; background:#f3f4f6; }
.modal-body { padding:20px; }
