/* ========== 全局变量 - 明亮炫酷主题 ========== */
:root {
  --gradient-1: linear-gradient(135deg, #ff007f, #7000ff, #00d4ff);
  --gradient-2: linear-gradient(135deg, #ff6b00, #ff00cc, #00e5ff);
  --gradient-3: linear-gradient(135deg, #00c6ff, #0072ff, #a855f7);
  --gradient-4: linear-gradient(135deg, #ff9a44, #fc6076, #ff00cc);
  --primary: #ff007f;
  --primary-hover: #ff3388;
  --bg-light: rgba(255, 255, 255, 0.92);
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-player: rgba(255, 255, 255, 0.95);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --border-color: rgba(0, 0, 0, 0.1);
  --accent: #ff007f;
  --shadow-glow: 0 10px 40px rgba(255, 0, 127, 0.25), 0 0 20px rgba(0, 212, 255, 0.3);
  --shadow-card: 0 15px 35px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(12px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans CJK SC', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f5f7ff 0%, #e8eaff 50%, #f0f2ff 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(255, 0, 127, 0.08), transparent 40%),
              radial-gradient(circle at 70% 60%, rgba(0, 212, 255, 0.08), transparent 40%),
              radial-gradient(circle at 50% 80%, rgba(112, 0, 255, 0.06), transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: bgFloat 12s ease-in-out infinite;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.6; }
  50% { transform: translate(3%, 2%) rotate(2deg); opacity: 1; }
}

.bubbles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.bubble {
  position: absolute;
  bottom: -80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 0, 127, 0.15), rgba(0, 212, 255, 0.08));
  animation: rise linear infinite;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.2);
}

@keyframes rise {
  0% { transform: translateY(0) scale(1); opacity: 0.4; }
  100% { transform: translateY(-120vh) scale(1.5); opacity: 0; }
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: auto;
  position: relative;
  z-index: 2;
}

header {
  margin-bottom: 28px;
  text-align: center;
}

.site-title {
  font-size: clamp(36px, 7vw, 52px);
  font-weight: 800;
  background: var(--gradient-1);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleFlow 3s ease infinite;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

@keyframes titleFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 1px;
  background: rgba(255,255,255,0.6);
  display: inline-block;
  padding: 6px 20px;
  border-radius: 40px;
  backdrop-filter: blur(4px);
}

.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border-radius: 28px;
  padding: 22px 26px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.6s ease;
}

.card:hover::before {
  left: 100%;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 0, 127, 0.3);
  box-shadow: var(--shadow-glow);
}

.card h3 {
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 18px;
  background: var(--gradient-2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.api-url {
  background: rgba(255,255,255,0.7);
  padding: 14px 20px;
  border-radius: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid rgba(255, 0, 127, 0.3);
}

.api-url code {
  color: #ff007f;
  font-size: 14px;
  font-weight: 600;
  font-family: monospace;
  background: rgba(255,255,255,0.8);
  padding: 4px 12px;
  border-radius: 40px;
}

.copy-btn {
  background: var(--gradient-1);
  border: none;
  color: white;
  padding: 8px 24px;
  border-radius: 40px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 0, 127, 0.3);
}

.copy-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(255, 0, 127, 0.5);
}

.player-dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}

.player-section {
  flex: 2;
  min-width: 280px;
}

/* ========== 播放列表 - 固定头部 + 滚动内容 ========== */
.playlist-section {
  flex: 1.2;
  min-width: 260px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border-radius: 28px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  max-height: 560px;
  height: 560px;
  overflow: hidden;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

/* 固定头部区域 - 不滚动 */
.playlist-header {
  flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
  border-radius: 28px 28px 0 0;
  padding-top: 4px;
}

.playlist-header h3 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 滚动列表区域 - 只滚动这里 */
.playlist-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 12px;
}

.playlist-scroll::-webkit-scrollbar {
  width: 5px;
}
.playlist-scroll::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
}
.playlist-scroll::-webkit-scrollbar-thumb {
  background: #ff007f;
  border-radius: 10px;
}

/* ========== 播放列表搜索框 ========== */
.playlist-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 40px;
  padding: 2px 14px 2px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.playlist-search:focus-within {
  border-color: #ff007f;
  box-shadow: 0 0 0 3px rgba(255, 0, 127, 0.15);
}

.search-icon {
  font-size: 14px;
  color: #999;
  flex-shrink: 0;
  line-height: 1;
}

.search-input-mini {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  min-width: 60px;
}

.search-input-mini::placeholder {
  color: #aaa;
  font-weight: 400;
}

.clear-search-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: #666;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.clear-search-btn:hover {
  background: rgba(255, 0, 0, 0.15);
  color: #ff007f;
}

/* ========== 热门推荐标签 ========== */
.hot-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 32px;
  padding: 4px 0;
}

#hotTagsContainer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hot-label {
  font-size: 12px;
  font-weight: 700;
  color: #ff007f;
  background: rgba(255, 0, 127, 0.1);
  padding: 2px 12px;
  border-radius: 30px;
  margin-right: 4px;
  flex-shrink: 0;
}

.hot-tag {
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 30px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.hot-tag:hover {
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.12), rgba(112, 0, 255, 0.08));
  color: #ff007f;
  border-color: rgba(255, 0, 127, 0.2);
  transform: translateY(-1px) scale(1.02);
}

.hot-tag:active {
  transform: scale(0.95);
}

/* ========== 搜索结果计数 ========== */
.search-result-count {
  font-size: 11px;
  color: #aaa;
  padding: 0 4px 10px 4px;
  text-align: right;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 8px;
  display: none;
}

.search-result-count.show {
  display: block;
}

/* ========== 无搜索结果提示 ========== */
.no-result {
  text-align: center;
  padding: 30px 10px;
  color: #aaa;
  font-size: 14px;
  display: none;
}

.no-result.show {
  display: block;
}

.no-result span {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.now-playing-card {
  background: var(--bg-player);
  backdrop-filter: var(--glass-blur);
  border-radius: 32px;
  padding: 28px 24px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
}

.now-playing-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.song-title-display {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 20px;
}

.transport-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin: 20px 0 20px;
}

.ctrl-btn {
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.ctrl-btn img {
  width: 28px;
  height: 28px;
  filter: brightness(0.3);
  transition: filter 0.2s, transform 0.2s;
}

.ctrl-btn:hover {
  transform: scale(1.08);
  background: #ff007f;
  border-color: white;
  box-shadow: 0 0 20px #ff007f;
}

.ctrl-btn:hover img {
  filter: brightness(0) invert(1);
}

.ctrl-btn.play-pause {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ff007f, #7000ff);
  box-shadow: 0 5px 20px rgba(255, 0, 127, 0.4);
}

.ctrl-btn.play-pause img {
  filter: brightness(0) invert(1);
}

.progress-container {
  width: 100%;
  margin: 20px 0 10px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
}

.progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff007f, #ff6b00, #ffcc00);
  border-radius: 10px;
  position: relative;
  transition: width 0.05s linear;
  box-shadow: 0 0 6px #ff007f;
}

.progress::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: #ff007f;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff007f;
  opacity: 0;
  transition: opacity 0.2s;
}

.progress-bar:hover .progress::after {
  opacity: 1;
}

.time-display {
  text-align: right;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: monospace;
  margin-top: 8px;
}

.speed-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 15px 0 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
  padding: 6px 16px;
  border-radius: 40px;
  width: fit-content;
  float: right;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 0, 127, 0.3);
}

.speed-select {
  background: white;
  color: #1a1a2e;
  border: 1px solid #ff007f;
  border-radius: 60px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  outline: none;
}

.speed-select option {
  background: white;
  color: #1a1a2e;
}

.speed-select:hover {
  background: #ff007f;
  color: white;
  border-color: #ff007f;
  transform: scale(1.02);
  box-shadow: 0 2px 10px rgba(255, 0, 127, 0.4);
}

.badge-note {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  clear: both;
}

.song-list {
  list-style: none;
}

.song-item {
  padding: 10px 14px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 60px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s;
  border: 1px solid transparent;
}

.song-item:hover {
  background: rgba(255, 0, 127, 0.06);
  border-color: rgba(255, 0, 127, 0.15);
}

.song-item.active {
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.15), rgba(112, 0, 255, 0.1));
  border-left: 4px solid #ff007f;
  border-radius: 60px;
}

.play-indicator {
  color: #ff007f;
  font-size: 12px;
  visibility: hidden;
}

.song-item.active .play-indicator {
  visibility: visible;
}

.song-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.play-count-badge {
  font-size: 11px;
  color: #ff007f;
  background: rgba(255, 0, 127, 0.12);
  padding: 3px 10px;
  border-radius: 40px;
  font-weight: 600;
}

.admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.btn {
  background: var(--gradient-1);
  color: white;
  padding: 10px 28px;
  border-radius: 40px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(255, 0, 127, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 127, 0.4);
}

footer {
  margin-top: 40px;
  text-align: center;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.4);
}

/* ========== 页脚超链接样式 ========== */
footer a {
    color: #ff007f;
    text-decoration: none;
    font-weight: 700;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    background: transparent;
}

footer a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #ff007f, #7000ff, #00d4ff);
    background-size: 300% 100%;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 2px;
    animation: underlineFlow 3s ease infinite;
}

@keyframes underlineFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

footer a:hover {
    color: #1a1a2e;
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(135deg, rgba(255, 0, 127, 0.08), rgba(0, 212, 255, 0.08));
    box-shadow: 0 4px 20px rgba(255, 0, 127, 0.15);
}

footer a:hover::after {
    transform: scaleX(1);
}

footer a:active {
    transform: scale(0.95);
    transition-duration: 0.1s;
}

footer a:focus-visible {
    outline: 2px solid #ff007f;
    outline-offset: 4px;
    border-radius: 6px;
}

footer a::before {
    content: '✦';
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8px;
    color: #ff007f;
    opacity: 0;
    transition: all 0.4s ease;
}

footer a:hover::before {
    opacity: 1;
    left: -22px;
    color: #7000ff;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  body { padding: 16px 12px; }
  .player-dashboard { flex-direction: column; }
  .playlist-section {
    max-height: 400px;
    height: 400px;
    position: relative;
    top: 0;
  }
  .ctrl-btn { width: 50px; height: 50px; }
  .ctrl-btn img { width: 22px; height: 22px; }
  .ctrl-btn.play-pause { width: 65px; height: 65px; }
  .ctrl-btn.play-pause img { width: 28px; height: 28px; }
  .transport-bar { gap: 20px; }
  .speed-control { float: none; margin: 15px auto; justify-content: center; width: auto; }
  .playlist-search { padding-left: 12px; }
  .search-input-mini { font-size: 12px; padding: 6px 0; }
  .hot-tag { font-size: 11px; padding: 3px 10px; }
  .hot-label { font-size: 11px; padding: 2px 10px; }
}

@media (max-width: 480px) {
  .api-url { flex-direction: column; align-items: stretch; }
  .copy-btn { width: 100%; }
  .admin-card { flex-direction: column; text-align: center; }
}

/* 移动端隐藏自定义光标 */
@media (max-width: 768px) {
  .cursor { display: none; }
}