/* 新增旋转动画 */
@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 专辑封面容器 */
.album-cover {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1),
              0 0 0 4px rgba(0, 0, 0, 0.2),
              0 10px 20px rgba(0, 0, 0, 0.5);
  animation: rotate 30s linear infinite; /* 每分钟2转 = 30秒/转 */
  z-index: 1;
  
  /* 音乐图标样式 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  color: #5a189a;
  background: linear-gradient(135deg, #2a0a4a 0%, #3d0c6e 100%);
}

.album-image-container {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 深色主题样式 */
.dark-theme body {
    background: linear-gradient(135deg, #121212 0%, #1a1a1a 100%);
    color: #e0e0e0;
}

.dark-theme .header-content {
    background: rgba(30, 30, 30, 0.9);
}

.dark-theme .logo-icon {
    background: linear-gradient(135deg, #5a189a 0%, #7b2cbf 100%);
    color: #ffd700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.dark-theme .logo-text {
    background: linear-gradient(135deg, #9d4edd 0%, #c77dff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dark-theme .search-container {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.dark-theme .search-input {
    background: #2d2d2d;
    color: #f0f0f0;
    border: 1px solid #444;
}

.dark-theme .search-input::placeholder {
    color: #aaa;
}

.dark-theme .search-btn {
    background: linear-gradient(135deg, #5a189a 0%, #7b2cbf 100%);
    color: #ffd700;
}

.dark-theme .search-btn:hover {
    background: linear-gradient(135deg, #4a147d 0%, #6a25a3 100%);
}

.dark-theme .hot-search-panel {
    background: #252525;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.dark-theme .hot-search-title {
    color: #c77dff;
}

.dark-theme .hot-tag {
    background: #3a3a3a;
    color: #d0d0d0;
}

.dark-theme .hot-tag:hover {
    background: #7b2cbf;
    color: #ffd700;
}

.dark-theme .player-section,
.dark-theme .results-section {
    background: rgba(40, 40, 40, 0.9);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}
.dark-theme #loopBtn.active {
    background: #7b2cbf !important;
    color: #ffd700 !important;
}
.dark-theme .album-cover {
	 background: linear-gradient(135deg, #2a0a4a 0%, #3d0c6e 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    color: #9d4edd;
}

.dark-theme .song-title {
    color: #f0f0f0;
}

.dark-theme .song-artist {
    color: #aaa;
}

.dark-theme .lyrics-container {
    background: #2a2a2a;
}

.dark-theme .lyrics-content {
    color: #ccc;
}

.dark-theme .current-lyric {
    color: #c77dff;
}

.dark-theme .expand-lyrics {
    color: #ffffff;
}

.dark-theme .lyrics-actions {
    display: flex;
    justify-content: space-between;
    padding: 0 5px 5px;
}

.dark-theme .collection-btn {
    background: rgba(255, 165, 0, 0.3); /* 橙色半透明 */
    color: #ffd700; /* 可选：文字颜色改为金色更搭配 */
    padding: 4px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dark-theme .collection-btn:hover {
    background: rgba(155, 89, 182, 0.3);
}

/* 新增缓冲条样式 */
.buffer-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(150, 150, 150, 0.3); /* 浅色主题缓冲条 */
    width: 0%;
    border-radius: 3px;
    z-index: 1; /* 在进度条下方 */
    transition: width 0.3s ease;
}

.dark-theme .buffer-bar {
    background-color: rgba(255, 255, 255, 0.2); /* 深色主题缓冲条 */
}

.progress-container {
    position: relative; /* 确保子元素绝对定位相对此元素 */
    background: #eee6ff;
    height: 5px;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 3px;
}

.dark-theme .progress-container {
    background: #333;
}

.progress-bar {
    position: relative; /* 确保在缓冲条之上 */
    height: 100%;
    background: linear-gradient(90deg, #6a1b9a 0%, #8e44ad 100%);
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
    z-index: 2; /* 在缓冲条上方 */
}

.dark-theme .progress-bar {
    background: linear-gradient(90deg, #7b2cbf 0%, #9d4edd 100%);
}

.dark-theme .time-info {
    color: #aaa;
}

.dark-theme .player-btn {
    background: #3a3a3a;
    color: #c77dff;
}

.dark-theme .player-btn:hover {
    background: #7b2cbf;
    color: #ffd700;
}

.dark-theme #volumeSlider {
    background: #333;
}

.dark-theme #volumeSlider::-webkit-slider-thumb {
    background: #9d4edd;
}

.dark-theme .results-header {
    color: #e0e0e0;
}

.dark-theme .result-item {
    border-bottom: 1px solid #333;
}

.dark-theme .result-item:hover {
    background: #2d2d2d;
}

.dark-theme .result-number {
    color: #9d4edd;
}

.dark-theme .result-title {
    color: #f0f0f0;
}

.dark-theme .result-artist {
    color: #aaa;
}

.dark-theme .result-songid {
    color: #888;
}

/* 深色主题当前播放歌曲高亮样式 */
.dark-theme .current-song {
    background: #3a1e5a !important;
    border-left: 4px solid #9d4edd !important;
}

/* 浅色主题当前播放歌曲高亮样式 */
.current-song {
    background: #f5edff !important;
    border-left: 4px solid #8e44ad !important;
}

.dark-theme footer p {
    color: #888;
}

/* 按钮禁用状态 */
.dark-theme .song-actions .action-btn:disabled {
    background: #2a2a2a;
    color: #555;
}

/* 操作按钮样式 */
.dark-theme .song-actions .action-btn {
    background: #4a3b5c; /* 柔和紫灰 */
    color: #d1b8ff;      /* 淡紫色图标 */
    transition: all 0.2s ease;
}

.dark-theme .song-actions .action-btn:hover {
    background: #7b2cbf;
    color: #ffd700;
}

/* 循环按钮激活状态 */
.dark-theme .loop-btn.active {
    background: #5a4775;
    color: #ffd700;
}

/* 静音按钮状态 */
.dark-theme .mute-btn.muted {
    color: #ff6b6b;
}

/* 原有样式保持不变 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f9f8ff 0%, #eae6ff 100%);
    color: #333;
    min-height: 100vh;
    padding: 8px 0 15px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
    position: relative;
}

/* 头部样式 */
header {
    padding: 10px 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6a1b9a 0%, #8e44ad 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd700;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(106, 27, 154, 0.2);
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #6a1b9a 0%, #8e44ad 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 搜索区域样式 */
.search-section {
    padding: 10px 0;
}

.search-box {
    width: 100%;
    position: relative;
}

.search-container {
    display: flex;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.15);
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    font-size: 14px;
    transition: all 0.3s ease;
    height: 40px;
}

.search-input:focus {
    outline: none;
}

.search-input::placeholder {
    color: #aaa;
}

.search-btn {
    padding: 0 25px;
    background: linear-gradient(135deg, #6a1b9a 0%, #8e44ad 100%);
    color: #ffd700;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 40px;
}

.search-btn:hover {
    background: linear-gradient(135deg, #5a1685 0%, #7d3c98 100%);
}

.hot-search-panel {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-top: 8px;
    display: none;
    position: absolute;
    width: 100%;
    z-index: 10;
}

.hot-search-title {
    color: #6a1b9a;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: left;
}

.hot-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hot-tag {
    background: #f5edff;
    color: #412f1f;
    padding: 3px 5px;
    border-radius: 18px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hot-tag:hover {
    background: #8e44ad;
    color: #ffd700;
    transform: translateY(-2px);
}

/* 播放器样式 */
.player-section {
    background: white;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    padding: 15px;
    margin: 10px 0;
}

.player-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-gap: 10px;
}

/* 歌曲信息 */
.song-info {
    grid-column: 2;
    grid-row: 1;
}

.song-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.song-title {
    font-size: 20px;
    margin-right: auto;
}

.song-actions {
    display: flex;
    gap: 6px;
}

.song-actions .action-btn {
    width: 35px;
    height: 35px;
    font-size: 20px;   /* 图标大小 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f5edff;
    color: #8e44ad;
    border: none;
    transition: all 0.2s ease;
}

.song-actions .action-btn:hover {
    background: #8e44ad;
    color: #ffd700;
}

.song-actions .action-btn:disabled {
    background: #f0f0f0;
    color: #aaa;
    cursor: not-allowed;
}

.song-artist {
    color: #666;
    font-size: 14px;
}

/* 歌词容器 */
.lyrics-container {
    grid-column: 2;
    grid-row: 2;
    background: #f9f5ff;
    border-radius: 12px;
    padding: 15px;
    max-height: 150px;
    overflow: hidden;
    transition: max-height 0.4s ease;
    position: relative;
}

.lyrics-container.expanded {
    max-height: 350px;
}

.lyrics-content {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    white-space: pre-line;
    transition: all 0.3s ease;
    overflow: auto;
    max-height: 100%;
    padding: 5px;
    text-align: center;
}

.current-lyric {
    font-size: 20px;  /* 比普通歌词更大 */
    color: #8e44ad;   /* 高亮颜色 */
}

.lyrics-actions {
    display: flex;
    justify-content: space-between;
    padding: 0 5px 5px;
}

.collection-btn {
    background: rgba(142, 68, 173, 0.1);
    color: #8e44ad;
    padding: 4px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.collection-btn:hover {
    background: rgba(142, 68, 173, 0.15);
}

.expand-lyrics {
    cursor: pointer;
    color: #6a1b9a;
    font-weight: 400;
    font-size: 14px;
}

/* 播放器控件 */
.audio-player {
    grid-column: 1 / span 2;
    grid-row: 3;
    width: 100%;
    margin-top: 5px;
}

.player-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 新增：进度条和时间信息容器 */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.progress-container {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    margin-bottom: 3px;
}

.time-info {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    color: #777;
    font-size: 16px;
    white-space: nowrap;
    gap: 5px;
    min-width: 80px;
}

.player-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    margin-top: 5px;
}

.player-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f5edff;
    color: #8e44ad;
    font-size: 26px;
    border: none;
    transition: all 0.2s ease;
}

.player-btn:hover {
    background: #8e44ad;
    color: #ffd700;
    transform: scale(1.05);
}

/* 音量滑块 */
#volumeSlider {
    width: 70px;
    height: 5px;
    background: #eee6ff;
    outline: none;
    -webkit-appearance: none;
    border-radius: 3px;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8e44ad;
    cursor: pointer;
}

/* 收藏面板 */
.collection-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    background: white;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    padding: 15px;
    display: none;
    overflow: hidden;
}

.dark-theme .collection-panel {
	background: linear-gradient(135deg, #3a1e5a 0%, #4a2470 100%);
    color: #e0e0e0;
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.dark-theme .collection-header {
    border-bottom: 1px solid #444;
}

.close-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.dark-theme .close-btn:hover {
    background: #333;
    color: #fff;
}

.collection-list {
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

.fav-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #f9f5ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dark-theme .fav-item {
	background: linear-gradient(135deg, #1e1e3f 0%, #2a2a5a 100%);
}

.fav-item:hover {
    background: #f0e6ff;
    transform: translateY(-2px);
}

.dark-theme .fav-item:hover {
    background: #3a3a3a;
}

.fav-title {
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.fav-artist {
    color: #666;
    font-size: 13px;
    min-width: 60px;
    text-align: right;
}

.dark-theme .fav-artist {
    color: #aaa;
}

.fav-remove {
    color: #e74c3c;
    padding: 5px 8px;
    margin-left: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.fav-remove:hover {
    background: rgba(231, 76, 60, 0.1);
}

.empty-collection {
    text-align: center;
    color: #888;
    padding: 20px;
}

/* 搜索结果样式 */
.results-section {
    background: white;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    padding: 15px;
    margin-bottom: 10px;
}

.results-header {
    margin-bottom: 10px;
}

.results-title {
    font-size: 18px;
    font-weight: 500;
    color: #c77dff;
}

.results-list {
    max-height: 400px;
    overflow-y: auto;
    scroll-behavior: smooth; /* 添加平滑滚动效果 */
}

/* 搜索结果条目 - 紧凑布局 */
.result-item {
    display: flex;
    align-items: center;
    padding: 6px 6px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s ease;
    cursor: pointer;
    font-size: 16px;
    gap: 4px; /* 调整间距 */
}

.result-item:hover {
    background: #f9f5ff;
    border-radius: 8px;
}

.result-number {
    min-width: 15px; /* 调整序号宽度 */
    text-align: center;
    font-weight: 600;
    color: #6a1b9a;
	padding-left: 0; /* 移除左侧内边距 */
    margin-right: 15px; /* 调整序号间距 */
}

.result-actions {
    display: flex;
    gap: 18px; /* 调整按钮间距 */
    margin-right: 25px;
}

.fav-btn, .share-btn {
    width: 24px; /* 调整按钮大小 */
    height: 24px;
	font-size: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #8e44ad;
    transition: all 0.3s ease;
}

.fav-btn.favorited {
    color: #ffd700;
}

.fav-btn:hover, .share-btn:hover {
    background: #f0e6ff;
    transform: scale(1.1);
}

.share-btn {
    color: #3498db;
}

.result-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.result-title {
    font-size: 16px; /* 调整歌曲名大小 */
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-artist {
    font-size: 14px; /* 调整歌手名大小 */
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-songid {
    display: none; /* 去除ID显示 */
}

/* 页脚样式 */
footer {
    text-align: center;
    color: #888;
    font-size: 12px;
    padding: 10px 0;
}
/* 热门搜索面板右上角关闭按钮 */
.hot-search-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease;
}

.hot-search-close:hover {
  transform: scale(1.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .player-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
    }
    
    .album-cover {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        max-width: 160px;
        height: 160px;
        margin: 0 auto;
    }
    
    .song-info {
        grid-column: 1;
        grid-row: 2;
    }
    
    .lyrics-container {
        grid-column: 1;
        grid-row: 3;
    }
    
    .audio-player {
        grid-column: 1;
        grid-row: 4;
    }
    
    .time-info {
        font-size: 14px;
        min-width: 65px;
    }
    
    .result-item {
        flex-wrap: nowrap;
        padding: 8px;
    }
    
    .result-number {
        width: auto;
        text-align: left;
        flex-shrink: 0;
        margin-right: 4px;
    }
    
    .result-actions {
        margin-right: 25px;
    }
    
    .result-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .result-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 0;
    }
    
    .result-artist {
        min-width: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 13px;
    }
    
    .result-songid {
        display: none;
    }
    .hot-tag {
        font-size: 20px;  /* 增大字体 */
        padding: 3px 5px; /* 调整内边距 */
    }

    .dark-theme .hot-tag {
        font-size: 20px;  /* 深色模式同步调整 */
    }
}
