:root {
  --bg: #101318;
  --panel: #171b21;
  --panel-soft: #1d222a;
  --text: #f5f7fa;
  --muted: #929ba8;
  --line: #2a3039;
  --accent: #20d36b;
  --accent-soft: rgba(32, 211, 107, .14);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(49, 62, 75, .34), transparent 35%),
    var(--bg);
}
button, input { font: inherit; }
button { cursor: pointer; }

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}
.brand-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}
.page-header h1 { margin: 5px 0 0; font-size: 24px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 48vw);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
}
.search-box:focus-within { border-color: #5c6674; }
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}
.search-box input::placeholder { color: #707986; }


.albums-section {
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(23, 27, 33, .78);
}
.albums-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:16px; }
.albums-heading h2 { margin:5px 0 0; font-size:22px; }
.albums-heading p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.albums-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:16px; }
.album-state { grid-column:1/-1; }
.album-card { min-width:0; padding:0; border:0; background:transparent; color:inherit; text-align:left; }
.album-card-cover, .album-cover-fallback { width:100%; aspect-ratio:1; border-radius:16px; object-fit:cover; background:linear-gradient(145deg,#2b333d,#1a1f26); }
.album-cover-fallback { display:grid; place-items:center; color:#89939f; font-size:42px; }
.album-card-cover-wrap { display:block; position:relative; overflow:hidden; border-radius:16px; border:1px solid var(--line); background:#20262e; transition:transform .16s ease,border-color .16s ease; }
.album-card:hover .album-card-cover-wrap { transform:translateY(-3px); border-color:#48515d; }
.album-card-title { margin-top:10px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-weight:750; }
.album-card-meta { margin-top:4px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:var(--muted); font-size:12px; }
.album-modal .album-backdrop { background:rgba(5,8,12,.82); backdrop-filter:blur(18px); }
.album-detail-dialog {
  width:min(1080px,calc(100vw - 36px));
  max-height:min(88vh,860px);
  overflow:hidden;
  padding:0;
  border:1px solid rgba(255,255,255,.12);
  border-radius:28px;
  background:linear-gradient(145deg,rgba(25,31,39,.98),rgba(14,18,24,.98));
  box-shadow:0 30px 90px rgba(0,0,0,.5);
}
.album-close { z-index:5; top:18px; right:18px; background:rgba(255,255,255,.06); }
.album-detail-layout { display:grid; grid-template-columns:minmax(320px,.9fr) minmax(390px,1.1fr); min-height:610px; }
.album-hero-panel { padding:48px 42px 34px; border-right:1px solid rgba(255,255,255,.08); background:radial-gradient(circle at 30% 20%,rgba(38,208,124,.11),transparent 38%); }
.album-detail-cover { width:min(100%,360px); aspect-ratio:1; overflow:hidden; border-radius:22px; box-shadow:0 22px 55px rgba(0,0,0,.35); }
.album-detail-cover img { width:100%; height:100%; object-fit:cover; border-radius:22px; }
.album-player-copy { margin-top:26px; }
.album-player-copy h3 { margin:7px 0 4px; font-size:25px; line-height:1.2; }
.album-player-copy p { margin:0; color:var(--muted); }
.album-player-progress { margin-top:24px; }
.album-player-time-row { display:flex; justify-content:space-between; margin-bottom:7px; color:#8e98a6; font-size:12px; }
.album-player-progress input { width:100%; accent-color:#2fd884; }
.album-player-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; }
.album-control-button,.album-play-button { border:0; color:#e8edf2; background:transparent; cursor:pointer; }
.album-control-button { width:44px; height:44px; border-radius:50%; font-size:18px; }
.album-control-button:hover { background:rgba(255,255,255,.06); }
.album-play-button { width:70px; height:70px; border-radius:50%; display:grid; place-items:center; font-size:25px; background:linear-gradient(145deg,#35e28d,#19b96c); color:#07130d; box-shadow:0 12px 30px rgba(32,210,124,.25); }
.album-play-button.amplitude-playing .album-play-icon::before { content:'Ⅱ'; }
.album-play-button.amplitude-playing .album-play-icon { font-size:0; }
.album-play-button.amplitude-playing .album-play-icon::before { font-size:25px; }
.album-content-panel { min-width:0; padding:48px 38px 34px; overflow:auto; }
.album-detail-head { margin:0 0 26px; padding-right:48px; }
.album-detail-copy h2 { margin:6px 0 0; font-size:34px; letter-spacing:-.02em; }
.album-detail-artist { margin:7px 0 0; color:#cbd2da; font-size:17px; }
.album-meta-line { margin-top:13px; }
.album-detail-description { margin:14px 0 0; color:var(--muted); line-height:1.6; }
.album-track-heading { display:grid; grid-template-columns:1fr auto; gap:16px; padding:0 14px 10px; border-bottom:1px solid rgba(255,255,255,.08); color:#7f8996; font-size:12px; }
.album-detail-songs { display:grid; gap:8px; margin-top:10px; }
.album-detail-song { display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:12px; width:100%; padding:13px 14px; border:1px solid transparent; border-radius:14px; background:transparent; color:inherit; text-align:left; transition:background .16s ease,border-color .16s ease,transform .16s ease; }
.album-detail-song:hover { background:rgba(255,255,255,.045); transform:translateX(2px); }
.album-detail-song.album-song-active { background:linear-gradient(90deg,rgba(33,211,126,.14),rgba(33,211,126,.035)); border-color:rgba(33,211,126,.16); }
.album-track-number { color:#7f8996; text-align:center; font-variant-numeric:tabular-nums; }
.album-detail-song.album-song-active .album-track-number,.album-detail-song.album-song-active .song-title { color:#35db89; }
.album-detail-song .song-duration { color:#89939f; font-variant-numeric:tabular-nums; }
@media(max-width:760px){
  .albums-section{padding:16px}.albums-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
  .album-detail-dialog{width:min(100vw - 16px,620px);max-height:92vh;border-radius:22px;overflow:auto}
  .album-detail-layout{display:block;min-height:0}
  .album-hero-panel{padding:28px 20px 24px;border-right:0;border-bottom:1px solid rgba(255,255,255,.08)}
  .album-detail-cover{width:min(72vw,290px);margin:0 auto}
  .album-player-copy{text-align:center;margin-top:18px}.album-player-copy h3{font-size:22px}
  .album-player-controls{max-width:360px;margin:20px auto 0}.album-play-button{width:62px;height:62px}
  .album-content-panel{padding:26px 16px 24px;overflow:visible}.album-detail-head{padding-right:32px;margin-bottom:18px}
  .album-detail-copy h2{font-size:27px}.album-detail-description{display:block;font-size:13px}
  .album-detail-song{grid-template-columns:30px minmax(0,1fr) auto;padding:12px 10px}.album-track-heading{padding-left:10px;padding-right:10px}
}


.music-layout {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(360px, 1.22fr);
  gap: 20px;
  align-items: stretch;
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(23, 27, 33, .94);
}
.song-panel { padding: 18px; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.panel-heading h2 { margin: 0; font-size: 20px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.count-chip {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}
.song-list { display: grid; gap: 8px; }
.song-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 64px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background .16s ease, border-color .16s ease;
}
.song-row:hover { background: var(--panel-soft); }
.song-row.active {
  border-color: rgba(32, 211, 107, .25);
  background: var(--accent-soft);
}
.song-cover, .song-cover-fallback {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}
.song-cover-fallback {
  display: grid;
  place-items: center;
  background: #252b34;
  color: #858e9a;
  font-size: 20px;
}
.song-info { min-width: 0; }
.song-title {
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.song-artist {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.song-duration { color: var(--muted); font-size: 12px; }
.state-card { padding: 34px 12px; color: var(--muted); text-align: center; }

.now-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 28px 22px;
  text-align: center;
}
.cover-stage {
  position: relative;
  width: min(250px, 58%);
  aspect-ratio: 1;
  margin: 0 auto 17px;
  overflow: hidden;
  border-radius: 20px;
  background: #20262e;
}
.now-cover, .cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-fallback {
  display: grid;
  place-items: center;
  color: #9aa3ae;
  font-size: 70px;
  background: linear-gradient(145deg, #2b333d, #1a1f26);
}
.now-copy h2 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(21px, 3vw, 28px);
}
.now-copy p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.lyrics {
  width: 100%;
  max-width: 620px;
  height: 165px;
  margin-top: 18px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #343b46 transparent;
}
.lyric-line {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #69727e;
  line-height: 1.45;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.lyric-line:hover { color: #b8c0ca; }
.lyric-line.active {
  color: var(--text);
  background: var(--accent-soft);
  font-size: 17px;
  font-weight: 750;
}
.muted { color: var(--muted); }

.player-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(340px, 1.6fr) minmax(150px, .7fr);
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(23, 27, 33, .96);
}
.player-song {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.mini-cover-wrap { width: 46px; height: 46px; flex: 0 0 46px; }
.mini-cover {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  object-fit: cover;
}
.mini-cover.fallback {
  display: grid;
  place-items: center;
  background: #262c34;
  color: #8c95a1;
  font-size: 20px;
}
.player-copy { min-width: 0; }
.player-copy strong,
.player-copy span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.player-copy strong { font-size: 14px; }
.player-copy span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.player-center { min-width: 0; }
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.round-btn, .play-btn, .volume-btn {
  border: 1px solid var(--line);
  color: #d8dee6;
  background: transparent;
}
.round-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.play-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #07150c;
  font-weight: 900;
}
.round-btn:hover, .volume-btn:hover { background: #222832; }
.pause-icon, .amplitude-playing .play-icon { display: none; }
.amplitude-playing .pause-icon { display: inline; }
.amplitude-shuffle-on, .amplitude-repeat-on {
  border-color: rgba(32, 211, 107, .6) !important;
  color: var(--accent) !important;
}
.progress-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.progress-row input, .volume-row input { width: 100%; min-width: 0; }
input[type="range"] { accent-color: var(--accent); }
.volume-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.volume-btn { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; }
.amplitude-muted { opacity: .5; }
.status-text {
  position: absolute;
  right: 18px;
  bottom: 3px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 900px) {
  .page-shell { width: min(100% - 24px, 760px); }
  .music-layout { grid-template-columns: 1fr; }
  .song-panel { order: 2; }
  .now-panel { order: 1; }
  .cover-stage { width: min(230px, 54%); }
  .player-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .player-center { grid-column: 2; }
  .progress-row, .volume-row { display: none; }
  .status-text { display: none; }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 20px, 640px); padding-top: 16px; }
  .page-header { align-items: stretch; flex-direction: column; gap: 12px; }
  .search-box { width: 100%; }
  .now-panel { padding: 20px 16px; }
  .cover-stage { width: min(210px, 65%); }
  .lyrics { height: 150px; }
  .player-bar { gap: 10px; padding: 12px; }
  .round-btn { width: 38px; height: 38px; }
  .play-btn { width: 44px; height: 44px; }
  .controls { gap: 5px; }
  .controls .amplitude-shuffle,
  .controls .amplitude-repeat { display: none; }
  .mini-cover-wrap { width: 42px; height: 42px; flex-basis: 42px; }
  .player-copy strong { max-width: 130px; }
  .player-copy span { max-width: 130px; }
}

@media (max-width: 420px) {
  .song-row { grid-template-columns: 44px minmax(0, 1fr); }
  .song-duration { display: none; }
  .player-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .player-copy strong { max-width: 105px; }
  .player-copy span { max-width: 105px; }
}
/* =========================================================
   Melody Music - User Account / Login / Register UI
   ========================================================= */

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-button {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel);
  font-weight: 700;
  white-space: nowrap;
  transition:
    background .16s ease,
    border-color .16s ease,
    transform .16s ease;
}

.account-button:hover {
  border-color: #48515d;
  background: var(--panel-soft);
}

.account-button:active {
  transform: scale(.97);
}

.account-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #07150c;
}

.account-button.primary:hover {
  background: #2cde78;
}


/* =========================================================
   Logged-in User
   ========================================================= */

.user-area {
  position: relative;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel);
}

.user-menu-button:hover {
  border-color: #48515d;
  background: var(--panel-soft);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #07150c;
  font-weight: 900;
}

.user-name {
  max-width: 130px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-arrow {
  color: var(--muted);
  font-size: 11px;
}

.user-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  right: 0;
  width: 190px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #1b2027;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .38);
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  color: #e7ebf0;
  background: transparent;
  text-align: left;
  font-size: 13px;
}

.user-menu-item:hover {
  background: #262c34;
}

.user-menu-item.danger {
  color: #ff8b8b;
}

.user-menu-divider {
  height: 1px;
  margin: 6px 3px;
  background: var(--line);
}


/* =========================================================
   Auth Modal
   ========================================================= */

.auth-modal {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-modal[hidden] {
  display: none;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 8, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-dialog {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid #303741;
  border-radius: 24px;
  background:
    radial-gradient(
      circle at 50% -15%,
      rgba(32, 211, 107, .12),
      transparent 35%
    ),
    #171b21;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #aab2bd;
  background: transparent;
  font-size: 25px;
  line-height: 1;
}

.auth-close:hover {
  color: var(--text);
  background: #252b33;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
}

.auth-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 15px;
  color: #07150c;
  background: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.auth-brand-name {
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}

.auth-brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}


/* =========================================================
   Auth Forms
   ========================================================= */

.auth-form h2 {
  margin: 0;
  font-size: 25px;
}

.auth-description {
  margin: 7px 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
}

.auth-field > span {
  color: #c7cdd5;
  font-size: 12px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--text);
  background: #11151a;
  transition:
    border-color .16s ease,
    box-shadow .16s ease;
}

.auth-field input::placeholder {
  color: #626b77;
}

.auth-field input:focus {
  border-color: rgba(32, 211, 107, .75);
  box-shadow: 0 0 0 3px rgba(32, 211, 107, .1);
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: 12px;
  color: #06150b;
  background: var(--accent);
  font-weight: 850;
}

.auth-submit:hover {
  background: #2cde78;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: .6;
}

.auth-message {
  min-height: 20px;
  margin: 3px 0 8px;
  color: #ff9696;
  font-size: 12px;
  line-height: 1.45;
}

.auth-message.success {
  color: var(--accent);
}

.auth-switch-text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-link-button {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 750;
}

.auth-link-button:hover {
  text-decoration: underline;
}


/* =========================================================
   Responsive Account UI
   ========================================================= */

@media (max-width: 900px) {
  .header-actions {
    flex: 1;
  }

  .search-box {
    flex: 1;
    width: auto;
  }
}

@media (max-width: 760px) {
  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .search-box {
    width: 100%;
    flex-basis: 100%;
  }

  .account-actions {
    margin-left: auto;
  }

  .user-area {
    margin-left: auto;
  }

  .auth-dialog {
    padding: 25px 20px 22px;
    border-radius: 20px;
  }
}

@media (max-width: 420px) {
  .account-button {
    min-height: 38px;
    padding: 7px 13px;
    font-size: 13px;
  }

  .user-name {
    max-width: 90px;
  }

  .auth-modal {
    padding: 12px;
  }

  .auth-dialog {
    max-height: calc(100vh - 24px);
    padding: 22px 17px 19px;
  }

  .auth-brand {
    padding-right: 32px;
  }
}
/* =========================================================
   Playlist UI
   ========================================================= */

.playlist-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.add-playlist-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.playlist-header {
  margin-bottom: 20px;
  padding-right: 36px;
}

.playlist-header h2 {
  margin: 4px 0 6px;
  font-size: 26px;
  line-height: 1.2;
}

.playlist-header p {
  margin: 0;
  color: #8e98a4;
  font-size: 14px;
}

.create-playlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 10px;
}

.create-playlist-form input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  outline: none;
  color: #f3f6f8;
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.create-playlist-form input::placeholder {
  color: #6f7882;
}

.create-playlist-form input:focus {
  border-color: rgba(89, 214, 158, 0.6);
  background: rgba(255, 255, 255, 0.075);
  box-shadow:
    0 0 0 3px rgba(89, 214, 158, 0.10);
}

#createPlaylistButton {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: #07140e;
  background: #62dda3;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.16s ease,
    opacity 0.16s ease;
}

#createPlaylistButton:hover {
  transform: translateY(-1px);
}

#createPlaylistButton:active {
  transform: translateY(0);
}

#createPlaylistButton:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.playlist-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 100px;
  max-height: 440px;
  margin-top: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.playlist-list::-webkit-scrollbar {
  width: 8px;
}

.playlist-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.playlist-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.playlist-item:hover {
  border-color: rgba(98, 221, 163, 0.20);
  background: rgba(255, 255, 255, 0.055);
}

.playlist-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  color: #79e7b1;
  background: rgba(98, 221, 163, 0.11);
  font-size: 20px;
}

.playlist-item-copy {
  min-width: 0;
}

.playlist-item-name {
  display: block;
  margin-bottom: 3px;
  overflow: hidden;
  color: #f4f7f9;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-item-meta {
  display: block;
  color: #808a95;
  font-size: 12px;
}

.playlist-item-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.playlist-open-button,
.playlist-add-button,
.playlist-delete-button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    opacity 0.16s ease;
}

.playlist-open-button,
.playlist-add-button {
  border: 1px solid rgba(98, 221, 163, 0.2);
  color: #87e9b9;
  background: rgba(98, 221, 163, 0.08);
}

.playlist-open-button:hover,
.playlist-add-button:hover {
  border-color: rgba(98, 221, 163, 0.38);
  background: rgba(98, 221, 163, 0.14);
}

.playlist-delete-button {
  border: 1px solid rgba(255, 105, 125, 0.17);
  color: #f58b9a;
  background: rgba(255, 105, 125, 0.06);
}

.playlist-delete-button:hover {
  border-color: rgba(255, 105, 125, 0.35);
  background: rgba(255, 105, 125, 0.11);
}

.playlist-open-button:disabled,
.playlist-add-button:disabled,
.playlist-delete-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.playlist-secondary-button {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  border: 1px dashed rgba(98, 221, 163, 0.3);
  border-radius: 12px;
  color: #8feabf;
  background: rgba(98, 221, 163, 0.055);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}

.playlist-secondary-button:hover {
  border-color: rgba(98, 221, 163, 0.5);
  background: rgba(98, 221, 163, 0.10);
}

.playlist-empty {
  padding: 28px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  text-align: center;
}

.playlist-empty-icon {
  display: block;
  margin-bottom: 8px;
  color: #6edfab;
  font-size: 28px;
}

.playlist-empty strong {
  display: block;
  margin-bottom: 5px;
  color: #edf2f5;
}

.playlist-empty span {
  color: #7e8993;
  font-size: 13px;
}

/* =========================================================
   Add song to playlist button
   ========================================================= */

.add-to-playlist-btn {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 48px;
  width: 34px;
  height: 34px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: #85909a;
  background: transparent;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.add-to-playlist-btn:hover {
  color: #75dfae;
  background: rgba(98, 221, 163, 0.09);
}

.add-to-playlist-btn:active {
  transform:
    translateY(-50%)
    scale(0.9);
}

.add-to-playlist-btn:disabled {
  cursor: wait;
  opacity: 0.5;
}

/*
 * 现在歌曲行右侧会同时放：
 * ＋ 添加歌单
 * ♥ 收藏
 */

.song-row-wrap .song-row {
  padding-right: 88px;
}

/* =========================================================
   Selected playlist / song list
   ========================================================= */

.playlist-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.playlist-detail-title {
  min-width: 0;
}

.playlist-detail-title h3 {
  margin: 0 0 4px;
  overflow: hidden;
  color: #f2f5f7;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-detail-title p {
  margin: 0;
  color: #808a95;
  font-size: 13px;
}

.playlist-back-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  color: #c9d0d6;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.playlist-song-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.playlist-song-item:last-child {
  border-bottom: 0;
}

.playlist-song-copy {
  min-width: 0;
}

.playlist-song-copy strong {
  display: block;
  overflow: hidden;
  color: #eef2f5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-song-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #7e8993;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-remove-song-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #e98593;
  background: rgba(255, 100, 125, 0.06);
  font-size: 18px;
  cursor: pointer;
}

.playlist-remove-song-button:hover {
  background: rgba(255, 100, 125, 0.12);
}

/* =========================================================
   Responsive playlist UI
   ========================================================= */

@media (max-width: 620px) {
  .playlist-dialog,
  .add-playlist-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .create-playlist-form {
    grid-template-columns: 1fr;
  }

  #createPlaylistButton {
    width: 100%;
  }

  .playlist-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .playlist-icon {
    width: 40px;
    height: 40px;
  }

  .playlist-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .song-row-wrap .song-row {
    padding-right: 84px;
  }

  .add-to-playlist-btn {
    right: 44px;
  }
}

@media (max-width: 420px) {
  .playlist-header h2 {
    font-size: 23px;
  }

  .playlist-list {
    max-height: 390px;
  }

  .playlist-open-button,
  .playlist-add-button,
  .playlist-delete-button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }
}

/* Desktop-only album dialog sizing fix.
   Keep the existing mobile album layout unchanged. */
@media (min-width: 761px) {
  .album-modal .album-detail-dialog {
    width: min(1080px, calc(100vw - 36px));
    max-height: min(88vh, 860px);
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(25,31,39,.98), rgba(14,18,24,.98));
    box-shadow: 0 30px 90px rgba(0,0,0,.5);
  }
}
