:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2329;
  --text-sub: #646a73;
  --primary: #3370ff;
  --primary-dark: #245bdb;
  --ok: #34a853;
  --late: #f54a45;
  --border: #e5e6eb;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 72px;
}

/* 顶部时钟 */
.topbar {
  padding: 28px 20px 16px;
  text-align: center;
}
.clock {
  font-size: 44px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.date-line {
  margin-top: 6px;
  color: var(--text-sub);
  font-size: 14px;
}

.page { padding: 0 16px; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.card h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

/* 今日状态 */
.status-row {
  display: flex;
  gap: 12px;
}
.status-item {
  flex: 1;
  background: var(--bg);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.status-item .label { font-size: 13px; color: var(--text-sub); }
.status-item .time { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.status-item .none { font-size: 15px; color: var(--text-sub); }

.tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}
.tag-ok { background: #e6f4ea; color: var(--ok); }
.tag-late { background: #fdeceb; color: var(--late); }

/* 摄像头 */
.camera-placeholder {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-sub);
}
.camera-placeholder p { margin-bottom: 16px; font-size: 15px; }

.camera-live video,
.camera-preview img {
  width: 100%;
  border-radius: 10px;
  display: block;
  background: #000;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.camera-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}
.camera-actions .btn { flex: 1; }

.note-input {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.note-input:focus { border-color: var(--primary); }

.late-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--late);
}

.error-text { color: var(--late); }

/* 按钮 */
.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn-danger { background: #fdeceb; color: var(--late); width: 100%; margin-top: 14px; }

/* 日历 */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cal-header h2 { margin: 0; }
.cal-header .btn { padding: 6px 14px; font-size: 18px; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-week span {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  padding: 6px 0;
}
.cal-cell {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  position: relative;
}
.cal-cell.blank { cursor: default; }
.cal-cell.today { outline: 1.5px solid var(--primary); }
.cal-cell.full { background: #e6f4ea; color: var(--ok); font-weight: 600; }
.cal-cell.half { background: #fff7e0; color: #b88230; font-weight: 600; }
.cal-cell.late-dot::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--late);
}
.cal-cell.selected { outline: 2px solid var(--text); }
.cal-cell.holiday::before {
  content: "休";
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 10px;
  color: var(--late);
}
.cal-cell.makeup::before {
  content: "班";
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 10px;
  color: var(--text-sub);
}

/* 详情 */
.detail-block { margin-bottom: 14px; }
.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.detail-photo {
  width: 100%;
  border-radius: 10px;
  display: block;
}
.note { margin-top: 8px; font-size: 14px; color: var(--text-sub); }
.detail .none { color: var(--text-sub); }

/* 统计 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stat {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.stat-num { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 4px; font-size: 13px; color: var(--text-sub); }

.tip {
  font-size: 12px;
  color: var(--text-sub);
  padding: 0 4px;
  line-height: 1.6;
}

/* 底部导航 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 0;
  font-size: 15px;
  color: var(--text-sub);
  cursor: pointer;
}
.tabbar button.active { color: var(--primary); font-weight: 600; }

/* 登录 / 注册 */
.auth-page {
  padding: 60px 16px 0;
}
.auth-title {
  text-align: center;
  font-size: 24px;
  margin-bottom: 24px;
}
.auth-card { padding: 22px 18px; }
.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}
.auth-tabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-sub);
  cursor: pointer;
}
.auth-tabs button.active {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.auth-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
}
.auth-input:focus { border-color: var(--primary); }
.auth-error {
  color: var(--late);
  font-size: 13px;
  margin-bottom: 12px;
}
.auth-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
}
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.logout {
  color: var(--primary);
  font-size: 13px;
  margin-left: 8px;
  cursor: pointer;
}

/* 团队 */
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.member-row:last-of-type { border-bottom: none; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.me-badge {
  font-size: 11px;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 0 6px;
  margin-left: 6px;
  vertical-align: 1px;
}
.member-status { font-size: 13px; color: var(--text); }
.member-status .none { color: var(--text-sub); font-size: 13px; }
.dot-sep { margin: 0 6px; color: var(--text-sub); }

.reshoot {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* 日历成员筛选与人数角标 */
.member-filter {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 10px;
  background: var(--card);
  color: var(--text);
}
.count-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  border-radius: 999px;
  text-align: center;
  padding: 0 3px;
}
.member-detail {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.member-detail:first-of-type { border-top: none; padding-top: 0; }
.member-detail-name { font-size: 15px; margin-bottom: 8px; }
.detail-sub { margin-bottom: 12px; }

/* 统计页成员切换 */
.stats-tabs { margin-bottom: 14px; }

/* 管理员删除成员按钮 */
.btn-del-member {
  flex-shrink: 0;
  border: none;
  background: #fdeceb;
  color: var(--late);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* 三段打卡状态 */
.status-row.three { gap: 8px; }
.status-row.three .status-item { padding: 10px; }
.status-row.three .time { font-size: 17px; }
.slot-stat { white-space: nowrap; }
.slot-stat + .slot-stat { margin-left: 8px; }
.late-mark {
  font-style: normal;
  font-size: 11px;
  color: var(--late);
  margin-left: 2px;
}
.member-status i.none { font-style: normal; color: var(--text-sub); }

/* 仪表盘表单 */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.form-row label { font-size: 14px; color: var(--text); flex-shrink: 0; }
.form-input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  outline: none;
  max-width: 180px;
}
.form-input:focus { border-color: var(--primary); }
.form-check { width: 20px; height: 20px; accent-color: var(--primary); }
.dt-tabs { margin-bottom: 14px; }

/* 团队概览 */
.overview-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.overview-row:last-of-type { border-bottom: none; }
.overview-name { flex: 1; font-weight: 500; }
.overview-stat { color: var(--text-sub); margin-left: 14px; }
.overview-stat.late-text, .late-text { color: var(--late); }

/* 轻提示 */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 99;
  white-space: nowrap;
}
