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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ==========================
   Auth pages (Login/Register)
   统一配色、字体与交互反馈
   ========================== */
:root {
    --brand-gradient-start: #667eea;
    --brand-gradient-end: #764ba2;
    --primary-600: #4a90e2;
    --primary-500: #6A82FB;
    --primary-focus: rgba(102, 126, 234, 0.20);
    --border-color: #ddd;
    --text-color: #333;
    --muted-text: #555;
    --danger-600: #e74c3c;
    --danger-bg: #fdecea;
    --card-bg: #fff;
}
/* 扩展设计令牌 */
:root {
    --primary-700: #4f46e5;
    --primary-400: #818cf8;
    --success-600: #22c55e;
    --warning-600: #f59e0b;
    --text-muted: #666;
    --divider-color: #eee;
    --bg-default: #f5f5f5;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 10px rgba(0,0,0,0.10);
    --shadow-lg: 0 10px 32px rgba(0,0,0,0.18);
    --bp-sm: 576px;
    --bp-md: 768px;
    --bp-lg: 992px;
    --bp-xl: 1200px;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--brand-gradient-start) 0%, var(--brand-gradient-end) 100%);
}

.auth-card {
    width: 100%;
    max-width: 520px;
    margin: 6vh auto;
    padding: 28px 24px;
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: 0 10px 32px rgba(0,0,0,0.18);
    border: 1px solid rgba(0,0,0,0.06);
    position: relative;
}

.auth-title {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    color: var(--text-color);
}

.auth-helper {
    font-size: 13px;
    color: var(--muted-text);
    text-align: center;
    margin-top: 12px;
}

/* 表单统一样式（不影响其它页面已有的 .form-input/.form-group 用法） */
.auth-card .form-group { margin-bottom: 16px; }
.auth-card .form-label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-color); }
.auth-card .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
    background: #fff;
}
.auth-card .form-input:focus { border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-focus); }
.auth-card .form-input.valid { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.auth-card .form-input.invalid { border-color: var(--danger-600); box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15); }

/* 注册页：验证码行布局 */
.auth-card .code-row { display: flex; align-items: center; gap: 8px; }
.auth-card .code-row .form-input { flex: 1; }
.auth-card .code-row .btn { width: auto; padding: 10px 16px; white-space: nowrap; }
@media (max-width: 480px) {
  .auth-card .code-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .auth-card .code-row .btn { width: 100%; }
}

.auth-card .btn {
    display: inline-block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: filter .2s ease, transform .05s ease, opacity .2s ease;
}
.auth-card .btn:hover { filter: brightness(1.05); }
.auth-card .btn:active { transform: translateY(1px); }
.auth-card .btn:disabled { opacity: .6; cursor: not-allowed; }

.auth-card .btn .spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.6);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: text-bottom;
    margin-right: 8px;
}

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

.auth-card .alert { display:none; margin-top: 10px; text-align: center; padding: 8px 10px; border-radius: 6px; }
.auth-card .alert.error { color: var(--danger-600); background: var(--danger-bg); border-left: 4px solid var(--danger-600); }


/* 响应式适配 */
@media (max-width: 480px) {
    .auth-card { padding: 22px 18px; border-radius: 12px; }
    .auth-title { font-size: 20px; }
}

/* 登录页面扩展样式（统一到全局样式） */
.auth-card::before { position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: linear-gradient(90deg, var(--brand-gradient-start), var(--brand-gradient-end)); }
.auth-subtitle { margin-top: -4px; font-size: 14px; text-align: center; color: var(--text-muted); }
.input-icon-wrapper { position: relative; }
.input-icon-wrapper input { padding-right: 40px; }
.input-icon-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; background: transparent; color: #6b7280; cursor: pointer; border-radius: var(--radius-md); transition: color .2s ease, background .2s ease; }
.input-icon-btn:hover { color: #1f6feb; background: rgba(31,111,235,0.06); }
.input-icon-btn:focus { outline: none; box-shadow: 0 0 0 3px var(--primary-focus); }
.input-icon-btn svg { width: 20px; height: 20px; }
.input-left-icon-wrap { position: relative; }
.input-left-icon-wrap input { padding-left: 56px; }
.input-left-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: #9ca3af; pointer-events: none; }
.social-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 9px 12px; border-radius: var(--radius-lg); border: 1px solid #e5e7eb; background: #fff; color: #374151; transition: background .15s ease, box-shadow .15s ease; }
.social-btn:hover { background: #f9fafb; box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.social-btn:active { transform: translateY(0.5px); }
.social-icon { width: 20px; height: 20px; }
.fade-enter { opacity: 0; transform: translateY(6px); }
.fade-enter-active { opacity: 1; transform: translateY(0); transition: opacity .25s ease, transform .25s ease; }
.helper { font-size: 13px; color: var(--muted-text); text-align: center; margin-top: 10px; }
.error { display:none; margin-top: 10px; color: var(--danger-600); text-align: center; background: var(--danger-bg); border-left: 4px solid var(--danger-600); padding: 8px 10px; border-radius: var(--radius-md); }
.lock { display:none; margin-top: 10px; color: #a56600; text-align: center; background: #fff5e6; border-left: 4px solid #f39c12; padding: 8px 10px; border-radius: var(--radius-md); }

@media (min-width: 768px) {
    .auth-card { max-width: 560px; }
}


.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    height: 60px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.8rem;
}


.search-container {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.2);
    border-radius: 25px;
    padding: 5px;
    min-width: 300px;
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 15px;
    flex: 1;
    outline: none;
    font-size: 14px;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: rgba(255,255,255,0.3);
}


.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.dropdown {
    position: relative;
}

.dropdown-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.dropdown-btn:hover {
    background: rgba(255,255,255,0.3);
}

.dropdown-content {
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1001;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.dropdown-content a:hover {
    background: #f8f9fa;
}

.dropdown-content a:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-content a:last-child {
    border-radius: 0 0 8px 8px;
}


.main-content {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px;
    min-height: calc(100vh - 100px);
}


.sidebar {
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}


.folder-tree {
    max-height: 500px;
    overflow-y: auto;
}

.folder-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 2px;
}

.folder-item:hover {
    background: #f8f9fa;
}

.folder-item.active {
    background: #e3f2fd;
    color: #1976d2;
}

.folder-item i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.folder-item .folder-name {
    flex: 1;
    font-size: 14px;
}


.file-area {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}


.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.toolbar-left {
    flex: 1;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}


.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.3s;
}

.breadcrumb-item:hover {
    background: #e3f2fd;
    color: #1976d2;
}

.breadcrumb-item.active {
    color: #333;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #ccc;
}


.view-controls {
    display: flex;
    background: #f0f0f0;
    border-radius: 6px;
    padding: 2px;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.view-btn.active {
    background: white;
    color: #1976d2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}


.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    outline: none;
}

.sort-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
}

.sort-btn:hover {
    background: #e9ecef;
}


.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

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


.batch-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff3cd;
    border-bottom: 1px solid #ffeaa7;
}

.batch-info {
    font-size: 14px;
    color: #856404;
    font-weight: 500;
}

.batch-actions {
    display: flex;
    gap: 10px;
}


.file-list-container {
    min-height: 400px;
    position: relative;
}

.file-list {
    padding: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
    margin-bottom: 4px;
}

.file-item:hover {
    background: #f8f9fa;
}

.file-item.selected {
    background: #e3f2fd;
    border-color: #2196f3;
}

.file-checkbox {
    margin-right: 15px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.file-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #f0f0f0;
}


.file-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.file-icon.folder {
    background: #fff3e0;
    color: #ff9800;
}

.file-icon.image {
    background: #e8f5e8;
    color: #4caf50;
}

.file-icon.document {
    background: #e3f2fd;
    color: #2196f3;
}

.file-icon.video {
    background: #fce4ec;
    color: #e91e63;
}

.file-icon.audio {
    background: #f3e5f5;
    color: #9c27b0;
}

.file-icon.archive {
    background: #fff8e1;
    color: #ffc107;
}

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

.file-name {
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 15px;
}

.file-actions {
    display: flex;
    gap: 8px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.file-item:hover .file-actions {
    opacity: 1;
}


@media (hover: none) and (pointer: coarse) {
    .file-actions {
        opacity: 1;
    }
}

.action-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #e0e0e0;
    color: #333;
}


.file-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.file-list.grid-view .file-item {
    flex-direction: column;
    text-align: center;
    padding: 20px;
    border: 1px solid #eee;
}

.file-list.grid-view .file-icon {
    width: 60px;
    height: 60px;
    margin: 0 0 15px 0;
    font-size: 30px;
}

.file-list.grid-view .file-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    margin: 0;
}


.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.loading-indicator i {
    margin-right: 10px;
    font-size: 20px;
}


.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}


.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.pagination {
    display: flex;
    gap: 5px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 14px;
}

.page-btn:hover {
    background: #f8f9fa;
}

.page-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


.upload-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.upload-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.upload-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #f0f0f0;
}

/* 模态与上传面板统一样式层级 */
.modal-content, .upload-content { box-shadow: var(--shadow-lg); }
.modal-header, .upload-header { border-bottom: 1px solid var(--divider-color); }
.modal-footer { border-top: 1px solid var(--divider-color); }

.upload-zone {
    padding: 40px;
    text-align: center;
    border: 2px dashed #ddd;
    margin: 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.upload-zone.dragover {
    border-color: #007bff;
    background: #f8f9ff;
}

.upload-zone i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

.upload-zone p {
    margin-bottom: 20px;
    color: #666;
}


.upload-progress {
    padding: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
    width: 0%;
}

.upload-files {
    max-height: 200px;
    overflow-y: auto;
}

.upload-file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
}

.upload-file-item .file-name {
    flex: 1;
    margin-right: 10px;
    font-size: 14px;
}

.upload-file-item .file-progress {
    flex: 0 0 180px;
    height: 6px;
    background: #eee;
    border-radius: 6px;
    margin-right: 10px;
    overflow: hidden;
}

.upload-file-item .file-progress .file-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #36d1dc, #5b86e5);
    transition: width 0.1s linear;
}

.upload-file-item .file-progress-text {
    min-width: 150px;
    font-size: 12px;
    color: #666;
    margin-right: 10px;
    text-align: right;
}

.upload-file-item .file-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}

.file-status.success {
    background: #d4edda;
    color: #155724;
}

.file-status.error {
    background: #f8d7da;
    color: #721c24;
}

.file-status.uploading {
    background: #d1ecf1;
    color: #0c5460;
}


.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}


.image-preview-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
}


.search-modal .modal-content {
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
}

.search-modal .modal-body {
    padding: 0;
}

.search-toolbar {
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid #eee;
    padding: 12px 20px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-summary {
    color: #555;
    font-size: 13px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
}

.filter-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-label {
    color: #888;
    font-size: 12px;
}

.checkbox-pill {
    display: inline-flex;
    align-items: center;
}

.checkbox-pill input {
    display: none;
}

.checkbox-pill span {
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #555;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: all 0.2s ease;
}

.checkbox-pill:hover span {
    background: #eef2f7;
}

.checkbox-pill input:checked + span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
}

.search-results-list {
    padding: 16px 16px 20px 16px;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
}

.search-result-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover {
    border-color: #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.search-result-item .sr-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
}

.search-result-item .sr-main {
    min-width: 0;
}

.search-result-item .sr-name {
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-item .type-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    color: #6c757d;
    background: #f1f3f5;
    border: 1px solid #e9ecef;
    border-radius: 999px;
    padding: 2px 8px;
}

.search-result-item .sr-meta {
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-result-item .sr-meta i {
    color: #adb5bd;
}

.search-result-item .sr-actions {
    display: flex;
    align-items: center;
}

.image-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}


.image-fallback {
    width: 100%;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #888;
    border-radius: 8px;
    background: #f7f7f7;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.image-fallback i {
    font-size: 64px;
    color: #b0b0b0;
    margin-bottom: 12px;
}
.image-fallback p {
    margin: 0;
    font-size: 14px;
}

.image-info {
    text-align: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    width: 100%;
}

.image-info h5 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: #333;
    word-break: break-all;
}

.image-info p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}


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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: #007bff;
}

.form-help {
    margin-top: 8px;
    color: #666;
    font-size: 12px;
}


.context-menu {
    position: fixed;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 4000;
    min-width: 150px;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.context-menu li {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: background 0.3s;
}

.context-menu li:hover {
    background: #f8f9fa;
}

.context-menu li.separator {
    height: 1px;
    background: #eee;
    margin: 5px 0;
    padding: 0;
}

.context-menu li.danger {
    color: #dc3545;
}

.context-menu li.danger:hover {
    background: #f8d7da;
}


.notifications {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 5000;
    max-width: 400px;
}

.notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    padding: 15px;
    border-left: 4px solid #007bff;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    border-left-color: #28a745;
}

.notification.error {
    border-left-color: #dc3545;
}

.notification.warning {
    border-left-color: #ffc107;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
}

.notification-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 16px;
}

.notification-message {
    font-size: 13px;
    color: #666;
}

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


.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-input {
    padding: 12px 15px;
    font-size: 16px;
}

.login-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 10px;
}

.login-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}


@media (max-width: 768px) {
    .header-content {
        padding: 0 15px;
        height: 50px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .search-container {
        min-width: 200px;
    }
    
    .main-content {
        flex-direction: column;
        margin: 10px auto;
        padding: 0 15px;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .toolbar-right {
        justify-content: space-between;
    }
    
    .batch-toolbar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .file-list.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .upload-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .notifications {
        right: 15px;
        left: 15px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 10px 15px;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    
    .search-container {
        min-width: 100%;
    }
    
    .file-list.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .file-item {
        padding: 8px;
    }
    
    .file-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        margin-right: 10px;
    }
    
    .file-name {
        font-size: 14px;
    }
    
    .file-meta {
        font-size: 11px;
    }
    
    
    .file-actions {
        opacity: 1 !important;
    }
    
    .action-btn {
        padding: 8px;
        min-width: 32px;
        min-height: 32px;
    }
}


@media print {
    .header,
    .sidebar,
    .toolbar,
    .batch-toolbar,
    .pagination-container,
    .file-actions,
    .upload-area,
    .modal,
    .context-menu,
    .notifications {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .file-area {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}


@media (prefers-contrast: high) {
    .file-item:hover {
        background: #000;
        color: #fff;
    }
    
    .btn-primary {
        background: #000;
        border: 2px solid #fff;
    }
    
    .search-container {
        border: 2px solid #fff;
    }
}


@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 全局可访问性与工具类 */
:focus-visible {
    outline: 3px solid var(--primary-focus);
    outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.u-flex { display: flex; }
.u-grid { display: grid; }
.u-gap-2 { gap: var(--space-2); }
.u-gap-3 { gap: var(--space-3); }
.u-gap-4 { gap: var(--space-4); }
.u-mt-2 { margin-top: var(--space-2); }
.u-mt-3 { margin-top: var(--space-3); }
.u-mt-4 { margin-top: var(--space-4); }
.u-p-2 { padding: var(--space-2); }
.u-p-3 { padding: var(--space-3); }
.u-p-4 { padding: var(--space-4); }
.u-rounded { border-radius: var(--radius-md); }
.u-shadow { box-shadow: var(--shadow-md); }

/* 暗色模式（跟随系统偏好） */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-default: #0f1115;
        --card-bg: #171923;
        --text-color: #e5e7eb;
        --text-muted: #9ca3af;
        --border-color: #2a2f3a;
        --divider-color: #2a2f3a;
    }
    body { background-color: var(--bg-default); color: var(--text-color); }
    .header { color: #fff; }
    .sidebar, .file-area, .modal-content, .upload-content { background: var(--card-bg); }
    .toolbar, .pagination-container { background: #111827; border-color: var(--divider-color); }
    .file-item:hover { background: #1f2937; }
    .dropdown-content { background: var(--card-bg); }
    .page-btn { background: var(--card-bg); color: var(--text-color); border-color: var(--divider-color); }
}

/* 布局细节优化与变量化 */
.main-content { gap: var(--space-4); padding: 0 var(--space-4); }
.toolbar { gap: var(--space-3); }
.sidebar { padding: var(--space-4); }
.file-list { padding: var(--space-4); }
.pagination-container { padding: var(--space-4); }

@media (max-width: 992px) { /* lg 以下 */
    .main-content { gap: var(--space-3); }
    .toolbar { gap: var(--space-2); }
}

/* 链接的可见焦点增强 */
a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-focus); border-radius: var(--radius-sm); }

/* 文件列表与网格视图视觉统一（覆盖规则） */
.file-item.selected { border-color: var(--primary-600); }
.file-list.grid-view .file-item { border: 1px solid var(--divider-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }