:root {
    --primary-color: #3498db;
    --primary-light: #ebf5fb;
    --secondary-color: #f8f9fa;
    --border-color: #e0e0e0;
    --text-color: #333;
    --text-light: #666;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --sidebar-width: 250px;
    --bottom-nav-height: 60px;
    --mobile-action-bar-height: 56px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* ========== 侧边栏样式 ========== */
.sidebar {
    width: var(--sidebar-width);
    background-color: white;
    box-shadow: var(--shadow);
    padding: 20px 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: var(--secondary-color);
    font-size: 16px;
    color: var(--text-light);
    z-index: 10;
}

.sidebar-close:hover {
    background: var(--border-color);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

.logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    font-size: 15px;
    min-height: 48px; /* touch-friendly */
}

.nav-item:hover {
    background-color: var(--primary-light);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.nav-item i {
    margin-right: 10px;
    font-size: 18px;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: auto;
}

/* ========== 汉堡菜单按钮 ========== */
.hamburger-btn {
    display: none;
    font-size: 20px;
    padding: 8px 10px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    border-radius: 4px;
    transition: background 0.2s;
}

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

/* ========== 主内容区样式 ========== */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-width: 0; /* flex overflow fix */
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 48px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.breadcrumb::-webkit-scrollbar {
    display: none;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    margin: 0 6px;
    color: var(--text-light);
    flex-shrink: 0;
}

.upload-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    min-height: 40px;
    font-size: 14px;
    line-height: 1.2;
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
}

.btn i {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    line-height: 1;
}

.btn-label {
    flex-shrink: 0;
    display: inline;
}

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

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

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

.btn-copy {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

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

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

/* ========== 文件操作栏样式 ========== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
}

.toolbar-left {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}

.toolbar-right {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.toolbar-separator {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
    flex-shrink: 0;
    align-self: center;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 12px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 200px;
    font-size: 14px;
    min-height: 40px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* 排序按钮区域 */
.sort-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sort-label {
    color: var(--text-light);
    font-size: 14px;
    margin-right: 2px;
}

.sort-btn {
    position: relative;
    padding: 6px 12px;
    font-size: 13px;
}

.sort-btn.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.sort-indicator {
    font-size: 12px;
    font-weight: bold;
    color: var(--primary-color);
}

/* 移动端更多操作按钮 */
.mobile-more-btn {
    display: none !important;
}

/* ========== 文件列表样式 ========== */
.file-list-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: auto;
}

.file-list-header {
    display: grid;
    grid-template-columns: 40px minmax(200px, 0.8fr) 120px 180px 200px;
    padding: 12px 15px;
    background-color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
    user-select: none;
    font-size: 14px;
}

.file-list-header > div {
    display: flex;
    align-items: center;
}

.file-list-header > div:not(:first-child) {
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
}

.file-list-header > div:not(:first-child):hover {
    background-color: var(--border-color);
}

.file-list {
    list-style: none;
}

.file-item {
    display: grid;
    grid-template-columns: 40px minmax(200px, 0.8fr) 120px 180px 200px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 52px;
    align-items: center;
}

.file-item:hover {
    background-color: var(--primary-light);
}

.file-item.selected {
    background-color: var(--primary-light);
}

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0; /* text overflow fix */
}

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

.file-size, .file-modified, .file-actions {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.file-actions {
    gap: 4px;
    opacity: 1;
    flex-wrap: wrap;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.15s;
}

.action-btn:hover {
    filter: brightness(1.15);
    transform: scale(1.1);
}

/* 操作按钮功能色 */
.action-download { color: #3498db; }
.action-download:hover { background: #ebf5fb; }

.action-preview { color: #2ecc71; }
.action-preview:hover { background: #e8f8ef; }

.action-rename { color: #7f8c8d; }
.action-rename:hover { background: #f0f0f0; }

.action-compress { color: #e67e22; }
.action-compress:hover { background: #fef5ec; }

.action-delete { color: #e74c3c; }
.action-delete:hover { background: #fdedec; }

.action-restore { color: #27ae60; }
.action-restore:hover { background: #e8f8ef; }

.action-permadelete { color: #c0392b; }
.action-permadelete:hover { background: #fdedec; }


/* ========== 右键菜单样式 ========== */
.context-menu {
    position: fixed;
    background-color: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 6px 0;
    z-index: 1000;
    min-width: 180px;
    display: none;
}

.context-menu-item {
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    min-height: 44px; /* touch-friendly */
    transition: background 0.15s;
}

.context-menu-item:hover {
    background-color: var(--primary-light);
}

.context-menu-danger {
    color: var(--danger-color);
}

.context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 4px 12px;
}

/* ========== 剪贴板提示条 ========== */
.clipboard-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: #fef9e7;
    border: 1px solid #f9e79f;
    border-radius: 8px;
    gap: 12px;
    flex-wrap: wrap;
}

.clipboard-bar.active {
    display: flex;
}

.clipboard-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #7d6608;
    min-width: 0;
}

.clipboard-info span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clipboard-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    min-height: 34px;
}

/* ========== 上传区域样式 ========== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s;
    background-color: white;
}

.upload-area.active {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.upload-area i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-area p {
    margin-bottom: 15px;
    color: var(--text-light);
}

/* ========== 模态框样式 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 500px;
    max-width: 100%;
    max-height: 90vh;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-modal-content {
    width: 90%;
    max-width: 1200px;
}

.announcement-modal-content {
    width: 600px;
    max-width: 100%;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 18px;
}

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

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close:hover {
    background: var(--secondary-color);
}

/* 表单 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px; /* prevent iOS zoom */
    min-height: 44px;
}

.form-group label {
    font-weight: 500;
    font-size: 14px;
}

/* ========== 预览模态框样式 ========== */
.preview-content {
    max-height: 65vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.preview-image {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* ========== 确认对话框样式 ========== */
.confirm-dialog {
    text-align: center;
    padding: 10px 0;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.confirm-message {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

/* ========== 冲突处理对话框 ========== */
.conflict-modal-content {
    width: 650px;
    max-width: 95%;
}

.conflict-file-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.conflict-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.conflict-file-item:last-child {
    border-bottom: none;
}

.conflict-file-name {
    flex: 1;
    min-width: 140px;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conflict-file-options {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.conflict-file-options label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-light);
    white-space: nowrap;
}

.conflict-file-options input[type="radio"] {
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* ========== 同名文件处理对话框 ========== */
.duplicate-files-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
    background-color: var(--secondary-color);
}

.duplicate-file-item {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

.duplicate-file-item:last-child {
    border-bottom: none;
}

/* ========== 消息提示 ========== */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    z-index: 1100;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    transform: translateX(150%);
    max-width: calc(100vw - 40px);
    word-break: break-word;
}

.message.success {
    background-color: var(--success-color);
}

.message.error {
    background-color: var(--danger-color);
}

.message.warning {
    background-color: var(--warning-color);
}

.message.show {
    transform: translateX(0);
}

/* ========== 上传进度条样式 ========== */
.upload-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    z-index: 1200;
    display: none;
}

.upload-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.upload-progress-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    width: 400px;
    max-width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}

.upload-progress-info {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-progress-text {
    font-size: 14px;
    color: var(--text-light);
}

.upload-progress-percent {
    font-weight: 600;
    color: var(--primary-color);
}

.upload-progress-bar-container {
    height: 8px;
    background-color: var(--secondary-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.upload-progress-bar-inner {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-files {
    margin-top: 15px;
    max-height: 150px;
    overflow-y: auto;
    text-align: left;
}

.upload-progress-file {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.upload-progress-file:last-child {
    border-bottom: none;
}

/* ========== 移动端底部导航栏 ========== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 90;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 11px;
    transition: color 0.2s;
    min-width: 60px;
    min-height: 48px;
}

.bottom-nav-item i {
    font-size: 22px;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item span {
    font-size: 11px;
}

/* ========== 移动端快捷操作栏 ========== */
.mobile-action-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--mobile-action-bar-height);
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 95;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-action-bar.active {
    display: flex;
}

.mobile-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    min-width: 48px;
    min-height: 44px;
}

.mobile-action-btn:active {
    background: var(--secondary-color);
}

.mobile-action-btn i {
    font-size: 20px;
}

.mobile-action-delete {
    color: var(--danger-color);
}

/* ========== 公告模态框样式 ========== */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    margin-right: auto;
    min-height: 44px; /* touch-friendly */
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s;
    flex-shrink: 0;
}

.checkbox-container input:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-container input:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 公告内容样式 */
#announcementContent h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

#announcementContent hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.announcement-history {
    display: block;
    width: 100%;
    height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: auto;
    padding: 12px 16px;
    margin: 12px 0 0;
    background: var(--secondary-color);
    -webkit-overflow-scrolling: touch;
}

#announcementContent ul {
    margin: 15px 0;
    padding-left: 20px;
}

#announcementContent li {
    margin-bottom: 8px;
    line-height: 1.5;
}

#announcementContent p {
    margin-top: 15px;
    color: var(--text-light);
}

/* ========== 加载中遮罩 ========== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner p {
    margin-top: 12px;
    color: var(--text-light);
    font-size: 14px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== Body 滚动锁定 ========== */
body.modal-open {
    overflow: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

/* ========== 预览增强样式 ========== */
.preview-pdf-container {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    border: none;
    border-radius: 4px;
}

.preview-pdf-container embed,
.preview-pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 4px;
}

.preview-video,
.preview-audio {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 4px;
    background: #000;
}

.preview-audio {
    width: 100%;
    min-height: 60px;
    background: var(--secondary-color);
    border-radius: 8px;
    padding: 10px;
}

.preview-unsupported {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.preview-unsupported .preview-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.preview-unsupported h3 {
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 18px;
}

.preview-unsupported p {
    margin-bottom: 16px;
    font-size: 14px;
}

.preview-unsupported .file-info {
    display: inline-block;
    background: var(--secondary-color);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-light);
}

.preview-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--danger-color);
}

.preview-error .preview-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.preview-error h3 {
    color: var(--text-color);
    margin-bottom: 8px;
}

.preview-error p {
    color: var(--text-light);
    font-size: 14px;
}

/* 文本预览增强 */
.preview-text {
    white-space: pre-wrap;
    font-family: 'Cascadia Code', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', monospace;
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    word-break: break-all;
    tab-size: 4;
    -moz-tab-size: 4;
}

.preview-text.loading {
    color: var(--text-light);
    background-color: var(--secondary-color);
    text-align: center;
    font-family: inherit;
}

/* ========== 文件列表空状态 ========== */
.file-list-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-light);
}

.file-list-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.6;
}

.file-list-empty p {
    font-size: 15px;
    margin-bottom: 4px;
}

.file-list-empty .empty-hint {
    font-size: 13px;
    color: #999;
}

/* ========== 文件列表加载状态 ========== */
.file-list-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
}

.file-list-loading .spinner {
    margin-bottom: 12px;
}

/* ================================================================ */
/*                     响 应 式 设 计                                */
/* ================================================================ */

/* ---- 中等屏幕 (平板竖屏, ≤1024px) ---- */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .file-list-header,
    .file-item {
        grid-template-columns: 36px minmax(150px, 0.8fr) 90px 150px 180px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .search-box input {
        width: 160px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* ---- 小平板/大手机 (≤768px) ---- */
@media (max-width: 768px) {
    /* 侧边栏变为抽屉式 */
    .container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        z-index: 101;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
        padding-top: 50px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
    }

    .hamburger-btn {
        display: flex;
    }

    /* 主内容区 */
    .main-content {
        padding: 12px;
        padding-bottom: calc(var(--bottom-nav-height) + 20px + env(safe-area-inset-bottom, 0));
    }

    /* 头部 */
    .header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }

    .header-left {
        flex: 1;
        min-width: 0;
    }

    .breadcrumb {
        font-size: 13px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .upload-buttons {
        gap: 6px;
    }

    .upload-buttons .btn-label {
        display: none; /* 仅显示图标 */
    }

    .upload-buttons .btn {
        padding: 8px 12px;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    /* 隐藏桌面端排序标签 */
    .sort-label {
        display: none;
    }

    .sort-buttons .btn-label {
        display: none;
    }

    .sort-buttons .btn {
        padding: 8px 10px;
        min-width: 40px;
        justify-content: center;
    }

    /* 工具栏 */
    .toolbar {
        padding: 8px 0;
        margin-bottom: 10px;
        gap: 6px;
    }

    .toolbar-left {
        gap: 3px;
    }

    .toolbar-left .btn-label,
    .toolbar-right .btn-label {
        display: none;
    }

    .toolbar .btn {
        padding: 8px 10px;
        min-width: 40px;
        min-height: 40px;
        justify-content: center;
        font-size: 14px;
    }

    .toolbar-separator {
        margin: 0 2px;
        height: 20px;
    }

    .search-box input {
        width: 120px;
        min-height: 40px;
        font-size: 14px;
    }

    /* 文件列表 - 简化为4列 */
    .file-list-header,
    .file-item {
        grid-template-columns: 32px minmax(100px, 0.7fr) 80px 60px;
        padding: 10px 10px;
        font-size: 13px;
    }

    .col-modified,
    .file-modified {
        display: none;
    }

    .col-actions,
    .file-actions {
        max-width: 60px;
        justify-content: center;
    }

    /* 每个文件行只显示2个操作按钮 */
    .file-actions .action-btn:nth-child(n+3) {
        display: none;
    }

    .file-actions {
        gap: 2px;
    }

    .action-btn {
        padding: 4px;
        min-width: 28px;
        min-height: 28px;
        font-size: 14px;
    }

    /* 移动端更多按钮显示 */
    .mobile-more-btn {
        display: flex !important;
    }

    /* 搜索框 */
    .search-box input {
        width: 110px;
    }

    /* 底部导航栏 */
    .mobile-bottom-nav {
        display: flex;
    }

    /* 模态框 */
    .modal-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    .modal-footer .btn {
        min-height: 44px;
    }

    /* 预览 */
    .preview-content {
        max-height: 55vh;
    }

    .preview-pdf-container {
        height: 55vh;
        min-height: 350px;
    }

    .preview-text {
        font-size: 12px;
        padding: 12px;
    }

    .preview-video {
        max-height: 50vh;
    }

    /* 上传区域 */
    .upload-area {
        padding: 30px 15px;
    }

    .upload-area i {
        font-size: 36px;
    }

    .upload-area h3 {
        font-size: 16px;
    }

    /* 消息提示 */
    .message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        text-align: center;
        font-size: 14px;
    }

    /* 右键菜单高度适配 */
    .context-menu {
        max-height: 50vh;
        overflow-y: auto;
        border-radius: 12px;
    }
}

/* ---- 小手机 (≤480px) ---- */
@media (max-width: 480px) {
    .main-content {
        padding: 8px;
        padding-bottom: calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom, 0));
    }

    .header {
        margin-bottom: 8px;
    }

    .hamburger-btn {
        padding: 6px;
        min-width: 40px;
        min-height: 40px;
    }

    /* 文件列表极简 3 列：复选框 + 名称 + 操作图标 */
    .file-list-header,
    .file-item {
        grid-template-columns: 28px minmax(80px, 1fr) 50px;
        padding: 8px 8px;
        font-size: 12px;
        gap: 4px;
    }

    .col-size,
    .col-modified,
    .col-actions,
    .file-size,
    .file-modified {
        display: none;
    }

    .file-actions {
        max-width: 50px;
    }

    /* 每行只显示下载按钮 */
    .file-actions .action-btn {
        display: none;
    }
    .file-actions .action-btn[data-action="download"] {
        display: flex;
    }

    /* 工具栏进一步精简 */
    .toolbar {
        gap: 4px;
        padding: 6px 0;
        margin-bottom: 8px;
    }

    .toolbar .btn {
        padding: 6px 8px;
        min-width: 36px;
        min-height: 36px;
        font-size: 13px;
    }

    .toolbar-separator {
        display: none;
    }

    .search-box input {
        width: 90px;
        min-height: 36px;
        font-size: 13px;
        padding: 6px 8px 6px 30px;
    }

    .search-box i {
        left: 8px;
        font-size: 13px;
    }

    .sort-buttons {
        gap: 2px;
    }

    .sort-buttons .btn {
        padding: 6px;
        min-width: 34px;
        font-size: 12px;
    }

    .upload-buttons {
        gap: 3px;
    }

    .upload-buttons .btn {
        padding: 6px 10px;
        min-width: 38px;
        min-height: 38px;
    }

    /* 面包屑 */
    .breadcrumb {
        font-size: 12px;
    }

    .breadcrumb a {
        font-size: 12px;
    }

    /* 上传区域 */
    .upload-area {
        padding: 20px 12px;
        border-radius: 6px;
    }

    .upload-area i {
        font-size: 30px;
    }

    .upload-area h3 {
        font-size: 15px;
    }

    .upload-area p {
        font-size: 12px;
    }

    /* 侧边栏宽度 */
    .sidebar {
        width: 260px;
    }

    /* 上下文菜单 */
    .context-menu {
        min-width: 160px;
    }

    .context-menu-item {
        padding: 8px 14px;
        min-height: 42px;
        font-size: 13px;
    }

    /* 确认对话框 */
    .confirm-message {
        font-size: 14px;
    }

    .confirm-icon {
        font-size: 40px;
    }
}

/* ---- 超小屏 (≤360px) ---- */
@media (max-width: 360px) {
    .file-list-header,
    .file-item {
        grid-template-columns: 24px minmax(60px, 1fr) 40px;
        padding: 6px 6px;
        font-size: 11px;
    }

    .toolbar .btn {
        padding: 4px 6px;
        min-width: 32px;
        min-height: 32px;
        font-size: 12px;
    }

    .search-box input {
        width: 75px;
        font-size: 12px;
    }

    .upload-buttons .btn {
        padding: 4px 8px;
        min-width: 34px;
        min-height: 34px;
    }

    .sidebar {
        width: 240px;
    }
}

/* ---- 横屏手机 (高度小) ---- */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
    }

    .file-list-container {
        max-height: calc(100vh - 150px);
    }

    .upload-area {
        padding: 15px;
    }

    .upload-area i {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .upload-area h3 {
        font-size: 14px;
    }

    .upload-area p {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .mobile-bottom-nav {
        height: 48px;
    }

    .bottom-nav-item {
        padding: 4px 12px;
        min-height: 40px;
    }
}

/* ---- 大屏优化 (>1440px) ---- */
@media (min-width: 1440px) {
    .main-content {
        padding: 30px 40px;
    }

    .file-list-header,
    .file-item {
        grid-template-columns: 40px minmax(250px, 1fr) 120px 200px 250px;
    }
}
