/* ============================================================
   🎬 95-storyboard-wizard.css — LibTV 工业级短剧 3 步向导总表工作台与视频组
   ============================================================ */

/* 1. 向导遮罩与主弹窗 */
.sbw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: sbwFadeIn 0.2s ease;
}

@keyframes sbwFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes sbw-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sbw-modal {
  width: min(1360px, 96vw);
  height: min(880px, 92vh);
  background: #0d121f;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85), 0 0 40px rgba(56, 189, 248, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* 2. 顶部标题与三步向导 Stepper (方案1: 极致紧凑超薄单行栏) */
.sbw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: linear-gradient(90deg, #111827, #0d121f);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  min-height: 38px;
  box-sizing: border-box;
}

.sbw-title-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sbw-brand-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
}

.sbw-main-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* 🌟 方案3: 标题下方微型后台生成监视徽章 (未生成时隐藏，生成中展示，点击无损切回监视屏) */
.sbw-top-bg-monitor {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.5);
  padding: 1px 7px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  user-select: none;
}

.sbw-top-bg-monitor:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(52, 211, 153, 0.8);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.sbw-top-bg-monitor .sbw-bg-spinner {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: sbw-pulse 1s infinite alternate;
}

.sbw-top-bg-monitor .sbw-bg-text {
  font-size: 10.5px;
  font-weight: 700;
  color: #34d399;
  line-height: 1.2;
}

.sbw-top-bg-monitor .sbw-bg-tokens {
  font-size: 10px;
  color: #a7f3d0;
  font-family: monospace;
  line-height: 1.2;
}

.sbw-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 6px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sbw-step-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sbw-step-item .sbw-step-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.sbw-step-item.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}
.sbw-step-item.active .sbw-step-num {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.sbw-step-item.completed {
  color: #38bdf8;
}

/* 🌟 方案3：后台生成中，与「正在被生成的那一步」联动发光 + 脉冲点 */
.sbw-step-item.generating {
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.55);
  background: rgba(16, 185, 129, 0.12);
  animation: sbw-gen-glow 1.15s infinite alternate;
}

/* 正在生成的那一步，序号圆点换成绿色脉冲点(与顶栏监视胶囊同色，视觉同源) */
.sbw-step-item.generating .sbw-step-num {
  background: #10b981;
  color: #052e21;
  box-shadow: 0 0 8px #10b981;
  animation: sbw-pulse 0.85s infinite alternate;
}

@keyframes sbw-gen-glow {
  from {
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.25);
    border-color: rgba(52, 211, 153, 0.35);
  }
  to {
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.65);
    border-color: rgba(52, 211, 153, 0.9);
  }
}

/* 顶栏监视胶囊的绿色脉冲点依赖此关键帧(此前未定义，动画一直是失效的) */
@keyframes sbw-pulse {
  from {
    opacity: 0.35;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1.12);
  }
}

.sbw-step-arrow {
  color: #475569;
  font-size: 10px;
}

.sbw-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.sbw-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* 2.1 全局参数控制带 (方案1: 沉浸式全局参数控制带) */
.sbw-control-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 16px;
  background: #080c14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  min-height: 36px;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.sbw-strip-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sbw-strip-label {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
  user-select: none;
}

.sbw-strip-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.sbw-strip-subitem {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sbw-strip-sublabel {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  user-select: none;
}

.sbw-control-strip .sbw-spec-select {
  background: #0f172a;
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.5);
  border-radius: 12px;
  padding: 0 8px;
  height: 24px;
  font-size: 11px;
  font-weight: bold;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  max-width: 150px;
  transition: border-color 0.15s ease;
}
.sbw-control-strip .sbw-spec-select:hover {
  border-color: rgba(167, 139, 250, 0.9);
}

.sbw-control-strip .btn-toggle-spec-drawer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  height: 24px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: bold;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(167, 139, 250, 0.25));
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.6);
  border-radius: 12px;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.2);
  transition: all 0.15s ease;
}
.sbw-control-strip .btn-toggle-spec-drawer:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(167, 139, 250, 0.45));
  border-color: rgba(167, 139, 250, 0.9);
}

.sbw-control-strip .sbw-top-llm-model-sel {
  background: #0f172a;
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 12px;
  padding: 0 8px;
  height: 24px;
  font-size: 11px;
  font-weight: bold;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}
.sbw-control-strip .sbw-top-llm-model-sel:hover {
  border-color: rgba(245, 158, 11, 0.9);
}

.sbw-control-strip .sbw-top-video-model-sel {
  background: #0f172a;
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 12px;
  padding: 0 8px;
  height: 24px;
  font-size: 11px;
  font-weight: bold;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}
.sbw-control-strip .sbw-top-video-model-sel:hover {
  border-color: rgba(16, 185, 129, 0.9);
}

.sbw-control-strip .sbw-top-asset-model-sel {
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 12px;
  padding: 0 8px;
  height: 24px;
  font-size: 11px;
  font-weight: bold;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}
.sbw-control-strip .sbw-top-asset-model-sel:hover {
  border-color: rgba(56, 189, 248, 0.9);
}

/* 3. 中间主要内容区域 */
.sbw-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.sbw-main-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  overflow-y: auto;
  gap: 10px;
}

/* 全局电影摄制规范面板 (Production Spec Box) */
.sbw-spec-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-left: 4px solid #38bdf8;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sbw-spec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sbw-spec-title {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sbw-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.sbw-spec-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sbw-spec-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.sbw-spec-input, .sbw-spec-textarea {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #cbd5e1;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}
.sbw-spec-input:focus, .sbw-spec-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* 4. 步骤 1：多列分镜总表 */
.sbw-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sbw-table-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #080c14;
}

.sbw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.sbw-table th {
  background: #111827;
  color: #94a3b8;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.sbw-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  vertical-align: top;
}

.sbw-table tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}

.sbw-shot-no {
  font-weight: 800;
  color: #38bdf8;
  font-family: monospace;
  font-size: 13px;
}

.sbw-shot-dur {
  color: #f59e0b;
  font-weight: 700;
}

.sbw-shot-desc {
  max-width: 260px;
  line-height: 1.5;
}

.sbw-shot-scale {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: #f1f5f9;
  white-space: nowrap;
}

.sbw-shot-light {
  color: #94a3b8;
  font-size: 11.5px;
  line-height: 1.4;
  max-width: 140px;
}

.sbw-shot-dialogue {
  color: #38bdf8;
  font-style: italic;
  max-width: 180px;
  line-height: 1.4;
}

.sbw-shot-audio {
  font-size: 11px;
  color: #a855f7;
  max-width: 140px;
}

.sbw-shot-motion {
  font-size: 11px;
  color: #10b981;
  max-width: 160px;
}

/* 右侧原始剧本逐行对照侧边栏 */
.sbw-script-drawer {
  width: 380px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: #090e18;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease;
}

.sbw-script-drawer.collapsed {
  width: 0;
  border-left: none;
}

.sbw-drawer-head {
  padding: 12px 16px;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sbw-drawer-body {
  flex: 1;
  padding: 14px 16px;
  overflow-y: auto;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* 5. 步骤 2：资产全向定妆卡 */
.sbw-assets-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sbw-asset-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sbw-asset-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sbw-asset-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.sbw-asset-item-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}
.sbw-asset-item-card:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.sbw-aic-title {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
}

.sbw-aic-desc {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.45;
}

.sbw-aic-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  align-self: flex-start;
}

/* 6. 步骤 3：两段式提示词卡 */
.sbw-prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 14px;
}

.sbw-two-stage-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sbw-tsc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.sbw-stage-part {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sbw-part-tag {
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sbw-part-tag.video-tag {
  color: #10b981;
}

.sbw-prompt-box {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.45;
  font-family: monospace;
}

.sbw-prev-shot-state {
  background: rgba(56, 189, 248, 0.1);
  border-left: 2px solid #38bdf8;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #7dd3fc;
}

/* 7. 底部导航与按钮 */
.sbw-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #111827;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sbw-footer-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sbw-footer-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sbw-primary-btn {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  border: none;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}
.sbw-primary-btn:hover {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}

/* ============================================================
   🎬 8. 视频组容器 (Video Group Container Card) 画布样式
   ============================================================ */
.card.video_group {
  background: rgba(13, 18, 31, 0.94) !important;
  border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(56, 189, 248, 0.15) !important;
  border-radius: 16px !important;
}

.card.video_group .card-body {
  padding: 0 !important;
}

.vg-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vg-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vg-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vg-tool-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vg-tool-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: #38bdf8;
}

.vg-btn-run {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4) !important;
}
.vg-btn-run:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.vg-shots-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 14px;
}

.vg-shot-item {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vg-shot-item:hover {
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
}

.vg-shot-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: #1e293b;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.vg-shot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.vg-shot-thumb:hover img {
  transform: scale(1.05);
}

/* ===== 📜 历史对话与全案抽屉 (方案 2: 全案保存 + 模块化复用) ===== */
.sbw-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sbw-btn-history, .sbw-btn-quick-save {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}

.sbw-history-count {
  background: #f59e0b;
  color: #0b0f19;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 14px;
  text-align: center;
  line-height: 1.2;
}
.sbw-btn-history:hover, .sbw-btn-quick-save:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
  color: #fff;
  transform: translateY(-1px);
}
.sbw-btn-quick-save {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}
.sbw-btn-quick-save:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #fff;
}

.sbw-history-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  background: #080c14;
  border-left: 1.5px solid rgba(245, 158, 11, 0.3);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.sbw-history-drawer.is-open {
  transform: translateX(0);
}

.sbw-hdrawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #0d1322;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.sbw-hdrawer-btn-save {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 800;
  border: none;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
}
.sbw-hdrawer-btn-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.sbw-hdrawer-btn-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sbw-hdrawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 快照卡片 */
.sbw-snap-card {
  background: #0d121f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color .15s, box-shadow .15s;
}
.sbw-snap-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.sbw-snap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sbw-snap-title {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sbw-snap-time {
  font-size: 10.5px;
  color: #64748b;
}

/* 四个步骤完成度胶囊 */
.sbw-snap-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.sbw-snap-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.sbw-snap-badge.b-script {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.sbw-snap-badge.b-shots {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.sbw-snap-badge.b-assets {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.sbw-snap-badge.b-prompt {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sbw-snap-snippet {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 8px;
  border-radius: 4px;
  max-height: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 操作按钮行 */
.sbw-snap-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.sbw-snap-btn-restore {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
}
.sbw-snap-btn-restore:hover {
  filter: brightness(1.1);
}
.sbw-snap-btn-continue {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.sbw-snap-btn-continue:hover {
  filter: brightness(1.1);
}
.sbw-snap-btn-split {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.sbw-snap-btn-split:hover {
  background: rgba(255, 255, 255, 0.15);
}
.sbw-snap-btn-del {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
.sbw-snap-btn-del:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* 拆分复用下拉菜单/小面板 */
.sbw-snap-split-menu {
  display: none;
  background: #050811;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.sbw-snap-split-menu.is-open {
  display: flex;
}
.sbw-split-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  font-size: 11px;
  color: #cbd5e1;
  cursor: pointer;
  border: none;
  text-align: left;
}
.sbw-split-item:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

/* 📋 方案1: 实时监视器解禁文本划选与一键复制按钮 */
.sbw-stream-view,
.sbw-stream-view * {
  user-select: text !important;
  -webkit-user-select: text !important;
}
.sbw-stream-view {
  cursor: text !important;
}
.sbw-stream-view::selection,
.sbw-stream-view *::selection {
  background: rgba(56, 189, 248, 0.4) !important;
  color: #ffffff !important;
}
.btn-copy-stream-full:hover {
  background: rgba(56, 189, 248, 0.28) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}
.btn-copy-stream-full:active {
  transform: scale(0.96);
}

/* =============================================================
   🎛️ 导演指令模块化控制台样式 (方案1 · 双层通透工整编排)
   ============================================================= */
.sbw-director-console {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #030712;
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  box-sizing: border-box;
  gap: 7px;
}

/* 第 1 层：主标题与全局操作按钮 (通透舒展，杜绝任何换行挤压) */
.sbw-console-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding-bottom: 2px;
}
.sbw-console-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sbw-console-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  flex-shrink: 0;
}
.sbw-console-title-text {
  font-size: 13.5px;
  font-weight: 800;
  color: #f59e0b;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.sbw-console-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sbw-console-actions-group .btn-preview-full-prompt {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.sbw-console-actions-group .btn-reset-modules-default {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.sbw-console-actions-group .btn-save-director-prompt {
  font-size: 11px;
  padding: 3px 10px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}

/* 第 2 层：剧本方案切换 ＆ 胶囊标签栏 (平铺舒展) */
.sbw-console-subbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 4px;
}
.sbw-preset-bar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* 顶部横向滚动胶囊标签栏 (Filter Chips) */
.sbw-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px 0;
  flex-shrink: 0;
  scrollbar-width: none;
}
.sbw-chips-bar::-webkit-scrollbar {
  display: none;
}

.sbw-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
}
.sbw-chip:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.sbw-chip.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.18);
}
.sbw-chip.inactive {
  opacity: 0.45;
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.06);
  color: #64748b;
  text-decoration: line-through;
}

/* 模块卡片列表容器 */
.sbw-modules-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.sbw-modules-container::-webkit-scrollbar {
  width: 5px;
}
.sbw-modules-container::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.25);
  border-radius: 4px;
}

/* 单个模块卡片 */
.sbw-module-card {
  background: #090e1a;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.sbw-module-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.sbw-module-card.active {
  border-color: rgba(56, 189, 248, 0.35);
}
.sbw-module-card.disabled {
  opacity: 0.45;
  background: #050811;
  border-color: rgba(255, 255, 255, 0.04);
}
.sbw-module-card.disabled .sbw-module-card-body {
  display: none;
}

/* 卡片头部 */
.sbw-module-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 8px;
  user-select: none;
}
.sbw-module-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.sbw-module-drag-icon {
  color: #475569;
  font-size: 13px;
  cursor: grab;
  user-select: none;
}
.sbw-module-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sbw-module-summary {
  font-size: 11px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sbw-module-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 开关/勾选容器 */
.sbw-module-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #e2e8f0;
  cursor: pointer;
}
.sbw-module-checkbox {
  cursor: pointer;
  accent-color: #10b981;
  width: 14px;
  height: 14px;
}

/* 剔除此项按钮 (参考图2的红框删除) */
.btn-module-disable {
  font-size: 10.5px;
  padding: 2px 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.btn-module-disable:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #f87171;
  color: #ffffff;
}

.btn-module-collapse {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  transition: transform 0.15s ease;
}
.btn-module-collapse.collapsed {
  transform: rotate(-90deg);
}

/* 卡片正文 */
.sbw-module-card-body {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #060913;
}
.sbw-module-textarea {
  width: 100%;
  min-height: 80px;
  background: #03060f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 10px;
  color: #fef3c7;
  font-size: 11.5px;
  line-height: 1.5;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  box-sizing: border-box;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}
.sbw-module-textarea:focus {
  border-color: rgba(56, 189, 248, 0.5);
}

/* 完整指令预览弹窗 */
.sbw-prompt-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10005;
}
.sbw-prompt-preview-modal {
  width: 820px;
  max-width: 90vw;
  height: 82vh;
  background: #080c16;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

/* =============================================================
   📑 方案 1: 左侧双 Tab 联动工作台与指令全屏大编辑器
   ============================================================= */
.sbw-left-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
  flex-shrink: 0;
  gap: 8px;
}
.sbw-left-tabs-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sbw-left-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  color: #94a3b8;
  transition: all 0.15s ease;
  user-select: none;
}
.sbw-left-tab-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}
.sbw-left-tab-btn.active {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 -2px 10px rgba(56, 189, 248, 0.15);
}
.sbw-left-tab-btn.tab-editing.active {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 -2px 10px rgba(245, 158, 11, 0.15);
}

/* 右侧卡片选中高亮态 */
.sbw-module-card {
  cursor: pointer;
}
.sbw-module-card.is-selected {
  border-color: #f59e0b !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35) !important;
  background: rgba(245, 158, 11, 0.06) !important;
}

/* 左侧指令全屏编辑器容器 */
.sbw-large-editor-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow: hidden;
  background: #030712;
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  padding: 12px 14px;
  box-sizing: border-box;
}
.sbw-large-editor-textarea {
  flex: 1;
  width: 100%;
  background: #060913;
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  padding: 12px 14px;
  color: #fef3c7;
  font-size: 12.5px;
  line-height: 1.6;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  box-sizing: border-box;
  resize: none;
  outline: none;
  transition: border-color 0.15s ease;
}
.sbw-large-editor-textarea:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

/* =============================================================
   📋 方案预设选择器与智能保存模态弹窗样式
   ============================================================= */
.sbw-preset-selector-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.sbw-preset-select {
  background: #0f172a;
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.sbw-preset-select:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}
.sbw-preset-select:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.sbw-preset-select option {
  background: #0b1120;
  color: #f1f5f9;
  font-weight: normal;
}

/* 方案保存模态弹窗 */
.sbw-save-preset-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10010;
}
.sbw-save-preset-card {
  width: 440px;
  max-width: 92vw;
  background: #090e1a;
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sbw-save-preset-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(245, 158, 11, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sbw-save-preset-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sbw-save-preset-option-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sbw-save-preset-option-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.04);
}
.sbw-save-preset-option-card.selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}



/* ============================================================
   🧩 PrevisModal — 9 类型提示词模块勾选面板 (2026-09-10 新增)
   位置: PrevisModal 右侧"海螺 H3 生成配置"下方
   行为: 每行一个 [checkbox] + emoji + 类型名 + N 块角标;
         取消勾选 → 中间栏对应块消失,提交生视频时该类型不参与
   ============================================================ */
.pm-toggle-section {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(8, 12, 20, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
}

.pm-toggle-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.pm-toggle-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.2px;
}

.pm-toggle-title #pm-toggle-enabled-count {
  color: #38bdf8;
  font-family: 'Menlo', 'Monaco', monospace;
}

.pm-toggle-master {
  display: flex;
  gap: 4px;
}

.pm-toggle-master-btn {
  font-size: 10.5px;
  padding: 3px 8px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.pm-toggle-master-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.55);
}

.pm-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pm-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.18s ease;
  user-select: none;
  font-size: 11.5px;
  line-height: 1.4;
}

.pm-toggle-row.is-enabled {
  background: rgba(56, 189, 248, 0.06);
  color: #e2e8f0;
}

.pm-toggle-row.is-enabled:hover {
  background: rgba(56, 189, 248, 0.14);
}

.pm-toggle-row.is-disabled {
  background: rgba(100, 116, 139, 0.05);
  color: #64748b;
  opacity: 0.55;
}

.pm-toggle-row.is-disabled:hover {
  background: rgba(100, 116, 139, 0.12);
  opacity: 0.75;
}

.pm-toggle-cb {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: #38bdf8;
}

.pm-toggle-emoji {
  flex-shrink: 0;
  font-size: 13px;
  width: 18px;
  text-align: center;
}

.pm-toggle-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-toggle-count {
  flex-shrink: 0;
  font-size: 10px;
  font-family: 'Menlo', 'Monaco', monospace;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(100, 116, 139, 0.18);
  color: #94a3b8;
  min-width: 30px;
  text-align: center;
}

.pm-toggle-count.has-blocks {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  font-weight: 700;
}

.pm-toggle-count.empty {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  font-weight: 400;
  opacity: 0.7;
}

/* ============================================================
   🆕 2026-09-10 v2:第 10 行"自定义" + 9 行拖动
   - .pm-toggle-handle 拖动手柄 ⠿
   - .pm-toggle-row[draggable] 可拖动 cursor
   - .pm-toggle-row.is-dragging 拖动中
   - .pm-toggle-row.is-drop-target 放置目标高亮
   - .pm-toggle-row.is-user-content 自定义行(无 checkbox,有 ✏️ 按钮)
   - .pm-user-content-btn ✏️ 编辑按钮
   - .pm-toggle-label-tag / .pm-toggle-label-content / .pm-toggle-label-hint
   - .pm-user-content-overlay 自定义内容编辑模态框
   ============================================================ */

.pm-toggle-row[draggable="true"] {
  cursor: grab;
}
.pm-toggle-row[draggable="true"]:active {
  cursor: grabbing;
}

.pm-toggle-handle {
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
  color: #64748b;
  cursor: grab;
  user-select: none;
  opacity: 0.55;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.pm-toggle-row:hover .pm-toggle-handle {
  opacity: 1;
  color: #94a3b8;
}
.pm-toggle-handle:active {
  cursor: grabbing;
}

.pm-toggle-row.is-dragging {
  opacity: 0.4;
  background: rgba(56, 189, 248, 0.08) !important;
  outline: 1px dashed rgba(56, 189, 248, 0.5);
}

.pm-toggle-row.is-drop-target {
  outline: 2px solid #38bdf8;
  outline-offset: -2px;
  background: rgba(56, 189, 248, 0.12) !important;
}

/* 第 10 行"自定义"行(无 checkbox,用 <div> 不用 <label>) */
.pm-toggle-row.is-user-content {
  background: rgba(168, 85, 247, 0.05);
  color: #e2e8f0;
  border: 1px dashed rgba(168, 85, 247, 0.25);
}
.pm-toggle-row.is-user-content:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.5);
}
.pm-toggle-row.is-user-content.has-content {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-style: solid;
}
.pm-toggle-row.is-user-content.has-content:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.55);
}
.pm-toggle-row.is-user-content.is-empty {
  border-style: dashed;
  opacity: 0.7;
}
.pm-toggle-row.is-user-content.is-empty:hover {
  opacity: 1;
}

.pm-toggle-row.is-user-content .pm-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  flex: 1;
  min-width: 0;
}

.pm-toggle-label-tag {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
  color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  padding: 1px 7px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}
.pm-toggle-row.has-content .pm-toggle-label-tag {
  color: #10b981;
  background: rgba(16, 185, 129, 0.14);
}

.pm-toggle-label-content {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #e2e8f0;
  word-break: break-word;
  white-space: pre-wrap;
  max-height: 3.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pm-toggle-label-hint {
  flex: 1;
  font-size: 10.5px;
  color: #64748b;
  font-style: italic;
}

.pm-user-content-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #a855f7;
  width: 26px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  padding: 0;
}
.pm-toggle-row.has-content .pm-user-content-btn {
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}
.pm-user-content-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.7);
  color: #c084fc;
}
.pm-toggle-row.has-content .pm-user-content-btn:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.7);
  color: #34d399;
}

/* ============================================================
   🆕 2026-09-10 v2:第 10 行"自定义"内容编辑模态框
   ============================================================ */
.pm-user-content-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: pmUserOverlayFade 0.18s ease;
}
.pm-user-content-overlay.is-open {
  display: flex;
}
@keyframes pmUserOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pm-user-content-dialog {
  width: min(560px, 90vw);
  max-height: 80vh;
  background: #1e293b;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 10px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pmUserDialogPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pmUserDialogPop {
  from { transform: scale(0.92) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.pm-user-content-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(56, 189, 248, 0.05));
}

.pm-user-content-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}

.pm-user-content-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.12s ease;
}
.pm-user-content-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.pm-user-content-body {
  flex: 1;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.pm-user-content-textarea {
  flex: 1;
  min-height: 160px;
  background: #0f172a;
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 12.5px;
  line-height: 1.55;
  font-family: inherit;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.pm-user-content-textarea:focus {
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}
.pm-user-content-textarea::placeholder {
  color: #475569;
  font-style: italic;
}

.pm-user-content-hint {
  font-size: 10.5px;
  color: #64748b;
  line-height: 1.4;
}

.pm-user-content-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(100, 116, 139, 0.2);
  background: rgba(15, 23, 42, 0.5);
}

.pm-user-content-btn-primary,
.pm-user-content-btn-secondary {
  border: 0;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  letter-spacing: 0.2px;
}
.pm-user-content-btn-primary {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}
.pm-user-content-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.5);
}
.pm-user-content-btn-primary:active {
  transform: translateY(0);
}

.pm-user-content-btn-secondary {
  background: rgba(100, 116, 139, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.3);
}
.pm-user-content-btn-secondary:hover {
  background: rgba(100, 116, 139, 0.25);
  color: #e2e8f0;
}
