:root {
  --blue-50: #e6f1fb;
  --blue-100: #b5d4f4;
  --blue-400: #378add;
  --blue-600: #185fa5;
  --blue-800: #0c447c;
  --blue-900: #042c53;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e3e8ef;
  --text: #1d2939;
  --text-2: #667085;
  --text-3: #98a2b3;
  --red: #d92d20;
  --red-bg: #fef3f2;
  --amber: #b54708;
  --amber-bg: #fffaeb;
  --green: #067647;
  --green-bg: #ecfdf3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0c447c 0%, #185fa5 55%, #378add 100%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: #fff; border-radius: 14px;
  padding: 32px 28px; box-shadow: 0 12px 40px rgba(4, 44, 83, .28);
}
.login-card h1 { font-size: 20px; margin: 0 0 4px; color: var(--blue-800); font-weight: 600; }
.login-card p.sub { margin: 0 0 24px; color: var(--text-2); font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; margin-top: 8px; }
.login-err { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 8px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.side {
  width: 210px; flex: 0 0 210px; background: var(--blue-900); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side .brand {
  padding: 18px 18px 14px; font-size: 15px; font-weight: 600; letter-spacing: .5px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.side .brand small { display: block; font-weight: 400; font-size: 11px; color: #9cc3e8; margin-top: 3px; letter-spacing: 0; }
.nav { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 18px; color: #cfe3f7;
  text-decoration: none; font-size: 13.5px; border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: rgba(55,138,221,.28); border-left-color: #85b7eb; color: #fff; font-weight: 500; }
.nav a .ico { width: 16px; text-align: center; opacity: .9; font-size: 13px; }
.nav .grp { padding: 14px 18px 4px; font-size: 11px; color: #6f9ac4; letter-spacing: 1px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 16px; margin: 0; font-weight: 600; color: var(--blue-800); }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue-50); color: var(--blue-600);
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}

.content { padding: 18px 20px 60px; flex: 1; }

/* ---------- 卡片 / 统计 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12px; color: var(--text-2); }
.stat .v { font-size: 26px; font-weight: 600; color: var(--blue-800); line-height: 1.25; margin-top: 2px; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.stat.warn .v { color: var(--red); }
.stat.mid .v { color: var(--amber); }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.panel-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.panel-h h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--blue-800); }
.panel-b { padding: 14px 16px; }
.panel-b.p0 { padding: 0; }
.panel-h .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  background: #f8fafc; text-align: left; padding: 10px 12px; font-weight: 600;
  color: var(--text-2); border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px;
}
table.tb td { padding: 10px 12px; border-bottom: 1px solid #f1f4f8; vertical-align: middle; }
table.tb tbody tr:hover { background: #f8fbfe; }
table.tb td.ops { white-space: nowrap; }
.empty { padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------- 卡片列表（手机端用来替代宽表格） ---------- */
.card-list { display: flex; flex-direction: column; gap: 9px; padding: 10px; background: #f6f8fb; }
.cl-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 0; }
.cl-h { display: flex; align-items: flex-start; gap: 8px; }
.cl-t { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--blue-900); line-height: 1.4; word-break: break-word; }
.cl-t b { font-weight: 600; }
.cl-t .tag { font-weight: 400; }
.cl-s { flex: 0 0 auto; padding-top: 1px; }
.cl-b { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 4px 10px; margin-top: 7px; }
.cl-k { font-size: 11.5px; color: var(--text-3); line-height: 1.65; }
.cl-v { font-size: 12.5px; color: var(--text-2); line-height: 1.65; min-width: 0; word-break: break-word; }
.cl-v .tag { margin-right: 4px; }
.cl-ops {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end;
  margin: 9px -12px 0; padding: 8px 12px; border-top: 1px solid #f1f4f8;
  background: #fcfdfe; border-radius: 0 0 10px 10px;
}

/* ---------- 隐患清单 ---------- */
.hz-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #f1f4f8; }
.hz-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.hz-main { flex: 1; min-width: 0; }
.hz-desc { font-size: 13.5px; font-weight: 500; }
.hz-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.hz-pics { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.hz-pics img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid var(--line); }
.hz-side { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.hz-mini { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f4f8; }
.hz-mini:last-child { border-bottom: 0; }
.hz-mini-t { min-width: 0; font-size: 13px; }
.hz-mini-t span { display: block; font-size: 12px; color: var(--text-3); }
.side-foot { display: none; }
.tb-l { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* 巡查表单：检查项照片 */
.iphot { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px 23px; flex-wrap: wrap; }
.ithumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.ithumb { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.ithumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.ithumb .idel {
  position: absolute; top: 0; right: 0; width: 18px; height: 18px; line-height: 16px; text-align: center;
  background: rgba(255,255,255,.85); color: #d92d20; border: none; border-radius: 0 0 0 8px; cursor: pointer; font-size: 13px; padding: 0;
}
.ithumb .ibusy { position: absolute; inset: 0; background: rgba(255,255,255,.65); color: var(--blue-600); font-size: 10px; display: grid; place-items: center; }
.iadd { padding: 6px 12px; font-size: 12.5px; color: var(--blue-600); background: var(--blue-50); border: 1px dashed var(--blue-100); border-radius: 8px; cursor: pointer; }
.iadd input { display: none; }
.iadd + .iadd { margin-left: 8px; }
.iadd.off { display: none; }
.itip { font-size: 11.5px; color: var(--text-3); }

/* 使用记录：暂无记录的实训室卡片 */
.ucard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ucard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; text-align: left; font: inherit; line-height: 1.35;
  background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; cursor: default;
}
button.ucard { cursor: pointer; }
button.ucard:hover { background: var(--blue-50); border-color: var(--blue-100); }
button.ucard:hover .ucard-add { opacity: 1; }
.ucard-name { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ucard-code { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ucard-add { margin-top: 3px; font-size: 12px; color: var(--blue-600); opacity: .75; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.pager-info { margin-right: auto; font-size: 12.5px; color: var(--text-3); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 14px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; font-size: 13px;
  transition: .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--blue-100); color: var(--blue-600); background: #fafcff; }
.btn.primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn.primary:hover { background: var(--blue-800); color: #fff; }
.btn.danger { color: var(--red); border-color: #f4c3bf; }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue-600); }
.btn.ghost:hover { background: var(--blue-50); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.field label .req { color: var(--red); margin-left: 2px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d0d7e2; border-radius: 7px;
  background: #fff; color: var(--text); outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(55,138,221,.13); }
textarea { resize: vertical; min-height: 72px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px;
  line-height: 1.6; white-space: nowrap;
}
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.blue { background: var(--blue-50); color: var(--blue-600); }
.tag.gray { background: #f2f4f7; color: var(--text-2); }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 620px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(4,44,83,.3);
}
.modal-h {
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-h h3 { margin: 0; font-size: 15px; color: var(--blue-800); }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f {
  padding: 12px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}
.x { background: none; border: 0; font-size: 20px; color: var(--text-3); cursor: pointer; line-height: 1; padding: 4px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%);
  background: var(--blue-900); color: #fff; padding: 9px 18px; border-radius: 8px;
  font-size: 13px; z-index: 300; box-shadow: 0 6px 20px rgba(4,44,83,.3);
  opacity: 0; transition: .2s; pointer-events: none; max-width: 90vw;
}
.toast.on { opacity: 1; }
.toast.err { background: #b42318; }

/* ---------- 评分 / 进度 ---------- */
.bar { height: 6px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue-600); }

/* ---------- 页脚备案 ---------- */
.foot {
  padding: 12px 20px 16px; text-align: center; font-size: 12px; color: var(--text-3);
  display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap;
}
.foot a { color: var(--text-3); text-decoration: none; }
.foot a:hover { color: var(--blue-600); text-decoration: underline; }
.foot a.ga { display: inline-flex; align-items: center; gap: 3px; }

/* ---------- 响应式 ---------- */
.mobile-only { display: none; }

@media (max-width: 860px) {
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 90;
    transform: translateX(-100%); transition: .22s; width: 240px; flex-basis: 240px;
    box-shadow: 0 0 30px rgba(4,44,83,.28);
  }
  .side.open { transform: translateX(0); }
  .sidebar-mask { position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 80; }
  .mobile-only { display: inline-flex; }
  .side .nav a { padding: 11px 18px; font-size: 14px; }
  .side .nav .grp { padding: 14px 18px 4px; }
  .side-foot {
    display: block; border-top: 1px solid rgba(255,255,255,.12); padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  }
  .side-foot .sf-u { display: flex; align-items: center; gap: 9px; color: #fff; }
  .side-foot .sf-u .avatar { background: rgba(255,255,255,.16); color: #dbeaf9; width: 32px; height: 32px; }
  .side-foot .sf-u em { font-style: normal; display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }
  .side-foot .sf-u i { font-style: normal; font-size: 11px; color: #9cc3e8; margin-top: 2px; }
  .side-foot .sf-b { display: flex; gap: 8px; margin-top: 10px; }
  .side-foot .sf-b .btn { flex: 1; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); color: #eaf3fc; }

  .content { padding: 12px 12px 40px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .who { gap: 6px; }
  .topbar .who .avatar, .topbar .who .who-t, .topbar #pwdBtn { display: none; }
  .tb-l { flex: 1; min-width: 0; }

  .cards { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 9px; }
  .stat { padding: 11px 12px; }
  .stat .k { font-size: 11.5px; }
  .stat .v { font-size: 21px; }
  .form-grid { grid-template-columns: 1fr; }
  .panel-h { padding: 11px 12px; }
  .panel-h h3 { font-size: 13.5px; }
  .panel-b { padding: 12px; }
  .pager { padding: 9px 12px; }
  table.tb th, table.tb td { padding: 8px 9px; }

  /* 表单弹窗：贴边、底部按钮加高，方便手指点 */
  .mask { padding: 0; align-items: flex-end; }
  .modal { max-width: 100% !important; max-height: 94dvh; border-radius: 14px 14px 0 0; }
  .modal-h { padding: 13px 16px; }
  .modal-b { padding: 14px 16px; }
  .modal-f { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .modal-f .btn { flex: 1; padding: 10px; }
  .hz-row { flex-direction: column; gap: 9px; }
  .hz-side { width: 100%; flex-wrap: wrap; }
}

/* ---------- 手机（≤640px）：列表全部改卡片，进一步收紧 ---------- */
@media (max-width: 640px) {
  .content { padding: 10px 10px 36px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 9px 10px; border-radius: 8px; }
  .stat .k { font-size: 10.5px; line-height: 1.35; }
  .stat .v { font-size: 18px; margin-top: 1px; }
  .stat .v small { font-size: 10px; margin-left: 1px; }

  .panel { border-radius: 9px; margin-bottom: 12px; }
  .panel-h { flex-wrap: wrap; gap: 8px; }
  .panel-h h3 { flex: 1 1 100%; }
  .panel-h .tools, .panel-h > .btn { width: auto; }

  /* iOS 输入框字号 <16px 会触发自动放大，这里统一到 16px */
  input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea { font-size: 16px; padding: 9px 10px; }
  .field label { font-size: 12px; }

  .btn { padding: 8px 13px; }
  .btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 6px; }
  .pager { flex-wrap: wrap; gap: 6px; }
  .pager-info { flex: 1 1 100%; }

  .foot { font-size: 11px; padding: 10px 12px 14px; }
  .bdm-room .nm { font-size: 12px; }
  #content .qr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #content .qr-item { padding: 12px 8px; }
  #content .qr-box canvas, #content .qr-box img { width: 118px !important; height: 118px !important; }
  .ucard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ucard { padding: 9px 10px; }
  .hz-desc { font-size: 13px; }
  .hz-side .btn { flex: 1; }
}

@media (max-width: 380px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-b { grid-template-columns: 56px minmax(0, 1fr); }
}

@media print {
  .side, .topbar, .no-print { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}

/* ================= 实训室使用看板（课表式） ================= */
.bd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bd-title h2 { margin: 0; font-size: 18px; color: var(--blue-900); letter-spacing: .2px; }
.bd-title p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-2); }
.bd-title p b { color: var(--blue-700); font-weight: 600; }
.bd-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bd-tools input[type=date] { width: auto; padding: 6px 9px; font-size: 13px; }

/* 课表矩阵 */
.bdm-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.bdm { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.bdm th, table.bdm td { border-bottom: 1px solid var(--line); padding: 0; }
table.bdm thead th {
  background: #f8fafc; padding: 7px 6px; text-align: center; font-weight: 600;
  font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--line);
}
table.bdm thead tr:first-child th { font-size: 11.5px; color: var(--blue-700); letter-spacing: 1px; padding: 5px 6px; }
table.bdm thead th b { display: block; font-size: 12.5px; color: var(--blue-800); font-weight: 600; }
table.bdm thead th em { display: block; font-style: normal; font-size: 11px; color: var(--text-3); font-weight: 400; margin-top: 1px; }
table.bdm thead th.is-now { background: #e6f1fb; box-shadow: inset 0 3px 0 var(--blue-600); }
table.bdm thead th.is-now b, table.bdm thead th.is-now em { color: var(--blue-800); }

/* 首列：实训室（横向滚动时固定） */
table.bdm th.bdm-room, table.bdm td.bdm-room {
  width: 200px; min-width: 200px; text-align: left; padding: 9px 12px;
  background: #fff; position: sticky; left: 0; z-index: 2;
}
table.bdm thead th.bdm-room { background: #f8fafc; z-index: 3; border-right: 1px solid var(--line); }
table.bdm td.bdm-room { border-right: 1px solid var(--line); }
.bdm-room b { font-size: 12.5px; color: var(--blue-800); letter-spacing: .3px; font-family: ui-monospace, Consolas, monospace; }
.bdm-room .nm { display: block; font-size: 12.5px; color: var(--text); margin-top: 1px; line-height: 1.3; }
.bdm-room .mt { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.bdm-room .mt i { font-style: normal; color: var(--red); }
tr.st-busy td.bdm-room { box-shadow: inset 3px 0 0 #12b76a; }
tr.st-booked td.bdm-room { box-shadow: inset 3px 0 0 var(--blue-400); }
tr.st-pending td.bdm-room { box-shadow: inset 3px 0 0 #f79009; }
tr.st-free td.bdm-room { box-shadow: inset 3px 0 0 #e3e8ef; }
table.bdm tbody tr:hover td { background: #fbfdff; }
table.bdm tbody tr:hover td.bdm-room { background: #fbfdff; }

/* 格子 */
td.bdm-slot { padding: 5px 5px !important; vertical-align: middle; }
td.bdm-slot.is-now { background: rgba(24, 95, 165, .045); }
.bdm-slot .b {
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  min-height: 42px; padding: 5px 9px; border-radius: 7px;
}
.bdm-slot.free .b { background: #fafbfc; border: 1px dashed #e6eaf0; }
.bdm-slot.free .who { font-size: 11.5px; color: #b9c2cf; font-weight: 400; }
.bdm-slot.ok .b { background: #e6f1fb; border: 1px solid #b5d4f4; }
.bdm-slot.ok .who { color: var(--blue-900); font-weight: 600; }
.bdm-slot.pend .b { background: #fffaeb; border: 1px dashed #f5c26b; }
.bdm-slot.pend .who { color: #b54708; font-weight: 600; }
.bdm-slot .who { font-size: 12.5px; line-height: 1.3; }
.bdm-slot .cls { font-size: 11px; color: var(--text-2); line-height: 1.3; }
.bdm-slot.ok .cls { color: var(--blue-700); }
.bdm-slot.pend .cls { color: #b54708; opacity: .8; }

/* 图例 */
.bd-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 12px; color: var(--text-2); }
.bd-legend .sw { width: 20px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.bd-legend .sw.ok { background: #e6f1fb; border: 1px solid #b5d4f4; }
.bd-legend .sw.pend { background: #fffaeb; border: 1px dashed #f5c26b; }
.bd-legend .sw.free { background: #fafbfc; border: 1px dashed #e6eaf0; }
.bd-legend .tip { margin-left: auto; color: var(--text-3); font-size: 11.5px; }
.bd-legend-bar { padding: 9px 14px; border-top: 1px solid var(--line); background: #fcfdfe; }

/* ---------- 手机版看板（卡片式，替代宽课表） ---------- */
.bd-head.is-narrow { align-items: flex-start; flex-direction: column; gap: 10px; }
.bd-head.is-narrow .bd-title h2 { font-size: 16px; }
.bd-head.is-narrow .bd-title p { font-size: 12px; }
.bd-head.is-narrow .bd-title p b { font-weight: 600; }
.bd-head.is-narrow .bd-tools { width: 100%; gap: 6px; }
.bd-head.is-narrow .bd-tools input[type=date] { flex: 1 1 96px; min-width: 0; }
.bd-head.is-narrow .bd-tools .btn { padding: 6px 10px; }

.bd-mob { display: flex; flex-direction: column; gap: 9px; padding: 11px; }
.m-room { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.m-h { display: flex; align-items: center; gap: 7px; min-width: 0; }
.m-h b { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--blue-800); flex: 0 0 auto; }
.m-h .m-nm { font-size: 13px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-h .m-st { margin-left: auto; flex: 0 0 auto; font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 20px; background: #f2f4f7; color: var(--text-2); }
.m-st.on { background: var(--green-bg); color: var(--green); }
.m-st.bk { background: var(--blue-50); color: var(--blue-700); }
.m-st.pd { background: var(--amber-bg); color: var(--amber); }
.m-rows { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.m-r { display: flex; align-items: baseline; gap: 6px; font-size: 12px; padding: 5px 8px; border-radius: 6px; background: #f6f9fd; border-left: 2px solid var(--blue-400); }
.m-r.pend { background: #fffdf5; border-left-color: #f79009; }
.m-r i { flex: 0 0 auto; font-style: normal; font-size: 11.5px; color: var(--blue-700); font-variant-numeric: tabular-nums; }
.m-r.pend i { color: var(--amber); }
.m-r b { font-size: 12px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-r em { margin-left: auto; flex: 0 1 auto; max-width: 46%; font-style: normal; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-empty { margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.m-box { background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.m-box .lb { display: block; font-size: 11.5px; color: var(--text-3); }
.m-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.m-chip { font-size: 11.5px; padding: 1px 9px; border-radius: 20px; background: #f2f4f7; border: 1px solid var(--line); color: var(--text-2); }

@media (max-width: 900px) {
  table.bdm th.bdm-room, table.bdm td.bdm-room { width: 148px; min-width: 148px; padding: 8px 9px; }
  .bdm-room .nm { font-size: 12px; }
  .bdm-room .mt { display: none; }
}
@media (max-width: 560px) {
  table.bdm { min-width: 640px; }
  .bd-title h2 { font-size: 16px; }
  .bd-legend-bar { padding: 8px 10px; gap: 8px 12px; }
  .bd-legend .tip { display: none; }
}

/* ---------- 手机端底部导航（方案B） ---------- */
.mtabbar { display: none; }
.mt-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid #f1f4f8; color: #1d2939; text-decoration: none; font-size: 14px;
}
.mt-row:last-child { border-bottom: 0; }
.mt-row .mt-l { flex: 1; min-width: 0; }
.mt-row .mt-n { font-size: 16px; font-weight: 600; color: #98a2b3; }
.mt-row .mt-n.hot { color: #d92d20; }
.mt-row .mt-ar { color: #98a2b3; font-size: 13px; }
.mt-dot { width: 7px; height: 7px; border-radius: 50%; background: #d0d7e2; flex: 0 0 7px; }
.mt-dot.hot { background: #d92d20; }
.mt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.mt-gi {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 11.5px; color: #1d2939; text-decoration: none; text-align: center;
}
.mt-gi:active .mt-gic { background: #d8e8f8; }
.mt-gic {
  width: 44px; height: 44px; border-radius: 12px; background: #e6f1fb; color: #185fa5;
  display: grid; place-items: center; font-size: 18px;
}
.mt-gic.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; flex: 0 0 30px; }
.avatar.big { width: 52px; height: 52px; font-size: 20px; flex: 0 0 52px; }
.mt-me { display: flex; align-items: center; gap: 12px; }
.mt-me b { font-size: 16px; display: block; }
.mt-me i { font-style: normal; font-size: 12px; color: #98a2b3; display: block; margin-top: 3px; }

@media (max-width: 640px) {
  .mtabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    background: #fff; border-top: 1px solid #e3e8ef;
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
    box-shadow: 0 -1px 8px rgba(4, 44, 83, .06);
  }
  .mtabbar a { text-align: center; font-size: 10px; color: #667085; text-decoration: none; padding: 2px 0; }
  .mtabbar a .ti { display: block; font-size: 18px; line-height: 1.25; }
  .mtabbar a.on { color: #185fa5; font-weight: 600; }
  /* 有底部导航后，顶栏「目录」抽屉按钮不再需要 */
  .mobile-only { display: none !important; }
  /* 顶栏只留标题，退出/改密收进「我的」 */
  .topbar #outBtn, .topbar #pwdBtn { display: none; }
  .content { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
