:root {
  --bg: #f5f8fc;
  --panel: #ffffff;
  --text: #172033;
  --muted: #748198;
  --line: #e6edf6;
  --line-soft: #eef3f8;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf2ff;
  --blue: #3b82f6;
  --blue-soft: #eaf2ff;
  --amber: #ff9f43;
  --amber-soft: #fff2e5;
  --violet: #7c4dff;
  --danger: #ff5d73;
  --danger-dark: #e64a61;
  --danger-soft: #ffecef;
  --sidebar: #ffffff;
  --sidebar-hover: #f0f6ff;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(33, 61, 101, 0.05);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 23px; line-height: 1.35; letter-spacing: 0; }
h2 { font-size: 17px; line-height: 1.4; letter-spacing: 0; }
h3 { font-size: 14px; line-height: 1.4; letter-spacing: 0; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { min-height: 0; display: flex; flex-direction: column; padding: 18px 14px; color: #2d3a4f; border-right: 1px solid var(--line); background: var(--sidebar); }
.brand { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; color: #1361d8; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; font-size: 17px; font-weight: 800; }
.brand-mark img { width: 40px; height: 40px; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.brand-copy strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.brand-copy small { display: block; margin-top: 2px; color: #748198; font-size: 11px; }
.school-space { margin: 6px 4px 14px; padding: 11px 12px; border: 1px solid #e4edf9; border-radius: 10px; background: #f8fbff; }
.school-space small { color: #748198; font-size: 11px; }
.school-space strong { display: block; margin-top: 4px; color: #2d3a4f; font-size: 13px; }
.side-nav { display: grid; gap: 7px; }
.nav-link { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 10px; color: #2d3a4f; font-weight: 600; text-decoration: none; position: relative; transition: color 0.18s ease, background 0.18s ease; }
.nav-link .icon { width: 20px; height: 20px; }
.nav-link:hover { color: #176fe8; background: var(--sidebar-hover); }
.nav-link.active { color: var(--primary-dark); background: var(--primary-soft); font-weight: 700; }
.nav-link.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--primary); border-radius: 3px; }
.admin-profile { margin-top: auto; min-height: 62px; display: flex; align-items: center; gap: 10px; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #2365d8; background: linear-gradient(135deg, #c6dcff, #eef5ff); font-weight: 800; }
.admin-profile strong { display: block; color: #2d3a4f; font-size: 13px; }
.admin-profile div span { display: block; margin-top: 3px; color: #748198; font-size: 11px; }

.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: 68px minmax(0, 1fr); }
.topbar { min-width: 0; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 26px; border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar-title { min-width: 164px; }
.topbar-title strong { display: block; color: #172033; font-size: 18px; }
.topbar-title span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.topbar-actions, .heading-actions, .filter-bar { display: flex; align-items: center; gap: 8px; }
.global-search { width: min(330px, 28vw); position: relative; display: block; margin-left: auto; }
.global-search .icon { width: 17px; height: 17px; position: absolute; top: 50%; left: 13px; z-index: 1; color: #8b9bb0; transform: translateY(-50%); }
.global-search input { width: 100%; min-height: 42px; padding-left: 40px; border-color: #e8edf4; border-radius: 12px; background: #f5f7fa; }
.global-search input:focus { border-color: #bcd4ff; background: #fff; }
.sync-status { display: inline-flex; align-items: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sync-status i { width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #2aa66e; box-shadow: 0 0 0 3px #e1f4e9; }
.settings-menu { position: absolute; top: 54px; right: 22px; z-index: 15; min-width: 164px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.settings-menu button { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 9px; border: 0; border-radius: 5px; color: var(--text); background: transparent; text-align: left; }
.settings-menu button:hover { background: #f4f6f8; }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid var(--primary); border-radius: 9px; color: #fff; background: linear-gradient(90deg, var(--primary), var(--blue)); text-decoration: none; white-space: nowrap; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.button:hover { border-color: #1d68d8; background: linear-gradient(90deg, #1d68d8, #2b7df6); box-shadow: 0 6px 16px rgba(30, 75, 140, 0.16); transform: translateY(-1px); }
.button-soft { color: #2365d8; border-color: #d8e6fb; background: #f4f8ff; }
.button-soft:hover { color: #fff; border-color: #2a7af1; background: #2a7af1; }
.button-ghost { color: var(--text); border-color: var(--line); background: #fff; }
.button-ghost:hover { color: var(--text); border-color: #c7d0d8; background: #f4f6f8; }
.button-danger { border-color: var(--danger); background: var(--danger); }
.button-danger:hover { border-color: var(--danger-dark); background: var(--danger-dark); }
.button-small { min-height: 34px; padding: 0 10px; font-size: 12px; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: #475467; background: #fff; }
.icon-button:hover { color: var(--text); background: #f4f6f8; }
.text-button { display: inline-flex; align-items: center; gap: 3px; color: var(--primary); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.text-button .icon { width: 15px; height: 15px; }
.text-button:hover { color: var(--primary-dark); }

.content { min-height: 0; overflow: auto; padding: 18px 24px 30px; }
.page { max-width: 1440px; margin: 0 auto; }
.page-heading { min-height: 58px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-heading p, .panel-heading p, .dialog-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.school-welcome { min-height: 132px; display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden; margin-bottom: 16px; padding: 24px 28px; border: 1px solid #e4edf9; border-radius: 16px; background: linear-gradient(110deg, #f8fbff 0%, #eef6ff 60%, #e6f2ff 100%); }
.welcome-kicker { display: block; margin-bottom: 5px; color: #3d7fde; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.school-welcome h2 { color: #105bc7; font-size: 26px; letter-spacing: -.02em; }
.school-welcome p { margin-top: 9px; color: #66758d; font-size: 14px; line-height: 1.55; }
.welcome-summary { width: 250px; min-height: 82px; position: relative; display: grid; align-content: center; gap: 5px; padding: 14px 18px; border: 2px solid #b4d3ff; border-radius: 12px; color: #5c7fae; background: rgba(255, 255, 255, .45); }
.welcome-summary span { font-size: 11px; }
.welcome-summary strong { max-width: 190px; overflow: hidden; color: #2d6fcf; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.welcome-summary i { width: 18px; height: 18px; position: absolute; bottom: -2px; border: 2px solid #9ec8ff; border-bottom: 0; border-radius: 5px 5px 0 0; background: #d9ebff; }
.welcome-summary i:nth-of-type(1) { right: 28px; height: 42px; }
.welcome-summary i:nth-of-type(2) { right: 70px; height: 30px; }
.welcome-summary i:nth-of-type(3) { right: 112px; height: 24px; }
select, input { min-height: 40px; padding: 0 12px; border: 1px solid #dce6f2; border-radius: 9px; color: var(--text); background: #fff; }
select:hover, input:hover { border-color: #bcd4f5; }
input::placeholder { color: #98a2b3; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { min-height: 112px; display: grid; align-content: center; gap: 5px; padding: 17px; border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.stat-top .icon { width: 19px; height: 19px; color: var(--primary); }
.stat-card > strong { font-size: 28px; line-height: 1.1; }
.stat-card > small { color: var(--muted); font-size: 11px; }
.stat-blue { border-top-color: var(--blue); }
.stat-blue .stat-top .icon { color: var(--blue); }
.stat-amber { border-top-color: #d28a1f; }
.stat-amber .stat-top .icon { color: var(--amber); }
.stat-violet { border-top-color: var(--violet); }
.stat-violet .stat-top .icon { color: var(--violet); }

.dashboard-grid { display: grid; gap: 14px; }
.dashboard-grid-main { grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr); }
.dashboard-grid-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.panel-heading { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.legend { display: inline-flex; align-items: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.legend i { width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: var(--primary); }
.chart-body { padding: 10px 16px 13px; }
.bar-chart { height: 202px; position: relative; display: flex; align-items: end; gap: clamp(10px, 2vw, 22px); padding: 27px 9px 32px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 39px, #edf1f4 40px); }
.chart-column { height: 100%; flex: 1; min-width: 34px; position: relative; display: flex; align-items: end; justify-content: center; }
.chart-bar { width: min(54px, 75%); min-height: 6px; position: relative; border-radius: 5px 5px 0 0; background: var(--primary); transition: height 0.25s; }
.chart-column:nth-child(2n) .chart-bar { background: var(--blue); }
.chart-column:nth-child(3n) .chart-bar { background: #d28a1f; }
.chart-column:nth-child(4n) .chart-bar { background: var(--violet); }
.chart-value { position: absolute; top: -23px; left: 50%; color: #475467; font-size: 11px; font-weight: 700; transform: translateX(-50%); }
.chart-label { position: absolute; left: 50%; bottom: -24px; color: var(--muted); font-size: 12px; white-space: nowrap; transform: translateX(-50%); }
.ranking-list { display: grid; gap: 18px; padding: 19px 16px; }
.ranking-item { display: grid; grid-template-columns: 42px minmax(80px, 1fr) 38px; align-items: center; gap: 10px; font-size: 13px; }
.ranking-name { color: #344054; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #edf1f4; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.ranking-item:nth-child(2) .progress-track i { background: var(--blue); }
.ranking-item:nth-child(3) .progress-track i { background: #d28a1f; }
.ranking-item:nth-child(4) .progress-track i { background: var(--violet); }
.ranking-item strong { text-align: right; font-size: 12px; }
.compact-list { display: grid; }
.compact-item { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 15px; border-bottom: 1px solid var(--line-soft); }
.compact-item:last-child { border-bottom: 0; }
.compact-main { min-width: 0; display: flex; align-items: center; gap: 11px; }
.compact-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 7px; color: var(--primary-dark); background: var(--primary-soft); font-size: 12px; font-weight: 700; }
.compact-avatar.teacher { border-radius: 50%; color: #255b8b; background: var(--blue-soft); }
.compact-copy { min-width: 0; }
.compact-copy strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.compact-copy span { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.badge { min-height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; border-radius: 5px; color: #475467; background: #eef2f5; font-size: 11px; white-space: nowrap; }
.badge-green { color: #12613f; background: #dff3e8; }
.badge-blue { color: #255b8b; background: var(--blue-soft); }
.badge-orange { color: #754500; background: var(--amber-soft); }
.badge-gray { color: #667085; background: #eef2f5; }
.badge-red { color: #b42318; background: #fee4e2; }

.notif-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.notif-row.notif-unread { background: #f6faff; border-color: #dbe8fb; }
.notif-row-main { flex: 1; min-width: 0; }
.notif-row-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notif-row-content { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; word-break: break-all; }
.notif-row-meta { margin-top: 7px; color: #a0acba; font-size: 11px; }
.notif-row-ops { display: flex; flex-direction: column; gap: 5px; flex: 0 0 auto; }

.grade-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grade-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.grade-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.grade-card-head p { margin-top: 6px; color: var(--muted); font-size: 12px; }
.grade-stats { display: grid; gap: 13px; margin-top: 18px; }
.grade-stat { display: grid; grid-template-columns: 68px minmax(60px, 1fr) 40px; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.grade-stat strong { color: var(--text); text-align: right; font-size: 12px; }
.grade-footer { display: flex; align-items: center; gap: 5px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; }

.filter-bar { min-height: 48px; flex-wrap: wrap; margin-bottom: 10px; }
.search-field { width: 280px; position: relative; display: block; }
.search-field .icon { position: absolute; top: 50%; left: 11px; z-index: 1; width: 17px; height: 17px; color: #98a2b3; transform: translateY(-50%); }
.search-field input { width: 100%; padding-left: 36px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.table-panel { overflow: hidden; }
.leave-panel + .leave-panel { margin-top: 14px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 13px; white-space: nowrap; }
th { color: #5d6d84; background: var(--panel); font-size: 12px; font-weight: 600; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
.teacher-cell { display: flex; align-items: center; gap: 9px; }
.table-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-size: 11px; font-weight: 700; }
.class-cell strong, .teacher-cell strong { font-size: 13px; }
.class-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.permission-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.permission-list { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 10px; }
.switch { width: 34px; height: 19px; position: relative; display: inline-block; flex: none; }
.switch input { width: 1px; height: 1px; position: absolute; opacity: 0; }
.switch-track { position: absolute; inset: 0; border-radius: 99px; background: #cbd5dc; transition: background 0.15s; }
.switch-track::after { content: ""; width: 15px; height: 15px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(15px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(49, 109, 166, 0.22); outline-offset: 2px; }
.empty-state { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 30px 16px; color: var(--muted); text-align: center; }
.empty-state .icon { width: 32px; height: 32px; margin-bottom: 4px; color: #98a2b3; }
.empty-state strong { color: #475467; font-size: 14px; }
.empty-state span { font-size: 12px; }

.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(23, 32, 51, 0.45); }
.dialog { width: min(540px, 100%); max-height: 90vh; overflow: auto; border-radius: 14px; background: #fff; box-shadow: 0 24px 70px rgba(33, 61, 101, 0.24); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 18px 13px; border-bottom: 1px solid var(--line); }
.dialog-heading .icon-button { width: 32px; height: 32px; flex: none; }
.dialog-body { padding: 16px 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 18px 17px; border-top: 1px solid var(--line-soft); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { display: grid; align-content: start; gap: 6px; color: #475467; font-size: 12px; }
.field-wide { grid-column: 1 / -1; }
.field input, .field select { width: 100%; }
.field > small { min-height: 15px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.field .field-error { color: var(--danger); }
.field.invalid input { border-color: var(--danger); background: #fffafa; }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); cursor: pointer; }
.check-row input { width: 16px; height: 16px; min-height: 0; margin: 2px 0 0; accent-color: var(--primary); }
.check-row span { display: grid; gap: 3px; }
.check-row strong { font-size: 12px; }
.check-row small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.form-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; border-radius: 7px; color: #67501d; background: #fff7e5; font-size: 11px; line-height: 1.55; }
.form-note .icon { width: 16px; height: 16px; margin-top: 1px; }
.modal-compact .dialog { width: min(440px, 100%); }
.confirm-content { display: flex; align-items: flex-start; gap: 13px; padding: 20px 18px 15px; }
.confirm-content h2 { font-size: 16px; }
.confirm-content p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.confirm-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 50%; color: var(--danger); background: var(--danger-soft); }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 7px; color: #fff; background: #26333f; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.modal-open { overflow: hidden; }

button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: 0.62; }
.button[aria-busy="true"] { position: relative; }
.entry-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-layout { width: min(920px, 100%); min-height: 520px; display: grid; grid-template-columns: minmax(250px, 0.78fr) minmax(360px, 1.22fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: flex-start; gap: 12px; padding: 42px 34px; color: #fff; background: linear-gradient(145deg, #2563eb, #61a2ff); }
.login-brand > div { padding-top: 3px; }
.login-brand strong { display: block; font-size: 20px; }
.login-brand span:not(.entry-mark) { display: block; margin-top: 5px; color: #aebcc6; font-size: 12px; }
.entry-mark { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 8px; color: #fff; background: var(--primary); font-size: 15px; font-weight: 700; }
.login-panel { display: grid; align-content: center; gap: 16px; padding: 48px clamp(28px, 6vw, 72px); }
.login-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 5px; }
.login-heading h1 { font-size: 22px; }
.login-heading p { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 8px; color: var(--primary-dark); background: var(--primary-soft); }
.login-submit { width: 100%; margin-top: 2px; }
.login-note { color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.entry-panel { width: min(460px, 100%); display: grid; justify-items: center; gap: 12px; padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); text-align: center; }
.entry-panel h1, .entry-panel strong { font-size: 17px; }
.entry-panel p { max-width: 360px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.entry-panel small { color: var(--muted); font-size: 11px; }
.entry-status .entry-mark { margin-bottom: 4px; }
.entry-error-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--danger); background: var(--danger-soft); }
.entry-error-icon .icon { width: 22px; height: 22px; }
.entry-actions { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-alert { padding: 10px 11px; border: 1px solid #efc5c9; border-radius: 7px; color: var(--danger-dark); background: #fff5f6; font-size: 12px; line-height: 1.55; }
.global-alert { max-width: 1440px; min-height: 62px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; margin: 0 auto 16px; padding: 10px 12px; border: 1px solid #efc5c9; border-radius: var(--radius); color: var(--danger-dark); background: #fff7f8; }
.global-alert > .icon { width: 20px; height: 20px; }
.global-alert strong { display: block; font-size: 13px; }
.global-alert p { margin-top: 3px; color: #7a3d43; font-size: 11px; line-height: 1.5; }
.global-alert small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.section-loading { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.inline-empty { min-height: 120px; display: grid; place-items: center; padding: 20px; color: var(--muted); font-size: 12px; text-align: center; }
.sync-status.sync-loading i { background: #d28a1f; box-shadow: 0 0 0 3px var(--amber-soft); }
.sync-status.sync-error i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.sync-status.sync-success i { background: #2aa66e; box-shadow: 0 0 0 3px #e1f4e9; }
.dialog-wide { width: min(680px, 100%); }
.class-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.class-picker legend { margin-bottom: 6px; padding: 0; }
.class-picker > div { max-height: 146px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; overflow: auto; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.class-option { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 5px; color: var(--text); background: #fff; cursor: pointer; }
.class-option:hover { background: var(--primary-soft); }
.class-option input { width: 15px; height: 15px; min-height: 0; flex: none; margin: 0; accent-color: var(--primary); }
.class-option span { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.muted-copy { color: var(--muted); font-size: 11px; }
.table-secondary { display: block; max-width: 180px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; }
.permission-toggle:has(input:disabled) { opacity: 0.65; }
.operations-layout { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(0, 1.28fr); gap: 14px; align-items: start; }
.operation-form { overflow: hidden; }
.operation-body { padding: 15px; }
.field-action { display: flex; align-items: end; }
.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field select, .inline-field input { min-width: 150px; }
textarea { width: 100%; min-height: 100px; resize: vertical; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); font: inherit; line-height: 1.5; }
textarea:focus { outline: 3px solid rgba(13, 148, 136, 0.16); border-color: var(--primary); }
.announcement-pin { min-height: 100%; align-self: stretch; }
.attachment-notice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; border: 1px solid #d9e4e8; border-radius: 7px; color: #52626f; background: #f8fbfc; font-size: 11px; line-height: 1.55; }
.attachment-notice .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--primary-dark); }
.attachment-notice strong { color: #334a57; }
.announcement-content { color: #344054; font-size: 14px; line-height: 1.75; }
.announcement-content > *:first-child { margin-top: 0; }
.announcement-content > *:last-child { margin-bottom: 0; }
.announcement-content p { margin: 0 0 13px; }
.announcement-content h2, .announcement-content h3, .announcement-content h4 { margin: 20px 0 9px; color: var(--text); line-height: 1.35; }
.announcement-content h2 { font-size: 19px; }
.announcement-content h3 { font-size: 17px; }
.announcement-content h4 { font-size: 15px; }
.announcement-content ul { margin: 0 0 13px; padding-left: 22px; }
.announcement-content code { padding: 1px 5px; border-radius: 4px; color: #0f766e; background: #e8f8f5; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.announcement-attachments { display: grid; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.attachment-link { min-height: 40px; display: flex; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--primary-dark); background: #fbfefd; font-size: 12px; font-weight: 600; text-decoration: none; transition: background .18s ease, border-color .18s ease; }
.attachment-link:hover { border-color: var(--primary); background: var(--primary-soft); }
.attachment-link:focus-visible { outline: 3px solid rgba(13, 148, 136, .22); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

.role-tag { display: inline-flex; align-items: center; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 12px; line-height: 1.5; background: transparent; white-space: nowrap; }
.role-tag + .role-tag { margin-left: 6px; }

.role-card-title { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.role-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.role-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; cursor: pointer; }
.role-card:hover { border-color: var(--primary); background: var(--primary-soft, #f0fdf9); }
.role-card strong { font-size: 14px; font-weight: 600; color: var(--text); }
.role-card small { font-size: 12px; color: #52626f; line-height: 1.5; }
.role-assignment-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef2f5; }
.role-assignment-row:last-child { border-bottom: 0; }
.role-assignment-name { display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
.role-assignment-name small { font-size: 12px; color: #52626f; }
.role-assignment-row .form-control { min-width: 120px; }
.role-scope-value { min-width: 200px; }
.scope-type-label { font-size: 13px; font-weight: 600; color: var(--text); padding: 6px 4px; white-space: nowrap; }
.class-option-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; }
.subject-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #eef2f5; border-radius: 8px; cursor: pointer; }
.subject-option span { flex: 1; font-size: 13px; }
.subject-select { min-width: 120px; }

.dorm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.dorm-main { display: grid; gap: 16px; }
.dorm-buildings { display: grid; gap: 16px; }
.dorm-building { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.dorm-building-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dorm-building-head h3 { margin: 0; font-size: 15px; }
.dorm-building-gender { font-size: 12px; color: var(--muted); }
.dorm-building-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 14px 16px; }
.dorm-room { border: 1px solid var(--line-soft); border-radius: 10px; background: #fbfdff; padding: 12px; }
.dorm-room-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dorm-room-head b { font-size: 13px; }
.dorm-room-del { border: 0; background: none; color: #c44f55; cursor: pointer; font-size: 12px; font-weight: 700; }
.dorm-room-beds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.dorm-bed { position: relative; height: 52px; border: 1.5px dashed #c3d2e2; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #566a7e; cursor: pointer; }
.dorm-bed.occupied { background: #e8f1ff; border-color: #6f9fd8; color: #2d64ad; }
.dorm-bed.dragover { border-color: #2468d8; background: #eaf2ff; box-shadow: 0 0 0 3px rgba(36, 104, 216, .2); }
.dorm-bed .bed-no { position: absolute; top: 3px; left: 6px; font-size: 9px; color: #9aa5b0; }
.dorm-unassigned-wrap, .dorm-side { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.dorm-side-head { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.dorm-unassigned, .dorm-swap-list { padding: 12px; display: grid; gap: 8px; max-height: 560px; overflow: auto; }
.dorm-student-card { border: 1px solid #dbe4ee; border-radius: 9px; padding: 8px 10px; background: #fff; cursor: grab; font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.dorm-student-card:active { cursor: grabbing; }
.dorm-student-card small { color: #9aa5b0; font-weight: 500; }
.dorm-swap-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.dorm-swap-item .swap-title { font-size: 12px; font-weight: 800; }
.dorm-swap-item .swap-desc { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.dorm-swap-item .swap-actions { display: flex; gap: 6px; margin-top: 8px; }
.dorm-swap-item .swap-status { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10px; }
.dorm-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.dorm-hint { font-size: 11px; color: #9aa5b0; }
.dorm-building-title { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.dorm-building-title .arrow { display: inline-block; transition: transform .18s; color: var(--muted); }
.dorm-building.collapsed .arrow { transform: rotate(-90deg); }
.dorm-building.collapsed .dorm-building-rooms { display: none; }
.dorm-student-card input[type="checkbox"] { width: 14px; height: 14px; }

/* ===== 左下角头像菜单 ===== */
.admin-profile { cursor: pointer; user-select: none; }
.profile-menu { position: absolute; left: 14px; bottom: 74px; width: 200px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; }
.profile-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--text); padding: 10px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; text-align: left; }
.profile-menu button:hover { background: var(--sidebar-hover); }
.profile-menu button .icon { width: 16px; height: 16px; }

/* ===== 个人中心 ===== */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.profile-body { padding: 16px; }
.profile-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.profile-row span { color: var(--muted); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.logo-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.logo-fallback { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 22px; font-weight: 700; }
.logo-prev-wrap { margin-top: 12px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ===== 设置弹窗 ===== */
.settings-section { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.settings-section:last-child { border-bottom: 0; }
.settings-section h3 { margin: 0 0 10px; font-size: 13px; }
.settings-desc { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.theme-swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.theme-swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer; font-size: 12px; color: var(--muted); padding: 0; }
.theme-swatch span { width: 40px; height: 40px; border-radius: 10px; display: block; }
.theme-swatch.active { color: var(--primary); }
.theme-swatch.active span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== 头像菜单：设置子菜单（在设置项右侧展开） ===== */
.profile-sub { position: relative; }
.profile-sub > button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--text); padding: 10px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; text-align: left; }
.profile-sub > button:hover { background: var(--sidebar-hover); }
.profile-sub > button .icon { width: 16px; height: 16px; }
.sub-arrow { margin-left: auto; font-size: 15px; line-height: 1; color: var(--muted); }
.profile-submenu { position: absolute; left: calc(100% + 8px); bottom: -6px; width: 170px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 80; }
.profile-submenu button { display: block; width: 100%; border: 0; background: transparent; color: var(--text); padding: 9px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; text-align: left; }
.profile-submenu button:hover { background: var(--sidebar-hover); }

/* ===== 设置密码 ===== */
.password-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.password-tabs button { flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.password-tabs button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.password-pane { display: grid; gap: 12px; }
.notice { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--line-soft); font-size: 12px; line-height: 1.7; }

/* ===== 主题变量（深色/绿色/紫色） ===== */
body[data-theme="dark"] {
  --bg: #111827; --panel: #1f2937; --text: #e5e7eb; --muted: #9ca3af;
  --line: #374151; --line-soft: #2a3441; --sidebar: #111827; --sidebar-hover: #26303f;
  --primary: #3b82f6; --primary-dark: #60a5fa; --primary-soft: #1e3a5f; --blue: #3b82f6; --blue-soft: #1e3a5f;
  --amber: #fbbf24; --amber-soft: #3a2f1e; --violet: #8b5cf6;
  --danger: #f87171; --danger-dark: #f87171; --danger-soft: #3a2023;
  --shadow: 0 6px 20px rgba(0,0,0,0.35); color-scheme: dark;
}
body[data-theme="green"] {
  --primary: #16a34a; --primary-dark: #15803d; --primary-soft: #e8f7ee; --blue: #22c55e; --blue-soft: #e8f7ee;
}
body[data-theme="purple"] {
  --primary: #7c4dff; --primary-dark: #6d3cf0; --primary-soft: #f1edfb; --blue: #8b5cf6; --blue-soft: #f1edfb; --violet: #7c4dff;
}
@media (max-width: 820px) { .profile-grid { grid-template-columns: 1fr; } }

/* ===== 设置侧滑抽屉 ===== */
.settings-drawer-mask { position: fixed; inset: 0; background: rgba(25,41,57,.4); z-index: 200; }
.settings-drawer-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); background: var(--panel); z-index: 201; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,0,0,.18); }
.settings-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.settings-drawer-head h2 { margin: 0; font-size: 16px; }
.settings-drawer-body { padding: 18px; overflow: auto; }
/* ===== logo 编辑器 ===== */
.logo-editor-preview { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin-bottom: 14px; }
.logo-editor-preview img, .logo-editor-preview span { width: 72px; height: 72px; object-fit: cover; display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-size: 26px; font-weight: 700; }
.logo-editor-preview img[data-shape="circle"], .logo-editor-preview span[data-shape="circle"] { border-radius: 50%; }
.logo-editor-preview img[data-shape="square"], .logo-editor-preview span[data-shape="square"] { border-radius: 4px; }
.logo-editor-preview img[data-shape="rounded"], .logo-editor-preview span[data-shape="rounded"] { border-radius: 16px; }
.logo-editor-preview img[data-shape="hexagon"], .logo-editor-preview span[data-shape="hexagon"] { clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); border-radius: 0; }
.logo-shape-label { font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.logo-shape-options { display: flex; gap: 8px; margin-bottom: 14px; }
.logo-shape-options button { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.logo-shape-options button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.logo-name-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.logo-editor input[type="text"] { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 13px; }
.logo-crop-wrap { display: flex; gap: 20px; flex-wrap: wrap; }
.logo-crop-side { flex: 1; min-width: 200px; }
.logo-crop-hint { font-size: 12px; color: var(--muted); margin-top: 12px; }
.logo-shape-options button { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.logo-shape-options button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.logo-shape-label { font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.logo-name-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; margin-top: 12px; }


\n\n/* 通知中心空状态（原内联样式改为类，适配严格 CSP） */\n.notif-empty{margin:0;text-align:center;color:#8a97a6;padding:30px 0}\n