/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    position: relative;
    max-width: 450px;
    height: 100vh;
    margin: 0 auto;
    background: linear-gradient(135deg, #8e44ad, #3498db);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 搜索栏样式 */
.search-bar {
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 15px;
    flex: 1;
}

.search-icon {
    color: rgba(255, 255, 255, 0.8);
    margin-right: 10px;
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    width: 100%;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* 播放器容器样式 */
.player-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    touch-action: pan-y;
    position: relative;
    transition: transform 0.3s ease;
}

/* 当前歌曲信息样式 */
.current-song {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
}

.album-cover {
    width: 250px;
    height: 250px;
    border-radius: 125px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    animation: rotate 20s linear infinite;
    animation-play-state: paused;
}

.album-cover.playing {
    animation-play-state: running;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-info {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.song-info h2 {
    font-size: 24px;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.song-info p {
    font-size: 18px;
    opacity: 0.8;
}

/* 播放控制区域样式 */
.player-controls {
    width: 100%;
    margin-bottom: 30px;
    margin-top: 20mm;
}

.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress {
    height: 100%;
    background-color: white;
    border-radius: 2px;
    width: 0%;
    position: absolute;
    top: 0;
    left: 0;
}

.time-info {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin-top: 5px;
}

.control-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    margin: 0 20px;
    cursor: pointer;
    outline: none;
}

.play-pause {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}

/* 社交图标样式 */
.social-icons {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.social-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.social-icon i {
    font-size: 24px;
    margin-bottom: 5px;
}

.icon-label {
    font-size: 12px;
    opacity: 0.8;
}

/* 滑动提示样式 */
.swipe-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 15px;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.1);
}

/* 播放列表样式 */
.playlist-container {
    position: fixed;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    flex-direction: column;
}

.playlist-container.show {
    display: flex;
    left: 0;
}

.playlist-header {
    padding: 15px;
    color: white;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-selector {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    padding: 8px 12px;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    position: relative;
}

.playlist-selector:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.3);
}

.playlist-selector:focus {
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.5);
    border-color: #4a90e2;
}

.playlist-selector option {
    background: #2a2a2a;
    color: white;
    padding: 8px;
}

.playlist {
    height: calc(100vh - 50px);
    overflow-y: auto;
    padding: 10px;
}

.playlist::-webkit-scrollbar {
    width: 5px;
}

.playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.playlist::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.playlist::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 搜索结果样式 */
.search-results-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-results-title {
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.back-to-playlist-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.back-to-playlist-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.search-result-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-item.search-result:hover .search-result-actions {
    opacity: 1;
}

.play-search-result-btn {
    background: rgba(29, 185, 84, 0.8);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.play-search-result-btn:hover {
    background: #1DB954;
    transform: scale(1.1);
}

.playlist-item.search-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
}

/* 好友列表容器 */
.friends-list-container {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 确保内容不溢出 */
}

/* 好友列表头部 */
.friends-list-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.friends-list-title {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.friends-list-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

#friends-camera-btn,
.search-friend-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

#friends-camera-btn {
    background: rgba(82, 179, 217, 0.3);
}

#friends-camera-btn:hover {
    background: rgba(82, 179, 217, 0.5);
}

.search-friend-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.friends-list-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 15px;
}

.friends-list {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 80px); /* 确保可以滚动显示所有好友 */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent; /* Firefox */
    height: auto; /* 自动高度 */
    display: block; /* 确保块级显示 */
}

.friends-list::-webkit-scrollbar {
    width: 5px;
}

.friends-list::-webkit-scrollbar-track {
    background: transparent;
}

.friends-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

.friends-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.friend-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative; /* 为徽章定位 */
}

.friend-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

.friend-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.friend-info {
    flex: 1;
    overflow: hidden;
}

.friend-nickname {
    color: #fff;
    font-size: 16px;
    margin-bottom: 4px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-status {
    font-size: 13px;
    color: #aaa;
    display: flex;
    align-items: center;
}

.friend-item.online .friend-avatar {
    border: 2px solid #4CAF50;
}

.friend-item.offline .friend-avatar {
    filter: grayscale(70%);
    border: 2px solid #666;
}

.friend-item.online .friend-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
    margin-right: 6px;
}

.friend-item.offline .friend-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    margin-right: 6px;
}

/* 添加和搜索好友按钮 - 已重新设计到顶部 */

/* 好友搜索对话框 */
.friend-search-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.dialog-content {
    background: #333;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
}

.dialog-content h2 {
    color: white;
    margin-bottom: 15px;
    text-align: center;
}

/* 搜索类型选择器样式 */
.search-type-selector {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.search-type-selector label {
    color: white;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
}

.search-type-selector label:hover {
    background: rgba(255, 255, 255, 0.2);
}

.search-type-selector input[type="radio"] {
    margin-right: 5px;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

#friend-search-input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: #444;
    color: white;
}

.friend-limit-info {
    position: absolute;
    right: 5px;
    bottom: -18px;
    font-size: 11px;
    color: #999;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.result-info {
    flex: 1;
}

.result-nickname {
    color: white;
    font-size: 14px;
}

.result-email {
    color: #999;
    font-size: 12px;
}

.dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dialog-buttons button {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn {
    background: #4CAF50;
    color: white;
}

.search-btn:hover {
    background: #45a049;
}

.close-btn {
    background: #666;
    color: white;
}

.close-btn:hover {
    background: #555;
}

/* 好友搜索对话框样式 */
.message-container {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    display: none;
}

.message-container.active {
    display: block;
}

.message-item {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 音乐控制区域在有消息时隐藏 */
.player-controls.has-messages {
    display: none;
}

/* 登录模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-container {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    width: 90%;
    max-width: 400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
}

.close-modal {
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: white;
}

.modal-tabs {
    display: flex;
    background-color: rgba(0, 0, 0, 0.2);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: bold;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: white;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
}

.auth-btn {
    background: linear-gradient(135deg, #3498db, #8e44ad);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px 0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.auth-btn:active {
    transform: translateY(0);
}

/* 登录按钮样式 */
.login-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 15px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.login-btn span {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.login-btn.logged-in {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.playlist-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 5px;
}

.playlist-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.playlist-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
}

/* 登录区域样式 */
.login-section {
    margin-top: auto;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.login-btn {
    background: linear-gradient(135deg, #3498db, #8e44ad);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 共享文件夹按钮样式 */
.shared-folder-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 165, 0, 0.3);
    color: white;
    border: none;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.shared-folder-btn:hover {
    background: rgba(255, 165, 0, 0.5);
    transform: scale(1.1);
}

/* 共享文件夹模态框样式 */
.shared-folder-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
}

.shared-folder-modal.show {
    display: flex;
}

.shared-folder-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 15px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.shared-folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shared-folder-header h3 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.shared-folder-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.shared-folder-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.shared-folder-options {
    padding: 25px;
}

.shared-option {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.shared-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.shared-option:last-child {
    margin-bottom: 0;
}

.option-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    font-size: 24px;
}

#local-mp3-option .option-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

#p2p-share-option .option-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.option-content {
    flex: 1;
}

.option-content h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
}

.option-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

.option-arrow {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.shared-option:hover .option-arrow {
    color: white;
    transform: translateX(5px);
}

/* 共享统计样式 */
.sharing-stats {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stats-item:last-child {
    margin-bottom: 0;
}

.stats-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.stats-value {
    color: #1DB954;
    font-size: 14px;
    font-weight: 600;
}

/* 歌词显示区域样式 */
.lyrics-container {
    margin-bottom: 25px;
    height: 120px;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lyrics-display {
    height: 100%;
    position: relative;
    transition: transform 0.6s ease-out;
    text-align: center; /* 使歌词容器中的文本居中 */
}

.lyric-line {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    line-height: 30px;
    text-align: center; /* 确保每行歌词居中 */
    padding: 2px 0;
    transition: all 0.6s ease;
    cursor: pointer;
    position: relative; /* 为伪元素定位 */
}

.lyric-line::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 50%; /* 从中心点开始 */
    transform: translateX(-50%); /* 向左偏移自身宽度的一半以实现居中 */
    width: 0%;
    color: #FFD700;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    overflow: hidden;
    white-space: nowrap;
    z-index: 2;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    padding: inherit;
}

.lyric-line.karaoke::before {
    width: var(--karaoke-progress, 0%);
    left: 50%; /* 从中心点开始 */
    transform: translateX(-50%); /* 向左偏移自身宽度的一半以实现居中 */
    transition: width 0.1s linear;
}

/* 卡拉OK进度效果 */
.lyric-line.active {
    position: relative;
    color: #1DB954;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(29, 185, 84, 0.5);
    transform: scale(1.05);
}

.lyric-line.active::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    color: #FFD700;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    overflow: hidden;
    white-space: nowrap;
    z-index: 2;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    padding: inherit;
}

/* 歌词滚动动画 */
@keyframes lyric-scroll {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.lyric-line.scroll-in {
    animation: lyric-scroll 0.5s ease-out;
}

/* 空歌词状态 */
.lyrics-display.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.lyrics-display.empty .lyric-line {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* 歌词点击交互效果 */
.lyric-line:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
}

.lyric-line.clicked {
    animation: lyric-click 0.3s ease;
}

@keyframes lyric-click {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        color: #1DB954;
    }
    100% {
        transform: scale(1);
    }
}

/* 歌词加载动画 */
.lyrics-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.6);
}

.lyrics-loading::after {
    content: "载入歌词中...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: "载入歌词中";
    }
    40% {
        content: "载入歌词中.";
    }
    60% {
        content: "载入歌词中..";
    }
    80%, 100% {
        content: "载入歌词中...";
    }
}

/* P2P搜索结果样式 */
.search-results-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-results-container.show {
    opacity: 1;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.search-results-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
}

.close-search-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-results-content {
    padding: 20px;
}

.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #fff;
    font-size: 16px;
}

.search-loading i {
    font-size: 24px;
    margin-bottom: 10px;
}

.no-results {
    text-align: center;
    color: #fff;
    padding: 40px 20px;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results p {
    margin: 10px 0;
    font-size: 16px;
}

.no-results .hint {
    opacity: 0.7;
    font-size: 14px;
}

.search-results-list {
    max-width: 600px;
    margin: 0 auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: background 0.3s ease, transform 0.2s ease;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.result-info {
    flex: 1;
    margin-right: 15px;
}

.result-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.result-details {
    display: flex;
    gap: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.result-artist {
    color: #1DB954;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.play-btn, .add-to-playlist-btn {
    background: rgba(29, 185, 84, 0.8);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background: #1DB954;
    transform: scale(1.1);
}

.add-to-playlist-btn {
    background: rgba(255, 255, 255, 0.2);
}

.add-to-playlist-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 播放列表选择器样式 */
.playlist-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 15000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playlist-selector-modal.show {
    opacity: 1;
}

.playlist-selector-content {
    background: #2a2a2a;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.playlist-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-selector-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
}

.close-selector-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
}

.playlist-selector-body {
    padding: 20px;
}

.song-preview {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.preview-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.preview-artist {
    color: #1DB954;
    font-size: 14px;
}

.playlist-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.playlist-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.playlist-option:hover {
    background: rgba(29, 185, 84, 0.2);
    transform: translateX(5px);
}

.playlist-option i {
    color: #1DB954;
    margin-right: 15px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.playlist-option span {
    color: #fff;
    font-size: 14px;
}

/* 播放限制对话框样式 */
.play-limit-modal {
    text-align: center;
}

.limit-message {
    padding: 20px;
}

.limit-message i {
    display: block;
    margin: 0 auto 16px;
}

.limit-message p {
    margin: 8px 0;
    font-size: 16px;
    line-height: 1.5;
}

.limit-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #1e90ff, #00bfff);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(30, 144, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 分享对话框样式 */
.share-modal {
    backdrop-filter: blur(10px);
}

.share-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 24px;
}

.share-song-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.share-album-art {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.share-text-info h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: white;
}

.share-text-info p {
    margin: 4px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.share-user-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.share-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.share-section h4 {
    margin: 0 0 16px 0;
    color: white;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

.share-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.share-btn i {
    font-size: 24px;
}

.share-btn span {
    font-size: 14px;
}

/* 好友选择对话框样式 */
.friend-selection-modal .modal-container {
    max-width: 500px;
}

.share-song-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
}

.share-song-preview img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
}

.share-song-preview h4 {
    margin: 0 0 4px 0;
    color: white;
    font-size: 16px;
}

.share-song-preview p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.friends-list {
    max-height: 300px;
    overflow-y: auto;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.friend-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.friend-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.friend-item span {
    color: white;
    font-size: 16px;
}

/* 微信分享对话框样式 */
.wechat-share-modal {
    backdrop-filter: blur(15px);
}

.share-tips {
    text-align: center;
    margin-bottom: 24px;
}

.share-tips i {
    display: block;
    margin: 0 auto 16px;
}

.share-tips p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.5;
}

.share-qr-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#qr-canvas {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
}

.share-url-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

#share-url-input {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
}

#share-url-input:focus {
    outline: none;
    border-color: #1e90ff;
}

.share-url-container button {
    padding: 12px 20px;
    background: #1e90ff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.share-url-container button:hover {
    background: #0066cc;
}

/* 歌词生成器图标样式 */
.song-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 5px;
}

.lyrics-generator-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lyrics-generator-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.lyrics-generator-icon:active {
    transform: scale(0.95);
}

.lyrics-generator-icon i {
    font-size: 16px;
}

/* 歌词生成器模态框样式 */
.lyrics-generator-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lyrics-generator-modal.show {
    display: flex;
}

.lyrics-generator-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 15px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

.lyrics-generator-header {
    background: linear-gradient(135deg, #8e44ad, #3498db);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lyrics-generator-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.lyrics-generator-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lyrics-generator-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lyrics-generator-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.lyrics-input-section {
    margin-bottom: 20px;
}

.lyrics-input-label {
    display: block;
    color: white;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.lyrics-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    backdrop-filter: blur(5px);
}

.lyrics-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.lyrics-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 时间轴控制区域 */
.timeline-controls {
    margin-bottom: 20px;
}

.timeline-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.current-time-display {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    min-width: 80px;
    text-align: center;
}

.add-timeline-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.add-timeline-btn:hover {
    background: #219a52;
    transform: translateY(-1px);
}

.add-timeline-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

/* 歌词生成器按钮区域 */
.lyrics-generator-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.lg-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lg-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.lg-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lg-btn-primary {
    background: #3498db;
    color: white;
}

.lg-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.lg-btn-success {
    background: #27ae60;
    color: white;
}

.lg-btn-success:hover {
    background: #219a52;
    transform: translateY(-1px);
}

/* 快捷键提示 */
.keyboard-shortcut-hint {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
}

.shortcut-key {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-weight: bold;
}

/* 歌词列表预览 */
.lyrics-preview {
    margin-top: 15px;
}

.lyrics-preview-title {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.lyrics-lines-list {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.lyric-line-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 12px;
}

.lyric-timestamp {
    color: #3498db;
    font-family: monospace;
    min-width: 60px;
}

.lyric-text {
    color: white;
    flex: 1;
    margin-left: 10px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .album-cover {
        width: 200px;
        height: 200px;
        border-radius: 100px;
    }
    
    .song-info h2 {
        font-size: 20px;
    }
    
    .song-info p {
        font-size: 16px;
    }
    
    .control-btn {
        margin: 0 15px;
    }
    
    .shared-folder-content {
        width: 95%;
        margin: 10px;
    }
    
    .shared-folder-header {
        padding: 15px 20px;
    }
    
    .shared-folder-header h3 {
        font-size: 18px;
    }
    
    .shared-folder-options {
        padding: 20px;
    }
    
    .shared-option {
        padding: 15px;
    }
    
    .option-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .option-content h4 {
        font-size: 15px;
    }
    
    .option-content p {
        font-size: 13px;
    }
    
    .sharing-stats {
        padding: 15px 20px;
    }
    
    .lyrics-generator-content {
        width: 95%;
        margin: 10px;
    }
    
    .lyrics-generator-header {
        padding: 15px;
    }
    
    .lyrics-generator-body {
        padding: 15px;
    }
    
    .timeline-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .lyrics-generator-actions {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .search-results-header {
        padding: 15px;
    }
    
    .search-results-content {
        padding: 15px;
    }
    
    .search-result-item {
        padding: 12px;
    }
    
    .result-title {
        font-size: 14px;
    }
    
    .result-details {
        font-size: 11px;
        gap: 10px;
    }
    
    .play-btn, .add-to-playlist-btn {
        width: 35px;
        height: 35px;
    }
}

/* Toast消息样式 */
.toast-message {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    max-width: 80%;
    text-align: center;
    line-height: 1.2;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: toastFadeIn 0.3s ease forwards;
}

@keyframes toastFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}