/* ============================================================
   L&K 教务管理系统 · 设计系统
   ============================================================ */
:root {
  /* 中性色 */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #f0f2f5;
  --border: #e8eaee;
  --border-strong: #d8dce3;
  --text: #151a22;
  --text-2: #5a6473;
  --text-3: #8f98a6;
  --text-4: #b4bcc7;

  /* 品牌与语义色 */
  --accent: #2b62e8;
  --accent-hover: #1f4fc9;
  --accent-soft: #eef3fe;
  --accent-line: #c9d8fb;
  --green: #12875f;
  --green-soft: #e7f5ef;
  --amber: #b06f0c;
  --amber-soft: #fdf3e3;
  --red: #c8452a;
  --red-soft: #fdf0ec;
  --violet: #6b5bd2;

  /* 尺度 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(19,26,38,.04);
  --shadow-sm: 0 1px 2px rgba(19,26,38,.05), 0 2px 6px rgba(19,26,38,.04);
  --shadow-md: 0 2px 4px rgba(19,26,38,.04), 0 8px 24px rgba(19,26,38,.06);
  --shadow-lg: 0 12px 40px rgba(19,26,38,.14);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
.app { display: flex; min-height: 100vh; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 22px 22px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, #2b62e8, #1846b8);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; letter-spacing: .4px;
  box-shadow: 0 4px 12px rgba(43,98,232,.28);
}
.brand-title { font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.brand-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; letter-spacing: .2px; }

.nav { padding: 6px 14px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-group-label {
  font-size: 11px; font-weight: 600; color: var(--text-4); letter-spacing: .6px;
  padding: 16px 10px 7px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px;
  border: none; background: transparent; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13.5px; color: var(--text-2); text-align: left; font-family: inherit;
  font-weight: 500; transition: background .14s, color .14s; position: relative;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-icon { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-foot { padding: 0 14px 16px; }
.term-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; }
.term-card-label { font-size: 10.5px; color: var(--text-4); font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.term-card-value { font-size: 12.5px; color: var(--text); font-weight: 600; margin-top: 4px; }
.sync-info { font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* ---------------- 主区 / 顶栏 ---------------- */
.main { flex: 1; min-width: 0; }
.topbar {
  height: 76px; background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 34px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-left { display: flex; flex-direction: column; gap: 3px; }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.crumb b { color: var(--text-2); font-weight: 600; }
.crumb i { font-style: normal; color: var(--text-4); }
.topbar h1 { font-size: 21px; font-weight: 650; letter-spacing: -.3px; line-height: 1.2; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.date-chip { font-size: 12.5px; color: var(--text-2); font-weight: 500; padding: 5px 11px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; }
.data-status { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.data-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(18,135,95,.12); }
.data-status.loading .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(176,111,12,.12); animation: pulse 1.1s infinite; }
.data-status.error .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(200,69,42,.12); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }
.icon-btn {
  width: 34px; height: 34px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px;
  cursor: pointer; color: var(--text-2); display: flex; align-items: center; justify-content: center;
  transition: background .14s, border-color .14s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
.content { padding: 28px 34px 60px; max-width: 1480px; }

/* ---------------- 通用 ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.section-title {
  font-size: 15px; font-weight: 650; margin: 30px 0 14px; display: flex; align-items: center; gap: 9px;
  letter-spacing: -.2px;
}
.section-title:first-child { margin-top: 0; }
.section-title .hint { font-size: 12px; color: var(--text-3); font-weight: 400; letter-spacing: 0; }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: none; background: transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-2); font-family: inherit; font-weight: 500; transition: all .14s;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); }
.select {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 9px; padding: 8px 12px;
  font-size: 13px; color: var(--text); font-family: inherit; cursor: pointer; font-weight: 500;
  transition: border-color .14s;
}
.select:hover { border-color: var(--text-4); }
.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------------- 总览：KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-card { padding: 20px 22px; position: relative; overflow: hidden; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi-label svg { width: 15px; height: 15px; opacity: .5; }
.kpi-value { font-size: 32px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; margin-top: 10px; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { font-size: 12px; color: var(--text-3); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.kpi-trend { font-weight: 600; }
.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }

/* ---------------- 总览：老师卡 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { padding: 20px; position: relative; overflow: hidden; }
.stat-card .t-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.stat-card .t-avatar {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.stat-card .t-name-wrap { min-width: 0; }
.stat-card .t-name { font-size: 14px; font-weight: 650; line-height: 1.25; }
.stat-card .t-role { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.stat-card .t-num { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.stat-card .t-num small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.stat-card .t-row {
  display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2);
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border);
}
.stat-card .t-row b { color: var(--text); font-weight: 650; }
.stat-card .t-progress { height: 6px; background: var(--surface-3); border-radius: 3px; margin-top: 13px; overflow: hidden; }
.stat-card .t-progress i { display: block; height: 100%; border-radius: 3px; min-width: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* ---------------- 总览：面板 ---------------- */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: stretch; }
.panel { padding: 20px 22px; display: flex; flex-direction: column; }
.panel h3 { font-size: 13.5px; font-weight: 650; margin-bottom: 18px; color: var(--text); display: flex; align-items: center; justify-content: space-between; }
.panel h3 span { font-size: 11.5px; color: var(--text-3); font-weight: 400; }

.bar-row { display: grid; grid-template-columns: 92px 1fr 46px; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 12.5px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row .label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; background: var(--surface-3); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar-row .val { text-align: right; color: var(--text); font-weight: 650; font-size: 12.5px; }

.month-split { display: flex; gap: 16px; align-items: stretch; flex: 1; }
.month-box { flex: 1; padding: 20px 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.month-box .m-label { font-size: 12px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.month-box .m-label i { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
.month-box .m-num { font-size: 28px; font-weight: 700; margin: 10px 0 3px; letter-spacing: -.8px; }
.month-box .m-num span { font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.month-box .m-sub { font-size: 11.5px; color: var(--text-3); }
.month-box .m-bar { height: 5px; background: var(--surface-3); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.month-box .m-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------------- 今日安排 ---------------- */
.today-panel { padding: 20px 22px; }
.today-list { display: flex; flex-direction: column; }
.today-row { display: grid; grid-template-columns: 108px 8px 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.tr-time { white-space: nowrap; }
.today-row:last-child { border-bottom: none; padding-bottom: 0; }
.today-row:first-child { padding-top: 0; }
.tr-time { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.tr-dot { width: 8px; height: 8px; border-radius: 3px; }
.tr-course { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-course em { font-style: normal; color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: 6px; }
.tr-teacher { font-size: 11.5px; color: var(--text-2); font-weight: 600; }

/* ---------------- 表格 ---------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--surface-2); text-align: left; padding: 12px 16px; font-size: 11.5px;
  color: var(--text-3); font-weight: 600; border-bottom: 1px solid var(--border);
  white-space: nowrap; letter-spacing: .3px; text-transform: uppercase;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid #f2f3f6; color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
.teacher-tag { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; }
.teacher-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.status-pill { font-size: 11px; padding: 3px 9px; border-radius: 6px; font-weight: 600; white-space: nowrap; display: inline-block; }
.status-pending { background: var(--amber-soft); color: var(--amber); }
.status-done { background: var(--green-soft); color: var(--green); }
.status-empty { background: var(--surface-3); color: var(--text-3); }
.status-cancel { background: var(--surface-3); color: var(--text-4); }
.hours-num { font-weight: 650; }

/* ---------------- 教师课表：老师 tab ---------------- */
.teacher-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.teacher-tab {
  display: flex; align-items: center; gap: 9px; position: relative;
  padding: 9px 15px 9px 10px; min-width: 112px;
  border: 1.5px solid var(--border); border-radius: 11px; background: var(--surface);
  box-shadow: var(--shadow-xs); cursor: pointer; font-family: inherit;
  font-size: 13px; color: var(--text-2); font-weight: 550;
  transition: border-color .15s, transform .12s, box-shadow .15s;
}
.teacher-tab:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.teacher-tab.active { border-color: var(--tc); color: var(--text); font-weight: 650; box-shadow: 0 2px 10px rgba(19,26,38,.07); }
.tab-avatar {
  width: 31px; height: 31px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.all-avatar { background: var(--surface-3); color: var(--text-3); }
.tab-name { white-space: nowrap; }
.tab-dot { width: 6px; height: 6px; border-radius: 50%; margin-left: auto; }

/* ---------------- 周历 ---------------- */
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-nav-btn {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 9px;
  padding: 8px 14px; font-size: 13px; cursor: pointer; font-family: inherit; color: var(--text-2);
  font-weight: 550; transition: all .14s;
}
.cal-nav-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.cal-nav-btn:disabled { opacity: .38; cursor: default; }
.cal-week-stat { margin-left: auto; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.cal-week-stat b { color: var(--text); font-size: 15px; font-weight: 700; }

.cal-wrap { overflow-x: auto; }
.cal-table { min-width: 860px; table-layout: fixed; }
.cal-table th { text-align: center; padding: 13px 6px; }
.cal-table th.cal-slot-head, .cal-table td.cal-slot-time { width: 112px; text-align: center; }
.cal-table th.cal-today { background: var(--accent-soft); color: var(--accent); }
.cal-date { font-size: 11px; font-weight: 500; color: var(--text-3); }
.cal-today .cal-date { color: var(--accent); }
.cal-slot-time {
  font-size: 11.5px; color: var(--text-2); font-weight: 600; vertical-align: middle;
  background: var(--surface-2); border-right: 1px solid var(--border);
}
.cal-cell { padding: 7px !important; vertical-align: top; height: 104px; border-right: 1px solid #f2f3f6; }
.cal-cell:last-child { border-right: none; }
.cal-cell-inner { display: flex; flex-direction: column; gap: 6px; min-height: 90px; }
.cal-blank { color: var(--text-4); font-size: 13px; margin: auto; opacity: .6; }
.cal-course {
  border-left: 3px solid #888; border-radius: 8px; padding: 8px 10px;
  transition: transform .12s, box-shadow .12s; overflow: hidden;
}
.cal-course.clickable { cursor: pointer; }
.cal-course:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(19,26,38,.1); }
.cal-course-time { font-size: 10.5px; color: var(--text-2); font-weight: 600; margin-bottom: 3px; }
.cal-course-name {
  font-size: 12.5px; color: var(--text); font-weight: 650; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cal-course-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; gap: 4px; }
.cal-course-teacher { font-size: 10.5px; font-weight: 650; }
.cal-course-status { font-size: 9.5px; padding: 1.5px 6px; border-radius: 5px; background: var(--amber-soft); color: var(--amber); white-space: nowrap; font-weight: 600; }
.cal-course-status.done { background: var(--green-soft); color: var(--green); }
.cal-untimed {
  margin-top: 14px; padding: 12px 16px; background: #fdf8ee; border: 1px solid #f0e3c8;
  border-radius: 10px; font-size: 12.5px; color: var(--text-2);
}

/* ---------------- 排课空档 ---------------- */
.booking-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; font-weight: 500; }
.booking-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.week-table { font-size: 12.5px; }
.week-table th { text-align: center; padding: 12px 8px; }
.week-table th:first-child, .week-table td:first-child { text-align: left; width: 116px; }
.week-table td { padding: 6px 8px; text-align: center; vertical-align: middle; border-right: 1px solid #f2f3f6; }
.week-table td:last-child { border-right: none; }
.slot-cell {
  min-height: 52px; border-radius: 9px; padding: 8px; display: flex; align-items: center; justify-content: center;
  gap: 5px; flex-wrap: wrap; cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.slot-cell:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(19,26,38,.09); }
.slot-cell.free { background: #f0f9f4; border: 1px dashed #cfe8db; }
.slot-cell.busy { background: var(--surface-2); border: 1px solid var(--border); }
.slot-cell.full { background: var(--surface-3); border: 1px solid var(--border); }
.mini-chip { font-size: 10.5px; padding: 2.5px 8px; border-radius: 5px; color: #fff; font-weight: 650; white-space: nowrap; }
.slot-allfree { font-size: 11px; color: var(--green); font-weight: 600; }
.slot-full { font-size: 11px; color: var(--text-4); font-weight: 600; }
.slot-free-label { font-size: 10px; color: var(--text-3); font-weight: 600; margin-right: 2px; }
.slot-time { font-size: 11.5px; color: var(--text-2); font-weight: 650; }

/* ---------------- 签到 ---------------- */
.sign-summary {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: repeat(4, 1fr) 1.4fr; gap: 20px; align-items: center;
}
.ss-item { display: flex; flex-direction: column; gap: 5px; }
.ss-item span { font-size: 12px; color: var(--text-3); font-weight: 500; }
.ss-item b { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.ss-item b i { font-size: 12px; font-style: normal; color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.ss-progress { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.ss-progress i { display: block; height: 100%; background: linear-gradient(90deg, #1aa06f, var(--green)); border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.sign-row-busy { background: #fffdf8; }
.sign-btn {
  border: 1px solid var(--green); color: var(--green); background: var(--surface); border-radius: 8px;
  padding: 5px 13px; font-size: 12px; cursor: pointer; font-family: inherit; font-weight: 600;
  transition: background .14s;
}
.sign-btn:hover { background: var(--green-soft); }
.sign-btn.done { border-color: var(--border); color: var(--text-4); cursor: default; background: var(--surface-2); }

/* ---------------- 弹窗 ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,22,34,.44); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 480px; max-width: 96vw;
  max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -.2px; }
.modal-close {
  border: none; background: var(--surface-2); width: 30px; height: 30px; border-radius: 8px;
  font-size: 20px; color: var(--text-3); cursor: pointer; line-height: 1; transition: background .14s;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 22px 24px 26px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; font-weight: 550; }
.form-row input, .form-row select {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 9px; padding: 10px 12px;
  font-size: 13.5px; font-family: inherit; color: var(--text); background: var(--surface);
  transition: border-color .14s, box-shadow .14s;
}
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row input::placeholder { color: var(--text-4); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.btn {
  padding: 10px 20px; border-radius: 9px; font-size: 13.5px; font-family: inherit; cursor: pointer;
  font-weight: 600; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  transition: all .14s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 3px rgba(43,98,232,.3); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #b03b22; color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 加载 / 提示 ---------------- */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 120px 20px; color: var(--text-3); gap: 16px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #1a2230; color: #fff;
  padding: 12px 22px; border-radius: 10px; font-size: 13.5px; z-index: 200; box-shadow: var(--shadow-lg);
  font-weight: 500; max-width: 90vw; text-align: center;
}
.empty-tip { padding: 48px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* ---------------- 学生课时 ---------------- */
.stu-stat-grid { grid-template-columns: repeat(4, 1fr); }
.stu-search { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 9px; padding: 8px 13px; font-size: 13px; font-family: inherit; min-width: 210px; font-weight: 500; }
.stu-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stu-card { padding: 18px 19px 15px; position: relative; display: flex; flex-direction: column; }
.stu-subjects { flex: 1; }
.stu-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.stu-avatar {
  width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.stu-id { flex: 1; min-width: 0; }
.stu-name { font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.stu-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stu-pct { font-size: 18px; font-weight: 700; color: var(--green); letter-spacing: -.3px; }
.stu-progress { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin-bottom: 14px; }
.stu-progress-fill { height: 100%; background: linear-gradient(90deg, #1aa06f, var(--green)); border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.stu-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-bottom: 13px; border-bottom: 1px solid var(--border); }
.stu-nums.four { grid-template-columns: repeat(4, 1fr); }
.stu-nums > div { display: flex; flex-direction: column; gap: 2px; }
.stu-nums span { font-size: 11px; color: var(--text-3); font-weight: 500; }
.stu-nums b { font-size: 18px; font-weight: 700; letter-spacing: -.4px; }
.stu-nums.four b { font-size: 16px; }
.stu-subjects { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; min-height: 21px; align-content: flex-start; }
.subj-chip { font-size: 10.5px; background: var(--surface-3); color: var(--text-2); padding: 2.5px 9px; border-radius: 6px; font-weight: 500; }
.stu-card-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }
.stu-detail-btn { border: none; background: transparent; color: var(--accent); font-size: 11.5px; cursor: pointer; font-family: inherit; font-weight: 650; }
.stu-detail { margin-top: 13px; }
.stu-detail-inner { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.stu-detail-table { font-size: 11.5px; }
.stu-detail-table th { padding: 8px 10px; font-size: 10px; }
.stu-detail-table td { padding: 7px 10px; }

/* ---------------- 学生课表 ---------------- */
.student-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.student-summary > div { display: flex; flex-direction: column; gap: 4px; }
.student-summary span { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.student-summary b { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.stu-portal-head { display: flex; align-items: center; gap: 15px; margin-bottom: 22px; }
.sp-avatar {
  width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(135deg, #2b62e8, #1846b8);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 23px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(43,98,232,.26);
}
.sp-title { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.sp-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.sp-live {
  margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--green);
  background: var(--green-soft); padding: 7px 14px; border-radius: 20px; font-weight: 600; transition: background .3s;
}
.sp-live.flash { background: #c9ecdd; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.8s infinite; }

/* ---------------- 取消 / 恢复 ---------------- */
.row-cancelled { background: #fafbfc; }
.row-cancelled td { color: var(--text-4); text-decoration: line-through; text-decoration-color: #dde1e7; }
.row-act {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; padding: 4px 11px;
  font-size: 11.5px; cursor: pointer; font-family: inherit; color: var(--text-2); font-weight: 550; transition: all .14s;
}
.row-act:hover { background: var(--surface-2); }
.row-act.cancel:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.row-act.restore:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.cancel-target { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; margin: 14px 0; }
.cancel-target .ct-course { font-size: 14.5px; font-weight: 650; }
.cancel-target .ct-meta { font-size: 12.5px; color: var(--text-2); margin-top: 5px; }

/* ---------------- 对调 ---------------- */
.swap-compare { display: flex; align-items: stretch; gap: 12px; }
.swap-card { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 15px; }
.swap-card .sc-label { font-size: 10px; color: var(--text-3); font-weight: 650; letter-spacing: .5px; text-transform: uppercase; }
.swap-card .sc-course { font-size: 14px; font-weight: 650; margin: 6px 0 8px; }
.swap-card .sc-line { font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.swap-card .sc-time-now { font-size: 11.5px; color: var(--text-4); text-decoration: line-through; }
.swap-card .sc-time-new { font-size: 12.5px; color: var(--accent); margin-top: 5px; font-weight: 500; }
.swap-arrow { display: flex; align-items: center; font-size: 22px; color: var(--accent); font-weight: 700; }

/* ---------------- 课程详情 ---------------- */
.lesson-detail { padding: 4px 0 6px; }
.ld-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.ld-teacher-tag { font-size: 12px; font-weight: 650; padding: 4px 12px; border-radius: 8px; }
.ld-course { font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: 18px; letter-spacing: -.3px; }
.ld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.ld-grid > div { display: flex; flex-direction: column; gap: 4px; }
.ld-grid span { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.ld-grid b { font-size: 14px; font-weight: 650; }
.ld-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

/* ---------------- 学生端专属模式 ---------------- */
body.student-portal .sidebar { display: none; }
body.student-portal .topbar { padding-left: 36px; }
body.student-portal .content { max-width: 1200px; margin: 0 auto; padding-top: 34px; }
body.student-portal .date-chip, body.student-portal .data-status, body.student-portal .crumb { display: none; }
body.student-portal .topbar h1 { font-size: 19px; font-weight: 600; color: var(--text-2); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1280px) {
  .stu-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .kpi-grid, .stat-grid, .stu-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 68px; }
  .brand-text, .nav-item span, .nav-group-label, .sidebar-foot { display: none; }
  .brand { justify-content: center; padding: 20px 0; }
  .nav { padding: 8px; align-items: center; }
  .nav-item { justify-content: center; padding: 11px; }
  .nav-item.active::before { display: none; }
  .content { padding: 20px 18px 48px; }
  .topbar { padding: 0 18px; height: 68px; gap: 12px; }
  .date-chip { display: none; }
  .data-status { font-size: 11px; }
  .topbar h1 { font-size: 18px; }
  .kpi-value { font-size: 26px; }
  .stu-grid { grid-template-columns: 1fr; }
  .sign-summary { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .sign-summary .ss-progress { grid-column: 1 / -1; }
  .student-summary { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .ld-grid { grid-template-columns: 1fr; }
  .swap-compare { flex-direction: column; }
}
