.page-content {
  max-width: 1500px;
}

@media (max-width: 600px) {
  .page-content {
    width: calc(100% - 12px);
    padding-left: 12px;
    padding-right: 12px;
  }
}

.song-display-modes {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 10px;
}

.display-mode-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--radius-md);
  background: #fdf1f1;
  color: var(--color-sub);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}

.display-mode-icon-btn:hover {
  background: #f8dfe0;
  color: var(--color-base-deep);
}

.display-mode-icon-btn.active {
  background: var(--color-base);
  color: #ffffff;
}

.songbook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.songbook-header h1 {
  color: var(--color-base-deep);
  margin: 0;
}

.add-song-panel {
  margin-bottom: 20px;
}

.add-song-panel label {
  display: block;
  margin: 10px 0 4px;
  color: var(--color-sub);
  font-size: 0.9rem;
}

.add-song-panel input[type=text] {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-base);
  background: #ffffff;
  color: var(--color-text);
  font-family: 'Noto Sans KR', sans-serif;
}

.songbook-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.song-search-input {
  flex: 1;
  min-width: 200px;
  box-sizing: border-box;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-base);
  background: #ffffff;
  color: var(--color-text);
  font-family: 'Noto Sans KR', sans-serif;
}

.song-view-modes {
  display: flex;
  gap: 6px;
}

.view-mode-btn {
  font-size: 0.85rem;
  padding: 7px 14px;
}

.view-mode-btn.active {
  background: var(--color-base);
  color: #ffffff;
  border-color: var(--color-base-deep);
}

.song-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: #fdf1f1;
  border-radius: var(--radius-md);
}

.song-group-chip {
  font-size: 0.8rem;
  padding: 6px 14px;
}

.song-group-chip.active {
  background: var(--color-base);
  color: #ffffff;
  border-color: var(--color-base-deep);
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
  transition: opacity 0.15s ease-out;
}

/* Applied briefly by JS around a 카드/목록 view switch — see .song-list-view
   for the matching rule and setDisplayMode() in script.js for the sequencing. */
.song-grid.view-fade,
.song-list-view.view-fade {
  opacity: 0;
}

.song-card {
  background: #ffffff;
  border: 2px solid #f4e2e2;
  border-radius: var(--radius-md);
  padding: 10px;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}

.song-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(244, 168, 195, 0.18);
}

.song-cover-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  margin-bottom: 8px;
}

.song-cover-wrap.no-cover {
  display: flex;
  align-items: center;
  justify-content: center;
}

.song-cover-wrap.no-cover::after {
  content: '♪';
  font-size: 2rem;
  color: var(--color-sub-light);
}

.song-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.song-cover-wrap.no-cover .song-cover {
  display: none;
}

.song-title {
  font-size: 0.95rem;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-artist {
  font-size: 0.8rem;
  color: var(--color-sub-light);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.song-tag {
  background: #fdf1f1;
  color: var(--color-base-deep);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-size: 0.7rem;
}

.song-rating {
  font-size: 0.75rem;
}

@media (max-width: 600px) {
  .song-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .song-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
  }

  .song-card:hover {
    transform: none;
  }

  .song-cover-wrap,
  .song-cover-wrap.no-cover {
    display: none;
  }

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

  .song-tags {
    margin-bottom: 2px;
  }
}

/* ---------- Detail modal ---------- */

.song-detail-modal {
  max-width: 560px;
  width: 92%;
  position: relative;
}

.song-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--color-sub-light);
  font-size: 1rem;
  cursor: pointer;
}

.song-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.song-detail-header-text {
  flex: 1;
  min-width: 0;
}

.song-edit-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-base);
  background: #ffffff;
  color: var(--color-text);
  font-family: 'Noto Sans KR', sans-serif;
  margin-top: 4px;
}

.song-detail-header img {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--color-bg);
  flex-shrink: 0;
}

.song-detail-header h2 {
  margin: 0 0 4px;
  color: var(--color-text);
  font-weight: normal;
  font-size: 1.2rem;
}

.song-detail-artist {
  margin: 0;
  color: var(--color-sub-light);
}

.song-detail-info {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.song-detail-box {
  flex: 1;
  min-width: 100px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 12px;
}

.song-detail-box-split {
  display: flex;
  gap: 16px;
}

.song-detail-box-full {
  flex-basis: 100%;
  width: 100%;
}

.song-detail-label {
  font-size: 0.75rem;
  color: var(--color-sub-light);
  margin-bottom: 6px;
}

.song-detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.song-detail-rating {
  font-size: 0.9rem;
}

.song-copied-notice {
  margin-top: 14px;
  text-align: center;
  background: #fdf1f1;
  color: var(--color-base-deep);
  border-radius: var(--radius-md);
  padding: 8px;
  font-size: 0.85rem;
}

/* ---------- Pagination ---------- */

.song-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
  margin: 28px auto 0;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.page-btn {
  box-sizing: border-box;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 999px;
  border: none;
  outline: none;
  background: #ffffff;
  color: var(--color-sub);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}

.page-btn:hover:not(:disabled) {
  background: #fdf1f1;
  color: var(--color-base-deep);
}

.page-btn.active {
  background: var(--color-base);
  color: #ffffff;
  font-weight: bold;
}

.page-btn-arrow {
  background: transparent;
  color: var(--color-sub-light);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.page-ellipsis {
  color: var(--color-sub-light);
  padding: 0 4px;
}

.song-detail-memo {
  white-space: pre-wrap;
  color: var(--color-text);
  font-size: 0.9rem;
}

/* ---------- List (table) view ---------- */

.song-list-view {
  overflow-x: auto;
  background: #ffffff;
  border-radius: var(--radius-md);
  transition: opacity 0.15s ease-out;
  border: 1px solid #f4e2e2;
}

.song-list-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 560px;
}

.song-list-table th:nth-child(1),
.song-list-table td:nth-child(1) {
  width: 20%;
}

.song-list-table th:nth-child(2),
.song-list-table td:nth-child(2) {
  width: 38%;
}

.song-list-table th:nth-child(3),
.song-list-table td:nth-child(3) {
  width: 10%;
}

.song-list-table th:nth-child(4),
.song-list-table td:nth-child(4) {
  width: 12%;
}

.song-list-table th:nth-child(5),
.song-list-table td:nth-child(5) {
  width: 20%;
}

.song-list-table th {
  background: #fdf1f1;
  color: var(--color-base-deep);
  text-align: left;
  padding: 12px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.song-list-table th:nth-child(3),
.song-list-table th:nth-child(4) {
  text-align: center;
}

.song-list-row {
  cursor: pointer;
  transition: background .12s ease;
}

.song-list-row:hover {
  background: #fdf1f1;
}

.song-list-row td {
  padding: 12px 14px;
  border-top: 1px solid #f4e2e2;
  font-size: 0.9rem;
  color: var(--color-text);
}

.song-list-artist {
  color: var(--color-base-deep);
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-list-rating {
  text-align: center;
  white-space: nowrap;
  color: #e0a83c;
}

.song-list-memo {
  color: var(--color-sub-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
