/* ============================================
   WEB Cloud - 样式表
   设计语言: 简约大气 (Apple/Google inspired)
   ============================================ */

:root {
    --primary: #4F6EF7;
    --primary-hover: #3D56D4;
    --primary-light: #EBEEFE;
    --primary-soft: #F5F7FF;
    --danger: #EF4444;
    --danger-hover: #DC2626;
    --success: #10B981;
    --warning: #F59E0B;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-hover: #F3F4F6;
    --bg-active: #EBEEFE;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --transition: 0.2s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: var(--primary); }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
input, select { font-family: inherit; font-size: inherit; }
svg { display: block; }

/* ============================================
   登录/注册页面
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo svg {
    margin: 0 auto 16px;
    display: block;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.dialog-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus,
.dialog-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-primary {
    width: 100%;
    height: 42px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 500;
}

.auth-error {
    margin-top: 12px;
    color: var(--danger);
    font-size: 13px;
    min-height: 20px;
}

/* ============================================
   主界面布局
   ============================================ */
.main-page {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition);
}

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

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

.storage-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-bottom: 6px;
    overflow: hidden;
}

.storage-used {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s;
}

.storage-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    transition: margin-left var(--transition);
}

.main-content.expanded {
    margin-left: 0;
}

/* 顶栏 */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.btn-toggle-sidebar {
    padding: 6px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.btn-toggle-sidebar:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* 面包屑 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.breadcrumb-item {
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition);
    white-space: nowrap;
}

.breadcrumb-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.breadcrumb-sep {
    color: var(--text-muted);
    user-select: none;
}

/* 搜索 */
.search-box {
    width: 280px;
    position: relative;
    flex-shrink: 0;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 34px;
    padding: 0 12px 0 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 17px;
    font-size: 13px;
    outline: none;
    transition: all var(--transition);
}

.search-box input:focus {
    background: var(--bg-primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box.hidden {
    display: none;
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.username {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.btn-logout {
    padding: 6px;
    border-radius: var(--radius);
    color: var(--text-muted);
    display: flex;
}

.btn-logout:hover {
    background: var(--bg-hover);
    color: var(--danger);
}

/* ============================================
   视图切换
   ============================================ */
.view-pane {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: calc(100vh - var(--topbar-height));
    width: 100%;
}

.view-pane[style*="display:none"] {
    display: none !important;
}

/* ============================================
   工具栏
   ============================================ */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-tool {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.btn-tool:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-view-toggle {
    padding: 6px 10px;
    border-radius: var(--radius);
    color: var(--text-muted);
    display: flex;
    transition: all var(--transition);
}

.btn-view-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.btn-view-toggle.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* ============================================
   文件区域
   ============================================ */
.file-area {
    padding: 20px;
    min-height: 400px;
    position: relative;
    flex: 1;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-muted);
    transition: all var(--transition);
    cursor: pointer;
}

.drop-zone.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.drop-zone svg {
    margin: 0 auto 12px;
}

.drop-zone p {
    font-size: 14px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0;
    color: var(--text-muted);
}

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

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

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin: 0 auto 16px;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
}

/* 文件网格 */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.file-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.file-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.file-card .file-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.file-card .file-icon.folder { color: var(--warning); }
.file-card .file-icon.image { color: #EC4899; }
.file-card .file-icon.video { color: #8B5CF6; }
.file-card .file-icon.audio { color: #10B981; }
.file-card .file-icon.document { color: var(--primary); }
.file-card .file-icon.code { color: #6B7280; }
.file-card .file-icon.archive { color: #F97316; }
.file-card .file-icon.raw { color: #F59E0B; }

/* 缩略图 */
.file-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    inset: 0;
}

.file-thumb.loaded {
    opacity: 1;
}

.file-thumb-list {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.file-card .file-name {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    max-height: 2.8em;
}

.file-card .file-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.file-card .file-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    transition: all var(--transition);
}

.file-card.show-check .file-check {
    display: flex;
}

.file-card.selected .file-check {
    background: var(--primary);
    border-color: var(--primary);
}

.file-card.selected .file-check::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* 文件列表视图 */
.file-list-view table {
    width: 100%;
    border-collapse: collapse;
}

.file-list-view th {
    text-align: left;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.file-list-view td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    vertical-align: middle;
}

.file-list-view tr {
    cursor: pointer;
    transition: background var(--transition);
}

.file-list-view tr:hover {
    background: var(--bg-hover);
}

.file-list-view tr.selected {
    background: var(--primary-light);
}

.col-name { width: 40%; }
.col-size { width: 12%; white-space: nowrap; }
.col-type { width: 10%; }
.col-date { width: 20%; white-space: nowrap; }
.col-actions { width: 18%; }

.file-list-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-list-name svg {
    flex-shrink: 0;
}

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

.file-actions button {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-muted);
    transition: all var(--transition);
}

.file-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.file-actions .btn-delete:hover {
    color: var(--danger);
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 1000;
    min-width: 180px;
    display: none;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
    text-align: left;
}

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

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

.context-menu-item.danger:hover {
    background: #FEF2F2;
}

.context-menu-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* ============================================
   上传管理页面
   ============================================ */
.upload-page {
    padding: 20px 24px;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.upload-page-header {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.upload-page-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-page-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
}

.upload-folder-selector {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.upload-folder-selector > label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.upload-folder-display {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.upload-folder-display svg {
    color: var(--warning);
    flex-shrink: 0;
}

.upload-dropzone-large {
    background: var(--bg-primary);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 24px;
    text-align: center;
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: pointer;
    margin-bottom: 14px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-dropzone-large:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.upload-dropzone-large.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
}

.upload-dropzone-large svg {
    margin: 0 auto 10px;
    color: var(--text-muted);
    width: 48px;
    height: 48px;
}

.upload-dropzone-large h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-dropzone-large p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 14px;
}

.upload-dropzone-large .btn-primary {
    width: auto;
    padding: 0 28px;
    height: 36px;
}

/* 上传技巧卡片 */
.upload-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.upload-tip {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
}

.upload-tip:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.upload-tip > svg {
    flex-shrink: 0;
}

.upload-tip-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-tip-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upload-tasks {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex: 1;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

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

.upload-tasks-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-count {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
}

/* 任务工具栏 */
.upload-tasks-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    gap: 8px;
    flex-wrap: wrap;
}

.upload-tasks-toolbar-left,
.upload-tasks-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.upload-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.upload-toolbar-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.upload-selected-info {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    margin-left: 4px;
}

.upload-tasks-list {
    max-height: 600px;
    overflow-y: auto;
}

.upload-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

/* 任务项 - 重新设计为水平 4 栏布局 */
.upload-task-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    display: grid;
    grid-template-columns: 24px 36px 1fr auto;
    align-items: center;
    gap: 12px;
    transition: background var(--transition);
    min-height: 76px;
}

.upload-task-item:hover {
    background: var(--bg-secondary);
}

.upload-task-item.selected {
    background: var(--primary-light);
}

.upload-task-item:last-child {
    border-bottom: none;
}

/* 复选框 */
.upload-task-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.upload-task-check input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin: 0;
}

.upload-task-check-box {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: var(--bg-primary);
    transition: all var(--transition);
    position: relative;
}

.upload-task-check:hover .upload-task-check-box {
    border-color: var(--primary);
}

.upload-task-check input:checked + .upload-task-check-box {
    background: var(--primary);
    border-color: var(--primary);
}

.upload-task-check input:checked + .upload-task-check-box::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 图标 */
.upload-task-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
    flex-shrink: 0;
}

.upload-task-icon.success {
    background: #ECFDF5;
    color: var(--success);
}

.upload-task-icon.error {
    background: #FEF2F2;
    color: var(--danger);
}

.upload-task-icon.paused {
    background: #FFFBEB;
    color: var(--warning);
}

.upload-task-icon.cancelled {
    background: var(--bg-hover);
    color: var(--text-muted);
}

/* 任务信息 */
.upload-task-info {
    min-width: 0;
    overflow: hidden;
}

.upload-task-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    line-height: 1.3;
}

.upload-task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.upload-task-size {
    color: var(--text-secondary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.upload-task-pct {
    color: var(--primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
}

.upload-task-speed {
    color: var(--text-secondary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.upload-task-eta {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.upload-task-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
}

.upload-task-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-task-bar-fill.success {
    background: var(--success);
}

.upload-task-bar-fill.error {
    background: var(--danger);
}

.upload-task-bar-fill.paused {
    background: var(--warning);
}

.upload-task-bar-fill.cancelled {
    background: var(--text-muted);
}

/* 任务操作按钮 */
.upload-task-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.upload-task-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.upload-task-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border);
}

.upload-task-btn.pause:hover {
    color: var(--warning);
    background: #FFFBEB;
}

.upload-task-btn.resume:hover {
    color: var(--success);
    background: #ECFDF5;
}

.upload-task-btn.retry:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.upload-task-btn.remove:hover {
    color: var(--danger);
    background: #FEF2F2;
}

/* ============================================
   模态框
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow: auto;
    z-index: 1;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close-modal {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
    transition: all var(--transition);
}

.btn-close-modal:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.preview-modal {
    width: 90vw;
    max-width: 900px;
    max-height: 85vh;
}

.preview-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.preview-content img,
.preview-content video {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius);
}

.preview-content audio {
    width: 100%;
    max-width: 500px;
}

.preview-content iframe {
    width: 100%;
    min-height: 500px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.preview-content .preview-text {
    width: 100%;
    max-height: 60vh;
    overflow: auto;
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    text-align: left;
}

.dialog-modal {
    width: 90%;
    max-width: 440px;
    padding: 24px;
}

.dialog-modal h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.btn-cancel {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.btn-cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    padding: 8px 20px;
    border-radius: var(--radius);
    background: var(--danger);
    color: white;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

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

.dialog-wide {
    max-width: 560px;
}

.move-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    flex-wrap: wrap;
    font-size: 13px;
}

.move-breadcrumb span {
    cursor: pointer;
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
}

.move-breadcrumb span:hover {
    background: var(--primary-light);
}

.move-breadcrumb span.current {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.move-folder-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.move-folder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
    font-size: 13px;
}

.move-folder-item:hover {
    background: var(--bg-hover);
}

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

.move-folder-item:last-child {
    border-bottom: none;
}

.share-link-box {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.share-link-box input {
    flex: 1;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-copy {
    white-space: nowrap;
}

/* ============================================
   Toast 提示
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.toast.error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.toast.info {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.toast.fadeout {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* ============================================
   响应式布局
   ============================================ */
@media (max-width: 1024px) {
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0 !important;
    }

    .topbar {
        padding: 0 12px;
    }

    .toolbar {
        padding: 10px 12px;
    }

    .file-area {
        padding: 12px;
    }

    .upload-page {
        padding: 20px;
    }

    .search-box {
        width: 200px;
    }
}

@media (max-width: 640px) {
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .file-card {
        padding: 12px 8px;
    }

    .file-card .file-icon {
        width: 40px;
        height: 40px;
    }

    .search-box {
        width: 140px;
    }

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

    .btn-tool {
        padding: 7px 10px;
    }

    .auth-container {
        padding: 32px 24px;
    }

    .upload-page {
        padding: 16px;
    }

    .upload-dropzone-large {
        padding: 40px 16px;
    }

    .upload-task-bar {
        max-width: 80px;
    }
}
