:root {
  --brand: #2f6fed;
  --brand-dark: #1e50c0;
  --brand-light: #eaf1ff;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --border: #e3e8f0;
  --border-strong: #cfd7e3;
  --text: #1c2433;
  --text-2: #5a6577;
  --text-3: #8a94a6;
  --green: #16a34a;
  --green-bg: #e8f8ee;
  --amber: #d97706;
  --amber-bg: #fdf3e3;
  --red: #dc2626;
  --red-bg: #fdecec;
  --violet: #7c3aed;
  --violet-bg: #f1ebfe;
  --gray-bg: #eef1f6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 30, 54, .06), 0 4px 14px rgba(16, 30, 54, .05);
  --shadow-lg: 0 10px 40px rgba(16, 30, 54, .18);
  --sidebar-w: 216px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 布局 ---------------- */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #10192c;
  color: #c7d0e0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .logo {
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar .logo .t1 { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.sidebar .logo .t2 { font-size: 11px; color: #7d8aa3; margin-top: 3px; }
/* 版本号徽标：升级后一眼可确认线上跑的是哪个版本 */
.sidebar .logo .ver {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: #9fb0cc;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.12);
  vertical-align: 1px;
}

.nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  cursor: pointer; color: #c7d0e0; font-size: 14px;
  user-select: none; transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; }
.nav-item .badge {
  margin-left: auto; background: rgba(255,255,255,.16); color: #fff;
  font-size: 11px; border-radius: 9px; padding: 1px 7px; font-weight: 600;
}
.nav-item.active .badge { background: rgba(255,255,255,.3); }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 10px; }

.sidebar .foot { padding: 12px 16px; font-size: 11px; color: #63708a; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--panel); border-bottom: 1px solid var(--border);
  padding: 12px 22px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; }
.topbar .sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.topbar .spacer { flex: 1; }

.content { padding: 18px 22px 40px; flex: 1; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px;
}
.card > .card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card > .card-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.card > .card-head .spacer { flex: 1; }
.card > .card-body { padding: 16px; }
.card > .card-body.tight { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  cursor: pointer; font-size: 13px; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: #f7f9fc; border-color: #b9c3d2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--red); border-color: #f0c4c4; }
.btn.danger:hover { background: var(--red-bg); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn.success:hover { filter: brightness(.94); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-bg); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.lg { padding: 10px 20px; font-size: 15px; }

.input, .select, .textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,237,.13);
}
.textarea { min-height: 66px; resize: vertical; }
.select { cursor: pointer; }

.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 600; }
.field > label .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.field.inline { display: flex; align-items: center; gap: 8px; margin-bottom: 0; }

.grid { display: grid; gap: 13px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) {
  .grid.c5, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .grid.c2, .grid.c3, .grid.c4, .grid.c5 { grid-template-columns: 1fr; }
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 10px 12px; background: #f8fafd;
  border-bottom: 1px solid var(--border); color: var(--text-2);
  font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.tbl td { padding: 9px 12px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
table.tbl tbody tr:hover { background: #fafbfe; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.acts { white-space: nowrap; text-align: right; }
table.tbl .muted { color: var(--text-3); }
table.tbl tfoot td {
  background: #f8fafd; font-weight: 700; border-top: 2px solid var(--border-strong);
  border-bottom: none; padding: 10px 12px;
}

.empty { padding: 40px 20px; text-align: center; color: var(--text-3); }
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .5; }

/* ---------------- 标签 / 徽章 ---------------- */
.tag {
  display: inline-block; padding: 1.5px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; background: var(--gray-bg); color: var(--text-2);
  white-space: nowrap;
}
.tag.blue { background: var(--brand-light); color: var(--brand-dark); }
.tag.green { background: var(--green-bg); color: #15803d; }
.tag.amber { background: var(--amber-bg); color: #b45309; }
.tag.red { background: var(--red-bg); color: #b91c1c; }
.tag.violet { background: var(--violet-bg); color: #6d28d9; }
.tag.gray { background: var(--gray-bg); color: var(--text-2); }
.tag.sm { font-size: 11px; padding: 1px 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--brand-light); color: var(--brand-dark);
  padding: 2px 9px; border-radius: 14px; font-size: 12px; font-weight: 600; margin: 0 4px 4px 0;
}
.chip .x { cursor: pointer; opacity: .6; font-size: 13px; line-height: 1; }
.chip .x:hover { opacity: 1; }

/* ---------------- 统计卡 ---------------- */
.statgrid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 16px; }
@media (max-width: 1180px) { .statgrid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px) { .statgrid { grid-template-columns: 1fr; } }

.stat {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12.5px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 27px; font-weight: 700; margin-top: 7px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 4px; }
.stat .d { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.stat.accent { border-left: 3px solid var(--brand); }
.stat.accent.green { border-left-color: var(--green); }
.stat.accent.amber { border-left-color: var(--amber); }
.stat.accent.violet { border-left-color: var(--violet); }

/* ---------------- 模态框 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 1000; overflow-y: auto;
  animation: fade .12s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 640px; max-width: 100%; animation: pop .14s ease;
}
@keyframes pop { from { transform: translateY(-10px) scale(.99); opacity: .6 } to { transform: none; opacity: 1 } }
.modal.wide { width: 900px; }
.modal.narrow { width: 440px; }
.modal-head {
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-head .x {
  margin-left: auto; cursor: pointer; color: var(--text-3);
  font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.modal-head .x:hover { background: var(--gray-bg); color: var(--text); }
.modal-body { padding: 18px 20px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot {
  padding: 13px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 9px; align-items: center;
}
.modal-foot .spacer { flex: 1; }

/* ---------------- 提示 ---------------- */
#toasts {
  position: fixed; top: 16px; right: 16px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px; max-width: 400px;
}
.toast {
  background: #1c2433; color: #fff; padding: 11px 15px; border-radius: 8px;
  box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 9px;
  align-items: flex-start; animation: slide .16s ease;
}
@keyframes slide { from { transform: translateX(20px); opacity: 0 } to { transform: none; opacity: 1 } }
.toast .ti { font-size: 15px; line-height: 1.2; }
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
.toast.warn { background: #78350f; }

/* ---------------- 排课日历 ---------------- */
.sched-filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 12px; }
.week-nav { display: flex; align-items: center; gap: 7px; }
.week-nav .label { font-weight: 700; font-size: 14px; min-width: 190px; text-align: center; }

.cal-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; max-height: calc(100vh - 250px); }
.cal { display: grid; min-width: 900px; }
.cal-head {
  position: sticky; top: 0; z-index: 5; background: #f8fafd;
  border-bottom: 1px solid var(--border);
}
.cal-corner, .cal-dayhead, .cal-time, .cal-cell { border-right: 1px solid #eef1f6; border-bottom: 1px solid #eef1f6; }
.cal-corner { background: #f8fafd; }
.cal-dayhead {
  padding: 8px 6px; text-align: center; background: #f8fafd;
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
}
.cal-dayhead.today { background: var(--brand-light); color: var(--brand-dark); }
.cal-dayhead .dw { font-size: 11px; color: var(--text-3); font-weight: 500; }
.cal-dayhead.today .dw { color: var(--brand); }
.cal-time {
  font-size: 11px; color: var(--text-3); text-align: right; padding: 2px 6px 0 0;
  background: #fcfdff; font-variant-numeric: tabular-nums;
}
.cal-cell { position: relative; background: #fff; }
.cal-cell:hover { background: #fbfcfe; }
.cal-cell.today { background: #f7faff; }
.cal-cell.now { box-shadow: inset 0 -2px 0 var(--brand); }

.les {
  position: absolute; left: 2px; right: 2px; border-radius: 6px;
  padding: 3px 6px; font-size: 11.5px; line-height: 1.35; overflow: hidden;
  cursor: pointer; border-left: 3px solid var(--brand);
  background: var(--brand-light); color: var(--brand-dark);
  transition: box-shadow .12s, transform .1s;
}
.les:hover { box-shadow: 0 2px 10px rgba(16,30,54,.2); z-index: 4; }
.les .t { font-weight: 700; }
.les .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.les.st-attended { background: var(--green-bg); color: #15803d; border-left-color: var(--green); }
.les.st-absent { background: var(--red-bg); color: #b91c1c; border-left-color: var(--red); }
.les.st-cancelled_early { background: var(--gray-bg); color: var(--text-3); border-left-color: #b6bfcd; }
.les.st-cancelled_late { background: var(--amber-bg); color: #b45309; border-left-color: var(--amber); }
.les.st-cancelled_teacher { background: #f1f5f9; color: var(--text-3); border-left-color: #94a3b8; text-decoration: line-through; }
.les.st-rescheduled { background: #f8fafc; color: var(--text-3); border-left-color: #cbd5e1; }
.les.st-trial { background: var(--violet-bg); color: #6d28d9; border-left-color: var(--violet); }
.les.group { border-right: 3px solid rgba(0,0,0,.08); }

/* ---------------- 登录页 ---------------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 30px 16px;
  background: linear-gradient(140deg, #182642 0%, #23407a 55%, #2f6fed 100%);
}
.auth-card {
  width: 420px; max-width: 100%; background: #fff; border-radius: 14px;
  box-shadow: 0 24px 70px rgba(8, 18, 40, .38); padding: 30px 30px 22px;
}
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.auth-logo {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 46px;
  background: linear-gradient(135deg, var(--brand), #1e50c0); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 23px;
}
.auth-title { font-size: 16.5px; font-weight: 700; line-height: 1.35; }
.auth-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.auth-btn { width: 100%; margin-top: 6px; }
.auth-tip { font-size: 12px; color: var(--text-3); margin-top: 12px; text-align: center; }
.auth-foot {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.6;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
/* 登录页版本号：用户报障时可据此确认线上版本 */
.auth-foot .auth-ver {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px; color: var(--muted);
}
.auth-foot .auth-ver:empty { display: none; }
.auth-card .field > label { font-weight: 600; }

/* ---------------- 账号菜单 ---------------- */
.user-chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 5px 10px 5px 5px; border-radius: 20px; border: 1px solid var(--border);
  background: #fff; user-select: none; transition: background .12s, border-color .12s;
}
.user-chip:hover { background: #f5f8fd; border-color: var(--border-strong); }
.u-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand-light);
  color: var(--brand-dark); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.u-name { font-size: 13px; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-caret { font-size: 10px; color: var(--text-3); }

.user-menu {
  position: fixed; z-index: 1500; width: 230px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: pop .12s ease;
}
.um-head { padding: 12px 14px; border-bottom: 1px solid var(--border); background: #f8fafd; }
.um-item { padding: 10px 14px; font-size: 13.5px; cursor: pointer; transition: background .1s; }
.um-item:hover { background: var(--brand-light); }
.um-item.danger { color: var(--red); }
.um-item.danger:hover { background: var(--red-bg); }
.um-sep { height: 1px; background: var(--border); }
.um-foot {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #fafbfd;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ---------------- 周/月视图切换 ---------------- */
.view-switch {
  display: inline-flex; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); overflow: hidden; background: #fff;
}
.vs-btn {
  padding: 7px 15px; border: none; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text-2); white-space: nowrap;
  transition: background .12s, color .12s;
}
.vs-btn + .vs-btn { border-left: 1px solid var(--border); }
.vs-btn:hover { background: #f5f7fb; color: var(--text); }
.vs-btn.active { background: var(--brand); color: #fff; font-weight: 600; }

/* ---------------- 月视图 ---------------- */
.month-wrap { padding: 0 0 4px; }

.month-summary {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 10px 14px; font-size: 12.5px;
  background: #f8fafd; border-bottom: 1px solid var(--border);
}
.month-summary .spacer { flex: 1; }
.month-summary b { font-variant-numeric: tabular-nums; }

.m-head-row {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border); background: #f8fafd;
}
.m-dow {
  padding: 7px 4px; text-align: center; font-size: 12px; font-weight: 700;
  color: var(--text-2); border-right: 1px solid #eef1f6;
}
.m-dow:last-child { border-right: none; }
.m-dow.weekend { color: var(--brand-dark); background: #f2f6ff; }

.m-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }

.m-cell {
  min-height: 124px; padding: 3px 3px 5px; border-right: 1px solid #eef1f6;
  border-bottom: 1px solid #eef1f6; background: #fff; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  transition: background .1s;
}
.m-cell:nth-child(7n) { border-right: none; }
.m-cell:hover { background: #fbfcfe; }
.m-cell.out { background: #fafbfd; }
.m-cell.out .m-day { color: #c3cad6; }
.m-cell.weekend { background: #fcfdff; }
.m-cell.weekend.out { background: #f8fafc; }
.m-cell.today { background: #f4f8ff; box-shadow: inset 0 0 0 2px var(--brand); }
.m-cell.today .m-day { color: var(--brand); font-weight: 800; }

.m-head {
  display: flex; align-items: center; gap: 5px;
  padding: 1px 3px 3px; font-size: 12px;
}
.m-head .spacer { flex: 1; }
.m-day { font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.m-today {
  font-size: 10px; background: var(--brand); color: #fff;
  padding: 0 5px; border-radius: 8px; font-weight: 600;
}
.m-count { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.m-list { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }

.m-les {
  display: flex; gap: 5px; align-items: baseline;
  padding: 2px 5px; border-radius: 4px; font-size: 11.5px;
  border-left: 3px solid var(--brand); background: var(--brand-light);
  color: var(--brand-dark); cursor: pointer; overflow: hidden;
  transition: box-shadow .1s;
}
.m-les:hover { box-shadow: 0 1px 6px rgba(16,30,54,.18); }
.m-les .mt { font-weight: 700; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.m-les .mn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-les.conflict { outline: 1.5px solid var(--red); outline-offset: -1.5px; }

.m-les.st-attended { background: var(--green-bg); color: #15803d; border-left-color: var(--green); }
.m-les.st-absent { background: var(--red-bg); color: #b91c1c; border-left-color: var(--red); }
.m-les.st-cancelled_early { background: var(--gray-bg); color: var(--text-3); border-left-color: #b6bfcd; }
.m-les.st-cancelled_late { background: var(--amber-bg); color: #b45309; border-left-color: var(--amber); }
.m-les.st-cancelled_teacher { background: #f1f5f9; color: var(--text-3); border-left-color: #94a3b8; text-decoration: line-through; }
.m-les.st-rescheduled { background: #f8fafc; color: var(--text-3); border-left-color: #cbd5e1; }
.m-les.st-trial { background: var(--violet-bg); color: #6d28d9; border-left-color: var(--violet); }

.m-more {
  font-size: 11px; color: var(--brand); padding: 1px 5px; cursor: pointer;
  border-radius: 4px; font-weight: 600;
}
.m-more:hover { background: var(--brand-light); }

@media (max-width: 900px) {
  .m-cell { min-height: 92px; }
  .m-les .mn { display: none; }
}

/* ---------------- 图表 ---------------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart .bar { transition: opacity .12s; }
.chart .bar:hover { opacity: .8; }
.chart text { font-size: 11px; fill: var(--text-3); }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .gridline { stroke: #eef1f6; stroke-width: 1; }
.chart .val { font-size: 10.5px; fill: var(--text-2); font-weight: 600; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

.hbar { display: flex; flex-direction: column; gap: 9px; }
.hbar .row { display: grid; grid-template-columns: 108px 1fr 76px; align-items: center; gap: 10px; font-size: 12.5px; }
.hbar .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.hbar .track { height: 16px; background: var(--gray-bg); border-radius: 8px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 8px; background: var(--brand); transition: width .3s; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------------- 详情页 ---------------- */
.detail-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.avatar {
  width: 54px; height: 54px; border-radius: 50%; background: var(--brand-light);
  color: var(--brand-dark); display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 700; flex: 0 0 54px;
}
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 7px 12px; font-size: 13px; }
.kv .k { color: var(--text-3); }
.kv .v { color: var(--text); word-break: break-all; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 9px 16px; cursor: pointer; font-size: 13.5px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------------- 其它 ---------------- */
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px;
  margin-bottom: 13px; display: flex; gap: 9px; align-items: flex-start;
}
.alert.warn { background: var(--amber-bg); color: #92400e; }
.alert.err { background: var(--red-bg); color: #991b1b; }
.alert.info { background: var(--brand-light); color: var(--brand-dark); }
.alert.ok { background: var(--green-bg); color: #166534; }

.loading { padding: 40px; text-align: center; color: var(--text-3); }
.spinner {
  display: inline-block; width: 20px; height: 20px; border: 2.5px solid var(--border-strong);
  border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.row-flex { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* 打印 */
@media print {
  .sidebar, .topbar, .toolbar, .no-print, #toasts, .user-menu { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card { box-shadow: none; border: none; margin: 0; }
  .modal-body { max-height: none; overflow: visible; }
  .mask { position: static; padding: 0; background: #fff; display: block; }
  .modal { box-shadow: none; width: 100%; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
