/* ==================== 全局 ==================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 12px;
}

/* ==================== 顶部标题栏 ==================== */
.header {
  width: 100%; max-width: 480px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.header h1 { font-size: 20px; }
.logout-link { color: #6b7280; font-size: 13px; text-decoration: none; }

/* ==================== 模式切换 ==================== */
.tabs {
  display: flex; gap: 8px;
  width: 100%; max-width: 480px;
  margin-bottom: 12px;
}
.tab {
  flex: 1; padding: 10px 0;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: transparent; color: #9ca3af;
  font-size: 14px; cursor: pointer;
}
.tab.active {
  background: #f59e0b; color: #1a1a2e;
  border-color: #f59e0b; font-weight: 600;
}

/* ==================== 视频/图片显示区 ==================== */
.video-wrap { position: relative; width: 100%; max-width: 480px; }
.video-wrap canvas {
  width: 100%; height: auto;
  display: block;
  background: #000;
  border-radius: 8px;
}
#video { display: none; } /* 原始视频隐藏，仅用 canvas 显示画面+检测框 */

/* ==================== 控制按钮 ==================== */
.controls {
  display: flex; gap: 10px;
  width: 100%; max-width: 480px;
  margin-top: 14px;
}
button {
  flex: 1;
  padding: 12px 0;
  border: none; border-radius: 8px;
  font-size: 16px; color: #fff; cursor: pointer;
}
#startBtn  { background: #22c55e; }
#stopBtn   { background: #ef4444; }
#uploadBtn { background: #3b82f6; }
#albumBtn  { background: #8b5cf6; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ==================== 信息行 ==================== */
.row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 480px;
  margin-top: 10px; font-size: 14px;
}
input[type=range] { flex: 1; margin: 0 10px; accent-color: #22c55e; }
.status { color: #9ca3af; }

/* ==================== 登录页 ==================== */
.login-body {
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 16px;
}
.login-card {
  width: 100%; max-width: 360px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  margin: auto;
}
.login-logo { font-size: 52px; line-height: 1; }
.login-card h1 { font-size: 20px; margin: 14px 0 4px; }
.login-sub { color: #9ca3af; font-size: 13px; margin-bottom: 24px; }
.login-card input[type=password] {
  width: 100%; padding: 12px 14px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3); color: #fff; font-size: 16px;
  outline: none; text-align: center; letter-spacing: 2px;
}
.login-card input[type=password]:focus { border-color: #f59e0b; }
.login-card button {
  width: 100%; margin-top: 14px; padding: 12px 0;
  border: none; border-radius: 8px;
  background: #f59e0b; color: #1a1a2e;
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.login-card button:active { transform: scale(0.98); }
.login-error { margin-top: 12px; color: #f87171; font-size: 13px; min-height: 18px; }
.login-tip { margin-top: 16px; color: #6b7280; font-size: 12px; }
