/* 远程监控系统 - 全局样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f4f7; color: #1f2937;
}
.hidden { display: none !important; }
.hint { color: #9ca3af; font-size: 12px; margin: 8px 0; }
.status { color: #9ca3af; font-size: 13px; }
.msg { margin-top: 12px; font-size: 13px; color: #16a34a; }
.msg.error { color: #dc2626; }

/* ---------- 按钮与输入 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border: 0; border-radius: 8px;
  font-size: 15px; cursor: pointer; background: #e5e7eb; color: #374151;
  transition: background .15s;
}
.btn.primary { background: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { background: transparent; }
.btn.small { font-size: 13px; padding: 6px 10px; }
.btn.danger { background: #fee2e2; color: #dc2626; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select {
  padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px;
  background: #fff; width: 100%;
}
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 160px; }

/* ---------- 登录页 ---------- */
.auth-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; padding: 16px; }
.auth-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 16px;
  padding: 28px; box-shadow: 0 8px 30px rgba(0,0,0,.08);
}
.auth-card h1 { font-size: 20px; text-align: center; margin-bottom: 18px; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; background: #f3f4f6; border-radius: 10px; padding: 4px; }
.tab { flex: 1; padding: 8px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 15px; }
.tab.active { background: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form .btn { margin-top: 4px; }

/* ---------- 教师端 ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 18px; flex: 1; }
.topbar select { max-width: 220px; }
.topbar .status { flex: 1; text-align: right; }
.watch-wrap { padding: 14px; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.video-stage {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000;
  border-radius: 12px; overflow: hidden;
}
.video-stage video { width: 100%; height: 100%; object-fit: contain; }
.placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #6b7280; font-size: 15px; text-align: center; line-height: 1.8;
}
.self-video {
  position: absolute; right: 12px; bottom: 12px; width: 120px; height: 68px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.3); object-fit: cover; background: #111;
}
.controls { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.chk input { width: auto; }
.btn.talk {
  width: 100%; max-width: 420px; height: 112px; border-radius: 20px;
  flex-direction: column; gap: 6px; background: #2563eb; color: #fff; font-size: 18px;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.btn.talk.active { background: #dc2626; transform: scale(.98); }
.talk-hint { font-size: 12px; opacity: .8; }

/* ---------- 管理端 ---------- */
.admin-wrap { padding: 16px; max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card h2 { font-size: 17px; margin-bottom: 12px; }
.card h3 { font-size: 15px; margin: 14px 0 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
th { color: #6b7280; font-weight: 500; }
.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .detail-cols { grid-template-columns: 1fr; } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 420px; }
.modal h3 { margin-bottom: 12px; }
.token-box {
  background: #0f172a; color: #7dd3fc; padding: 14px; border-radius: 10px;
  word-break: break-all; white-space: pre-wrap; font-size: 15px; margin-bottom: 14px;
}