/* 管理后台专用样式 */

/* 管理后台基础样式 */
.admin-body {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* 管理后台重写基础样式 */
.admin-body::before {
    display: none; /* 隐藏动态背景 */
}

/* 通用表单元素样式 - 确保所有表单元素都能正确显示 */
.admin-body input, 
.admin-body button, 
.admin-body textarea, 
.admin-body select {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    color: #333;
    background: white;
}

.admin-body button {
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.admin-body button:hover {
    background: #0056b3;
}

.admin-body label {
    display: block;
    margin: 10px 0 5px 0;
    font-weight: bold;
    color: #495057;
}

/* 视频列表容器 */
.admin-video-list {
    max-width: 1200px;
    margin: 20px auto;
}

/* 视频项目 */
.admin-video-item {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 分类区块 */
.admin-category-section {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-left: 4px solid #007bff;
}

/* 分类头部 */
.admin-category-header {
    background: #f8f9fa;
    padding: 15px;
    margin: -20px -20px 20px -20px;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #e9ecef;
}

/* 表单控件 */
.admin-input, .admin-button, .admin-textarea, .admin-select {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

/* 按钮样式 */
.admin-button {
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.admin-button:hover {
    background: #0056b3;
}

/* 源链接项目 */
.admin-source-item {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    align-items: center;
}

.admin-source-item input {
    margin: 0;
}

.admin-source-item button {
    width: auto;
    padding: 5px 10px;
    background: #dc3545;
}

.admin-source-item button:hover {
    background: #c82333;
}

/* 编辑表单 */
.admin-edit-form {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 表单按钮组 */
.admin-form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.admin-form-buttons button {
    flex: 1;
}

/* 专用按钮样式 */
.admin-export-btn {
    background: #28a745 !important;
}

.admin-export-btn:hover {
    background: #218838 !important;
}

.admin-delete-btn {
    background: #dc3545 !important;
}

.admin-delete-btn:hover {
    background: #c82333 !important;
}

/* 视频操作按钮 */
.admin-video-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 10px;
}

.admin-video-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: auto;
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
    background: #007bff;
    color: white;
}

.admin-video-actions button:hover {
    background: #0056b3;
}

/* 统计信息 */
.admin-stats {
    background: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

/* 标签输入 */
.admin-tag-input {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
}

/* 标签项目 */
.admin-tag-item {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.admin-tag-item button {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0;
    width: auto;
    font-size: 14px;
}

/* 分类内视频 */
.admin-videos-in-category {
    margin-left: 20px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.admin-videos-in-category.collapsed {
    display: none;
}

/* 嵌套视频 */
.admin-nested-video {
    border-left: 3px solid #28a745;
    margin: 10px 0;
    padding-left: 15px;
}

/* 头部控件 */
.admin-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 登出按钮 */
.admin-logout-btn {
    background: #dc3545 !important;
    width: auto !important;
    padding: 8px 16px !important;
}

.admin-logout-btn:hover {
    background: #c82333 !important;
}

/* 分类切换 */
.admin-category-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-category-toggle::before {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #666;
}

.admin-category-toggle.collapsed::before {
    transform: rotate(-90deg);
}

/* 分类统计 */
.admin-category-stats {
    font-size: 12px;
    color: #666;
    margin-left: auto;
}

/* 媒体文件管理样式 */
.admin-media-preview {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.admin-audio-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-media-item {
    background: white;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.admin-media-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.admin-media-info {
    flex: 1;
}

.admin-media-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.admin-media-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.admin-media-info .media-meta {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* 播放按钮特殊样式 */
.admin-play-btn {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.admin-play-btn:hover {
    background: linear-gradient(135deg, #218838, #1a9c7e) !important;
    transform: scale(1.05);
}

/* 配置表单样式 */
.admin-config-section {
    background: #f8f9fa;
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.admin-config-section h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 模式切换器样式 */
.admin-mode-switcher {
    margin: 20px 0;
    text-align: center;
}

.mode-buttons {
    display: inline-flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mode-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.mode-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.mode-btn.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

/* 模式内容容器 */
.admin-mode-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 媒体网格布局 */
.admin-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-media-item {
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.admin-media-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-media-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.admin-audio-preview {
    width: 100%;
    margin-bottom: 10px;
}

.admin-media-info {
    flex: 1;
    margin-bottom: 10px;
}

.admin-media-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.admin-media-info p {
    margin: 0;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.admin-media-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.admin-media-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.admin-audio-preview {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
}

.admin-media-info h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 16px;
}

.admin-media-info p {
    margin: 4px 0;
    color: #6c757d;
    font-size: 14px;
}

/* 操作按钮样式 */
.admin-media-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
    align-items: center;
}

.admin-media-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    width: auto;
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
}

.admin-media-actions button:first-child {
    background: #28a745;
    color: white;
}

.admin-media-actions button:first-child:hover {
    background: #1e7e34;
}

.admin-delete-btn {
    background: #dc3545 !important;
    color: white !important;
}

.admin-delete-btn:hover {
    background: #c82333 !important;
}

/* 空状态样式 */
.admin-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.admin-empty-state h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.admin-empty-state p {
    margin: 0 0 20px 0;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-body {
        padding: 10px;
    }
    
    .admin-video-list {
        margin: 10px auto;
    }
    
    .admin-header-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .admin-form-buttons {
        flex-direction: column;
    }
    
    .admin-video-actions {
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }
    
    .admin-video-actions button,
    .admin-media-actions button {
        width: 100%;
        margin: 2px 0;
        padding: 8px 12px;
        font-size: 13px;
    }

    .admin-media-actions {
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }
    
    .mode-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .mode-btn {
        text-align: center;
        padding: 12px 16px;
    }
    
    .admin-media-grid {
        grid-template-columns: 1fr;
    }
}
