/* ---------- ⊞ 分镜网格画板卡片 (Storyboard Grid Canvas) ---------- */
.card.grid_canvas {
  --tc: #eab308;
  --tc-rgb: 234, 179, 8;
  background: rgba(18, 21, 30, 0.98);
  border: 1.5px solid rgba(234, 179, 8, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
  border-radius: 12px;
}
.card.grid_canvas:hover {
  border-color: rgba(234, 179, 8, 0.85);
}

.gc-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 14px;
}

/* 顶栏控制栏 (规范单行排布，禁止换行与溢出) */
.gc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(26, 31, 46, 0.92);
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
}
.gc-topbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
}
.gc-topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.gc-ctrl-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #94a3b8;
}
.gc-lbl {
  font-weight: 600;
  font-size: 10.5px;
  color: #cbd5e1;
}
.gc-sel {
  appearance: none;
  -webkit-appearance: none;
  background: #171b26;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 3px 16px 3px 6px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  transition: all .15s ease;
  max-width: 130px;
}
.gc-sel:hover {
  border-color: #eab308;
  color: #ffffff;
}

/* 按钮样式 */
.gc-btn {
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
}
.gc-btn-icon-only {
  padding: 4px 6px;
  font-size: 12px;
  min-width: 24px;
}
.gc-btn-compact {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.gc-btn-compact:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #ffffff;
}
.gc-btn-stitch {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #0f172a;
  border: 1px solid #fde047;
}
.gc-btn-stitch:hover {
  background: linear-gradient(135deg, #facc15, #eab308);
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.5);
  color: #000;
}
.gc-btn-clear {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.gc-btn-clear:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}
.gc-btn-fold {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.gc-btn-fold:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* 网格槽位容器 */
.gc-grid {
  display: grid;
  gap: 8px;
  width: 100%;
}

/* 单个槽位 */
.gc-slot {
  position: relative;
  background: #141722;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.gc-slot.empty:hover, .gc-slot.dragover {
  border-color: #eab308;
  background: rgba(234, 179, 8, 0.08);
  transform: scale(1.01);
}
.gc-slot.is-dragging {
  opacity: 0.45;
  border-color: #3b82f6;
}
.gc-slot.drag-swap-target {
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.15) !important;
  transform: scale(1.03);
}
.gc-slot.is-locked {
  border-color: rgba(234, 179, 8, 0.65) !important;
}
.gc-slot.filled {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.18);
  cursor: grab;
}
.gc-slot.filled:active {
  cursor: grabbing;
}
.gc-slot.filled:hover {
  border-color: rgba(234, 179, 8, 0.6);
}

.gc-slot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #080a10;
  display: block;
  pointer-events: none;
}

/* 槽位序号徽标 */
.gc-slot-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #fde047;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(234, 179, 8, 0.4);
  pointer-events: none;
}

/* 槽位操作按钮 (hover 显示) */
.gc-slot-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s ease;
}
.gc-slot.filled:hover .gc-slot-actions {
  opacity: 1;
}
.gc-slot-btn {
  border: none;
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all .12s ease;
}
.gc-slot-btn.gc-slot-lock.active {
  background: rgba(234, 179, 8, 0.25);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.6);
}
.gc-slot-btn.gc-slot-fit.active {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.6);
}
.gc-slot-btn.gc-slot-send:hover {
  background: #10b981;
  color: #fff;
  border-color: #34d399;
}
.gc-slot-btn.gc-slot-replace:hover {
  background: #2563eb;
  color: #fff;
  border-color: #60a5fa;
}
.gc-slot-btn.gc-slot-del:hover {
  background: #dc2626;
  color: #fff;
  border-color: #f87171;
}

/* 槽位图片填充模式支持 (contain 完整保全 / cover 撑满无黑边) */
.gc-slot.fit-cover .gc-slot-img {
  object-fit: cover;
}
.gc-slot.fit-contain .gc-slot-img {
  object-fit: contain;
}

/* 空槽位内部元素 */
.gc-slot-empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #64748b;
  pointer-events: none;
}
.gc-slot-plus {
  font-size: 24px;
  font-weight: 300;
  color: #94a3b8;
  line-height: 1;
}
.gc-slot-num-empty {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}
.gc-slot-tip {
  font-size: 10px;
  color: #64748b;
}

/* 折叠态 */
.gc-collapsed-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(22, 27, 38, 0.95);
  border-radius: 8px;
  cursor: pointer;
}
.gc-collapsed-wrap:hover {
  background: rgba(30, 38, 54, 0.98);
}
.gc-collapsed-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gc-col-icon {
  font-size: 16px;
  color: #eab308;
}
.gc-col-title {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}
.gc-col-tag {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 6px;
}
.gc-col-count {
  font-size: 11.5px;
  color: #eab308;
  font-weight: 600;
}
.gc-btn-unfold {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #fde047;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.gc-btn-unfold:hover {
  background: rgba(234, 179, 8, 0.3);
  color: #ffffff;
}

/* 🌟 方案 1: 屏幕顶部固定常驻悬浮条 (随屏跟随，拖线直扔或就地展开) */
.gc-floating-capsule {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 16px;
  background: rgba(18, 22, 34, 0.94);
  border: 1.5px solid #eab308;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.75), 0 0 16px rgba(234, 179, 8, 0.3);
  border-radius: 28px;
  backdrop-filter: blur(12px);
  color: #f1f5f9;
  user-select: none;
  transition: all .15s ease;
  cursor: pointer;
}
.gc-floating-capsule:hover {
  background: rgba(26, 32, 48, 0.98);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.85), 0 0 22px rgba(234, 179, 8, 0.45);
  transform: translateX(-50%) translateY(-1px);
}
.gc-floating-capsule.drag-target {
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.2) !important;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.6) !important;
  transform: translateX(-50%) scale(1.05) !important;
}
.gc-floating-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gc-floating-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gc-btn-float-unfold {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #0f172a;
  border: 1px solid #fde047;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .12s ease;
}
.gc-btn-float-unfold:hover {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #000;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.5);
}
.gc-btn-float-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-size: 11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gc-btn-float-close:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: #f87171;
  color: #fff;
}

