/* ==================================================================
   高中后勤管理系统 - 样式表
   移动端优先的响应式设计，兼容各系统桌面浏览器与手机浏览器
   ================================================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --purple: #7c3aed;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e5e9f0;
  --border-light: #f0f2f7;
  --text: #1f2937;
  --text-2: #4b5563;
  --text-3: #9ca3af;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);

  --sidebar-w: 216px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

a { color: var(--primary); text-decoration: none; }

/* ============================ 登录页 ============================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  padding: 20px;
}

.login-wrap {
  width: 100%;
  max-width: 940px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 0;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.login-hero {
  background: linear-gradient(160deg, #1e40af, #2563eb);
  color: #fff;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-hero h1 { font-size: 26px; margin: 0 0 8px; font-weight: 700; letter-spacing: .5px; }
.login-hero p { margin: 0 0 24px; opacity: .85; font-size: 13px; }

.login-features { list-style: none; padding: 0; margin: 0; }
.login-features li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; font-size: 13px; opacity: .95;
}
.login-features li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #93c5fd; flex: none;
}

.login-form { padding: 40px 36px; }
.login-form h2 { font-size: 20px; margin: 0 0 4px; }
.login-form .sub { color: var(--text-3); font-size: 13px; margin-bottom: 24px; }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; max-width: 420px; }
  .login-hero { padding: 28px 24px; }
  .login-hero h1 { font-size: 22px; }
  .login-features { display: none; }
  .login-form { padding: 28px 24px; }
}

/* ============================ 布局 ============================ */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 60;
  transition: transform .25s ease;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 700; font-size: 15px;
  white-space: nowrap; overflow: hidden;
}
.sidebar-brand .logo {
  width: 30px; height: 30px; flex: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.sidebar-brand small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-group-title {
  font-size: 11px; color: var(--text-3); padding: 12px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; font-size: 13.5px;
  margin-bottom: 2px; position: relative;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--border-light); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-item .ic { width: 18px; text-align: center; flex: none; opacity: .9; }
.nav-item .badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar .menu-btn { display: none; }
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent;
  cursor: pointer; color: var(--text-2); font-size: 16px; position: relative;
}
.topbar .icon-btn:hover { background: var(--border-light); }

.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 8px; border-radius: 20px;
}
.user-chip:hover { background: var(--border-light); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex: none; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .meta { line-height: 1.2; }
.user-chip .meta b { display: block; font-size: 13px; }
.user-chip .meta span { font-size: 11px; color: var(--text-3); }

.dropdown {
  position: absolute; right: 0; top: 44px; min-width: 180px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 6px; z-index: 100; display: none;
}
.dropdown.show { display: block; }
.dropdown button {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text-2);
}
.dropdown button:hover { background: var(--border-light); color: var(--text); }

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

/* ============================ 通用组件 ============================ */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 16px; overflow: hidden;
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.page-head {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.page-head .desc { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.page-head .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: #fff; color: var(--text-2); cursor: pointer; font-size: 13.5px;
  font-family: inherit; transition: all .15s; white-space: nowrap;
  min-height: 36px;
}
.btn:hover { background: var(--border-light); border-color: #d5dae3; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.94); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; min-height: 30px; }
.btn-block { width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--border-light); }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* 表单 */
.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500;
}
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=tel], input[type=month], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}
textarea { min-height: 78px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
input:disabled, select:disabled, textarea:disabled { background: #f7f8fa; color: var(--text-3); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* 表格 */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.data th {
  background: #fafbfd; text-align: left; padding: 10px 14px;
  font-weight: 600; color: var(--text-2); font-size: 12.5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data td {
  padding: 11px 14px; border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
table.data tbody tr:hover { background: #fafbfd; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .actions { white-space: nowrap; text-align: right; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 可排序表头：点击列标题排序 */
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--primary); background: #f2f5fa; }
table.data th .sort-arrow { color: var(--primary); font-size: 10px; }
/* 列表筛选条 */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px 0 0; font-size: 13px; color: var(--text-2);
}
.filter-bar label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.filter-bar select { width: auto; min-width: 110px; display: inline-block; }
/* 可搜索下拉（combo） */
.combo { position: relative; }
.combo .combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  max-height: 260px; overflow-y: auto; overflow-x: hidden;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
}
.combo .combo-item {
  padding: 8px 12px; font-size: 13px; line-height: 1.5; cursor: pointer;
  border-bottom: 1px solid var(--border-light); word-break: break-all;
}
.combo .combo-item:last-child { border-bottom: none; }
.combo .combo-item:hover, .combo .combo-item.on { background: #eef4ff; color: var(--primary); }
.combo .combo-empty { padding: 12px; font-size: 12.5px; color: var(--text-3); text-align: center; }
.combo .combo-group {
  position: sticky; top: 0; z-index: 1;
  padding: 5px 12px; font-size: 11.5px; font-weight: 600; color: var(--text-3);
  background: #f4f6fa; border-bottom: 1px solid var(--border-light);
}

/* 徽章 */
.badge-status {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.s-pending { background: var(--warning-light); color: #92400e; }
.s-progress { background: var(--primary-light); color: #1e40af; }
.s-success { background: var(--success-light); color: #15803d; }
.s-danger  { background: var(--danger-light); color: #b91c1c; }
.s-muted   { background: #f1f3f7; color: var(--text-2); }
.s-info    { background: #cffafe; color: #0e7490; }
.s-purple  { background: #ede9fe; color: #6d28d9; }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: #f1f3f7; color: var(--text-2); font-size: 12px; margin-right: 4px;
}

/* 统计卡片 */
.stat-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-bottom: 16px;
}
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; gap: 13px; transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff;
}
.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-icon.green { background: linear-gradient(135deg, #16a34a, #4ade80); }
.stat-icon.red { background: linear-gradient(135deg, #dc2626, #f87171); }
.stat-icon.purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.stat-icon.yellow { background: linear-gradient(135deg, #d97706, #fbbf24); }
.stat-icon.cyan { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.stat-icon.teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.stat-body { min-width: 0; flex: 1; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; word-break: break-word; }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
/* 紧凑统计卡：宽屏 7 张一行（宿舍管理等卡片较多时使用） */
.stat-grid.compact { grid-template-columns: repeat(7, 1fr); gap: 10px; }
.stat-grid.compact .stat-card { padding: 12px 12px; gap: 10px; }
.stat-grid.compact .stat-icon { width: 36px; height: 36px; font-size: 17px; border-radius: 9px; }
.stat-grid.compact .stat-value { font-size: 19px; }
.stat-grid.compact .stat-label { font-size: 12px; white-space: nowrap; }
.stat-grid.compact .stat-sub { font-size: 11px; }
@media (max-width: 1360px) { .stat-grid.compact { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 860px) { .stat-grid.compact { grid-template-columns: repeat(2, 1fr); } }

/* 筛选栏 */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light); background: #fcfdff;
}
.filters .field { margin-bottom: 0; min-width: 140px; flex: 1 1 150px; }
.filters .field > label { font-size: 12px; margin-bottom: 4px; }
.filters .actions { display: flex; gap: 8px; flex: none; }

/* 分页 */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border-light);
}
.pager .info { color: var(--text-3); font-size: 13px; }
.pager .btns { display: flex; gap: 6px; }

/* 空状态 */
.empty {
  padding: 46px 20px; text-align: center; color: var(--text-3);
}
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: .5; }
.empty p { margin: 4px 0; }

/* 标签页（全系统统一：放大醒目，选中项主题色高亮） */
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  padding: 0 16px; overflow-x: auto; background: #fff;
}
.tabs button {
  border: none; background: none; padding: 13px 22px; cursor: pointer;
  font-size: 15.5px; color: var(--text-2); border-bottom: 2px solid transparent;
  font-family: inherit; white-space: nowrap; margin-bottom: -1px;
  border-radius: 9px 9px 0 0; transition: background .15s;
}
.tabs button:hover { background: #f1f5fb; }
.tabs button.active {
  color: var(--primary-dark); border-bottom-color: var(--primary);
  font-weight: 700; background: var(--primary-light);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  padding: 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg); max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.97); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.modal-head {
  padding: 15px 18px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.modal-head .close {
  border: none; background: none; font-size: 20px; cursor: pointer; color: var(--text-3);
  line-height: 1; padding: 2px 6px;
}
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 8px;
}
.modal.wide { max-width: 820px; }

/* 抽屉（详情） */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 190;
}
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 480px; max-width: 100%;
  background: #fff; z-index: 195; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: slide .22s ease;
}
.drawer.wide { width: min(860px, 92vw); }
@keyframes slide { from { transform: translateX(24px); opacity: .6 } to { transform: none; opacity: 1 } }

/* 描述列表 */
.desc-list { display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; font-size: 13.5px; }
.desc-list dt { color: var(--text-3); }
.desc-list dd { margin: 0; color: var(--text); word-break: break-all; }
.desc-list.full { grid-template-columns: 1fr; }

/* 时间线 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: ""; position: absolute; left: -20px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
  border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary-light);
}
.timeline-item.reject::before { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-light); }
.timeline-item .t-title { font-size: 13.5px; font-weight: 500; }
.timeline-item .t-meta { font-size: 12px; color: var(--text-3); }
.timeline-item .t-comment {
  font-size: 13px; color: var(--text-2); background: #f7f8fa;
  padding: 6px 10px; border-radius: var(--radius-sm); margin-top: 5px;
}

/* 消息提示 */
.toast-wrap {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 20px;
  font-size: 13.5px; box-shadow: var(--shadow-md); animation: tin .2s ease;
  max-width: 90vw;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
@keyframes tin { from { transform: translateY(-10px); opacity: 0 } to { transform: none; opacity: 1 } }

/* 加载 */
.loading { padding: 40px; text-align: center; color: var(--text-3); }
.spinner {
  width: 26px; height: 26px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* 图片上传 */
.uploader { display: flex; gap: 8px; flex-wrap: wrap; }
.uploader .thumb {
  width: 76px; height: 76px; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); position: relative; background: #f7f8fa;
}
.uploader .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uploader .thumb .del {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.uploader .add {
  width: 76px; height: 76px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-3); font-size: 12px; background: #fafbfd;
}
.uploader .add:hover { border-color: var(--primary); color: var(--primary); }
.uploader .add span { font-size: 20px; line-height: 1; }

/* 明细表格录入 */
.grid-input { overflow-x: auto; }
.grid-input-tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
.grid-input-tbl th, .grid-input-tbl td {
  border: 1px solid var(--border); padding: 4px 6px; vertical-align: middle;
}
.grid-input-tbl thead th {
  background: #f5f7fa; color: var(--text-2); font-weight: 600; text-align: center; white-space: nowrap;
}
.grid-input-tbl td input {
  width: 100%; border: none; outline: none; background: transparent;
  padding: 4px 2px; font-size: 13px; color: var(--text-1); min-height: 26px;
}
.grid-input-tbl td input:focus { box-shadow: 0 0 0 2px rgba(37,99,235,.15); border-radius: 4px; }
.grid-input-tbl .gi-no { text-align: center; color: var(--text-3); background: #fafbfd; }
.grid-input-tbl .gi-sub { text-align: right; color: var(--text-2); background: #fafbfd; font-variant-numeric: tabular-nums; }
.grid-total { margin-top: 8px; text-align: right; font-size: 14px; color: var(--text-2); }
.grid-total b { color: #dc2626; font-size: 16px; margin-left: 2px; }
.grid-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.grid-tip { font-size: 12px; color: var(--text-2); }
/* 可点击的数字（如房间已住人数 → 住宿名单） */
.link-num {
  border: none; background: none; padding: 0; cursor: pointer;
  color: var(--primary); font-weight: 600; font-size: inherit;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.link-num:hover { color: #1d4ed8; }

.grid-input-tbl .gi-op { text-align: center; background: #fafbfd; }
.gi-del {
  border: 1px solid transparent; background: none; color: var(--danger);
  font-size: 12.5px; padding: 2px 6px; border-radius: 4px; cursor: pointer;
}
.gi-del:hover { background: #fee2e2; border-color: #fecaca; }
.gi-del:disabled { color: #cbd5e1; cursor: not-allowed; background: none; border-color: transparent; }

/* 宿舍一日常规检查表 */
.insp-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px;
  justify-content: center; margin: 4px 0 12px; text-align: center;
}
.insp-head b { font-size: 20px; color: #b91c1c; letter-spacing: 2px; }
.insp-head span { color: var(--text-2); font-size: 13px; }
.insp-block { overflow-x: auto; margin-bottom: 14px; }
.insp-report { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.insp-report th, .insp-report td {
  border: 1px solid #94a3b8; padding: 4px 6px; text-align: center; white-space: nowrap;
}
.insp-report thead th { background: #fef3c7; color: #92400e; font-weight: 700; min-width: 44px; }
.insp-report .insp-label {
  background: #fde68a; color: #78350f; font-weight: 600; text-align: left;
  min-width: 96px; position: sticky; left: 0; z-index: 1;
}
.insp-report .insp-cell { font-variant-numeric: tabular-nums; background: #fff; }
.insp-report .insp-deduct { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.insp-report .insp-remark { min-width: 72px; max-width: 140px; white-space: normal; color: var(--text-2); }
.insp-summary {
  margin-top: 10px; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: #f8fafc; font-size: 13px; line-height: 1.8;
}
.insp-summary b { display: block; margin-bottom: 4px; color: var(--text-1); }
.insp-section { margin-bottom: 26px; }

/* 常规检查表打印：横版 A4，男生/女生各一张（@page 方向由打印时动态注入，避免多条 @page 规则互相覆盖） */
#printRoot { display: none; }
@media print {
  body.print-mode > *:not(#printRoot) { display: none !important; }
  body.print-mode #printRoot { display: block !important; }
  #printRoot .insp-head { text-align: center; margin: 0 0 6px; }
  #printRoot .insp-head b { font-size: 17px; }
  #printRoot .insp-head span { display: block; margin-top: 2px; font-size: 11px; }
  #printRoot .insp-block { overflow: visible; margin-bottom: 8px; page-break-inside: avoid; }
  #printRoot .insp-report { width: 100%; font-size: 10px; min-width: 0; }
  #printRoot .insp-report th, #printRoot .insp-report td { border: 1px solid #444; padding: 3px 2px; }
  #printRoot .insp-report thead th {
    background: #fef3c7; color: #92400e; min-width: 0;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  #printRoot .insp-report .insp-label {
    background: #fde68a; color: #78350f; position: static; min-width: 72px;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  #printRoot .insp-report .insp-deduct {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  #printRoot .insp-remark { max-width: none; }
  #printRoot .insp-summary { page-break-inside: avoid; }
}

/* 缺勤人员多选（关联住宿登记） */
.insp-persons { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.person-list { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.person-item {
  display: inline-flex; align-items: center; gap: 5px; margin: 0; cursor: pointer;
  font-weight: normal; padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 14px; background: #fff; font-size: 13px;
}
.person-item:hover { border-color: var(--primary); color: var(--primary); }
.person-item input { width: auto !important; margin: 0; }
.person-item input:checked + span { color: var(--danger); font-weight: 600; }

/* 常规检查各项评分录入 */
.insp-score-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.insp-score-item {
  display: flex; flex-direction: column; gap: 4px; min-width: 92px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.insp-score-item > span { font-size: 12.5px; color: var(--text-2); }
.insp-score-item input { width: 100%; text-align: center; font-size: 15px; }
.insp-score-item.insp-total { background: #fef3c7; border-color: #fcd34d; align-items: center; }
.insp-score-item.insp-total span { font-size: 18px; font-weight: 700; color: #b91c1c; }
.insp-score-item.insp-total span.insp-deduct { color: #b91c1c; }

/* 进度条 */
.progress { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.progress.warn > i { background: var(--warning); }
.progress.over > i { background: var(--danger); }

/* 图表 */
.chart-box { width: 100%; overflow: hidden; }
.chart-box svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* 快捷入口 */
.shortcut-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px;
}
.shortcut {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 8px; text-align: center; cursor: pointer; transition: all .15s;
}
.shortcut:hover { border-color: var(--primary); background: #f8faff; transform: translateY(-2px); }
.shortcut .ic { font-size: 22px; margin-bottom: 6px; display: block; }
.shortcut .txt { font-size: 13px; color: var(--text-2); }

/* 列表项（动态） */
.feed { list-style: none; padding: 0; margin: 0; }
.feed li {
  display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
}
.feed li:last-child { border-bottom: none; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex: none; }
.feed .main { flex: 1; min-width: 0; }
.feed .t { font-size: 13.5px; }
.feed .m { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.text-muted { color: var(--text-3); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.flex { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }

.price-mask {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: #f1f3f7; color: var(--text-3); font-size: 12px;
}

/* ============================ 移动端 ============================ */

.bottom-nav { display: none; }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body { font-size: 14px; }

  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .sidebar-mask {
    position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 55; display: none;
  }
  .sidebar-mask.show { display: block; }

  .main { margin-left: 0; padding-bottom: 62px; }
  .topbar .menu-btn { display: flex; }
  .topbar .page-title { font-size: 15px; }

  .content { padding: 12px; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-top: 1px solid var(--border); z-index: 70;
    padding: 4px 0 max(4px, env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 5px 2px; color: var(--text-3); font-size: 11px; position: relative; text-decoration: none;
    min-height: 54px;
  }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a .ic { font-size: 19px; line-height: 1.2; }
  .bottom-nav a .badge {
    position: absolute; top: 2px; right: 50%; margin-right: -20px;
    background: var(--danger); color: #fff; font-size: 10px; min-width: 15px; height: 15px;
    border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
  }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .stat-icon { width: 34px; height: 34px; font-size: 16px; }
  .stat-value { font-size: 19px; }

  .page-head h2 { font-size: 18px; }
  .card-head { padding: 11px 13px; }
  .card-body { padding: 13px; }
  .filters { padding: 12px; }
  .filters .field { min-width: 100%; flex: 1 1 100%; }
  .filters .actions { width: 100%; }
  .filters .actions .btn { flex: 1; }

  .field-row { grid-template-columns: 1fr; }

  .modal { max-width: 100%; border-radius: 12px; }
  .modal-mask { padding: 10px; align-items: flex-end; }
  .modal-foot .btn { flex: 1; }
  .drawer { width: 100%; }

  table.data { min-width: 560px; font-size: 13px; }
  .toast-wrap { top: 10px; }

  .desc-list { grid-template-columns: 84px 1fr; }

  .btn { padding: 8px 12px; }
}

@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .shortcut-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 打印 */
@media print {
  .sidebar, .topbar, .bottom-nav, .filters, .pager, .btn { display: none !important; }
  .main { margin-left: 0; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* ------------------------------ 通知中心 ------------------------------ */
.topbar .icon-btn .badge-dot {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #e24b4a; border: 1.5px solid #fff; display: none;
}
.noti-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-2); margin: 4px 0 10px;
}
.noti-list { display: flex; flex-direction: column; gap: 8px; }
.noti-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
}
.noti-item:hover { border-color: var(--primary); }
.noti-item.read { opacity: .58; }
.noti-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 6px; flex: 0 0 auto; }
.noti-dot.on { background: #e24b4a; }
.noti-main { flex: 1; min-width: 0; }
.noti-title { font-size: 14px; font-weight: 500; }
.noti-body { font-size: 13px; color: var(--text-2); margin-top: 2px; word-break: break-all; }
.noti-time { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.noti-tag { font-size: 11px; color: #e24b4a; align-self: center; flex: 0 0 auto; }

/* ---------------- 打印：《项目支付确认单》（@page 方向由打印时动态注入） ---------------- */
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block !important; }
}
.print-sheet {
  font-family: "Microsoft YaHei", "SimSun", serif; color: #000; background: #fff;
  width: 100%; max-width: 720px; margin: 0 auto; padding: 4px 0;
}
.print-sheet .ps-title { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.print-sheet .ps-sub { text-align: center; font-size: 16px; font-weight: 700; margin: 8px 0 4px; letter-spacing: 4px; }
.print-sheet .ps-meta { text-align: center; font-size: 12px; color: #444; margin-bottom: 10px; }
.print-sheet .ps-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.print-sheet .ps-table th,
.print-sheet .ps-table td {
  border: 1px solid #333; padding: 7px 9px; font-size: 13px; line-height: 1.5;
  text-align: left; vertical-align: middle; word-break: break-all;
}
.print-sheet .ps-table th { background: #f4f6f9; width: 16%; font-weight: 600; white-space: nowrap; }
.print-sheet .ps-sign td { height: 46px; }
.print-sheet .ps-foot { font-size: 12px; color: #444; line-height: 1.7; margin-top: 6px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d5dae3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bcc3ce; }
::-webkit-scrollbar-track { background: transparent; }

/* ==================== 模块管理 ==================== */
.mod-hint { font-size:12.5px;color:var(--text-2);margin:4px 0 14px;line-height:1.7 }
.mod-list { display:grid;grid-template-columns:1fr 1fr;gap:14px }
@media (max-width:760px){ .mod-list{ grid-template-columns:1fr } }
.mod-card { border:1px solid var(--border-light);border-radius:12px;padding:14px 16px;background:#fff }
.mod-card.off { opacity:.72;background:#fafbfc }
.mod-card .mc-head { display:flex;align-items:center;gap:10px }
.mod-card .mc-ic { font-size:20px;width:30px;text-align:center }
.mod-card .mc-title { font-weight:600;flex:1;font-size:14.5px }
.mod-card .mc-lock { font-size:11px;color:#94a3b8;border:1px solid #e2e8f0;border-radius:6px;padding:1px 6px }
.mod-card .mc-body { margin-top:12px;padding-top:12px;border-top:1px dashed var(--border-light) }
.mod-card .mc-row { display:flex;align-items:center;gap:10px;margin-bottom:8px }
.mod-card .mc-row > label { font-size:13px;color:var(--text-2);width:84px;flex:none }
.mod-card select { flex:1 }
.mod-card .mc-foot { margin-top:6px;text-align:right }
.chk-group { display:flex;flex-wrap:wrap;gap:8px 16px;margin-top:4px }
.chk-group label { display:inline-flex;align-items:center;gap:5px;font-size:13px;cursor:pointer;color:var(--text) }
.chk-group.empty { color:var(--text-2);font-size:12.5px }
/* 开关 */
.switch { position:relative;display:inline-block;width:44px;height:24px;flex:none }
.switch input { opacity:0;width:0;height:0 }
.switch .slider { position:absolute;cursor:pointer;inset:0;background:#cbd5e1;border-radius:24px;transition:.2s }
.switch .slider:before { content:"";position:absolute;height:18px;width:18px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s;box-shadow:0 1px 2px rgba(0,0,0,.2) }
.switch input:checked + .slider { background:var(--primary) }
.switch input:checked + .slider:before { transform:translateX(20px) }
.switch input:disabled + .slider { opacity:.5;cursor:not-allowed }

/* ---------------- 模块管理：操作权限矩阵 ---------------- */
.mc-ops { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--bg-2, #fafafa); }
.mc-ops summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-1); user-select: none; }
.mc-ops .ops-hint { font-size: 12px; color: var(--text-2); margin: 8px 0; line-height: 1.6; }
.mc-ops .op-row { padding: 8px 0; border-top: 1px dashed var(--line); }
.mc-ops .op-name { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-1); }
.mc-ops .op-grp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 4px; font-size: 12.5px; }
.mc-ops .op-cap { color: var(--text-2); min-width: 32px; }
.mc-ops .op-grp label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

/* 图片放大查看（灯箱） */
.lightbox-mask {
  position: fixed; inset: 0; z-index: 400; background: rgba(15, 23, 42, .85);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
  animation: lbFade .15s ease;
}
@keyframes lbFade { from { opacity: 0 } to { opacity: 1 } }
.lightbox-mask .lb-img {
  max-width: 92vw; max-height: 90vh; border-radius: 6px;
  box-shadow: 0 10px 48px rgba(0, 0, 0, .55); cursor: default; background: #fff;
}
.lightbox-mask .lb-close {
  position: absolute; top: 14px; right: 18px; width: 36px; height: 36px;
  border-radius: 50%; border: none; background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.lightbox-mask .lb-close:hover { background: rgba(255, 255, 255, .3); }
.lightbox-mask .lb-prev, .lightbox-mask .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
  border-radius: 50%; border: none; background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 28px; line-height: 1; cursor: pointer; user-select: none; padding: 0 0 3px;
}
.lightbox-mask .lb-prev { left: 18px; }
.lightbox-mask .lb-next { right: 18px; }
.lightbox-mask .lb-prev:hover, .lightbox-mask .lb-next:hover { background: rgba(255, 255, 255, .3); }
.lightbox-mask .lb-count {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(15, 23, 42, .5);
  padding: 4px 12px; border-radius: 999px;
}
