.course-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 260px minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  min-height: 58px;
}

.topbar-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.c-main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.c-grid {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.c-col-left {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 74px;
}

.c-col-right {
  min-width: 0;
  display: grid;
  gap: 16px;
  --shot-thumb-ratio: 16 / 9;
}

.step-badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
}

.panel-head h2 {
  display: flex;
  align-items: center;
}

button.block {
  width: 100%;
  margin-top: 4px;
}

.hint-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -2px 0 12px;
  flex-wrap: wrap;
}

.hint-row .tag {
  background: #e1ebff;
  color: #214fb0;
  font-weight: 700;
}

.muted.small,
.small {
  font-size: 12px;
}

.export-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.source-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.source-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}

.source-preview {
  min-height: 88px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.source-panel textarea {
  min-height: 150px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.instructor-preview {
  height: 238px;
  cursor: pointer;
  position: relative;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.instructor-preview:hover {
  border-color: var(--teal);
  background: #eef5f3;
}

.instructor-preview:focus-visible {
  outline: 3px solid rgba(8, 121, 111, 0.2);
  outline-offset: 2px;
}

.instructor-upload-content {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 24px 18px;
  text-align: center;
}

.instructor-upload-content > span {
  display: block;
}

.instructor-upload-plus {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: transparent;
  font-size: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.instructor-upload-plus::before,
.instructor-upload-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #2563eb;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.instructor-upload-plus::before {
  width: 18px;
  height: 2px;
}

.instructor-upload-plus::after {
  width: 2px;
  height: 18px;
}

.instructor-upload-text {
  color: #44525f;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  position: absolute;
  left: 50%;
  top: calc(50% + 46px);
  transform: translateX(-50%);
}

.instructor-upload-hint {
  color: var(--muted);
  font-size: 12px;
  position: absolute;
  left: 50%;
  top: calc(50% + 78px);
  transform: translateX(-50%);
}

.instructor-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111820;
}

.instructor-upload-replace {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(23, 32, 40, 0.74);
  color: #fff;
  font-size: 11px;
  pointer-events: none;
}

/* 批量生图工具条 */
.batch-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.inline-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.inline-field span {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.theme-select {
  position: relative;
  min-width: 0;
}

.theme-select[data-size="md"] {
  width: 240px;
}

.theme-select[data-size="lg"] {
  width: min(100%, 640px);
}

.theme-select[data-size="sm"] {
  width: 96px;
}

.theme-select.is-disabled {
  opacity: 0.6;
}

.theme-select-trigger {
  width: 100%;
  min-height: 40px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow);
}

.theme-select-trigger:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.theme-select-trigger:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.theme-select-trigger:disabled {
  cursor: not-allowed;
  background: #f8fafc;
  color: #94a3b8;
  box-shadow: none;
}

.theme-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.theme-select-caret {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-right: 1.8px solid #64748b;
  border-bottom: 1.8px solid #64748b;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.theme-select.open .theme-select-caret {
  transform: rotate(225deg) translateY(1px);
  border-color: #1d4ed8;
}

.theme-select-menu {
  position: absolute;
  z-index: 30;
  left: 0;
  top: calc(100% + 6px);
  min-width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 4px;
}

.theme-select-menu[hidden] {
  display: none;
}

.theme-select-option {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  box-shadow: none;
}

.theme-select-option:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.theme-select-option[aria-selected="true"] {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.theme-select-option:focus-visible {
  outline: none;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e3e9ee;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--blue);
  transition: width 0.25s ease;
}

/* 分镜列表 */
.storyboard {
  display: grid;
  gap: 18px;
}

.storyboard:empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
}

.storyboard:empty::before {
  content: "填写主题、上传形象照，然后点击“AI 拆解章节”生成分镜";
  padding: 0 20px;
  text-align: center;
}

.chapter-block {
  display: grid;
  gap: 12px;
}

.chapter-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--surface-tint);
}

.chapter-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 760;
  color: var(--ink);
}

.chapter-title .chapter-idx {
  color: var(--teal);
}

.chapter-title .chapter-desc {
  color: var(--muted);
  font-size: 12px;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.shot-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.shot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shot-no {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: #214fb0;
}

.shot-no .dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e1ebff;
  font-size: 12px;
}

.shot-thumb {
  position: relative;
  aspect-ratio: var(--shot-thumb-ratio, 16 / 9);
  border-radius: 8px;
  overflow: hidden;
  background: #0f1720;
  display: grid;
  place-items: center;
}

.shot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot-thumb .placeholder {
  color: #6b7885;
  font-size: 12px;
  text-align: center;
  padding: 6px;
}

.shot-thumb .placeholder.retry,
.shot-video .placeholder.retry {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  width: 100%;
  height: 100%;
  padding: 12px;
  box-sizing: border-box;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.4;
  user-select: none;
}

.shot-thumb .placeholder.retry:hover,
.shot-video .placeholder.retry:hover {
  background: rgba(255, 255, 255, 0.04);
}

.shot-thumb .spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.shot-thumb a.open {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 23, 32, 0.72);
  color: #fff;
  font-size: 11px;
  text-decoration: none;
}

.shot-board {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #102f2a;
  border: 1px solid rgba(15, 118, 110, 0.22);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}

.shot-board img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot-board .placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  background: #f3f7f5;
  text-align: center;
  padding: 8px;
}

.shot-board .placeholder.error {
  color: #b42318;
}

.shot-board .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.shot-board a.open {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 23, 32, 0.72);
  color: #fff;
  font-size: 11px;
  text-decoration: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.shot-field {
  display: grid;
  gap: 4px;
}

.shot-field label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.shot-field textarea {
  min-height: 52px;
  font-size: 13px;
  padding: 7px 8px;
}

.shot-field textarea.prompt {
  min-height: 60px;
  background: var(--surface-soft);
  color: #384553;
}

.shot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shot-actions button {
  min-height: 32px;
  flex: 1;
}

.shot-status {
  font-size: 12px;
  white-space: nowrap;
}

.shot-status.ok {
  color: var(--green);
}

.shot-status.err {
  color: var(--red);
}

.shot-status.run {
  color: var(--amber);
}

@media (max-width: 1080px) {
  .c-grid {
    grid-template-columns: 1fr;
  }

  .c-col-left {
    position: static;
  }

  .course-topbar {
    grid-template-columns: 1fr auto;
  }

  .course-topbar .top-metrics {
    display: none;
  }
}

/* -------------------------------------------------- */
/* Modern SaaS theme overrides for the course workbench */
/* -------------------------------------------------- */
:root {
  --bg: #f8fafc;
  --chrome: #0f172a;
  --chrome-2: #111827;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-tint: #eff6ff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --blue: #2563eb;
  --teal: #4f46e5;
  --amber: #d97706;
  --red: #dc2626;
  --green: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: 0;
}

h2 {
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

button {
  min-height: 38px;
  padding: 0 14px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: none;
}

button.primary:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

button.compact {
  min-height: 32px;
  padding-inline: 12px;
}

button.block {
  min-height: 42px;
  font-weight: 700;
}

textarea::placeholder,
input::placeholder {
  color: #94a3b8;
}

.course-topbar {
  background: var(--chrome);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 60px;
  padding-inline: 20px;
  grid-template-columns: minmax(220px, 300px) minmax(220px, 1fr) auto;
}

.course-topbar .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
}

.course-topbar .brand-copy strong {
  color: #fff;
  font-size: 15px;
}

.course-topbar .brand-copy span {
  color: #94a3b8;
}

.course-topbar .top-metrics {
  justify-content: flex-end;
  gap: 8px;
}

.status-pill,
.metric-pill {
  min-height: 28px;
  padding: 0 10px 0 9px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 12px;
  box-shadow: none;
}

.status-pill::before,
.metric-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #94a3b8;
  display: inline-block;
  flex: 0 0 auto;
}

.status-pill::before {
  background: #2563eb;
}

.metric-pill b {
  color: #0f172a;
}

.course-topbar .topbar-link {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  border-radius: 10px;
}

.course-topbar .topbar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.c-main {
  max-width: 1520px;
  padding: 20px;
}

.c-grid {
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.c-col-left {
  top: 76px;
  gap: 18px;
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel.flat {
  box-shadow: var(--shadow);
}

.panel-head {
  margin-bottom: 14px;
}

.panel-head h2 {
  gap: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.step-badge {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 999px;
  background: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.panel-kicker,
.counter-badge {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #64748b;
}

.counter-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #dbeafe;
}

.counter-badge.error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.field {
  gap: 5px;
  margin-bottom: 12px;
}

.field span,
.check-row span,
.inline-field span {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

input,
textarea,
select {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

textarea {
  line-height: 1.55;
}

.file-field input {
  padding: 8px 10px;
  background: #fff;
}

.control-strip {
  gap: 12px;
  grid-template-columns: minmax(160px, 1fr) minmax(110px, 150px);
}

.video-control-strip {
  grid-template-columns: minmax(0, 1fr);
}

.hint-row {
  gap: 8px;
  margin: 0 0 12px;
}

.hint-row .tag {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  font-weight: 700;
}

.media-preview {
  min-height: 236px;
  margin-bottom: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
}

.instructor-preview:hover {
  border-color: #2563eb;
  background: #f8fafc;
}

.instructor-upload-content {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: center;
}

.instructor-upload-plus {
  width: 50px;
  height: 50px;
  margin: 0;
  border: 1px solid #dbe3ea;
  border-radius: 14px;
  background: #fff;
  color: transparent;
  font-size: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.instructor-upload-plus::before,
.instructor-upload-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #2563eb;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.instructor-upload-plus::before {
  width: 18px;
  height: 2px;
}

.instructor-upload-plus::after {
  width: 2px;
  height: 18px;
}

.instructor-upload-text {
  color: #334155;
  font-size: 16px;
  font-weight: 700;
  position: absolute;
  left: 50%;
  top: calc(50% + 44px);
  transform: translateX(-50%);
}

.instructor-upload-hint {
  color: #64748b;
  font-size: 12px;
  position: absolute;
  left: 50%;
  top: calc(50% + 74px);
  transform: translateX(-50%);
}

.instructor-preview img {
  object-fit: cover;
  background: #e2e8f0;
}

.instructor-upload-replace {
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
}

.source-optional-hint {
  margin: -4px 0 12px;
  line-height: 1.55;
}

.source-file-card {
  width: 100%;
  height: 188px;
  min-height: 188px;
  padding: 0;
  display: block;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
}

.source-file-card:hover {
  border-color: #2563eb;
  background: #f8fafc;
}

.source-file-card.has-file {
  border-color: #86efac;
  background: #f0fdf4;
}

.source-file-card.has-file .instructor-upload-plus {
  border-color: #bbf7d0;
}

.source-file-card.has-file .instructor-upload-text {
  color: #166534;
}

.source-file-card .instructor-upload-text,
.source-file-card .instructor-upload-hint {
  width: calc(100% - 36px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-file-card .instructor-upload-hint {
  top: calc(50% + 68px);
}

.source-toolbar {
  margin: 0 0 10px;
}

.source-meta {
  margin: 8px 0 10px;
}

.source-preview {
  max-height: 132px;
  overflow: auto;
}

.source-dialog {
  width: min(680px, calc(100vw - 32px));
  max-width: 680px;
  padding: 0;
  border: 0;
  background: transparent;
}

.source-dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.source-dialog-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.24);
}

.source-dialog textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
}

.source-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.batch-bar {
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.inline-field select {
  min-width: 126px;
}

.progress {
  height: 8px;
  background: #e2e8f0;
}

.progress-fill {
  width: 0%;
  background: #2563eb;
  transition: width 0.25s ease;
}

.storyboard {
  gap: 16px;
}

.storyboard:empty {
  min-height: 240px;
  gap: 12px;
  place-content: center;
  justify-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  text-align: center;
  padding: 24px;
}

.storyboard:empty::before {
  content: "";
  width: 44px;
  height: 44px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M3 9h18M9 4v5M15 4v5'/%3E%3C/svg%3E");
  opacity: 0.9;
}

.storyboard:empty::after {
  content: '填写主题、上传讲师形象照，然后点击“AI 拆解章节”生成分镜';
  max-width: 26rem;
  line-height: 1.6;
}

.chapter-block {
  gap: 14px;
}

.chapter-title {
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.chapter-title h3 {
  font-size: 15px;
  font-weight: 700;
}

.chapter-title .chapter-idx {
  color: #2563eb;
  font-weight: 700;
}

.chapter-title .chapter-desc {
  color: #64748b;
  font-size: 12px;
}

.shot-grid {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.shot-card {
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.shot-card:hover {
  border-color: #cbd5e1;
}

.shot-top {
  align-items: flex-start;
  gap: 10px;
}

.shot-badges {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.shot-no {
  color: #1d4ed8;
  font-size: 13px;
}

.shot-no .dot {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
}

.shot-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}

.shot-video-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.shot-status.ok {
  color: #166534;
  border-color: #dcfce7;
  background: #f0fdf4;
}

.shot-video-status.ok {
  color: #166534;
  border-color: #dcfce7;
  background: #f0fdf4;
}

.shot-status.err {
  color: #b42318;
  border-color: #fee2e2;
  background: #fef2f2;
}

.shot-video-status.err {
  color: #b42318;
  border-color: #fee2e2;
  background: #fef2f2;
}

.shot-status.run {
  color: #a16207;
  border-color: #fef3c7;
  background: #fffbeb;
}

.shot-video-status.run {
  color: #a16207;
  border-color: #fef3c7;
  background: #fffbeb;
}

.shot-thumb {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #0f172a;
}

.shot-thumb .placeholder {
  color: #cbd5e1;
  font-size: 12px;
}

.shot-thumb .spinner {
  border-color: rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
}

.shot-thumb a.open {
  right: 8px;
  bottom: 8px;
  background: rgba(15, 23, 42, 0.85);
}

.shot-video {
  position: relative;
  aspect-ratio: var(--shot-thumb-ratio, 16 / 9);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #0f172a;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.shot-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111820;
}

.shot-video .placeholder {
  color: #cbd5e1;
  font-size: 12px;
  text-align: center;
  padding: 6px;
}

.shot-video .spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.shot-video a.open {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 11px;
  text-decoration: none;
}

.scene-panel {
  display: grid;
  gap: 10px;
}

.scene-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.scene-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.scene-actions button {
  width: 100%;
}

.scene-empty {
  min-height: 52px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}

.scene-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.scene-thumb {
  width: 64px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8f0;
}

.scene-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.scene-meta strong,
.scene-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-meta strong {
  color: #334155;
  font-size: 13px;
}

.scene-meta span {
  color: #64748b;
  font-size: 12px;
}

.shot-scene-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(110px, 0.8fr);
  gap: 8px;
}

.shot-scene-controls label {
  display: grid;
  gap: 4px;
}

.shot-scene-controls span {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.shot-scene-controls select {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.concat-controls {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.concat-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.concat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.concat-tags .tag.error {
  border-color: #fee2e2;
  background: #fef2f2;
  color: #b42318;
}

.concat-section-title {
  margin-top: 2px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.concat-preview {
  position: relative;
  min-height: 280px;
}

.concat-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0f172a;
}

.concat-preview .open {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 11px;
  text-decoration: none;
}

.concat-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px;
  text-align: center;
  color: #64748b;
}

.concat-empty strong {
  color: #334155;
  font-size: 15px;
}

.concat-empty span {
  max-width: 24rem;
  font-size: 12px;
  line-height: 1.5;
}

.concat-actions {
  align-items: center;
  gap: 10px;
}

.concat-url {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-field label {
  color: #64748b;
  font-size: 11px;
}

.shot-field textarea {
  min-height: 54px;
  padding: 8px 10px;
  font-size: 13px;
}

.shot-field textarea.prompt {
  background: #f8fafc;
  color: #334155;
}

.shot-field textarea.anchor {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.shot-actions button {
  min-height: 34px;
  flex: 1 1 140px;
}

.segment-list:empty,
.slot-list:empty,
.asset-list:empty,
.task-list:empty {
  min-height: 84px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
}

.segment-row,
.slot-row,
.asset-row,
.task-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.segment-row {
  grid-template-columns: 38px minmax(0, 1fr) 104px 112px;
  gap: 12px;
  padding: 12px;
}

.segment-row textarea {
  min-height: 56px;
  margin: 0;
}

.segment-row audio {
  grid-column: 2 / -1;
  height: 34px;
}

.slot-row {
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.slot-row p {
  color: #64748b;
  font-size: 12px;
}

.asset-row,
.task-row {
  gap: 6px;
  padding: 12px;
}

.row-index {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
}

.tag {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

.tag.warn {
  background: #fffbeb;
  color: #a16207;
  border-color: #fef3c7;
}

.tag.error {
  background: #fef2f2;
  color: #b42318;
  border-color: #fee2e2;
}

.muted {
  color: #64748b;
  font-size: 13px;
}

.event-log {
  gap: 8px;
}

.video-gallery {
  min-height: 110px;
  gap: 12px;
}

.video-gallery:empty,
.video-gallery > .muted {
  min-height: 88px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
}

@media (max-width: 1080px) {
  .c-grid {
    grid-template-columns: 1fr;
  }

  .c-col-left {
    position: static;
  }

  .course-topbar {
    grid-template-columns: 1fr auto;
  }

  .course-topbar .top-metrics {
    display: none;
  }
}
