/* 部门管理系统 - 主样式 */

/* ==================== 重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: #333; background: #f0f2f5; line-height: 1.5; }
a { color: #1890ff; text-decoration: none; }
a:hover { color: #40a9ff; }

/* ==================== 登录框?==================== */
.login-page { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); overflow: hidden; }
#particleCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.login-card { position: relative; z-index: 1; background: #fff; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); padding: 40px; width: 380px; max-width: 90vw; }
.login-card h2 { text-align: center; margin-bottom: 8px; font-size: 22px; color: #1890ff; }
.login-card .subtitle { text-align: center; color: #999; font-size: 13px; margin-bottom: 28px; }
.login-card .form-group { margin-bottom: 18px; }
.login-card label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; color: #555; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.login-card input:focus { border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.1); }
.login-card .btn-login { width: 100%; padding: 10px; background: #1890ff; color: #fff; border: none; border-radius: 4px; font-size: 15px; cursor: pointer; transition: background 0.2s; }
.login-card .btn-login:hover { background: #40a9ff; }
.login-card .error-msg { color: #ff4d4f; text-align: center; font-size: 13px; margin-top: 10px; min-height: 20px; }

/* ==================== 主布局 ==================== */
.app-layout { display: flex; min-height: 100vh; }

/* 侧边栏?*/
.sidebar { width: 220px; background: #001529; color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; overflow-y: auto; }
.sidebar-logo { padding: 16px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 10px; }
.sidebar-logo .logo-icon { width: 32px; height: 32px; background: #1890ff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.sidebar-menu { padding: 8px 0; flex: 1; }
.menu-group-label { padding: 16px 20px 6px; font-size: 11px; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.5px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; cursor: pointer; transition: all 0.2s; color: rgba(255,255,255,0.65); font-size: 14px; }
.menu-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.menu-item.active { color: #fff; background: #1890ff; }
.menu-item .menu-icon { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.menu-item .menu-text { white-space: nowrap; }
.menu-item.hidden { display: none; }

/* 主内容区 */
.main-area { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-height: 100vh; }

/* 顶栏 */
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.topbar-search { position: relative; margin-right: auto; }
.topbar-search input { width: 260px; padding: 7px 12px 7px 34px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; outline: none; }
.topbar-search input:focus { border-color: #1890ff; }
.topbar-search .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #bbb; font-size: 14px; }
.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.topbar-icon { font-size: 18px; cursor: pointer; color: #666; position: relative; }
.topbar-icon:hover { color: #1890ff; }
.topbar-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.topbar-user:hover { background: #f5f5f5; }
.topbar-avatar { width: 30px; height: 30px; background: #1890ff; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; }
.topbar-username { font-size: 13px; color: #333; }
.topbar-dropdown { position: absolute; top: 100%; right: 0; background: #fff; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 120px; display: none; z-index: 200; }
.topbar-dropdown.show { display: block; }
.topbar-dropdown a { display: block; padding: 8px 16px; font-size: 13px; color: #333; }
.topbar-dropdown a:hover { background: #f5f5f5; }
.role-badge { background: #e6f7ff; color: #1890ff; font-size: 11px; padding: 1px 8px; border-radius: 10px; margin-left: 6px; }

/* 内容区?*/
.content { padding: 24px; flex: 1; }

/* ==================== 仪表盘?==================== */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.dashboard-header h2 { font-size: 20px; font-weight: 600; }
.dashboard-header .subtitle { color: #999; font-size: 13px; margin-top: 2px; }
.dashboard-header .header-actions { display: flex; gap: 8px; }
.stats-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stat-card .stat-left { display: flex; flex-direction: column; }
.stat-card .stat-label { font-size: 13px; color: #999; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 600; color: #333; }
.stat-card .stat-change { font-size: 12px; margin-top: 4px; }
.stat-card .stat-change.up { color: #52c41a; }
.stat-card .stat-change.down { color: #ff4d4f; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-card .stat-icon.red { background: #fff2f0; color: #ff4d4f; }
.stat-card .stat-icon.blue { background: #e6f7ff; color: #1890ff; }
.stat-card .stat-icon.green { background: #f6ffed; color: #52c41a; }
.stat-card .stat-icon.orange { background: #fff7e6; color: #fa8c16; }

.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.chart-card .card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-card .card-title { font-size: 15px; font-weight: 600; }
.chart-tabs { display: flex; gap: 0; }
.chart-tab { padding: 4px 12px; border: 1px solid #d9d9d9; font-size: 12px; cursor: pointer; background: #fff; color: #333; }
.chart-tab:first-child { border-radius: 4px 0 0 4px; }
.chart-tab:last-child { border-radius: 0 4px 4px 0; }
.chart-tab.active { background: #1890ff; color: #fff; border-color: #1890ff; }
.chart-canvas { width: 100%; max-height: 240px; }

.bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.list-card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.list-card .card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.list-card .card-title { font-size: 15px; font-weight: 600; }
.list-card .view-all { font-size: 13px; color: #1890ff; cursor: pointer; }
.list-item { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.list-item:last-child { border-bottom: none; }
.list-item .item-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; margin-right: 12px; flex-shrink: 0; }
.list-item .item-icon.issue { background: #fff2f0; }
.list-item .item-icon.meeting { background: #e6f7ff; }
.list-item .item-info { flex: 1; min-width: 0; }
.list-item .item-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .item-meta { font-size: 12px; color: #999; margin-top: 2px; }
.list-item .item-status { padding: 2px 8px; border-radius: 4px; font-size: 11px; flex-shrink: 0; margin-left: 8px; }
.list-item .item-status.unresolved { background: #fff2f0; color: #ff4d4f; }
.list-item .item-status.processing { background: #fff7e6; color: #fa8c16; }
.list-item .item-status.resolved { background: #f6ffed; color: #52c41a; }
.list-item .item-status.upcoming { background: #e6f7ff; color: #1890ff; }
.list-item .item-status.ended { background: #f5f5f5; color: #999; }

/* ==================== 按钮 ==================== */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; cursor: pointer; background: #fff; color: #333; transition: all 0.2s; white-space: nowrap; }
.btn:hover { border-color: #1890ff; color: #1890ff; }
.btn-primary { background: #1890ff; color: #fff; border-color: #1890ff; }
.btn-primary:hover { background: #40a9ff; border-color: #40a9ff; color: #fff; }
.btn-success { background: #52c41a; color: #fff; border-color: #52c41a; }
.btn-success:hover { background: #73d13d; border-color: #73d13d; color: #fff; }
.btn-danger { background: #ff4d4f; color: #fff; border-color: #ff4d4f; }
.btn-danger:hover { background: #ff7875; border-color: #ff7875; color: #fff; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-text { border: none; background: none; padding: 4px 8px; color: #1890ff; }
.btn-text:hover { color: #40a9ff; background: #e6f7ff; }
.btn-text.danger { color: #ff4d4f; }
.btn-text.danger:hover { background: #fff2f0; }

/* ==================== 工具类?==================== */
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }
.filter-select { padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; outline: none; background: #fff; }
.filter-select:focus { border-color: #1890ff; }

/* ==================== 表格 ==================== */
.table-wrapper { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
table { width: 100%; border-collapse: collapse; }
thead th { background: #fafafa; padding: 12px 14px; text-align: left; font-weight: 600; font-size: 13px; color: #666; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
tbody td { padding: 10px 14px; border-bottom: 1px solid #f5f5f5; font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #e6f7ff; }
tbody tr:last-child td { border-bottom: none; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: #1890ff; }
.sort-icon { font-size: 11px; color: #bbb; }
.status-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.status-tag:hover { transform: scale(1.05); }
.status-tag.green { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.status-tag.blue { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.status-tag.orange { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.status-tag.red { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffa39e; }
.status-tag.gray { background: #f5f5f5; color: #999; border: 1px solid #d9d9d9; }
.priority-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.priority-tag.high { background: #fff2f0; color: #ff4d4f; }
.priority-tag.medium { background: #fff7e6; color: #fa8c16; }
.priority-tag.low { background: #e6f7ff; color: #1890ff; }
.editable-cell { cursor: pointer; padding: 2px 4px; border-radius: 2px; min-width: 60px; }
.editable-cell:hover { border-color: #1890ff; background: #f0f5ff; }
.inline-input { width: 100%; padding: 4px 8px; border: 1px solid #1890ff; border-radius: 4px; font-size: 13px; outline: none; }
.inline-textarea { width: 100%; padding: 4px 8px; border: 1px solid #1890ff; border-radius: 4px; font-size: 13px; outline: none; resize: vertical; min-height: 60px; }

/* ==================== 弹窗 ==================== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 560px; max-width: 92vw; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.modal-lg { width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #999; padding: 4px 8px; border-radius: 4px; }
.modal-close:hover { background: #f5f5f5; color: #333; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 24px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; color: #333; }
.form-group label .required { color: #ff4d4f; }
.form-input { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.1); }
textarea.form-input { min-height: 80px; resize: vertical; }
select.form-input { appearance: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 确认弹窗 */
.confirm-body { text-align: center; padding: 24px; }
.confirm-icon { font-size: 36px; margin-bottom: 12px; }
.confirm-body p { font-size: 14px; color: #333; }

/* ==================== 文件管理 ==================== */
.file-manager { display: flex; gap: 16px; min-height: 500px; }
.folder-panel { width: 220px; background: #fff; border-radius: 8px; padding: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); flex-shrink: 0; }
.folder-panel .panel-title { font-size: 13px; font-weight: 600; padding: 6px 8px; margin-bottom: 8px; color: #666; }
.folder-tree { list-style: none; }
.folder-tree li { padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 6px; color: #333; }
.folder-tree li:hover { background: #f0f5ff; }
.folder-tree li.active { background: #e6f7ff; color: #1890ff; font-weight: 500; }
.folder-tree .folder-icon { font-size: 14px; }
.folder-actions { margin-left: auto; display: none; gap: 2px; }
.folder-tree li:hover .folder-actions { display: flex; }
.folder-action-btn { background: none; border: none; font-size: 12px; cursor: pointer; padding: 2px 4px; border-radius: 2px; color: #999; }
.folder-action-btn:hover { color: #1890ff; background: #e6f7ff; }
.folder-action-btn.danger:hover { color: #ff4d4f; background: #fff2f0; }
.file-panel { flex: 1; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); display: flex; flex-direction: column; }
.file-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #f0f0f5; }
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 13px; margin-right: auto; }
.breadcrumb span { cursor: pointer; color: #1890ff; }
.breadcrumb span:last-child { color: #333; cursor: default; }
.upload-zone { border: 2px dashed #d9d9d9; border-radius: 8px; padding: 32px; text-align: center; cursor: pointer; transition: border-color 0.2s; margin: 16px; }
.upload-zone:hover, .upload-zone.dragover { border-color: #1890ff; background: #f0f5ff; }
.upload-zone .upload-icon { font-size: 32px; color: #bbb; margin-bottom: 8px; }
.upload-zone p { color: #999; font-size: 13px; }
.file-list { padding: 0 16px 16px; }
.file-item { display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid #f5f5f5; gap: 12px; }
.file-item:hover { background: #fafafa; border-radius: 4px; }
.file-icon { width: 36px; height: 36px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.file-icon.doc { background: #e6f7ff; color: #1890ff; }
.file-icon.img { background: #f6ffed; color: #52c41a; }
.file-icon.pdf { background: #fff2f0; color: #ff4d4f; }
.file-icon.excel { background: #f6ffed; color: #52c41a; }
.file-icon.other { background: #f5f5f5; color: #999; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 12px; color: #999; margin-top: 2px; }
.file-actions { display: flex; gap: 4px; flex-shrink: 0; }
.empty-state { text-align: center; padding: 60px 20px; color: #ccc; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ==================== 权限设置 ==================== */
.permission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.permission-item { padding: 12px; border: 1px solid #f0f0f0; border-radius: 6px; }
.permission-item h4 { font-size: 14px; margin-bottom: 8px; }
.permission-item label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.permission-item input[type=checkbox] { margin-right: 6px; }

/* ==================== 分页 ==================== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 16px; }
.pagination button { padding: 4px 10px; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; font-size: 13px; cursor: pointer; }
.pagination button:hover { border-color: #1890ff; color: #1890ff; }
.pagination button.active { background: #1890ff; color: #fff; border-color: #1890ff; }
.pagination button:disabled { color: #d9d9d9; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: #999; margin: 0 8px; }

/* ==================== Toast ==================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 6px; color: #fff; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 8px; animation: slideIn 0.3s ease; min-width: 200px; }
.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }
.toast.info { background: #1890ff; }
.toast.warning { background: #fa8c16; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }


/* ==================== 导入弹窗 ==================== */
.import-area { border: 2px dashed #d9d9d9; border-radius: 8px; padding: 40px; text-align: center; cursor: pointer; transition: border-color 0.2s; }
.import-area:hover, .import-area.dragover { border-color: #1890ff; background: #f0f5ff; }
.import-area .import-icon { font-size: 36px; margin-bottom: 8px; }
.import-area p { color: #999; font-size: 13px; }
.import-result { padding: 12px; background: #f6ffed; border-radius: 4px; margin-top: 12px; font-size: 13px; color: #52c41a; }

/* ==================== 附件预览 ==================== */
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attachment-item { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid #f0f0f0; border-radius: 4px; font-size: 12px; background: #fafafa; }
.attachment-item img { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; cursor: pointer; }
.attachment-item .remove-attach { cursor: pointer; color: #ff4d4f; font-size: 12px; }

/* ==================== 响应式?==================== */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-logo span, .menu-text, .menu-group-label { display: none; }
    .sidebar-logo { justify-content: center; padding: 16px 8px; }
    .menu-item { justify-content: center; padding: 10px; }
    .main-area { margin-left: 60px; }
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .charts-row, .bottom-row { grid-template-columns: 1fr; }
    .file-manager { flex-direction: column; }
    .folder-panel { width: 100%; }
    .form-row { grid-template-columns: 1fr; }
}

/* ==================== 可排序表格?==================== */
.sortable { cursor: pointer; user-select: none; position: relative; }
.sortable:hover { color: #1890ff; background: #f0f5ff; }
.sort-arrow { font-size: 12px; color: #1890ff; margin-left: 4px; }

/* ==================== 附件上传区域 ==================== */
.attachment-upload-area { border: 1px dashed #d9d9d9; border-radius: 4px; padding: 12px; background: #fafafa; }
.attachment-upload-area:hover { border-color: #1890ff; }

/* ==================== 角色标签 ==================== */
.role-badge { display: inline-block; background: #e6f7ff; color: #1890ff; font-size: 11px; padding: 1px 8px; border-radius: 10px; }

/* ==================== 必填标记 ==================== */
.required { color: #ff4d4f; }

/* ==================== New Styles ==================== */
.page-header { margin-bottom: 16px; }
.page-header h2 { font-size: 18px; font-weight: 600; }
.attachment-upload-zone { border: 2px dashed #d9d9d9; border-radius: 6px; padding: 20px; text-align: center; cursor: pointer; transition: border-color 0.2s; margin-top: 8px; }
.attachment-upload-zone:hover, .attachment-upload-zone.dragover { border-color: #1890ff; background: #f0f5ff; }
.attachment-upload-zone p { color: #999; font-size: 13px; margin: 0; }
.file-badge { display: inline-block; }
.file-badge a { color: #1890ff; font-size: 16px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attachment-item { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid #f0f0f0; border-radius: 4px; font-size: 12px; background: #fafafa; }
.attachment-item img { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; cursor: pointer; }
.attachment-item .remove-attach { cursor: pointer; color: #ff4d4f; font-size: 14px; font-weight: bold; margin-left: 4px; }
.attachment-item .remove-attach:hover { color: #ff7875; }

/* ==================== 附件拖拽排序 ==================== */
.attachment-list .attachment-item { cursor: grab; position: relative; transition: all 0.2s; }
.attachment-list .attachment-item:active { cursor: grabbing; }
.attachment-list .attachment-item.dragging { opacity: 0.4; transform: scale(0.95); }
.attachment-list .attachment-item.drag-over { border-color: #1890ff; background: #e6f7ff; transform: scale(1.02); box-shadow: 0 2px 8px rgba(24,144,255,0.2); }
.attachment-item .sort-handle { color: #bbb; cursor: grab; font-size: 14px; margin-right: 4px; user-select: none; }
.attachment-item .sort-handle:hover { color: #1890ff; }
.attachment-item .sort-btns { display: flex; flex-direction: column; gap: 0; margin-left: 2px; }
.attachment-item .sort-btn { background: none; border: none; cursor: pointer; color: #bbb; font-size: 10px; line-height: 1; padding: 0 2px; }
.attachment-item .sort-btn:hover { color: #1890ff; }
.attachment-item .attach-preview { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; cursor: pointer; }
.attachment-item .attach-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

/* ==================== 角色增强标签 ==================== */
.role-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.role-tag.admin { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffa39e; }
.role-tag.manager { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.role-tag.supervisor { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.role-tag.leader { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.role-tag.editor { background: #f9f0ff; color: #722ed1; border: 1px solid #d3adf7; }
.role-tag.auditor { background: #e6fffb; color: #13c2c2; border: 1px solid #87e8de; }
.role-tag.viewer { background: #f5f5f5; color: #999; border: 1px solid #d9d9d9; }

/* ==================== 附件计数徽章 ==================== */
.attach-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; background: #1890ff; color: #fff; border-radius: 9px; font-size: 10px; padding: 0 4px; margin-left: 4px; }
/* ==================== Lightbox 增强 ==================== */
.lightbox { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.9); display: none; align-items: center; justify-content: center; z-index: 2000; }
.lightbox.show { display: flex; }
.lightbox .lb-content { display: flex; flex-direction: column; align-items: center; max-width: 90vw; max-height: 90vh; }
.lightbox .lb-content img { max-width: 90vw; max-height: 80vh; object-fit: contain; cursor: pointer; }
.lightbox .lb-info { color: #fff; text-align: center; margin-top: 8px; font-size: 13px; display: flex; gap: 16px; align-items: center; }
.lightbox .lb-counter { color: rgba(255,255,255,0.6); }
.lightbox .lb-nav { position: fixed; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.4); color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2001; transition: background 0.2s; }
.lightbox .lb-nav:hover { background: rgba(0,0,0,0.7); }
.lightbox .lb-prev { left: 16px; }
.lightbox .close-btn { position: absolute; top: 16px; right: 16px; color: #fff; font-size: 28px; cursor: pointer; background: rgba(0,0,0,0.3); border: none; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; z-index: 2002; }
.lightbox .lb-next { right: 16px; }

/* ==================== 右键菜单 ==================== */
.context-menu { position: fixed; z-index: 3000; min-width: 160px; background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); padding: 4px 0; }
.context-menu .ctx-item { padding: 8px 16px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.context-menu .ctx-item.danger:hover { background: #fff1f0; }

/* ==================== 登录弹窗 ==================== */
.login-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.login-modal-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    padding: 40px;
    width: 380px;
    max-width: 90vw;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-modal-card h2 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 22px;
    color: #1890ff;
}
.login-modal-card .subtitle {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-bottom: 28px;
}
.login-modal-card .form-group {
    margin-bottom: 18px;
}
.login-modal-card label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 13px;
    color: #555;
}
.login-modal-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.login-modal-card input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}
.login-modal-card .btn-login {
    width: 100%;
    padding: 10px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}
.login-modal-card .btn-login:hover {
    background: #40a9ff;
}
.login-modal-card .error-msg {
    color: #ff4d4f;
    text-align: center;
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
}
.login-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.login-modal-close:hover {
    color: #333;
}

/* ==================== 顶栏登录按钮 ==================== */
.btn-topbar-login {
    padding: 6px 20px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-topbar-login:hover {
    background: #40a9ff;
}
#guestArea {
    display: flex;
    align-items: center;
}

/* ==================== 加载状态 ==================== */
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 60px 20px; color: #999; font-size: 14px; }
.loading-spinner::before { content: ''; width: 20px; height: 20px; border: 2px solid #e8e8e8; border-top-color: #1890ff; border-radius: 50%; margin-right: 10px; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 平板适配 */
@media (max-width: 1024px) {
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .bottom-row { grid-template-columns: 1fr; }
    .topbar-search input { width: 180px; }
    .table-wrapper { overflow-x: auto; }
    table { min-width: 600px; }
}

/* 手机适配增强 */
@media (max-width: 480px) {
    .sidebar { width: 0; overflow: hidden; }
    .main-area { margin-left: 0; }
    .topbar { padding: 0 12px; }
    .topbar-search input { width: 120px; font-size: 12px; }
    .content { padding: 12px; }
    .stats-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 20px; }
    .page-header h2 { font-size: 16px; }
    .toolbar { flex-wrap: wrap; gap: 6px; }
    .toolbar .form-input { width: 100% !important; }
    .modal { width: 95vw; max-height: 90vh; overflow-y: auto; }
    .login-modal-card { padding: 24px; width: 90vw; }
    .btn-topbar-login { padding: 4px 12px; font-size: 12px; }
    table { min-width: 500px; font-size: 12px; }
    th, td { padding: 6px 8px; }
    .pagination { gap: 2px; }
    .pagination button { padding: 4px 8px; font-size: 12px; }
}

/* ===== 调试/角色预览模式 ===== */
.debug-banner {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #fff;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    animation: debugPulse 2s ease-in-out infinite;
}
@keyframes debugPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}
.debug-banner strong {
    color: #fff;
    background: rgba(0,0,0,0.2);
    padding: 2px 8px;
    border-radius: 4px;
    margin: 0 4px;
}
.btn-debug-exit {
    background: #fff;
    color: #dc2626;
    border: 2px solid #fff;
    padding: 6px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.btn-debug-exit:hover {
    background: #dc2626;
    color: #fff;
}
.debug-role-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.debug-role-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.debug-role-card h3 {
    margin: 0 0 6px;
    font-size: 16px;
    color: #1e293b;
}
.debug-role-card .subtitle {
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 18px;
}
.debug-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.debug-role-item {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    background: #fff;
}
.debug-role-item:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}
.debug-role-item.active {
    border-color: #f59e0b;
    background: #fef3c7;
    font-weight: 600;
}
.debug-role-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.debug-role-actions button {
    padding: 6px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    border: none;
}
.btn-debug-confirm {
    background: #f59e0b;
    color: #fff;
}
.btn-debug-confirm:hover {
    background: #d97706;
}
.btn-debug-cancel {
    background: #e2e8f0;
    color: #475569;
}
/* ===== 通知铃铛 ===== */
.notification-bell { transition: transform 0.2s; }
.notification-bell:hover { transform: scale(1.1); }
.notification-bell:hover .notif-badge { animation: notifPulse 0.5s; }
@keyframes notifPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Lightbox 左右点击区域 */
.lightbox .lb-zone { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 1999; display: flex; align-items: center; justify-content: center; transition: background 0.2s; cursor: pointer; }
.lightbox .lb-zone-left { left: 0; }
.lightbox .lb-zone-right { right: 0; }
.lightbox .lb-zone:hover { background: rgba(255,255,255,0.06); }
.lightbox .lb-zone .lb-zone-hint { font-size: 36px; color: rgba(255,255,255,0); transition: color 0.2s; pointer-events: none; }
.lightbox .lb-zone:hover .lb-zone-hint { color: rgba(255,255,255,0.5); }
/* 搜索结果弹窗（可拖拽） */
.search-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); z-index: 1000; display: none; }
.search-modal-overlay.show { display: block; }
.search-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #fff; border-radius: 8px; width: 700px; max-width: 92vw; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,0.2); z-index: 1001; }
.search-drag-handle { cursor: move; user-select: none; }
/* 星级和收藏 */
.star-cell { white-space: nowrap; }
.star-icon { font-size: 16px; cursor: pointer; margin-right: 1px; transition: color 0.15s; }
.star-on { color: #faad14; }
.star-off { color: #d9d9d9; }
.star-icon:hover { color: #ffc53d; transform: scale(1.2); }
.fav-btn { font-size: 18px; cursor: pointer; transition: color 0.15s; color: #d9d9d9; }
.fav-on { color: #ff4d4f; }
.fav-btn:hover { transform: scale(1.2); }



/* ==================== 主题切换按钮 ==================== */
.theme-toggle {
    cursor: pointer;
    font-size: 20px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s;
    user-select: none;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle:hover {
    background: rgba(0,0,0,0.06);
    transform: scale(1.15);
}
body.dark-mode .theme-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* ==================== 柔和深色模式 ==================== */
/* 整体背景 */
body.dark-mode {
    background: #f0f0f3;
    color: #333;
}

/* 侧边栏 - 稍深一点 */
body.dark-mode .sidebar {
    background: #2c2c3a;
}

/* 顶栏 */
body.dark-mode .topbar {
    background: #e8e8ec;
    border-bottom-color: #d5d5db;
}

/* 搜索框 */
body.dark-mode .topbar-search input {
    background: #fff;
    border-color: #d0d0d6;
    color: #333;
}
body.dark-mode .topbar-search .search-icon {
    color: #999;
}

/* 用户区 */
body.dark-mode .topbar-username {
    color: #333;
}
body.dark-mode .topbar-avatar {
    background: #5b6abf;
}
body.dark-mode .topbar-dropdown {
    background: #fff;
    border-color: #d0d0d6;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
body.dark-mode .topbar-dropdown a {
    color: #333;
}
body.dark-mode .topbar-dropdown a:hover {
    background: #f0f0f3;
}

/* 按钮 */
body.dark-mode .btn-topbar-login {
    background: #5b6abf;
}
body.dark-mode .btn-topbar-login:hover {
    background: #6b7ad0;
}

/* 内容区 */
body.dark-mode .content-area {
    background: #f0f0f3;
}

/* 统计卡片 */
body.dark-mode .stat-card {
    background: #fff;
    border-color: #e0e0e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
body.dark-mode .stat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* 通用卡片 */
body.dark-mode .card {
    background: #fff;
    border-color: #e0e0e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
body.dark-mode .card h3 {
    color: #333;
}
body.dark-mode .card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* 表格 */
body.dark-mode .table-wrapper {
    border-color: #e0e0e5;
}
body.dark-mode thead th {
    background: #eef0f5;
    color: #444;
    border-color: #e0e0e5;
}
body.dark-mode tbody td {
    border-color: #eaeaed;
    color: #333;
}
body.dark-mode tbody tr:hover {
    background: #f5f6fa;
}
body.dark-mode tbody tr.editing {
    background: #e8ecf5;
}

/* 弹窗 */
body.dark-mode .modal-overlay {
    background: rgba(0,0,0,0.35);
}
body.dark-mode .modal-card {
    background: #fff;
    border-color: #e0e0e5;
}
body.dark-mode .modal-card h3 {
    color: #333;
}
body.dark-mode .modal-card input,
body.dark-mode .modal-card textarea,
body.dark-mode .modal-card select {
    background: #f8f8fa;
    border-color: #d0d0d6;
    color: #333;
}
body.dark-mode .modal-card input:focus,
body.dark-mode .modal-card textarea:focus,
body.dark-mode .modal-card select:focus {
    border-color: #5b6abf;
}

/* 按钮 */
body.dark-mode .btn-primary {
    background: #5b6abf;
}
body.dark-mode .btn-primary:hover {
    background: #6b7ad0;
}
body.dark-mode .btn-secondary {
    background: #e8e8ec;
    color: #333;
}
body.dark-mode .btn-secondary:hover {
    background: #d5d5db;
}
body.dark-mode .btn-sm {
    background: #f0f0f3;
    color: #555;
    border-color: #d0d0d6;
}
body.dark-mode .btn-sm:hover {
    background: #e0e0e5;
}

/* 分页 */
body.dark-mode .pagination button {
    background: #fff;
    border-color: #d0d0d6;
    color: #555;
}
body.dark-mode .pagination button:hover {
    background: #f0f0f3;
}
body.dark-mode .pagination button.active {
    background: #5b6abf;
    color: #fff;
}
body.dark-mode .pagination .page-info {
    color: #888;
}

/* 筛选栏 */
body.dark-mode .filter-bar {
    background: #fff;
    border-color: #e0e0e5;
}
body.dark-mode .filter-bar input,
body.dark-mode .filter-bar select {
    background: #f8f8fa;
    border-color: #d0d0d6;
    color: #333;
}

/* 搜索弹窗 */
body.dark-mode .search-modal {
    background: #fff;
    border-color: #e0e0e5;
}
body.dark-mode .search-modal h3 {
    color: #333;
}
body.dark-mode .search-modal .search-result-item {
    border-color: #eaeaed;
}
body.dark-mode .search-modal .search-result-item:hover {
    background: #f5f6fa;
}

/* 登录弹窗 */
body.dark-mode .login-modal-overlay {
    background: rgba(0,0,0,0.4);
}
body.dark-mode .login-modal-card {
    background: #fff;
}
body.dark-mode .login-modal-card input {
    background: #f8f8fa;
    border-color: #d0d0d6;
    color: #333;
}

/* 通知 */
body.dark-mode .notif-dropdown {
    background: #fff;
    border-color: #e0e0e5;
}
body.dark-mode .notif-item {
    border-color: #eaeaed;
}
body.dark-mode .notif-item:hover {
    background: #f5f6fa;
}

/* 星级和收藏 */
body.dark-mode .star-on {
    color: #f5a623;
}
body.dark-mode .star-off {
    color: #ccc;
}
body.dark-mode .fav-on {
    color: #e74c3c;
}
body.dark-mode .fav-btn {
    color: #ccc;
}

/* 标题 */
body.dark-mode .page-header h2,
body.dark-mode .dashboard-header h2 {
    color: #333;
}
body.dark-mode .section-title {
    color: #5b6abf;
}

/* 空状态 */
body.dark-mode .empty-state {
    color: #999;
}

/* 灯箱 */
body.dark-mode .lightbox {
    background: rgba(0,0,0,0.8);
}

/* 链接卡片 */
body.dark-mode .link-card {
    background: #fff;
    border-color: #e0e0e5;
}
body.dark-mode .link-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
body.dark-mode .link-card .link-title {
    color: #5b6abf;
}

/* toast */
body.dark-mode .toast {
    background: #fff;
    color: #333;
    border-color: #e0e0e5;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* 徽章 */
body.dark-mode .badge {
    background: #eef0f5;
    color: #5b6abf;
}

/* 图表 */
body.dark-mode .chart-container {
    background: #fff;
    border-color: #e0e0e5;
}

/* ==================== 移动端完整适配 ==================== */

/* 汉堡菜单按钮 - 默认隐藏 */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 8px;
}
.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    border-radius: 1px;
    transition: all 0.3s ease;
}
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    display: none;
}
.sidebar-overlay.show {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99;
}

/* 平板 (768px - 1024px) */
@media (max-width: 1024px) {
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .bottom-row { grid-template-columns: 1fr; }
    .charts-row { grid-template-columns: 1fr; }
    .topbar-search input { width: 180px; }
    .table-wrapper { overflow-x: auto; }
    table { min-width: 600px; }
    .sidebar { width: 60px; }
    .sidebar-logo span, .menu-text, .menu-group-label { display: none; }
    .sidebar-logo { justify-content: center; padding: 16px 8px; }
    .menu-item { justify-content: center; padding: 10px; }
    .main-area { margin-left: 60px; }
}

/* 手机 (480px - 768px) */
@media (max-width: 768px) {
    /* 汉堡按钮显示 */
    .hamburger-btn {
        display: flex !important;
    }

    /* 侧边栏隐藏，可滑出 */
    .sidebar {
        width: 240px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* 恢复文字显示 */
    .sidebar-logo span,
    .menu-text,
    .menu-group-label {
        display: block !important;
    }
    .sidebar-logo {
        justify-content: flex-start !important;
        padding: 16px 20px !important;
    }
    .menu-item {
        justify-content: flex-start !important;
        padding: 10px 20px !important;
    }

    /* 主区域全宽 */
    .main-area {
        margin-left: 0 !important;
    }

    /* 顶栏紧凑 */
    .topbar {
        padding: 0 12px;
        gap: 8px;
    }
    .topbar-search {
        flex: 1;
        min-width: 0;
    }
    .topbar-search input {
        width: 100% !important;
        font-size: 14px;
    }
    .topbar-username {
        display: none;
    }

    /* 统计卡片 */
    .stats-cards {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    .stat-card {
        padding: 12px !important;
    }
    .stat-value {
        font-size: 20px !important;
    }
    .stat-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
    }

    /* 图表区域单列 */
    .charts-row,
    .bottom-row {
        grid-template-columns: 1fr !important;
    }

    /* 内容区域 */
    .content {
        padding: 12px !important;
    }
    .page-header h2 {
        font-size: 16px !important;
    }
    .dashboard-header h2 {
        font-size: 16px !important;
    }

    /* 工具栏 */
    .toolbar {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .toolbar .form-input {
        width: 100% !important;
    }
    .toolbar-right {
        margin-left: 0 !important;
        width: 100%;
        justify-content: flex-end;
    }

    /* 表格 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 500px !important;
        font-size: 13px;
    }
    th, td {
        padding: 6px 8px !important;
    }

    /* 弹窗 */
    .modal {
        width: 95vw !important;
        max-height: 85vh !important;
        border-radius: 12px;
    }
    .modal-header {
        padding: 12px 16px;
    }
    .modal-body {
        padding: 12px 16px;
    }
    .modal-footer {
        padding: 12px 16px;
    }

    /* 登录弹窗 */
    .login-modal-card {
        padding: 24px !important;
        width: 90vw !important;
    }

    /* 搜索弹窗 */
    .search-modal {
        width: 95vw !important;
        max-width: 95vw !important;
    }

    /* 分页 */
    .pagination {
        gap: 2px;
    }
    .pagination button {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* 通知下拉 */
    .notif-dropdown {
        position: fixed !important;
        top: 56px !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
        max-width: none !important;
    }

    /* 文件管理器 */
    .file-manager {
        flex-direction: column;
    }
    .folder-panel {
        width: 100% !important;
        max-height: 200px;
    }

    /* 表单行 */
    .form-row {
        grid-template-columns: 1fr !important;
    }

    /* 星级和收藏 */
    .star-cell .star-icon {
        font-size: 14px;
    }
    .fav-btn {
        font-size: 16px;
    }

    /* Toast通知 */
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
    }
    .toast {
        min-width: auto;
    }
}

/* 小手机 (<480px) */
@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .stat-card {
        padding: 10px !important;
        gap: 12px;
    }
    .stat-value {
        font-size: 18px !important;
    }
    .stat-info h3 {
        font-size: 14px;
    }

    .content {
        padding: 8px !important;
    }
    .page-header {
        margin-bottom: 12px;
    }

    .modal {
        width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0;
    }

    table {
        min-width: 450px !important;
        font-size: 12px;
    }
    th, td {
        padding: 5px 6px !important;
    }
}

/* 隐藏滚动条（移动端美化） */
@media (max-width: 768px) {
    .sidebar::-webkit-scrollbar {
        width: 0;
    }
    .table-wrapper::-webkit-scrollbar {
        height: 4px;
    }
    .table-wrapper::-webkit-scrollbar-thumb {
        background: #d9d9d9;
        border-radius: 2px;
    }
}