/* =========================================================
   ✅ 最终合并版 CSS（去重 + 不再留巨大空隙 + 自动高度占位）
   用法：
   1) 只保留这一份 CSS
   2) JS 里用 ResizeObserver/计算高度，把 --player-h 写成播放栏真实高度
   ========================================================= */

/* =========================
   基础 & 全局
   ========================= */
:root{
  /* JS 自动写入：播放栏真实高度（px），用于页面底部占位 */
  --player-h: 0px;

  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.12);
  --text: #222;
  --muted: #555;
  --brand: #FF6347;                /* 番茄红 */
  --card: rgba(255, 228, 181, 0.92);
  --card2: #f4e1c1;
}

html{ font-size:16px; }
*{ box-sizing:border-box; }

body{
  margin:0;
  padding:0;
  color: var(--text);
  min-height:100vh;
  overflow-x:hidden;
  overflow-y:auto;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  background-attachment:fixed;
  
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC","Microsoft YaHei", Arial;

}


/* =========================
   容器：底部占位（关键）
   ✅ 只用真实播放器高度占位，空隙不会大
   ========================= */
.container{
  width:100%;
  max-width:45rem; /* 750px */
  margin:0 auto;
  padding:2rem;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  justify-content:flex-start;

  /* ✅ 真正占位：播放器高度 + 安全区 + 一点点间距 */
  padding-bottom: calc(2rem + var(--player-h) + env(safe-area-inset-bottom) + 12px) !important;
}

/* 标题 */
h1{
  text-align:center;
  color: var(--brand);
  font-size: 3rem;
  margin: 0 0 2rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 2px 2px 5px rgba(0,0,0,.25);
}

/* =========================
   筛选区域
   ========================= */
.filter-container{
  display: flex;
  justify-content: flex-start; /* 靠左 */
  gap: 15px;
  margin-bottom: 20px;
}

.filter-container form{
  display:flex;
  gap:10px;
  justify-content:flex-start;
  flex-wrap:wrap;
  width:100%;
}
select{
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.18);
  background: rgba(255,255,255,.80);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
select:focus{
  border-color:#4CAF50;
  outline:none;
  box-shadow: 0 0 0 4px rgba(76,175,80,.15);
  transform: translateY(-1px);
}

/* =========================
   返回歌单按钮（已合并）
   ========================= */
.back{
  display:inline-flex;
  align-items:center;
  gap:6px;

  padding:10px 16px;
  border-radius:999px;

  font-size:14px;
  font-weight:900;
  text-decoration:none;
  white-space:nowrap;

  color:#111827;
  background: rgba(255,255,255,.85);
  border:1px solid rgba(0,0,0,.10);

  box-shadow:0 10px 24px rgba(0,0,0,.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  transition:
    transform .15s ease,
    box-shadow .15s ease,
    background-color .15s ease,
    color .15s ease;
}

.back:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.95);
  box-shadow:0 14px 32px rgba(0,0,0,.14);
}

.back:active{
  transform: translateY(0);
  box-shadow:0 8px 18px rgba(0,0,0,.12);
}

/* ✅ 在筛选区中自动靠右（和 select 同一行） */
.filter-container .back{
  margin-left:auto;
}

/* =========================
   歌曲卡片
   ========================= */
.song{
  background-color: var(--card2);
  padding: 1.25rem;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
  margin-bottom: 0.2rem;

  display:flex;
  align-items:center;
  gap: 1rem;
  overflow:hidden;
  cursor:pointer;

  transition: transform .18s ease, box-shadow .18s ease;
}
.song:hover{
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(0,0,0,.16);
}

/* 封面（列表里） */
.cover-image{
  width: 6.25rem;
  height: 6.25rem;
  object-fit:cover;
  border-radius: 12px;
  flex: 0 0 auto;
}

/* 文本区 */
.song-info{
  min-width:0;
  flex:1;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.song-info h2{
  margin:0;
  font-size: 1.35rem;
  font-weight: 900;
  color: #8B0000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-info p{
  margin:0;
  font-size: 1rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================
   详情按钮
   ========================= */
.btn{
  padding: 8px 16px;
  background-color: #8B4513;
  color:#fff;
  text-decoration:none;
  border-radius: 10px;
  display:inline-block;
  font-size: 1rem;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover{
  background-color:#A52A2A;
  transform: translateY(-1px);
}

/* =========================
   分页（不再被挡）
   ========================= */
.pagination{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  margin-top:20px;

  /* 不参与让位 */
  padding-bottom: 0;
  margin-bottom: 0;
}

.pagination a{
  padding:8px 16px;
  border:1px solid #ddd;
  border-radius:6px;
  text-decoration:none;
  color:#333;
  background:#f0f0f0;
  font-size:14px;
}
.pagination a:hover{ background:#e6e6e6; }
.pagination .prev-button,
.pagination .next-button{ font-weight:900; }
.pagination span{ font-size:14px; padding:0 6px; }

/* =========================
   顶部登录栏
   ========================= */
.topbar{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
  margin:10px 0 0;
}
.topbar .user-badge{
  font-size:13px;
  color:#1f2937;
  padding:7px 12px;
  background:rgba(255,255,255,.75);
  border:1px solid rgba(0,0,0,.06);
  border-radius:999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.topbar .login-btn,
.topbar .logout-btn{
  border:1px solid rgba(255,255,255,.15);
  cursor:pointer;
  font-size:13px;
  padding:8px 14px;
  border-radius:999px;
  background: linear-gradient(135deg,#111827,#0b1220);
  color:#fff;
  box-shadow:0 8px 20px rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.topbar .logout-btn{ background: linear-gradient(135deg,#6b7280,#374151); }
.topbar .login-btn:hover,
.topbar .logout-btn:hover{ transform: translateY(-1px); }
.topbar .login-btn:active,
.topbar .logout-btn:active{ transform: translateY(0); opacity:.95; }

/* =========================
   登录弹窗
   ========================= */
.login-modal-mask{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:9999;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(255,255,255,.25), transparent 55%),
    radial-gradient(900px 500px at 80% 90%, rgba(255,255,255,.18), transparent 60%),
    rgba(0,0,0,.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.login-modal-mask.show{ display:flex; }

.login-modal{
  width:100%;
  max-width:440px;
  border-radius:22px;
  overflow:hidden;
  box-shadow:0 25px 80px rgba(0,0,0,.35);
  transform: translateY(10px) scale(.98);
  opacity:.85;
  animation: loginPop .18s ease-out forwards;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
@keyframes loginPop{
  to{ transform: translateY(0) scale(1); opacity:1; }
}
.login-modal-header{
  position:relative;
  padding:16px 18px;
  color:#fff;
  background: linear-gradient(135deg,#111827,#4f46e5,#ec4899);
}
.login-modal-header h3{
  margin:0;
  font-size:16px;
  letter-spacing:.2px;
  font-weight:900;
}
.login-modal-subtitle{
  margin-top:6px;
  font-size:12px;
  opacity:.9;
  line-height:1.4;
}
.login-close{
  position:absolute;
  top:12px;
  right:12px;
  width:36px;
  height:36px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
  font-size:18px;
  line-height:34px;
  text-align:center;
  transition: transform .12s ease, background .12s ease;
}
.login-close:hover{ transform: scale(1.03); background: rgba(255,255,255,.18); }
.login-close:active{ transform: scale(.98); }

.login-modal-body{ padding:16px 18px 18px; }
.login-field{ margin-bottom:12px; }

.input-group{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.75);
  transition: box-shadow .15s ease, border-color .15s ease, transform .12s ease;
}
.input-group:focus-within{
  border-color: rgba(79,70,229,.55);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
  transform: translateY(-1px);
}
.input-icon{
  width:38px;
  height:38px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background: rgba(79,70,229,.10);
  color:#4f46e5;
  flex:0 0 auto;
}
.input-group input{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  font-size:14px;
  color:#111827;
}
.login-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
}
.login-submit{
  flex:1;
  border:none;
  cursor:pointer;
  font-size:14px;
  padding:11px 12px;
  border-radius:14px;
  color:#fff;
  background: linear-gradient(135deg,#111827,#4f46e5);
  box-shadow:0 12px 26px rgba(79,70,229,.22);
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}
.login-submit:hover{ transform: translateY(-1px); box-shadow:0 16px 34px rgba(79,70,229,.26); }
.login-submit:active{ transform: translateY(0); opacity:.95; }

.login-cancel{
  flex:1;
  border:1px solid rgba(0,0,0,.12);
  cursor:pointer;
  font-size:14px;
  padding:11px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.85);
  color:#111827;
  transition: transform .14s ease, opacity .14s ease, box-shadow .14s ease;
}
.login-cancel:hover{ transform: translateY(-1px); box-shadow:0 10px 24px rgba(0,0,0,.08); }
.login-cancel:active{ transform: translateY(0); opacity:.95; }

.login-error,
.login-success{
  margin-top:12px;
  font-size:13px;
  padding:10px 12px;
  border-radius:14px;
  display:none;
}
.login-error{
  color:#7f1d1d;
  background: rgba(239,68,68,.12);
  border:1px solid rgba(239,68,68,.22);
}
.login-success{
  color:#14532d;
  background: rgba(34,197,94,.12);
  border:1px solid rgba(34,197,94,.22);
}
.login-loading{ opacity:.75; pointer-events:none; }
@media (max-width:420px){
  .login-actions{ flex-direction:column; }
}

/* =========================
   通用按钮（播放器/列表共用）
   ========================= */
.pc-btn{
  border:1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.9);
  color:#111827;
  cursor:pointer;
  padding:10px 14px;
  border-radius:999px;
  font-weight:900;
  font-size:14px;
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
  box-shadow:0 10px 24px rgba(0,0,0,.08);
}
.pc-btn:hover{ transform: translateY(-1px); box-shadow:0 14px 30px rgba(0,0,0,.10); }
.pc-btn:active{ transform: translateY(0); opacity:.95; }
.pc-btn.primary{
  border:none;
  color:#fff;
  background: linear-gradient(135deg,#111827,#4f46e5);
  box-shadow:0 12px 26px rgba(79,70,229,.22);
}
.pc-btn.ghost{
  background: rgba(17,24,39,.06);
  border:1px solid rgba(17,24,39,.10);
}
.pc-btn.small{ padding:8px 12px; font-size:13px; }
.pc-btn.on{
  border:none;
  color:#fff;
  background: linear-gradient(135deg,#111827,#ec4899);
  box-shadow:0 12px 26px rgba(236,72,153,.18);
}

/* =========================
   播放列表面板（固定在播放栏上方）
   ========================= */
.playlist-panel{
  position:fixed;
  left:50%;
  transform: translateX(-50%);
  bottom: calc(var(--player-h) + env(safe-area-inset-bottom) + 10px);
  width: calc(100% - 24px);
  max-width:760px;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:0 18px 50px rgba(0,0,0,.12);
  display:none;
  z-index:9997;
}
.playlist-panel.show{ display:block; }
.playlist-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  background: linear-gradient(135deg,#111827,#4f46e5);
  color:#fff;
}
.playlist-title{ font-weight:900; font-size:14px; }
.playlist-body{ max-height:340px; overflow:auto; padding:8px; }

.playlist-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  border:1px solid transparent;
  transition: background .12s ease, transform .12s ease, border-color .12s ease;
}
.playlist-item:hover{ background: rgba(17,24,39,.06); transform: translateY(-1px); }
.playlist-item.active{ background: rgba(79,70,229,.12); border-color: rgba(79,70,229,.25); }
.playlist-item.disabled{ opacity:.55; cursor:not-allowed; }

.playlist-left{ min-width:0; }
.playlist-name{
  font-weight:900;
  font-size:14px;
  color:#111827;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.playlist-artist{
  font-size:12px;
  color:#6b7280;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.playlist-right{ font-size:12px; color:#6b7280; flex:0 0 auto; }

/* =========================
   底部播放栏（fixed + 高对比）
   ========================= */
.now-playing{
  z-index: 9998;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  background: rgba(17,24,39,.94);
  color: #fff;
  border-top: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 -10px 30px rgba(0,0,0,.35);
  padding-bottom: env(safe-area-inset-bottom);
  transition: transform .25s ease;
}
.now-playing{ pointer-events:none; }
.now-playing *{ pointer-events:auto; }



/* ✅ 你现在用 hidden/show 的 transform 方案：不要再用 display:none 版本 */
.now-playing.hidden{ transform: translateY(110%); }
.now-playing.show{ transform: translateY(0); }

.now-playing .top-info{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 14px;
}
.now-playing .cover-image{
  width:52px;
  height:52px;
  border-radius:10px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.2);
  box-shadow:0 8px 20px rgba(0,0,0,.45);
}
.now-playing .song-info{ min-width:0; }

/* ✅ 播放栏文字高对比 */
#now-playing-song-name{
  margin:0;
  font-size:15px;
  font-weight:900;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-shadow:0 1px 2px rgba(0,0,0,.4);
}
#now-playing-artist{
  margin:2px 0 0;
  font-size:13px;
  color: rgba(255,255,255,.85);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* 进度条 */
.progress-container{
  width:100%;
  height:6px;
  max-width:1050px; /* 750px */
  background: rgba(255,255,255,.15);
  cursor:pointer;
}
.progress-bar{
  height:100%;
  width:0;
  background: linear-gradient(90deg,#4f46e5,#ec4899);
}

/* 播放栏内控制按钮（嵌入底部栏） */
.player-controls.in-player{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-top:1px solid rgba(255,255,255,.10);
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.player-controls.in-player .left,
.player-controls.in-player .right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* 播放/暂停按钮更大一点 */
#playPauseBtn{
  min-width:56px;
  font-size:16px;
}

/* 深色底部栏里的按钮变深色风格 */
.now-playing .pc-btn{
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  color:#fff;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
}
.now-playing .pc-btn.primary{
  border:none;
  background: linear-gradient(135deg,#4f46e5,#ec4899);
}
.now-playing .pc-btn.ghost{
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
}

/* ===== SVG 图标按钮补丁（放在你现有 CSS 之后）===== */

/* 让按钮内容居中（不影响你原来的 padding/圆角/阴影） */
.pc-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 图标默认尺寸 */
.pc-btn .btn-icon{
  width: 22px;
  height: 22px;
  display: block;
}

/* 播放/暂停按钮更大一点：你原来 #playPauseBtn 有 min-width/字号，这里改成图标更大 */
#playPauseBtn .btn-icon{
  width: 26px;
  height: 26px;
}

/* 可选：如果你想 primary 按钮更“圆润”或更集中，可以保持 min-width */
#playPauseBtn{
  min-width: 56px; /* 你原来就有，保留 */
}

/* 可选：某些浏览器 img 默认会有基线空隙，这里彻底消掉 */
.pc-btn img{
  vertical-align: middle;
}



/* 折叠箭头（不 fixed，避免盖页面） */
.arrow-button{
  text-align:center;
  font-size:18px;
  padding:6px 0;
  color:#fff;
  opacity:.7;
  cursor:pointer;
  user-select:none;
}
.arrow-button:hover{ opacity:1; }

/* =========================
   动画：封面旋转（只保留一份）
   ========================= */
@keyframes rotateAnimation{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}
.rotate{ animation: rotateAnimation 2s linear infinite; }

/* =========================
   响应式
   ========================= */
@media (max-width: 768px){
  h1{ font-size:30px; }

  .container{
    padding:10px;
    background-color: rgba(255,255,255,.70);
  }

  .song{
    padding: 1rem;
    gap: 10px;
  }

  .cover-image{
    width:80px;
    height:80px;
  }

  .song-info h2{ font-size:16px; }
  .song-info p{ font-size:12px; }

  .btn{
    padding:6px 10px;
    font-size:12px;
  }
}

@media (max-width: 480px){
  .now-playing .top-info{ padding: 8px 10px; }
  .now-playing .cover-image{ width:46px; height:46px; }
  #now-playing-song-name{ font-size:14px; }
  #now-playing-artist{ font-size:12px; }
}
