* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2d3748;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    color: #2d3748;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
    /* overflow: hidden; */
}

#filesList {
    overflow-x: auto;
}

.upload-section {
    padding: 25px;
}

.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
    position: relative;
}

.upload-area:hover {
    border-color: #3182ce;
    background: #edf2f7;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #38a169;
    background: #f0fff4;
    transform: scale(1.02);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    opacity: 0.6;
}

.file-input {
    display: none;
}

.files-section {
    padding: 30px;
}

.files-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    gap: 12px;
}

.files-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* 桌面端：h2在左边，右边是搜索框和控件 */
.files-header>.search-box,
.files-header>.files-header-controls {
    order: 2;
}

.files-header>.search-box {
    flex: 0 0 auto;
    margin-left: auto;
}

.upload-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #10b981;
}

.upload-btn:hover {
    background: #f0fff4;
    border-color: #38a169;
    color: #22543d;
}

.refresh-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #3b82f6;
}

.refresh-btn:hover {
    background: #ebf8ff;
    border-color: #4299e1;
    color: #2b6cb0;
}

.admin-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #8b5cf6;
}

.admin-btn:hover {
    background: #f5f3ff;
    border-color: #a78bfa;
    color: #7c3aed;
}

.offline-download-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: none;
    /* 默认隐藏，等权限加载完成后再显示 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #f59e0b;
}

.offline-download-btn:hover {
    background: #fffbeb;
    border-color: #fbbf24;
    color: #d97706;
}

.offline-download-btn.downloading {
    color: #3b82f6;
    background: #eff6ff;
    border-color: #93c5fd;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* 中转文件管理按钮样式 */
.relay-files-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: none;
    /* 默认隐藏，等权限加载完成后再显示 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #8b5cf6;
}

.relay-files-btn:hover {
    background: #f5f3ff;
    border-color: #a78bfa;
    color: #7c3aed;
}

/* 离线下载对话框样式 */
.offline-download-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.offline-download-modal.show {
    display: flex;
}

/* 手机端：解锁弹窗顶部对齐，避免软键盘弹出时输入框被遮挡 */
@media (max-height: 700px), (hover: none) {
    #unlockFolderModal.offline-download-modal {
        align-items: flex-start;
        padding-top: 12px;
        padding-bottom: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #unlockFolderModal.offline-download-modal .offline-download-content {
        flex-shrink: 0;
        margin-top: 0;
        max-height: min(calc(100vh - 24px), calc(100dvh - 24px));
        overflow-y: auto;
    }
}

.offline-download-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.offline-download-header {
    padding: 20px 20px 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.download-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
}

.download-tab {
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

.download-tab svg {
    width: 16px;
    height: 16px;
}

.download-tab:hover {
    background: #f7fafc;
    color: #4a5568;
}

.download-tab.active {
    background: #f7fafc;
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.offline-download-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.offline-download-body {
    padding: 25px;
}

.offline-download-input-group {
    margin-bottom: 20px;
}

.offline-download-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
}

.offline-download-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.offline-download-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.offline-download-notice {
    padding: 12px 16px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1565c0;
    line-height: 1.6;
}

.offline-download-notice svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 8px;
    color: #2196f3;
}

.offline-download-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.offline-download-btn-action {
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.offline-download-btn-action:hover {
    background: #f7fafc;
}

.offline-download-btn-action.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.offline-download-btn-action.primary:hover {
    background: #2563eb;
}

.offline-download-btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 离线下载进度条样式 */
.offline-download-progress-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.offline-download-progress-modal.show {
    display: flex;
}

.offline-download-progress-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.offline-download-progress-notice {
    padding: 10px 14px;
    background: #f0f9ff;
    border-left: 3px solid #0ea5e9;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #0369a1;
    line-height: 1.5;
}

.offline-download-progress-notice svg {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 6px;
    color: #0ea5e9;
}

.offline-download-progress-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

.offline-download-progress-filename {
    font-size: 0.875rem;
    color: #4a5568;
    margin-bottom: 20px;
    text-align: center;
    word-break: break-all;
}

.offline-download-stage {
    font-size: 0.875rem;
    font-weight: 500;
    color: #3b82f6;
    margin-bottom: 10px;
}

.offline-download-progress-bar-container {
    margin-bottom: 20px;
}

.offline-download-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 8px;
}

.offline-download-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.offline-download-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.offline-download-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.offline-download-size-info {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
}

.bucket-select {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 0.875rem;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 200px;
    min-width: 120px;
    width: auto;
    height: 32px;
    line-height: 30px;
    box-sizing: border-box;
}

.bucket-select:hover {
    border-color: #cbd5e0;
}

.bucket-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.files-table th,
.files-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.files-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #555;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

/* 1. Checkbox */
.files-table th:nth-child(1) {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 0;
    text-align: center;
}

/* 2. Name */
.files-table th:nth-child(2) {
    width: 40%;
    min-width: 150px;
}

/* 3. Size */
.files-table th:nth-child(3) {
    width: 15%;
    min-width: 80px;
}

/* 4. Date */
.files-table th:nth-child(4) {
    width: 20%;
    min-width: 120px;
}

/* 5. Actions */
.files-table th:nth-child(5) {
    width: 20%;
    min-width: 100px;
}

.files-table tbody tr {
    transition: background 0.2s ease;
}

.files-table tbody tr:hover {
    background: #f7fafc;
}

.inline-edit-input {
    width: 100%;
    height: 24px;
    line-height: 24px;
    box-sizing: border-box;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.9);
    outline: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    color: #1a202c;
    padding: 0 6px;
    margin: 0;
    transition: all 0.2s ease;
}

.inline-edit-input:focus {
    border-color: #3b82f6;
    /* Blue border on focus */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    /* Focus ring */
}

.file-name {
    color: #2d3748;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-name:hover {
    color: #3b82f6;
}

.file-size,
.file-date {
    color: #718096;
    font-size: 0.8rem;
    white-space: nowrap;
}

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

.icon-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.icon-btn.view {
    color: #3b82f6;
}

.icon-btn.download {
    color: #10b981;
}

.icon-btn.delete {
    color: #ef4444;
}

.icon-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #718096;
}

.icon-btn.view:hover {
    background: #ebf8ff;
    border-color: #4299e1;
    color: #2b6cb0;
}

.icon-btn.download:hover {
    background: #f0fff4;
    border-color: #38a169;
    color: #22543d;
}

.icon-btn.delete:hover {
    background: #fff5f5;
    border-color: #fc8181;
    color: #c53030;
}

/* 中转文件管理页面样式 */
.relay-files-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f7fafc;
    z-index: 9999;
    overflow-y: auto;
}

.relay-files-page.show {
    display: block;
}

.relay-files-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.relay-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.relay-files-title {
    font-size: 2rem;
    font-weight: 600;
    color: #2d3748;
}

.relay-files-actions {
    display: flex;
    gap: 12px;
}

.relay-files-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
}

.relay-files-empty {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.relay-files-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: #cbd5e0;
}

.relay-files-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.relay-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.relay-file-item:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.relay-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.relay-file-icon {
    width: 40px;
    height: 40px;
    background: #edf2f7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    flex-shrink: 0;
}

.relay-file-details {
    flex: 1;
    min-width: 0;
}

.relay-file-name {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.relay-file-meta {
    font-size: 0.875rem;
    color: #718096;
    display: flex;
    gap: 16px;
}

.relay-file-actions {
    display: flex;
    gap: 8px;
}

.relay-file-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.relay-file-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.relay-file-btn.primary {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.relay-file-btn.primary:hover {
    background: #059669;
    border-color: #059669;
}

.relay-file-btn.danger {
    color: #e53e3e;
}

.relay-file-btn.danger:hover {
    background: #fff5f5;
    border-color: #fc8181;
}

/* 中转下载进度对话框样式 */
.relay-download-progress-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.relay-download-progress-modal.show {
    display: flex;
}

.relay-download-progress-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

.relay-download-progress-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

.relay-download-progress-notice {
    padding: 10px 14px;
    background: #ecfdf5;
    border-left: 3px solid #10b981;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #047857;
    line-height: 1.5;
}

.relay-download-progress-filename {
    font-size: 0.875rem;
    color: #4a5568;
    margin-bottom: 8px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.relay-download-stage {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 20px;
    text-align: center;
}

.relay-download-progress-bar-container {
    margin-bottom: 20px;
}

.relay-download-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: #4a5568;
}

.relay-download-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.relay-download-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.relay-download-size-info {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #718096;
    text-align: center;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .files-section {
        padding: 15px;
    }

    .files-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 第一行：标题和搜索框 */
    .files-header h2 {
        flex: 1;
        min-width: 0;
        font-size: 1.1rem;
        margin-bottom: 0;
    }

    .files-header>.search-box {
        flex: 0 0 auto;
        width: auto;
        /* max-width: 140px; */
        min-width: 100px;
        padding: 0 8px;
        height: 32px;
    }

    .files-header>.search-box .search-input {
        width: 70px;
        font-size: 0.8rem;
        height: 100%;
    }

    /* 第二行：存储桶和按钮组 */
    .files-header-controls {
        width: 100%;
        display: flex;
        gap: 6px;
        align-items: center;
        flex-wrap: nowrap !important;
    }

    .bucket-select {
        flex: 1 1 auto;
        max-width: none;
        min-width: 80px;
        width: auto;
        font-size: 0.75rem;
        padding: 0 6px;
        height: 32px;
        line-height: 30px;
        box-sizing: border-box;
    }

    /* 按钮组容器 */
    .button-group {
        display: flex;
        gap: 6px;
        flex-shrink: 0;
    }

    .upload-btn,
    .new-file-btn,
    .new-folder-btn,
    .refresh-btn,
    .offline-download-btn,
    .relay-files-btn,
    .admin-btn,
    .view-toggle-btn,
    .more-btn {
        flex-shrink: 1;
        /* Allow shrinking */
        width: 32px;
        height: 32px;
        padding: 0;
    }

    .button-group button svg {
        width: 14px;
        height: 14px;
    }


    /* 手机端简化表格布局 */
    .files-table {
        display: block;
    }

    .files-table thead {
        display: block;
    }

    .files-table thead tr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 10px;
        background: #f7fafc;
        border-bottom: 1px solid #e2e8f0;
    }

    .files-table thead th {
        padding: 0;
        border: none;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #64748b;
    }

    /* 1. Checkbox Header */
    .files-table thead th:nth-child(1) {
        width: 40px;
        flex-shrink: 0;
    }

    /* 2. Name Header */
    .files-table thead th:nth-child(2) {
        flex: 1;
        text-align: left;
    }

    /* 3. Size Header */
    .files-table thead th:nth-child(3) {
        flex-shrink: 0;
        text-align: right;
        min-width: 55px;
    }

    /* 4, 5. Date & Actions Header */
    .files-table thead th:nth-child(4),
    .files-table thead th:nth-child(5) {
        display: none;
    }

    .files-table tbody {
        display: block;
    }

    .files-table tr {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 10px;
        border-bottom: 1px solid #e2e8f0;
        background: white;
        transition: background 0.2s;
        gap: 12px;
        cursor: pointer;
    }

    .files-table tr:active {
        background: #e0e7ff;
    }

    .files-table td {
        padding: 0;
        border: none;
    }

    /* 1. Checkbox Column */
    .files-table td:nth-child(1) {
        width: 40px;
        flex-shrink: 0;
        display: flex;
        justify-content: center;
    }

    /* 2. Name Column */
    .files-table td:nth-child(2) {
        flex: 1;
        min-width: 0;
    }

    .files-table td:nth-child(2) .file-name,
    .files-table td:nth-child(2) .folder-item,
    .files-table td:nth-child(2) .file-item {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        max-width: 100%;
    }

    .files-table td:nth-child(2) .file-name span,
    .files-table td:nth-child(2) .folder-item span,
    .files-table td:nth-child(2) .file-item span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.875rem;
    }

    /* 3. Size Column */
    .files-table td:nth-child(3) {
        flex-shrink: 0;
        font-size: 0.75rem;
        color: #64748b;
        font-weight: 500;
        margin-left: auto;
        padding-left: 12px;
        text-align: right;
        min-width: 55px;
    }

    .files-table td:nth-child(3) .file-size {
        white-space: nowrap;
    }

    /* 4, 5. Hide Date & Actions Column */
    .files-table td:nth-child(4),
    .files-table td:nth-child(5) {
        display: none;
    }

    /* 文件名样式 */
    .file-name,
    .folder-item {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .file-name span,
    .folder-item span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        max-width: 100%;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .upload-text {
        font-size: 1rem;
    }
}

.file-name {
    color: #2d3748;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-name:hover {
    color: #3182ce;
}

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

.icon-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.icon-btn.view {
    color: #3b82f6;
}

.icon-btn.download {
    color: #10b981;
}

.icon-btn.delete {
    color: #ef4444;
}

.icon-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #718096;
}

.icon-btn.view:hover {
    background: #ebf8ff;
    border-color: #4299e1;
    color: #2b6cb0;
}

.icon-btn.download:hover {
    background: #f0fff4;
    border-color: #38a169;
    color: #22543d;
}

.icon-btn.delete:hover {
    background: #fff5f5;
    border-color: #fc8181;
    color: #c53030;
}

.file-size {
    color: #718096;
    font-size: 0.875rem;
}

.file-date {
    color: #718096;
    font-size: 0.875rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 16px;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.status-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    display: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.status-error {
    background: #fff5f5;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.upload-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px);
    z-index: 1000;
    width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    transform: translateY(-120px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    overflow: hidden;
}

.upload-modal.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
    0% {
        transform: translateY(-120px) scale(0.95);
        opacity: 0;
    }

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

.upload-modal-header {
    padding: 24px 24px 20px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.upload-modal-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-modal-title svg {
    color: #3b82f6;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.upload-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f7fafc;
    color: #4a5568;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.upload-modal-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.upload-modal-content {
    padding: 24px;
    background: #fafbfc;
}

.upload-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.upload-item-info {
    margin-bottom: 16px;
}

.upload-item-name {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 6px;
    font-size: 0.95rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-left: 26px;
    position: relative;
}

.upload-item-name::before {
    content: '📁';
    font-size: 1rem;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.upload-item-status {
    font-size: 0.85rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 6px;
}

.upload-item-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #48bb78;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.upload-item-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-progress-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.upload-progress-filename {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.upload-progress-bar {
    flex: 1;
    height: 10px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e0 100%);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer-progress 1.5s infinite;
}

@keyframes shimmer-progress {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

.upload-percentage {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
    min-width: 45px;
    text-align: right;
}

.upload-progress-text {
    font-size: 0.8rem;
    color: #4a5568;
    margin-top: 5px;
    text-align: center;
}

.drag-drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.05);
    border: 3px dashed #3b82f6;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    flex-direction: column;
    gap: 20px;
}

.drag-drop-zone.active {
    display: flex;
}

.drag-drop-icon {
    font-size: 3rem;
    color: #3b82f6;
}

.drag-drop-text {
    font-size: 1.2rem;
    color: #2d3748;
    font-weight: 500;
}

@media (max-width: 768px) {
    .upload-modal {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .upload-modal-header {
        padding: 20px 18px 16px;
    }

    .upload-modal-title {
        font-size: 1rem;
    }

    .upload-modal-title svg {
        width: 14px;
        height: 14px;
    }

    .upload-modal-content {
        padding: 18px;
    }

    .upload-item {
        padding: 16px;
    }

    .upload-item-name {
        font-size: 0.9rem;
        padding-left: 24px;
    }

    .upload-item-name::before {
        font-size: 0.9rem;
    }

    .upload-percentage {
        font-size: 0.85rem;
        min-width: 40px;
    }
}

.breadcrumb {
    margin-bottom: 20px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.breadcrumb a {
    color: #3182ce;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #2c5282;
    text-decoration: underline;
}

.folder-item,
.file-item {
    display: inline-flex;
    /* 更改为 inline-flex 使宽度自适应内容 */
    align-items: center;
    padding: 0;
    color: #2d3748;
    cursor: pointer;
    transition: background-color 0.2s;
    height: 24px;
    /* Match inline-edit-input height */
    gap: 8px;
}

.folder-item:hover,
.file-item:hover {
    color: #3b82f6;
    /* Hover effect similar to file-name */
}

.file-item span,
.folder-item span {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-warning {
    background: #fffbf0;
    color: #744210;
    border: 1px solid #f6e05e;
}

.status-info {
    background: #ebf8ff;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #718096;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 乐观 UI：上传中图标 */
.uploading-icon {
    width: 14px;
    height: 14px;
    border: 2px solid #e2e8f0;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
}

.uploading-item {
    opacity: 0.7;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    opacity: 0.5;
}

.bucket-info {
    background: rgba(49, 130, 206, 0.1);
    color: #2c5282;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(49, 130, 206, 0.2);
}

.files-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.button-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.new-file-btn,
.new-folder-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.new-file-btn {
    color: #ec4899;
}

.new-file-btn:hover {
    background: #fce7f3;
    border-color: #f472b6;
    color: #be185d;
}

.new-folder-btn {
    color: #d946ef;
}

.new-folder-btn:hover {
    background: #f3e8ff;
    border-color: #e879f9;
    color: #9d174d;
}

.more-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.more-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

/* 默认隐藏"更多"按钮 */
.more-btn {
    display: none;
}

/* 响应式设计 - 手机屏幕 */
@media (max-width: 768px) {
    .files-header-controls {
        flex-wrap: nowrap !important;
        width: 100%;
        gap: 8px;
    }

    .button-group {
        flex-wrap: nowrap;
        max-width: 100%;
        gap: 4px;
        /* Reduced gap */
        flex: 1;
        /* Take up remaining space */
        display: flex;
        min-width: 0;
        /* Allow shrinking */
    }

    /* 手机紧凑模式：隐藏部分按钮，显示更多按钮 */
    .button-group.condensed .offline-download-btn,
    .button-group.condensed .relay-files-btn,
    .button-group.condensed .admin-btn {
        display: none !important;
    }

    /* 均分空间给所有可见按钮 */
    .button-group.condensed .upload-btn,
    .button-group.condensed .new-file-btn,
    .button-group.condensed .new-folder-btn,
    .button-group.condensed .refresh-btn,
    .button-group.condensed .view-toggle-btn,
    .button-group.condensed .more-btn {
        flex: 1;
        min-width: 18px;
        /* Further reduced to ensure space */
        max-width: 32px;
        display: flex;
        padding: 0;
    }

    /* 手机展开模式：显示所有按钮，均分空间 */
    .button-group.expanded {
        justify-content: space-between;
        flex-wrap: nowrap;
        width: 100%;
    }

    .button-group.expanded>button {
        display: flex;
        flex: 1;
        max-width: 32px;
        min-width: 18px;
        padding: 0;
    }

    /* 展开时bucket-select隐藏 */
    .custom-select-container.hidden,
    #bucketSelectContainer.hidden {
        display: none !important;
    }
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0 12px;
    gap: 8px;
    transition: all 0.2s;
    max-width: 300px;
    height: 32px;
    flex: 0 1 auto;
}

.search-box:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box svg {
    color: #9ca3af;
    flex-shrink: 0;
}

.search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    color: #2d3748;
    width: 100%;
    min-width: 150px;
    height: 100%;
    display: flex;
    align-items: center;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-clear {
    background: none;
    border: none;
    padding: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    color: #9ca3af;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-clear:hover {
    color: #ef4444;
}

.search-clear.show {
    display: flex;
}

.file-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 不同文件类型的图标颜色 */
.file-icon.image {
    color: #10b981;
    /* 绿色 - 图片 */
}

.file-icon.document {
    color: #3b82f6;
    /* 蓝色 - 文档 */
}

.file-icon.executable {
    color: #ef4444;
    /* 红色 - 可执行文件 */
}

.file-icon.archive {
    color: #f59e0b;
    /* 橙色 - 压缩包 */
}

.file-icon.video {
    color: #8b5cf6;
    /* 紫色 - 视频 */
}

.file-icon.audio {
    color: #ec4899;
    /* 粉色 - 音频 */
}

.file-icon.code {
    color: #6366f1;
    /* 深蓝 - 代码 */
}

.file-icon.default {
    color: #6b7280;
    /* 灰色 - 默认 */
}

/* 文件详情模态框样式 */
.file-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.file-detail-modal.show {
    display: flex;
}

.file-detail-content {
    background: white;
    border-radius: 12px;
    width: auto;
    max-width: 95vw;
    height: auto;
    max-height: 95vh;
    min-height: 300px;
    min-width: 360px;
    /* Minimum width for buttons */
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* 不可预览文件的紧凑模式 */
.file-detail-content.compact {
    width: 95%;
    max-width: 600px;
}

.file-detail-header {
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    min-height: 48px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.file-detail-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    overflow: hidden;
}

.file-detail-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-detail-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f7fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.file-detail-close svg {
    width: 18px;
    height: 18px;
}

.file-detail-close:hover {
    background: #edf2f7;
}

.file-detail-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.file-preview-container {
    flex: 1;
    overflow: hidden;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.file-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.file-preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #718096;
}

.file-detail-actions {
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.action-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.action-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.action-btn.success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.action-btn.success:hover {
    background: #059669;
    border-color: #059669;
}

.action-btn.success:active {
    transform: scale(0.95);
}

.action-btn.success.copied {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* 二维码悬浮卡片 */
.qrcode-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    width: 240px; /* 固定宽度，防止文字挤压 */
    min-width: 200px;
}

.qrcode-popup.show {
    opacity: 1;
    visibility: visible;
}

.qrcode-popup::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.qrcode-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
    text-align: center;
    white-space: nowrap; /* 防止文字换行 */
}

#qrcodeCanvas {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    width: 200px; /* 明确指定画布容器尺寸 */
    height: 200px;
}

#qrcodeCanvas svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* 二维码按钮容器 */
.qrcode-btn-wrapper {
    position: relative;
    display: inline-block;
}

/* 确认对话框样式 */
.confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-modal.show {
    display: flex;
}

.confirm-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 24px;
    text-align: center;
}

.confirm-modal-icon {
    width: 48px;
    height: 48px;
    background: #fef2f2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.confirm-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.confirm-modal-message {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    flex: 1;
}

.confirm-btn.cancel {
    background: white;
    border-color: #e5e7eb;
    color: #374151;
}

.confirm-btn.cancel:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.confirm-btn.danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.confirm-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* 移动端模式 */
.qrcode-btn-wrapper.mobile-mode .action-btn.active {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

/* Toast提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    border-left: 4px solid #10b981;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-icon.success {
    color: #10b981;
}

.toast-icon.error {
    color: #ef4444;
}

.toast-icon.info {
    color: #3b82f6;
}

.toast-message {
    color: #2d3748;
    font-size: 0.875rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .file-detail-content {
        width: 95%;
        max-height: 95vh;
    }

    .file-detail-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .qrcode-btn-wrapper {
        width: 100%;
    }

    .qrcode-btn-wrapper .action-btn {
        width: 100%;
    }

    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        right: auto;
    }

    /* 移动端下拉菜单适配 */
    .custom-select-options {
        left: 0 !important;
        transform: none !important;
        width: 280px;
        /* 移动端可以稍微宽一点 */
        max-width: 85vw;
        /* 防止超出屏幕宽度 */
    }

    /* 移动端动画 */
    .custom-select-options.show {
        animation: fadeInMobile 0.15s ease-out !important;
    }
}

@keyframes fadeInMobile {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

/* 自定义存储桶下拉框 */
.custom-select-container {
    position: relative;
    /* 移除固定最小宽度，改为自适应 */
    /* min-width: 220px; */
}

.custom-select-trigger {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    /* 增加文字和图标间距 */
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #2d3748;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
    /* 防止文字换行 */
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.8);
}

.custom-select-options {
    /* 移除默认的居中对齐，因为现在由 JS 控制绝对位置 */
    position: absolute; /* JS 会动态改为 fixed */
    /* left: 50%; 已移除 */
    /* transform: translateX(-50%); 已移除 */
    
    /* 设定一个固定宽度，保证展示用量信息足够宽敞 */
    width: 260px;
    margin-top: 8px;
    
    /* Unified Frosted Glass Style */
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;

    z-index: 100;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    padding: 6px;
}

.custom-select-options.show {
    display: block;
    /* 修改动画以适配固定定位 */
    animation: fadeInSimple 0.15s ease-out;
}

@keyframes fadeInSimple {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

.bucket-option {
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s;
}

.bucket-option:hover {
    background: #eff6ff;
}

.bucket-option.selected {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
}

.bucket-option-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1e293b;
    font-size: 0.9rem;
}

.bucket-option-details {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.bucket-progress-bg {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.bucket-progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* 选中框样式 */
.selection-box {
    position: fixed;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.5);
    pointer-events: none;
    z-index: 1000;
    display: none;
}

/* 复选框样式 */
.checkbox-cell {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 0 !important;
    text-align: center;
    vertical-align: middle;
}

/* 确保复选框容器垂直居中 */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.custom-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid #cbd5e0;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.6);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.custom-checkbox:hover {
    border-color: #3b82f6;
}

.custom-checkbox.checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.custom-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 选中行样式 */
tr.selected {
    background: rgba(59, 130, 246, 0.1) !important;
}

.files-table {
    user-select: none;
    /* 防止拖拽选择文本 */
    -webkit-user-select: none;
}

/* 右键菜单样式 */
.context-menu {
    position: fixed;
    /* Unified Frosted Glass Style */
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;

    padding: 6px;
    z-index: 9999;
    min-width: 180px;
    display: none;
    flex-direction: column;
    animation: fadeIn 0.1s ease-out;
}

.context-menu-item {
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.context-menu-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.context-menu-separator {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 4px 0;
}

/* 移动/复制模态框样式 */
.path-select-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.path-select-modal.show {
    display: flex;
}

.path-select-content {
    /* Unified Frosted Glass Style */
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;

    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.path-select-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.path-select-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.path-select-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.folder-tree-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.folder-tree-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.folder-tree-item.selected {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.path-select-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 分享设置模态框 */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0);
    z-index: 2100;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.share-modal.show {
    display: flex;
}

.share-modal-content {
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    width: 560px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.share-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

.share-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
}

.share-target-info {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    color: #2d3748;
    margin-bottom: 14px;
    font-size: 0.92rem;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.share-section {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.share-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.share-switch-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #374151;
    font-size: 0.9rem;
}

.share-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.share-preset {
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #334155;
}

.share-preset.active {
    border-color: #3b82f6;
    color: #1d4ed8;
    background: #eff6ff;
}

.share-custom-duration {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.share-custom-duration input,
.share-custom-duration select,
#shareCustomCodeInput {
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    font-size: 0.9rem;
    color: #334155;
    min-width: 0;
}

.share-custom-duration input {
    flex: 1;
}

#shareCustomCodeInput {
    width: 100%;
    margin-top: 8px;
}

.share-hint {
    color: #64748b;
    font-size: 0.8rem;
}

.share-code-mode {
    display: flex;
    gap: 14px;
    color: #334155;
    font-size: 0.9rem;
}

.share-error {
    min-height: 18px;
    color: #dc2626;
    font-size: 0.85rem;
}

.share-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ==================== 拖拽功能样式 ==================== */

/* 拖拽中的行样式 */
.files-table tbody tr.dragging {
    opacity: 0.5;
    background: rgba(59, 130, 246, 0.1);
}

/* 拖拽悬停目标文件夹样式 - 列表视图 */
.files-table tbody tr.drag-over {
    background: rgba(255, 255, 255, 0.4) !important;
}

/* 拖拽悬停目标文件夹样式 - 网格视图 */
.grid-item.drag-over {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* 拖拽无效目标样式 */
.files-table tbody tr.drag-invalid {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    cursor: not-allowed;
}

/* ==================== 目录树样式优化 ==================== */
.tree-node {
    user-select: none;
}

.tree-content {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tree-content:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.tree-content.selected {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2b6cb0;
}

.toggle-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: #a0aec0;
    border-radius: 4px;
}

.toggle-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #4a5568;
}

.toggle-icon.expanded {
    transform: rotate(90deg);
}

.toggle-icon.invisible {
    visibility: hidden;
    pointer-events: none;
}

.folder-icon {
    margin-right: 8px;
    /* color: #ecc94b; */
}

.tree-children {
    padding-left: 23px;
    position: relative;
    margin-left: 10px;
    border-left: 1px solid #e2e8f0;
}

/* 拖拽时的光标 */
.files-table tbody tr[draggable="true"] {
    cursor: move;
}

/* 拖拽幽灵图像样式 */
.drag-ghost {
    position: fixed;
    top: -9999px;
    left: -9999px;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.95);
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    z-index: 10000;
}

.folder-tree-indent {
    width: 20px;
    display: inline-block;
}
.card table,
.card tbody,
.card thead,
.card tr,
.card td,
.card th,
.file-list,
.file-item,
.el-table,
.el-table__expanded-cell {
    background-color: transparent !important;
    background: transparent !important;
}

.bucket-select {
    background: transparent !important;
}

.breadcrumb {
    background: transparent !important;
}

.files-header,
thead th {
    background-color: rgba(255, 255, 255, 0.1) !important;
    /* 给表头一点点区分度 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.card {
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3) !important;

    border-radius: 20px !important;
    overflow: visible !important;
}

#filesList {
    overflow-x: auto;
}

.custom-select-trigger {
    background: transparent !important;
}

.files-header>.search-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.files-header>.search-box input,
.search-input {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 12px !important;
    color: #1a202c !important;
    padding: 8px 12px !important;
}

.search-box svg,
.icon {
    color: #2d3748 !important;
}

input::placeholder {
    color: rgba(45, 55, 72, 0.7) !important;
}

tbody tr,
.file-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

:root {
    /* Plyr 核心主题色 (官方演示使用的是 #00b3ff) */
    --plyr-color-main: #00b3ff;
    
    /* 播放器控件图标颜色 */
    --plyr-video-control-color: #ffffff;
    
    /* 控件悬停背景色 (通常设为主题色的半透明版) */
    --plyr-video-control-background-hover: rgb(0, 179, 255);
    
    /* 菜单背景和文字颜色 */
    --plyr-menu-background: rgba(255, 255, 255, 0.95);
    --plyr-menu-color: #4a5568;
    
    /* 默认背景，会被JS覆盖 */
    --bg-image-url: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Plyr 样式修正 */
.plyr {
    width: 100%;
    height: auto;
    max-height: 80vh;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
}


body {
    background: none !important;
    min-height: 100vh !important;
}

body::before {
    content: "";
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: var(--bg-image-url) !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    transform: translateZ(0);
}

@media (hover: hover) {
    tbody tr:hover {
        background: rgba(255, 255, 255, 0.4) !important;
        cursor: pointer !important;
    }
}

.files-header {
    padding-bottom: unset !important;
    border-bottom: unset !important;
    background-color: transparent !important;
    border-bottom: 0px !important;
}

.more-btn {
    background-color: transparent !important;
}

.more-btn:hover {
    border-color: #e2e8f0 !important;
}

.new-file-btn,
.new-folder-btn {
    /* No fixed min-width here, allow mobile rules to control it */
}

.file-item {
    border: 0px !important;
}

.folder-item:hover {
    background-color: unset !important;
    border: 0px !important;
}

tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Grid View Styles */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    padding: 16px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    user-select: none;
    animation: fadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) backwards;
}

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

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

.grid-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.grid-item.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.grid-item-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-item-icon img,
.grid-item-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Thumbnail images should cover the area */
.grid-item-icon img.lazy-thumb,
.grid-item-icon img[src*="/thumbnail"] {
    object-fit: cover;
    border-radius: 8px;
}

.grid-item-name {
    font-size: 0.9rem;
    color: #2d3748;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

.grid-item:hover .grid-item-name {
    /* Keep single line on hover as requested */
}

.view-toggle-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.view-toggle-btn:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e0;
}

/* Grid Checkbox (Optional, usually visible on hover or selection) */
.grid-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-item:hover .grid-checkbox,
.grid-item.selected .grid-checkbox {
    opacity: 1;
}

/* Make icons larger in grid view */
.files-grid .file-icon {
    width: 64px !important;
    height: 64px !important;
}
.file-icon {
    -webkit-user-drag: none;
    user-drag: none;
}

/* Hover effect for drag target (Name) */
.file-name:hover, .folder-item:hover, .grid-item-name:hover {
    color: #3182ce;
    cursor: grab;
}

.file-name:active, .folder-item:active, .grid-item-name:active {
    cursor: grabbing;
}

/* Selection Box (Marquee) */
.selection-area {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.5);
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}

/* Drag Ghost Badge */
.drag-ghost {
    position: absolute;
    top: -1000px;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #e2e8f0;
    font-size: 14px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10000;
    width: max-content;
}

.drag-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    height: 18px;
    min-width: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.drag-stack-effect {
    position: absolute;
    top: 4px;
    left: 4px;
    right: -4px;
    bottom: -4px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    z-index: -1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
