* { 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;
}
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9dde5;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
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, #2f6fed, #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: #2f6fed; 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: #2f6fed; color: #fff; }
.userbox { display: flex; align-items: center; gap: 12px; color: #666; }

main { padding: 20px 24px 60px; max-width: 1100px; margin: 0 auto; }
h2 { margin-bottom: 16px; font-size: 20px; }
h3 { margin: 20px 0 10px; font-size: 15px; color: #555; }

.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; }
.row.actions { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: #e8f0fe; color: #2f6fed; border-radius: 6px; padding: 2px 10px; font-size: 12px; }
.chip.red { background: #fdecea; color: #e03e2f; }
.chip.green { background: #e6f7ec; color: #20a464; }
.chip.purple { background: #f1ebfd; color: #7b5cd6; }
.chip.gray { background: #f0f1f5; color: #8a8f99; }
.chip.gen-m { background: #e8f0fe; color: #2f6fed; }
.chip.gen-f { background: #fde8ee; color: #e0557d; }
.t-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; vertical-align: middle; cursor: pointer; }
.t-avatar.ph { display: inline-flex; align-items: center; justify-content: center; background: #f0f2f7; font-size: 15px; }
.bind-code-box { background: #f0f4ff; border: 1px dashed #2f6fed; color: #2f6fed; font-size: 30px; font-weight: 700; letter-spacing: 6px; text-align: center; padding: 14px 0; border-radius: 10px; margin-bottom: 14px; }
.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; }
.box { border-top: 1px solid #f0f1f5; margin-top: 12px; padding-top: 12px; }
.chk { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; margin-bottom: 8px; cursor: pointer; }

.form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-row input[type="file"] { max-width: 220px; }
.batch-bar { background: #eef4ff; border: 1px solid #cfe0ff; }
.tt-adv { padding: 0; overflow: hidden; }
.tt-adv summary { padding: 14px 16px; cursor: pointer; color: #2f6fed; font-weight: 600; user-select: none; }
.tt-adv summary:hover { background: #f7f9fc; }
.tt-adv-body { padding: 4px 16px 14px; border-top: 1px solid #f0f1f5; }
.tt-adv-row { padding: 12px 0; }
.tt-adv-row + .tt-adv-row { border-top: 1px solid #f0f1f5; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #f0f1f5; }
.table th { background: #fafbfc; color: #666; font-weight: 600; }
.table .actions button { margin-right: 6px; padding: 5px 12px; }
.tcell-name { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.t-ops button { padding: 4px 9px; margin-right: 4px; font-size: 12px; }
.range-btns button { padding: 5px 14px; font-size: 13px; }
.q-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.q-card { flex: 1 1 130px; background: #fff; border-radius: 12px; padding: 12px 16px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.q-card b { display: block; font-size: 24px; color: #2f6fed; }
.q-card.bad b { color: #e03e2f; }
.q-card.ok b { color: #20a464; }
.q-card span { color: #999; font-size: 12px; }
.q-class summary { cursor: pointer; font-size: 14px; }
.q-class summary b { margin-right: 10px; }

.tt { border-collapse: collapse; }
.tt th, .tt td { border: 1px solid #e3e6ec; padding: 8px 10px; text-align: center; min-width: 64px; }
.tt th { background: #fafbfc; color: #555; font-weight: 600; }
.tt .period { background: #fafbfc; color: #555; font-weight: 600; }
.tt .group { writing-mode: vertical-rl; font-weight: 700; letter-spacing: 4px; background: #eef4ff; color: #2f6fed; min-width: 34px; }
.tt .group.pm { background: #fff6ea; color: #e68a00; }
.tt .cell { cursor: pointer; color: #2f6fed; }
.tt .cell.on { background: #2f6fed; color: #fff; font-weight: 700; }
.tt .cell-btn { border: none; background: transparent; color: inherit; font-weight: inherit; font-size: 12px; cursor: pointer; padding: 2px 4px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.stat { background: #fff; border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.stat .num { font-size: 34px; font-weight: 800; }
.stat div:last-child { color: #999; margin-top: 4px; }

.loading, .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: 640px; max-height: 82vh; overflow: auto; }
.modal-box h3 { margin-top: 0; }
.modal-box label { display: block; margin-bottom: 12px; }
.modal-box label input { width: 100%; margin-top: 4px; }
.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; }
