/* === 全局重置 === */
* { margin: 0; padding: 0; box-sizing: border-box; }
*:focus { outline: none; }

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --topbar-height: 56px;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
}

/* === 登录页 === */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}
.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px;
    width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 32px;
}
.login-header h1 { font-size: 20px; color: var(--gray-800); font-weight: 700; }
.login-header p { font-size: 14px; color: var(--gray-500); margin-top: 4px; }
.login-form .form-group {
    position: relative;
    margin-bottom: 20px;
}
.login-form .form-group i {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 16px;
}
.login-form input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
}
.login-form input:focus { border-color: var(--primary); }
.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-login:hover { background: var(--primary-dark); }
.login-tip { text-align: center; margin-top: 16px; color: var(--gray-400); font-size: 12px; }
.login-version { text-align: center; margin-top: 18px; color: var(--gray-400); font-size: 12px; letter-spacing: .5px; }

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

/* === 侧边栏 === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width 0.3s;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar-header {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-title { display: flex; flex-direction: column; white-space: nowrap; overflow: hidden; }
.sidebar-title span { font-size: 15px; font-weight: 700; }
.sidebar-title small { font-size: 11px; color: var(--gray-400); }
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .user-detail { display: none; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.sidebar-nav .nav-group { margin-bottom: 4px; }
.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    color: var(--gray-300);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
    white-space: nowrap;
}
.sidebar-nav .nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-nav .nav-item.active {
    background: rgba(37,99,235,0.15);
    color: #fff;
    border-left-color: var(--primary);
}
.sidebar-nav .nav-item i { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-item .nav-label { flex: 1; }
.sidebar-nav .nav-item .arrow { font-size: 10px; transition: transform 0.2s; }
.sidebar-nav .nav-item.expanded .arrow { transform: rotate(90deg); }
.sidebar-nav .nav-submenu {
    display: none;
    padding-left: 32px;
}
.sidebar-nav .nav-submenu.show { display: block; }
.sidebar-nav .nav-submenu .nav-item { padding: 8px 16px; font-size: 13px; }

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gray-700);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    color: #fff;
}
.user-detail { flex: 1; overflow: hidden; }
.user-detail span { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; }
.user-detail small { font-size: 11px; color: var(--gray-400); }
.btn-logout {
    background: none; border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 14px;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* === 主内容区 === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* === 顶部栏 === */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}
.btn-toggle {
    background: none; border: none;
    width: 36px; height: 36px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 18px;
}
.btn-toggle:hover { background: var(--gray-100); }
.breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-600);
}
.breadcrumb .separator { color: var(--gray-400); }
.current-date { color: var(--gray-500); font-size: 13px; }

/* === 内容区域 === */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* === 卡片 === */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { font-size: 16px; font-weight: 600; color: var(--gray-800); }
.card-body { padding: 24px; }

/* === 统计卡片 === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid var(--gray-300);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.stat-card.border-blue { border-left-color: var(--primary); }
.stat-card.border-green { border-left-color: var(--success); }
.stat-card.border-orange { border-left-color: var(--warning); }
.stat-card.border-red { border-left-color: var(--danger); }
.stat-card.border-teal { border-left-color: #0d9488; }
.stat-card.border-gray { border-left-color: var(--gray-400); }
.stat-card.border-purple { border-left-color: #7c3aed; }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-icon.orange { background: #fef3c7; color: var(--warning); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }
.stat-icon.teal { background: #ccfbf1; color: #0d9488; }
.stat-icon.gray { background: #f3f4f6; color: #6b7280; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-info h3 { font-size: 28px; font-weight: 700; color: var(--gray-800); }
.stat-info p { font-size: 13px; color: var(--gray-500); }

/* === 表格 === */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    background: #fff;
    table-layout: auto;
}
.data-table thead th {
    text-align: left;
    padding: 14px 16px;
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    color: var(--gray-700);
    font-weight: 700;
    font-size: 13px;
    border-bottom: 2px solid var(--gray-300);
    border-right: 1px solid var(--gray-200);
    white-space: nowrap;
    letter-spacing: 0.3px;
    position: relative;
}
.data-table thead th:last-child { border-right: none; }
.data-table thead th:first-child { border-top-left-radius: 10px; }
.data-table thead th:last-child { border-top-right-radius: 10px; }
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-100);
    font-size: 14px;
    color: var(--gray-700);
    vertical-align: middle;
}
.data-table td:last-child { border-right: none; }
.data-table tbody tr:nth-child(even) td { background: #fafbfc; }
.data-table tbody tr:hover td { background: #eff6ff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:last-child td:first-child { border-bottom-left-radius: 10px; }
.data-table tbody tr:last-child td:last-child { border-bottom-right-radius: 10px; }
.data-table .text-center { text-align: center; }
.data-table .text-muted { color: var(--gray-400); }
.data-table .text-right { text-align: right; }
.data-table .text-bold { font-weight: 700; color: var(--gray-800); }
/* 列宽建议类 */
.data-table td.col-title { min-width: 200px; max-width: 360px; word-break: break-word; }
.data-table td.col-money { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--gray-800); }
.data-table td.col-actions { white-space: nowrap; min-width: 140px; }
.data-table td.col-narrow { width: 80px; text-align: center; }
.data-table td.col-medium { width: 120px; text-align: center; }
/* 行高紧凑 */
.data-table.table-compact td { padding: 8px 12px; font-size: 13px; }
/* 合计行 */
.data-table tr.total-row td {
    background: #fff7ed;
    font-weight: 700;
    color: var(--danger);
    border-top: 2px solid var(--warning);
    border-bottom: 2px solid var(--warning);
}

/* 合计条 (表格上方) */
.total-bar {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid transparent;
}
.total-bar-label {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 600;
}
.total-bar-amount {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--danger);
}
.total-bar-count {
    font-size: 13px;
    color: var(--gray-500);
    padding-left: 8px;
    border-left: 1px solid currentColor;
    opacity: 0.7;
}
.total-bar-success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.total-bar-success .total-bar-amount { color: #047857; }
.total-bar-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.total-bar-danger .total-bar-amount { color: #b91c1c; }
.total-bar-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.total-bar-warning .total-bar-amount { color: #b45309; }
.total-bar-info { background: #e0f7fa; border-color: #a5f3fc; color: #0891b2; }
.total-bar-info .total-bar-amount { color: #0891b2; }
/* 序号列样式 */
.data-table .row-num {
    display: inline-block;
    min-width: 28px;
    text-align: center;
    background: var(--gray-100);
    color: var(--gray-500);
    border-radius: 4px;
    font-size: 12px;
    padding: 2px 6px;
    font-weight: 600;
}

/* === 按钮 === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-default { background: var(--gray-100); color: var(--gray-700); }
.btn-default:hover { background: var(--gray-200); }
.btn-sm { padding: 5px 12px; font-size: 12px; font-weight: 600; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 表格内操作按钮组 */
.action-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}
.action-group .btn-text { font-size: 13px; }
.action-sep { color: var(--gray-300); margin: 0 1px; }

/* Tab按钮组(无图标) */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
    overflow-x: auto;
}
.tab-bar .tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    margin-bottom: -2px;
}
.tab-bar .tab-btn:hover { color: var(--primary); background: var(--gray-50); }
.tab-bar .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-light);
    border-radius: 8px 8px 0 0;
}

/* === 表单 === */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.form-group {
    flex: 1;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}
.form-group label .required { color: var(--danger); }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; }

/* === 搜索栏 === */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.search-bar .form-control { width: auto; min-width: 200px; }
.search-bar .btn { white-space: nowrap; }

/* === 分页 === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}
.pagination button {
    min-width: 36px; height: 36px;
    border: 1px solid var(--gray-300);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-700);
}
.pagination button:hover:not(:disabled) { background: var(--gray-50); border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { margin: 0 12px; font-size: 13px; color: var(--gray-500); }

/* === 标签 === */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-green { background: #d1fae5; color: #059669; }
.tag-orange { background: #fef3c7; color: #b45309; }
.tag-red { background: #fee2e2; color: #dc2626; }
.tag-gray { background: var(--gray-100); color: var(--gray-600); }
.tag-purple { background: #ede9fe; color: #7c3aed; }
.tag-teal { background: #ccfbf1; color: #0d9488; }
.tag-default { background: var(--gray-100); color: var(--gray-600); }

/* === 徽章 (与tag统一) === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-success { background: #d1fae5; color: #059669; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #e0f7fa; color: #0891b2; }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-purple { background: #ede9fe; color: #7c3aed; }

/* === 文字操作按钮 (替代图标) === */
.btn-text {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-text:hover { text-decoration: underline; }
.btn-text-edit { color: var(--primary); }
.btn-text-edit:hover { background: var(--primary-light); text-decoration: none; }
.btn-text-delete { color: var(--danger); }
.btn-text-delete:hover { background: #fee2e2; text-decoration: none; }
.btn-text-view { color: var(--info); }
.btn-text-view:hover { background: #e0f7fa; text-decoration: none; }
.btn-text-approve { color: var(--success); }
.btn-text-approve:hover { background: #d1fae5; text-decoration: none; }
.btn-text-reject { color: var(--danger); }
.btn-text-reject:hover { background: #fee2e2; text-decoration: none; }
.btn-text-download { color: var(--info); }
.btn-text-download:hover { background: #e0f7fa; text-decoration: none; }
.btn-text-submit { color: var(--warning); }
.btn-text-submit:hover { background: #fef3c7; text-decoration: none; }
.btn-text-sep { color: var(--gray-300); padding: 0 2px; font-weight: 400; }

/* btn-text在按钮内时继承按钮颜色 */
.btn .btn-text {
    color: inherit;
    background: none;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    border-radius: 0;
}
.btn .btn-text:hover {
    background: none;
    text-decoration: underline;
}

/* 表格操作列 */
.data-table td .action-group,
.data-table td .btn-text,
.data-table td .btn-sm {
    white-space: nowrap;
}

/* === 模态框 === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 40px 20px;
}
.modal-container {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0;
    background: #fff;
    z-index: 10;
    border-radius: 12px 12px 0 0;
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close {
    background: none; border: none;
    font-size: 20px; cursor: pointer;
    color: var(--gray-400);
    padding: 4px 8px;
    border-radius: 6px;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky; bottom: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
}

/* === Toast 通知 === */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}
@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }
.toast.warning { background: var(--warning); }

/* === 空状态 === */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

/* === 上传区域 === */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area i { font-size: 48px; color: var(--gray-400); margin-bottom: 12px; }
.upload-area p { color: var(--gray-500); }
.upload-area .file-name { color: var(--primary); font-weight: 600; }

/* === 权限树 === */
.perm-tree { padding: 8px 0; }
.perm-tree-node { margin-left: 24px; }
.perm-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}
.perm-tree-item .checkbox { width: 16px; height: 16px; }

/* === 响应式 === */
@media (max-width: 768px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .sidebar-title, .sidebar .nav-label, .sidebar .user-detail { display: none; }
    .main-content { margin-left: var(--sidebar-collapsed); }
    .form-row { flex-direction: column; }
    .search-bar { flex-direction: column; align-items: stretch; }
    .search-bar .form-control { width: 100%; }
}

/* === 富文本编辑器 === */
.body-editor {
    font-family: '仿宋', '仿宋_GB2312', 'Songti SC', serif;
    font-size: 16px;
    line-height: 1.8;
    background: #fff;
    color: #333;
}
.body-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--gray-400);
    pointer-events: none;
}
.body-editor:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary-light);
}
.body-editor p {
    margin-bottom: 8px;
    text-indent: 2em;
}
.body-editor p:first-child {
    text-indent: 2em;
}
.body-editor h1, .body-editor h2, .body-editor h3 {
    font-family: '黑体', 'Heiti SC', sans-serif;
    font-weight: bold;
    margin: 12px 0 8px;
    text-indent: 2em;
}
.body-editor h1 { font-size: 18px; }
.body-editor h2 { font-size: 16px; }
.body-editor h3 { font-size: 16px; }
.body-editor ul, .body-editor ol {
    margin-left: 2em;
    margin-bottom: 8px;
}
.body-editor li {
    margin-bottom: 4px;
}
.body-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}
.body-editor td, .body-editor th {
    border: 1px solid #ddd;
    padding: 6px 10px;
}

.editor-toolbar .btn-sm {
    padding: 4px 8px;
    min-width: 32px;
    font-size: 13px;
}

/* === 公文预览 === */
.doc-preview {
    background: #fff;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 60px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    min-height: 600px;
}
.doc-preview p {
    text-indent: 2em;
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.8;
}
.doc-preview h1, .doc-preview h2, .doc-preview h3 {
    font-family: '黑体', 'Heiti SC', sans-serif;
    font-weight: bold;
    text-indent: 2em;
    margin: 12px 0 8px;
}
.doc-preview ul, .doc-preview ol {
    margin-left: 2em;
    margin-bottom: 8px;
}
.doc-preview li {
    margin-bottom: 4px;
    font-size: 16px;
    line-height: 1.8;
}
