/* ===== Muse 加密音乐播放器 · 极致暗色玻璃主题 ===== */

:root {
  --bg-dark: #07070a;
  --panel-bg: rgba(22, 22, 30, 0.6);
  --panel-border: rgba(255, 255, 255, 0.08);
  --hover-bg: rgba(255, 255, 255, 0.06);
  --text-0: #ffffff;
  --text-1: #c4c4d4;
  --text-2: #8a8a9e;
  --text-3: #5a5a6e;
  --accent: #8a2be2;
  --accent-2: #e028b0;
  --accent-glow: rgba(224, 40, 176, 0.4);
  --danger: #ff4766;
  --success: #17e67e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.6);
  --sidebar-w: 320px;
  
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

.bg-layer {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: -1; overflow: hidden;
}
.bg-shape {
  position: absolute; border-radius: 50%; filter: blur(90px);
  opacity: 0.4; animation: floatBg 20s ease-in-out infinite alternate;
}
.shape-1 { width: 50vw; height: 50vw; top: -10%; left: -10%; background: var(--accent); }
.shape-2 { width: 40vw; height: 40vw; bottom: -10%; right: -10%; background: var(--accent-2); animation-delay: -5s; }
@keyframes floatBg {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(10vw, 10vh) scale(1.2); }
}

.screen { display: none; width: 100%; height: 100%; position: relative; z-index: 1; }
.screen.active { display: flex; }

#login-screen { align-items: center; justify-content: center; }
.login-card {
  width: 90%; max-width: 400px;
  padding: 48px 40px 40px;
  background: var(--panel-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 80px; height: 80px; margin: 0 auto 24px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 24px; color: #fff;
  box-shadow: 0 12px 28px var(--accent-glow);
}
.login-title { font-size: 32px; font-weight: 800; letter-spacing: 2px; }
.login-subtitle { color: var(--text-2); font-size: 14px; margin-top: 4px; margin-bottom: 32px; }

.input-group { position: relative; margin-bottom: 20px; }
.input-group input {
  width: 100%; padding: 16px 48px 16px 20px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm); color: var(--text-0); font-size: 15px;
  outline: none; transition: all 0.3s ease;
}
.input-group input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(224, 40, 176, 0.2); }
.toggle-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; color: var(--text-2); border-radius: 8px; }
.toggle-btn:hover { color: var(--text-0); background: var(--hover-bg); }

.btn-primary {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 1px;
  border-radius: var(--radius-sm); transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { box-shadow: 0 8px 24px var(--accent-glow); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-error {
  margin-top: 16px; padding: 12px 16px;
  background: rgba(255, 71, 102, 0.15); border: 1px solid rgba(255, 71, 102, 0.3);
  border-radius: var(--radius-sm); color: var(--danger); font-size: 13px; text-align: left;
}
.login-hint { margin-top: 24px; color: var(--text-3); font-size: 12px; }

#player-screen { flex-direction: row; }

.sidebar {
  width: var(--sidebar-w); background: var(--panel-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--panel-border);
  display: flex; flex-direction: column; flex-shrink: 0; z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-header {
  padding: 24px 20px 16px; display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800;
  background: linear-gradient(to right, var(--text-0), var(--text-1)); -webkit-background-clip: text; color: transparent;
}
.icon-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  color: var(--text-1); border-radius: 12px; transition: all 0.2s;
}
.icon-btn:hover { color: var(--text-0); background: var(--hover-bg); }

.search-box { margin: 10px 20px 20px; position: relative; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.search-box input {
  width: 100%; padding: 12px 16px 12px 42px; background: rgba(0,0,0,0.25);
  border: 1px solid var(--panel-border); border-radius: 12px; color: var(--text-0);
  font-size: 14px; transition: all 0.2s;
}
.search-box input:focus { border-color: var(--accent-2); background: rgba(0,0,0,0.4); }

.playlist-label { padding: 0 24px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 1px; }
.song-count { background: var(--hover-bg); padding: 4px 10px; border-radius: 12px; font-size: 11px; color: var(--text-1); }

.playlist { flex: 1; overflow-y: auto; padding: 0 12px 24px; }
.song-item {
  display: flex; align-items: center; gap: 14px; padding: 10px;
  border-radius: 12px; cursor: pointer; transition: all 0.2s; margin-bottom: 4px;
}
.song-item:hover { background: var(--hover-bg); }
.song-item.active {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.05);
}
.song-item.active .song-title { color: var(--accent-2); font-weight: 600; }
.song-cover {
  width: 48px; height: 48px; border-radius: 10px; object-fit: cover;
  background: rgba(255,255,255,0.05); flex-shrink: 0;
}
.song-cover.placeholder { display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.song-info { flex: 1; min-width: 0; }
.song-title { font-size: 15px; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist { font-size: 13px; color: var(--text-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.mobile-top-bar { display: none; }
.content-wrapper { flex: 1; display: flex; flex-direction: row; min-height: 0; overflow: hidden; }

.lyrics-panel {
  flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 32px 40px; position: relative;
}
.lyrics-panel::before, .lyrics-panel::after {
  content: ''; position: absolute; left: 0; right: 0; height: 80px; pointer-events: none; z-index: 2;
}
.lyrics-panel::before { top: 0; background: linear-gradient(to bottom, var(--bg-dark), transparent); }
.lyrics-panel::after { bottom: 0; background: linear-gradient(to top, var(--bg-dark), transparent); }

.lyrics-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; position: relative; z-index: 3; }
.lyrics-header h3 { font-size: 16px; font-weight: 700; color: var(--text-1); letter-spacing: 1px; }
.lrc-status { font-size: 13px; color: var(--text-3); }

.lyrics-container {
  flex: 1; overflow-y: auto; scroll-behavior: smooth; padding: 120px 0; position: relative; z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}
.lyrics-container::-webkit-scrollbar { display: none; }
.lyric-line {
  padding: 16px 12px; font-size: 18px; line-height: 1.6; color: var(--text-3);
  text-align: center; cursor: pointer; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(0.95); opacity: 0.6; border-radius: 12px; margin: 4px 0;
}
.lyric-line:hover { color: var(--text-1); opacity: 1; background: rgba(255,255,255,0.03); }
.lyric-line.active {
  color: #fff; font-size: 24px; font-weight: 700; transform: scale(1); opacity: 1;
  text-shadow: 0 4px 24px rgba(255, 255, 255, 0.3), 0 0 10px var(--accent-glow);
}
.lyric-line.near { color: var(--text-1); opacity: 0.85; transform: scale(0.98); }

.info-panel {
  width: 420px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  padding: 48px 40px; background: rgba(20, 20, 30, 0.3); border-left: 1px solid var(--panel-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cover-wrap { width: 100%; display: flex; justify-content: center; margin-bottom: 40px; perspective: 1000px; }
.cover-display {
  width: 280px; height: 280px; border-radius: 20px; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; color: var(--text-3);
  overflow: hidden; box-shadow: 0 24px 50px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.cover-display.playing { animation: floatCover 6s ease-in-out infinite; }
@keyframes floatCover { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.02); box-shadow: 0 30px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.1); } }
.cover-display img { width: 100%; height: 100%; object-fit: cover; }
.cover-display svg { opacity: 0.3; }

.track-info { text-align: center; margin-bottom: 40px; width: 100%; }
.track-title { font-size: 26px; font-weight: 800; color: #fff; line-height: 1.3; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.track-artist { font-size: 16px; color: var(--text-1); font-weight: 500; }
.track-album { font-size: 13px; color: var(--text-3); margin-top: 4px; }

.control-panel { width: 100%; margin-top: auto; }
.progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.time { font-size: 12px; color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; min-width: 36px; text-align: center; }
.progress-bar {
  flex: 1; height: 6px; border-radius: 3px; position: relative; cursor: pointer; display: flex; align-items: center;
}
.progress-bg { position: absolute; width: 100%; height: 100%; background: rgba(255,255,255,0.1); border-radius: 3px; transition: height 0.2s; }
.progress-bar:hover .progress-bg { height: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; width: 0%; z-index: 1; transition: height 0.2s; }
.progress-bar:hover .progress-fill { height: 8px; }
.progress-handle {
  position: absolute; left: 0%; top: 50%; transform: translate(-50%, -50%);
  width: 14px; height: 14px; background: #fff; border-radius: 50%; opacity: 0; z-index: 2;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5); transition: opacity 0.2s, transform 0.1s;
}
.progress-bar:hover .progress-handle { opacity: 1; width: 16px; height: 16px; }

.controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 32px; }
.ctrl-btn { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--text-1); border-radius: 50%; transition: all 0.2s; }
.ctrl-btn:hover:not(:disabled) { color: #fff; background: rgba(255,255,255,0.1); }
.ctrl-btn:active:not(:disabled) { transform: scale(0.9); }
.ctrl-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.ctrl-btn.play-main {
  width: 60px; height: 60px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 30px var(--accent-glow);
}
.ctrl-btn.play-main:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 15px 40px var(--accent-glow); }
.ctrl-btn.play-main:active:not(:disabled) { transform: scale(0.95); }
.ctrl-btn.play-main:disabled { background: rgba(255,255,255,0.1); box-shadow: none; }

.sub-controls { display: flex; align-items: center; justify-content: space-between; }
.ctrl-btn-sm { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--text-2); border-radius: 12px; transition: all 0.2s; }
.ctrl-btn-sm:hover { color: #fff; background: rgba(255,255,255,0.1); }
.ctrl-btn-sm[data-mode="repeat-one"], .ctrl-btn-sm[data-mode="shuffle"] { color: var(--accent-2); }
.volume-group { display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.volume-slider {
  -webkit-appearance: none; width: 100px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; outline: none; transition: height 0.2s;
}
.volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: #fff; border-radius: 50%; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.volume-slider::-moz-range-thumb { width: 12px; height: 12px; background: #fff; border-radius: 50%; border: none; cursor: pointer; }

.toast {
  position: fixed; top: 40px; left: 50%; transform: translateX(-50%) translateY(-20px);
  padding: 14px 28px; background: rgba(20,20,30,0.85); backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border); border-radius: 30px; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--danger); background: rgba(255, 71, 102, 0.2); }
.toast.success { border-color: var(--success); background: rgba(23, 230, 126, 0.1); }

@media (max-width: 1100px) {
  .info-panel { width: 340px; padding: 32px 24px; }
  .cover-display { width: 240px; height: 240px; }
  .track-title { font-size: 22px; }
  .lyrics-panel { padding: 24px 30px; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
}

/* ================== 移动端左右滑动显示歌词与封面 ================== */
@media (max-width: 768px) {
  html, body { background-color: var(--bg-dark); }
  
  .sidebar { position: fixed; top: 0; left: -100%; height: 100%; box-shadow: none; border-right: none; background: #111116; z-index: 1000; }
  .sidebar.open { left: 0; box-shadow: 10px 0 30px rgba(0,0,0,0.8); }
  
  .sidebar-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }

  .mobile-top-bar {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 16px; flex-shrink: 0; z-index: 10;
  }
  .mobile-brand { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 1px; }

  .mobile-dots { display: flex; align-items: center; gap: 8px; }
  .mobile-dots .dot {
    width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease; cursor: pointer;
  }
  .mobile-dots .dot.active {
    width: 20px; border-radius: 4px; background: var(--accent-2);
  }

  .main-area { flex-direction: column; overflow: hidden; }
  
  .content-wrapper {
    width: 200vw;
    height: calc(100% - 56px);
    display: flex;
    flex-direction: row;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateX(0);
  }

  .content-wrapper.show-lyrics {
    transform: translateX(-100vw);
  }

  .info-panel {
    width: 100vw;
    height: 100%;
    padding: 10px 24px 20px;
    border-left: none;
    background: transparent;
    backdrop-filter: none;
    box-sizing: border-box;
    overflow-y: auto;
  }

  .cover-wrap { margin-bottom: 20px; perspective: none; }
  .cover-display {
    width: 70vw; height: 70vw; max-width: 280px; max-height: 280px;
    border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  }
  
  .track-info { margin-bottom: 20px; }
  .track-title { font-size: 22px; }
  .track-artist { font-size: 14px; }

  .progress-row { margin-bottom: 20px; }
  .progress-bar { height: 8px; }
  .progress-bg { height: 8px; }
  .progress-fill { height: 8px; }
  .progress-handle { width: 16px; height: 16px; opacity: 1; }

  .controls { gap: 16px; margin-bottom: 20px; }
  .ctrl-btn { width: 44px; height: 44px; }
  .ctrl-btn.play-main { width: 56px; height: 56px; }

  .sub-controls { padding: 0 8px; }
  .volume-slider { width: 80px; }

  .lyrics-panel {
    width: 100vw;
    height: 100%;
    padding: 10px 20px 30px;
    background: transparent;
    box-sizing: border-box;
  }
  .lyrics-panel::before, .lyrics-panel::after { display: none; }
  .lyrics-header { justify-content: center; margin-bottom: 12px; }
  .lyrics-header h3 { display: none; }
  .lyrics-container { padding: 20px 0 60px; -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 85%, transparent 100%); }
  
  .lyric-line { font-size: 16px; padding: 12px 8px; }
  .lyric-line.active { font-size: 20px; text-shadow: 0 2px 12px rgba(255, 255, 255, 0.2); }
}