/* ============================================================
   view-courseware.css · 课件制作
   ============================================================ */

/* ---------------- 无 item 时的极简引导页 ----------------
   课件在对话里生成，这里只解释去哪做，不放课件卡与主题母版 */
.cw-guide { padding-top: 68px; }
.cw-guide .empty__art { background: #fff5e9; color: #bd7008; }

/* ---------------- 编辑器骨架：三栏 ---------------- */
.cw-editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.cw-editor__body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr);
}
.cw-editor__body > * { min-height: 0; }

/* ---- 左栏：缩略图 / 大纲 ---- */
.cw-rail {
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column;
  min-height: 0;
}
.cw-rail__head { flex: none; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cw-rail__scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px; }

.cw-thumb {
  position: relative;
  padding: 6px; margin-bottom: 8px;
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.cw-thumb:hover { background: var(--surface-3); }
.cw-thumb.is-active { background: var(--brand-50); border-color: var(--brand-200); }
.cw-thumb__mini {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong); border-radius: var(--r-xs);
  background: var(--surface); overflow: hidden;
}
.cw-thumb.is-active .cw-thumb__mini { border-color: var(--brand-400); }
.cw-thumb__cap {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; font-size: 12px; color: var(--text-3);
}
.cw-thumb__no {
  width: 17px; height: 15px; flex: none; border-radius: var(--r-xs);
  background: var(--surface-3); color: var(--text-3);
  font-size: 10px; font-weight: 600; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.cw-thumb.is-active .cw-thumb__no { background: var(--brand-600); color: #fff; }
.cw-thumb__acts {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 1px; padding: 2px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--sh-2);
  opacity: 0; transition: opacity .15s var(--ease);
}
.cw-thumb:hover .cw-thumb__acts { opacity: 1; }
.cw-thumb__acts .icon-btn { width: 24px; height: 24px; }

/* 迷你页内容（固定 px，保证小尺寸下可读） */
.cw-mini { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 7px 8px; background: var(--surface); }
.cw-mini__band { height: 3px; border-radius: 2px; background: var(--dk-1); width: 42%; }
.cw-mini__title { margin-top: 5px; font-size: 10px; font-weight: 700; color: var(--dk-1); line-height: 1.3; overflow: hidden; }
.cw-mini__line { height: 3px; border-radius: 2px; background: var(--line-strong); margin-top: 3.5px; }
.cw-mini__line--short { width: 62%; }
.cw-mini__cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(112deg, var(--dk-3), #fff); }
.cw-mini__cover b { font-size: 10px; color: var(--dk-1); letter-spacing: -.01em; }
.cw-mini__cover span { font-size: 10px; color: var(--text-4); margin-top: 3px; }
.cw-mini__cover::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--dk-1); }
.cw-mini__bars { display: flex; align-items: flex-end; gap: 4px; height: 26px; margin-top: 8px; }
.cw-mini__bars i { flex: 1; border-radius: 2px 2px 0 0; background: var(--dk-2); display: block; }
.cw-mini__formula { margin-top: 10px; height: 12px; border-radius: 3px; background: var(--dk-3); border: 1px solid var(--dk-2); }
.cw-mini__bullets { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.cw-mini__bullets span { display: flex; align-items: center; gap: 4px; }
.cw-mini__bullets span i { width: 5px; height: 5px; border-radius: 50%; background: var(--dk-2); flex: none; }
.cw-mini__bullets span u { height: 3px; border-radius: 2px; background: var(--line-strong); flex: 1; text-decoration: none; }
.cw-mini__sec { position: absolute; inset: 0; display: flex; align-items: center; gap: 7px; padding: 0 12px; }
.cw-mini__sec b { font-size: 13px; color: var(--dk-3); font-weight: 700; }
.cw-mini__sec span { font-size: 10px; font-weight: 600; color: var(--dk-1); }

/* 大纲视图 */
.cw-oline { display: flex; flex-direction: column; gap: 2px; }
.cw-oline__item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 9px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .14s var(--ease);
}
.cw-oline__item:hover { background: var(--surface-3); }
.cw-oline__item.is-active { background: var(--brand-50); }
.cw-oline__mark {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-dark); margin-top: 1px;
  display: grid; place-items: center; font-size: 10px; color: #fff;
}
.cw-oline__item.is-done .cw-oline__mark { background: var(--success); border-color: var(--success); }
.cw-oline__title { font-size: 13px; color: var(--text); line-height: 1.5; }
.cw-oline__sub { font-size: var(--fs-12); color: var(--text-4); margin-top: 1px; }

/* ---- 中栏：画布 ---- */
.cw-stage { display: flex; flex-direction: column; min-height: 0; background: var(--bg-alt); }
.cw-tools { flex: none; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; padding: 6px 12px; gap: 6px; flex-wrap: wrap; }
.cw-sel { width: 104px; flex: none; }
.cw-sel--wide { width: 118px; }
.cw-sel .select { min-height: 26px; height: 26px; font-size: 12px; padding: 2px 24px 2px 8px; border-radius: var(--r-sm); }
.cw-sw {
  width: 24px; height: 24px; border-radius: var(--r-xs);
  border: 1px solid var(--line-strong); flex: none;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.cw-sw:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.cw-sw.is-active { box-shadow: var(--ring); border-color: var(--brand-500); }
.cw-tools__label { font-size: 12px; color: var(--text-4); padding: 0 2px; }

/* vbar 的「⋯」更多导出菜单 */
.cw-more { position: relative; flex: none; }
.cw-more__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 168px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-3);
  display: flex; flex-direction: column; gap: 2px;
}
.cw-more__menu[hidden] { display: none; }
.cw-more__item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: var(--r-sm);
  font-size: var(--fs-13); color: var(--text-2); text-align: left;
  transition: background .14s var(--ease);
}
.cw-more__item:hover { background: var(--surface-3); color: var(--text); }

/* 窄屏 / 右面板打开时：vbar 换行，操作不再被裁掉 */
.cw-editor .vbar { flex-wrap: wrap; overflow-x: visible; height: auto; row-gap: 7px; }

/* 「该版式无需填写正文」提示 */
.cw-props__note {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 9px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px dashed var(--line-dark);
  font-size: var(--fs-12); line-height: 1.6; color: var(--text-3);
}
.cw-props__note svg { flex: none; margin-top: 2px; color: var(--text-4); }

.cw-stage__area {
  flex: 1; min-height: 0; overflow: auto;
  padding: 20px 22px 24px;
  display: flex; align-items: flex-start;
}
.cw-stage__wrap {
  width: 100%; min-width: 520px; max-width: 940px; margin: 0 auto;
  container-type: inline-size;
  --cw-scale: 1;
}

/* ---- 幻灯片画布（16:9） ---- */
.cw-canvas {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-3);
  overflow: hidden;
  --dk-1: var(--brand-700); --dk-2: var(--brand-500); --dk-3: var(--brand-100);
  font-size: 15px;
  font-size: calc(clamp(9px, 1.52cqw, 21px) * var(--cw-scale, 1));
  color: var(--text);
}
.cw-slide { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 1.9em 2.4em 1.6em; }
.cw-slide__title { font-size: 1.72em; font-weight: 600; letter-spacing: -.015em; color: var(--dk-1); line-height: 1.35; }
.cw-slide__sub { font-size: .9em; color: var(--text-3); margin-top: .35em; }
.cw-slide__body { flex: 1; min-height: 0; margin-top: 1.1em; }
.cw-slide__pg {
  position: absolute; right: 2.4em; bottom: .9em;
  font-size: .72em; color: var(--text-4); font-variant-numeric: tabular-nums;
}
.cw-slide__foot {
  position: absolute; left: 2.4em; right: 2.4em; bottom: 1em;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .7em; color: var(--text-4);
  border-top: 1px solid var(--line); padding-top: .7em;
}
.cw-canvas.is-bold .cw-slide__title { font-weight: 700; }

/* 封面 */
.cw-cover { background: linear-gradient(112deg, var(--dk-3) 0%, #fff 52%, #fff 100%); }
.cw-cover__rule { position: absolute; left: 0; top: 0; bottom: 0; width: 0.6em; background: var(--dk-1); }
.cw-cover__badge {
  align-self: flex-start;
  padding: .2em .75em; border-radius: .4em;
  background: var(--dk-1); color: #fff;
  font-size: .78em; font-weight: 600; letter-spacing: .05em;
}
.cw-cover__title { font-size: 2.5em; font-weight: 700; color: var(--dk-1); letter-spacing: -.02em; line-height: 1.28; margin-top: .42em; }
.cw-cover__sub { font-size: .95em; color: var(--text-2); margin-top: .6em; }
.cw-cover__meta { margin-top: auto; display: flex; gap: 1.6em; font-size: .78em; color: var(--text-4); }

/* 目录 */
.cw-toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8em 1.6em; align-content: start; }
.cw-toc__item { display: flex; align-items: center; gap: .7em; padding: .5em .7em; border-radius: .45em; background: var(--surface-2); border: 1px solid var(--line); }
.cw-toc__n {
  width: 1.75em; height: 1.75em; flex: none; border-radius: .35em;
  background: var(--dk-1); color: #fff;
  display: grid; place-items: center; font-size: .82em; font-weight: 700;
}
.cw-toc__t { font-size: .95em; color: var(--text); font-weight: 600; }

/* 章节页 */
.cw-chap { display: flex; align-items: center; gap: 1.4em; }
.cw-chap__num { font-size: 4.2em; font-weight: 700; color: var(--dk-3); line-height: 1; letter-spacing: -.04em; }
.cw-chap__rule { width: .22em; align-self: stretch; background: var(--dk-2); border-radius: .2em; }
.cw-chap__title { font-size: 1.7em; font-weight: 700; color: var(--dk-1); }
.cw-chap__sub { font-size: .92em; color: var(--text-3); margin-top: .45em; }

/* 图文 / 流程 */
.cw-flow { display: flex; align-items: stretch; gap: .5em; margin-bottom: 1.1em; }
.cw-flow__box {
  flex: 1; min-width: 0;
  padding: .7em .5em; border-radius: .45em;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  text-align: center; font-size: .86em; color: var(--text-2); font-weight: 600;
}
.cw-flow__box--key { background: var(--dk-3); border-color: var(--dk-2); color: var(--dk-1); font-weight: 600; }
.cw-flow__arrow { align-self: center; color: var(--line-dark); font-size: 1em; }
.cw-fig {
  margin-top: .6em; display: flex; align-items: center; gap: 1em;
  padding: 1em; border-radius: .5em;
  background: var(--surface-2); border: 1px dashed var(--line-dark);
}
.cw-fig__art { flex: none; }
.cw-fig__text { font-size: .92em; line-height: 1.6; color: var(--text-2); }

/* 要点 */
.cw-list { display: flex; flex-direction: column; gap: .62em; }
.cw-list__item {
  display: flex; align-items: flex-start; gap: .7em;
  padding: .62em .8em; border-radius: .5em;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .98em; color: var(--text); line-height: 1.5;
}
.cw-list__n {
  width: 1.7em; height: 1.7em; flex: none; border-radius: 50%;
  background: var(--dk-3); color: var(--dk-1);
  display: grid; place-items: center; font-size: .78em; font-weight: 700;
  border: 1px solid var(--dk-2);
}

/* 图表 */
.cw-chart { display: flex; align-items: flex-end; gap: 1.4em; height: 100%; padding: .4em 1em 0; }
.cw-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .5em; }
.cw-chart__bar {
  width: 100%; max-width: 4.6em; border-radius: .35em .35em .12em .12em;
  background: linear-gradient(180deg, var(--dk-2), var(--dk-1));
  animation: barGrow .7s var(--ease-out) both;
  transform-origin: bottom;
}
.cw-chart__col:nth-child(2) .cw-chart__bar { background: linear-gradient(180deg, var(--dk-3), var(--dk-2)); }
.cw-chart__val { font-size: .78em; font-weight: 600; color: var(--dk-1); font-variant-numeric: tabular-nums; }
.cw-chart__label { font-size: .78em; color: var(--text-3); white-space: nowrap; }

/* 公式 */
.cw-formula {
  margin: .4em 0 1em; padding: 1.1em 1em;
  text-align: center; border-radius: .5em;
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 1.28em; font-weight: 600;
  color: var(--dk-1); letter-spacing: .01em;
}
.cw-note { font-size: .85em; color: var(--text-3); display: flex; align-items: center; gap: .45em; }

/* 小结 */
.cw-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8em; margin-top: 1.1em; }
.cw-sum__card { padding: .75em .85em; border-radius: .5em; background: var(--dk-3); border: 1px solid var(--dk-2); }
.cw-sum__t { font-size: .85em; font-weight: 700; color: var(--dk-1); }
.cw-sum__d { font-size: .8em; color: var(--text-2); margin-top: .3em; line-height: 1.5; }

/* ---- 中栏底部状态栏 ---- */
.cw-status {
  flex: none; height: 34px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-3);
}
.cw-status b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- 右栏：属性面板 ---- */
.cw-props {
  border-left: 1px solid var(--line);
  background: var(--surface);
  overflow: auto; min-height: 0;
  padding: 14px;
}
.cw-props__sec { margin-bottom: 16px; }
.cw-props__sec:last-child { margin-bottom: 0; }
.cw-layouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cw-layout {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12px; color: var(--text-2); text-align: left;
  transition: all .14s var(--ease);
}
.cw-layout:hover { border-color: var(--brand-300); color: var(--brand-700); }
.cw-layout.is-active { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-700); font-weight: 600; box-shadow: var(--ring); }

.cw-themes { display: flex; flex-direction: column; gap: 7px; }
.cw-theme {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
  text-align: left; transition: all .15s var(--ease);
}
.cw-theme:hover { border-color: var(--brand-300); }
.cw-theme.is-active { border-color: var(--brand-400); background: var(--brand-50); box-shadow: var(--ring); }
.cw-theme__sw { display: flex; gap: 3px; flex: none; }
.cw-theme__sw i { width: 15px; height: 15px; border-radius: var(--r-xs); display: block; }
.cw-theme__name { font-size: 12px; font-weight: 600; }
.cw-anims { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.is-on { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); font-weight: 600; }

/* ---------------- 演示预览 ---------------- */
.cw-present { container-type: inline-size; }
.cw-present .cw-canvas { box-shadow: none; border-color: var(--line-strong); }
.cw-present__bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: var(--fs-12); color: var(--text-3); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1440px) {
  .cw-editor__body { grid-template-columns: 216px minmax(0, 1fr) 272px; }
}
@media (max-width: 1180px) {
  .cw-editor__body { grid-template-columns: 196px minmax(0, 1fr) 250px; }
}
