html {
  height: 100%;
}

/* 与站点页头、页脚同屏：中部授课区占满剩余高度 */
body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.skeTeachingWrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: grid;
  grid-template-rows: auto 1fr auto auto; /* 主区 / 底栏 / 页脚提示 */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #0b1220;
  background: radial-gradient(1200px 600px at 20% -10%, #eef3ff 0%, transparent 60%),
    radial-gradient(1200px 600px at 90% 0%, #f3efff 0%, transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.title .h1 {
  font-weight: 700;
  letter-spacing: 0.2px;
}
.title .sub {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(2, 6, 23, 0.65);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bottombar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 10px 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
}

.bottomActions {
  justify-content: center;
}

.fileBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  user-select: none;
}
.fileBtn input {
  display: none;
}

.btn {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn:not(:disabled):hover {
  background: white;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.65);
}
.pageLabel {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: rgba(2, 6, 23, 0.72);
}
.pageInput {
  width: 72px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.9);
}

.main {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  gap: 12px;
  padding: 12px 12px 18px;
  min-height: 0; /* 允许子面板内部滚动，避免撑高 */
  overflow: hidden; /* 主区不滚动，交给子面板 */
}

.sidebar {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.rightbar {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  min-height: 0;
}

.rightbarTopActions {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.smallBtn {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.tab {
  padding: 10px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 650;
  color: rgba(2, 6, 23, 0.72);
}
.tab:hover {
  background: rgba(15, 23, 42, 0.04);
}
.tab.active {
  color: rgba(30, 41, 59, 0.95);
  background: rgba(99, 102, 241, 0.10);
  box-shadow: inset 0 -2px 0 rgba(99, 102, 241, 0.95);
}

.tabPanels {
  min-height: 0;
  overflow: hidden;
}
.tabPanel {
  height: 100%;
  overflow: auto;
}

.list {
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.listItem {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.listItem.selectable {
  cursor: pointer;
}
.listItem.selected {
  border-color: rgba(99, 102, 241, 0.9);
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.18);
}
.listItemTitle {
  font-weight: 700;
}
.listItemMeta {
  font-size: 12px;
  color: rgba(2, 6, 23, 0.65);
  line-height: 1.45;
}

.panelTitle {
  padding: 10px 12px;
  font-weight: 650;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.stage > .panelTitle {
  text-align: center;
}

.stageTools {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.55);
  justify-content: center;
  flex-wrap: wrap;
}

.thumbs {
  padding: 10px;
  overflow: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 两列缩略图 */
}

.thumb {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  position: relative;
}
.thumb:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.08);
}
.thumb.active {
  border-color: rgba(99, 102, 241, 0.9);
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.18);
}
.thumb .thumbIndex {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  padding: 3px 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.thumb .thumbBody {
  padding: 8px;
}

.thumbPreviewViewport {
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
}

.thumbPreview {
  pointer-events: none; /* 避免缩略图内部元素抢点击 */
}
.thumbPreview * {
  pointer-events: none;
}

.emptyHint {
  font-size: 13px;
  color: rgba(2, 6, 23, 0.65);
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.6);
}

.stage {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  min-height: 0;
}

.status {
  padding: 16px;
  color: rgba(2, 6, 23, 0.72);
}
.statusLine {
  font-weight: 650;
  margin-bottom: 8px;
}
.statusHint {
  font-size: 13px;
  line-height: 1.55;
}
.statusHint code {
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.viewerWrap {
  width: 100%;
  height: 100%;
  padding: 14px;
  box-sizing: border-box;
}

.viewer {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: auto;
  padding: 8px;
  box-sizing: border-box;
}

/* 授课中心：按比例缩放整块幻灯片，保证「完整显示」而非裁切（contain） */
.skeViewerFitShell {
  flex-shrink: 0;
}
.skeViewerFitOuter {
  overflow: visible;
  margin: 0 auto;
}
.skeViewerFitInner {
  overflow: visible;
  transform-origin: top left;
}

/* 覆盖 pptxjs 默认 overflow:hidden，减少贴边图形/阴影被裁 */
.viewer .slide {
  overflow: visible;
}

.footer {
  padding: 10px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  color: rgba(2, 6, 23, 0.65);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.65);
  display: grid;
  gap: 6px;
}

.notice {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.10);
  color: rgba(2, 6, 23, 0.78);
  font-size: 12px;
  line-height: 1.45;
}

.hidden {
  display: none !important;
}

/* 黑板（手写）覆盖层 */
.blackboard {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0b1220;
  display: grid;
  grid-template-rows: auto 1fr;
}

.bbTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(2, 6, 23, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.bbTitle {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.bbTools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bbLabel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
}

.bbLabel input[type="range"] {
  width: 120px;
}

.bbBtn {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.bbBtn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.bbBtnActive {
  border-color: rgba(99, 102, 241, 0.95);
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.25);
}

.bbCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* 触控/手写时不滚动页面 */
  cursor: crosshair;
}

@media (max-width: 980px) {
  .main {
    grid-template-columns: 1fr;
  }
  .sidebar {
    grid-template-rows: auto auto;
  }
  .thumbs {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 220px);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .rightbar {
    grid-template-rows: auto auto;
    min-height: 280px;
  }
}

/* 全屏时只显示“授课中心” */
:fullscreen .main {
  grid-template-columns: 1fr;
  padding: 0;
  gap: 0;
}
:fullscreen .sidebar,
:fullscreen .rightbar,
:fullscreen .bottombar,
:fullscreen .footer {
  display: none !important;
}
:fullscreen .uk-navbar-container,
:fullscreen .skeSiteFooter {
  display: none !important;
}
:fullscreen .skeTeachingWrap {
  flex: 1 1 auto;
}
:fullscreen .stage {
  border-radius: 0;
  border: none;
}
:fullscreen .stage > .panelTitle {
  display: none;
}

/* 选择备课弹层 */
.beikeModal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.beikeModal.hidden {
  display: none !important;
}
.beikeModalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
}
.beikeModalCard {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.18);
}
.beikeModalHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.beikeModalTitle {
  font-weight: 600;
  font-size: 15px;
}
.beikeModalCloseBtn {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: rgba(2, 6, 23, 0.55);
  padding: 4px 8px;
  border-radius: 8px;
}
.beikeModalCloseBtn:hover {
  background: rgba(2, 6, 23, 0.06);
  color: #0b1220;
}
.beikeModalBody {
  padding: 8px;
  overflow: auto;
  flex: 1;
}
.beikePickRow {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.beikePickRow:hover {
  background: #f4f7ff;
  border-color: rgba(59, 130, 246, 0.35);
}
.beikePickRowTitle {
  font-weight: 600;
  font-size: 14px;
}
.beikePickRowMeta {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(2, 6, 23, 0.58);
}
.beikeModalEmpty {
  padding: 24px 12px;
  text-align: center;
  color: rgba(2, 6, 23, 0.55);
  font-size: 13px;
}
