/* ============================================
   aliyun.css — 云文档模块专属样式
   公共样式在 static/common.css
   ============================================ */

/* ---------- 文件图标 ---------- */
.file-icon {
    font-size: 1.6rem;
    color: var(--text-muted);
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}
.file-icon-lg {
    font-size: 3rem;
    color: var(--primary);
}

/* ---------- 文件名列 ---------- */
.file-name-cell {
    font-weight: 600;
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ---------- 类型列（长 MIME 截断，完整值悬停显示） ---------- */
.file-type-cell {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ---------- 存储商标签 ---------- */
.badge-provider {
    display: inline-block;
    font-size: 0.7rem;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--primary);
    vertical-align: middle;
}

/* ---------- 批量删除按钮 ---------- */
#btnBatchDelete .batch-count {
    font-size: 0.8rem;
}

/* ---------- 上传进度条 ---------- */
.upload-progress-wrap {
    margin-top: 14px;
}
.upload-progress-wrap .progress {
    height: 14px;
}
#uploadProgressText {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---------- 上传文件信息 ---------- */
#uploadFileInfo {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    word-break: break-all;
}

/* ---------- 左右布局 ---------- */
.doc-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.folder-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-h) + 16px);
}
.doc-main {
    flex: 1;
    min-width: 0;
}

/* ---------- 文件夹侧栏头部 ---------- */
.folder-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: #f8f9fa;
}
.folder-sidebar-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
}
.folder-sidebar-title i {
    color: var(--primary);
    margin-right: 6px;
}
.folder-sidebar-actions {
    display: flex;
    gap: 4px;
}
.folder-sidebar-actions .action-btn {
    padding: 2px 7px;
    font-size: 0.85rem;
}
.folder-sidebar-actions .action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- 文件夹树 ---------- */
.folder-tree {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 8px 6px;
}
.folder-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    transition: background var(--transition);
}
.folder-node:hover {
    background: rgba(13, 110, 253, 0.06);
}
.folder-node.active {
    background: rgba(13, 110, 253, 0.12);
    color: var(--primary);
    font-weight: 600;
}
.folder-node.active .bi-folder-fill,
.folder-node.active .bi-inboxes {
    color: var(--primary);
}
.folder-node > i {
    color: var(--warning);
    flex-shrink: 0;
}
.folder-node > i.bi-inboxes {
    color: var(--text-muted);
}
.folder-caret {
    width: 16px;
    flex-shrink: 0;
    display: inline-flex;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.folder-caret.no-children {
    visibility: hidden;
}
.folder-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 当前文件夹路径条 ---------- */
.doc-folder-path {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding: 0 2px;
}
.doc-folder-path i {
    color: var(--primary);
}
.doc-folder-path span {
    font-weight: 600;
    color: var(--text-dark);
}

/* ---------- 上传目标提示 ---------- */
.upload-target {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(13, 110, 253, 0.06);
    border: 1px dashed rgba(13, 110, 253, 0.4);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* ---------- 复选框列 ---------- */
#docTable th.check-col,
#docTable td.check-col {
    width: 40px;
    text-align: center;
}
.doc-check {
    cursor: pointer;
}

/* ---------- 预览按钮 ---------- */
.action-btn.preview-btn {
    color: var(--success);
    border-color: var(--success);
}
.action-btn.preview-btn:hover {
    background: var(--success);
    color: #fff;
}

/* ---------- 全屏图片预览 ---------- */
.preview-modal .modal-dialog {
    max-width: none;
    margin: 0;
    height: 100vh;
}
.preview-modal .modal-content {
    height: 100%;
    border: none;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
}
.preview-header {
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.preview-header .modal-title {
    font-size: 1rem;
}
.preview-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    position: relative;
    background: #111;
}
.preview-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    overflow: hidden;
}
.preview-stage:active {
    cursor: grabbing;
}
#previewImage {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    transform-origin: center;
    transition: transform 0.08s ease;
    user-select: none;
    -webkit-user-select: none;
    background: #fff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.preview-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 999px;
    padding: 6px 16px;
    white-space: nowrap;
}
.preview-footer {
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* ---------- 同步结果 ---------- */
.sync-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}
.sync-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.sync-warning {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ---------- 批量上传 ---------- */
.batch-upload-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 10px 0;
}
#batchFileList {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}
.batch-file-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #fff;
}
.batch-file-head {
    gap: 8px;
}
.batch-file-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
}
.batch-file-status {
    font-size: 0.8rem;
    flex-shrink: 0;
}
.batch-file-progress {
    height: 6px;
    margin-top: 8px;
}
.batch-total-progress {
    margin-top: 14px;
}
.batch-total-progress .progress {
    height: 12px;
}
#batchTotalText {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---------- 响应式：小屏隐藏列 / 侧栏折叠 ---------- */
@media (max-width: 992px) {
    .folder-sidebar {
        width: 220px;
    }
}
@media (max-width: 768px) {
    .file-name-cell {
        max-width: 140px;
    }
    .doc-layout {
        flex-direction: column;
    }
    .folder-sidebar {
        width: 100%;
        position: static;
    }
    .folder-tree {
        max-height: 240px;
    }
}
