* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f5f6fa; color: #333; font-size: 14px; }

.hidden { display: none !important; }
.muted { color: #999; font-size: 13px; }
.primary { background: #2f6fed; color: #fff; border: none; }
.danger { background: #fdecea; color: #e03e2f; border: none; }

.boot-loading {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: #f5f6fa; color: #888; font-size: 15px;
}

button {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #d9dde5;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 13px;
}
button:hover { opacity: 0.88; }

input, select {
  padding: 8px 12px;
  border: 1px solid #d9dde5;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid #2f6fed55; }

.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: #333; color: #fff; padding: 10px 22px; border-radius: 20px;
  opacity: 0; transition: all .25s; z-index: 999; pointer-events: none; font-size: 14px;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: #e03e2f; }

.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2f9db0, #4c8cff);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px 44px; width: 380px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card .sub { color: #999; margin-bottom: 24px; font-size: 13px; }
.login-card input { width: 100%; margin-bottom: 14px; }
.login-card button { width: 100%; padding: 11px; font-size: 15px; border-radius: 10px; }
.login-card .msg { color: #e03e2f; margin-top: 12px; font-size: 13px; min-height: 18px; }
.login-card .foot-link { display: block; text-align: center; color: #2f6fed; margin-top: 16px; text-decoration: none; font-size: 13px; }

header {
  display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 20;
}
.brand { font-size: 17px; font-weight: 700; color: #2f9db0; white-space: nowrap; }
nav { display: flex; gap: 4px; flex: 1; }
nav a { padding: 8px 16px; border-radius: 8px; color: #555; cursor: pointer; text-decoration: none; }
nav a:hover { background: #f0f3fa; }
nav a.active { background: #2f9db0; color: #fff; }
.userbox { display: flex; align-items: center; gap: 12px; color: #666; }

main { padding: 20px 24px 60px; max-width: 900px; margin: 0 auto; }
h2 { margin-bottom: 16px; font-size: 20px; }

.card {
  background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #e8f0fe; color: #2f6fed; border-radius: 6px; padding: 2px 10px; font-size: 12px; }
.chip.green { background: #e6f7ec; color: #20a464; }
.chip.orange { background: #fff4e5; color: #e68a00; }
.chip.blue { background: #e8f0fe; color: #2f6fed; }
.pf-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; cursor: pointer; flex-shrink: 0; }
.pf-avatar.ph { display: inline-flex; align-items: center; justify-content: center; background: #f0f2f7; font-size: 24px; }
.profile-avatar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

.class-card.hot { border: 2px solid #2f9db0; }
.form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.adj-tip { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.adj-makeup { background: #fff4e5; color: #b45309; border: 1px solid #f6ddb0; }
.adj-stop { background: #fdecea; color: #c0392b; border: 1px solid #f6c2bc; }
.month { font-size: 16px; font-weight: 700; min-width: 100px; text-align: center; }

.head-card { background: #2f9db0; color: #fff; }
.head-card .muted { color: rgba(255,255,255,.85); }
.head-card button { border-color: rgba(255,255,255,.6); }

.stu-list { background: #fff; border-radius: 12px; padding: 0 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.gender-tabs { display: flex; gap: 10px; padding: 12px 14px 0; }
.gt { flex: 1; padding: 7px 0; border-radius: 8px; border: 1px solid #e3e6ec; background: #fff; color: #8a8f99; font-size: 13px; cursor: pointer; }
.gt.on { background: #2f9db0; color: #fff; border-color: #2f9db0; font-weight: 600; }
.seq { flex-shrink: 0; min-width: 20px; text-align: right; color: #b6bcc7; font-size: 12px; }
.stu-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; padding: 11px 0; border-bottom: 1px solid #f2f3f6; }
.stu-row:last-child { border-bottom: none; }
.stu-row.abnormal { background: #fff6f4; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.stu-info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.gender { width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; flex-shrink: 0; }
.gender.gm { background: #4c8cff; }
.gender.gf { background: #ff7a9e; }
.gender.gn { background: #c5cbd6; }
.stu-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 4em; }
.stu-name.gen-m { color: #2f6fed; }
.stu-name.gen-f { color: #e0557d; }
.stu-no { color: #b6bcc7; font-size: 12px; flex-shrink: 0; }
.seg { display: flex; gap: 6px; flex: 1 1 0; min-width: 0; }
.seg-btn { flex: 1 1 0; padding: 5px 0; text-align: center; border-radius: 8px; border: 1px solid #e3e6ec; background: #fff; color: #8a8f99; font-size: 13px; cursor: pointer; }
.seg-btn.on { color: #fff; font-weight: 600; border-color: transparent; }
.seg-btn.g.on { background: #20a464; }
.seg-btn.o.on { background: #e68a00; }
.seg-btn.r.on { background: #e03e2f; }
.seg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.acts { display: flex; gap: 6px; flex: 1 1 0; min-width: 0; }
.act-btn { flex: 1 1 0; padding: 5px 0; text-align: center; border-radius: 8px; border: 1px solid #b9c6de; background: #fff; color: #6b7a96; font-size: 13px; cursor: pointer; }
.act-btn.has { border-color: #2f9db0; color: #2f9db0; background: #eef7f8; font-weight: 600; }
.act-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.modal-box textarea { width: 100%; padding: 8px 12px; border: 1px solid #d9dde5; border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical; }
.rec-photo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rec-photo { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; cursor: pointer; }

.fab {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 28px));
  padding: 13px 0;
  border: none;
  border-radius: 26px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(47, 157, 176, 0.35);
  z-index: 60;
}

.dirty-hint {
  background: #fff4e5;
  color: #b45309;
  padding: 8px 14px;
  margin: 0 14px;
  border-radius: 8px;
  font-size: 13px;
}
.hist-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hist-chip { padding: 6px 14px; border-radius: 16px; border: 1px solid #e3e6ec; background: #fff; color: #666; font-size: 13px; cursor: pointer; }
.hist-chip.on { background: #2f9db0; color: #fff; border-color: #2f9db0; font-weight: 600; }
.wd-chip { display: inline-block; background: #e8f0fe; color: #2f9db0; border-radius: 4px; padding: 0 6px; font-size: 12px; margin-left: 4px; }
.weekgrid td { vertical-align: top; min-width: 108px; }
.grid-rec { display: block; width: 100%; border: none; background: #eef7f8; color: #2f9db0; border-radius: 8px; padding: 6px 4px; font-size: 12px; cursor: pointer; margin: 2px 0; }
.grid-rec b { display: block; }
.grid-rec span { color: #e03e2f; }
.grid-rec.todo { background: #fff4e5; color: #b45309; }
.grid-rec.todo span { color: #b45309; }
.grid-rec.done span.ok { color: #20a464; }
.chip.orange { background: #fff4e5; color: #e68a00; }
.thumb-photo { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; margin-top: 8px; cursor: pointer; }
.sec-label { font-weight: 600; margin: 10px 0 6px; color: #555; }
.all-ok { color: #20a464; font-size: 15px; margin: 12px 0; }
.privacy-tip { color: #bbb; font-size: 12px; margin: 10px 0; }
.att-extra-toggle { width: 100%; margin-top: 2px; }
.att-extra { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.att-extra .photo { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; }
.att-extra input[type="text"], .att-extra input:not([type="file"]) { flex: 1; min-width: 180px; }

.rec-row { cursor: default; }
.loading, .empty, .error { padding: 60px; text-align: center; color: #999; }
.error { color: #e03e2f; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; overflow: auto; padding: 60px 16px; }
.modal-box { background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 620px; max-height: 82vh; overflow: auto; }
.modal-box h3 { margin-top: 0; }
.rec-item { padding: 10px 0; border-bottom: 1px solid #f0f1f5; }
.rec-item.abnormal { border-left: 3px solid #e03e2f; padding-left: 10px; }
.rec-item .photo { width: 140px; height: 140px; object-fit: cover; border-radius: 8px; margin-top: 8px; cursor: pointer; }

/* 底部选项卡（微信式，手机端显示） */
.tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-top: 1px solid #e8e8e8;
  z-index: 50;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: #999;
  cursor: pointer;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item.active { color: #2f9db0; font-weight: 600; }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-icon svg { width: 22px; height: 22px; display: block; }

@media (max-width: 768px) {
  header { padding: 0 12px; height: 48px; gap: 8px; }
  .brand { font-size: 15px; }
  nav { display: none; }
  .userbox { display: none; }
  main { padding: 12px 12px 90px; }
  .tabbar { display: flex; }
  .login-view { padding: 20px; }
  .login-card { width: 100%; max-width: 400px; padding: 32px 28px; }
  .form-row { gap: 8px; }
  .att-extra input[type="text"], .att-extra input:not([type="file"]) { min-width: 100%; }
}
