/* 一键成课向导（assets/features/lesson-gen）。只用设计令牌；薄荷色只给每步一个主按钮与焦点环；1px 细线、4/8 栅格。 */
.lg-overlay { z-index: var(--layer-stack-94); }
.lg-panel {
  width: min(880px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden;
}
.lg-head { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--line); }
.lg-title { margin: 0; font: 600 var(--text-lg)/1.2 var(--font-ui); letter-spacing: -.01em; color: var(--ink); outline: none; }
.lg-steps { display: flex; gap: 6px; margin-right: auto; }
.lg-steps i { width: 20px; height: 3px; border-radius: 2px; background: var(--line); transition: background-color var(--motion-fast) var(--ease-out); }
.lg-steps i.is-on { background: var(--ink); }
.lg-close { min-height: 32px; padding: 0 var(--space-2); }
.lg-body { overflow: auto; padding: var(--space-6); display: grid; gap: var(--space-4); align-content: start; overscroll-behavior: contain; }
.lg-status { margin: 0; padding: 0 var(--space-6); min-height: 20px; font-size: var(--text-sm); color: var(--muted); }
.lg-status[data-kind="error"] { color: var(--danger, #b42318); }
.lg-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--line); }
.lg-foot-note { margin-right: auto; color: var(--muted); font-size: var(--text-sm); }
.lg-foot > .ui-btn--ghost:first-child { margin-right: auto; }

.lg-pane { display: grid; gap: var(--space-2); }
.lg-text, .lg-narration, .lg-point-title, .lg-lesson-title, .lg-revise-input {
  width: 100%; box-sizing: border-box; font: 400 var(--text-base)/1.55 var(--font-ui); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3);
  transition: border-color var(--motion-fast) var(--ease-out);
}
.lg-text { min-height: 168px; resize: vertical; }
.lg-text:focus, .lg-narration:focus, .lg-point-title:focus, .lg-lesson-title:focus, .lg-revise-input:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: transparent; }
.lg-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.lg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.lg-label { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.lg-label > span:first-child { min-width: 40px; color: var(--muted); font-size: var(--text-sm); }
.lg-check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--ink); cursor: pointer; }
.lg-check input { width: 16px; height: 16px; accent-color: var(--ink); }
.lg-hint { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.lg-muted { color: var(--muted); font-size: var(--text-sm); }
.lg-thumbs { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.lg-thumb { position: relative; margin: 0; width: 88px; height: 112px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.lg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lg-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgb(24 24 27 / .6); color: #fff; cursor: pointer; font-size: 12px; }

.lg-meta { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.lg-lesson-title { flex: 1 1 280px; font-weight: 600; font-size: var(--text-md); }
.lg-lesson-name { font: 600 var(--text-md)/1.3 var(--font-ui); }
.lg-outline { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.lg-point { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); background: var(--surface); }
.lg-point-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.lg-point-title { border-color: transparent; padding: var(--space-1) var(--space-2); font-weight: 500; }
.lg-point-title:hover { border-color: var(--line); }
.lg-point-main small { padding: 0 var(--space-2); color: var(--muted); font-size: var(--text-xs, 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-num { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font: 500 12px/1 var(--font-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-tag { flex: none; padding: 2px 6px; border-radius: var(--radius-tag); border: 1px solid var(--line); font: 500 11px/1.2 var(--font-ui); color: var(--muted); }
.lg-icon { flex: none; width: 28px; height: 28px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; transition: background-color var(--motion-fast), transform var(--motion-press) var(--ease-out); }
.lg-icon:hover:not(:disabled) { background: var(--surface-hover); color: var(--ink); }
.lg-icon:active:not(:disabled) { transform: scale(.92); }
.lg-icon:disabled { opacity: .3; cursor: default; }
.lg-icon:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.lg-add { justify-self: start; }

.lg-media { display: grid; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); }
.lg-revise { display: flex; gap: var(--space-2); }
.lg-revise .ui-btn { flex: 0 0 auto; white-space: nowrap; }
.lg-panel .ui-segmented { flex-wrap: wrap; }
.lg-panel .ui-segmented button { flex: 0 0 auto; white-space: nowrap; }
.lg-scenes { display: grid; gap: var(--space-2); }
.lg-scene { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); transition: border-color var(--motion-panel) var(--ease-out), box-shadow var(--motion-panel) var(--ease-out); }
.lg-scene > header { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.lg-scene > header b { font: 600 var(--text-sm)/1.3 var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-scene > header .lg-muted { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-scene.is-changed { border-color: var(--selection-border); box-shadow: 0 0 0 1px var(--selection-border) inset; }
.lg-narration { resize: vertical; font-size: var(--text-sm); min-height: 52px; }

@media (max-width: 640px) {
  .lg-panel { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .lg-head, .lg-body, .lg-foot { padding-left: var(--space-4); padding-right: var(--space-4); }
  .lg-status { padding: 0 var(--space-4); }
  .lg-grid { grid-template-columns: 1fr; }
  .lg-foot-note { display: none; }
  .lg-foot { flex-wrap: wrap; }
  .lg-scene > header .lg-muted { display: none; }
}
@media (prefers-reduced-motion: reduce) { .lg-steps i, .lg-scene, .lg-icon { transition: none; } }
.lg-facts { font-size: var(--text-sm); }
.lg-facts summary { cursor: pointer; color: var(--muted); list-style: none; }
.lg-facts summary::-webkit-details-marker { display: none; }
.lg-facts summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }
.lg-facts ul { margin: var(--space-2) 0 0; padding: 0; list-style: none; display: grid; gap: var(--space-1); }
.lg-facts li { line-height: 1.5; }
.lg-facts small { color: var(--muted); }
.lg-badge { display: inline-block; padding: 0 6px; border-radius: var(--radius-tag); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.lg-facts li[data-status="unverified"] .lg-badge, .lg-warn { color: var(--warning, #b45309); border-color: currentColor; }
.lg-ok { color: var(--muted); }

/* ---------- 不白屏：流式生成的实时卡片墙（live.js）。动效只用 transform / opacity，缓动 ease-out-quart 系（tokens 草案 easeOutStandard） ---------- */
.lg-live-wrap { display: grid; gap: var(--space-3); }
.lg-live-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.lg-live-title { font: 600 var(--text-md)/1.4 var(--font-ui); color: var(--ink); letter-spacing: -.005em; }
.lg-live-count { font-size: var(--text-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-live-progress { height: 3px; border-radius: var(--radius-tag); background: var(--line); overflow: hidden; }
.lg-live-progress > i { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(.04); transition: transform 400ms cubic-bezier(.16, 1, .3, 1); }
.lg-live-wrap[data-live="done"] .lg-live-progress > i { background: var(--state-active-fg, var(--ink)); }
.lg-live { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: var(--space-3); }
.lg-live-card { display: grid; gap: var(--space-2); align-content: start; min-height: 132px; padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card, 12px);
  box-shadow: 0 0 0 1px rgb(24 24 27 / .02), 0 1px 2px rgb(24 24 27 / .04), 0 4px 12px rgb(24 24 27 / .04);
  animation: lg-live-in 260ms cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
.lg-live-card > header { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.lg-live-card .lg-live-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); color: var(--ink); }
.lg-live-card.is-pending .lg-tag { opacity: .55; }
.lg-live-card.is-in .lg-live-body { animation: lg-live-in 260ms cubic-bezier(.16, 1, .3, 1) both; }
.lg-live-body { display: grid; gap: var(--space-1); }
.lg-skel-line.is-short { width: 58%; }
.lg-live-text { margin: 0; font-size: var(--text-sm); line-height: 1.5; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lg-live-surface { margin-top: auto; }
.lg-live-chip { display: inline-block; padding: 2px var(--space-2); font-size: 12px; line-height: 16px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-tag); animation: lg-live-in 180ms cubic-bezier(.16, 1, .3, 1) both; }
.lg-live-note { display: flex; align-items: center; gap: var(--space-3); margin: 0; font-size: var(--text-sm); color: var(--danger, #b42318); }
.lg-retry-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-card, 12px); }
@keyframes lg-live-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lg-live-card, .lg-live-card.is-in .lg-live-body, .lg-live-chip { animation: none; } .lg-live-progress > i { transition: none; } }
@media (max-width: 640px) { .lg-live { grid-template-columns: 1fr; } .lg-live-card { min-height: 0; } }

/* 一键成课流水线、教材与逐幕编辑沿用同一面板；长标题与原始正文在窄屏内换行。 */
#lessonPipelineDialog .lg-body { display: grid; gap: var(--space-3); }
#lessonPipelineDialog .lg-label { min-width: 0; align-items: stretch; }
#lessonPipelineDialog input:not([type="checkbox"]), #lessonPipelineDialog select, #lessonPipelineDialog textarea { max-width: 100%; min-width: 0; }
#lessonPipelineDialog .lg-narration, #lessonPipelineDialog .lg-text { width: 100%; box-sizing: border-box; }
#lessonPipelineDialog .lg-foot { gap: var(--space-2); }
.lp-textbook { display: grid; gap: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-4); }
.lp-textbook h3, .lp-next { margin: 0; }
.lp-next { font-size: var(--text-sm); color: var(--ink); }
.lp-visual-list { padding-left: 1.3em; font-size: var(--text-sm); overflow-wrap: anywhere; }
#lessonPipelineDialog .lg-row { flex-wrap: wrap; }
#lessonPipelineDialog .lg-surface-row { flex-wrap: wrap; }

/* 三槽流式（assets/features/lesson-stream/slots.js）：思考面板 / 口播剧本 / 3D 课件进度与资源预热 */
.ls-slots { display: grid; gap: var(--space-3); margin: var(--space-3) 0; }
.ls-script h4, .ls-tool header b { margin: 0 0 var(--space-2); font: 600 var(--text-sm)/1.4 var(--font-ui); color: var(--ink); }
.ls-tool { display: grid; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.ls-tool header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.ls-tool-count, .ls-vfs-status { color: var(--muted); font: 400 var(--text-xs)/1.4 var(--font-ui); }
.ls-assets { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font: 400 var(--text-sm)/1.5 var(--font-ui); }
.ls-assets li { display: flex; justify-content: space-between; gap: var(--space-2); }
.ls-assets li[data-state="loading"] .ls-asset-state { color: var(--muted); }
.ls-assets li[data-state="ready"] .ls-asset-state { color: var(--ink); font-weight: 600; }
.ls-asset-name { overflow-wrap: anywhere; }
.ls-vfs-wrap { display: grid; gap: var(--space-1); }
.ls-vfs { height: 240px; border-radius: var(--radius-sm); overflow: hidden; background: #10161c; }
.ls-vfs-frame { width: 100%; height: 100%; border: 0; display: block; }
.ls-ws-badge { position: absolute; right: 12px; bottom: 12px; z-index: var(--layer-stack-36, 36); padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); font: 500 var(--text-sm)/1.4 var(--font-ui); box-shadow: 0 4px 16px #0002; pointer-events: none; }

/* 成课卡：仅在本模块作用域映射浅色页 tokens，不改共享令牌。 */
html body .lg-overlay {
 --surface:var(--p-card,#fff);--surface-soft:var(--p-soft,#F0EEE6);--surface-hover:var(--p-soft,#F0EEE6);
 --ink:var(--p-ink,#1F1E1D);--muted:var(--p-muted,#6B6A65);--line:var(--p-line,rgb(31 30 29/.12));--danger:var(--p-danger,#C2410C);--focus-ring:var(--p-ink,#1F1E1D);
 position:fixed;inset:0;display:flex;justify-content:flex-end;align-items:stretch;padding:16px;background:transparent;pointer-events:none;backdrop-filter:none;
}
html body .lg-overlay[hidden],html body .lg-overlay [hidden]{display:none!important}
html body .lg-overlay .lg-panel {
 pointer-events:auto;width:380px;max-width:100%;height:calc(100dvh - 32px);max-height:calc(100dvh - 32px);margin:0;
 grid-template-rows:auto minmax(0,1fr) auto auto;border:1px solid var(--line);border-radius:24px;background:var(--p-bg,#FAF9F5);color:var(--ink);
 box-shadow:0 1px 2px rgb(0 0 0/.06);font:400 15px/1.5 system-ui,-apple-system,sans-serif;transform:none;
}
html body .lg-panel *{box-sizing:border-box}
html body .lg-panel :is(h2,h3){font-family:"Songti SC","Noto Serif SC",Georgia,serif;font-weight:400;color:var(--ink)}
html body .lg-panel h2{font-size:26px;margin:0 auto 0 0}
html body .lg-panel .lg-head{padding:18px 20px;gap:8px}
html body .lg-panel .lg-body{padding:20px;gap:18px}
html body .lg-panel .lg-foot{padding:16px 20px;display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px}
html body .lg-panel .lg-foot-note{display:block;width:100%;margin:0;font-size:13px}
html body .lg-panel :is(.ui-btn,.lg-icon,.ui-segmented button){min-height:48px;border:1px solid var(--line);border-radius:999px;padding:8px 14px;background:var(--surface);color:var(--ink);font:inherit;box-shadow:none;cursor:pointer}
html body .lg-panel .ui-btn--accent{background:var(--p-solid,#1F1E1D);color:#fff;border-color:transparent}
html body .lg-panel :is(.ui-btn,.lg-icon):disabled{opacity:.45;cursor:default}
html body .lg-panel :is(input:not([type=checkbox]),select){min-height:52px;width:100%;border-radius:999px;padding:12px 16px;border:1px solid var(--line);background:var(--surface);color:var(--ink);font:inherit;min-width:0}
html body .lg-panel textarea{border-radius:16px;border:1px solid var(--line);background:var(--surface);color:var(--ink);padding:14px;font:inherit;resize:vertical}
html body .lg-panel .lg-text{min-height:170px;width:100%}
html body .lg-panel .lg-label{display:grid;gap:6px;min-width:0}
html body .lg-panel :is(.lg-hint,.lg-muted,.lg-status,.lg-label>span){font-size:13px;color:var(--muted)}
html body .lg-panel .lg-status[data-kind=error],html body .lg-panel .lg-live-note{color:var(--danger)}
html body .lg-panel .lg-status:empty{display:none}
html body .lg-panel .lg-sources{display:flex;flex-wrap:nowrap;gap:4px;padding:4px;border-radius:999px;background:var(--surface-soft);border:0}
html body .lg-panel .lg-sources button{flex:1;min-width:0;padding:8px 4px;border:0;background:transparent;font-size:13px}
html body .lg-panel .lg-sources [aria-pressed=true]{background:var(--surface);box-shadow:0 1px 2px rgb(0 0 0/.06)}
/* B-37: outline cards — dedicated actions column + readable gaps (no overlap with title/narration) */
html body .lg-panel .lg-outline-editor{display:grid;gap:14px}
html body .lg-panel .lg-outline{background:transparent;border:0;gap:16px;overflow:visible}
html body .lg-panel .lg-point{display:grid;grid-template-columns:18px 22px minmax(0,1fr) auto;align-items:start;padding:14px;gap:10px 8px;border:1px solid var(--line);border-radius:16px}
html body .lg-panel .lg-point-main{gap:8px;min-width:0}
html body .lg-panel .lg-point-actions{grid-column:4;grid-row:1;display:flex;flex-wrap:wrap;gap:4px;justify-content:flex-end;align-self:start}
html body .lg-panel .lg-icon{width:44px;min-height:44px;padding:4px}
html body .lg-panel .lg-point-title{border-color:transparent;padding:8px;min-height:44px;border-radius:12px;width:100%}
html body .lg-panel .lg-point-main .lg-narration{width:100%;min-height:64px}
html body .lg-panel .lg-drag{cursor:grab;color:var(--muted);padding:12px 0}
html body .lg-panel .lg-scene,html body .lg-panel .lg-live-card{border-radius:16px;box-shadow:0 1px 2px rgb(0 0 0/.06)}
html body .lg-panel .lg-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
html body .lg-panel .lg-progress-steps{list-style:none;padding:0;margin:0;display:grid;gap:0}
html body .lg-panel .lg-progress-steps li{padding:14px 12px;border-bottom:1px solid var(--line);color:var(--muted);font-size:13px}
html body .lg-panel .lg-progress-steps [data-state=done]{color:var(--p-ok,#1E7D45)}
html body .lg-panel .lg-progress-steps [data-state=active]{color:var(--ink);font-weight:600}
html body .lg-panel .lg-progress-steps [data-state=failed]{color:var(--danger)}
html body .lg-panel .lg-progress-loader{min-height:96px;display:grid;place-items:center}
html body .lg-panel .lg-live-progress{width:min(240px,100%)}
html body .lg-panel .lp-textbook{border:0;padding:0}
html body .lg-panel .lp-textbook .lg-row{display:grid}
@media(max-width:640px){html body .lg-overlay{padding:0}html body .lg-overlay .lg-panel{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0;border:0}html body .lg-panel .lg-foot{padding-bottom:max(16px,env(safe-area-inset-bottom))}}
/* The segmented-button selector is more specific than a bare accent class. */
html body .lg-panel .ui-btn.ui-btn--accent,html body .lg-panel .ui-btn.ui-btn--accent:hover{background:var(--p-solid,#1F1E1D);color:#fff;border-color:transparent}
html body .lg-panel :is(input:not([type=checkbox]),select,textarea){font:400 15px/1.5 system-ui,-apple-system,sans-serif}
