@import url("ambient-bg.css");

/* 阿里 iconfont 风格图标（Symbol 引用，与 iconfont.cn 用法一致）
 * 若使用自有 iconfont 项目，可在 index.html 引入：
 * <link rel="stylesheet" href="//at.alicdn.com/t/font_你的项目id.css">
 */
.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.15em;
  overflow: hidden;
}

.icon-sm { font-size: 16px; }
.icon-md { font-size: 20px; }
.icon-lg { font-size: 28px; }

:root {
  --bg: #030508;
  --surface: rgba(18, 22, 28, 0.82);
  --text: #f5f5f7;
  --text-muted: #8e8e93;
  --accent: #e85d04;
  --accent-soft: rgba(232, 93, 4, 0.25);
  --radius: 14px;
  --lyric-font: SimHei, "Heiti SC", "STHeiti", "STXihei", "Microsoft YaHei", sans-serif;
  --lyric-line-height: 1.2;
  --lyric-size: clamp(1.2rem, 3.8vw, 1.85rem);
  --lyric-slot-height: calc(var(--lyric-size) * var(--lyric-line-height) * 1.12);
  --lyric-slot-height-past: calc(var(--lyric-size) * var(--lyric-line-height) * 0.82);
  --player-cover-blur: 56px;
  --cover-reveal-blur: 20px;
  --cover-reveal-duration: 1.45s;
  --cover-placeholder-fade: 1.15s;
  --color-played: #ffffff;
  --color-unplayed: rgba(255, 255, 255, 0.45);
  --header-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --scrollbar-size: 6px;
  --scrollbar-track: #030508;
  --scrollbar-thumb: #1a3a38;
  --scrollbar-thumb-hover: #e85d04;
  --content-max: 1220px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  /* 始终预留滚动条槽位，避免滚动条出现/消失时整页左右跳动 */
  scrollbar-gutter: stable;
}

/*
 * 全局滚动条（无上下箭头）
 * Chrome 121+：一旦设置 scrollbar-width 会禁用 ::-webkit-scrollbar，Windows 会退回带箭头的系统滚动条。
 * Chromium / Safari 仅用 WebKit 伪元素；Firefox 用 scrollbar-width（见下方 @supports）。
 */
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-button,
*::-webkit-scrollbar-button:single-button,
*::-webkit-scrollbar-button:vertical:start:decrement,
*::-webkit-scrollbar-button:vertical:end:increment,
*::-webkit-scrollbar-button:horizontal:start:decrement,
*::-webkit-scrollbar-button:horizontal:end:increment {
  display: none;
  width: 0;
  height: 0;
  -webkit-appearance: none;
  appearance: none;
}

@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

html:has(body:not(.searched)) {
  overflow: hidden;
}

body:not(.searched) {
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ========== 首页搜索 ========== */
.app {
  position: relative;
  z-index: 1;
  margin-top: var(--top-nav-height, 72px);
  min-height: calc(100dvh - var(--top-nav-height, 72px));
  display: flex;
  flex-direction: column;
}


/* 首页热榜播放：居中展示当前一句歌词（固定于导航与灵动岛之间，避免聚焦搜索框时 flex 重排下拉） */
.home-hero-lyric {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 20px 24px calc(96px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  text-align: center;
  pointer-events: none;
}

body:not(.searched) .home-hero-lyric:not(.hidden) {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--top-nav-height, 72px);
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  flex: none;
  width: 100%;
  margin: 0;
  z-index: 1;
  box-sizing: border-box;
}

.home-hero-lyric.hidden {
  display: none !important;
}

body.searched .home-hero-lyric {
  display: none !important;
}

.home-hero-lyric__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(720px, 92vw);
  min-height: clamp(5rem, 14vw, 6.5rem);
  box-sizing: border-box;
}

.home-hero-lyric__stage {
  position: relative;
  width: 100%;
  min-height: clamp(2.2rem, 7vw, 3.2rem);
  flex: 0 0 auto;
}

.home-hero-lyric__line {
  position: absolute;
  inset: 0;
  height: 100%;
  max-height: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 8px;
  box-sizing: border-box;
  min-width: 0;
  font-family: var(--lyric-font);
  font-size: clamp(1.45rem, 4.8vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--color-played);
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.52s cubic-bezier(0.25, 0.9, 0.35, 1),
    transform 0.52s cubic-bezier(0.25, 0.9, 0.35, 1);
  will-change: opacity, transform;
}

.home-hero-lyric__viewport {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.home-hero-lyric__viewport.is-overflow {
  justify-content: flex-start;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 10%,
    #000 90%,
    transparent 100%
  );
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.home-hero-lyric__track {
  display: inline-block;
  white-space: nowrap;
  vertical-align: top;
  transform: translateX(0);
  will-change: transform;
}

.home-hero-lyric__line.is-scroll .home-hero-lyric__track {
  animation: home-hero-marquee var(--scroll-duration, 14s) ease-in-out infinite alternate;
}

@keyframes home-hero-marquee {
  0%,
  16% {
    transform: translateX(0);
  }

  84%,
  100% {
    transform: translateX(var(--scroll-offset, 0));
  }
}

.home-hero-lyric__main {
  display: inline;
  margin: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  white-space: nowrap;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
}

.home-hero-lyric__main--prime {
  display: inline-block;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.15;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.26);
  text-shadow: none;
  vertical-align: middle;
}

/* 占位音符：放大舞台高度并取消裁切，避免 ♪ 被 viewport 截断 */
.home-hero-lyric__stage:has(.home-hero-lyric__main--prime) {
  min-height: clamp(2.75rem, 10vw, 3.75rem);
  overflow: visible;
}

.home-hero-lyric__line:has(.home-hero-lyric__main--prime) {
  overflow: visible;
}

.home-hero-lyric__line:has(.home-hero-lyric__main--prime) .home-hero-lyric__viewport {
  overflow: visible;
}

/* 歌词下方：青色横线（独立于歌词层，切换句时保持常驻） */
.home-hero-lyric__accent {
  position: relative;
  display: block;
  width: min(300px, 76vw);
  height: 3px;
  margin-top: 0.72em;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.52s cubic-bezier(0.25, 0.9, 0.35, 1);
}

.home-hero-lyric__accent.is-visible {
  opacity: 1;
}

.home-hero-lyric__accent.hidden {
  display: none !important;
}

.home-hero-lyric__accent:not(.hidden) {
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 6%,
    #000 22%,
    #000 78%,
    rgba(0, 0, 0, 0.35) 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 6%,
    #000 22%,
    #000 78%,
    rgba(0, 0, 0, 0.35) 94%,
    transparent 100%
  );
}

.home-hero-lyric__accent-base {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 229, 204, 0.06) 18%,
    rgba(0, 229, 204, 0.22) 50%,
    rgba(0, 229, 204, 0.06) 82%,
    transparent 100%
  );
}

.home-hero-lyric__accent-glow {
  position: absolute;
  top: 0;
  left: -35%;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 229, 204, 0.12) 22%,
    rgba(120, 235, 255, 0.55) 50%,
    rgba(0, 210, 230, 0.38) 72%,
    rgba(0, 229, 204, 0.1) 88%,
    transparent 100%
  );
  box-shadow:
    0 0 10px rgba(0, 229, 204, 0.2),
    0 0 18px rgba(64, 200, 255, 0.12);
  animation: home-hero-accent-sweep 2.6s ease-in-out infinite alternate;
  will-change: left;
}

@keyframes home-hero-accent-sweep {
  0% {
    left: -38%;
  }

  100% {
    left: 96%;
  }
}

.home-hero-lyric__line.is-active {
  opacity: 1;
  transform: translateY(0);
}

.home-hero-lyric__line.is-exit {
  opacity: 0;
  transform: translateY(-18px);
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-lyric__line {
    transition-duration: 0.01ms;
  }

  .home-hero-lyric__line.is-scroll .home-hero-lyric__track,
  .home-hero-lyric__accent-glow {
    animation: none;
  }

  .results-wrap,
  body.search-entering .home-hero-lyric:not(.hidden) {
    transition-duration: 0.01ms;
  }
}

body.searched .results-wrap {
  display: block;
}

body.searched .app {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}


/* ========== 顶部导航（固定顶部，不随页面滚动） ========== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 10px 20px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  box-sizing: border-box;
  background: rgba(3, 8, 12, 0.92);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(0, 229, 204, 0.08);
}

.top-nav__brand {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  margin: 0;
  max-width: none;
}

.top-nav__brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-nav__brand .brand-title {
  flex: 0 1 auto;
  min-width: 0;
}

.top-nav__brand .brand-title h1 {
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-nav__brand .brand-title__img {
  max-width: min(100%, 200px);
  max-height: 40px;
  margin: 0;
}

.brand-platforms {
  display: none !important;
}

.admin-entry-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  min-width: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #d3217b;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.admin-entry-dot:not([hidden]) {
  display: inline-block;
}

.admin-entry-dot:focus-visible {
  outline: 2px solid rgba(211, 33, 123, 0.55);
  outline-offset: 3px;
}

.brand-title--refresh {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.brand-title--refresh:focus-visible {
  outline: 2px solid rgba(0, 229, 204, 0.45);
  outline-offset: 4px;
  border-radius: 6px;
}

.top-nav__search {
  flex: 0 1 320px;
  width: 100%;
  max-width: min(320px, 40vw);
  margin: 0;
}

.top-nav__search .search-box {
  min-height: 40px;
  padding: 2px 3px 2px 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.32);
}

.top-nav__search .search-box:focus-within {
  border-color: rgba(0, 229, 204, 0.22);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.32);
}

.top-nav__search .search-box input {
  padding: 8px 8px 8px 0;
  font-size: 0.875rem;
}

.top-nav__search .search-box button {
  width: 34px;
  height: 34px;
}

.top-nav__search .search-btn-icon {
  width: 18px;
  height: 18px;
}

.search-form {
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 56px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 229, 204, 0.1);
  border-radius: 999px;
  padding: 4px 6px 4px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.search-box:focus-within {
  border-color: var(--accent-soft);
  box-shadow: 0 8px 40px var(--accent-soft);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  padding: 14px 12px 14px 0;
  outline: none;
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s;
}

.search-box button:hover {
  transform: scale(1.05);
}

.search-box button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.search-btn-icon {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

/* ========== 搜索结果（整页滚动，搜索栏 sticky 置顶） ========== */
.results-wrap {
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.38s cubic-bezier(0.25, 0.9, 0.35, 1),
    transform 0.38s cubic-bezier(0.25, 0.9, 0.35, 1),
    visibility 0.38s;
}

.results-inner {
  flex: 1;
  min-width: 0;
  position: relative;
}

body.searched {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  max-height: none;
}

body.searched .results-wrap {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  max-height: none;
  overflow: visible;
  padding: 8px 20px max(12px, env(safe-area-inset-bottom, 0px));
  visibility: visible;
  box-sizing: border-box;
}

body.searched.search-results-visible .results-wrap {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* 进入搜索：首页歌词先淡出，再展开结果区 */
body.search-entering .home-hero-lyric:not(.hidden) {
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.song-list {
  list-style: none;
  overflow-anchor: none;
}

.song-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  position: relative;
  min-height: 56px;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: var(--delay, 0s);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

body.searched .song-item {
  scroll-margin-top: var(--search-sticky-offset, 96px);
  scroll-margin-bottom: 12px;
}

/* 去掉鼠标/快捷键切歌时的默认白描边；仅 Tab 键盘导航时显示焦点 */
.song-item:focus {
  outline: none;
}

.song-item:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

.song-item:focus-visible {
  outline: 2px solid rgba(232, 93, 4, 0.65);
  outline-offset: 2px;
}

/* 列表项：鼠标/切歌不显示描边，Tab 键盘导航保留焦点环 */


.song-item--static {
  opacity: 1;
  animation: none;
  transform: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.song-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.song-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.platform-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.song-title-row .song-title {
  flex: 1;
  min-width: 0;
}
.song-item.is-active {
  background: rgba(232, 93, 4, 0.08);
}

.cover-wrap,
.di-cover-wrap {
  position: relative;
}

.cover-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  justify-self: center;
  background: rgba(255, 255, 255, 0.06);
}

.cover-wrap.is-no-cover .cover-img,
.di-cover-wrap.is-no-cover .di-cover {
  display: none;
}

/* 无封面 / 加载中：白色高斯模糊占位 */
.cover-wrap.is-no-cover::before,
.cover-wrap.is-cover-pending::before,
.di-cover-wrap.is-no-cover::before,
.di-cover-wrap.is-cover-pending::before {
  content: "";
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
  filter: blur(16px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
  transition: opacity var(--cover-placeholder-fade, 1.15s) ease-out;
}

.cover-wrap.is-cover-ready::before,
.di-cover-wrap.is-cover-ready::before {
  opacity: 0;
}

.cover-img,
.di-cover {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: blur(var(--cover-reveal-blur, 20px));
  opacity: 0;
  transition:
    filter var(--cover-reveal-duration, 1.45s) cubic-bezier(0.22, 1, 0.36, 1),
    opacity var(--cover-reveal-duration, 1.45s) cubic-bezier(0.22, 1, 0.36, 1);
  will-change: filter, opacity;
}

.cover-img.is-cover-loaded,
.di-cover.is-cover-loaded {
  filter: blur(0);
  opacity: 1;
}

.cover-wrap.is-playing .cover-img.is-cover-loaded {
  animation: spin 8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.song-meta {
  min-width: 0;
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.song-aside {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
  min-height: 56px;
  flex-shrink: 0;
}

.song-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-item:hover .song-title {
  color: var(--accent);
}

.song-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.btn-icon:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-action-icon {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  pointer-events: none;
}

.btn-icon--dl:hover {
  background: rgba(0, 255, 127, 0.12);
}

.btn-icon--dl:hover .btn-action-icon {
  filter: brightness(1.15);
}

.btn-icon--no-lyric {
  cursor: default;
}

.btn-icon--no-lyric:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  transform: none;
}

.loading-item,
.empty-item {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  animation: none;
  opacity: 1;
}

/* 搜索结果页：回到顶部（列表右缘外侧，靠下固定） */
.back-to-top {
  position: fixed;
  z-index: 90;
  right: max(20px, calc((100vw - min(100vw, var(--content-max))) / 2 - 56px));
  bottom: calc(32px + var(--safe-bottom));
  top: auto;
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.88);
  pointer-events: none;
  transition:
    opacity 0.32s ease,
    transform 0.38s cubic-bezier(0.34, 1.35, 0.64, 1),
    visibility 0.32s ease,
    filter 0.2s ease;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35));
}

.back-to-top-icon {
  width: 46px;
  height: 46px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  filter: drop-shadow(0 6px 20px rgba(232, 93, 4, 0.45));
}

.back-to-top:active {
  transform: scale(0.94);
}

body.has-chart-island.searched .back-to-top {
  bottom: calc(96px + var(--safe-bottom));
}

@media (max-width: 1280px) {
  .back-to-top {
    right: 16px;
  }
}

body:not(.searched) .back-to-top,
body.player-open .back-to-top,
body.search-loading .back-to-top {
  display: none !important;
}

/* 手机端搜索结果：避免回到顶部与列表、底部灵动岛重叠 */
@media (max-width: 640px) {
  body.searched .back-to-top {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: opacity 0.15s ease, visibility 0.15s ease, background 0.2s ease;
  }

  .back-to-top:active {
    transform: scale(0.94);
  }
}

/* ========== 全屏播放器 ========== */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  overflow: hidden;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.36s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.36s;
}

.player-overlay.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  z-index: 220;
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s;
}

/* 收起：保持高层级，避免灵动岛突然盖住淡出层 */
.player-overlay.is-closing {
  visibility: visible;
  opacity: 0;
  pointer-events: none;
  z-index: 220;
  transition:
    opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.38s;
}

.player-bg-stack {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
}

.player-bg-stack .player-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.72s ease-in-out;
  pointer-events: none;
  will-change: opacity;
}

.player-bg-stack .player-bg.is-visible {
  opacity: 1;
  z-index: 1;
}

.player-bg {
  background-color: var(--bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* 有封面：模糊歌曲图（放大避免边缘露底） */
.player-bg.has-cover {
  filter: blur(var(--player-cover-blur, 56px)) saturate(1.2) brightness(0.5);
  transform: scale(1.2);
}

/* 无封面：站点配色渐变 */
.player-bg.no-cover {
  background-image:
    radial-gradient(ellipse 90% 70% at 15% 20%, rgba(232, 93, 4, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 75%, rgba(255, 255, 255, 0.05), transparent 50%),
    linear-gradient(165deg, var(--surface) 0%, var(--bg) 45%, #121014 100%);
  filter: none;
  transform: none;
}

.player-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 暗角压层（不透明色阶，只叠在封面上，不露出列表） */
.player-bg.has-cover::after {
  background: linear-gradient(
    180deg,
    #0a0a0c 0%,
    #121216 28%,
    #101012 50%,
    #121216 72%,
    #0a0a0c 100%
  );
  opacity: 0.72;
}

.player-bg.no-cover::after {
  background: linear-gradient(
    180deg,
    #0d0d0f 0%,
    #151518 50%,
    #0d0d0f 100%
  );
  opacity: 1;
}

.player-ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 2;
  transform: scale(0);
  opacity: 0;
}

.player-ripple.animate {
  animation: rippleExpand 0.9s ease-out forwards;
}

@keyframes rippleExpand {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(120);
    opacity: 0;
  }
}

.player-content {
  position: relative;
  z-index: 3;
  background: transparent;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 20px calc(16px + var(--safe-bottom));
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-overlay.open .player-content,
.player-overlay.is-closing .player-content {
  opacity: 1;
  transform: none;
}

.player-overlay.open .player-content {
  transition-delay: 0.06s;
}

.player-overlay.is-closing .player-content {
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition:
    opacity 0.34s cubic-bezier(0.4, 0, 1, 1),
    transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-overlay.is-closing.is-closing-home .player-content {
  transform: translateY(32px) scale(0.86);
  transform-origin: var(--motion-ox, 50%) var(--motion-oy, 92%);
  transition:
    opacity 0.3s cubic-bezier(0.4, 0, 1, 1),
    transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
}

.player-overlay.is-closing .player-bg-stack .player-bg.has-cover.is-visible {
  transition:
    opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.4s ease;
  transform: scale(1.12);
  filter: blur(calc(var(--player-cover-blur, 56px) + 12px)) saturate(1.1) brightness(0.42);
}

@media (prefers-reduced-motion: reduce) {
  .player-bg-stack .player-bg {
    transition-duration: 0.01ms;
  }
}

.play-btns {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-collapse {
  width: 52px;
  height: 52px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  transition: transform 0.2s, background 0.2s;
}

.btn-collapse:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.lyric-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.lyric-bg-char {
  position: absolute;
  font-family: var(--lyric-font);
  font-size: clamp(8rem, 25vw, 16rem);
  color: rgba(255, 255, 255, 0.04);
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.lyric-scroll {
  --lyric-scroll-pad: 45vh;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: center;
  padding: 0 20px;
  width: 100%;
  scrollbar-width: none;
}

.lyric-scroll-pad {
  height: var(--lyric-scroll-pad);
  flex-shrink: 0;
  width: 100%;
  pointer-events: none;
}

.lyric-scroll::-webkit-scrollbar {
  display: none;
}

/* 固定行高槽位：已播行压缩高度，避免上方留白过大 */
.lyric-line-slot {
  height: var(--lyric-slot-height);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.lyric-line-slot.is-past-slot {
  height: var(--lyric-slot-height-past);
}

.lyric-line {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0 6px;
  font-family: var(--lyric-font);
  font-size: var(--lyric-size);
  line-height: var(--lyric-line-height, 1.2);
  color: var(--color-unplayed);
  font-weight: 400;
  opacity: 0.65;
  text-shadow: none;
  white-space: pre-wrap;
  word-break: break-word;
  transition:
    color 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    font-size 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    font-weight 0.45s ease;
}

.lyric-line.active {
  color: var(--color-played);
  font-size: calc(var(--lyric-size) * 1.06);
  opacity: 1;
}

.lyric-line.past {
  opacity: 0.34;
  font-size: calc(var(--lyric-size) * 0.9);
}

.lyric-line-slot.is-active-slot {
  z-index: 1;
}

@media (max-width: 640px) {
  .player-overlay {
    --lyric-size: clamp(1rem, 4.2vw, 1.35rem);
    --lyric-slot-height: calc(var(--lyric-size) * var(--lyric-line-height) * 1.15);
  }

  .lyric-stage {
    width: 100%;
    min-width: 0;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
  }

  .lyric-scroll {
    padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
    max-width: 100%;
    box-sizing: border-box;
  }

  .lyric-line-slot {
    height: auto;
    min-height: var(--lyric-slot-height);
    overflow: visible;
    padding: 0.28em 0;
  }

  .lyric-line-slot.is-past-slot {
    height: auto;
    min-height: var(--lyric-slot-height-past);
  }

  .lyric-line {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 2px;
  }

  .lyric-line.active {
    font-size: clamp(1.05rem, 4.5vw, 1.32rem);
    line-height: 1.35;
  }

  .lyric-line.past {
    font-size: clamp(0.88rem, 3.4vw, 1.05rem);
    line-height: 1.3;
  }

  .player-info h2 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9375rem;
    line-height: 1.35;
  }
}

.player-footer {
  flex-shrink: 0;
}

/* 首页灵动岛进入：仅歌词全屏，隐藏底部控制条 */
body.player-home-lyric .player-footer {
  display: none;
}

body.player-home-lyric .player-content {
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

body.player-home-lyric .lyric-stage {
  flex: 1;
  min-height: 0;
}

body.player-home-lyric.player-open .chart-island {
  z-index: 225;
}

body.player-closing .chart-island {
  z-index: 214;
}

body.player-home-lyric .player-overlay.open .player-content {
  animation: homeLyricIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
}

@keyframes homeLyricIn {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.88);
    transform-origin: var(--motion-ox, 50%) var(--motion-oy, 92%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body.player-home-lyric .player-overlay.open .player-content {
  transition: none;
}

.player-toolbar {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  width: 100%;
}

.player-info {
  flex: 0 1 28%;
  min-width: 80px;
  max-width: 220px;
}

.player-info h2 {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  opacity: 0.95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-wrap .btn-play-toolbar {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
}

body.searched .player-info {
  display: none;
}

body.searched .player-toolbar {
  gap: 10px 12px;
}

.progress-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  min-width: 40px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  touch-action: none;
}

.progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
}

.progress-handle {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  left: 0%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  cursor: grab;
}

.btn-play-main {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--accent-soft);
  transition: transform 0.2s;
}

.btn-play-main:hover {
  transform: scale(1.06);
}

.play-toggle-icon {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
}

.play-toggle-icon--play {
  transform: translateX(2px);
}

.btn-play-main .play-toggle-icon--pause {
  display: none;
}

.btn-play-main.is-pause .play-toggle-icon--play {
  display: none;
}

.btn-play-main.is-pause .play-toggle-icon--pause {
  display: block;
  transform: none;
}

.ci-play-btn .play-toggle-icon {
  width: 22px;
  height: 22px;
}

.ci-play-btn .play-toggle-icon--play {
  transform: translateX(1px);
}

.ci-play-btn .play-toggle-icon--pause {
  transform: none;
}

.ci-play-btn .play-toggle-icon--pause {
  display: none;
}

.ci-play-btn.is-pause .play-toggle-icon--play {
  display: none;
}

.ci-play-btn.is-pause .play-toggle-icon--pause {
  display: block;
}

.btn-action-icon {
  display: block;
  object-fit: contain;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.btn-action-icon--collapse {
  transform: rotate(180deg);
}

.btn-collapse .btn-action-icon--collapse {
  width: 22px;
  height: 22px;
}

.ci-expand-btn .btn-action-icon--expand {
  width: 18px;
  height: 18px;
  transform: none;
}

.ci-panel-head .btn-action-icon--collapse {
  width: 18px;
  height: 18px;
}

.hidden-cover {
  display: none;
}

/* ========== 灵动岛（加载 / 播放状态，贴底） ========== */
.dynamic-island {
  position: fixed;
  top: auto;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 220;
  transform: translateX(-50%) translateY(calc(100% + 28px)) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition:
    top 0.45s cubic-bezier(0.34, 1.25, 0.64, 1),
    bottom 0.45s cubic-bezier(0.34, 1.25, 0.64, 1),
    transform 0.55s cubic-bezier(0.34, 1.45, 0.64, 1),
    opacity 0.35s ease,
    filter 0.35s ease;
  filter: drop-shadow(0 -4px 20px rgba(0, 0, 0, 0.35)) drop-shadow(0 8px 28px rgba(0, 0, 0, 0.4));
}

.dynamic-island.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  width: fit-content;
  max-width: min(380px, calc(100vw - 28px));
}

.dynamic-island.is-visible .di-inner,
.dynamic-island.is-hiding .di-inner {
  pointer-events: auto;
}

.dynamic-island.is-hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(18px) scale(0.92);
  transition:
    transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.32s ease;
}

/* 空搜索等提示：灵动岛贴顶 */
.dynamic-island.island-at-top {
  top: calc(18px + env(safe-area-inset-top, 0px));
  bottom: auto;
  z-index: 230;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.35)) drop-shadow(0 8px 28px rgba(0, 0, 0, 0.4));
}

.dynamic-island.island-at-top:not(.is-visible):not(.is-hiding) {
  transform: translateX(-50%) translateY(calc(-100% - 28px)) scale(0.9);
}

.dynamic-island.island-at-top.is-visible {
  transform: translateX(-50%) translateY(0) scale(1);
}

.dynamic-island.island-at-top.is-hiding {
  transform: translateX(-50%) translateY(-18px) scale(0.92);
}

/* 展开歌词页：灵动岛贴顶，避免与底部播放栏重叠 */
body.player-open .dynamic-island {
  top: calc(18px + env(safe-area-inset-top, 0px));
  bottom: auto;
  z-index: 230;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.35)) drop-shadow(0 8px 28px rgba(0, 0, 0, 0.4));
}

body.player-open .dynamic-island:not(.is-visible):not(.is-hiding) {
  transform: translateX(-50%) translateY(calc(-100% - 28px)) scale(0.9);
}

body.player-open .dynamic-island.is-visible {
  transform: translateX(-50%) translateY(0) scale(1);
}

body.player-open .dynamic-island.is-hiding {
  transform: translateX(-50%) translateY(-18px) scale(0.92);
}

.di-inner {
  --di-cover: 54px;
  --di-gap: 11px;
  display: flex;
  align-items: center;
  gap: var(--di-gap);
  min-height: calc(var(--di-cover) + var(--di-gap) * 2);
  padding: var(--di-gap);
  border-radius: 999px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  width: 156px;
  box-sizing: border-box;
  transition:
    width 0.52s cubic-bezier(0.34, 1.25, 0.64, 1),
    gap 0.45s ease,
    padding 0.45s ease;
}

.dynamic-island.is-playing .di-inner,
.dynamic-island.island-pinned .di-inner {
  width: min(380px, calc(100vw - 48px));
  max-width: min(380px, calc(100vw - 48px));
  gap: var(--di-gap);
  padding: var(--di-gap);
}

.di-cover-wrap {
  width: 0;
  height: var(--di-cover);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  opacity: 0;
  background: rgba(255, 255, 255, 0.06);
  transition:
    width 0.45s cubic-bezier(0.34, 1.2, 0.64, 1),
    opacity 0.35s ease;
}

.dynamic-island.is-playing .di-cover-wrap,
.dynamic-island.island-pinned .di-cover-wrap {
  width: var(--di-cover);
  opacity: 1;
}

.di-cover {
  width: var(--di-cover);
  height: var(--di-cover);
  transform-origin: center center;
}

@keyframes di-cover-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.dynamic-island.is-visible.is-playing .di-cover-wrap:not(.is-no-cover) .di-cover.is-cover-loaded,
.dynamic-island.is-visible.island-pinned .di-cover-wrap:not(.is-no-cover) .di-cover.is-cover-loaded {
  animation: di-cover-spin 14s linear infinite;
}

.dynamic-island.is-visible.is-playing.is-paused .di-cover-wrap:not(.is-no-cover) .di-cover.is-cover-loaded,
.dynamic-island.is-visible.island-pinned.is-paused .di-cover-wrap:not(.is-no-cover) .di-cover.is-cover-loaded {
  animation-play-state: paused;
}

.chart-island.is-playing .di-cover-wrap.is-cover-ready .di-cover.is-cover-loaded,
.chart-island.is-paused .di-cover-wrap.is-cover-ready .di-cover.is-cover-loaded {
  animation: di-cover-spin 14s linear infinite;
}

.chart-island.is-paused .di-cover-wrap.is-cover-ready .di-cover.is-cover-loaded {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .dynamic-island .di-cover-wrap .di-cover,
  .chart-island .di-cover-wrap .di-cover {
    animation: none !important;
  }

  .cover-img,
  .di-cover {
    filter: none !important;
    opacity: 1 !important;
    transition: none !important;
    will-change: auto;
  }

  .cover-wrap.is-no-cover::before,
  .cover-wrap.is-cover-pending::before,
  .di-cover-wrap.is-no-cover::before,
  .di-cover-wrap.is-cover-pending::before {
    transition: none !important;
  }
}

.di-content {
  flex: 1;
  min-width: 0;
  position: relative;
  height: var(--di-cover);
}

.di-row {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: var(--di-gap);
  white-space: nowrap;
  transition:
    opacity 0.32s ease,
    transform 0.42s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.di-row--loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  opacity: 1;
  transform: scale(1);
}

.di-row--playing {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.dynamic-island.is-playing:not(.is-loading) .di-row--loading {
  opacity: 0;
  transform: scale(0.9);
}

.dynamic-island.is-playing:not(.is-loading) .di-row--playing {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.dynamic-island.is-loading .di-row--loading {
  opacity: 1;
  transform: scale(1);
}

.dynamic-island.is-loading .di-row--playing {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

/* 歌词页顶部常驻岛：加载时展示封面 + 加载行 */
.dynamic-island.island-pinned.is-loading:not(.is-playing) .di-cover-wrap {
  width: var(--di-cover);
  opacity: 1;
}

/* 搜索列表页：加载态与在线模式一致（紧凑胶囊 + 六点动画，非 pinned 宽岛） */
body.searched .dynamic-island.is-loading:not(.island-pinned):not(.is-playing) .di-inner {
  width: 156px;
  gap: 11px;
  padding: 11px;
}

body.searched .dynamic-island.is-loading:not(.island-pinned):not(.is-playing) .di-cover-wrap {
  width: 0;
  opacity: 0;
}

/* 灵动岛内联反馈：加载/失败在 meta 区替换歌名歌手，不弹出独立 loading 气泡 */
.dynamic-island.is-playing.is-meta-feedback .di-row--loading,
.chart-island.is-playing.is-meta-feedback .di-row--success,
.dynamic-island.is-playing.is-meta-feedback .di-row--success,
.chart-island.is-playing.is-meta-feedback .di-row--error,
.dynamic-island.is-playing.is-meta-feedback .di-row--error {
  display: none;
}

.chart-island.is-playing.is-meta-feedback .ci-meta .di-title,
.chart-island.is-playing.is-meta-feedback .ci-meta .di-sub {
  display: block;
}

.dynamic-island.is-playing.is-meta-feedback .di-row--playing {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  width: 100%;
  box-sizing: border-box;
}

.chart-island .di-sub .di-dots--inline {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
  transform: scale(0.85);
}

body.searched .dynamic-island.is-search-list-island.is-playing.is-meta-feedback .di-inner {
  width: min(380px, calc(100vw - 48px));
  max-width: min(380px, calc(100vw - 48px));
}

.chart-island.is-meta-loading .ci-eq,
.chart-island.is-meta-failed .ci-eq,
.dynamic-island.is-meta-loading .di-eq,
.dynamic-island.is-meta-failed .di-eq {
  opacity: 0.35;
}

.chart-island.is-meta-failed .di-sub,
.dynamic-island.is-meta-failed .di-sub {
  color: #ff8a8a;
}

.chart-island.is-meta-success:not(.is-meta-loading) .ci-meta .di-sub,
.dynamic-island.is-meta-success:not(.is-meta-loading) .di-meta .di-sub {
  color: #b8f5d8;
}

.chart-island.is-meta-refresh .ci-meta .di-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.chart-island.is-meta-refresh .di-meta-check {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  color: #34d399;
  background: rgba(52, 211, 153, 0.2);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.25);
}

.chart-island.is-meta-refresh .di-meta-check__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@keyframes chartRefreshTitleIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chartRefreshSubIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes chartRefreshCheckPop {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }
  65% {
    transform: scale(1.14);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.chart-island.is-meta-refresh.is-meta-refresh-enter .ci-meta .di-title {
  animation: chartRefreshTitleIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chart-island.is-meta-refresh.is-meta-refresh-enter .ci-meta .di-sub {
  animation: chartRefreshSubIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.chart-island.is-meta-refresh.is-meta-refresh-enter .di-meta-check {
  animation: chartRefreshCheckPop 0.48s cubic-bezier(0.34, 1.45, 0.64, 1) 0.18s both;
}

@media (prefers-reduced-motion: reduce) {
  .chart-island.is-meta-refresh.is-meta-refresh-enter .ci-meta .di-title,
  .chart-island.is-meta-refresh.is-meta-refresh-enter .ci-meta .di-sub,
  .chart-island.is-meta-refresh.is-meta-refresh-enter .di-meta-check {
    animation: none;
  }
}

.dynamic-island .di-sub .di-dots--inline {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
  transform: scale(0.85);
}

/* 歌词页展开时隐藏底部灵动岛；关闭歌词页时过渡滑入（避免 visibility 无法动画） */
body.searched.player-open.has-chart-island .chart-island:not([hidden]) {
  opacity: 0;
  transform: translateX(-50%) translateY(calc(100% + 32px)) scale(0.88);
  pointer-events: none;
  visibility: visible;
}

body.searched.player-closing.has-chart-island .chart-island:not([hidden]) {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  body.searched.player-open.has-chart-island .chart-island:not([hidden]),
  body.searched.player-closing.has-chart-island .chart-island:not([hidden]) {
    transform: translateX(-50%);
    transition-duration: 0.18s;
  }
}

.di-row--error {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.dynamic-island.is-error .di-row--loading,
.dynamic-island.is-error .di-row--playing {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.dynamic-island.is-error .di-row--error {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.dynamic-island.is-error .di-inner {
  width: min(300px, calc(100vw - 40px));
  gap: var(--di-gap);
  padding: var(--di-gap);
}

.dynamic-island.is-error.is-error-only .di-inner {
  width: auto;
  min-width: 140px;
  max-width: min(280px, calc(100vw - 40px));
}

.dynamic-island.is-error.is-error-only .di-cover-wrap {
  width: 0;
  opacity: 0;
}

.dynamic-island.is-error:not(.is-error-only) .di-cover-wrap {
  width: var(--di-cover);
  opacity: 1;
}

.di-error-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  color: #ff007f;
  background: rgba(255, 0, 127, 0.18);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.25);
}

.di-sub--error,
.dynamic-island.is-error .di-sub {
  color: rgba(255, 120, 180, 0.95);
}

.di-row--success {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.dynamic-island.is-success .di-row--loading,
.dynamic-island.is-success .di-row--playing,
.dynamic-island.is-success .di-row--error {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.dynamic-island.is-success .di-row--success {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.dynamic-island.is-success .di-inner {
  width: min(300px, calc(100vw - 40px));
  gap: var(--di-gap);
  padding: var(--di-gap);
}

.dynamic-island.is-success:not(.is-success-only) .di-cover-wrap {
  width: var(--di-cover);
  opacity: 1;
}

.dynamic-island.is-success.is-success-only .di-cover-wrap {
  width: 0;
  opacity: 0;
}

.di-success-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: #5eead4;
  background: rgba(94, 234, 212, 0.15);
  box-shadow: 0 0 10px rgba(94, 234, 212, 0.2);
}

.di-sub--success,
.dynamic-island.is-success .di-sub {
  color: rgba(150, 240, 220, 0.9);
}

.di-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.02em;
}

.di-dots {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

/* 加载/失败：6 小点依次亮起，与文案垂直居中 */
.di-dots--seq {
  align-items: center;
  gap: 2px;
  height: 0.75rem;
}

.di-dots--seq i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ff007f;
  opacity: 0.12;
  transform: scale(0.55);
  animation: diDotSeq 1.5s ease-in-out infinite;
}

.di-dots--seq i:nth-child(1) {
  animation-delay: 0s;
}

.di-dots--seq i:nth-child(2) {
  animation-delay: 0.1s;
}

.di-dots--seq i:nth-child(3) {
  animation-delay: 0.2s;
}

.di-dots--seq i:nth-child(4) {
  animation-delay: 0.3s;
}

.di-dots--seq i:nth-child(5) {
  animation-delay: 0.4s;
}

.di-dots--seq i:nth-child(6) {
  animation-delay: 0.5s;
}

@keyframes diDotSeq {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(0.5);
  }
  10%,
  28% {
    opacity: 1;
    transform: scale(1);
  }
  38%,
  100% {
    opacity: 0.12;
    transform: scale(0.5);
  }
}

.dynamic-island.is-load-failed .di-label {
  color: rgba(255, 130, 175, 0.98);
}

@media (prefers-reduced-motion: reduce) {
  .di-dots--seq i {
    animation: none;
    opacity: 0.85;
    transform: scale(1);
  }
}

.di-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 42px;
  height: 30px;
  flex-shrink: 0;
  margin: 0;
}

.di-bar {
  --di-dot: 3px;
  display: block;
  width: var(--di-dot);
  border-radius: 999px;
  background: linear-gradient(180deg, #ff66b3 0%, #ff007f 55%, #e6006e 100%);
  box-shadow: 0 0 8px rgba(255, 0, 127, 0.4);
  transform-origin: center center;
  flex-shrink: 0;
  transition:
    transform 0.85s cubic-bezier(0.25, 0.9, 0.35, 1),
    opacity 0.65s ease,
    box-shadow 0.65s ease;
  transition-delay: 0s;
}

/* 共用水平中线对齐，仅高度错落（上下沿不对齐） */
.di-bar:nth-child(1) {
  height: 11px;
}

.di-bar:nth-child(2) {
  height: 19px;
}

.di-bar:nth-child(3) {
  height: 26px;
}

.di-bar:nth-child(4) {
  height: 15px;
}

.di-bar:nth-child(5) {
  height: 21px;
}

/* 暂停 / 切歌加载：长条缓慢沿中线收成正圆（scaleY 过渡，宽度不变） */
.dynamic-island.is-paused .di-eq .di-bar,
.chart-island.is-paused .di-eq .di-bar,
.di-eq.is-eq-paused .di-bar {
  animation: none !important;
  opacity: 0.72;
  box-shadow: 0 0 6px rgba(255, 0, 127, 0.32);
  transition:
    transform 0.85s cubic-bezier(0.25, 0.9, 0.35, 1),
    opacity 0.65s ease,
    box-shadow 0.65s ease !important;
}

.dynamic-island.is-paused .di-eq .di-bar:nth-child(1),
.chart-island.is-paused .di-eq .di-bar:nth-child(1),
.di-eq.is-eq-paused .di-bar:nth-child(1) {
  transform: scaleY(0.273) !important;
  transition-delay: 0s;
}

.dynamic-island.is-paused .di-eq .di-bar:nth-child(2),
.chart-island.is-paused .di-eq .di-bar:nth-child(2),
.di-eq.is-eq-paused .di-bar:nth-child(2) {
  transform: scaleY(0.158) !important;
  transition-delay: 0.07s;
}

.dynamic-island.is-paused .di-eq .di-bar:nth-child(3),
.chart-island.is-paused .di-eq .di-bar:nth-child(3),
.di-eq.is-eq-paused .di-bar:nth-child(3) {
  transform: scaleY(0.115) !important;
  transition-delay: 0.14s;
}

.dynamic-island.is-paused .di-eq .di-bar:nth-child(4),
.chart-island.is-paused .di-eq .di-bar:nth-child(4),
.di-eq.is-eq-paused .di-bar:nth-child(4) {
  transform: scaleY(0.2) !important;
  transition-delay: 0.07s;
}

.dynamic-island.is-paused .di-eq .di-bar:nth-child(5),
.chart-island.is-paused .di-eq .di-bar:nth-child(5),
.di-eq.is-eq-paused .di-bar:nth-child(5) {
  transform: scaleY(0.143) !important;
  transition-delay: 0s;
}

/* 播放：频谱跳动（transform 由 keyframes 控制） */
.dynamic-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar,
.chart-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar {
  animation: diBar 2.1s cubic-bezier(0.45, 0.05, 0.25, 1) infinite;
  transition: opacity 0.65s ease, box-shadow 0.65s ease;
  transition-delay: 0s;
}

.dynamic-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(1),
.chart-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(1) {
  animation-duration: 1.85s;
  animation-delay: 0s;
}

.dynamic-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(2),
.chart-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(2) {
  animation-duration: 2.35s;
  animation-delay: 0.22s;
}

.dynamic-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(3),
.chart-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(3) {
  animation-duration: 1.9s;
  animation-delay: 0.08s;
}

.dynamic-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(4),
.chart-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(4) {
  animation-duration: 2.2s;
  animation-delay: 0.35s;
}

.dynamic-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(5),
.chart-island.is-playing:not(.is-paused) .di-eq:not(.is-eq-paused) .di-bar:nth-child(5) {
  animation-duration: 2.05s;
  animation-delay: 0.14s;
}

@keyframes diBar {
  0%,
  100% {
    transform: scaleY(0.32);
    opacity: 0.5;
  }
  20% {
    transform: scaleY(0.58);
    opacity: 0.72;
  }
  38% {
    transform: scaleY(0.88);
    opacity: 0.9;
  }
  52% {
    transform: scaleY(0.4);
    opacity: 0.65;
  }
  68% {
    transform: scaleY(1);
    opacity: 1;
  }
  84% {
    transform: scaleY(0.52);
    opacity: 0.78;
  }
}

.di-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
}

.di-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.di-sub {
  font-size: 0.6875rem;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.dynamic-island.is-playing .di-row--playing .di-eq {
  flex-shrink: 0;
}

.dynamic-island.is-playing .di-row--playing .di-meta,
.dynamic-island.island-pinned .di-row--playing .di-meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.dynamic-island.is-playing .di-meta,
.dynamic-island.island-pinned .di-meta {
  justify-content: center;
}

.dynamic-island.is-playing .di-title,
.dynamic-island.island-pinned .di-title,
.dynamic-island.is-playing .di-sub,
.dynamic-island.island-pinned .di-sub {
  display: block;
  max-width: 100%;
}

/* Toast（略高于底部灵动岛，避免重叠） */
.toast {
  position: fixed;
  bottom: calc(92px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(40, 40, 45, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.875rem;
  z-index: 200;
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
  backdrop-filter: blur(12px);
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.player-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  /* 不支持 scrollbar-gutter 时由 JS 写入 --scroll-lock-pad 补偿 */
  padding-right: var(--scroll-lock-pad, 0px);
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  .song-item {
    grid-template-columns: 48px 1fr auto;
    min-height: 48px;
  }

  .cover-wrap {
    width: 48px;
    height: 48px;
  }

  .song-aside {
    min-height: 48px;
  }

  .player-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .player-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title title"
      "progress controls";
    gap: 10px 12px;
    align-items: center;
  }

  body.searched .player-toolbar {
    grid-template-areas: "progress controls";
  }

  .player-info {
    grid-area: title;
    flex: none;
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  body.searched .player-info {
    display: none;
  }

  .player-info h2 {
    display: block;
    width: 100%;
  }

  .progress-wrap {
    grid-area: progress;
    flex: none;
    min-width: 0;
    width: 100%;
    order: unset;
    gap: 8px;
  }

  .progress-time {
    min-width: 34px;
    flex-shrink: 0;
    font-size: 0.6875rem;
  }

  .progress-track {
    min-width: 0;
  }

  .play-btns {
    grid-area: controls;
    order: unset;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .btn-play-main {
    width: 46px;
    height: 46px;
  }
}

@media (min-width: 768px) {
  .results-wrap {
    padding-bottom: 60px;
  }
}

/* === bg-liquid === */

/* 液态黑 + 青色背景：柔和光晕、慢速漂移 */
:root {
  --bg-base: #030508;
}

html {
  background: var(--bg-base);
}

body {
  background: transparent;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg-base);
}

/* 底层静态景深 */
.page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 70% at 50% 100%, #071218 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(0, 90, 85, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 70% 45% at 100% 100%, rgba(0, 70, 110, 0.1) 0%, transparent 48%);
}

.page-bg__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(88px);
  opacity: 0.55;
  will-change: transform;
}

.page-bg__blob--1 {
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  left: 8%;
  top: 12%;
  background: radial-gradient(circle, rgba(0, 210, 190, 0.35) 0%, rgba(0, 100, 95, 0.08) 55%, transparent 72%);
  animation: liquidDrift1 28s ease-in-out infinite alternate;
}

.page-bg__blob--2 {
  width: min(65vw, 480px);
  height: min(65vw, 480px);
  right: 5%;
  bottom: 18%;
  background: radial-gradient(circle, rgba(30, 160, 220, 0.28) 0%, rgba(0, 60, 90, 0.06) 55%, transparent 72%);
  animation: liquidDrift2 34s ease-in-out infinite alternate;
}

.page-bg__blob--3 {
  width: min(50vw, 360px);
  height: min(50vw, 360px);
  left: 42%;
  top: 55%;
  background: radial-gradient(circle, rgba(0, 160, 150, 0.22) 0%, transparent 68%);
  animation: liquidDrift3 24s ease-in-out infinite alternate;
  opacity: 0.4;
}

.page-bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

@keyframes liquidDrift1 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(6vw, 5vh) scale(1.08);
  }
}

@keyframes liquidDrift2 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-8vw, -6vh) scale(1.06);
  }
}

@keyframes liquidDrift3 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-5vw, 4vh) scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-bg__blob {
    animation: none;
  }
}

/* === chart-island === */

/* 首页排行榜灵动岛：样式与搜索结果页 #dynamicIsland 一致 */
.chart-island {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 215;
  width: fit-content;
  max-width: min(380px, calc(100vw - 28px));
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 -4px 20px rgba(0, 0, 0, 0.35)) drop-shadow(0 8px 28px rgba(0, 0, 0, 0.4));
  transition:
    opacity 0.35s ease,
    transform 0.55s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.chart-island:not([hidden]) .ci-bar {
  pointer-events: auto;
  position: relative;
  z-index: 3;
}

.chart-island[hidden] {
  opacity: 0;
  transform: translateX(-50%) translateY(calc(100% + 28px)) scale(0.9);
}

.chart-island:not([hidden]) {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.chart-island.is-expanded .ci-expand-btn .btn-action-icon--expand {
  transform: rotate(180deg);
}

.chart-island .ci-bar.di-inner {
  width: max-content;
  max-width: min(380px, calc(100vw - 28px));
  box-sizing: border-box;
  cursor: default;
  position: relative;
  z-index: 2;
  gap: 10px;
  transition:
    width 0.48s cubic-bezier(0.34, 1.25, 0.64, 1),
    max-width 0.48s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.chart-island.is-playing .ci-bar.di-inner,
.chart-island.is-paused .ci-bar.di-inner {
  width: min(380px, calc(100vw - 40px));
  max-width: min(380px, calc(100vw - 40px));
}

/* 搜索页继承：收起展开钮，播放钮随 flex 滑至右侧原展开位 */
.chart-island .ci-expand-btn {
  flex-shrink: 0;
  width: 36px;
  min-width: 36px;
  opacity: 1;
  overflow: hidden;
  position: relative;
  z-index: 4;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    width 0.48s cubic-bezier(0.34, 1.25, 0.64, 1),
    min-width 0.48s cubic-bezier(0.34, 1.25, 0.64, 1),
    opacity 0.32s ease,
    margin 0.48s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.chart-island.is-search-carry .ci-expand-btn {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  margin-left: -10px;
}

.chart-island.is-search-carry .ci-meta.di-meta {
  cursor: default;
  pointer-events: none;
}

.chart-island.is-search-carry.is-playing .ci-bar.di-inner,
.chart-island.is-search-carry.is-paused .ci-bar.di-inner {
  width: min(340px, calc(100vw - 40px));
  max-width: min(340px, calc(100vw - 40px));
}

@media (prefers-reduced-motion: reduce) {
  .chart-island .ci-bar.di-inner,
  .chart-island .ci-expand-btn,
  .chart-island .ci-play-btn {
    transition: none;
  }
}

.chart-island.is-playing .di-cover-wrap,
.chart-island.is-paused .di-cover-wrap {
  width: var(--di-cover);
  min-width: var(--di-cover);
  max-width: var(--di-cover);
  height: var(--di-cover);
  opacity: 1;
}

.ci-eq {
  display: none;
}

.chart-island.is-playing .ci-eq,
.chart-island.is-paused .ci-eq {
  display: flex;
}

.ci-cover-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--di-cover);
  height: var(--di-cover);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.ci-cover-btn:focus,
.ci-cover-btn:focus-visible,
.ci-cover-btn:active {
  outline: none;
  background: transparent;
}

.chart-island .di-cover-wrap .di-cover {
  border-radius: 50%;
}

body.player-home-lyric .chart-island .ci-cover-btn {
  position: relative;
  box-shadow: 0 0 0 2px var(--accent);
  transform: scale(1.04);
}

body.player-closing .chart-island .ci-cover-btn {
  transition:
    box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 0 0 0 transparent;
  transform: scale(1);
}

.ci-meta.di-meta {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: default;
}

.chart-island.is-playing .ci-meta.di-meta,
.chart-island.is-paused .ci-meta.di-meta {
  justify-content: center;
}

.chart-island .di-title,
.chart-island .di-sub {
  max-width: 100%;
}

.ci-btn-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s, margin 0.48s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.chart-island .ci-play-btn.ci-btn-icon {
  transition:
    transform 0.2s,
    margin 0.48s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.chart-island button,
.dynamic-island button {
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.chart-island .ci-bar button:focus,
.chart-island .ci-bar button:focus-visible,
.chart-island .ci-panel-head button:focus,
.chart-island .ci-panel-head button:focus-visible,
.dynamic-island button:focus,
.dynamic-island button:focus-visible {
  outline: none;
}

.chart-island .ci-btn-icon:focus,
.chart-island .ci-btn-icon:focus-visible,
.chart-island .ci-btn-icon:active,
.dynamic-island .ci-btn-icon:focus,
.dynamic-island .ci-btn-icon:focus-visible,
.dynamic-island .ci-btn-icon:active {
  outline: none;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
}

@media (hover: hover) and (pointer: fine) {
  .ci-btn-icon:hover {
    background: rgba(255, 255, 255, 0.18);
  }
}

.ci-btn-icon .btn-action-icon,
.ci-btn-icon .play-toggle-icon {
  transition: transform 0.45s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.ci-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 1;
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  border-radius: 18px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  transform: scaleY(0);
  transform-origin: bottom center;
  visibility: hidden;
  transition:
    grid-template-rows 0.38s cubic-bezier(0.34, 1.2, 0.64, 1),
    transform 0.38s cubic-bezier(0.34, 1.25, 0.64, 1),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    visibility 0s linear 0.38s;
  pointer-events: none;
}

.ci-panel-inner {
  overflow: hidden;
  min-height: 0;
  max-height: min(70vh, 560px);
}

.chart-island.is-expanded .ci-panel {
  grid-template-rows: 1fr;
  background: rgba(12, 12, 14, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  transform: scaleY(1);
  visibility: visible;
  transition:
    grid-template-rows 0.38s cubic-bezier(0.34, 1.2, 0.64, 1),
    transform 0.38s cubic-bezier(0.34, 1.25, 0.64, 1),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    visibility 0s;
  z-index: 5;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .chart-island .ci-expand-btn,
  .chart-island .ci-play-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}

.ci-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 8px;
  flex-shrink: 0;
}

.ci-panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

.ci-chart-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 10px;
  max-height: min(calc(70vh - 52px), 508px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ci-chart-placeholder {
  padding: 20px 12px;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
}

.ci-chart-list::-webkit-scrollbar {
  width: 4px;
}

.ci-chart-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 4px;
}

.ci-chart-list::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.ci-chart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s ease, transform 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .ci-chart-item:hover {
    background: rgba(255, 255, 255, 0.06);
  }
}

.ci-chart-item:focus,
.ci-chart-item:focus-visible {
  outline: none;
}

.ci-chart-item:active:not(.is-active) {
  background: transparent;
}

.ci-chart-item.is-active {
  background: rgba(232, 93, 4, 0.15);
}

.ci-chart-item.is-active:active {
  background: rgba(232, 93, 4, 0.15);
}

.ci-chart-rank {
  flex-shrink: 0;
  width: 22px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

.ci-chart-item.is-active .ci-chart-rank {
  color: var(--accent);
}

.ci-chart-meta {
  flex: 1;
  min-width: 0;
}

.ci-chart-name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ci-chart-artist {
  display: block;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.has-chart-island.searched .app {
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

body.has-chart-island.searched .toast {
  bottom: calc(108px + var(--safe-bottom));
}

body.has-chart-island:not(.searched) .toast {
  bottom: calc(108px + var(--safe-bottom));
}

/* === search-loader === */

/* 列表加载动画：搜索页全屏居中（本地目录加载不重排页面，避免列表闪动） */
body.searched:has(.search-loading-item) {
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
}

body.searched:has(.search-loading-item) .app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden;
}

body.searched:has(.search-loading-item) .results-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding-bottom: 20px;
}

body.searched:has(.search-loading-item) .results-inner {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body.searched:has(.search-loading-item) .back-to-top {
  display: none !important;
}

body.searched .song-list:has(> .search-loading-item:only-child) {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
  padding: 0;
}

/* 本地目录加载：仅淡化列表，不改变整页 flex/overflow */


.search-loading-item {
  list-style: none;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  animation: none !important;
  opacity: 1 !important;
}

.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 0;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

.search-loading .pl {
  width: 6em;
  height: 6em;
  display: block;
}

.search-loading .pl__ring {
  animation: pl-ringA 2s linear infinite;
}

.search-loading .pl__ring--a {
  stroke: #f42f25;
}

.search-loading .pl__ring--b {
  animation-name: pl-ringB;
  stroke: #f49725;
}

.search-loading .pl__ring--c {
  animation-name: pl-ringC;
  stroke: #255ff4;
}

.search-loading .pl__ring--d {
  animation-name: pl-ringD;
  stroke: #f42582;
}

.search-loading__label {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

@keyframes pl-ringA {
  from,
  4% {
    stroke-dasharray: 0 660;
    stroke-width: 20;
    stroke-dashoffset: -330;
  }

  12% {
    stroke-dasharray: 60 600;
    stroke-width: 30;
    stroke-dashoffset: -335;
  }

  32% {
    stroke-dasharray: 60 600;
    stroke-width: 30;
    stroke-dashoffset: -595;
  }

  40%,
  54% {
    stroke-dasharray: 0 660;
    stroke-width: 20;
    stroke-dashoffset: -660;
  }

  62% {
    stroke-dasharray: 60 600;
    stroke-width: 30;
    stroke-dashoffset: -665;
  }

  82% {
    stroke-dasharray: 60 600;
    stroke-width: 30;
    stroke-dashoffset: -925;
  }

  90%,
  to {
    stroke-dasharray: 0 660;
    stroke-width: 20;
    stroke-dashoffset: -990;
  }
}

@keyframes pl-ringB {
  from,
  12% {
    stroke-dasharray: 0 220;
    stroke-width: 20;
    stroke-dashoffset: -110;
  }

  20% {
    stroke-dasharray: 20 200;
    stroke-width: 30;
    stroke-dashoffset: -115;
  }

  40% {
    stroke-dasharray: 20 200;
    stroke-width: 30;
    stroke-dashoffset: -195;
  }

  48%,
  62% {
    stroke-dasharray: 0 220;
    stroke-width: 20;
    stroke-dashoffset: -220;
  }

  70% {
    stroke-dasharray: 20 200;
    stroke-width: 30;
    stroke-dashoffset: -225;
  }

  90% {
    stroke-dasharray: 20 200;
    stroke-width: 30;
    stroke-dashoffset: -305;
  }

  98%,
  to {
    stroke-dasharray: 0 220;
    stroke-width: 20;
    stroke-dashoffset: -330;
  }
}

@keyframes pl-ringC {
  from {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: 0;
  }

  8% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -5;
  }

  28% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -175;
  }

  36%,
  58% {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: -220;
  }

  66% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -225;
  }

  86% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -395;
  }

  94%,
  to {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: -440;
  }
}

@keyframes pl-ringD {
  from,
  8% {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: 0;
  }

  16% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -5;
  }

  36% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -175;
  }

  44%,
  50% {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: -220;
  }

  58% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -225;
  }

  78% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -395;
  }

  86%,
  to {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: -440;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-loading .pl__ring {
    animation: none;
  }
}

/* 平板/窄屏：标题与搜索框留出呼吸间距 */
@media (max-width: 900px) {
  .top-nav {
    gap: 12px 18px;
  }
}

/* 手机端：标题左、搜索右，单行自适应 */
@media (max-width: 640px) {
  /* 输入聚焦时避免整页被软键盘顶起（配合 viewport interactive-widget） */
  body.is-mobile-nav {
    min-height: 100dvh;
  }

  body.is-mobile-nav .app {
    min-height: calc(100dvh - var(--top-nav-height, 72px));
  }

  body.is-mobile-nav.searched .app {
    min-height: calc(100dvh - var(--top-nav-height, 72px));
  }

  /* 搜索聚焦：锁定聚焦前布局高度，抵消软键盘导致的 visualViewport 偏移，避免歌词被挤到键盘旁 */
  body.is-mobile-nav.home-search-focus:not(.searched) {
    overflow: hidden;
  }

  body.home-search-focus:not(.searched) .home-hero-lyric:not(.hidden) {
    inset: auto;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    height: var(--home-hero-lock-h, 100dvh);
    min-height: var(--home-hero-lock-h, 100dvh);
    max-height: var(--home-hero-lock-h, 100dvh);
    transform: translateY(calc(-1 * var(--home-hero-vv-offset-top, 0px)));
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--top-nav-height, 72px);
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  .top-nav {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    width: 100%;
    max-width: 100%;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .top-nav__brand {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 38%;
    text-align: left;
    padding-right: 0;
  }

  .top-nav__brand-row {
    justify-content: flex-start;
    gap: 6px;
  }

  .top-nav__brand .brand-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .top-nav__brand .brand-title h1 {
    font-size: clamp(0.875rem, 3.8vw, 1.05rem);
  }

  .top-nav__brand .brand-title__img {
    max-width: 100%;
    max-height: 32px;
    width: auto;
    height: auto;
  }

  .top-nav__search {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: 62%;
    margin: 0;
  }

  .top-nav__search .search-box,
  .top-nav__search .search-box:focus-within {
    min-height: 36px;
    padding: 2px 2px 2px 10px;
  }

  .top-nav__search .search-box input {
    min-width: 0;
    width: 100%;
    padding: 6px 4px 6px 0;
    /* ≥16px 避免 iOS 聚焦放大页面导致首页歌词区下移 */
    font-size: max(16px, 0.8125rem);
  }

  .top-nav__search .search-box input::placeholder {
    font-size: 0.75rem;
  }

  .top-nav__search .search-box button {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
  }

  .top-nav__search .search-btn-icon {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 380px) {
  .top-nav {
    gap: 8px 10px;
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
  }

  .top-nav__brand {
    max-width: 36%;
  }

  .top-nav__search {
    max-width: 64%;
  }
}

/* ========== 首页公告弹窗 ========== */
.announce-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.announce-modal.hidden {
  display: none !important;
}

body.announce-open {
  overflow: hidden;
  padding-right: var(--scroll-lock-pad, 0px);
}

.announce-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: announceFadeIn 0.35s ease;
}

.announce-modal__card {
  position: relative;
  width: min(420px, 100%);
  max-height: min(78vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(28, 28, 32, 0.98) 0%, rgba(12, 12, 14, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  animation: announceCardIn 0.45s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.announce-modal__card-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  transform-origin: center center;
}

.announce-modal__lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.announce-modal__line {
  position: absolute;
  left: 50%;
  width: calc(100% - 48px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(211, 33, 123, 0.15) 0%,
    rgba(255, 120, 190, 0.95) 50%,
    rgba(211, 33, 123, 0.15) 100%
  );
  box-shadow: none;
  transform: translateX(-50%) scaleX(0);
  opacity: 0;
}

.announce-modal.is-closing .announce-modal__lines {
  z-index: 3;
}

.announce-modal.is-closing .announce-modal__line {
  box-shadow: 0 0 14px rgba(211, 33, 123, 0.5);
}

.announce-modal__line--top {
  top: 13px;
}

.announce-modal__line--bottom {
  bottom: 13px;
}

.announce-modal__glow {
  position: absolute;
  top: -40%;
  left: 50%;
  width: 120%;
  height: 55%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(211, 33, 123, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

.announce-modal__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 0;
}

.announce-modal__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1.35;
}

.announce-modal__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: -4px -6px 0 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.announce-modal__close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.announce-modal__body {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 14px 0 0;
  padding: 0 22px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  white-space: pre-line;
}

.announce-modal__foot {
  position: relative;
  padding: 18px 22px 22px;
}

.announce-modal__btn {
  width: 100%;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  font-synthesis: none;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #d3217b 0%, #ff4da6 100%);
  box-shadow: 0 8px 28px rgba(211, 33, 123, 0.35);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-stroke: 0 transparent;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.announce-modal__btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 32px rgba(211, 33, 123, 0.45);
}

.announce-modal__btn:focus,
.announce-modal__btn:focus-visible,
.announce-modal__btn:active {
  outline: none;
  border: 0;
}

.announce-modal__btn:focus:not(:focus-visible) {
  outline: none;
}

.announce-modal__btn:active {
  transform: scale(0.98);
}

@media (max-width: 640px) {
  .announce-modal__btn {
    font-weight: 500;
    -webkit-text-stroke: 0;
    text-shadow: none;
    box-shadow: 0 6px 22px rgba(211, 33, 123, 0.3);
  }

  .announce-modal__btn:hover,
  .announce-modal__btn:focus,
  .announce-modal__btn:focus-visible,
  .announce-modal__btn:active {
    outline: none;
    box-shadow: 0 6px 22px rgba(211, 33, 123, 0.3);
    filter: none;
  }
}

@keyframes announceFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes announceCardIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 关闭：框体上下收成线条 → 线条左右缩成圆点消失 */
.announce-modal.is-closing {
  pointer-events: none;
}

.announce-modal.is-closing .announce-modal__backdrop {
  animation: announceBackdropOut 0.58s ease forwards;
}

.announce-modal.is-closing .announce-modal__card {
  animation: announceCardShellOut 0.36s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
  overflow: visible;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.announce-modal.is-closing .announce-modal__glow {
  opacity: 0;
  transition: opacity 0.12s ease;
}

.announce-modal.is-closing .announce-modal__card-content {
  animation: announceContentToLines 0.34s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

.announce-modal.is-closing .announce-modal__line--top {
  animation:
    announceLineAppear 0.2s 0.26s ease forwards,
    announceLinePinch 0.44s 0.34s cubic-bezier(0.45, 0.05, 0.2, 1) forwards;
}

.announce-modal.is-closing .announce-modal__line--bottom {
  animation:
    announceLineAppear 0.2s 0.28s ease forwards,
    announceLinePinch 0.44s 0.36s cubic-bezier(0.45, 0.05, 0.2, 1) forwards;
}

@keyframes announceBackdropOut {
  from {
    opacity: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  to {
    opacity: 0;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
  }
}

@keyframes announceCardShellOut {
  0% {
    max-height: min(78vh, 560px);
  }
  100% {
    max-height: 30px;
    min-height: 30px;
  }
}

@keyframes announceContentToLines {
  0% {
    opacity: 1;
    transform: scaleY(1);
    filter: blur(0);
  }
  50% {
    opacity: 0.25;
    transform: scaleY(0.14);
    filter: blur(0.6px);
  }
  100% {
    opacity: 0;
    transform: scaleY(0);
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
}

@keyframes announceLineAppear {
  from {
    opacity: 0;
    transform: translateX(-50%) scaleX(0.5);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
  }
}

@keyframes announceLinePinch {
  0% {
    transform: translateX(-50%) scaleX(1);
    width: calc(100% - 48px);
    height: 2px;
    border-radius: 999px;
    opacity: 1;
  }
  62% {
    transform: translateX(-50%) scaleX(0.07);
    height: 3px;
    border-radius: 999px;
    opacity: 0.88;
  }
  100% {
    transform: translateX(-50%) scaleX(0);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .announce-modal__backdrop,
  .announce-modal__card {
    animation: none;
  }

  .announce-modal.is-closing .announce-modal__backdrop,
  .announce-modal.is-closing .announce-modal__card,
  .announce-modal.is-closing .announce-modal__card-content,
  .announce-modal.is-closing .announce-modal__line--top,
  .announce-modal.is-closing .announce-modal__line--bottom {
    animation: none !important;
  }
}

/* —— 本地音乐浏览 —— */
.hidden {
  display: none !important;
}

.local-shell {
  display: none !important;
}

html:has(body.local-music-mode:not(.searched)) {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
}

body.local-music-mode:not(.searched) {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100dvh;
  max-height: none;
}

body.local-music-mode:not(.searched) .app {
  display: block;
  min-height: calc(100dvh - var(--top-nav-height, 72px));
  overflow: visible;
  box-sizing: border-box;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

body.local-music-mode:not(.searched) .local-shell:not([hidden]) {
  display: block !important;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: 0;
  padding-top: var(--local-bc-bar-height, 48px);
  padding-bottom: 12px;
  box-sizing: border-box;
  overflow: visible;
}

.local-shell-head {
  position: relative;
  z-index: 1;
  background: transparent;
}

.local-top-divider {
  flex-shrink: 0;
  height: 1px;
  width: 100%;
  margin: 0;
  padding: 0 20px;
  box-sizing: border-box;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.14) 18%,
    rgba(255, 255, 255, 0.14) 82%,
    transparent 100%
  );
  pointer-events: none;
}

.local-bc-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.local-roots-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  max-width: min(52vw, 320px);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 2px 0;
}

.local-roots-bar:not([hidden]) {
  display: flex;
}

.local-roots-bar[hidden] {
  display: none !important;
}

.local-root-btn {
  flex-shrink: 0;
  max-width: 140px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(18, 22, 28, 0.72);
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.local-root-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

.local-root-btn.is-active {
  color: var(--text);
  border-color: rgba(232, 93, 4, 0.55);
  background: rgba(232, 93, 4, 0.14);
}

.local-root-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.local-bc-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px 12px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 20px 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.local-music-mode:not(.searched) .local-bc-bar {
  position: fixed;
  top: var(--top-nav-height, 72px);
  left: 0;
  right: 0;
  z-index: 34;
  width: 100%;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  background: rgba(3, 8, 12, 0.94);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

.local-bc {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.local-bc__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.local-bc__link {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  font: inherit;
  transition: color 0.2s, background 0.2s;
}

.local-bc__link:hover,
.local-bc__link.is-current {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.local-bc__sep {
  opacity: 0.45;
  user-select: none;
}

.local-view-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(18, 22, 28, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.local-view-btn:hover {
  border-color: rgba(232, 93, 4, 0.45);
  background: rgba(232, 93, 4, 0.12);
}

.local-view-btn:active {
  transform: scale(0.96);
}

.local-view-btn:focus {
  outline: none;
}

.local-view-btn:focus-visible {
  outline: 2px solid rgba(232, 93, 4, 0.55);
  outline-offset: 2px;
}

.local-view-btn.is-active,
.local-view-btn[aria-pressed="true"] {
  border-color: rgba(232, 93, 4, 0.65);
  background: rgba(232, 93, 4, 0.22);
  box-shadow: 0 0 0 1px rgba(232, 93, 4, 0.35), 0 0 14px rgba(232, 93, 4, 0.2);
}

.local-view-btn.is-active .local-view-btn__icon,
.local-view-btn[aria-pressed="true"] .local-view-btn__icon {
  filter: brightness(1.15) saturate(1.1);
}

.local-view-btn.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

body.local-view-flat .local-bc {
  opacity: 0.45;
  pointer-events: none;
}

.local-item--loading {
  pointer-events: none;
  opacity: 0.75;
}

.local-browser {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 4px 20px 8px;
  overflow: visible;
}

.local-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.local-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  background: rgba(18, 22, 28, 0.55);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.local-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(24, 30, 38, 0.85);
}

.local-item.is-active {
  border-color: rgba(232, 93, 4, 0.45);
  background: rgba(232, 93, 4, 0.1);
  scroll-margin-top: calc(var(--top-nav-height, 72px) + var(--local-bc-bar-height, 48px) + 10px);
  scroll-margin-bottom: calc(96px + env(safe-area-inset-bottom, 0px) + 12px);
}

.local-item.is-active.is-kb-nav {
  border-color: rgba(232, 93, 4, 0.72);
  box-shadow: 0 0 0 2px rgba(232, 93, 4, 0.38);
}

.local-item:focus {
  outline: none;
}

.local-item:focus-visible {
  outline: none;
}

.local-item__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  opacity: 0.88;
}

.local-item__meta {
  min-width: 0;
  flex: 1;
}

.local-item__name {
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.local-item--file .local-item__sub {
  display: none;
}

@media (max-width: 640px) {
  .local-bc-bar {
    padding-left: 14px;
    padding-right: 14px;
    gap: 8px;
  }

  .local-bc-actions {
    gap: 6px;
  }

  .local-roots-bar {
    max-width: min(40vw, 180px);
  }

  .local-root-btn {
    max-width: 108px;
    padding: 5px 8px;
    font-size: 0.6875rem;
  }

  .local-view-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}

.local-ctx-menu {
  position: fixed;
  z-index: 400;
  min-width: 148px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 22, 28, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.local-ctx-menu__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.local-ctx-menu__item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.local-ctx-menu__item--danger {
  color: #fca5a5;
}

.local-ctx-menu__item--danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

body.local-music-mode:not(.searched) .app .results-wrap {
  display: none;
}

body.local-music-mode.searched .local-shell {
  display: none !important;
}

body.local-music-mode.searched .app {
  height: auto;
  max-height: none;
  min-height: calc(100dvh - var(--top-nav-height, 72px));
  overflow: visible;
  padding-bottom: 0;
}

body.local-music-mode:not(.searched) .home-hero-lyric {
  display: none !important;
}

body.local-music-mode .chart-island .ci-panel {
  display: none !important;
}

/* 灵动岛右侧：默认展开排行榜；本地模式才显示顺序/随机 */
.chart-island .chart-playmode-icon {
  display: none !important;
}

.chart-island .chart-expand-icon {
  display: block;
}

body.local-music-mode .chart-island .chart-expand-icon {
  display: none !important;
}

body.local-music-mode .chart-island .chart-playmode-icon {
  display: block !important;
}

body.local-music-mode .chart-island .ci-expand-btn.is-shuffle-on .chart-playmode-icon {
  transform: rotate(0deg);
}

.chart-island .ci-expand-btn .chart-playmode-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.25s;
}

.chart-island .ci-cover-btn.is-no-lyrics {
  cursor: default;
  pointer-events: none;
  opacity: 0.92;
}

