* { margin: 0; padding: 0; box-sizing: border-box; }
:root { color-scheme: light; }
html, body { min-height: 100%; }
body {
  background: #F2F2F7;
  color: #1C1C1E;
  font-family: "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Inter", "Source Han Sans SC", sans-serif;
  font-size: 18px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, a, input, select { touch-action: manipulation; }
button, .btn { user-select: none; font-family: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #056EB6;
  outline-offset: 2px;
}
.phone { max-width: 640px; margin: 0 auto; min-height: 100vh; }
.top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 8px;
}
.lock { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lock.center { justify-content: center; }
.logo { height: 72px; width: auto; display: block; flex: none; }
.brand {
  font-size: 28px;
  font-weight: 800;
  color: #056EB6;
  letter-spacing: 2px;
  line-height: 1.1;
}
.back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 44px;
  padding: 0 4px;
  color: #056EB6;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  flex: none;
}
h1.page-title, .titlebar h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.titlebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 16px 4px;
}
.titlebar h1 { display: flex; align-items: center; }
.cls .bar, .class-card .bar {
  width: 6px;
  border-radius: 3px;
  flex: none;
  margin-right: 12px;
}
.titlebar .bar { height: 28px; }
.class-card .bar { height: 36px; margin-right: 0; }
.c5 .bar { background: #007AFF; }
.c6 .bar { background: #34C759; }
.c7 .bar { background: #FF9500; }
.c8 .bar { background: #7c5cd6; }
.card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.05);
}
.date-row, .records { padding: 8px 16px 20px; }
.date-row label, .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  color: #636366;
}
input[type="date"], input[type="text"], input[type="password"], select, .note {
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: #1C1C1E;
  min-height: 48px;
  width: 100%;
  border-radius: 14px;
  border: 1.5px solid #D1D1D6;
  background: #fff;
  padding: 0 14px;
}
.note { font-weight: 600; margin-top: 10px; }
.date-inline { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 800; color: #636366; }
.class-list { display: flex; flex-direction: column; gap: 14px; padding: 8px 16px 8px; }
.class-card {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 84px;
  padding: 16px 18px;
  gap: 14px;
  background: #fff;
  border: none;
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.05);
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.class-card:active { transform: scale(0.99); }
.cname { font-size: 24px; font-weight: 800; letter-spacing: 0.5px; }
.meta { margin-left: auto; color: #8E8E93; font-weight: 700; font-size: 16px; white-space: nowrap; }
.footer-actions { padding: 12px 16px 28px; }
.footer-actions .btn { width: 100%; }
.ft {
  text-align: center;
  color: #8E8E93;
  letter-spacing: 4px;
  font-weight: 600;
  font-size: 14px;
  margin: 22px 0 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary {
  background: #056EB6;
  color: #fff;
  width: 100%;
  min-height: 56px;
  font-size: 22px;
  letter-spacing: 2px;
  border-radius: 16px;
}
.btn.primary:active { background: #045a94; }
.btn.primary:disabled { opacity: 0.55; }
.btn.ghost {
  background: #fff;
  color: #056EB6;
  border: 1.5px solid #BFDDF0;
}
.btn.all {
  background: #fff;
  color: #1f8a3b;
  border: 1.5px solid #34C759;
  min-height: 44px;
  width: auto;
  font-size: 18px;
  letter-spacing: 0;
  border-radius: 14px;
}
.sticky-stats {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(242, 242, 247, 0.94);
  padding: 8px 0;
}
.stats { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 16px;
}
.pill b { font-size: 20px; margin-left: 4px; }
.pill.dao { color: #1f8a3b; background: #34C7591f; }
.pill.leave { color: #c45500; background: #FF95001f; }
.pill.abs { color: #d21b12; background: #FF3B301f; }
.pill.none { color: #636366; background: #E5E5EA; }
.quick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 4px;
}
.saved-top {
  margin-left: auto;
  color: #8E8E93;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}
.stu-list { padding-bottom: 8px; }
.stu { margin: 12px 16px; padding: 16px 16px 14px; }
.stu h2 { font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #8E8E93;
  background: #F2F2F7;
  border-radius: 999px;
  vertical-align: middle;
  letter-spacing: 0;
}
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
  border: 1.5px solid #E5E5EA;
  background: #F2F2F7;
  color: #1C1C1E;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.seg button.on[data-status="到"] { background: #34C759; color: #fff; border-color: #34C759; }
.seg button.on[data-status="请假"] { background: #FF9500; color: #fff; border-color: #FF9500; }
.seg button.on[data-status="缺勤"] { background: #FF3B30; color: #fff; border-color: #FF3B30; }
.pad-save { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
.savebar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(640px, 100%);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
}
.save-msg { text-align: center; font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.save-msg.ok { color: #1f8a3b; }
.save-msg.bad { color: #d21b12; }
body.booting .stu, body.booting #date, body.booting #all-dao, body.booting #save { pointer-events: none; }
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 16px 48px;
}
.login-card { padding: 28px 20px 22px; }
.login-card h1 {
  font-size: 32px;
  font-weight: 800;
  color: #056EB6;
  letter-spacing: 3px;
  line-height: 1.1;
}
.sub {
  color: #8E8E93;
  letter-spacing: 3px;
  font-weight: 700;
  margin-top: 6px;
}
.login-card form { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.login-card input {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.35em;
  min-height: 64px;
}
.error { color: #d21b12; font-weight: 800; font-size: 16px; }
.muted { color: #8E8E93; font-weight: 600; }
.filter { padding: 16px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; width: auto; min-height: 48px; font-size: 18px; letter-spacing: 0; }
.sec { font-size: 20px; font-weight: 800; margin: 18px 2px 10px; }
.day, .person { padding: 16px; margin-bottom: 12px; }
.day h3, .person h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; }
.count {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 16px;
}
.count.dao { color: #1f8a3b; background: #34C7591f; }
.count.leave { color: #c45500; background: #FF95001f; }
.count.abs { color: #d21b12; background: #FF3B301f; }
.details { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.details li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  font-size: 16px;
  font-weight: 650;
  padding-top: 8px;
  border-top: 1px solid #E5E5EA;
}
.st { font-weight: 800; }
.st-dao { color: #1f8a3b; }
.st-leave { color: #c45500; }
.st-abs { color: #d21b12; }
.dnote { color: #636366; font-weight: 600; }
.empty {
  background: #fff;
  border-radius: 22px;
  padding: 22px 16px;
  text-align: center;
  color: #8E8E93;
  font-weight: 700;
}
@media (hover: hover) {
  .class-card:hover { transform: translateY(-1px); }
}

/* fix date input overflow on narrow screens */
input[type="date"] { min-width: 0; width: 100%; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
label, .field, form > div { min-width: 0; }
