/* ============ 课堂教学平台 ============ */
:root {
  /* 苹果风格配色：浅灰底 / 纯白卡 / 极细分隔线 / 克制的蓝色强调 */
  --bg: #f5f5f7;
  --card: #ffffff;
  --line: rgba(0, 0, 0, .09);
  --line-solid: #e3e3e6;
  --ink: #1d1d1f;
  --ink2: #6e6e73;
  --ink3: #86868b;
  --brand: #0071e3;
  --brand2: #0060c0;
  --ok: #34c759;
  --warn: #ff9f0a;
  --bad: #ff3b30;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .14);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
::selection { background: #b3d7ff; }

/* ---------- 顶栏（毛玻璃，整站只有这一行） ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 0 16px; height: 54px;
}
.topbar.topbar-hidden { display: none; }
.topbar .spacer { flex: 0 1 auto; min-width: 6px; }   /* 先让位给课程名 */
/* 顶栏项一律不收缩、不换行；只让「课程平铺区」吸收压缩并横向滚动，
   否则课程一多，其它按钮就会被挤到换行（曾出现「课程」竖排、「导入课表」折行）。 */
.topbar > * { flex: none; }
.top-slot { display: flex; align-items: center; gap: 8px; margin-left: 6px; min-width: 0; flex: 0 1 auto; }
.top-slot > * { flex: none; }
/* 课程平铺区必须能伸能缩：这条的选择器要比上面那条更具体，
   否则会被 flex:none 覆盖，只能拿到很窄的宽度（曾实测只分到 451px）。 */
.top-slot > .pick-chips { flex: 1 1 auto; min-width: 0; }
.topnav { display: flex; gap: 4px; align-items: center; flex: none; }
.tbtn, .pick, .pk-label, .chips-label, .role-badge { white-space: nowrap; }

/* LEODENG 品牌 */
.brand { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; flex: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #0a84ff, #0060c0);
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 0;
  box-shadow: 0 1px 3px rgba(0, 100, 220, .35);
}
.brand-mark.lg { width: 46px; height: 46px; border-radius: 13px; font-size: 26px; }
.brand-name { font-size: 14.5px; font-weight: 700; letter-spacing: 1.6px; color: var(--ink); }
.brand-name.lg { font-size: 24px; letter-spacing: 3px; }
.brand:hover .brand-name { color: var(--brand); }

/* 顶栏按钮 */
.tbtn {
  display: inline-flex; align-items: center; gap: 5px;
  border: none; background: transparent; color: var(--ink);
  padding: 6px 10px; border-radius: 9px; cursor: pointer; font-size: 13px;
  transition: background .12s;
}
.tbtn:hover { background: rgba(0, 0, 0, .05); }
.tbtn.on { background: rgba(0, 113, 227, .12); color: var(--brand); }
.tbtn .ti { font-size: 14px; line-height: 1; }

/* 学期 / 课程 选择器 */
.pick {
  display: inline-flex; align-items: center; gap: 6px; max-width: 320px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .9);
  padding: 5px 10px; border-radius: 10px; cursor: pointer; font-size: 13px;
  color: var(--ink); transition: border-color .12s, background .12s;
}
.pick:hover { border-color: rgba(0, 113, 227, .45); background: #fff; }
.pick .pk-label { color: var(--ink3); font-size: 11.5px; flex: none; }
.pick b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .pk-caret { color: var(--ink3); font-size: 11px; flex: none; }
.pick.muted b { color: var(--ink3); font-weight: 400; }
/* 课程平铺：一眼看到本学期所有课，点一下即切换 */
.pick-chips {
  display: flex; align-items: center; gap: 6px;
  flex: 1 1 auto; min-width: 0;              /* 优先吃掉剩余宽度，保证课程名一行排下 */
  overflow: hidden; padding: 2px 0;
  --chip-scale: 1;
}
.pick-chips.scroll {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
}
.pick-chips::-webkit-scrollbar { display: none; }
.pick-chip {
  display: inline-flex; align-items: center; flex: none;
  gap: calc(5px * var(--chip-scale)); padding: calc(4px * var(--chip-scale)) calc(10px * var(--chip-scale));
  font-size: calc(12.5px * var(--chip-scale)); line-height: 1.4;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .9);
  border-radius: 999px; cursor: pointer; white-space: nowrap; color: var(--ink);
  transition: background .12s, border-color .12s, color .12s;
}
.pick-chips.compact { gap: 5px; }
.pick-chips.compact .chip-dot { width: 6px; height: 6px; }
/* 空间紧张时：次要按钮只留图标、隐藏角色标签与「课程」二字，优先保证课程名一行排下 */
.topbar.tight .tbtn-collapsible .tl { display: none; }
.topbar.tight .chips-label { display: none; }
.topbar.tight .pick .pk-label { display: none; }
.topbar.tight .pick { padding: 5px 8px; }
.topbar.tight .role-badge { display: none; }
.topbar.tight .top-slot { gap: 6px; }
.topbar.tight .topnav { gap: 2px; }
.pick-chip:hover { border-color: rgba(0, 113, 227, .45); background: #fff; }
.pick-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pick-chip .chip-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.pick-chip.on .chip-dot { background: #fff !important; }
.pick-chip.empty { color: var(--ink3); cursor: default; border-style: dashed; }
.pick-chip.empty:hover { border-color: var(--line); background: rgba(255,255,255,.9); }
.pick-more { padding: 5px 8px; }
.pick-more .pk-caret { font-size: 12px; }
.chips-label { margin-left: 2px; }

.role-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: rgba(0,0,0,.06); color: var(--ink2); }
.role-badge.admin { background: rgba(0, 113, 227, .12); color: var(--brand); }

/* ---------- 下拉面板（学期 / 课程 / 课程菜单共用） ---------- */
.drop-panel {
  position: fixed; z-index: 400; min-width: 280px; max-width: min(460px, 92vw);
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; max-height: min(70vh, 560px); overflow: auto;
  animation: dropIn .13s ease;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.drop-title { font-size: 11.5px; color: var(--ink3); padding: 7px 10px 5px; font-weight: 600; letter-spacing: .2px; }
.drop-empty { padding: 14px 12px; color: var(--ink2); font-size: 13px; }
.drop-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: none; background: none; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 9px; color: var(--ink);
}
.drop-row:hover { background: rgba(0, 0, 0, .045); }
.drop-row.on { background: rgba(0, 113, 227, .1); }
.drop-row .dr-main { font-size: 13.5px; font-weight: 600; display: block; }
.drop-row .dr-sub { font-size: 11.5px; color: var(--ink2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-row .dr-body { flex: 1; min-width: 0; }
.drop-row .dr-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.drop-row .dr-more { border: none; background: none; color: var(--ink3); cursor: pointer; padding: 2px 6px; border-radius: 6px; font-size: 14px; flex: none; }
.drop-row .dr-more:hover { background: rgba(0, 0, 0, .08); color: var(--ink); }
.drop-row.simple .dr-main { font-weight: 500; }
.drop-foot { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--line); margin-top: 4px; flex-wrap: wrap; }

/* ---------- 全局查找 ---------- */
.find-mask {
  position: fixed; inset: 0; z-index: 600; background: rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
}
.find-panel {
  width: min(680px, 100%); background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 70vh;
  animation: dropIn .14s ease;
}
.find-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.find-ico { font-size: 19px; color: var(--ink3); }
.find-input { flex: 1; border: none; outline: none; font-size: 16px; background: transparent; color: var(--ink); }
.find-input::placeholder { color: var(--ink3); }
.find-kbd { font-size: 10.5px; color: var(--ink3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.find-list { overflow: auto; flex: 1; padding: 4px 0; }
.find-group { display: flex; align-items: center; gap: 8px; padding: 9px 16px 4px; font-size: 11.5px; color: var(--ink3); font-weight: 600; }
.find-gcount { margin-left: auto; font-weight: 400; }
.find-row { padding: 8px 16px; cursor: pointer; border-left: 3px solid transparent; }
.find-row:hover, .find-row.on { background: rgba(0, 113, 227, .08); border-left-color: var(--brand); }
.find-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.find-sub { font-size: 11.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-status { padding: 9px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink3); background: #fafafa; }

/* ---------- 学期校历 ---------- */
.cal-mask {
  position: fixed; inset: 0; z-index: 600; background: rgba(0, 0, 0, .32);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.cal-panel {
  width: min(1180px, 100%); max-height: 94vh; background: #fff; border-radius: 18px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
  animation: dropIn .16s ease;
}
.cal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-title { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.cal-sub { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }
.cal-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.cal-month { font-size: 14px; font-weight: 600; min-width: 116px; text-align: center; }
.ibtn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.ibtn:hover { background: rgba(0, 0, 0, .05); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px 14px 0; }
.cal-week span { text-align: center; font-size: 11.5px; color: var(--ink3); font-weight: 600; padding: 4px 0; }
.cal-grid-box { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); margin: 6px 14px 0; border-radius: 10px; overflow: hidden; flex: 1; min-height: 0; overflow-y: auto; }
.cal-cell { background: #fff; min-height: 104px; padding: 6px 7px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.out { background: #fafafa; }
.cal-cell.today { background: #f0f7ff; }
.cal-day { display: flex; align-items: center; gap: 5px; }
.cal-dayno { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.cal-cell.today .cal-dayno { color: var(--brand); }
.cal-cnt { margin-left: auto; font-size: 10px; color: var(--ink3); background: rgba(0,0,0,.05); border-radius: 8px; padding: 0 5px; }
.cal-items { display: flex; flex-direction: column; gap: 3px; }
.cal-item { border-left: 3px solid var(--brand); background: #f7f9fc; border-radius: 0 6px 6px 0; padding: 3px 6px; cursor: pointer; overflow: hidden; }
.cal-item:hover { background: #eef4fb; }
.cal-item .ci-1 { font-size: 11.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item .ci-2 { font-size: 10.5px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { font-size: 10.5px; color: var(--ink3); padding-left: 6px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px 16px; }
.cal-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink2); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
/* 校历格上的周次 / 放假标记 */
.cal-wk { font-size: 9.5px; color: var(--ink3); background: rgba(0,0,0,.05); border-radius: 6px; padding: 0 4px; }
.cal-hol { margin-left: auto; font-size: 9.5px; color: #b45309; background: #fef3c7; border-radius: 6px; padding: 0 5px; }
.cal-cell.holiday { background: #fffdf5; }
.cal-cell.holiday .cal-dayno { color: #b45309; }
.cal-hol.nat { background: #fee2e2; color: #b91c1c; }
.cal-cell.holiday .cal-items, .cal-cell.holiday .cal-item { opacity: .55; }
.cal-cell.workday { background: #f7fdf9; }
.cal-work { margin-left: auto; font-size: 9.5px; color: #15803d; background: #dcfce7; border-radius: 6px; padding: 0 5px; }

/* 导入校历弹窗 */
.calimp-tip { background: #f5f9ff; border: 1px solid rgba(0, 113, 227, .18); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--ink); }
.calimp .field { margin-bottom: 14px; }
.calimp .field label { color: var(--ink2); }
.wk-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.wk {
  width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #f2f2f4; color: var(--ink3); cursor: pointer; font-size: 12px; font-weight: 600;
  transition: all .1s;
}
.wk:hover { border-color: var(--brand); }
.wk.on { background: rgba(0, 113, 227, .12); border-color: rgba(0, 113, 227, .45); color: var(--brand); }
.wk.exam { background: #fff4e5; border-color: #f0c894; color: #b45309; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 26px; }
.calimp-preview { margin-top: 8px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 12px; color: var(--ink2); line-height: 1.8; }
.calimp-preview:empty { display: none; }
/* 识别结果摘要：这是自动排课的依据，做成一眼能核对的清单 */
.calimp-summary { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.calimp-ok { background: #f0fdf4; color: #15803d; font-size: 12.5px; font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.calimp-summary .sr { display: flex; gap: 12px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.calimp-summary .sr:last-of-type { border-bottom: none; }
.calimp-summary .sk { color: var(--ink2); width: 92px; flex: none; }
.calimp-summary .sv { color: var(--ink); font-weight: 500; }
.calimp-week1 { padding: 8px 12px; background: #fafafa; font-size: 11.5px; color: var(--ink2); border-top: 1px solid var(--line); }
.calimp-empty { padding: 16px 12px; text-align: center; color: var(--ink2); font-size: 13px; }
.linkbtn { border: none; background: none; color: var(--brand); cursor: pointer; font-size: 12.5px; padding: 8px 0 0; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
.calimp-manual { margin-top: 10px; border: 1px dashed var(--line-solid); border-radius: 12px; padding: 12px; background: #fcfcfd; }
.manual-title { font-size: 12px; color: var(--ink3); font-weight: 600; margin-bottom: 10px; }
.wk.off { background: #f1f5f9; border-color: #cbd5e1; color: var(--ink3); text-decoration: line-through; }
.hchip { display: inline-flex; align-items: center; gap: 5px; background: #fef3c7; color: #92400e; border-radius: 20px; padding: 3px 6px 3px 10px; font-size: 12px; }
.hchip button { border: none; background: rgba(0,0,0,.08); color: #92400e; border-radius: 50%; width: 16px; height: 16px; line-height: 1; cursor: pointer; font-size: 10px; }

/* ---------- 登录页 ---------- */
.main-login { max-width: none; padding: 0; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(180deg, #fbfbfd 0%, #f0f2f5 100%); }
.login-box { width: min(380px, 100%); background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 34px 30px 26px; text-align: center; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-sub { color: var(--ink2); font-size: 13px; margin-top: 10px; }
.login-form { display: flex; gap: 8px; margin-top: 22px; align-items: stretch; }
.login-form .input { flex: 1 1 auto; width: auto; min-width: 0; height: 42px; }
.login-form .btn { flex: 0 0 auto; }
.login-pw { flex: 1; text-align: center; letter-spacing: 2px; }
.login-go { min-width: 78px; }
.login-tip { margin-top: 18px; font-size: 11.5px; color: var(--ink3); line-height: 1.7; }

/* ---------- 首页主区 ---------- */
.main-wb { max-width: none; padding: 0; margin: 0; height: calc(100vh - 54px); overflow: hidden; }
.workbench { display: flex; height: 100%; padding: 10px 12px 10px; box-sizing: border-box; align-items: stretch; }
.wb-pane { background: #fff; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.wb-pane .wb-head {
  padding: 10px 14px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line);
  background: #fbfbfd; display: flex; align-items: center; gap: 8px; flex: none;
}
.wb-pane .wb-head .head-act { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.wb-pane .wb-body { flex: 1; overflow: auto; }
.wb-pane.wb-detail { width: 560px; flex: none; }
.wb-pane.wb-preview { flex: 1 1 0; min-width: 320px; }
.wb-pane.wb-preview:fullscreen, .wb-pane.wb-preview:-webkit-full-screen { width: 100% !important; border-radius: 0; border: none; }
.pv-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pv-area { flex: 1; min-height: 0; display: flex; position: relative; }
.info-card { margin: 12px; padding: 12px; background: #fbfbfd; border: 1px solid var(--line); border-radius: 12px; }
.info-line { font-size: 12px; color: #0f766e; margin-top: 8px; }
.info-line.muted { color: var(--ink2); }
.badge.editable { cursor: pointer; border: 1px dashed rgba(0, 113, 227, .4); }
.badge.editable:hover { background: rgba(0, 113, 227, .1) !important; }

/* ---------- 主布局 ---------- */
main { max-width: 1220px; margin: 0 auto; padding: 20px 18px 90px; }
.page-title { display:flex; align-items:center; gap:10px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-title h1 { font-size: 21px; margin: 0; }
.page-title .sub { color: var(--ink2); font-size: 13px; }
.muted { color: var(--ink2); }
.small { font-size: 12px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }
.center { text-align: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 7px 14px; border-radius: 9px; cursor: pointer; font-size: 13.5px;
  transition: all .12s; white-space: nowrap; line-height: 1.3;
}
.btn:hover { border-color: #c7d2fe; background: #f5f7ff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: #eef2ff; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { padding: 10px 22px; font-size: 15px; }
.btn.warn { background:#fff7ed; border-color:#fed7aa; color:#9a3412; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }

.grid { display: grid; gap: 14px; }
.grid.courses { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.sems { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.grid.info { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.course-card { padding: 16px; cursor: pointer; position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,.12); }
.course-card .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.course-card h3 { margin: 2px 0 4px; font-size: 16px; }
.course-card .code { font-family: var(--mono); font-size: 12px; color: var(--ink2); }
.course-card .stat { margin-top: 10px; font-size: 12px; color: var(--ink2); display:flex; gap: 14px; flex-wrap: wrap; }

.sem-card { padding: 16px; cursor: pointer; position: relative; }
.sem-card:hover { box-shadow: 0 8px 24px rgba(37,99,235,.12); }
.sem-card .row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sem-card .tag-pill { font-weight: 700; font-size: 13px; background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; padding: 3px 10px; border-radius: 20px; }
.kv { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); }
.kv b { color: var(--ink); font-weight: 600; }
.kv .item { display: flex; gap: 4px; }

/* 徽标 */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 20px; background: #f1f5f9; color: #475569; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.amber { background: #fef3c7; color: #b45309; }
.badge.purple { background: #ede9fe; color: #6d28d9; }

/* ---------- 表 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink2); background: #f8fafc; border-bottom: 1px solid var(--line); padding: 8px 10px; white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:hover td { background: #f8faff; }
.tbl .num { text-align: center; }
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tbl-wrap .tbl { min-width: 520px; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs button {
  border: none; background: none; padding: 9px 16px; font-size: 14px; cursor: pointer;
  color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--ink2); margin-bottom: 5px; font-weight: 600; }
.input, .select, textarea.input {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 8px 11px;
  font-size: 14px; color: var(--ink); background: #fff; outline: none; font-family: inherit;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea.input { resize: vertical; min-height: 90px; }
.input.invalid { border-color: var(--bad); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.hint { font-size: 12px; color: var(--ink2); margin-top: 4px; }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 90;
  display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 48px 16px;
}
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .16s ease; }
.modal.wide { width: 860px; }
.modal.xwide { width: 1100px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 16px 18px; max-height: 72vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: #f8fafc; border-radius: 0 0 14px 14px; }
.x { border: none; background: none; font-size: 20px; cursor: pointer; color: var(--ink2); padding: 0 4px; }
.x:hover { color: var(--ink); }

/* ---------- Toast ---------- */
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: 380px; animation: slidein .2s ease;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
@keyframes pop { from { transform: scale(.96); opacity: .4; } }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }

/* ---------- 登录页（保留旧类名以保证兼容，样式统一到新版） ---------- */
.login-box .t { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-box .s { text-align: center; color: var(--ink2); font-size: 13px; margin-bottom: 22px; }
.spin { display:inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; vertical-align: -2px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ============ 资料库 ============ */
.group-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.group-head h3 { margin: 0; font-size: 15px; flex: 1; }
.group-head .cnt { font-size: 12px; color: var(--ink2); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
.mcard {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  cursor: pointer; transition: .13s; position: relative; display: flex; flex-direction: column; gap: 8px;
  min-height: 108px;
}
.mcard:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(37,99,235,.14); transform: translateY(-1px); }
.mcard .icon { font-size: 26px; line-height: 1; }
.mcard .mtitle { font-weight: 600; font-size: 13.5px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mcard .msub { font-size: 11.5px; color: var(--ink2); display: flex; gap: 8px; flex-wrap: wrap; }
.mcard .act { position: absolute; right: 6px; top: 6px; opacity: 0; transition: .13s; }
.mcard:hover .act { opacity: 1; }
.mcard.converting { border-style: dashed; border-color: var(--warn); }
.mcard .conv-tag { font-size: 11px; }
.kind-ico { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.ki-pdf { background: #fee2e2; } .ki-ppt { background: #ffe4e6; } .ki-doc { background: #dbeafe; }
.ki-xls { background: #dcfce7; } .ki-image { background: #fce7f3; } .ki-audio { background: #ede9fe; }
.ki-video { background: #cffafe; } .ki-link { background: #fef3c7; } .ki-text { background: #f1f5f9; }
.ki-archive { background: #e2e8f0; } .ki-file { background: #f1f5f9; }

/* ============ 播放器 / 查看器 ============ */
.viewer-shell { position: fixed; inset: 0; background: #1f2937; z-index: 80; display: flex; flex-direction: column; }
/* 顶栏可收起：收起后纵向空间全部给课件 */
.viewer-chrome { flex: none; overflow: hidden; transition: height .24s ease; }
/* 顶部感应条：绝对定位在顶端，只有顶栏收起时才生效（不参与布局、不挡按钮） */
.viewer-topzone { position: absolute; top: 0; left: 0; right: 0; height: 0; z-index: 30; pointer-events: none; }
.viewer-shell.chrome-hidden .viewer-topzone { height: 20px; pointer-events: auto; }
.viewer-shell.chrome-hidden .viewer-topzone::after {
  content: ''; position: absolute; left: 50%; top: 4px; transform: translateX(-50%);
  width: 64px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); transition: background .15s;
}
.viewer-shell.chrome-hidden .viewer-topzone:hover::after { background: rgba(255,255,255,.8); }
.viewer-top { display: flex; align-items: center; gap: 10px; background: #111827; color: #e5e7eb; padding: 8px 12px; min-height: 46px; }
.viewer-top .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-top button { background: rgba(255,255,255,.08); border: none; color: #e5e7eb; cursor: pointer; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.viewer-top button:hover { background: rgba(255,255,255,.2); }
.viewer-top button.on { background: #2563eb; color: #fff; }
.viewer-body { flex: 1; overflow: auto; position: relative; background: #374151; }
.pdf-scroll { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 14px 0 40px; gap: 16px; }
.pdf-page { position: relative; box-shadow: 0 4px 18px rgba(0,0,0,.4); background: #fff; }
.pdf-page canvas { display: block; }
.overlay { position: absolute; inset: 0; pointer-events: none; }
/* 开启板书后：touch-action:none 让触摸屏/手写笔可以正常画线，
   否则手指移动会被浏览器当成滚动/缩放手势，笔画直接断掉 */
.overlay.drawing { pointer-events: auto; cursor: crosshair; touch-action: none; }
.overlay svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.page-tools { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(17,24,39,.9); color: #fff; display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 12px; z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.page-tools input { width: 54px; }
.viewer-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #cbd5e1; gap: 10px; font-size: 15px; }

/* 画笔工具栏（置于第二行，不遮挡顶部按钮） */
.drawbar {
  position: static; transform: none; z-index: 60;
  display: flex; gap: 6px; align-items: center; background: rgba(17,24,39,.95); border-radius: 10px;
  padding: 6px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.35); color: #fff; flex-wrap: nowrap; width: max-content;
}
.drawbar input[type=range] { width: 120px; accent-color: #2563eb; cursor: ew-resize; }
.drawbar button { background: rgba(255,255,255,.1); border: none; color: #fff; border-radius: 8px; padding: 6px 9px; cursor: pointer; font-size: 12.5px; }
.drawbar button.on, .drawbar button:hover { background: #2563eb; }
.drawbar .sep { width: 1px; height: 22px; background: rgba(255,255,255,.2); }
.color-swatches { display: flex; gap: 4px; align-items: center; }
.csw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.csw.on { border-color: #fff; box-shadow: 0 0 0 2px #2563eb; }
.width-sel { width: 42px; }

/* 板书工具栏：悬停立即显示中文功能名（原生 title 有一秒延迟，且样式不可控） */
.drawbar [data-tip] { position: relative; }
.drawbar [data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: 50%; top: calc(100% + 9px); transform: translateX(-50%);
  background: #0f172a; color: #f1f5f9; font-size: 12px; font-weight: 400; line-height: 1.2;
  padding: 5px 9px; border-radius: 7px; white-space: nowrap; z-index: 300;
  border: 1px solid rgba(148,163,184,.35); box-shadow: 0 6px 18px rgba(0,0,0,.5);
  pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s ease;
}
.drawbar [data-tip]::before {
  content: ''; position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: #0f172a; z-index: 301; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .12s ease;
}
.drawbar [data-tip]:hover::after, .drawbar [data-tip]:hover::before { opacity: 1; visibility: visible; }
.drawbar .cur-tool { font-size: 12.5px; min-width: 34px; }
/* 滑块本身不能渲染伪元素，提示挂在包裹层上；左「细」右「粗」 */
.drawbar .w-wrap { position: relative; display: inline-flex; align-items: center; gap: 6px; }

/* 白板画布 */
.board-canvas { position: absolute; inset: 0; z-index: 5; }
.media-holder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #000; }
.media-holder video, .media-holder img { max-width: 100%; max-height: 100%; }
.media-holder img.full { max-width: none; max-height: none; }
.link-frame { width: 100%; height: 100%; border: none; background: #fff; display: block; }

/* 缩略列表 */
.thumb-strip { display: flex; gap: 8px; padding: 10px 14px; background: #0b1220; overflow-x: auto; }
.thumb-strip .th { cursor: pointer; opacity: .6; border-radius: 6px; overflow: hidden; flex: none; position: relative; }
.thumb-strip .th.on { opacity: 1; outline: 2px solid #2563eb; }
.thumb-strip canvas { display: block; width: 84px; height: 118px; }

/* ============ AI 面板 ============ */
.ai-chat { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 380px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.ai-msgs { flex: 1; overflow: auto; padding: 14px; background: #f8fafc; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 84%; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 3px; }
.msg.ai { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.msg .who { font-size: 11px; opacity: .7; margin-bottom: 4px; }
.ai-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: center; }
.ai-input textarea { flex: 1; min-height: 40px; max-height: 120px; }
.md { white-space: normal; }
.md pre { background: #0f172a; color: #e2e8f0; padding: 10px; border-radius: 8px; overflow: auto; font-size: 12.5px; }
.md code { background: #eef2ff; border-radius: 4px; padding: 1px 5px; font-family: var(--mono); font-size: 12px; }
.md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: 8px 0; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 9px; font-size: 13px; }
.md h1,.md h2,.md h3,.md h4 { margin: 12px 0 6px; }
.md ul,.md ol { margin: 6px 0; padding-left: 22px; }
.md blockquote { border-left: 3px solid var(--brand); margin: 8px 0; padding: 2px 12px; color: var(--ink2); background: #f8fafc; }
.suggest { border: 1px dashed #a5b4fc; border-radius: 10px; padding: 10px; margin-top: 8px; background: #eef2ff33; }
.suggest .one { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dashed #e0e7ff; }
.suggest .one:last-child { border-bottom: none; }

/* 课程主信息条 */
.hero { padding: 18px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.hero .h-name { font-size: 22px; font-weight: 700; }
.metachip { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; }
.metachip .k { font-size: 11.5px; color: var(--ink2); }
.metachip .v { font-weight: 600; font-size: 14px; }

/* 点名 */
.rollcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #fff; }
.rollcard:hover { border-color: var(--brand); }
.rollcard .d { font-weight: 700; font-size: 14px; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot-present { background: var(--ok); } .dot-absent { background: var(--bad); }
.dot-late { background: var(--warn); } .dot-leave { background: #7c3aed; } .dot-none { background: #cbd5e1; }
.roll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.roll-stu { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; cursor: pointer; user-select: none; background: #fff; font-size: 13px; }
.roll-stu b { margin-right: 8px; color: var(--ink2); font-weight: 500; }
.roll-stu .st { float: right; font-size: 12px; }
.roll-stu[data-st="present"] { border-color: #86efac; background: #f0fdf4; }
.roll-stu[data-st="absent"] { border-color: #fca5a5; background: #fef2f2; }
.roll-stu[data-st="late"] { border-color: #fcd34d; background: #fffbeb; }
.roll-stu[data-st="leave"] { border-color: #c4b5fd; background: #f5f3ff; }

/* 其它 */
.empty { text-align: center; color: var(--ink2); padding: 46px 16px; font-size: 13.5px; }
.empty .big { font-size: 40px; margin-bottom: 10px; }
.kbd { background: #e2e8f0; border-radius: 5px; padding: 0 6px; font-family: var(--mono); font-size: 12px; }
code.path { background:#eef2ff; padding:1px 6px; border-radius:6px; font-family: var(--mono); font-size:12.5px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat-cards .c { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat-cards .n { font-size: 24px; font-weight: 700; }
.stat-cards .l { font-size: 12px; color: var(--ink2); }
.hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
details.acc { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 10px; }
details.acc summary { padding: 10px 14px; cursor: pointer; font-weight: 600; }
details.acc .acc-body { padding: 4px 14px 14px; }
.drop-zone { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 26px; text-align: center; color: var(--ink2); cursor: pointer; transition: .13s; }
.drop-zone.drag, .drop-zone:hover { border-color: var(--brand); background: #eff6ff; }
.progress { height: 8px; background: #e2e8f0; border-radius: 20px; overflow: hidden; margin: 8px 0; }
.progress .bar { height: 100%; background: var(--brand); width: 0; transition: width .2s; }
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .modal-mask { padding: 14px; align-items: flex-start; }
}

/* ============ 四栏工作台（栏宽可拖动调整） ============ */
/* 首页两栏：分隔条 + 列表项 + iframe */
.wb-gutter { flex: none; width: 9px; cursor: col-resize; position: relative; border-radius: 5px; }
.wb-gutter::after { content: ''; position: absolute; left: 3px; top: 12px; bottom: 12px; width: 3px; background: #d2d2d7; border-radius: 3px; transition: background .15s; }
.wb-gutter:hover::after, .wb-gutter.drag::after { background: var(--brand); }
.wb-item { display: flex; gap: 8px; padding: 9px 12px; cursor: pointer; border-left: 3px solid transparent; }
.wb-item:hover { background: #f8faff; }
.wb-item.on { background: #eef6ff; border-left-color: var(--brand); }
.wb-item .t1 { font-weight: 600; font-size: 13.5px; }
.wb-item .t2 { font-size: 12px; color: var(--ink2); }
.wb-empty { color: var(--ink2); text-align: center; padding: 34px 14px; font-size: 13px; }
.wb-iframe { width: 100%; height: 100%; border: none; background: #fff; }
@media (max-width: 1100px) { .wb-pane.wb-preview { flex-basis: 380px; } }
.mcard-on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(37,99,235,.35); }
/* 首页左栏：卡片更紧凑，一屏能看更多资料 */
.wb-detail .mgrid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.wb-detail .mcard { padding: 9px 10px; gap: 6px; min-height: 84px; border-radius: 11px; }
.wb-detail .mcard .mtitle { font-size: 12.8px; -webkit-line-clamp: 2; }
.wb-detail .mcard .kind-ico { width: 28px !important; height: 28px !important; font-size: 14px !important; border-radius: 8px; }
.wb-detail .info-card { margin: 10px 12px 4px; padding: 11px 12px; }
.wb-detail .mcard:hover { box-shadow: 0 4px 12px rgba(0, 113, 227, .16); }

/* 设置页内嵌 AI 助教对话面板 */
.wb-ai-embed .ai-chat { height: 500px; min-height: 420px; }
.wb-ai-embed .ai-msgs { min-height: 240px; }

/* ============ 最右预览栏：下方 AI 对话窗 ============ */
.mat-ai { flex: none; min-height: 0; height: 292px; display: flex; flex-direction: column; overflow: hidden; border-top: 1px solid var(--line); background: #fff; }
.mat-ai-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 5px 10px; font-weight: 700; font-size: 12.5px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; }
.mat-ai-head .mat-ctx { font-weight: 500; color: var(--ink2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.mat-quick { flex: none; display: flex; gap: 6px; padding: 4px 8px; border-bottom: 1px solid #f1f5f9; background: #f8fafc; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; min-height: 30px; max-height: 34px; align-items: center; }
.mat-quick .btn { padding: 2px 9px; font-size: 12px; }
.mat-msgs { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 7px; background: #f8fafc; }
.mat-msgs .msg { max-width: 96%; font-size: 12.8px; padding: 7px 10px; }
.mat-msgs .msg.me { align-self: flex-end; background: #2563eb; color: #fff; border-radius: 10px 10px 2px 10px; }
.mat-msgs .msg.ai { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 10px 10px 10px 2px; }
.mat-input {
/* 课件问答：正文载入状态 */
.mat-ai-statusbar { padding: 0 12px 6px; }
.mat-ai-status { font-size: 11.5px; color: var(--ink3); }
.mat-ai-status.loading { color: var(--ink2); }
.mat-ai-status.ok { color: #15803d; }
.mat-ai-status.warn { color: #b45309; }
.mat-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 8px; padding: 6px 9px; font-size: 12px; margin-bottom: 6px; }
.mat-ai-head .mat-ctx { color: var(--brand); font-weight: 600; }
 flex: none; display: flex; gap: 6px; padding: 6px 9px; border-top: 1px solid #e2e8f0; align-items: flex-end; background: #fff; position: relative; z-index: 2; }
.mat-input textarea { flex: 1; min-height: 32px; max-height: 84px; font-size: 12.8px; }

/* ============ 最右预览栏：上下可拖拽 / 全屏 / 收起对话 ============ */
.wb-vgutter { flex: none; height: 9px; cursor: row-resize; touch-action: none; background: #eef2ff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.wb-vgutter::after { content: ''; position: absolute; left: 0; right: 0; top: 2px; height: 2px; background: #c7d2fe; border-radius: 2px; transition: background .15s; }
.wb-vgutter:hover::after, .wb-vgutter.drag::after { background: var(--brand); }
.wb-bottom { display: flex; flex-direction: column; flex: none; min-height: 0; max-height: 70%; overflow: visible; }
.wb-pane.wb-preview:fullscreen, .wb-pane.wb-preview:-webkit-full-screen { width: 100% !important; max-width: 100vw; border-radius: 0; border: none; }
.editable-chip:hover { border-color: var(--brand) !important; background: #e0e7ff !important; }

/* ============ 排版润色：能单行不换行 ============ */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar { flex-wrap: nowrap; }
.topbar .t, .topbar .logo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .t { max-width: 40vw; }
.topbar nav { flex-wrap: nowrap; }
.btn, .navbtn, .badge, .tag-pill { white-space: nowrap; }
.badge { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.page-title { flex-wrap: nowrap; }
.page-title h1, .page-title .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title .right, .card-title .grow { flex-shrink: 0; }
.metachip { min-width: 0; }
.metachip .v { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .kv .item, .sem-card .kv .item, .kv b { white-space: nowrap; }
.sched-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }
.group-head { flex-wrap: nowrap; }
.group-head h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-item { flex-wrap: nowrap; align-items: flex-start; }
.wb-item .t1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.wb-item .t2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.mgrid .mtitle { -webkit-line-clamp: 1; line-height: 1.5; }
.mcard { white-space: normal; }
.mcard .msub span { white-space: nowrap; }
.tbl th { white-space: nowrap; }
.tbl td { white-space: nowrap; }
.tbl td.allow-wrap { white-space: normal; min-width: 140px; }
.mat-ai-head { flex-wrap: nowrap; }
.mat-ai-head .mat-ctx { flex: none; max-width: 42%; }
.roll-stu { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-head { flex-wrap: nowrap; }
.wb-head span, .wb-head .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-head .btn { flex-shrink: 0; }
.toast, .msg .md p { white-space: normal; }
.msg .who { white-space: nowrap; }
.stat-cards .n, .stat-cards .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt8 .badge, .flex .badge { vertical-align: middle; }

/* ============ 链接预览提示条 ============ */
.viewer-body .link-note { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; gap: 8px; align-items: center; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 5px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.12); max-width: 92%; flex-wrap: wrap; justify-content: center; }
.link-frame { display: block; }

/* 课程行 ⋮ 弹出菜单 */
.wb-popmenu { position: fixed; z-index: 400; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 34px rgba(15,23,42,.18); padding: 5px; min-width: 190px; display: flex; flex-direction: column; gap: 2px; }
.wb-popmenu button { border: none; background: none; text-align: left; padding: 8px 12px; border-radius: 7px; font-size: 13.5px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.wb-popmenu button:hover { background: #eef2ff; }
.wb-popmenu button:last-child { color: var(--bad); }
.wb-popmenu button:last-child:hover { background: #fef2f2; }

/* ============ 资料标记（钩/圈/叉） ============ */
.ki-html { background: #fef9c3; }
.card-corner { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; align-items: center; z-index: 3; }
.mark-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #cbd5e1; background: #fff; font-size: 13px; font-weight: 700; cursor: pointer; padding: 0; line-height: 1; }
.mark-badge:hover { transform: scale(1.12); }
/* 使用情况标记要一眼能扫到，所以不做「悬停才显示」；其它角落徽标仍保持悬停变亮 */
.mcard .card-corner { opacity: .55; transition: opacity .13s; }
.mcard:hover .card-corner { opacity: 1; }
.mcard .card-corner .mark-badge { opacity: 1; }
.mcard .card-corner { opacity: 1; }
.mcard .card-corner:not(:has(.mark-badge)) { opacity: .55; }

/* 三态标记：并排三个小圆钮，当前状态高亮，点哪个设哪个 */
.mark-group { display: inline-flex; gap: 5px; align-items: center; }
.mark-btn {
  width: 23px; height: 23px; border-radius: 50%; border: 1.6px solid #e2e6ee;
  background: transparent; font-size: 13px; font-weight: 700; line-height: 1;
  padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s, border-color .12s, color .12s, background .12s;
  user-select: none;
}
.mark-btn:hover { transform: scale(1.15); }
.mark-btn:active { transform: scale(.94); }
.wb-item .card-corner { position: static; }

/* 作业管理弹窗 */
.assign-list { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.assign-row { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.assign-row:last-child { border-bottom: none; }
.assign-main { flex: 1; min-width: 0; }
.assign-title { font-weight: 600; font-size: 13.5px; }
.assign-desc { font-size: 12px; color: var(--ink2); margin-top: 6px; white-space: pre-wrap; }
.assign-act { display: flex; gap: 6px; flex: none; }

/* 课件加载中的温和提示 */
.viewer-body .loading-hint { text-align: center; color: #cbd5e1; font-size: 13px; padding: 18px; }

/* 课件加载进度（大文件要下载几十秒，必须让用户看到在动） */
.load-progress { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; }
.lp-bar { width: min(320px, 70%); height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
.lp-fill { height: 100%; width: 2%; background: linear-gradient(90deg, #0a84ff, #64d2ff); border-radius: 3px; transition: width .25s; }
.lp-text { color: #cbd5e1; font-size: 13px; }
.viewer-body { position: relative; }

/* 链接资料卡片（多数网站禁止内嵌，直接给打开按钮） */
.link-card { max-width: 560px; margin: 60px auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; text-align: center; box-shadow: var(--shadow); }
.lc-icon { font-size: 42px; line-height: 1; }
.lc-title { font-size: 17px; font-weight: 700; margin-top: 10px; }
.lc-url { font-size: 12px; color: var(--brand); word-break: break-all; margin-top: 6px; }
.lc-note { font-size: 12.5px; color: var(--ink2); margin-top: 12px; line-height: 1.7; }
.lc-act { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* 浏览器自带 PDF 阅读器兜底 */
.native-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #1f2937; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.native-bar .btn { flex: none; }
.native-pdf { flex: 1; width: 100%; height: 100%; border: none; background: #525659; }

/* 预览窗加载失败的兜底卡片 */
.pv-fallback { margin: auto; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px; text-align: center; box-shadow: var(--shadow); }

/* 预览窗可能没加载出来时的温和提示（不替换内容） */
.pv-warn { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 8px 12px;
  font-size: 12.5px; color: #92400e; box-shadow: 0 6px 20px rgba(0,0,0,.12); max-width: 92%; }

/* 内嵌外部系统的劝阻条（很多教学系统在内嵌下无法登录） */
.embed-warn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px;
  background: #fffbeb; border-bottom: 1px solid #fde68a; color: #92400e; font-size: 12.5px; }
.embed-warn .ew-text { flex: 1; min-width: 220px; line-height: 1.5; }
.embed-warn .btn { flex: none; }

/* 聚光灯 + 激光笔：周围压暗，只留光标处一个亮圈；overlay 不吃事件，不挡板书/按钮 */
.spot-layer { position: fixed; z-index: 70; pointer-events: none; display: none; }
.spot-layer.on { display: block; }
.spot-layer.on {
  background: radial-gradient(circle at var(--sx, 50%) var(--sy, 50%),
    rgba(0,0,0,0) 0px, rgba(0,0,0,0) var(--spot-r, 96px),
    rgba(0,0,0,.55) calc(var(--spot-r, 96px) + 56px), rgba(0,0,0,.8) 100%);
}
.spot-dot {
  position: absolute; left: var(--sx, 50%); top: var(--sy, 50%);
  width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: radial-gradient(circle, #ff453a 0%, rgba(255,69,58,.85) 40%, rgba(255,69,58,0) 72%);
  box-shadow: 0 0 20px 7px rgba(255,69,58,.5);
}

/* 链接卡片上的「依据」小字（如 X-Frame-Options） */
.lc-evidence { margin-top: 8px; font-size: 11.5px; color: var(--ink3); background: #f8fafc; border: 1px dashed var(--line-solid); border-radius: 8px; padding: 6px 9px; word-break: break-all; }
