/* =========================================================
   studio.css — studio.html(목록) / studio-editor.html(작성) 공용 스타일
   ========================================================= */

.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--page-padding) 12px;
}

.studio-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 0 12px;
}

.studio-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.create-menu {
  position: absolute;
  top: 48px;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px var(--shadow-color);
  padding: 8px;
  width: 260px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.create-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
}

.create-option:hover {
  background: var(--bg-soft);
}

.create-option strong {
  font-size: 14px;
  color: var(--text-primary);
}

.create-option span {
  font-size: 12px;
  color: var(--text-muted);
}

.work-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px var(--page-padding) 60px;
}

.work-item {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.work-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.work-cover {
  width: 52px;
  height: 70px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.work-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.work-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-synopsis {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.work-status.submitted {
  background: var(--accent);
  color: var(--text-on-accent);
}

.work-edit,
.work-view,
.work-add-episode {
  flex-shrink: 0;
}

.empty-hint {
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px var(--page-padding);
  text-align: center;
}

.delete-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px var(--page-padding);
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
}

.delete-bar #deleteCount {
  margin-right: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.parent-picker,
.editor-form {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px var(--page-padding) 60px;
}

.editor-heading {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 20px;
}

.parent-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 16px;
}

.parent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.parent-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.parent-option:hover {
  border-color: var(--accent);
}

.parent-option strong {
  font-size: 14px;
  color: var(--text-primary);
}

.parent-option span {
  font-size: 12px;
  color: var(--text-muted);
}

.parent-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.field-error {
  margin: 0;
  font-size: 12px;
  color: #e0562f;
  min-height: 16px;
}


.cover-upload {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.cover-thumb {
  position: relative;
  width: 96px;
  height: 128px;
  flex-shrink: 0;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.cover-thumb:hover {
  border-color: var(--accent);
}

.cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#coverPlaceholder {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 0 8px;
}

.cover-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.cover-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.cover-download {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  width: fit-content;
}

.align-dropdown {
  position: relative;
}

.align-menu {
  position: absolute;
  top: 40px;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow-color);
  padding: 6px;
  width: 140px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.align-option {
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
}

.align-option:hover {
  background: var(--bg-soft);
}

.field-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.webtoon-image-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.webtoon-image-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px;
}

.webtoon-image-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-soft);
}

.webtoon-image-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.webtoon-image-meta span {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.webtoon-image-actions {
  display: flex;
  gap: 4px;
}

.webtoon-image-move,
.webtoon-image-remove {
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-soft);
}

.webtoon-image-move:hover,
.webtoon-image-remove:hover {
  background: var(--border);
}

.webtoon-image-move:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.webtoon-image-add-btn {
  display: inline-block;
  width: fit-content;
}

.visibility-toggle {
  display: inline-flex;
  gap: 6px;
}

.visibility-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.visibility-option input {
  accent-color: var(--accent);
  width: 13px;
  height: 13px;
}

.visibility-option:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.toggle-row {
  padding: 6px 0 16px;
}

.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.switch-label input {
  display: none;
}

.switch-label .switch {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.switch-label .switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  /* 스위치를 눌렀을 때 진짜 딸깍 넘어가는 느낌이 나도록 살짝 튕기는 이징을 쓴다. */
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch-label input:checked + .switch {
  background: var(--accent);
}

.switch-label input:checked + .switch::after {
  transform: translateX(18px);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-soft);
}

.tb-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-primary);
}

.tb-btn:hover {
  background: var(--bg-soft);
}

.tb-select {
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  padding: 0 8px;
  color: var(--text-primary);
  font-family: inherit;
}

.tb-color {
  width: 34px;
  height: 34px;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.editor-body {
  min-height: 420px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-primary);
  outline: none;
}

.editor-body:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- 반응형 (모바일) ---------- */
@media (max-width: 640px) {
  .work-item {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .work-info {
    flex: 1 1 160px;
  }

  .cover-upload {
    flex-wrap: wrap;
  }
}