/* 护工手卫生培训助手 —— 五月蓝 #005CBF 主色, 胡萝卜橙 #FF8822 强调 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 18px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #F2F6FC; color: #17263B;
  max-width: 520px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  -webkit-text-size-adjust: 100%;
}
/* 首页: 铺满一屏, 三个功能按钮平分剩余高度(任务书"各占约1/3屏高") */
body.home { min-height: 100vh; min-height: 100dvh; }
.home-main { display: flex; flex-direction: column; flex: 1; min-height: 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom)) !important; }
.home-btns { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; margin-top: 6px; }
.home-btn { flex: 1; margin: 0 !important; min-height: 76px; display: flex; align-items: center; justify-content: center; }
/* 顶栏 */
header {
  background: #005CBF; color: #fff; padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10;
}
header .back { font-size: 26px; text-decoration: none; color: #fff; padding: 4px 12px; }
header h1 { font-size: 24px; font-weight: 700; flex: 1; }
main { flex: 1; padding: 18px 16px calc(30px + env(safe-area-inset-bottom)); }

/* 首页 */
.hero { text-align: center; margin: 10px 0 22px; }
.hero .logo { width: 92px; height: 92px; border-radius: 22px; background: #fff; box-shadow: 0 4px 14px rgba(0,92,191,.18); object-fit: cover; }
.hero h2 { font-size: 30px; color: #005CBF; margin-top: 12px; }
.hero p { font-size: 19px; color: #5A6B84; margin-top: 6px; }

/* 方言选择 */
.dialect { margin: 4px 0 22px; }
.dialect .lab { font-size: 20px; color: #17263B; margin-bottom: 10px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-size: 20px; padding: 12px 18px; border-radius: 14px;
  border: 2px solid #005CBF; background: #fff; color: #005CBF; font-weight: 600;
}
.chip.on { background: #005CBF; color: #fff; }

/* 大按钮 */
.btn {
  display: block; width: 100%; border: none; border-radius: 18px;
  font-size: 26px; font-weight: 700; padding: 26px 20px; margin: 14px 0;
  background: #005CBF; color: #fff; text-align: center;
  box-shadow: 0 4px 12px rgba(0,92,191,.25);
}
.btn.orange { background: #FF8822; box-shadow: 0 4px 12px rgba(255,136,34,.3); }
.btn.ghost { background: #fff; color: #005CBF; border: 2px solid #005CBF; box-shadow: none; }
.btn.mini { font-size: 20px; padding: 14px 16px; border-radius: 14px; margin: 8px 0; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.row { display: flex; gap: 12px; }
.row .btn { margin: 10px 0; }

/* 学习卡 */
.card {
  background: #fff; border-radius: 20px; padding: 24px 20px;
  box-shadow: 0 4px 14px rgba(23,38,59,.08); margin: 14px 0;
}
.card .big { font-size: 34px; line-height: 1.55; font-weight: 600; }
.card .sub { font-size: 20px; color: #5A6B84; margin-bottom: 12px; }
.topic-list .btn { text-align: left; font-size: 24px; padding: 22px 20px; }
.count { font-size: 20px; color: #5A6B84; text-align: center; margin: 6px 0; }

/* 考核 */
.qtext { font-size: 32px; line-height: 1.5; font-weight: 700; margin: 6px 0 18px; }
.opt-btn { text-align: left; font-size: 24px; padding: 20px; }
.feedback { border-radius: 16px; padding: 18px; font-size: 26px; font-weight: 700; margin: 12px 0; }
.feedback.ok { background: #E4F4E6; color: #1B7F32; }
.feedback.bad { background: #FFF1E5; color: #C25E00; }
.score-ring { font-size: 64px; text-align: center; color: #005CBF; font-weight: 800; margin: 18px 0 6px; }

/* 判卷 */
.uploader { border: 3px dashed #005CBF; border-radius: 20px; padding: 34px 18px; text-align: center; background: #fff; }
.uploader p { font-size: 24px; color: #005CBF; font-weight: 700; line-height: 1.6; }
video.prev { width: 100%; border-radius: 14px; margin: 10px 0; background: #000; }
.spin { text-align: center; font-size: 26px; color: #005CBF; padding: 30px 0; }
.dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: #005CBF; margin: 0 6px; animation: b 1s infinite; }
.dot:nth-child(2) { animation-delay: .18s; } .dot:nth-child(3) { animation-delay: .36s; }
@keyframes b { 0%,80%,100% { transform: translateY(0);} 40% { transform: translateY(-14px);} }
.step-item { background: #fff; border-radius: 16px; padding: 16px; margin: 12px 0; border-left: 10px solid #1B7F32; }
.step-item.bad { border-left-color: #FF8822; }
.step-item .head { font-size: 26px; font-weight: 700; }
.step-item .head .tag-ok { color: #1B7F32; } .step-item .head .tag-bad { color: #C25E00; }
.step-item .reason { font-size: 22px; color: #42526B; margin-top: 8px; line-height: 1.5; }
.step-item video { width: 100%; border-radius: 12px; margin-top: 10px; background: #000; }
.hidden { display: none !important; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #17263B; color: #fff; font-size: 22px; padding: 14px 22px;
  border-radius: 14px; z-index: 99; max-width: 90%;
}

/* 网页摄像头取景(手部检测门禁) */
#camsec {
  position: fixed; inset: 0; z-index: 90; background: #000;
  display: flex; flex-direction: column;
}
#camv { flex: 1; width: 100%; object-fit: cover; background: #000; min-height: 0; }
.camtip {
  position: absolute; top: 12%; left: 50%; transform: translateX(-50%);
  width: 86%; max-width: 460px; text-align: center;
  background: rgba(23, 38, 59, .88); color: #fff;
  border: 3px solid #FF8822; border-radius: 18px; padding: 18px 16px; font-size: 26px;
}
.camtip .stat { font-size: 22px; color: #FFCB8E; margin-top: 10px; min-height: 28px; }
.cambar {
  display: flex; gap: 12px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: #0b1320;
}
.cambar .btn { flex: 1; margin: 0; }
.btn.red { background: #D93025; color: #fff; border-color: #D93025; }
#camGo[disabled] { opacity: .45; }

/* 触摸行为: 防双击缩放抖动, 按钮禁选中 */
.btn, .chip { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* 小屏适配(≤380px: iPhone SE一代/老安卓机) */
@media (max-width: 380px) {
  html { font-size: 16px; }
  .hero { margin: 4px 0 12px; }
  .hero .logo { width: 72px; height: 72px; }
  .hero h2 { font-size: 26px; }
  .dialect { margin: 2px 0 14px; }
  .chip { font-size: 18px; padding: 10px 14px; }
  .card .big { font-size: 28px; }
  .qtext { font-size: 27px; }
  .btn { font-size: 24px; }
  .home-btn { font-size: 26px; }
}
/* 矮屏(≤740px高): 压缩首页顶部, 保证三个按钮可用高度 */
@media (max-height: 740px) {
  .hero { margin: 2px 0 8px; }
  .hero .logo { width: 56px; height: 56px; }
  .hero h2 { font-size: 22px; }
  .hero p { display: none; }
  .dialect { margin: 2px 0 8px; }
  .chip { font-size: 16px; padding: 7px 12px; }
  .dialect .lab { font-size: 16px; margin-bottom: 6px; }
}
/* 横屏平板/桌面大屏: 首页按钮横排更顺 */
@media (orientation: landscape) and (min-width: 700px) {
  .home-btns { flex-direction: row; }
}
