/* ==========================================================================
   学小优 K12 交互课件设计系统 (Design System CSS)
   版本: v1.0.0
   适用场景: 教室电子白板 / 强光大屏 / 互动教学
   ========================================================================== */

:root {
  /* --- 1. 色彩系统 (Color Tokens) --- */
  /* 主色调：采用高饱和、高辨识度的活力蓝 */
  --cw-primary: #1865F2;
  --cw-primary-hover: #0E52D1;
  --cw-primary-active: #0A3FB0;
  --cw-primary-light: #EBF2FF;
  
  /* 功能状态色 (高对比度) */
  --cw-success: #059669;
  --cw-success-bg: #ECFDF5;
  --cw-warning: #D97706;
  --cw-warning-bg: #FFFBEB;
  --cw-danger: #DC2626;
  --cw-danger-bg: #FEF2F2;
  --cw-info: #0284C7;
  --cw-info-bg: #F0F9FF;

  /* 品牌辅助鲜艳色 (用于具象物体/图形/高亮) */
  --cw-accent-red: #EF4444;
  --cw-accent-yellow: #F59E0B;
  --cw-accent-green: #10B981;
  --cw-accent-blue: #3B82F6;
  --cw-accent-purple: #8B5CF6;
  --cw-accent-orange: #F97316;

  /* 中性色 (抗强光高对比文字与背景) */
  --cw-bg-main: #F4F6F9;
  --cw-bg-surface: #FFFFFF;
  --cw-bg-teacher: #F8FAFC;
  --cw-text-primary: #0F172A; /* 接近纯黑，WCAG AAA 比率 > 12:1 */
  --cw-text-secondary: #334155;
  --cw-text-muted: #64748B;
  --cw-border-strong: #0F172A; /* 大屏高粗细边框 */
  --cw-border-medium: #CBD5E1;
  --cw-border-light: #E2E8F0;

  /* --- 2. 字体与尺寸规范 (Typography & Spacing) --- */
  --cw-font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --cw-font-base: 18px; /* 教室基准字号，远观依然清晰 */
  
  --cw-font-size-sm: 16px;
  --cw-font-size-base: 18px;
  --cw-font-size-lg: 22px;
  --cw-font-size-xl: 28px;
  --cw-font-size-2xl: 36px;
  --cw-font-size-3xl: 48px;

  /* 大屏触控热区规范 (Touch Targets) */
  --cw-touch-min-height: 52px;
  --cw-touch-target-large: 64px;
  --cw-radius-sm: 8px;
  --cw-radius-md: 12px;
  --cw-radius-lg: 20px;

  /* 粗笔画与外边框 (防止投影仪发虚) */
  --cw-stroke-width: 2px;
  --cw-stroke-thick: 4px;

  /* 阴影 */
  --cw-shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.08);
  --cw-shadow-md: 0 8px 16px -2px rgba(15, 23, 42, 0.12);
  --cw-shadow-lg: 0 16px 32px -4px rgba(15, 23, 42, 0.16);

  /* 动画过渡 */
  --cw-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 强光抗反射模式 (High Contrast Outdoor/Bright Classroom Mode) --- */
[data-theme="high-contrast"] {
  --cw-bg-main: #FFFFFF;
  --cw-bg-surface: #FFFFFF;
  --cw-bg-teacher: #F1F5F9;
  --cw-text-primary: #000000;
  --cw-text-secondary: #1E293B;
  --cw-border-strong: #000000;
  --cw-border-medium: #000000;
  --cw-stroke-width: 3px;
  --cw-shadow-md: 0 0 0 3px #000000;
}

/* ==========================================================================
   全局重置与标准布局 (Global & Layout)
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none; /* 大屏防止拖拽误选文字 */
}

body {
  font-family: var(--cw-font-family);
  font-size: var(--cw-font-base);
  color: var(--cw-text-primary);
  background-color: var(--cw-bg-main);
  line-height: 1.5;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 课件全屏容器 */
.cw-app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  position: relative;
  background-color: var(--cw-bg-main);
}

/* --- 顶栏 Header --- */
.cw-header {
  height: 72px;
  background-color: var(--cw-bg-surface);
  border-bottom: var(--cw-stroke-width) solid var(--cw-border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 10;
  flex-shrink: 0;
  box-shadow: var(--cw-shadow-sm);
}

.cw-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  color: var(--cw-text-primary);
}

.cw-header-badge {
  background-color: var(--cw-primary-light);
  color: var(--cw-primary);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(24, 101, 242, 0.25);
  letter-spacing: 0.2px;
}

.cw-header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- 主体区域 Layout Main --- */
.cw-main-body {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* 互动大屏舞台 (Interactive Stage Area) */
.cw-stage-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--cw-bg-main);
  overflow: hidden;
  transition: var(--cw-transition);
}

/* 互动画布/视图容器 */
.cw-canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

/* 教师配置/控制面板 (Teacher Configuration Panel) */
.cw-teacher-panel {
  width: 360px;
  background-color: var(--cw-bg-teacher);
  border-left: var(--cw-stroke-width) solid var(--cw-border-medium);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: var(--cw-transition);
  box-shadow: var(--cw-shadow-md);
  position: relative;
}

/* 当教师面板收起/隐藏时的样式 */
.cw-teacher-panel.collapsed {
  margin-right: -360px;
  visibility: hidden;
  pointer-events: none;
}

.cw-panel-header {
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--cw-stroke-width) solid var(--cw-border-medium);
  background-color: var(--cw-bg-surface);
}

.cw-panel-title {
  font-size: var(--cw-font-size-lg);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw-panel-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 悬浮面板收折触控扣板 (Toggle Edge Button) */
.cw-panel-toggle-btn {
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 72px;
  background-color: var(--cw-bg-surface);
  border: var(--cw-stroke-width) solid var(--cw-border-medium);
  border-right: none;
  border-radius: 16px 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: -4px 0 12px rgba(15, 23, 42, 0.08);
  z-index: 25;
}

/* 底部操作工具栏 (Action Bar) */
.cw-action-bar {
  min-height: 80px;
  background-color: var(--cw-bg-surface);
  border-top: var(--cw-stroke-width) solid var(--cw-border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 24px;
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.05);
}

/* ==========================================================================
   全屏模式 (Stage Fullscreen & Focus Mode)
   ========================================================================== */

/* 舞台独立全屏 (隐藏 Header、Panel、编辑入口，只聚焦在 Stage Area) */
.cw-app-container.stage-fullscreen .cw-header,
.cw-app-container.stage-fullscreen .cw-teacher-panel,
.cw-app-container.stage-fullscreen .cw-shell-edit-entry {
  display: none !important;
}

.cw-app-container.stage-fullscreen .cw-stage-area {
  width: 100vw;
  height: 100vh;
}

/* 全屏专属悬浮工具栏 (Floating Control Pill in Fullscreen) */
.cw-fullscreen-floating-bar {
  position: absolute;
  top: 18px;
  right: 24px;
  display: none;
  align-items: center;
  gap: 6px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--cw-stroke-width) solid var(--cw-border-medium);
  padding: 4px 8px;
  border-radius: 40px;
  box-shadow: var(--cw-shadow-md);
  z-index: 100;
  pointer-events: auto;
}

.cw-app-container.stage-fullscreen .cw-fullscreen-floating-bar {
  display: inline-flex;
}

.cw-fullscreen-floating-bar .cw-btn {
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: var(--cw-text-secondary);
  box-shadow: none;
}

.cw-fullscreen-floating-bar .cw-btn:hover {
  background: var(--cw-bg-main);
  color: var(--cw-text-primary);
}

.cw-fullscreen-floating-bar .cw-btn.cw-btn-primary {
  background: var(--cw-primary-light);
  color: var(--cw-primary);
}

/* ==========================================================================
   交互组件标准 (Standard Controls & Touch UI)
   ========================================================================== */

/* --- 1. 大屏按钮 (Buttons) --- */
.cw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--cw-touch-min-height);
  padding: 0 24px;
  font-size: var(--cw-font-size-base);
  font-weight: 700;
  border-radius: var(--cw-radius-md);
  border: var(--cw-stroke-width) solid transparent;
  cursor: pointer;
  transition: var(--cw-transition);
  white-space: nowrap;
  outline: none;
}

.cw-btn:active {
  transform: scale(0.96);
}

.cw-btn-primary {
  background-color: var(--cw-primary);
  color: #FFFFFF;
  border-color: var(--cw-primary);
  box-shadow: 0 4px 12px rgba(24, 101, 242, 0.25);
}

.cw-btn-primary:hover {
  background-color: var(--cw-primary-hover);
}

.cw-btn-secondary {
  background-color: var(--cw-bg-surface);
  color: var(--cw-text-primary);
  border-color: var(--cw-border-strong);
}

.cw-btn-secondary:hover {
  background-color: var(--cw-primary-light);
}

.cw-btn-large {
  height: var(--cw-touch-target-large);
  padding: 0 32px;
  font-size: var(--cw-font-size-lg);
  border-radius: var(--cw-radius-lg);
}

.cw-btn-icon {
  width: var(--cw-touch-min-height);
  padding: 0;
  border-radius: var(--cw-radius-md);
}

/* --- 2. 控制组 / 计数器 (Number Stepper for Touch Screen) --- */
.cw-stepper {
  display: inline-flex;
  align-items: center;
  border: var(--cw-stroke-width) solid var(--cw-border-strong);
  border-radius: var(--cw-radius-md);
  background-color: var(--cw-bg-surface);
  overflow: hidden;
}

.cw-stepper-btn {
  width: 52px;
  height: 52px;
  background: var(--cw-bg-teacher);
  border: none;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--cw-transition);
}

.cw-stepper-btn:active {
  background-color: var(--cw-border-medium);
}

.cw-stepper-value {
  width: 60px;
  text-align: center;
  font-size: var(--cw-font-size-lg);
  font-weight: 700;
  color: var(--cw-text-primary);
}

/* --- 3. 配置卡片分组 (Form / Config Group) --- */
.cw-form-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cw-form-label {
  font-size: var(--cw-font-size-base);
  font-weight: 700;
  color: var(--cw-text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cw-card {
  background-color: var(--cw-bg-surface);
  border: var(--cw-stroke-width) solid var(--cw-border-medium);
  border-radius: var(--cw-radius-md);
  padding: 20px;
  box-shadow: var(--cw-shadow-sm);
}

/* 强调卡片边框 (强光下更醒目) */
.cw-card-highlight {
  border-color: var(--cw-primary);
  border-width: var(--cw-stroke-thick);
}

/* --- 通用课件外壳 (CoursewareShell) --- */
.cw-shell .cw-stage-area {
  background: var(--cw-bg-surface);
}

.cw-shell-question-rail {
  position: absolute;
  top: 50%;
  left: 18px;
  max-height: calc(100vh - 140px);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  min-width: 44px;
  gap: 8px;
  transform: translateY(-50%);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 4px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--cw-border-medium) transparent;
}

.cw-shell-question-rail::-webkit-scrollbar {
  width: 4px;
}

.cw-shell-question-rail::-webkit-scrollbar-thumb {
  background: var(--cw-border-medium);
  border-radius: 4px;
}

.cw-shell-question-rail button {
  min-width: 44px;
  height: 40px;
  padding: 0 10px;
  flex-shrink: 0;
  box-sizing: border-box;
  color: var(--cw-text-secondary);
  background: var(--cw-bg-surface);
  border: var(--cw-stroke-width) solid var(--cw-border-medium);
  border-radius: var(--cw-radius-md);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--cw-shadow-sm);
  transition: var(--cw-transition);
  white-space: nowrap;
  user-select: none;
  touch-action: none;
}

.cw-shell-question-rail button .cw-rail-num {
  min-width: 22px;
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
  flex-shrink: 0;
  display: inline-block;
}

.cw-shell-question-rail button.has-title {
  justify-content: flex-start;
  padding: 0 12px 0 8px;
  min-width: 108px;
  max-width: 190px;
}

.cw-shell-question-rail button.has-title .cw-rail-num {
  min-width: 26px;
  text-align: center;
}

.cw-shell-question-rail button .cw-rail-title {
  margin-left: 6px;
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  letter-spacing: 0.2px;
  flex: 1;
}

.cw-shell-question-rail button:hover {
  border-color: var(--cw-primary);
  color: var(--cw-primary);
  background: var(--cw-primary-light);
}

.cw-shell-question-rail button[aria-current="true"] {
  color: #fff;
  background: var(--cw-primary);
  border-color: var(--cw-primary);
  box-shadow: 0 4px 12px rgba(24, 101, 242, 0.3);
}

.cw-shell-question-rail button {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.cw-shell-question-rail button.is-dragging {
  cursor: grabbing;
  opacity: 0.45;
  transform: scale(0.92);
  box-shadow: 0 8px 20px rgba(24, 101, 242, 0.4);
}

.cw-shell-question-rail button.is-drag-over {
  border-color: var(--cw-primary);
  background: var(--cw-primary-light);
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(24, 101, 242, 0.45);
}

.cw-shell-question-rail .cw-shell-add-question {
  color: var(--cw-primary);
  border-style: dashed;
  border-color: var(--cw-primary);
}

.cw-shell-prompt {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  text-align: left;
  width: min(74%, 980px);
  max-width: calc(100% - 220px);
  z-index: 3;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  white-space: pre-wrap;
  color: var(--cw-text-primary);
  pointer-events: none;
}

/* 题干数学填空槽位美化 */
.cw-prompt-blank {
  display: inline-block;
  min-width: 58px;
  height: 30px;
  margin: 0 5px;
  border-bottom: 3px solid var(--cw-primary);
  background: rgba(24, 101, 242, 0.08);
  border-radius: 4px 4px 0 0;
  vertical-align: -5px;
  box-sizing: border-box;
  pointer-events: auto;
}

[data-theme="high-contrast"] .cw-prompt-blank {
  border-bottom-color: #000;
  background: rgba(0, 0, 0, 0.1);
}

.cw-shell-prompt:empty {
  display: none;
}

.cw-shell-prompt svg {
  display: inline-block;
  width: auto;
  max-width: 100%;
  height: 1.65em;
  margin: 0 0.18em;
  vertical-align: -0.3em;
}

.cw-shell-stage {
  position: relative;
  flex: 1;
  min-height: 350px;
  overflow: hidden;
  perspective: 1100px;
  touch-action: none;
}

.cw-shell-tools {
  position: absolute;
  z-index: 3;
  display: flex;
  overflow: hidden;
  background: var(--cw-bg-surface);
  border: var(--cw-stroke-width) solid var(--cw-border-medium);
  border-radius: var(--cw-radius-md);
  box-shadow: var(--cw-shadow-sm);
}

.cw-shell-tools:empty {
  display: none;
}

.cw-shell-tools-right {
  top: 20px;
  right: 24px;
}

.cw-shell-tools-bottom {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.cw-shell-tools button {
  min-width: 54px;
  min-height: 52px;
  padding: 0 18px;
  color: var(--cw-text-secondary);
  background: var(--cw-bg-surface);
  border: 0;
  border-right: 1px solid var(--cw-border-medium);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--cw-transition);
}

.cw-shell-tools button:last-child {
  border-right: 0;
}

.cw-shell-tools button:hover {
  background: var(--cw-bg-main);
  color: var(--cw-text-primary);
}

.cw-shell-tools button[aria-pressed="true"] {
  color: var(--cw-primary);
  background: var(--cw-primary-light);
}

.cw-shell-tools button:disabled {
  cursor: default;
  opacity: 0.45;
  color: var(--cw-text-secondary);
  background: var(--cw-bg-surface);
}

/* 右下角编辑入口胶囊 (未编辑时展示) */
.cw-shell-edit-entry {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cw-text-secondary);
  background: var(--cw-bg-surface);
  border: var(--cw-stroke-width) solid var(--cw-border-medium);
  border-radius: 23px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--cw-shadow-sm);
  transition: var(--cw-transition);
}

.cw-shell-edit-entry svg {
  color: var(--cw-text-muted);
  transition: var(--cw-transition);
}

.cw-shell-edit-entry:hover {
  color: var(--cw-primary);
  border-color: var(--cw-primary);
  background: var(--cw-primary-light);
  box-shadow: var(--cw-shadow-md);
}

.cw-shell-edit-entry:hover svg {
  color: var(--cw-primary);
}

.cw-shell-editing .cw-shell-edit-entry {
  display: none;
}

.cw-shell-panel {
  width: 380px;
  margin-right: -380px;
  background: var(--cw-bg-teacher);
  border-left: var(--cw-stroke-width) solid var(--cw-border-medium);
  transition: var(--cw-transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cw-shell-editing .cw-shell-panel {
  margin-right: 0;
}

.cw-shell-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 20px;
  background: var(--cw-bg-surface);
  border-bottom: var(--cw-stroke-width) solid var(--cw-border-medium);
  font-size: var(--cw-font-size-lg);
  font-weight: 800;
}

.cw-shell-panel-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.cw-shell-panel-foot {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px;
  background: var(--cw-bg-surface);
  border-top: var(--cw-stroke-width) solid var(--cw-border-medium);
}

.cw-panel-done-btn {
  height: 48px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 24px;
}

.cw-shell-panel-body section {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: var(--cw-stroke-width) solid var(--cw-border-light);
}

.cw-shell-panel-body section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.cw-shell-panel-body h2 {
  margin-bottom: 12px;
  font-size: var(--cw-font-size-lg);
}

.cw-shell-panel-body p {
  color: var(--cw-text-secondary);
  font-size: var(--cw-font-size-sm);
}

.cw-shell-panel-body .cw-form-label {
  margin-top: 14px;
  margin-bottom: 8px;
  display: block;
}

.cw-shell-panel-body section > .cw-form-label:first-of-type {
  margin-top: 0;
}

.cw-shell-panel-body input[type="text"],
.cw-shell-panel-body input[type="number"],
.cw-shell-panel-body textarea,
.cw-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  color: var(--cw-text-primary);
  background: var(--cw-bg-surface);
  border: var(--cw-stroke-width) solid var(--cw-border-strong);
  border-radius: var(--cw-radius-md);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  user-select: text;
  outline: none;
  transition: var(--cw-transition);
}

.cw-shell-panel-body textarea {
  min-height: 104px;
  padding: 12px 14px;
  resize: vertical;
}

.cw-shell-panel-body input[type="text"]:focus,
.cw-shell-panel-body input[type="number"]:focus,
.cw-shell-panel-body textarea:focus,
.cw-input:focus {
  border-color: var(--cw-primary);
  box-shadow: 0 0 0 3px rgba(24, 101, 242, 0.15);
}

.cw-shell-panel-body input::placeholder,
.cw-shell-panel-body textarea::placeholder,
.cw-input::placeholder {
  color: var(--cw-text-muted);
  font-weight: 400;
}

.cw-shell-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.cw-shell-actions .cw-btn {
  flex: 1;
  padding: 0 12px;
}

.cw-shell-toast {
  position: absolute;
  top: 76px;
  left: 50%;
  z-index: 50;
  padding: 10px 20px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--cw-radius-md);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cw-shell-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.stage-fullscreen .cw-shell-toast {
  top: 88px;
  font-size: 17px;
  padding: 12px 24px;
}

@media (max-width: 760px) {
  .cw-shell-prompt {
    top: 16px;
    left: 76px;
    right: 12px;
    width: auto;
    max-width: none;
    transform: none;
    font-size: var(--cw-font-size-lg);
  }

  .cw-shell-tools-right {
    top: auto;
    right: 16px;
    bottom: 16px;
  }

  .cw-shell-tools-bottom {
    bottom: 78px;
  }

  .cw-shell-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    max-width: calc(100vw - 36px);
  }
}

/* ==========================================================================
   全屏模式下整体视觉放大标准 (Fullscreen Display Enhancement)
   ========================================================================== */
.stage-fullscreen .cw-header {
  height: 76px;
  padding: 0 28px;
}

.stage-fullscreen .cw-header-title {
  font-size: 24px;
}

.stage-fullscreen .cw-header-badge {
  font-size: 14px;
  padding: 4px 12px;
}

.stage-fullscreen .cw-shell-prompt {
  top: 80px;
  font-size: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.stage-fullscreen .cw-shell-question-rail button {
  min-width: 48px;
  height: 46px;
  font-size: 18px;
  border-radius: var(--cw-radius-md);
}

.stage-fullscreen .cw-shell-question-rail button .cw-rail-num {
  font-size: 19px;
}

.stage-fullscreen .cw-shell-question-rail button .cw-rail-title {
  font-size: 15px;
  max-width: 170px;
}

.stage-fullscreen .cw-shell-tools button {
  min-height: 58px;
  min-width: 58px;
  font-size: 19px;
  padding: 0 22px;
}

.stage-fullscreen .cw-shell-tools-bottom {
  bottom: 24px;
}

/* ==========================================================================
   课堂画笔批注图层 (Classroom Annotation Layer)
   ========================================================================== */
.cw-annotation-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 300;
  pointer-events: auto;
}

.cw-annotation-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.cw-annotation-bar {
  position: absolute;
  top: 14px;
  right: 24px;
  z-index: 310;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--cw-bg-surface);
  border: var(--cw-stroke-width) solid var(--cw-border-medium);
  border-radius: 40px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stage-fullscreen .cw-annotation-bar {
  top: 68px;
  right: 24px;
  left: auto;
  transform: none;
  padding: 4px 8px;
}

[data-theme="high-contrast"] .cw-annotation-bar {
  background: #ffffff;
  border-color: #000000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.cw-pen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid transparent;
  border-radius: 20px;
  background: transparent;
  color: var(--cw-text-secondary);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--cw-transition);
}

.cw-pen-btn span:first-child:not(:last-child) {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cw-pen-btn:hover {
  background: var(--cw-bg-main);
  color: var(--cw-text-primary);
}

.cw-pen-btn.is-active {
  border-color: var(--cw-primary);
  background: var(--cw-primary-light);
  color: var(--cw-primary);
}

.cw-pen-close-btn {
  color: var(--cw-danger);
}

.cw-pen-close-btn:hover {
  background: var(--cw-danger-bg);
  color: var(--cw-danger);
}

/* ==========================================================================
   课件广场卡片纯净预览模式 (Pure Stage Preview Mode for Courseware Plaza)
   ========================================================================== */
html.cw-preview-mode,
html.cw-preview-mode body {
  overflow: hidden !important;
  background: radial-gradient(circle at 50% 45%, #ffffff 0%, #f1f5f9 100%) !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cw-preview-mode .cw-app-container,
.cw-preview-mode .cw-shell {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  background: transparent !important;
}

.cw-preview-mode .cw-header,
.cw-preview-mode .cw-shell-question-rail,
.cw-preview-mode .cw-shell-prompt,
.cw-preview-mode .cw-shell-tools-bottom,
.cw-preview-mode .cw-shell-tools-right,
.cw-preview-mode .cw-shell-edit-entry,
.cw-preview-mode .cw-annotation-layer,
.cw-preview-mode .cw-fullscreen-floating-bar,
.cw-preview-mode .cw-teacher-panel,
.cw-preview-mode .fc-ctrl-group,
.cw-preview-mode .fc-control-bar,
.cw-preview-mode .fc-player-status,
.cw-preview-mode .fc-deconstruct-gallery,
.cw-preview-mode .fc-formula-pill,
.cw-preview-mode .fc-breakdown-container,
.cw-preview-mode .fc-subdivision-bar,
.cw-preview-mode .fc-progress-hint,
.cw-preview-mode .fc-progress-tip,
.cw-preview-mode .fc-breakdown-subpills,
.cw-preview-mode .fc-step-progress,
.cw-preview-mode .cube-ground-label,
.cw-preview-mode .cube-toolbar-panel,
.cw-preview-mode .cube-orientation-gizmo,
.cw-preview-mode .cube-model-toolbar {
  display: none !important;
}

.cw-preview-mode .cw-main-body,
.cw-preview-mode .cw-stage-area {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.cw-preview-mode .cw-shell-stage {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 平面图形计数在预览模式下的微调 */
.cw-preview-mode .figure-counter-stage {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.cw-preview-mode .fc-main-layout {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
}

.cw-preview-mode .fc-primary-canvas-card {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}

.cw-preview-mode .fc-primary-svg {
  max-height: 400px !important;
  max-width: 92% !important;
  transform: scale(1.06);
  transform-origin: center center;
}

/* 观察物体 3D 舞台在预览模式下的微调（消除顶部裁切，优雅居中） */
.cw-preview-mode .cube-builder-stage {
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

.cw-preview-mode .cube-multi-grid {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

.cw-preview-mode .cube-model-card {
  transform: scale(0.82) translateY(24px);
  transform-origin: center center;
}



