:root {
  --bg: #f4f6f8;
  --sidebar: #1f3a5f;
  --sidebar-hover: #274a75;
  --sidebar-active: #ffffff;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7c93;
  --line: #e5e9ef;
  --accent: #2b6cb0;
  --ok: #2f855a;
  --warn: #b7791f;
  --err: #c53030;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--text); }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; flex-shrink: 0; background: var(--sidebar); color: #dbe7f5;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 1.1rem 1rem 0.85rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-title { font-weight: 700; font-size: 1.05rem; color: #fff; }
.brand-sub { font-size: .75rem; color: #9fb4d0; margin-top: .2rem; }
.side-nav { flex: 1; overflow: auto; padding: .6rem .5rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.side-nav button {
  text-align: left; background: transparent; border: 0; color: #c9d8ea;
  border-radius: 8px; padding: .55rem .75rem; cursor: pointer; font-size: .9rem;
}
.side-nav button:hover { background: var(--sidebar-hover); color: #fff; }
.side-nav button.active { background: var(--sidebar-active); color: var(--sidebar); font-weight: 700; }
.side-foot { padding: .75rem; border-top: 1px solid rgba(255,255,255,.08); }
.api-hint { font-size: .68rem; color: #9fb4d0; word-break: break-all; margin-bottom: .5rem; }
.api-hint code { color: #e8f0fa; }
.btn-logout {
  width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.25);
  color: #c9d8ea; border-radius: 8px; padding: .4rem; cursor: pointer;
}
.btn-logout:hover { color: #fff; border-color: #fff; }
.content { flex: 1; min-width: 0; }
.top { padding: 1.1rem 1.5rem .4rem; }
.top h1 { margin: 0 0 .25rem; font-size: 1.25rem; font-weight: 700; }
.sub { margin: 0; color: var(--muted); font-size: .88rem; }
.main { padding: .75rem 1.5rem 3rem; max-width: 980px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.card h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.card h3 { margin: .75rem 0 .4rem; font-size: .95rem; }
.card p, .card li { color: var(--muted); line-height: 1.55; }
pre {
  background: #f7fafc; border: 1px solid var(--line); padding: .75rem; border-radius: 8px;
  overflow: auto; font-size: .8rem; color: #334e68;
}
.badge {
  display: inline-block; background: #eef4fb; color: var(--accent);
  border-radius: 6px; padding: .15rem .45rem; font-size: .75rem; margin-right: .35rem;
}
.row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; align-items: center; }
.row button, .card button.primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: .45rem .85rem; font-weight: 600; cursor: pointer;
}
.err { color: var(--err); }
.ok { color: var(--ok); }
.muted { color: var(--muted); }

.member-list { list-style: none; margin: .75rem 0 0; padding: 0; }
.member { display: flex; gap: .85rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.avatar {
  width: 44px; height: 44px; border-radius: 10px; background: #eef4fb; color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.meta { min-width: 0; flex: 1; }
.name-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.online { background: var(--ok); }
.dot.away { background: var(--warn); }
.dot.offline { background: #94a3b8; }
.st { font-size: .75rem; color: var(--muted); }
.role { margin-top: .2rem; font-size: .9rem; }
.mods { margin-top: .35rem; }
.note { margin-top: .35rem; font-size: .8rem; color: var(--warn); }

.login-gate { position: fixed; inset: 0; background: rgba(31,58,95,.55); display: flex; align-items: center; justify-content: center; z-index: 50; }
.login-gate.hidden { display: none; }
.login-card { width: min(380px, 92vw); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem; }
.login-card h2 { margin: 0 0 .35rem; }
.login-card label { display: block; margin: .65rem 0 .35rem; font-size: .85rem; color: var(--muted); }
.login-card input {
  width: 100%; margin-top: .25rem; padding: .5rem .65rem; border-radius: 8px;
  border: 1px solid #cbd5e1; background: #fff; color: var(--text);
}
.login-card button {
  margin-top: .75rem; width: 100%; background: var(--accent); color: #fff;
  border: 0; border-radius: 8px; padding: .55rem; font-weight: 700; cursor: pointer;
}
.login-card .or { text-align: center; color: var(--muted); font-size: .8rem; margin: 1rem 0 .25rem; }
.login-card .row { display: flex; gap: .5rem; align-items: center; }
.login-card .row input { flex: 1; margin: 0; }
.login-card .row button { width: auto; margin: 0; white-space: nowrap; padding: .5rem .7rem; }

table.simple { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.simple th, table.simple td { text-align: left; padding: .45rem .55rem; border-bottom: 1px solid var(--line); }
table.simple th { color: var(--muted); font-weight: 600; }
.club-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.club-tile { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; background: #fafbfc; }
.club-tile strong { display: block; margin-bottom: .25rem; }
.stars { color: var(--warn); letter-spacing: 1px; }

@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
}

/* 生活区宿舍示意图 */
.dorm-schematic {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
  padding: 1rem;
  margin: .5rem 0 1rem;
}
.dorm-door {
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
  border-bottom: 2px dashed #cbd5e1;
  padding-bottom: .5rem;
  margin-bottom: .75rem;
}
.dorm-grid {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.dorm-col {
  flex: 1 1 140px;
  max-width: 200px;
  min-width: 120px;
}
.dorm-col-label {
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  color: var(--sidebar);
  margin-bottom: .4rem;
}
.dorm-bunks { display: flex; flex-direction: column; gap: .4rem; }
.bed-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .45rem .5rem;
  background: #fff;
  min-height: 52px;
}
.bed-cell.occupied {
  background: #e8f1fb;
  border-color: #90b4e0;
  box-shadow: inset 0 0 0 1px #c5daf3;
}
.bed-cell.empty { background: #f8fafc; color: var(--muted); }
.bed-cell.mini {
  display: inline-block;
  width: 14px; height: 14px; min-height: 0; padding: 0;
  vertical-align: middle; margin-right: .15rem;
}
.bed-pos { font-size: .72rem; color: var(--muted); }
.bed-name { font-weight: 600; font-size: .9rem; margin-top: .1rem; color: var(--text); }
.bed-cell.empty .bed-name { font-weight: 400; color: var(--muted); }
.bed-no { font-size: .7rem; color: var(--muted); }
.dorm-legend { margin-top: .75rem; font-size: .8rem; color: var(--muted); text-align: center; }

/* 统计页 */
.stat-chips { display:flex; flex-wrap:wrap; gap:.5rem; margin:.6rem 0 1rem; }
.stat-chip {
  background:#f7fafc; border:1px solid var(--line); border-radius:10px;
  padding:.55rem .85rem; min-width:110px;
}
.stat-chip .n { font-size:1.25rem; font-weight:700; color:var(--text); display:block; }
.stat-chip .l { font-size:.75rem; color:var(--muted); }
.stat-chip.warn .n { color:var(--warn); }
.stat-chip.err .n { color:var(--err); }
.stat-chip.ok .n { color:var(--ok); }
tr.never-used { background:#fff5f5; }
tr.never-used td { color:#9b2c2c; }
.badge-never {
  background:#fed7d7; color:#c53030; border-radius:6px;
  padding:.1rem .4rem; font-size:.72rem; font-weight:700;
}
.badge-ok-soft { background:#c6f6d5; color:#276749; border-radius:6px; padding:.1rem .4rem; font-size:.72rem; }
.role-switch { display:flex; flex-wrap:wrap; gap:.4rem; margin:.5rem 0 1rem; }
.role-switch button {
  background:#fff; border:1px solid var(--line); color:var(--text);
  border-radius:999px; padding:.35rem .8rem; cursor:pointer; font-size:.85rem;
}
.role-switch button.active { background:var(--accent); color:#fff; border-color:var(--accent); font-weight:600; }
.hint-box {
  background:#f0fff4; border:1px solid #c6f6d5; color:#276749;
  border-radius:8px; padding:.65rem .85rem; font-size:.88rem; margin:.5rem 0 1rem;
}
.hint-box.warn {
  background:#fffbeb; border-color:#fbd38d; color:#744210;
}

.btn-sim-login {
  background: var(--accent); color:#fff; border:0; border-radius:6px;
  padding:.25rem .55rem; font-size:.78rem; cursor:pointer;
}
table.simple td .btn-sim-login { white-space: nowrap; }

/* 教师成长十维 */
.growth-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-top: .5rem;
}
@media (max-width: 800px) {
  .growth-layout { grid-template-columns: 1fr; }
}
.growth-radar-wrap {
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem;
}
.growth-radar { width: 100%; max-width: 260px; display: block; margin: 0 auto; }
.radar-ring { fill: none; stroke: #d9e2ec; stroke-width: 0.4; }
.radar-axis { stroke: #cbd5e1; stroke-width: 0.35; }
.radar-poly {
  fill: rgba(43, 108, 176, 0.28);
  stroke: #2b6cb0;
  stroke-width: 0.7;
}
.radar-label { font-size: 3.2px; fill: #486581; }
.growth-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 64px;
  gap: .5rem;
  align-items: center;
  margin: .35rem 0;
}
.growth-bar-label { font-size: .82rem; line-height: 1.2; }
.growth-bar-label .muted { display: block; font-size: .68rem; }
.growth-bar-track {
  height: 10px; background: #edf2f7; border-radius: 999px; overflow: hidden;
}
.growth-bar-fill {
  height: 100%; background: linear-gradient(90deg, #63b3ed, #2b6cb0);
  border-radius: 999px;
}
.growth-bar-val { text-align: right; font-size: .9rem; }
.growth-score-input {
  width: 58px; padding: .25rem .35rem; border: 1px solid var(--line);
  border-radius: 6px; text-align: right; font-weight: 600;
}

/* 教学资源库 */
.scope-badge {
  display: inline-block; border-radius: 999px; padding: .12rem .5rem;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.scope-self { background: #edf2f7; color: #4a5568; }
.scope-class { background: #e9f5ff; color: #2b6cb0; }
.scope-school { background: #f0fff4; color: #276749; }
.scope-student { background: #faf5ff; color: #6b46c1; }
tr.res-taken-down { background: #f7fafc; opacity: .72; }
tr.res-taken-down td { color: var(--muted); }
.res-form {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .65rem .75rem; margin: .5rem 0 0;
}
.res-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); }
.res-form label.full { grid-column: 1 / -1; }
.res-form input, .res-form select {
  padding: .4rem .55rem; border-radius: 8px; border: 1px solid var(--line);
  font-size: .9rem; color: var(--text); background: #fff;
}
.btn-res-dl, .btn-res-del {
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: .25rem .55rem; font-size: .78rem; cursor: pointer;
}
.btn-res-dl:disabled { opacity: .45; cursor: not-allowed; }


/* 家长时间轴 / 成长册 */
.tl-group { margin: .85rem 0 1.1rem; }
.tl-group h4 { margin: 0 0 .45rem; font-size: .92rem; color: var(--muted); }
.tl-list { list-style: none; margin: 0; padding: 0; border-left: 2px solid #e2e8f0; }
.tl-item {
  display: grid; grid-template-columns: 92px 1fr; gap: .55rem;
  padding: .45rem 0 .45rem .85rem; position: relative;
}
.tl-item::before {
  content: ""; position: absolute; left: -5px; top: .7rem;
  width: 8px; height: 8px; border-radius: 50%; background: #2b6cb0;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #cbd5e1;
}
.tl-date { font-size: .78rem; color: var(--muted); padding-top: .15rem; }
.tl-body strong { margin-left: .35rem; font-size: .92rem; }
.tl-note-box {
  background: #f7fafc; border: 1px solid var(--line); border-radius: 10px;
  padding: .65rem .75rem; margin-bottom: .85rem;
}
.tl-exam { background:#e9f5ff; color:#2b6cb0; }
.tl-alert { background:#fed7d7; color:#c53030; }
.tl-club { background:#faf5ff; color:#6b46c1; }
.tl-points { background:#fefcbf; color:#975a16; }
.tl-rec { background:#e6fffa; color:#234e52; }
.tl-award { background:#fbd38d; color:#7b341e; }
.tl-teacher { background:#c6f6d5; color:#276749; }
.tl-parent { background:#eedfff; color:#553c9a; }
.tl-body { background:#edf2f7; color:#4a5568; }
.tl-other { background:#edf2f7; color:#4a5568; }


/* 可排序 / 可拖列表格 */
.table-wrap { overflow: auto; margin: .4rem 0 .8rem; }
table.simple { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.simple th, table.simple td {
  border-bottom: 1px solid var(--line); padding: .45rem .55rem; text-align: left; white-space: nowrap;
}
table.simple th.sortable {
  cursor: pointer; user-select: none; position: relative; background: #f8fafc;
}
table.simple th.sortable:hover { background: #eef4fb; }
table.simple th.sortable .sort-ind { color: var(--accent); margin-left: .2rem; font-size: .75rem; }
table.simple th.dragging { opacity: .55; background: #dbeafe; }
table.simple th.drag-over { box-shadow: inset 2px 0 0 var(--accent); }
table.simple tr.never-used { background: #fff5f5; }
.badge-never { background: #fed7d7; color: #c53030; border-radius: 6px; padding: .1rem .4rem; font-size: .75rem; }
.badge-ok-soft { background: #c6f6d5; color: #276749; border-radius: 6px; padding: .1rem .4rem; font-size: .75rem; }
.badge-fail { background: #fed7d7; color: #c53030; border-radius: 6px; padding: .1rem .4rem; font-size: .75rem; }
.hint-drag { font-size: .78rem; color: var(--muted); margin: .25rem 0 .5rem; }
