/* music.css — crowny.org 디자인토큰 SSOT
   다크: --bg:#0A0908 / 골드: #C9A961
   터치≥44px · 본문≥16px · 640px 캡 */

:root {
  --bg: #0A0908;
  --panel: #141210;
  --sidebar: #1A1916;
  --text: #F4E9D8;
  --text2: #9A8D7B;
  --border: #2E2A24;
  --gold: #C9A961;
  --gold-dim: #A08840;
  --coral: #D4743A;
  --success: #4CAF50;
  --warning: #FF9800;
  --error: #F44336;

  /* 상태 4상 색상 */
  --ti: #4CAF50;   /* 티: 성공/통과 */
  --om: #FF9800;   /* 옴: 대기/보류 */
  --ta: #F44336;   /* 타: 반려/실패 */
  --eum: #9C27B0;  /* 음: 이관/사람개입 */

  /* 발매 상태 색상 */
  --state-draft: #555;
  --state-meta: #1976D2;
  --state-cover: #0288D1;
  --state-review: var(--om);
  --state-dist: #7B1FA2;
  --state-live: var(--ti);
  --state-settle: var(--gold);
}

/* ── 라이트 모드 오버라이드 (시스템 설정 따름) ── */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #FAF9F7;
    --panel: #FFFFFF;
    --sidebar: #F4F1ED;
    --text: #1A1A1A;
    --text2: #6B6B6B;
    --border: #E5E2DD;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }
body {
  font-family: 'Pretendard', 'Söhne', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── 레이아웃 ── */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

/* ── 헤더 ── */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -0.01em;
}
.site-header .subtitle {
  font-size: 0.8rem;
  color: var(--text2);
}

/* ── 카드 ── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
  user-select: none;
  touch-action: manipulation;
}
.btn:active { opacity: 0.8; }

.btn-primary   { background: var(--gold);  color: #0A0908; }
.btn-secondary { background: var(--sidebar); color: var(--text); border: 1px solid var(--border); }
.btn-danger    { background: var(--error); color: #fff; }
.btn-ghost     { background: transparent; color: var(--gold); border: 1px solid var(--gold-dim); }
.btn-full      { width: 100%; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── 폼 ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 44px;
  background: var(--sidebar);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(201,169,97,0.15);
}
.form-textarea { min-height: 100px; resize: vertical; }

/* ── 스텝 위저드 ── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 60px;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sidebar);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text2);
  position: relative;
  z-index: 1;
}
.step-dot.active { border-color: var(--gold); background: var(--gold); color: #0A0908; }
.step-dot.done   { border-color: var(--ti); background: var(--ti); color: #fff; }
.step-label { font-size: 0.7rem; color: var(--text2); margin-top: 4px; text-align: center; }
.step-label.active { color: var(--gold); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-top: -18px;
}
.step-line.done { background: var(--gold-dim); }

/* ── 상태 배지 ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
/* 발매 상태 배지 텍스트 색 (기능적 상태 색상 — CSS 변수로 관리) */
:root {
  --badge-meta-text:  #64B5F6;  /* 메타입력 단계 — 파랑 */
  --badge-cover-text: #4FC3F7;  /* 커버업로드 단계 — 하늘 */
  --badge-dist-text:  #CE93D8;  /* 배급 단계 — 보라 */
}
.badge-draft   { background: rgba(85,85,85,0.2);    color: var(--text2); }
.badge-meta    { background: rgba(25,118,210,0.2);  color: var(--badge-meta-text); }
.badge-cover   { background: rgba(2,136,209,0.2);   color: var(--badge-cover-text); }
.badge-review  { background: rgba(255,152,0,0.2);   color: var(--om); }
.badge-dist    { background: rgba(123,31,162,0.2);  color: var(--badge-dist-text); }
.badge-live    { background: rgba(76,175,80,0.2);   color: var(--ti); }
.badge-settle  { background: rgba(201,169,97,0.2);  color: var(--gold); }

/* 4상 배지 */
.badge-ti   { background: rgba(76,175,80,0.2);   color: var(--ti); }
.badge-om   { background: rgba(255,152,0,0.2);   color: var(--om); }
.badge-ta   { background: rgba(244,67,54,0.2);   color: var(--ta); }
.badge-eum  { background: rgba(156,39,176,0.2);  color: var(--eum); }

/* ── 타임라인 ── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
}
.timeline-dot.active { background: var(--gold); }
.timeline-dot.done   { background: var(--ti); }
.timeline-title  { font-size: 0.9rem; font-weight: 600; }
.timeline-sub    { font-size: 0.8rem; color: var(--text2); margin-top: 2px; }

/* ── 수치 카드 ── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-item {
  background: var(--sidebar);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 2px;
}

/* ── 드래그 업로드 존 ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--sidebar);
}
.drop-zone.drag-over {
  border-color: var(--gold);
  background: rgba(201,169,97,0.06);
}
.drop-zone-icon { font-size: 2.5rem; margin-bottom: 8px; }
.drop-zone-text { font-size: 0.9rem; color: var(--text2); }
.drop-zone-hint { font-size: 0.75rem; color: var(--text2); opacity: 0.6; margin-top: 4px; }

/* ── 채널 목록 ── */
.channel-list { display: flex; flex-direction: column; gap: 8px; }
.channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sidebar);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.channel-item.selected { border-color: var(--gold); }
.channel-item input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--gold);
  cursor: pointer;
}
.channel-name { font-size: 0.9rem; font-weight: 600; flex: 1; }
.channel-fee  { font-size: 0.8rem; color: var(--text2); }

/* ── 정산 테이블 ── */
.settle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.settle-row:last-child { border-bottom: none; }
.settle-label { color: var(--text2); }
.settle-value { font-weight: 600; }
.settle-total { color: var(--gold); font-size: 1.1rem; }

/* ── 로딩 ── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text2);
  font-size: 0.9rem;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 토스트 ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.9rem;
  max-width: min(90vw, 400px);
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: slideUp 0.25s ease;
  display: none;
}
.toast.show { display: block; }
.toast.success { border-color: var(--ti); color: var(--ti); }
.toast.error   { border-color: var(--ta); color: var(--ta); }
@keyframes slideUp { from { opacity:0; transform: translateX(-50%) translateY(12px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ── 구분선 ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── 반응형 ── */
@media (max-width: 480px) {
  .container { padding: 12px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .wizard-steps { gap: 0; }
  .step-label { font-size: 0.65rem; }
}
