/* ============================================
   媒體管理頁面樣式
   最後更新：2025-12-09
   ============================================ */

/* 媒體管理容器 */
.media-management-container {
    padding: 30px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
    overflow-y: auto;
}

/* 頁面標題 */
.media-management-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.media-management-header h2 {
    font-size: 32px;
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-weight: 600;
}

.media-management-header h2 i {
    margin-right: 12px;
}

.media-management-header p {
    color: var(--text-light);
    font-size: 15px;
    margin: 0;
}

/* 三個上傳區塊容器 */
.upload-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* 單個上傳區塊 */
.upload-section {
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    transition: all 0.3s ease;
}

.upload-section:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}

.upload-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
}

.upload-section-header i {
    font-size: 28px;
    color: var(--primary-color);
    margin-right: 12px;
}

.upload-section-header h3 {
    font-size: 20px;
    color: var(--text-color);
    margin: 0;
    font-weight: 600;
}

/* 上傳拖放區域 */
.upload-dropzone {
    border: 3px dashed var(--border-color);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    background: var(--background-light);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-dropzone:hover {
    background: var(--background-hover);
    border-color: var(--primary-color);
}

.upload-dropzone.drag-over {
    background: var(--background-active);
    border-color: var(--accent-color);
    border-style: solid;
    transform: scale(1.02);
}

.upload-dropzone i {
    font-size: 56px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.upload-dropzone p {
    color: var(--text-light);
    margin: 8px 0;
    font-size: 15px;
}

.upload-dropzone p strong {
    color: var(--primary-color);
}

.upload-dropzone .file-limit {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 15px;
    line-height: 1.6;
}

.upload-dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 音訊子類型選擇器（僅在音訊上傳時顯示） */
.audio-subtype-selector {
    margin-top: 20px;
    padding: 20px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    display: none;
}

.audio-subtype-selector.show {
    display: block;
}

.audio-subtype-selector label {
    display: block;
    margin-bottom: 10px;
    color: #856404;
    font-weight: 600;
    font-size: 15px;
}

.audio-subtype-selector select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ffc107;
    border-radius: 6px;
    background: #ffffff;
    color: #2c3e50;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-subtype-selector select:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

/* 動作按鈕區域 */
.upload-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn-view-media {
    flex: 1;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-primary);
}

.btn-view-media:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(77, 184, 168, 0.4);
}

.btn-view-media:active {
    transform: translateY(0);
}

.btn-view-media i {
    font-size: 16px;
}

/* 上傳進度列表 */
.upload-progress-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.upload-progress-section h3 {
    font-size: 22px;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

.upload-batch-actions {
    display: flex;
    gap: 10px;
}

.btn-batch-confirm,
.btn-batch-reject {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-batch-confirm {
    background: var(--primary-color);
    color: white;
}

.btn-batch-confirm:hover {
    background: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(77, 184, 168, 0.3);
}

.btn-batch-reject {
    background: #ef4444;
    color: white;
}

.btn-batch-reject:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.upload-progress-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-progress-item {
    background: #ffffff;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    padding: 20px;
    animation: slideInUp 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.upload-progress-item.pending {
    border-color: #fbbf24;
    background: #fffbeb;
}

.upload-progress-item.uploading {
    border-color: var(--primary-color);
}

.upload-progress-item.completed {
    animation: fadeOut 0.5s ease 5s forwards;
    border-color: #22c55e;
}

.upload-progress-item.error {
    border-color: #ef4444;
    background: #fef2f2;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.progress-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-item-icon {
    font-size: 20px;
    color: var(--primary-color);
}

.progress-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.progress-item-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-item-actions {
    display: flex;
    gap: 8px;
}

.btn-file-confirm,
.btn-file-reject {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-file-confirm {
    background: var(--primary-color);
    color: white;
}

.btn-file-confirm:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(77, 184, 168, 0.3);
}

.btn-file-reject {
    background: #ef4444;
    color: white;
}

.btn-file-reject:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.progress-item-status {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
}

.progress-item-status.uploading {
    background: #e3f2fd;
    color: #1976d2;
}

.progress-item-status.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.progress-item-status.error {
    background: #ffebee;
    color: #c62828;
}

/* 進度條 */
.progress-bar-container {
    width: 100%;
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-bar-fill.completed {
    background: linear-gradient(90deg, var(--success-color), #58d68d);
}

.progress-bar-fill.error {
    background: var(--error-color);
}

/* 檔案元數據容器（workflow 和 subtype 選擇） */
.file-meta-container {
    display: flex;
    gap: 15px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.file-meta-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-meta-item label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.file-workflow-select,
.file-subtype-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-workflow-select:focus,
.file-subtype-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

/* 批次 Workflow 選擇彈窗 */
.batch-workflow-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.batch-workflow-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.batch-workflow-content h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 20px;
}

.batch-workflow-content p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.batch-workflow-select-group {
    margin-bottom: 20px;
}

.batch-workflow-select-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.batch-workflow-select-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.batch-workflow-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.batch-workflow-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-batch-confirm {
    background: var(--primary-color);
    color: white;
}

.btn-batch-confirm:hover {
    background: var(--secondary-color);
}

.btn-batch-cancel {
    background: #e0e0e0;
    color: #333;
}

.btn-batch-cancel:hover {
    background: #d0d0d0;
}

/* 媒體列表彈窗 */
.media-list-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.media-list-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.media-list-content {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.media-list-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 16px 16px 0 0;
}

.media-list-header h3 {
    font-size: 24px;
    color: #ffffff;
    margin: 0;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.media-list-header h3 i {
    margin-right: 10px;
}

.media-list-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    color: #ffffff;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.media-list-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.media-list-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    background: #f8f9fa;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.media-grid-item {
    background: #ffffff;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px;
    cursor: default;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* 防止內容超出 */
}

.media-grid-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-primary);
    transform: translateY(-4px);
}

.media-grid-item-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: #bdc3c7;
    overflow: hidden;
}

.media-grid-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.media-grid-item:hover .media-grid-item-thumbnail img {
    transform: scale(1.05);
}

.media-grid-item-info {
    margin-top: 12px;
    width: 100%;
    overflow: hidden;
}

.media-grid-item-name {
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.media-grid-item-meta {
    font-size: 13px;
    color: #7f8c8d;
}

/* 媒體預覽縮圖 */
.media-preview-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.media-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.media-grid-item:hover .media-preview-thumb img {
    transform: scale(1.05);
}

/* 影片持續時間徽章 */
.video-duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-duration-badge i {
    font-size: 12px;
}

/* 音訊列表項目 */
.media-list-item {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.25s ease;
}

.media-list-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(77, 184, 168, 0.15);
}

.media-list-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), #3da58a);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.media-list-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.media-list-name {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.media-list-meta {
    font-size: 13px;
    color: #7f8c8d;
}

.media-list-actions {
    flex-shrink: 0;
}

/* Workflow 和 Type 徽章 - 改進版 */
.workflow-badge,
.type-badge,
.subtype-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
}

.workflow-badge {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    border: 1px solid #90caf9;
}

.workflow-badge:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
    box-shadow: 0 2px 6px rgba(21, 101, 192, 0.2);
    transform: translateY(-1px);
}

.type-badge {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #6a1b9a;
    border: 1px solid #ce93d8;
}

.type-badge:hover {
    background: linear-gradient(135deg, #e1bee7 0%, #ce93d8 100%);
    box-shadow: 0 2px 6px rgba(106, 27, 154, 0.2);
    transform: translateY(-1px);
}

.subtype-badge {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
    border: 1px solid #ffb74d;
}

.subtype-badge:hover {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffb74d 100%);
    box-shadow: 0 2px 6px rgba(230, 81, 0, 0.2);
    transform: translateY(-1px);
}

/* Workflow 特定樣式 */
.workflow-badge::before {
    content: "📁";
    font-size: 10px;
}

.type-badge::before {
    content: "⚡";
    font-size: 10px;
}

.subtype-badge::before {
    content: "🎵";
    font-size: 10px;
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .upload-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 72px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 16px;
}

/* ============================================
   名稱編輯功能樣式
   ============================================ */

/* 上傳進度中的名稱輸入框 */
.file-name-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.file-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

/* 媒體列表中的名稱編輯容器 */
.media-item-name-editable,
.media-list-name-editable {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    width: 100%;
    min-width: 0;
    /* 允許子元素收縮 */
}

/* 媒體名稱輸入框 - 改進版 */
.media-name-input {
    flex: 1;
    min-width: 0;
    /* 重要：允許 flex 項目收縮 */
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #2c3e50;
    background: #f8f9fa;
    transition: all 0.25s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.media-name-input:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 2px 4px rgba(77, 184, 168, 0.1);
}

.media-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.15), 0 2px 8px rgba(77, 184, 168, 0.1);
}

/* 儲存按鈕 - 改進版 */
.btn-save-name {
    flex-shrink: 0;
    /* 防止按鈕被壓縮 */
    padding: 8px 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #3da58a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    box-shadow: 0 2px 4px rgba(77, 184, 168, 0.2);
}

.btn-save-name:hover {
    background: linear-gradient(135deg, #3da58a 0%, var(--primary-color) 100%);
    box-shadow: 0 4px 8px rgba(77, 184, 168, 0.3);
    transform: translateY(-1px);
}

.btn-save-name:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(77, 184, 168, 0.2);
}

.btn-save-name i {
    font-size: 13px;
}

/* 音訊列表的名稱編輯 - 特別調整 */
.media-list-name-editable .media-name-input {
    max-width: 280px;
    /* 限制最大寬度，避免超出 */
}

/* Grid 項目中的名稱編輯 - 確保不超出 */
.media-item-name-editable {
    max-width: 100%;
}

.media-item-info .media-name-input {
    width: 100%;
}

/* ���T Subtype �U�Կ�� */
.media-subtype-select {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c3e50' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.media-subtype-select:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f5f3 100%);
    box-shadow: 0 2px 8px rgba(77, 184, 168, 0.15);
}

.media-subtype-select:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

.media-subtype-select option {
    padding: 8px;
    font-size: 14px;
    background: white;
    color: #2c3e50;
}

/* 音訊列表名稱編輯區域佈局 */
.media-list-name-editable {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.media-list-name-editable .media-name-input {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #2c3e50;
    background: white;
    transition: all 0.3s ease;
}

.media-list-name-editable .media-name-input:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(77, 184, 168, 0.15);
}

.media-list-name-editable .media-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #f8fffe;
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

.media-list-name-editable .media-subtype-select {
    flex-shrink: 0;
    width: 120px;
}

.media-list-name-editable .btn-save-name {
    flex-shrink: 0;
}

/* ============================================
   批量選擇和刪除功能樣式
   ============================================ */

/* 批量控制列 */
.batch-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-radius: 10px;
    border: 1px solid #4a5568;
    flex-wrap: wrap;
}

.batch-controls .btn-secondary {
    background: #4a5568;
    border: 1px solid #718096;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #e2e8f0;
    transition: all 0.2s;
}

.batch-controls .btn-secondary:hover {
    background: #718096;
    border-color: #a0aec0;
}

.batch-controls .btn-danger {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.batch-controls .btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
    transform: translateY(-1px);
}

.batch-controls .btn-danger:disabled {
    background: #4a5568;
    cursor: not-allowed;
    opacity: 0.5;
}

.batch-controls .btn-warning {
    background: linear-gradient(135deg, #d69e2e 0%, #b7791f 100%);
    color: #1a202c;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.batch-controls .btn-warning:hover {
    background: linear-gradient(135deg, #b7791f 0%, #975a16 100%);
    transform: translateY(-1px);
}

.batch-controls span {
    color: #a0aec0;
}

.batch-controls strong {
    color: #4db8a8;
}

/* 選中行樣式 */
.selected-row {
    background: rgba(77, 184, 168, 0.15) !important;
}

.selected-row:hover {
    background: rgba(77, 184, 168, 0.25) !important;
}

/* Checkbox 單元格 */
.checkbox-cell {
    width: 40px;
    text-align: center;
    padding: 10px !important;
}

.checkbox-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color, #4db8a8);
}

/* 媒體 checkbox */
.media-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color, #4db8a8);
}

/* 工作流標籤 */
.workflow-tag {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.workflow-tag:empty::after {
    content: '-';
    color: #999;
    background: #f0f0f0;
}

/* 篩選器下拉選單樣式 */
#workflow-filter,
#resident-filter,
#type-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    min-width: 120px;
    cursor: pointer;
}

#workflow-filter:focus,
#resident-filter:focus,
#type-filter:focus {
    outline: none;
    border-color: var(--primary-color, #4db8a8);
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

/* 批量刪除進度 */
.batch-delete-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px 50px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    text-align: center;
}

.batch-delete-progress p {
    font-size: 16px;
    color: #333;
    margin: 0;
}

/* 搜尋欄 */
.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-bar input[type="text"] {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.search-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color, #4db8a8);
    box-shadow: 0 0 0 3px rgba(77, 184, 168, 0.1);
}

/* 表頭 checkbox */
#header-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color, #4db8a8);
}

/* ============================================
   上傳彈窗樣式
   ============================================ */

#upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

#upload-modal .modal-content {
    background: #2d3748;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
}

#upload-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #4a5568;
}

#upload-modal .modal-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 18px;
}

#upload-modal .modal-close {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#upload-modal .modal-close:hover {
    color: #e2e8f0;
}

#upload-modal .modal-body {
    padding: 20px;
}

#upload-modal .form-group {
    margin-bottom: 15px;
}

#upload-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #a0aec0;
    font-size: 14px;
}

#upload-modal .form-group select,
#upload-modal .form-group input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    background: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
}

#upload-modal .form-group select:focus,
#upload-modal .form-group input[type="file"]:focus {
    outline: none;
    border-color: #4db8a8;
}

#upload-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #4a5568;
}

#upload-modal .btn-secondary {
    background: #4a5568;
    color: #e2e8f0;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

#upload-modal .btn-secondary:hover {
    background: #718096;
}

#upload-modal .btn-primary {
    background: linear-gradient(135deg, #4db8a8 0%, #3a9d8f 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

#upload-modal .btn-primary:hover {
    background: linear-gradient(135deg, #3a9d8f 0%, #2d7a6f 100%);
}