* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f7f5;
  color: #2b2b2b;
  font-family: "Pretendard", "Noto Sans KR", system-ui, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #777;
  font-size: 14px;
}

h1 {
  margin: 0;
  font-size: 36px;
}

.header-desc {
  margin: 10px 0 0;
  color: #666;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.primary-btn {
  background: #2f6df6;
  color: #fff;
}

.primary-btn:hover {
  background: #245bd0;
}

.secondary-btn {
  background: #ededeb;
  color: #333;
}

.secondary-btn:hover {
  background: #e2e2df;
}

.ghost-btn {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.ghost-btn:hover {
  background: #f3f3f1;
}

.admin-link {
  color: #777;
  text-decoration: none;
  font-size: 14px;
}

.admin-link:hover {
  color: #2f6df6;
}

/* ==============================
   검색 / 필터 / 정렬
============================== */

.filter-card {
  background: #fff;
  border: 1px solid #e6e6e3;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.035);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr 0.9fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-field label {
  font-size: 13px;
  color: #666;
  font-weight: 600;
}

.filter-field input,
.filter-field select {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  background: white;
  color: #333;
}

.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47,109,246,0.12);
}

.filter-reset-btn {
  height: 42px;
}

/* ==============================
   일반 노래 리스트
============================== */

.list-card {
  background: #fff;
  border: 1px solid #e6e6e3;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.list-head,
.song-row {
  display: grid;
  grid-template-columns: 70px 1.5fr 1.2fr 0.8fr 0.9fr 0.9fr 120px;
  align-items: center;
  gap: 12px;
}

.list-head {
  padding: 14px 18px;
  background: #fbfbfa;
  border-bottom: 1px solid #e8e8e5;
  color: #777;
  font-size: 13px;
  font-weight: 600;
}

.song-row {
  padding: 14px 18px;
  border-bottom: 1px solid #eeeeeb;
}

.song-row:last-child {
  border-bottom: 0;
}

.empty-row {
  grid-template-columns: 1fr;
}

.song-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
}

.song-title {
  font-weight: 700;
}

.song-meta {
  color: #666;
  font-size: 14px;
}

.copy-btn {
  border: 1px solid #ddd;
  background: white;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}

.copy-btn:hover {
  background: #f3f3f1;
}

/* ==============================
   토스트 메시지
============================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: #222;
  color: white;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==============================
   팝업
============================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 3000;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0;
  font-size: 26px;
}

.close-btn {
  border: 0;
  background: #f1f1ef;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.close-btn:hover {
  background: #e6e6e3;
}

.request-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.request-panel {
  border: 1px solid #e6e6e3;
  border-radius: 18px;
  padding: 18px;
  background: #fbfbfa;
}

.request-panel h3 {
  margin: 0 0 8px;
}

.panel-desc {
  color: #777;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 13px;
}

.field label {
  font-size: 13px;
  color: #666;
  font-weight: 600;
}

.field label b {
  color: #2f6df6;
}

.field input {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  background: white;
}

.field input:focus {
  outline: none;
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47,109,246,0.12);
}

.full-btn {
  width: 100%;
  margin-top: 6px;
}

.empty-text {
  color: #999;
  font-size: 14px;
}

.auto-result-list {
  margin-top: 16px;
}

.youtube-result-card {
  grid-template-columns: 72px 1fr 90px;
  margin-bottom: 10px;
  padding: 12px;
}

.youtube-result-thumb {
  width: 72px;
  height: 72px;
}

.youtube-result-title {
  font-size: 15px;
}

/* ==============================
   관리자 페이지
============================== */

.hidden {
  display: none !important;
}

.admin-login-card {
  background: #fff;
  border: 1px solid #e6e6e3;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.admin-login-card h2 {
  margin: 0 0 10px;
}

.admin-login-card p {
  margin: 0 0 18px;
  color: #666;
}

.admin-login-form {
  display: flex;
  gap: 10px;
}

.admin-login-form input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
}

.admin-login-form input:focus {
  outline: none;
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47,109,246,0.12);
}

.admin-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-section-head h2 {
  margin: 0 0 8px;
}

.admin-section-head p {
  margin: 0;
  color: #666;
}

.admin-request-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-empty {
  background: #fff;
  border: 1px solid #e6e6e3;
  border-radius: 18px;
  padding: 24px;
  color: #777;
  text-align: center;
}

.request-card {
  display: grid;
  grid-template-columns: 84px 1fr 140px;
  gap: 18px;
  background: #fff;
  border: 1px solid #e6e6e3;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.request-thumb {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  object-fit: cover;
  background: #eee;
}

.request-info {
  min-width: 0;
}

.request-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.request-title-row h3 {
  margin: 0;
  font-size: 20px;
}

.request-badge {
  background: #eef3ff;
  color: #2f6df6;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
}

.request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #666;
  font-size: 14px;
  margin-bottom: 10px;
}

.request-meta b,
.request-link b {
  color: #333;
  margin-right: 5px;
}

.request-link {
  font-size: 14px;
  word-break: break-all;
}

.request-link a {
  color: #2f6df6;
  text-decoration: none;
}

.request-link a:hover {
  text-decoration: underline;
}

.request-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.approve-btn,
.reject-btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.approve-btn {
  background: #2f6df6;
  color: #fff;
}

.reject-btn {
  background: #f1f1ef;
  color: #555;
}

.approve-btn:hover {
  background: #245bd0;
}

.reject-btn:hover {
  background: #e4e4e1;
}

/* ==============================
   관리자 노래 수정 / 삭제 목록
============================== */

.admin-divider {
  height: 1px;
  background: #e6e6e3;
  margin: 8px 0;
}

.admin-song-edit-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-song-card {
  display: grid;
  grid-template-columns: 64px 1fr 100px;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #e6e6e3;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.035);
}

.edit-song-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #eee;
}

.edit-song-info {
  min-width: 0;
}

.edit-song-info h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.edit-song-info p {
  margin: 0 0 8px;
  color: #666;
  font-size: 14px;
}

.edit-song-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.edit-song-meta span {
  background: #f1f1ef;
  color: #666;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.edit-song-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-song-btn {
  width: 100%;
}

.delete-song-btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  background: #ffecec;
  color: #d33;
}

.delete-song-btn:hover {
  background: #ffdede;
}

/* ==============================
   모바일 반응형
============================== */

@media (max-width: 850px) {
  .page {
    width: min(100% - 28px, 1180px);
    padding: 32px 0;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-reset-btn {
    width: 100%;
  }

  .list-head {
    display: none;
  }

  .song-row {
    grid-template-columns: 58px 1fr;
    align-items: flex-start;
  }

  .song-thumb {
    grid-column: 1;
    grid-row: 1 / span 6;
  }

  .song-row > div,
  .song-row > span,
  .song-row > button {
    grid-column: 2;
  }

  .empty-row {
    grid-template-columns: 1fr;
  }

  .copy-btn {
    width: fit-content;
  }

  .request-split {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 18px;
  }

  .youtube-result-card {
    grid-template-columns: 56px 1fr;
  }

  .youtube-result-thumb {
    width: 56px;
    height: 56px;
  }

  .youtube-result-card .request-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .admin-login-form {
    flex-direction: column;
  }

  .admin-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .request-card {
    grid-template-columns: 72px 1fr;
  }

  .request-thumb {
    width: 72px;
    height: 72px;
  }

  .request-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .approve-btn,
  .reject-btn {
    flex: 1;
  }

  .edit-song-card {
    grid-template-columns: 56px 1fr;
  }

  .edit-song-thumb {
    width: 56px;
    height: 56px;
  }

  .edit-song-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .edit-song-actions .edit-song-btn,
  .edit-song-actions .delete-song-btn {
    flex: 1;
  }
}