/* ============================================
   全局样式
   - 顶栏（品牌/学校切换/导航/用户）
   - 卡片统计
   - 课表网格（.schedule-grid，M3 使用）
   ============================================ */
* { box-sizing: border-box; }
body { margin: 0; background: #f4f5f7; font-family: "Microsoft YaHei", sans-serif; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 18px;
  height: 56px; padding: 0 20px;
  background: #1e2a3a; color: #fff;
  position: relative; z-index: 999;
}
.topbar .brand { font-size: 16px; font-weight: 600; margin-right: 6px; white-space: nowrap; }
.topbar .brand i { color: #4da3ff; margin-right: 6px; }
.topbar .switcher select { width: 170px; height: 30px; border-radius: 4px; padding: 0 8px; font-size: 13px; }
.topbar .nav { display: flex; align-items: center; margin-left: 8px; }
/* 导航项：图标 + 文字一行对齐，左右留白形成间距划分 */
.topbar .nav > a {
  display: inline-flex; align-items: center;
  color: #cfd8e3; text-decoration: none;
  font-size: 14px; padding: 7px 14px; margin-right: 2px;
  border-radius: 6px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.topbar .nav > a i { font-size: 15px; margin-right: 6px; color: #8fa6bf; }
.topbar .nav > a:hover { background: #2a3a4f; color: #fff; }
.topbar .nav > a:hover i { color: #4da3ff; }
.topbar .nav > a.active { background: #2f5a8f; color: #fff; }
.topbar .nav > a.active i { color: #fff; }

/* 下拉菜单（基础数据） */
.topbar .has-dropdown { position: relative; }
.topbar .dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  min-width: 150px; padding: 6px 0;
  background: #243247; border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.topbar .has-dropdown:hover .dropdown { display: block; }
.topbar .dropdown a {
  display: flex; align-items: center;
  padding: 9px 16px; color: #cfd8e3;
  text-decoration: none; font-size: 13px;
}
.topbar .dropdown a i { margin-right: 8px; font-size: 14px; color: #8fa6bf; }
.topbar .dropdown a:hover { background: #2a3a4f; color: #fff; }

/* 用户区 */
.topbar .user { margin-left: auto; display: flex; align-items: center; font-size: 13px; white-space: nowrap; }
.topbar .icon-link { color: #9fc2e8; font-size: 16px; margin-right: 14px; text-decoration: none; }
.topbar .icon-link:hover { color: #fff; }
.topbar .user .uname {
  display: inline-flex; align-items: center;
  background: #2a3a4f; padding: 4px 12px; border-radius: 14px;
}
.topbar .user .uname i { margin-right: 6px; color: #4da3ff; }
.topbar .user a { color: #9fc2e8; margin-left: 12px; text-decoration: none; }
.topbar .user a:hover { color: #fff; }

/* ===== 操作记录悬浮窗（右侧，时间旅行恢复） ===== */
.oplog-float {
  position: fixed; right: 0; top: 42%; z-index: 990;
  display: flex; align-items: stretch;
  flex-direction: row-reverse;   /* toggle 贴右边缘，面板向左展开 */
}
.oplog-toggle {
  width: 36px; min-height: 68px; border: none; cursor: pointer;
  background: #1e2a3a; color: #9fc2e8;
  border-radius: 8px 0 0 8px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: -2px 2px 8px rgba(0,0,0,.25);
  transition: background .15s, color .15s;
}
.oplog-toggle:hover { background: #2f5f96; color: #fff; }
.oplog-panel {
  width: 310px; max-height: 72vh; display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e6e9ef; border-right: none;
  border-radius: 8px 0 0 8px;
  box-shadow: -6px 4px 16px rgba(0,0,0,.18);
}
.oplog-head {
  padding: 11px 14px; font-size: 14px; font-weight: 500; color: #1e2a3a;
  border-bottom: 1px solid #eef2f7;
}
.oplog-head span { color: #888; font-weight: 400; font-size: 12px; }
.oplog-list { flex: 1; overflow-y: auto; }
.oplog-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid #f4f6f9;
}
.oplog-item:hover { background: #f7f9fc; }
.oplog-time { color: #999; font-size: 11px; white-space: nowrap; flex-shrink: 0; }
.oplog-summary {
  flex: 1; min-width: 0; font-size: 12.5px; color: #333;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.oplog-summary.bad { color: #c0392b; }
.oplog-empty { padding: 30px; text-align: center; color: #999; font-size: 12.5px; }

/* 主容器：大屏放宽到 1680px，列表页（订单/账号/学校）充分利用宽度 */
.container { padding: 20px 24px; max-width: 1680px; margin: 0 auto; }
.toolbar { margin-bottom: 14px; }

/* ===== 全局工具栏按钮（水晶风，所有页面统一） ===== */
.tool-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1px solid #c8cfd9; border-radius: 5px;
  padding: 6px 14px; font-size: 13px; color: #1e2a3a; cursor: pointer;
  line-height: 1.4; white-space: nowrap; font-family: inherit;
  transition: all .15s;
}
.tool-btn i { color: #185fa5; font-style: normal; font-weight: 600; font-size: 14px; }
.tool-btn:hover:not(:disabled) { background: #e8f1fb; border-color: #185fa5; color: #185fa5; }
.tool-btn:hover:not(:disabled) i { color: #185fa5; }
.tool-btn:disabled { background: #f4f5f7; color: #b8c1ce; cursor: not-allowed; border-color: #e2e7ee; }
.tool-btn:disabled i { color: #b8c1ce; }
.tool-btn.danger:hover:not(:disabled) { background: #fdecec; border-color: #c0392b; color: #c0392b; }
.tool-btn.danger:hover:not(:disabled) i { color: #c0392b; }
.tool-btn.warm:hover:not(:disabled) { background: #fdf3e3; border-color: #b8860b; color: #8a5a00; }
.tool-btn.warm:hover:not(:disabled) i { color: #8a5a00; }
.tool-btn .n { color: #888; margin-left: 3px; font-size: 12px; }
/* 工具栏容器（水晶式灰底条） */
.tool-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  background: #f0f2f6; border: 1px solid #dde1e8; border-radius: 6px;
  padding: 6px 10px; margin-bottom: 12px;
}
.tool-bar .spacer { margin-left: auto; }
.tool-bar .tip { color: #8a97ab; font-size: 12.5px; }

/* ===== 全站统一页面布局（参考作息设置） ===== */
/* 左右布局：左侧参数设置面板 + 右侧主内容 */
.page-layout { display: flex; gap: 14px; align-items: flex-start; }
.side-panel {
  width: 232px; flex-shrink: 0;
  background: #fff; border: 1px solid #e6e9ef; border-radius: 8px;
  padding: 4px 14px 12px;
}
.page-main { flex: 1; min-width: 0; }

/* 左面板内通用组件 */
.panel-block { padding: 12px 0; border-bottom: 1px solid #eef2f7; }
.panel-block:last-child { border-bottom: none; }
.panel-title { font-size: 12.5px; color: #5a6c88; font-weight: 500; margin-bottom: 8px; }
.panel-hint { font-size: 11.5px; color: #9aa3ad; line-height: 1.5; }
.panel-note { font-size: 11.5px; color: #9aa3ad; margin-top: 2px; }
.scope-sel {
  width: 100%; height: 34px; border-radius: 5px; border: 1px solid #c8cfd9;
  font-size: 13px; padding: 0 8px; margin-bottom: 6px; background: #fff;
}
.day-checks { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.day-cb { font-size: 13px; color: #1e2a3a; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 3px; }
.num-row { display: flex; align-items: center; margin-bottom: 8px; }
.num-row:last-of-type { margin-bottom: 4px; }
.num-label { width: 42px; font-size: 13px; color: #1e2a3a; }
.num-input {
  width: 58px; height: 32px; border-radius: 5px; border: 1px solid #c8cfd9;
  font-size: 14px; text-align: center; padding: 0 4px;
}
.num-unit { font-size: 12.5px; color: #8a97ab; margin-left: 6px; }
.sum-lines { font-size: 12.5px; color: #4a5b74; line-height: 1.9; }
.sum-lines b { color: #185fa5; font-size: 14px; font-weight: 600; }
.sum-lines .sum-key { color: #8a5a00; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.lg-item { display: inline-flex; align-items: center; font-size: 12.5px; color: #4a5b74; }
.lg-item .dot { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 5px; }
.lg-item .dot.m { background: #5d8fc7; }
.lg-item .dot.a { background: #5fae62; }
.lg-item .dot.e { background: #7a6bb8; }
.lg-item .dot.act { background: #e8a33d; }
.lg-item .dot.off { background: #e4e6e9; border: 1px solid #cfd6df; }

/* 顶部页眉操作指引（与学校名/学期同行，醒目色） */
.guide-bar {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  background: #e8f1fb; border-left: 4px solid #185fa5; border-radius: 6px;
  color: #1c3a5e; font-size: 12.5px; line-height: 1.7;
  padding: 7px 14px; margin: 0;
}
.guide-bar b { color: #185fa5; }

/* Excel 导入弹窗 */
.imp-tip {
  background: #fff7e0; border: 1px solid #f0d9a8; border-radius: 6px;
  padding: 10px 12px; font-size: 12.5px; color: #8a5a00; line-height: 1.7;
  margin-bottom: 12px;
}
.imp-io-row { display: flex; gap: 8px; flex-wrap: wrap; }
.imp-ok {
  background: #eef7f1; border: 1px solid #b8e3d2; border-radius: 6px;
  padding: 10px 12px; font-size: 13px; color: #1d6b4f; margin-bottom: 8px;
}
.imp-ok b { color: #1d9e75; font-size: 15px; }
.imp-err {
  background: #fdecec; border: 1px solid #f0c4c0; border-radius: 6px;
  padding: 10px 12px; font-size: 13px; color: #a93226;
}
.imp-sec {
  font-size: 12.5px; color: #4a5b74; font-weight: 500;
  margin: 8px 0 4px; padding: 4px 8px; background: #f4f6f9; border-radius: 4px;
}
.imp-sec b { color: #185fa5; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.imp-table th, .imp-table td { border: 1px solid #e6e9ef; padding: 5px 8px; text-align: left; }
.imp-table th { background: #fafbfc; color: #5a6c88; font-weight: 500; }
.imp-table td { color: #1e2a3a; }
.imp-table td:first-child { width: 56px; text-align: center; color: #8a97ab; }

/* 左面板内的筛选列表项（年级/类型等） */
.grade-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; margin-bottom: 3px; border-radius: 5px;
  font-size: 13px; color: #1e2a3a; cursor: pointer; user-select: none;
  transition: background .12s;
}
.grade-item:hover { background: #f2f6fb; }
.grade-item.active { background: #e8f1fb; color: #185fa5; font-weight: 500; }
.grade-item .n { color: #8a97ab; font-size: 12px; }
.grade-item.active .n { color: #185fa5; }

/* 整行拖拽重排 */
tr[draggable="true"] { cursor: move; }
tr.dragging { opacity: 0.35; }
tr.drop-top { box-shadow: inset 0 3px 0 #185fa5; }
tr.drop-bottom { box-shadow: inset 0 -3px 0 #185fa5; }
.drag-tip { color: #b8c1ce; margin-right: 4px; cursor: grab; user-select: none; }

/* 容量超限（红字警示） */
.sum-over, .sum-over b { color: #c0392b !important; font-weight: 600; }

/* ===== 左侧导航布局（学校上下文页） ===== */
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 210px; flex-shrink: 0;
  background: #141d2a;             /* 更深，与内容区形成明显色差 */
  padding: 12px 10px 30px;
  border-right: 1px solid #0c121c;
  overflow-y: auto;
}
/* 菜单项：图标固定宽度列 + 文字左对齐，所有项完全一致 */
.sidebar .menu-item {
  display: flex; align-items: center;
  padding: 10px 12px; margin: 1px 0;
  color: #d8e2ef;                 /* 默认文字更亮 */
  text-decoration: none;
  font-size: 13.5px; border-radius: 6px;
  border-left: 3px solid transparent;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar .menu-item i {
  width: 22px; text-align: center;
  margin-right: 9px; font-size: 15px; color: #94aac8;  /* 图标默认更亮 */
  flex-shrink: 0;
}
.sidebar .menu-item span { line-height: 1; }
.sidebar .menu-item:hover { background: #2b3c54; color: #fff; }
.sidebar .menu-item:hover i { color: #58a8ff; }
.sidebar .menu-item.active {
  background: #2f5f96; color: #fff; font-weight: 500;
  border-left-color: #6fb4ff;
}
.sidebar .menu-item.active i { color: #fff; }
/* 一级目录：可点击，图标 + 展开箭头，选中联动高亮 */
.sidebar .menu-cat {
  display: flex; align-items: center;
  padding: 11px 12px; margin: 10px 0 2px;
  color: #e8edf4; text-decoration: none;
  font-size: 13.5px; font-weight: 500; border-radius: 6px;
  border-left: 3px solid transparent;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.sidebar .menu-cat i:first-child {
  width: 22px; text-align: center; margin-right: 9px;
  font-size: 15px; color: #6fb4ff;
}
.sidebar .menu-cat .arr { margin-left: auto; font-size: 12px; color: #5f7395; transition: transform .2s; }
.sidebar .menu-cat:hover { background: #2b3c54; color: #fff; }
.sidebar .menu-cat.active {
  background: #2f5f96; color: #fff; border-left-color: #6fb4ff;
}
.sidebar .menu-cat.active .arr { color: #b8d4f5; }
/* 一级目录展开态：箭头旋转 */
.sidebar .menu-cat.open .arr { transform: rotate(180deg); color: #b8d4f5; }

/* 子菜单：默认收起（手风琴），.open 展开 */
.sidebar .menu-sub { margin: 2px 0 6px; display: none; }
.sidebar .menu-sub.open { display: block; }
.sidebar .menu-sub .menu-item { padding: 9px 12px 9px 34px; }
.main { flex: 1; min-width: 0; background: #f4f5f7; }
.page-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: #fff;
  border-bottom: 1px solid #e6e9ef;
}
.page-head .school-name { font-size: 16px; font-weight: 600; color: #1e2a3a; }
.page-head .semester {
  background: #eef2f7; color: #5a6c88;
  padding: 3px 10px; border-radius: 12px; font-size: 12.5px;
}
.page-head .back-home { margin-left: auto; color: #185fa5; text-decoration: none; font-size: 13px; }
.page-head .back-home:hover { text-decoration: underline; }

/* 统计卡片 */
.cards { display: flex; flex-wrap: wrap; gap: 16px; }

/* ===== 基础数据录入步骤条（水晶向导式） ===== */
.steps {
  display: flex; align-items: center; gap: 0;
  background: #fff; border: 1px solid #e6e9ef; border-radius: 8px;
  padding: 12px 18px; margin-bottom: 16px;
}
.steps .step {
  display: flex; align-items: center; gap: 8px;
  color: #8a97ab; text-decoration: none; font-size: 13.5px;
  padding: 4px 14px; border-radius: 6px; white-space: nowrap;
  position: relative;
}
.steps .step i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #e9edf3; color: #7d8ba0;
  font-style: normal; font-size: 12px; font-weight: 600;
}
.steps .step:hover { background: #f2f6fb; color: #185fa5; }
.steps .step.active { background: #e8f1fb; color: #185fa5; font-weight: 500; }
.steps .step.active i { background: #185fa5; color: #fff; }
.steps .step.done { color: #1d9e75; }
.steps .step.done i { background: #1d9e75; color: #fff; }
.steps .step::after {
  content: ""; width: 26px; height: 1px; background: #e2e7ee;
  position: absolute; right: -13px;
}
.steps .step:last-child::after { display: none; }

/* 统计卡片 */
.card {
  width: 200px; padding: 20px; border-radius: 8px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  text-align: center;
}
.card .num { font-size: 30px; font-weight: 600; color: #1e6fff; }
.card .label { color: #888; margin-top: 6px; }
.card.link {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid transparent; transition: border-color .15s, box-shadow .15s;
}
.card.link:hover { border-color: #185fa5; box-shadow: 0 2px 8px rgba(24,95,165,.15); }
.card.link .name { font-size: 18px; font-weight: 600; color: #1e2a3a; margin-bottom: 6px; }

/* 课表网格（班级 x 星期 x 节次） */
.schedule-grid { width: 100%; border-collapse: collapse; background: #fff; }
.schedule-grid th, .schedule-grid td {
  border: 1px solid #d9dde3; padding: 6px 4px;
  font-size: 12px; text-align: center; min-width: 90px;
}
.schedule-grid th { background: #eef2f7; }
.schedule-grid td { height: 44px; }
.schedule-grid td.locked { background: #fff7e0; }
.schedule-grid td.conflict { background: #ffe3e3; color: #c0392b; }

/* 登录页 */
.login-bg {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: #1e2a3a;
}
.login-box {
  width: 340px; padding: 32px; border-radius: 10px;
  background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.login-box h2 { text-align: center; margin-bottom: 22px; color: #1e2a3a; }
