/**
 * 現代化收藏框樣式 - 獨立版本
 * 完全獨立的樣式，不依賴其他CSS文件
 */

/* 收藏框容器 */
.modern-favbox-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    width: 100%;
    height: 450px; /* 减小高度 */
    max-height: 80vh; /* 响应式高度，确保在小屏幕上不会超出视口 */
    display: flex; /* 使用flex布局 */
    flex-direction: column; /* 垂直排列 */
}

/* 收藏框頭部 */
.modern-favbox-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px; /* 减小上下内边距，优化空间利用 */
    color: white;
    text-align: center;
    position: relative;
    border-radius: 20px 20px 0 0;
    height: 60px; /* 固定头部高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-favbox-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    border-radius: 20px 20px 0 0;
}

.modern-favbox-title {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.modern-favbox-title i {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.9);
    animation: modern-favbox-pulse 2s infinite;
}

@keyframes modern-favbox-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.modern-favbox-music-name {
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

/* 收藏框內容 */
.modern-favbox-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    flex: 1; /* 自动填充剩余空间 */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative; /* 相对定位 */
}

.modern-favbox-section {
    margin-bottom: 10px; /* 进一步减小部分间距 */
    flex-shrink: 0; /* 防止部分被压缩 */
}

.modern-favbox-section:last-child {
    margin-bottom: 0;
}

/* 让包含列表的部分可以伸展 */
.modern-favbox-section.list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 允许内容溢出时滚动 */
    max-height: 200px; /* 限制最大高度 */
}

/* 標籤 */
.modern-favbox-label {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 8px 12px; /* 进一步减小内边距 */
    border-radius: 10px;
    margin-bottom: 10px; /* 进一步减小底部间距 */
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.modern-favbox-label::before {
    content: '🎵';
    font-size: 18px;
}

.modern-favbox-selected {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(5px);
    color: white;
}

/* 歌單列表 */
.modern-favbox-list {
    max-height: 180px; /* 进一步减少列表高度 */
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #e9ecef;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1; /* 让列表区域自动填充剩余空间 */
    margin-bottom: 5px; /* 减少底部间距 */
    min-height: 100px; /* 减小最小高度 */
    flex-shrink: 1; /* 允许在需要时被压缩 */
}

.modern-favbox-list::-webkit-scrollbar {
    width: 8px;
}

.modern-favbox-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modern-favbox-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.modern-favbox-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* 歌單項目 */
.modern-fav-box-item {
    margin-bottom: 8px; /* 减小项目间距 */
    transition: all 0.3s ease;
}

.modern-fav-box-item:last-child {
    margin-bottom: 0;
}

.modern-fav-box-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px; /* 减小内边距 */
    background: white;
    border-radius: 10px; /* 调整圆角 */
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent; /* 减小边框宽度 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px; /* 调整字体大小 */
}

.modern-fav-box-item a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #6e64c6 100%);
}

.modern-fav-box-item a i {
    color: #667eea;
    font-size: 18px;
    transition: all 0.3s ease;
}

.modern-fav-box-item a:hover i {
    transform: scale(1.2);
    color: #764ba2;
}

.modern-fav-box-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.modern-fav-box-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* 選中狀態 */
.modern-fav-box-selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.modern-fav-box-selected a {
    color: white;
    background: transparent;
}

.modern-fav-box-selected a i {
    color: white;
}

.modern-fav-box-selected .modern-fav-box-count {
    background: rgb(105 114 217);
    color: white;
}

/* 添加表單 */
.modern-favbox-add-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 0 10px 0; /* 添加底部边距 */
    padding: 0; /* 移除所有内边距 */
    position: relative; /* 确保定位正确 */
    z-index: 5; /* 确保在其他元素之上 */
    flex-shrink: 0; /* 防止被压缩 */
}

.modern-favbox-input {
    flex: 1;
    padding: 10px 15px; /* 减小内边距 */
    border: 1px solid #e9ecef; /* 减小边框宽度 */
    border-radius: 10px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 40px; /* 固定高度 */
}

.modern-favbox-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.modern-favbox-add-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0 15px; /* 水平内边距 */
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    height: 40px; /* 固定高度，与输入框一致 */
    min-width: 100px; /* 最小宽度 */
}

.modern-favbox-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* 操作按鈕 - 内嵌式 */
.modern-favbox-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 0; /* 移除所有边距 */
    padding: 0; /* 移除内边距 */
    z-index: 10;
    flex-shrink: 0; /* 防止被压缩 */
    border-top: none; /* 移除顶部边框 */
}

.modern-favbox-btn {
    padding: 0 15px; /* 减少水平内边距 */
    border-radius: 8px; /* 减小圆角 */
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px; /* 减小间距 */
    min-width: 80px; /* 减小最小宽度 */
    justify-content: center;
    height: 36px; /* 减小高度 */
    font-size: 13px; /* 减小字体 */
}

.modern-favbox-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modern-favbox-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.modern-favbox-btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.modern-favbox-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.4);
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
}

/* 消息區域 */
.modern-favbox-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.modern-favbox-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.modern-favbox-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(81, 207, 102, 0.3);
}

.modern-favbox-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modern-favbox-loading i {
    font-size: 18px;
    animation: modern-favbox-spin 1s linear infinite;
}

@keyframes modern-favbox-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .modern-favbox-container {
        margin: 10px;
        border-radius: 15px;
        height: 450px; /* 减小移动设备上的高度 */
    }
    
    .modern-favbox-content {
        padding: 15px;
    }
    
    .modern-favbox-header {
        padding: 10px 15px;
        height: 50px; /* 减小移动设备上的头部高度 */
    }
    
    .modern-favbox-list {
        max-height: 200px; /* 减小移动设备上的列表高度 */
    }
    
    .modern-favbox-add-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .modern-favbox-input, 
    .modern-favbox-add-btn {
        width: 100%;
        height: 36px; /* 减小移动设备上的输入框和按钮高度 */
    }
    
    .modern-favbox-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .modern-favbox-btn {
        width: 100%;
        height: 36px; /* 减小移动设备上的按钮高度 */
    }
}

/* Layer.js 樣式覆蓋 */
.modern-favbox-layer .layui-layer-content {
    background: transparent !important;
    border-radius: 20px !important;
    overflow: hidden !important;
}

/* 隐藏Layer.js标题栏 */
.modern-favbox-layer .layui-layer-title {
    display: none !important; /* 完全隐藏标题栏 */
}

/* 调整弹窗样式 */
.modern-favbox-layer {
    border-radius: 20px !important; /* 恢复完整圆角 */
    overflow: hidden !important;
    border: 1px solid #d9d9d9 !important;
}

/* 隐藏Layer.js底部调整大小区域 */
.modern-favbox-layer .layui-layer-resize {
    display: none !important;
} 