/**
 * Zibll Media Library Manager - Styles
 */

.tab-nav-media-library {
    border-bottom: 1px solid var(--main-border-color);
    padding: 10px;
    list-style: none;
}

/* 媒体列表容器 */
.zml-mini-media-my-lists {
    padding: 15px;
}

/* 图片网格布局 - 一行2个 */
.zml-mini-media-my-lists.zml-grid-view.zml-image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
}

/* 个人主页媒体库图片网格布局 - 使用与用户中心相同的样式 */
#zml-public-images-list.zml-mini-media-my-lists.zml-grid-view.zml-image-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
    padding: 15px !important;
}

/* 个人主页媒体库图片项目样式 */
#zml-public-images-list .zml-media-item {
    position: relative !important;
    background: var(--body-bg-color, #fff) !important;
    border: 1px solid var(--border-color, #eee) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

#zml-public-images-list .zml-media-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    transform: translateY(-2px) !important;
}

/* 个人主页媒体库缩略图容器 */
#zml-public-images-list .zml-media-thumb {
    position: relative !important;
    width: 100% !important;
    padding-bottom: 100% !important;
    background: var(--muted-border-color, #f5f5f5) !important;
    overflow: hidden !important;
}

#zml-public-images-list .zml-media-thumb img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* 个人主页媒体库媒体信息样式 */
#zml-public-images-list .zml-media-info {
    padding: 10px !important;
    background: var(--body-bg-color, #fff) !important;
}

#zml-public-images-list .zml-media-name {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--text-color, #333) !important;
    margin-bottom: 5px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#zml-public-images-list .zml-media-meta {
    font-size: 11px !important;
    color: var(--muted-color, #666) !important;
    margin-bottom: 2px !important;
}

/* 个人主页媒体库操作按钮样式 */
#zml-public-images-list .zml-media-actions {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    display: flex !important;
    gap: 5px !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    z-index: 10 !important;
}

#zml-public-images-list .zml-media-item:hover .zml-media-actions {
    opacity: 1 !important;
}

#zml-public-images-list .zml-action-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

/* 视频列表布局 - 一行1个 */
.zml-mini-media-my-lists.zml-video-list {
    display: block;
    padding: 15px;
}

/* 个人主页媒体库视频列表布局 - 使用与用户中心相同的样式 */
#zml-public-videos-list.zml-mini-media-my-lists.zml-video-list {
    display: block !important;
    padding: 15px !important;
}

/* 个人主页媒体库视频项目样式 */
#zml-public-videos-list .zml-media-item {
    position: relative !important;
    background: var(--body-bg-color, #fff) !important;
    border: 1px solid var(--border-color, #eee) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 15px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    display: flex !important;
    height: 120px !important;
}

#zml-public-videos-list .zml-media-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

#zml-public-videos-list .zml-media-thumb {
    position: relative !important;
    width: 90px !important;
    height: 120px !important;
    background: var(--muted-border-color, #f5f5f5) !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}

#zml-public-videos-list .zml-media-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#zml-public-videos-list .zml-video-play-icon {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 16px !important;
}

/* 个人主页媒体库其他文件列表布局 - 使用与用户中心相同的样式 */
#zml-public-others-list.zml-mini-media-my-lists.zml-list-view {
    display: block !important;
    padding: 15px !important;
}

/* 个人主页媒体库其他文件项目样式 */
#zml-public-others-list .zml-media-item {
    position: relative !important;
    background: var(--body-bg-color, #fff) !important;
    border: 1px solid var(--border-color, #eee) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 15px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    display: flex !important;
    height: 80px !important;
}

#zml-public-others-list .zml-media-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

#zml-public-others-list .zml-media-thumb {
    position: relative !important;
    width: 60px !important;
    height: 80px !important;
    background: var(--muted-border-color, #f5f5f5) !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#zml-public-others-list .zml-file-icon {
    font-size: 24px !important;
    color: var(--muted-color, #666) !important;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .zml-mini-media-my-lists.zml-grid-view.zml-image-grid {
        gap: 10px;
    }
}

/* 媒体项 - 图片网格视图 */
.zml-image-grid .zml-media-item {
    position: relative;
    background: var(--body-bg-color, #fff);
    border: 1px solid var(--border-color, #eee);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.zml-image-grid .zml-media-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* 媒体项 - 视频列表视图 */
.zml-video-list .zml-media-item {
    position: relative;
    background: var(--body-bg-color, #fff);
    border: 1px solid var(--border-color, #eee);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    height: 120px;
}

.zml-video-list .zml-media-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.zml-video-list .zml-media-item:last-child {
    margin-bottom: 0;
}

/* 缩略图容器 - 图片网格视图 */
.zml-image-grid .zml-media-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: var(--muted-border-color, #f5f5f5);
    overflow: hidden;
}

.zml-image-grid .zml-media-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 缩略图容器 - 视频列表视图 */
.zml-video-list .zml-media-thumb {
    position: relative;
    width: 90px;
    height: 120px;
    flex-shrink: 0;
    background: var(--muted-border-color, #f5f5f5);
    overflow: hidden;
}

.zml-video-list .zml-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zml-video-list .zml-media-thumb .zml-file-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: var(--muted-color, #999);
}

/* 移动端视频缩略图 */
@media (max-width: 768px) {
    .zml-video-list .zml-media-thumb {
        width: 150px;
        height: 90px;
    }
}

/* 视频播放图标 */
.zml-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

/* 媒体信息 - 图片网格视图 */
.zml-image-grid .zml-media-info {
    padding: 10px;
}

.zml-image-grid .zml-media-name {
    font-size: 13px;
    color: var(--main-color, #333);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 5px;
}

.zml-image-grid .zml-media-meta {
    font-size: 12px;
    color: var(--muted-color, #999);
    line-height: 1.5;
}

/* 媒体信息 - 视频列表视图 */
.zml-video-list .zml-media-info {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.zml-video-list .zml-media-name {
    font-size: 14px;
    color: var(--main-color, #333);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 8px;
    font-weight: 500;
}

.zml-video-list .zml-media-meta {
    font-size: 12px;
    color: var(--muted-color, #999);
    line-height: 1.8;
}

/* 移动端视频信息 */
@media (max-width: 768px) {
    .zml-video-list .zml-media-info {
        padding: 10px;
    }
    
    .zml-video-list .zml-media-name {
        font-size: 13px;
    }
}

/* 操作按钮容器 - 图片网格 */
.zml-image-grid .zml-media-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.zml-image-grid .zml-media-item:hover .zml-media-actions {
    opacity: 1;
}

/* 操作按钮容器 - 视频列表 */
.zml-video-list .zml-media-actions {
    position: absolute;
    top: 60px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

/* 移动端始终显示按钮 */
@media (max-width: 768px) {
    .zml-image-grid .zml-media-actions,
    .zml-video-list .zml-media-actions {
        opacity: 1;
    }
}

/* 操作按钮样式 */
.zml-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.zml-action-btn:hover {
    transform: scale(1.1);
}

.zml-view-btn {
    color: #2e7cf6;
}

.zml-view-btn:hover {
    background: #2e7cf6;
    color: #fff;
}

.zml-download-btn {
    color: #52c41a;
}

.zml-download-btn:hover {
    background: #52c41a;
    color: #fff;
}

.zml-delete-btn {
    color: #ff4757;
}

.zml-delete-btn:hover {
    background: #ff4757;
    color: #fff;
}

/* 作者标签 */
.zml-author-badge {
    width: fit-content;
    display: inline-block;
    padding: 2px 6px;
    background: var(--theme-color, #2e7cf6);
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
}

/* 列表视图 - 用于"其他"文件 */
.zml-list-view {
    display: block !important;
    padding: 0 !important;
}

.zml-list-view .zml-media-item {
    position: relative;
    border-bottom: 1px solid var(--border-color, #eee);
    transition: background 0.3s ease;
    cursor: pointer;
}

.zml-list-view .zml-media-item:hover {
    background: var(--muted-border-color, #f9f9f9);
}

.zml-list-view .zml-media-item:last-child {
    border-bottom: none;
}

/* 列表项盒子 */
.zml-list-box {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 10px;
}

/* 列表项图标 */
.zml-list-icon-box {
    width: 33px;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted-border-color, #f5f5f5);
    border-radius: 4px;
    flex-shrink: 0;
}

.zml-list-icon-box .zml-file-icon {
    font-size: 18px;
    color: var(--muted-color, #999);
}

.zml-list-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* 列表项内容 */
.zml-list-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.zml-list-content .zml-media-name {
    font-size: 13px;
    color: var(--main-color, #333);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zml-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted-color, #999);
}

/* 列表视图的操作按钮 */
.zml-list-view .zml-media-actions {
    position: static;
    opacity: 1;
    flex-shrink: 0;
}

/* 加载状态 */
.zml-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted-color, #999);
}

.zml-loading i {
    display: block;
    margin-bottom: 10px;
}

/* 空状态 */
.zml-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted-color, #999);
}

.zml-empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    opacity: 0.5;
}

.zml-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* 删除中状态 */
.zml-deleting {
    opacity: 0.5;
    pointer-events: none;
}

/* 删除确认弹窗样式调整 */
#zml-delete-modal .modal-content {
    border-radius: 8px;
    overflow: hidden;
}

#zml-delete-modal .modal-colorful-header {
    padding: 20px;
}

#zml-delete-modal .colorful-make {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.3) 100%);
}

/* 加载更多按钮样式 */
.zml-load-more {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.zml-load-more-btn {
    padding: 10px 30px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.zml-load-more-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.4);
}

.zml-load-more-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.zml-load-more-btn.loading {
    background: #6c757d;
    cursor: not-allowed;
}

.zml-load-more-btn.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 隐私设置样式 */
.zml-privacy-settings {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.zml-privacy-settings .switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.zml-privacy-settings .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.zml-privacy-settings .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.zml-privacy-settings .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.zml-privacy-settings input:checked + .slider {
    background-color: #2196F3;
}

.zml-privacy-settings input:checked + .slider:before {
    transform: translateX(26px);
}

.zml-privacy-toggle-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zml-privacy-toggle-btn:hover {
    background: #5a6268;
}

/* 个人主页媒体库样式 */
.zml-public-media-category {
    display: inline-block;
    margin-left: 10px;
}

.zml-public-media-trigger {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.zml-public-media-trigger:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.zml-public-media-trigger i {
    margin-right: 6px;
    font-size: 16px;
}

.zml-public-media-trigger .count {
    margin-left: 6px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.zml-public-media-box {
    margin-top: 20px;
}

.zml-public-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.zml-public-media-lists {
    padding: 20px;
    min-height: 300px;
    max-height: 50vh;
    overflow-y: auto;
}

.zml-public-media-lists .zml-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.zml-public-media-lists .zml-video-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zml-public-media-lists .zml-list-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
