/* 拍摄计划样式 - 左右分栏布局 */

.shooting-plan-wrapper {
  --scene-shot-image-width: 112px;
  display: flex;
  gap: 16px;
  height: calc(100vh - 140px);
  padding: 16px;
  overflow: hidden;
}

/* 左侧：未分配镜头池 */
.shot-pool-panel {
  width: 300px;
  min-width: 260px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.panel-header .count {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
  min-width: 28px;
  text-align: center;
}

.shot-pool-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-pool {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* 镜头卡片 */
.shot-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  cursor: grab;
  transition: all 0.2s;
  display: flex;
  gap: 10px;
  user-select: none;
}

.shot-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(180, 140, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shot-card:active {
  cursor: grabbing;
}

.shot-card.dragging,
.shot-card.lifted {
  opacity: 0.28;
  transform: scale(1.06);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  z-index: 3;
}

.shot-card-image {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shot-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-placeholder {
  color: #555;
  font-size: 11px;
  font-weight: 600;
}

.shot-card-info {
  flex: 1;
  min-width: 0;
}

.shot-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.shot-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.shot-card-content {
  font-size: 11px;
  color: #aaa;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 右侧：场次分组区 */
.scene-groups-panel {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scene-groups-container {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 16px;
  display: flex;
  flex-flow: row nowrap;
  gap: 16px;
  align-items: stretch;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 140, 255, 0.55) rgba(255, 255, 255, 0.05);
}

.empty-groups {
  flex: 1 0 100%;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

/* 场次分组卡片 */
.scene-group {
  flex: 0 0 clamp(320px, 42vw, 440px);
  width: clamp(320px, 42vw, 440px);
  max-height: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 14px;
  transition: all 0.2s;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scene-group:hover {
  border-color: rgba(180, 140, 255, 0.3);
}

.scene-group.drag-target {
  border-color: var(--accent);
  background: rgba(180, 140, 255, 0.08);
}

.scene-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.scene-group-handle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(8, 8, 14, 0.55);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
}

.scene-group-handle:active {
  cursor: grabbing;
}

.scene-group-index {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.scene-group-ghost {
  opacity: 0.45;
}

.scene-group-chosen,
.scene-group-dragging {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  border-color: rgba(180, 140, 255, 0.55);
}

.scene-group-name {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 6px 0;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.scene-group-name:focus {
  border-bottom-color: var(--accent);
}

.scene-group-name::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.btn-icon {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 6px;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* 拖放区域 */
.scene-group-drop-zone {
  flex: 1;
  min-height: 100px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 10px;
  align-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  transition: all 0.2s;
}

.scene-group-drop-zone.drag-over {
  background: rgba(180, 140, 255, 0.15);
  border-color: var(--accent);
  border-style: solid;
}

.scene-group-drop-zone.insert-empty {
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.45);
}

.scene-shot-card-full.insert-before {
  transform: translateY(10px) scale(0.985);
}

.scene-shot-card-full.insert-after {
  transform: translateY(-6px) scale(0.985);
}

.scene-insert-slot {
  flex: 0 0 auto;
  width: 100%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1.5px dashed transparent;
  background: transparent;
  opacity: 0;
  transform: scale(0.92);
  transition:
    height 0.22s ease,
    opacity 0.18s ease,
    transform 0.22s ease,
    margin 0.22s ease,
    border-color 0.18s ease,
    background 0.18s ease;
  display: grid;
  place-items: center;
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.scene-insert-slot.is-open {
  height: 56px;
  opacity: 1;
  transform: scale(1);
  border-color: rgba(167, 139, 250, 0.85);
  background: rgba(139, 92, 246, 0.16);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.25);
}

.drop-hint {
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 0;
}

.scene-group-stats {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 场次内完整镜头卡片 - 与左侧保持一致的视觉 */
.scene-shot-card-full {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease,
    margin 0.22s ease;
  position: relative;
  display: grid;
  grid-template-columns: var(--scene-shot-image-width) minmax(0, 1fr);
  align-items: stretch;
}

.scene-shot-card-full:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(180, 140, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scene-shot-card-full:active {
  cursor: grabbing;
}

.scene-shot-card-full.dragging,
.scene-shot-card-full.lifted {
  opacity: 0.22;
  transform: scale(1.05);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
  z-index: 4;
}

.scene-shot-card-full.just-landed {
  animation: scene-shot-land 0.42s ease;
}

@keyframes scene-shot-land {
  0% {
    transform: scale(1.08);
    box-shadow: 0 16px 28px rgba(139, 92, 246, 0.28);
  }
  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

.scene-shot-thumb {
  width: var(--scene-shot-image-width);
  min-width: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px 0 0 6px;
}

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

.scene-shot-detail {
  min-width: 0;
  padding: 8px 34px 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.scene-shot-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.scene-shot-number {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-shot-duration {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.scene-shot-meta {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}

.scene-shot-content {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.shooting-plan-wrapper[data-scene-size="compact"] .scene-shot-detail {
  padding-top: 5px;
  padding-bottom: 5px;
}

.shooting-plan-wrapper[data-scene-size="compact"] .scene-shot-content {
  -webkit-line-clamp: 1;
}

.shooting-plan-size-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.shooting-plan-size-control .size-slider {
  width: 112px;
}

.shooting-plan-size-control output {
  min-width: 38px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.remove-btn-full {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.scene-shot-card-full:hover .remove-btn-full {
  opacity: 1;
}

.remove-btn-full:hover {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
}

/* 镜头始终一行一个；窄屏时场次仍保持横向轨道。 */
@media (max-width: 600px) {
  .scene-shot-card-full {
    width: 100%;
  }

  .shooting-plan-size-control > span {
    display: none;
  }
}

/* 滚动条样式 */
.shot-pool-list::-webkit-scrollbar,
.scene-groups-container::-webkit-scrollbar {
  width: 8px;
}

.scene-groups-container::-webkit-scrollbar {
  height: 10px;
}

.shot-pool-list::-webkit-scrollbar-track,
.scene-groups-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.shot-pool-list::-webkit-scrollbar-thumb,
.scene-groups-container::-webkit-scrollbar-thumb {
  background: rgba(180, 140, 255, 0.3);
  border-radius: 4px;
}

.shot-pool-list::-webkit-scrollbar-thumb:hover,
.scene-groups-container::-webkit-scrollbar-thumb:hover {
  background: rgba(180, 140, 255, 0.5);
}

.scene-group-drop-zone {
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 140, 255, 0.35) transparent;
}

.scene-group-drop-zone::-webkit-scrollbar {
  width: 6px;
}

.scene-group-drop-zone::-webkit-scrollbar-thumb {
  background: rgba(180, 140, 255, 0.35);
  border-radius: 999px;
}

/* ========== 拍摄通告向导样式 ========== */
.callsheet-wizard {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.callsheet-step {
  max-width: 800px;
  margin: 0 auto;
}

.callsheet-step h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.callsheet-step .step-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.callsheet-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.callsheet-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.callsheet-field.full {
  grid-column: 1 / -1;
}

.callsheet-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.callsheet-field input,
.callsheet-field select,
.callsheet-field textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.callsheet-field input:focus,
.callsheet-field select:focus,
.callsheet-field textarea:focus {
  border-color: var(--accent);
}

.callsheet-field input::placeholder,
.callsheet-field textarea::placeholder {
  color: var(--text-muted);
}

.callsheet-field textarea {
  resize: vertical;
  min-height: 60px;
}

/* 步骤2：分组通告 */
.callsheet-scenes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.callsheet-scene-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
}

.callsheet-scene-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.callsheet-scene-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.callsheet-scene-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.callsheet-scene-shot {
  background: rgba(180, 140, 255, 0.12);
  border: 1px solid rgba(180, 140, 255, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text);
}

.callsheet-scene-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.callsheet-scene-fields .callsheet-field label {
  font-size: 12px;
}

.callsheet-scene-fields .callsheet-field input,
.callsheet-scene-fields .callsheet-field select {
  padding: 8px 10px;
  font-size: 13px;
}

/* 步骤3：日程预览 */
.schedule-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-time-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border-left: 4px solid var(--accent);
}

.schedule-time-row.meal {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

.schedule-time-row .time {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.schedule-time-row.meal .time {
  color: #f59e0b;
}

.schedule-time-row .label {
  font-size: 14px;
  color: var(--text);
}

.schedule-time-row .duration {
  font-size: 12px;
  color: var(--text-muted);
}

/* 通告单预览（导出格式） */
.callsheet-document {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  color: #1a1a1a;
  padding: 40px;
  border-radius: 8px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.callsheet-document .doc-header {
  text-align: center;
  border-bottom: 3px solid #1a1a1a;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.callsheet-document .doc-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.callsheet-document .doc-subtitle {
  font-size: 14px;
  color: #666;
}

.callsheet-document .doc-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
  margin-bottom: 24px;
  padding: 16px;
  background: #f8f8f8;
  border-radius: 6px;
}

.callsheet-document .doc-info-item {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.callsheet-document .doc-info-label {
  font-weight: 700;
  color: #1a1a1a;
  min-width: 70px;
}

.callsheet-document .doc-info-value {
  color: #333;
  flex: 1;
}

.callsheet-document .doc-section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e0e0e0;
  color: #1a1a1a;
}

.callsheet-document .doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.callsheet-document .doc-table th {
  background: #1a1a1a;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 8px 6px;
  font-size: 12px;
  border: 1px solid #333;
}

.callsheet-document .doc-table td {
  padding: 8px 6px;
  font-size: 12px;
  text-align: center;
  border: 1px solid #ddd;
  vertical-align: middle;
}

.callsheet-document .doc-table td.highlight {
  background: #fff3e0;
  font-weight: 700;
}

.callsheet-document .doc-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #ddd;
  text-align: center;
  font-size: 11px;
  color: #999;
}

/* 浅色拍摄计划 / 通告编辑区：只使用白色工作面与深色文字。 */
body.theme-light .shooting-plan-wrapper,
body.theme-light .callsheet-wizard {
  background: #ffffff;
  color: #121218;
}

body.theme-light .shot-pool-panel,
body.theme-light .scene-groups-panel,
body.theme-light .scene-group,
body.theme-light .shot-card,
body.theme-light .scene-shot-card-full,
body.theme-light .scene-group-drop-zone,
body.theme-light .callsheet-scene-item,
body.theme-light .schedule-time-row {
  background: #ffffff;
  border-color: #d5d8e0;
  color: #121218;
}

body.theme-light .panel-header {
  background: #ffffff;
  border-bottom-color: #d5d8e0;
}

body.theme-light .shot-card:hover,
body.theme-light .scene-shot-card-full:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 5px 16px rgba(28, 32, 48, 0.12);
}

body.theme-light .scene-group-drop-zone.drag-over,
body.theme-light .scene-group.drag-target {
  background: rgba(99, 102, 241, 0.06);
}

body.theme-light .scene-group-name {
  border-bottom-color: #cfd2db;
  color: #121218;
}

body.theme-light .scene-group-handle {
  background: #ffffff;
  border-color: #d5d8e0;
  color: #121218;
}

body.theme-light .scene-group-index {
  color: #6b7280;
}

body.theme-light .shot-card-title,
body.theme-light .scene-shot-title,
body.theme-light .scene-shot-number,
body.theme-light .scene-shot-content,
body.theme-light .shot-card-content,
body.theme-light .scene-group-stats {
  color: #121218;
}

body.theme-light .shot-card-meta,
body.theme-light .scene-shot-duration,
body.theme-light .empty-pool,
body.theme-light .empty-groups,
body.theme-light .drop-hint {
  color: #5c5c6a;
}

body.theme-light .btn-icon {
  background: #ffffff;
  border: 1px solid #cfd2db;
  color: #121218;
}

body.theme-light .shooting-plan-size-control {
  background: #ffffff;
  border-color: #cfd2db;
  color: #3f3f4a;
}

body.theme-light .shot-pool-list::-webkit-scrollbar-track,
body.theme-light .scene-groups-container::-webkit-scrollbar-track {
  background: #ffffff;
}

body.theme-light .callsheet-field input,
body.theme-light .callsheet-field select,
body.theme-light .callsheet-field textarea {
  background: #ffffff;
  border-color: #cfd2db;
  color: #121218;
}
