/* 拾音盘 H5 · 全局样式（对齐小程序 750rpx 设计稿，1rem = 100rpx） */
:root {
  --gold: #FCA311;
  --gold-2: #E8920C;
  --gold-deep: #FFD700;
  --bg: #0F101A;
  --panel: #1D1E2C;
  --panel-2: #161722;
  --line: #2A2B3D;
  --text: #FFFFFF;
  --muted: #888;
  --dim: #666;
  --shell-w: 480px;
  --tab-h: 1rem;
  --player-h: 3.06rem;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html {
  font-size: calc(min(100vw, 480px) / 7.5);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: #07080d;
  color: var(--text);
  font-size: .28rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.4;
  overscroll-behavior-y: contain;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: inherit; }
img { display: block; }
::-webkit-scrollbar { width: 0; height: 0; }

#app {
  width: 100%;
  max-width: var(--shell-w);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
#view { min-height: 100vh; }

/* 通用文本/卡片/按钮 */
.gold-text { color: var(--gold); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ellipsis-2 {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.card {
  background: linear-gradient(145deg, #1D1E2C, #161722);
  border-radius: .2rem;
  padding: .24rem;
  margin-bottom: .2rem;
  box-shadow: 0 .04rem .2rem rgba(0, 0, 0, .3);
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--bg);
  border: none;
  border-radius: .5rem;
  font-weight: bold;
  font-size: .3rem;
  padding: .18rem .4rem;
  cursor: pointer;
}
.btn-primary:disabled { opacity: .45; }
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: .02rem solid var(--gold);
  border-radius: .5rem;
  font-size: .28rem;
  padding: .14rem .34rem;
}
.required { color: #ff4444; }

/* 通用导航条 */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 .3rem;
  height: .88rem;
  padding-top: env(safe-area-inset-top);
}
.nav-content { display: flex; align-items: center; justify-content: space-between; width: 100%; height: .88rem; }
.back-btn {
  width: .6rem; height: .6rem; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.back-icon { font-size: .4rem; color: #fff; line-height: 1; margin-top: -.04rem; }
.nav-title { font-size: .34rem; color: #fff; font-weight: bold; }
.nav-placeholder { width: .6rem; height: .6rem; }

/* 浮动个人中心 */
.float-profile {
  position: absolute;
  top: .28rem; right: .2rem;
  z-index: 50;
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
}
.float-avatar {
  width: .9rem; height: .9rem; border-radius: 50%;
  border: .04rem solid var(--gold);
  box-shadow: 0 .04rem .16rem rgba(0, 0, 0, .6);
  object-fit: cover;
}
.float-avatar.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: #2a2b3c; font-size: .44rem;
}
.float-profile-text {
  font-size: .24rem; color: var(--gold); margin-top: .08rem; font-weight: bold;
  text-shadow: 0 .02rem .04rem rgba(0, 0, 0, .8);
}

/* 页面底部留白（避开 TabBar / 播放器） */
.page { min-height: 100vh; padding-bottom: calc(var(--tab-h) + .2rem); }
body.has-player .page { padding-bottom: calc(var(--tab-h) + var(--player-h)); }
body.no-tab .page { padding-bottom: .4rem; }
body.no-tab.has-player .page { padding-bottom: var(--player-h); }
body.no-tab .tabbar { display: none; }

/* ============ 底部 TabBar ============ */
.tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: var(--shell-w);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--panel);
  border-top: .01rem solid rgba(255, 255, 255, .06);
  display: flex;
  z-index: 900;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .04rem; color: #8a8b9a;
}
.tab-icon { font-size: .4rem; line-height: 1; filter: grayscale(1); opacity: .7; }
.tab-text { font-size: .22rem; }
.tab-item.active { color: var(--gold); }
.tab-item.active .tab-icon { filter: none; opacity: 1; }

/* ============ 全局播放器 ============ */
.global-player {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: var(--shell-w);
  z-index: 950;
  padding: 0 .16rem calc(env(safe-area-inset-bottom));
  background: #15161F;
  border-radius: .16rem .16rem 0 0;
}
body:not(.no-tab) .global-player { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
.player-info-bar {
  display: flex; align-items: center;
  background: linear-gradient(145deg, #1A1B28, #15161F);
  padding: .1rem .2rem .14rem;
  border-radius: .16rem .16rem 0 0;
  border-top: .02rem solid rgba(252, 163, 17, .3);
  box-shadow: 0 -.04rem .2rem rgba(0, 0, 0, .6);
}
.player-cover-small {
  width: .6rem; height: .6rem; border-radius: .08rem; flex-shrink: 0;
  object-fit: cover; background: #2a2b3c;
}
.player-text { flex: 1; margin-left: .14rem; overflow: hidden; }
.player-title { font-size: .26rem; color: #fff; }
.player-status { font-size: .2rem; color: var(--muted); }
.player-actions { display: flex; align-items: center; gap: .2rem; flex-shrink: 0; }
.action-icon { font-size: .36rem; opacity: .6; cursor: pointer; line-height: 1; }
.action-icon.active { opacity: 1; }

.player-progress {
  display: flex; align-items: center;
  padding: 0 .2rem .16rem;
  background: linear-gradient(145deg, #1A1B28, #15161F);
}
.time-text { font-size: .2rem; color: #fff; min-width: .6rem; text-align: center; font-variant-numeric: tabular-nums; }
.progress-slider {
  flex: 1; margin: 0 .12rem;
  position: relative; height: .3rem;
  display: flex; align-items: center;
  touch-action: none; cursor: pointer;
}
.slider-track {
  width: 100%; height: .06rem; background: #333; border-radius: .06rem; overflow: hidden;
}
.slider-fill {
  height: 100%; width: 0%;
  background: var(--gold);
  border-radius: .06rem;
}
.slider-knob {
  position: absolute; left: 0; top: 50%;
  width: .16rem; height: .16rem; margin-left: -.08rem;
  background: var(--gold); border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 .06rem rgba(252, 163, 17, .8);
}

.player-controls-top {
  display: flex; align-items: center; justify-content: center;
  gap: .4rem;
  background: linear-gradient(145deg, #252636, #1A1B28);
  padding: .16rem .2rem .12rem;
  box-shadow: 0 -.04rem .2rem rgba(0, 0, 0, .6);
}
.ctrl-btn-large {
  width: .8rem; height: .8rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #3a3b4c, #1a1b28);
  box-shadow: 0 .04rem .1rem rgba(0, 0, 0, .6), inset 0 .02rem .02rem rgba(255, 255, 255, .15), inset 0 -.02rem .04rem rgba(0, 0, 0, .3);
  border: .01rem solid rgba(255, 255, 255, .08);
  cursor: pointer; flex-shrink: 0;
}
.ctrl-btn-large:active { transform: scale(.92); }
.ctrl-btn-large.play-btn {
  width: 1rem; height: 1rem;
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  box-shadow: 0 .05rem .14rem rgba(252, 163, 17, .5), inset 0 .02rem .02rem rgba(255, 255, 255, .3);
}
.ctrl-icon { font-size: .4rem; color: #fff; line-height: 1; }
.ctrl-btn-large.play-btn .ctrl-icon { font-size: .46rem; color: #1a1a2e; }
.ctrl-btn-large.play-btn .ctrl-icon.play-icon { margin-left: .06rem; }
.ctrl-btn-small {
  width: .64rem; height: .64rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #2a2b3c, #1a1b28);
  box-shadow: 0 .03rem .08rem rgba(0, 0, 0, .5);
  cursor: pointer; flex-shrink: 0;
}
.ctrl-btn-small:active { transform: scale(.92); }
.ctrl-icon-small { font-size: .24rem; color: var(--gold); white-space: nowrap; }
.sleep-icon { color: #FF5A00; font-weight: bold; font-size: .22rem; }
.sleep-icon.on { color: #FF5A00; }
.player-copyright {
  text-align: center; padding: .06rem .3rem .1rem;
  font-size: .2rem; color: #FFF3B0; opacity: .9;
  background: linear-gradient(145deg, #1A1B28, #15161F);
}

/* ============ 弹窗（底部/居中两种） ============ */
.popup-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
}
.popup-mask.center { align-items: center; }
.popup-content {
  width: 100%; max-width: var(--shell-w);
  max-height: 80vh;
  background: var(--panel);
  border-radius: .3rem .3rem 0 0;
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  animation: popupUp .18s ease-out;
}
@keyframes popupUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.popup-mask.center .popup-content {
  width: 82%; max-width: calc(var(--shell-w) * .86);
  border-radius: .2rem;
  animation: popupFade .16s ease-out;
}
@keyframes popupFade { from { transform: scale(.96); opacity: .4; } to { transform: none; opacity: 1; } }
.popup-content.small { width: 80%; max-width: calc(var(--shell-w) * .84); }
.popup-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .3rem; border-bottom: .02rem solid var(--line);
  flex-shrink: 0;
}
.popup-title { font-size: .32rem; color: #fff; font-weight: bold; }
.popup-close {
  width: .5rem; height: .5rem; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .28rem; cursor: pointer;
}
.popup-body { flex: 1; padding: .3rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.popup-footer {
  display: flex; align-items: center; padding: .2rem .3rem .4rem; gap: .2rem; flex-shrink: 0;
}
.popup-footer .clear-btn { flex-shrink: 0; padding: .2rem .3rem; font-size: .28rem; color: var(--muted); cursor: pointer; }
.popup-footer .confirm-btn {
  flex: 1; height: .8rem; line-height: .8rem; font-size: .3rem; margin: 0;
  border-radius: .5rem; border: none; font-weight: bold;
}
.header-actions { display: flex; align-items: center; gap: .16rem; }
.confirm-tag-btn {
  padding: .1rem .24rem; background: var(--gold); color: #000;
  font-size: .26rem; font-weight: bold; border-radius: .3rem; cursor: pointer;
}

/* 输入框 */
.input-placeholder, ::placeholder { color: #555; }
.text-input, .form-textarea, .link-input {
  width: 100%; background: var(--bg);
  border: .02rem solid var(--line); border-radius: .12rem;
  padding: .2rem; font-size: .28rem; color: #fff;
  box-sizing: border-box; outline: none; resize: none;
}
.text-input:focus, .form-textarea:focus, .link-input:focus { border-color: rgba(252, 163, 17, .6); }

/* 标签网格（首页/提取页共用） */
.tag-grid { display: flex; flex-wrap: wrap; justify-content: space-between; }
.tag-grid-item {
  width: 31%; padding: .24rem 0; margin-bottom: .2rem;
  background: var(--bg); border: .02rem solid var(--line);
  border-radius: .14rem; text-align: center;
  font-size: .28rem; color: #ccc; cursor: pointer;
}
.tag-grid-item.active {
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  border-color: var(--gold); color: var(--bg); font-weight: bold;
  box-shadow: 0 .04rem .12rem rgba(252, 163, 17, .4);
}
.check-icon { margin-right: .06rem; font-weight: bold; }

/* 封面网格 / 新建歌单（首页、个人中心、提取页共用） */
.cover-select-section { text-align: center; margin-bottom: .3rem; }
.album-cover-preview {
  width: 2.4rem; height: 2.4rem; border-radius: .16rem;
  margin: 0 auto .16rem; box-shadow: 0 .04rem .16rem rgba(0, 0, 0, .4);
  object-fit: cover;
}
.change-cover-btn { font-size: .26rem; color: var(--gold); cursor: pointer; }
.album-name-label { font-size: .28rem; color: #ccc; margin-bottom: .12rem; }
.album-input-large {
  width: 100%; height: .8rem; background: transparent; border: none;
  border-bottom: .02rem solid #444; padding: 0; font-size: .32rem; color: #fff;
  outline: none;
}
.cover-grid { display: flex; flex-wrap: wrap; gap: .16rem; padding: .1rem; }
.cover-grid-item {
  width: calc(33.33% - .12rem); border-radius: .12rem; overflow: hidden;
  border: .04rem solid transparent; cursor: pointer;
}
.cover-grid-item.active { border-color: var(--gold); }
.cover-grid-item img { width: 100%; height: 2rem; object-fit: cover; }

/* 倍速弹窗 */
.speed-popup {
  width: 4rem; max-width: 80%;
  background: var(--panel); border-radius: .2rem; padding: .3rem;
  border: .02rem solid rgba(252, 163, 17, .3);
}
.speed-title { text-align: center; color: #fff; font-size: .3rem; margin-bottom: .2rem; font-weight: bold; }
.speed-options { display: flex; flex-direction: column; gap: .12rem; }
.speed-option {
  padding: .2rem; text-align: center; color: #ccc; font-size: .28rem;
  background: #252636; border-radius: .12rem; cursor: pointer;
}
.speed-option.selected { background: var(--gold); color: #000; font-weight: bold; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 45%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .82);
  color: #fff; font-size: .28rem;
  padding: .2rem .32rem; border-radius: .12rem;
  z-index: 2000; max-width: 70vw; text-align: center;
  pointer-events: none;
}

/* 自定义 confirm 弹窗 */
.dialog-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6);
  z-index: 1800; display: flex; align-items: center; justify-content: center;
}
.dialog {
  width: 76%; max-width: calc(var(--shell-w) * .8);
  background: #1D1E2C; border-radius: .2rem; overflow: hidden;
  border: .01rem solid rgba(255, 255, 255, .08);
}
.dialog-head { padding: .34rem .3rem .1rem; font-size: .32rem; font-weight: bold; color: #fff; text-align: center; }
.dialog-body { padding: .1rem .32rem .3rem; font-size: .27rem; color: #bbb; text-align: center; line-height: 1.6; white-space: pre-wrap; }
.dialog-foot { display: flex; border-top: .01rem solid #2A2B3D; }
.dialog-foot button {
  flex: 1; background: transparent; border: none; padding: .26rem 0;
  font-size: .3rem; color: var(--muted); cursor: pointer;
}
.dialog-foot button.primary { color: var(--gold); font-weight: bold; }
.dialog-foot button.danger { color: #FF4D4F; font-weight: bold; }
.dialog-foot button + button { border-left: .01rem solid #2A2B3D; }

/* 加载遮罩 */
.loading-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5);
  z-index: 1700; display: flex; align-items: center; justify-content: center;
}
.loading-box {
  background: rgba(0, 0, 0, .8); color: #fff; font-size: .26rem;
  padding: .24rem .34rem; border-radius: .12rem; display: flex; align-items: center; gap: .16rem;
}
.spinner {
  width: .32rem; height: .32rem; border-radius: 50%;
  border: .05rem solid #3a3b4a; border-top-color: var(--gold);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes blinkIcon {
  0%, 100% { opacity: .4; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.1); }
}
@keyframes pulseBtn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(252, 163, 17, .5); transform: scale(1); }
  50% { box-shadow: 0 0 0 .12rem rgba(252, 163, 17, 0); transform: scale(1.05); }
}

/* 桌面端：给应用外壳一点立体感 */
@media (min-width: 560px) {
  #app { box-shadow: 0 0 60px rgba(0, 0, 0, .8); }
  body { background: #05060a; }
}