/* =============================================================
 * 灵动岛 v2（全新模块）—— 顶部全宽黑条 + 展开式音乐面板
 * ============================================================= */

/* ---------- 灵动岛主条 ---------- */
.mth-island {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900; height: 36px;
  background: #0A0A0C; display: flex; align-items: center; gap: 7px;
  padding: 0 10px; width: 100%; box-shadow: 0 4px 16px rgba(0,0,0,.5);
  color: #fff; font-size: 12px; overflow: hidden; white-space: nowrap;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
/* 页面内容整体下移避让灵动岛 */
.mth-island-on .mth-wrap { padding-top: 44px; }
.mth-island-on [data-page="shopSearch"] .navbar { margin-top: 42px; }

/* 俱乐部图标 */
.mth-island .mth-isl-ico {
  width: 22px; height: 22px; border-radius: 5px; flex: none; display: none;
  background: var(--isl-icon, none) center/cover no-repeat;
}
.mth-island.has-ico .mth-isl-ico { display: inline-block; }

/* 状态呼吸绿点 */
.mth-island .mth-isl-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #2BD009; flex: none;
  box-shadow: 0 0 6px #2BD009; animation: mth-isl-breathe 2s ease-in-out infinite;
}
@keyframes mth-isl-breathe {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

/* 信息文字区：公告 / 歌词 / 所在页信息 */
.mth-island .mth-isl-txt {
  flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: pointer; line-height: 36px;
}

/* 绿色音浪条（播放中） */
.mth-island .mth-isl-music { display: none; align-items: center; gap: 2.5px; height: 16px; flex: none; }
.mth-island .mth-isl-music i {
  width: 2.5px; background: linear-gradient(#39FF14,#2BD009); border-radius: 2px;
  transform-origin: bottom; animation: mth-isl-eq .8s ease-in-out infinite;
}
.mth-island .mth-isl-music i:nth-child(1) { height: 6px; animation-delay: 0s; }
.mth-island .mth-isl-music i:nth-child(2) { height: 13px; animation-delay: .15s; }
.mth-island .mth-isl-music i:nth-child(3) { height: 8px; animation-delay: .3s; }
.mth-island .mth-isl-music i:nth-child(4) { height: 14px; animation-delay: .45s; }
.mth-island .mth-isl-music i:nth-child(5) { height: 9px; animation-delay: .25s; }
@keyframes mth-isl-eq { 0%,100% { transform: scaleY(.6); } 50% { transform: scaleY(1.35); } }

/* 播放/暂停圆形钮 */
.mth-island .mth-isl-btn {
  display: none; flex: none; width: 24px; height: 24px; border-radius: 50%;
  align-items: center; justify-content: center; cursor: pointer;
  background: rgba(255,255,255,.16); border: none; color: #fff;
  transition: background .2s ease, transform .15s ease;
}
.mth-island.has-music .mth-isl-btn { display: inline-flex; }
.mth-island .mth-isl-btn:active { transform: scale(.88); }
.mth-island .mth-isl-btn svg { width: 11px; height: 11px; display: none; }
.mth-island .mth-isl-btn .ic-play { display: block; }
.mth-island .mth-isl-btn.playing { background: linear-gradient(135deg,#39FF14,#2BD009); color: #06170A; box-shadow: 0 0 10px rgba(57,255,20,.55); }
.mth-island .mth-isl-btn.playing .ic-play { display: none; }
.mth-island .mth-isl-btn.playing .ic-pause { display: block; }

/* 后台自定义背景图 + 暗色蒙版 */
.mth-island.has-bg { background-image: var(--isl-bg, none); background-size: cover; background-position: center; }
.mth-island.has-bg::before {
  content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.8);
  pointer-events: none; z-index: 0;
}
.mth-island.has-bg > * { position: relative; z-index: 1; }

/* ---------- 展开的音乐面板 ---------- */
.mth-ip {
  position: fixed; top: 42px; left: 8px; right: 8px; z-index: 899;
  background: rgba(16,16,18,.97); border-radius: 16px; padding: 14px;
  color: #fff; box-shadow: 0 12px 40px rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  max-height: 62vh; overflow-y: auto; animation: mth-ip-in .2s ease;
}
@keyframes mth-ip-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.mth-ip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mth-ip-head b { font-size: 14px; }
.mth-ip-head small { font-size: 11px; color: rgba(255,255,255,.45); }
.mth-ip-cur { font-size: 12px; color: #2BD009; margin-bottom: 6px; }
.mth-ip-lyric {
  font-size: 13px; color: rgba(255,255,255,.92); line-height: 1.5;
  background: rgba(255,255,255,.07); border-radius: 10px; padding: 9px 11px; margin-bottom: 12px;
}
.mth-ip-ctrl { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 12px; }
.mth-ip-ctrl button {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; display: flex; align-items: center; justify-content: center;
}
.mth-ip-ctrl button svg { width: 18px; height: 18px; }
.mth-ip-ctrl .mth-ip-play {
  width: 46px; height: 46px; background: linear-gradient(135deg,#39FF14,#2BD009); color: #06170A;
  box-shadow: 0 0 14px rgba(57,255,20,.45);
}
.mth-ip-ctrl .mth-ip-play svg { width: 20px; height: 20px; }
.mth-ip-list { display: flex; flex-direction: column; gap: 2px; }
.mth-ip-song {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px; border-radius: 9px; font-size: 13px; cursor: pointer;
  color: rgba(255,255,255,.78); transition: background .15s ease;
}
.mth-ip-song b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mth-ip-song i { font-style: normal; font-size: 11px; color: #2BD009; flex: none; }
.mth-ip-song.on { background: rgba(57,255,20,.12); color: #fff; }
.mth-ip-song:active { background: rgba(255,255,255,.08); }

/* =============================================================
 * 模板二：胶囊浮窗（参考站 1:1）
 * 圆形头像 + 白底圆角文字泡 + 绿色音浪条 + 播放钮
 * 第二行：首页 / 身份 / 分类 快捷导航
 * ============================================================= */
.mth-island.tpl-capsule {
  position: fixed; top: 8px; left: 0; right: 0; z-index: 900;
  height: auto; background: none; box-shadow: none; padding: 0 10px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  overflow: visible; white-space: normal; backdrop-filter: none;
}
.mth-island.tpl-capsule.has-bg { background-image: none; }
.mth-island.tpl-capsule.has-bg::before { display: none; }

/* 第一行：胶囊本体 */
.mth-island.tpl-capsule .mth-isl-row {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 100%; min-width: 0;
  background: #101014; border-radius: 999px; padding: 4px 8px 4px 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,.42);
}
/* 圆形头像（俱乐部图标） */
.mth-island.tpl-capsule .mth-isl-ico {
  display: inline-block; width: 26px; height: 26px; border-radius: 50%;
  flex: none; background: var(--isl-icon, none) center/cover no-repeat;
  background-color: rgba(255,255,255,.14);
}
/* 文字区（参考站：白字直接排在黑色胶囊内） */
.mth-island.tpl-capsule .mth-isl-bubble {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border-radius: 999px; padding: 0 2px;
  min-width: 0; max-width: 52vw; height: 26px;
}
.mth-island.tpl-capsule .mth-isl-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #2BD009; flex: none;
  box-shadow: 0 0 5px #2BD009; animation: mth-isl-breathe 2s ease-in-out infinite;
}
.mth-island.tpl-capsule .mth-isl-txt {
  flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: pointer; line-height: 18px;
  color: #FFFFFF; font-size: 12.5px; font-weight: 500; letter-spacing: .2px;
}
/* 绿色音浪条 */
.mth-island.tpl-capsule .mth-isl-music { display: none; align-items: flex-end; gap: 2px; height: 16px; flex: none; }
.mth-island.tpl-capsule .mth-isl-music i {
  width: 2.5px; background: linear-gradient(#39FF14,#2BD009); border-radius: 2px;
  transform-origin: bottom; animation: mth-isl-eq .8s ease-in-out infinite;
}
.mth-island.tpl-capsule .mth-isl-music i:nth-child(1) { height: 6px; animation-delay: 0s; }
.mth-island.tpl-capsule .mth-isl-music i:nth-child(2) { height: 13px; animation-delay: .15s; }
.mth-island.tpl-capsule .mth-isl-music i:nth-child(3) { height: 8px; animation-delay: .3s; }
.mth-island.tpl-capsule .mth-isl-music i:nth-child(4) { height: 14px; animation-delay: .45s; }
.mth-island.tpl-capsule .mth-isl-music i:nth-child(5) { height: 9px; animation-delay: .25s; }
/* 播放钮 */
.mth-island.tpl-capsule .mth-isl-btn {
  display: inline-flex; flex: none; width: 26px; height: 26px; border-radius: 50%;
  align-items: center; justify-content: center; cursor: pointer;
  background: rgba(255,255,255,.18); border: none; color: #fff;
}
.mth-island.tpl-capsule.has-music .mth-isl-btn { display: inline-flex; }
.mth-island.tpl-capsule .mth-isl-btn.playing {
  background: linear-gradient(135deg,#39FF14,#2BD009); color: #06170A;
  box-shadow: 0 0 10px rgba(57,255,20,.55);
}

/* 胶囊模式：页面内容只下移一点点，避免浪费空间 */
.mth-island-on.tpl-capsule-on .mth-wrap { padding-top: 12px; }

/* =============================================================
 * 模板三：苹果灵动岛（Dynamic Island）
 * 收起：顶部居中的黑色药丸（胶囊），显示图标 + 文字 + 音浪条
 * 展开：药丸纵向撑开为圆角大卡片，显示封面 / 歌名 / 歌词 / 控制 / 歌单
 * ============================================================= */
.mth-island.tpl-apple {
  position: fixed; top: 10px; left: 0; right: 0; z-index: 900;
  height: auto; background: none; box-shadow: none; padding: 0 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  overflow: visible; white-space: normal; backdrop-filter: none;
}
.mth-island.tpl-apple.has-bg { background-image: none; }
.mth-island.tpl-apple.has-bg::before { display: none; }

/* 药丸本体 */
.mth-island.tpl-apple .mth-dk {
  position: relative; display: inline-flex; align-items: center;
  background: #000000; border-radius: 999px; overflow: hidden;
  max-width: 100%; min-width: 0;
  box-shadow: 0 6px 22px rgba(0,0,0,.42);
  transition: border-radius .38s cubic-bezier(.32,.72,0,1), width .38s cubic-bezier(.32,.72,0,1),
              height .38s cubic-bezier(.32,.72,0,1), background .3s ease;
  cursor: pointer;
}
/* 收起态：药丸 */
.mth-island.tpl-apple .mth-dk-mini {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; height: 32px; min-width: 0;
  transition: opacity .22s ease;
}
.mth-island.tpl-apple .mth-isl-ico {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--isl-icon, none) center/cover no-repeat;
  background-color: rgba(255,255,255,.16);
}
.mth-island.tpl-apple .mth-isl-txt {
  flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: #fff; font-size: 12.5px; line-height: 20px; font-weight: 500;
  max-width: 58vw;
}
.mth-island.tpl-apple .mth-isl-music {
  display: none; align-items: flex-end; gap: 2px; height: 15px; flex: none;
}
.mth-island.tpl-apple .mth-isl-music i {
  width: 2.5px; background: linear-gradient(#39FF14,#2BD009); border-radius: 2px;
  transform-origin: bottom; animation: mth-isl-eq .8s ease-in-out infinite;
}
.mth-island.tpl-apple .mth-isl-music i:nth-child(1) { height: 6px; animation-delay: 0s; }
.mth-island.tpl-apple .mth-isl-music i:nth-child(2) { height: 12px; animation-delay: .15s; }
.mth-island.tpl-apple .mth-isl-music i:nth-child(3) { height: 8px; animation-delay: .3s; }
.mth-island.tpl-apple .mth-isl-music i:nth-child(4) { height: 13px; animation-delay: .45s; }
.mth-island.tpl-apple .mth-isl-music i:nth-child(5) { height: 9px; animation-delay: .25s; }

/* 展开态：大卡片 */
.mth-island.tpl-apple .mth-dk-big {
  display: none; width: 100%; padding: 12px 14px 14px;
  flex-direction: column; gap: 12px;
}
.mth-island.tpl-apple.expanded .mth-dk {
  border-radius: 26px; width: 100%; max-width: 340px;
  background: rgba(10,10,12,.97);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  animation: mth-dk-in .38s cubic-bezier(.32,.72,0,1);
}
@keyframes mth-dk-in { from { transform: scale(.94); opacity: .6; } to { transform: none; opacity: 1; } }
.mth-island.tpl-apple.expanded .mth-dk-mini { display: none; }
.mth-island.tpl-apple.expanded .mth-dk-big { display: flex; }

.mth-island.tpl-apple .mth-dk-top { display: flex; align-items: center; gap: 10px; }
.mth-island.tpl-apple .mth-dk-cover {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  background: rgba(255,255,255,.14) center/cover no-repeat;
}
.mth-island.tpl-apple .mth-dk-info { flex: 1; min-width: 0; }
.mth-island.tpl-apple .mth-dk-name {
  display: block; font-size: 13.5px; color: #fff; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mth-island.tpl-apple .mth-dk-lyric {
  display: block; font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mth-island.tpl-apple .mth-dk-close {
  width: 26px; height: 26px; border-radius: 50%; border: none; flex: none;
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mth-island.tpl-apple .mth-dk-close svg { width: 15px; height: 15px; }

.mth-island.tpl-apple .mth-dk-ctrl {
  display: flex; align-items: center; justify-content: center; gap: 20px;
}
.mth-island.tpl-apple .mth-dk-ctrl button {
  border: none; background: none; color: #fff; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.mth-island.tpl-apple .mth-dk-ctrl button svg { width: 20px; height: 20px; display: block; }
.mth-island.tpl-apple .mth-dk-ctrl .mth-dk-play {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg,#39FF14,#2BD009); color: #06170A;
  box-shadow: 0 0 14px rgba(57,255,20,.4);
}
.mth-island.tpl-apple .mth-dk-ctrl .mth-dk-play svg { width: 18px; height: 18px; }
.mth-island.tpl-apple .mth-dk-ctrl .mth-dk-play .ic-play { display: block; }
.mth-island.tpl-apple .mth-dk-ctrl .mth-dk-play.playing .ic-play { display: none; }
.mth-island.tpl-apple .mth-dk-ctrl .mth-dk-play.playing .ic-pause { display: block; }

.mth-island.tpl-apple .mth-dk-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 150px; overflow-y: auto;
}
.mth-island.tpl-apple .mth-dk-song {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 10px; font-size: 12.5px; cursor: pointer;
  color: rgba(255,255,255,.75);
}
.mth-island.tpl-apple .mth-dk-song b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mth-island.tpl-apple .mth-dk-song i { font-style: normal; font-size: 11px; color: #2BD009; flex: none; }
.mth-island.tpl-apple .mth-dk-song.on { background: rgba(57,255,20,.13); color: #fff; }

/* 苹果岛模式：内容不需要下移（浮在内容之上） */
.mth-island-on.tpl-apple-on .mth-wrap { padding-top: 0; }
