/* player上传弹窗样式 */

/* 弹窗内容区域样式：flex 列布局，避免弹窗整体出现滚动条 */
.player-upload-content {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    width: 600px;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
}

/* flb类样式重置 - 确保不影响内容布局 */
.flb {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* 弹窗头部 */
.player-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border: none;
    background: #f8f9fa;
    position: relative;
    z-index: 2;
    margin-bottom: 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.player-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.player-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.player-modal-close:hover {
    background-color: #f0f0f0;
    color: #666;
}

/* 弹窗主体：占满剩余高度且不滚动，内部由队列/播放列表各自滚动 */
.player-modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-top: 50px;
}

/* 文件选择区域 */
.player-file-select {
    flex-shrink: 0;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 0;
    padding-top: 0;
}

/* 拖拽区域样式 */
.player-drop-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    margin-top: 0;
}

.player-drop-zone:hover,
.player-drop-zone.dragover {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.player-drop-text {
    color: #666;
}

.player-drop-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* 文件输入框 */
.player-file-input {
    display: none;
}

/* 上传队列样式：固定高度保证列表区域可滚动 */
.player-upload-queue {
    flex-shrink: 0;
    margin-top: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #f8f9fa;
    padding: 15px;
    height: 320px;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.player-queue-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.player-queue-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.player-queue-clear {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.player-queue-clear:hover {
    background: #c82333;
}

/* 列表区域：高度 = 3 条队列项（按单条样式：padding 10*2 + gap 8*2 + 行1约18 + 进度条10 + 行3约14 + margin 8 + border 2 ≈ 88px/条） */
.player-queue-items {
    max-height: 264px;  /* 88px × 3 条 */
    overflow-y: auto;
    overflow-x: hidden;
}

/* Webkit浏览器滚动条样式 */
.player-queue-items::-webkit-scrollbar {
    width: 6px;
}

.player-queue-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.player-queue-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.player-queue-items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 上传队列项：三行布局，长文件名完整显示（方案2） */
.player-queue-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    transition: all 0.2s;
}

.player-queue-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 第一行：左文件名，右文件大小 */
.player-queue-row1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.player-queue-file-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    word-break: break-all;
    overflow-wrap: break-word;
    line-height: 1.35;
}

.player-queue-file-size {
    flex-shrink: 0;
    font-size: 12px;
    color: #666;
}

/* 第二行：整行进度条，条上叠百分比 */
.player-queue-progress-wrap {
    position: relative;
    width: 100%;
}

.player-queue-progress-bar {
    width: 100%;
    height: 10px;
    background: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.player-queue-progress-fill {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.player-queue-progress-fill.uploading {
    background: linear-gradient(90deg, #007bff, #0056b3);
    animation: progressPulse 1.5s ease-in-out infinite;
}

.player-queue-progress-fill.completed {
    background: #28a745;
}

.player-queue-progress-fill.error,
.player-queue-progress-fill.failed {
    background: #dc3545;
}

.player-queue-progress-fill.cancelled {
    background: #6c757d;
}

/* 第三行：左速度/状态，右按钮 */
.player-queue-row3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.player-queue-meta {
    font-size: 11px;
    color: #666;
    min-width: 0;
}

.player-queue-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.player-queue-btn {
    padding: 2px 6px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.player-queue-btn-cancel {
    background: #ffc107;
    color: #212529;
}

.player-queue-btn-cancel:hover {
    background: #e0a800;
}

.player-queue-btn-retry {
    background: #17a2b8;
    color: white;
}

.player-queue-btn-retry:hover {
    background: #138496;
}

.player-queue-btn-remove {
    background: #dc3545;
    color: white;
}

.player-queue-btn-remove:hover {
    background: #c82333;
}

.player-queue-btn-disabled {
    background: #6c757d;
    color: white;
    cursor: not-allowed;
    opacity: 0.6;
}

.player-queue-btn-disabled:hover {
    background: #6c757d;
}


/* 性能优化：减少重绘 */
.player-queue-item {
    contain: layout style paint;
}

/* 优化动画性能 */
.player-queue-progress-fill {
    will-change: width;
    transform: translateZ(0);
}

/* 文件设置区域 */
/* 播放文件列表：占满剩余空间，仅内部表格滚动 */
.player-file-settings {
    flex: 1;
    min-height: 0;
    margin-top: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #f8f9fa;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.player-settings-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.player-settings-header-row h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.player-settings-table {
    flex: 1;
    min-height: 0;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.player-settings-header {
    flex-shrink: 0;
}

/* 播放列表区域：高度 = 5 条（按单条样式：padding 10*2 + font 13px 行高约16 ≈ 36px/条） */
.player-settings-items {
    max-height: 180px;  /* 36px × 5 条 */
    overflow-y: auto;
    overflow-x: hidden;
}

/* 播放列表内部滚动条样式 */
.player-settings-items::-webkit-scrollbar {
    width: 6px;
}

.player-settings-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.player-settings-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.player-settings-items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.player-settings-header {
    display: grid;
    grid-template-columns: 44px 1fr 90px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    min-width: 0;
}

.player-settings-header > div {
    padding: 10px 8px;
    border-right: 1px solid #e5e5e5;
}

.player-settings-header > div:last-child {
    border-right: none;
}

.player-settings-header-index {
    text-align: center;
    color: #666;
    font-size: 13px;
}

.player-settings-header-name {
    text-align: left;
    min-width: 0;
}

.player-settings-header-size {
    text-align: center;
    color: #666;
    font-size: 13px;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0;
}

/* 播放列表项样式（与表头同一 grid 列宽，保证对齐） */
.player-settings-item {
    display: grid;
    grid-template-columns: 44px 1fr 90px;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
    transition: background-color 0.2s;
    min-width: 0;
}

.player-settings-item:hover {
    background-color: #f8f9fa;
}

.player-settings-item:last-child {
    border-bottom: none;
}

.player-settings-file-index {
    padding: 10px 8px;
    border-right: 1px solid #e5e5e5;
    text-align: center;
    color: #666;
    font-size: 13px;
    box-sizing: border-box;
}

.player-settings-file-name {
    padding: 10px 8px;
    border-right: 1px solid #e5e5e5;
    text-align: left;
    cursor: pointer;
    color: #007bff;
    text-decoration: underline;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.player-settings-file-name:hover {
    color: #0056b3;
    background-color: #f0f8ff;
}

.player-settings-file-size {
    padding: 10px 8px;
    border-right: none;
    text-align: center;
    color: #666;
    font-size: 13px;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0;
}

/* 弹窗底部 */
.player-modal-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    background: #f8f9fa;
}

/* 播放列表底部按钮区域 */
.player-settings-footer {
    display: block;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
}

.player-settings-footer-text {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.player-notice-icon {
    margin-right: 6px;
    flex-shrink: 0;
    align-self: center;
}

.player-insert-all-link {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.player-insert-all-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 空状态样式 */
.player-settings-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.player-settings-empty-text {
    font-size: 18px;
    font-weight: 500;
    color: #666;
}


.player-queue-item.completed {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.player-queue-item.error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.player-queue-item.cancelled {
    background: #e2e3e5;
    border-left: 4px solid #6c757d;
}



/* 按钮样式 */
.player-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.player-btn-primary {
    background: #007bff;
    color: white;
}

.player-btn-primary:hover {
    background: #0056b3;
    color: white;
}

.player-btn-secondary {
    background: #6c757d;
    color: white;
}

.player-btn-secondary:hover {
    background: #545b62;
    color: white;
}

.player-btn-success {
    background: #28a745;
    color: white;
}

.player-btn-success:hover {
    background: #1e7e34;
    color: white;
}

.player-btn-danger {
    background: #dc3545;
    color: white;
}

.player-btn-danger:hover {
    background: #c82333;
    color: white;
}

/* 动画效果 */
@keyframes slideInTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .player-upload-content {
        width: 95%;
        max-width: 500px;
    }
    
    .player-modal-body {
        padding: 15px;
    }
    
    .player-drop-zone {
        padding: 30px 15px;
    }
    
    .player-settings-header > div {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .player-settings-header,
    .player-settings-item {
        grid-template-columns: 40px 1fr 70px;
    }
}

/* 弹窗内消息提示样式 - 参考fabuba_theme_cover的实现方式 */
@keyframes playerDialogMessageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.player-dialog-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 10002;
    animation: playerDialogMessageSlideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    white-space: nowrap;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.player-dialog-message-success {
    background: #10b981;
}

.player-dialog-message-error {
    background: #ef4444;
}

.player-dialog-message-warning {
    background: #f59e0b;
}

.player-dialog-message-info {
    background: #2196F3;
}
