:root {
  --bg: #0f0d14;
  --card: #1a1820;
  --text: #e8e2f0;
  --dim: rgba(232,226,240,0.45);
  --accent: #9b7fe8;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── demo page layout ── */
.demo-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 20px calc(var(--safe-bottom) + 100px);
  width: 100%;
}
.demo-header { text-align: center; padding: 20px 0 32px; }
.header-banner {
  width: 100%; border-radius: 16px; overflow: hidden; margin-bottom: 24px;
}
.header-banner img {
  width: 100%; display: block;
}
.demo-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; letter-spacing: 0.02em; }
.demo-header p { color: var(--dim); font-size: 0.88rem; line-height: 1.6; }
.demo-search {
  display: flex; gap: 10px; margin-bottom: 32px;
}
.demo-search input {
  flex: 1; background: var(--card); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 12px 16px; color: var(--text);
  font-size: 0.95rem; font-family: inherit; outline: none;
}
.demo-search input::placeholder { color: var(--dim); }
.demo-search button {
  background: var(--accent); border: none; border-radius: 14px;
  padding: 12px 20px; color: white; font-size: 0.9rem;
  font-family: inherit; cursor: pointer; font-weight: 600; flex-shrink: 0;
}
.demo-search button:active { opacity: 0.8; }
.demo-results { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.demo-result-row {
  background: var(--card); border-radius: 14px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.demo-result-row:active { opacity: 0.7; }
.demo-result-cover {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: rgba(255,255,255,0.08);
}
.demo-result-info { flex: 1; min-width: 0; }
.demo-result-name { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-result-artist { font-size: 0.73rem; color: var(--dim); margin-top: 2px; }
.demo-play-btn {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.demo-play-btn svg { fill: white; width: 14px; height: 14px; margin-left: 2px; }
.demo-section-label {
  font-size: 0.72rem; color: var(--dim); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 12px; padding-left: 4px;
}
.demo-note {
  text-align: center; color: var(--dim); font-size: 0.8rem;
  padding: 20px; line-height: 1.7;
}
.demo-note a { color: var(--accent); text-decoration: none; }

/* ── music card ── */
.music-card {
  border-radius: 18px; overflow: hidden; position: relative;
  width: 100%; cursor: pointer; user-select: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.music-card-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(40px) brightness(0.4) saturate(1.6); transform: scale(1.2); z-index: 0;
}
.music-card-inner {
  position: relative; z-index: 1; padding: 18px 16px;
  display: flex; align-items: center; gap: 12px; min-height: 90px;
}
.music-card-info { flex: 1; min-width: 0; }
.music-card-tag { font-size: 0.6rem; color: rgba(255,255,255,0.45); letter-spacing: 0.1em; margin-bottom: 6px; }
.music-card-name { font-size: 1.05rem; font-weight: 700; color: white; line-height: 1.2; }
.music-card-artist { font-size: 0.75rem; color: rgba(255,255,255,0.55); margin-top: 3px; }
.music-card-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.music-card-disc {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
  position: relative; flex-shrink: 0;
}
.music-card-disc-base {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
}
.music-card-disc-grooves {
  position: absolute; inset: 3px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.05); box-shadow: 0 0 0 3px rgba(255,255,255,0.03), 0 0 0 6px rgba(255,255,255,0.02);
}
.music-card-disc-hole {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: #111; top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.music-card-cover {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.music-card-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(10px);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content:center;
}
.music-card-btn svg { fill: white; width: 13px; height: 13px; margin-left: 2px; }
.music-card-progress {
  position: absolute; bottom: 0; left: 0; height: 2px;
  background: rgba(255,255,255,0.6); border-radius: 1px; transition: width 0.25s linear;
}

/* ── lyric player ── */
#lyricPlayer {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 99999; background: #111;
  flex-direction: column; align-items: center; box-sizing: border-box;
}
#lyricPlayer.open { display: flex; }
#lyricPlayer .lp-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(60px) brightness(0.35) saturate(1.4); transform: scale(1.1); z-index: 0;
}
#lyricPlayer .lp-content {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  align-items: center; width: 100%; max-width: 480px; flex: 1; overflow: hidden;
}
#lpInnerWrap {
  display: flex; flex-direction: column; width: 100%; flex: 1; overflow: hidden;
  padding: calc(var(--safe-top) + 12px) 20px 0;
}
#lpLyricsInner { display: flex; flex-direction: column; align-items: center; padding: 40px 0 60px; }
#lpLyricsInner .lp-line {
  text-align: center; padding: 10px 0; cursor: pointer;
  transition: opacity 0.3s, transform 0.3s; opacity: 0.3;
  font-size: 0.95rem; color: white; line-height: 1.5;
}
#lpLyricsInner .lp-line.active { opacity: 1; transform: scale(1.06); font-weight: 600; }
#lpLyricsInner .lp-trans { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-top: 2px; }
#lpInputBar {
  padding: 8px 16px calc(var(--safe-bottom) + 8px);
  background: rgba(0,0,0,0.3); backdrop-filter: blur(10px);
  display: flex; gap: 10px; align-items: center; width: 100%; flex-shrink: 0;
}
#lpChatInput {
  flex: 1; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px; padding: 10px 16px; color: white;
  font-size: 0.9rem; font-family: inherit; outline: none; resize: none;
}
#lpChatInput::placeholder { color: rgba(255,255,255,0.3); }

/* ── mini player ── */
#miniPlayer {
  display: none; position: fixed; bottom: 0;
  left: 0; right: 0; z-index: 9999;
  padding-bottom: var(--safe-bottom);
  background: var(--card); border-top: 1px solid rgba(255,255,255,0.06);
  flex-direction: column; box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
#miniPlayer.visible { display: flex; }
.mini-progress-bar {
  height: 2px; background: rgba(255,255,255,0.12); width: 100%;
}
.mini-progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.25s linear; }
.mini-inner {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; cursor: pointer;
}
.mini-disc {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: rgba(255,255,255,0.08); position: relative;
}
.mini-disc img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mini-disc-spin {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  animation: spin 4s linear infinite; animation-play-state: paused;
}
.mini-info { flex: 1; min-width: 0; }
.mini-title { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { font-size: 0.68rem; color: var(--dim); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-btn { background: none; border: none; color: var(--text); font-size: 1.1rem; cursor: pointer; padding: 4px; flex-shrink: 0; }

/* ── keyframes ── */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes disc-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
