.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.shell > * { min-width: 0; }
.brand {
  font-family: var(--serif);
  font-size: 1.8rem;
  margin: 0;
  letter-spacing: 0.04em;
}
.side {
  background: var(--ivy-deep);
  color: #f4efe4;
  padding: 1.25rem 1rem 2rem;
}
.nav-label { margin: 0.9rem 0.4rem 0.2rem; font-size: 0.75rem; letter-spacing: 0.08em; opacity: 0.7; }
.side a { color: #f4efe4; text-decoration: none; display: block; padding: 0.7rem 0.8rem; border-radius: 12px; }
a.card { color: inherit; text-decoration: none; display: block; }
.side a[aria-current="page"] { background: rgba(255, 253, 248, 0.14); }
.main { padding: 1.25rem; }
.top { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
h1, h2 { font-family: var(--serif); font-weight: 600; margin: 0 0 0.4rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.stat b { display: block; font-family: var(--serif); font-size: 1.8rem; }
.login-wrap { max-width: 28rem; margin: 8vh auto; padding: 1rem; }
.mark { width: 3rem; height: 3rem; border-radius: 50%; background: conic-gradient(from 120deg, var(--ivy), #d7e7cf, var(--clay), var(--ivy)); }
.main, .card { max-width: 100%; }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { padding-bottom: 0.5rem; }
  .side nav { display: flex; gap: 0.25rem; overflow-x: auto; max-width: 100%; }
  .side a { white-space: nowrap; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-wrap { margin-top: 2rem; }
}

.invite-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: rgba(0,0,0,0.05); padding: 0.15rem 0.4rem; border-radius: 6px; }
.month-wrap { overflow: auto; }
.month-grid { border-collapse: separate; border-spacing: 2px; width: max-content; min-width: 100%; font-size: 0.85rem; }
.month-grid th, .month-grid td { text-align: center; padding: 0.35rem 0.3rem; min-width: 1.8rem; }
.month-grid th:nth-child(1), .month-grid td:nth-child(1),
.month-grid th:nth-child(2), .month-grid td:nth-child(2) { position: sticky; left: 0; background: var(--paper, #fffdf8); z-index: 1; text-align: left; min-width: 3.5rem; }
.month-grid th:nth-child(2), .month-grid td:nth-child(2) { left: 3.5rem; min-width: 4.5rem; }
.day-present { background: #2f9e6b; color: #fff; cursor: pointer; border-radius: 6px; font-weight: 600; }
.day-present:hover, .day-present:focus { outline: 2px solid #1d6b48; outline-offset: 1px; }
.day-absent { background: transparent; color: transparent; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; }
.photo-card { margin: 0; }
.photo-card img { width: 100%; border-radius: 12px; display: block; background: #eee; min-height: 8rem; }
.file-btn { display: inline-flex; align-items: center; padding: 0.55rem 0.9rem; border-radius: 999px; cursor: pointer; }

.checkin-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 960px) { .checkin-layout { grid-template-columns: 1fr; } }
.invite-code { font-size: 0.95rem; }

#face-live, #face-preview, #admin-checkin-video {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0.75rem 0;
  border-radius: 12px;
  background: #111;
  min-height: 220px;
  object-fit: cover;
}
#face-live[hidden], #face-preview[hidden] { display: none !important; }

.face-prompt {
  font-size: 1.35rem;
  font-weight: 700;
  color: #07864f;
  margin: 0.6rem 0 0.8rem;
  min-height: 1.6em;
}
/* 仅预览镜像，抓帧上传仍用未翻转原图，以匹配用户自己的左/右 */
#face-live {
  transform: scaleX(-1);
}
