/* 基础变量 */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --overlay-color: rgba(0, 0, 0, 0.5);
    --pdf-bg: #fee2e2;
    --pdf-fg: #dc2626;
    --html-bg: #dbeafe;
    --html-fg: #2563eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --sidebar-width: 260px;
    --navbar-height: 64px;
    --transition: all 0.3s ease;
}

/* 暗色模式 */
html[data-theme="dark"] {
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --primary-light: rgba(99, 102, 241, 0.18);
    --secondary-color: #94a3b8;
    --bg-primary: #0f172a;
    --bg-secondary: #0b1120;
    --bg-tertiary: #1e293b;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border-color: #26334d;
    --border-light: #1e293b;
    --overlay-color: rgba(0, 0, 0, 0.65);
    --pdf-bg: rgba(239, 68, 68, 0.15);
    --pdf-fg: #f87171;
    --html-bg: rgba(59, 130, 246, 0.15);
    --html-fg: #60a5fa;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 键盘可达性 */
.btn:focus-visible,
.nav-item:focus-visible,
input:focus-visible,
.sort-option:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 应用容器 */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏 */
.navbar {
    height: var(--navbar-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-toggle {
    display: none;
    font-size: 1.1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.navbar-search {
    flex: 1;
    max-width: 480px;
    margin: 0 40px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    height: 40px;
    padding: 0 40px 0 44px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    font-size: 0.75rem;
    display: none;
}

.search-clear.show {
    display: block;
}

.search-clear:hover {
    color: var(--text-primary);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border-radius: 24px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* 主内容区 */
.main-content {
    display: flex;
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    bottom: 0;
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
}

.sidebar-section {
    margin-bottom: 24px;
}

.upload-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    font-family: inherit;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.upload-btn i {
    font-size: 1.125rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    padding: 0 12px;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

.nav-item.active .nav-badge {
    background: var(--primary-color);
    color: white;
}

/* 统计信息 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 12px;
}

.stat-item {
    background: var(--bg-secondary);
    padding: 16px 12px;
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* 内容区域 */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    max-width: calc(100% - var(--sidebar-width));
}

/* 页面标题 */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.page-actions {
    display: flex;
    gap: 8px;
    position: relative;
}

/* 排序菜单 */
.sort-menu-wrap {
    position: relative;
}

.sort-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 1100;
    min-width: 148px;
}

.sort-menu.show {
    display: block;
    animation: sortMenuIn 0.15s ease;
}

@keyframes sortMenuIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.sort-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sort-option.active {
    color: var(--primary-color);
    font-weight: 600;
}

.sort-option i {
    width: 16px;
    text-align: center;
    font-size: 0.8125rem;
}

/* 文件容器 */
.file-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    min-height: 400px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 加载状态 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 24px;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.loading-state .loading {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-icon i {
    font-size: 32px;
    color: var(--text-tertiary);
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 文件列表 - 列表视图 */
.file-list {
    padding: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.file-item:hover {
    background: var(--bg-secondary);
}

.file-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.file-icon i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.file-icon.pdf {
    background: var(--pdf-bg);
}

.file-icon.pdf i {
    color: var(--pdf-fg);
}

.file-icon.html {
    background: var(--html-bg);
}

.file-icon.html i {
    color: var(--html-fg);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 16px;
    justify-content: flex-end;
}

.tag {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.tag.primary {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* 标签芯片：可点击筛选 */
.tag-filterable {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.tag-filterable:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.tag-filterable.active {
    background: var(--primary-color);
    color: white;
}

.tag-del {
    border: none;
    background: none;
    padding: 0;
    color: inherit;
    opacity: 0;
    cursor: pointer;
    font-size: 0.625rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tag-filterable:hover .tag-del {
    opacity: 0.8;
}

.tag-del:hover {
    opacity: 1 !important;
}

/* 存储用量统计：独占一行 */
.stat-item.stat-storage {
    grid-column: 1 / -1;
}

.stat-item.stat-storage .stat-value {
    font-size: 1.125rem;
}

/* 全页拖拽上传遮罩 */
.drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: var(--overlay-color);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drop-overlay.show {
    display: flex;
    animation: modalSlideIn 0.15s ease;
}

.drop-overlay-content {
    text-align: center;
    color: white;
    border: 3px dashed rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    padding: 60px 80px;
}

.drop-overlay-content i {
    font-size: 4rem;
    margin-bottom: 16px;
}

.drop-overlay-content p {
    font-size: 1.25rem;
    font-weight: 600;
}

.file-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
    margin-left: 8px;
}

.file-item:hover .file-actions {
    opacity: 1;
}

/* 文件列表 - 网格视图 */
.file-list.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    padding: 16px;
}

.file-list.grid .file-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    border: 1px solid var(--border-light);
    position: relative;
}

.file-list.grid .file-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.file-list.grid .file-icon {
    margin-right: 0;
    margin-bottom: 14px;
    width: 56px;
    height: 56px;
}

.file-list.grid .file-icon i {
    font-size: 1.5rem;
}

.file-list.grid .file-info {
    width: 100%;
}

.file-list.grid .file-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-list.grid .file-meta {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.file-list.grid .file-tags {
    margin: 12px 0 0;
    justify-content: center;
}

.file-list.grid .file-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    margin-left: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 2px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-color);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-large {
    max-width: 560px;
}

.modal-small {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 24px 0;
    position: relative;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding-right: 40px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.text-center {
    text-align: center;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input[type="text"] {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
    font-family: inherit;
}

.form-group input[type="text"]::placeholder {
    color: var(--text-tertiary);
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    height: 44px;
    padding: 0 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
    font-family: inherit;
}

.input-group input::placeholder {
    color: var(--text-tertiary);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* 上传区域 */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.upload-zone-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.upload-zone-content p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.file-preview {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 20px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-preview-item i {
    color: var(--primary-color);
}

.file-preview-item .file-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 上传进度条 */
.upload-progress {
    position: relative;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #7c3aed);
    border-radius: 12px;
    transition: width 0.2s ease;
}

.upload-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    mix-blend-mode: difference;
    color: white;
}

/* 标签输入 */
.tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 44px;
    background: var(--bg-primary);
}

.tags-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-item button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 0.625rem;
    opacity: 0.8;
}

.tag-item button:hover {
    opacity: 1;
}

.tags-input input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 120px;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: transparent;
    font-family: inherit;
}

.tags-input input::placeholder {
    color: var(--text-tertiary);
}

.tags-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* 确认弹窗 */
.confirm-icon {
    width: 64px;
    height: 64px;
    background: var(--pdf-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirm-icon i {
    font-size: 28px;
    color: var(--danger-color);
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

#confirmModal h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
}

#confirmModal p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
    word-break: break-all;
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 84px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s ease;
    max-width: 400px;
    cursor: pointer;
    color: var(--text-primary);
}

.toast i {
    flex-shrink: 0;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.success i {
    color: var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.error i {
    color: var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.warning i {
    color: var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

.toast.info i {
    color: var(--primary-color);
}

.toast span {
    font-size: 0.875rem;
    word-break: break-all;
}

.toast.toast-out {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* 侧边栏遮罩（移动端） */
.sidebar-overlay {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--navbar-height);
    bottom: 0;
    background: var(--overlay-color);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* 响应式 */
@media (max-width: 1024px) {
    .nav-toggle {
        display: inline-flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .content-area {
        margin-left: 0;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 12px;
    }

    .brand-text {
        display: none;
    }

    .navbar-search {
        margin: 0 8px;
    }

    .navbar-actions .user-name {
        display: none;
    }

    .navbar-actions .btn span {
        display: none;
    }

    .content-area {
        padding: 20px 16px;
    }

    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .page-actions {
        justify-content: flex-start;
    }

    .file-item {
        flex-wrap: wrap;
    }

    .file-tags {
        width: 100%;
        margin: 12px 0 0 64px;
        justify-content: flex-start;
    }

    .file-actions {
        opacity: 1;
        width: 100%;
        justify-content: flex-end;
        margin-top: 12px;
        padding-left: 64px;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 24px;
    }

    .toast {
        max-width: 100%;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px 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);
    }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
