/* 全局核心样式 - 现代化 SaaS 调色板 (蓝绿渐变清爽版) */
:root {
    --primary: #3b82f6;       /* 主色调蓝 */
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --success: #10b981;       /* 成功绿 */
    --success-hover: #059669;
    --success-light: #ecfdf5;
    --warning: #f59e0b;       /* 琥珀黄 */
    --warning-hover: #d97706;
    --warning-light: #fffbeb;
    --danger: #ef4444;        /* 警示红 */
    --danger-hover: #dc2626;
    --danger-light: #fef2f2;
    --info: #0ea5e9;          /* 天蓝色 (用于左侧栏高亮) */
    --info-hover: #0284c7;
    --info-light: #f0f9ff;
    --dark: #0f172a;
    --dark-hover: #1e293b;
    --bg-body: #f0f6fc;       /* 极浅灰蓝色底板 */
    --bg-surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #334155;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 10px;           /* 更圆润的边角 */
    --sidebar-width: 200px;   /* 【新增】侧边栏初始默认宽度 */
}
* { margin:0; padding:0; box-sizing:border-box; }
body { 
    font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    background: var(--bg-body); color: var(--text-main); font-size: 13.5px; line-height: 1.6; overflow: hidden; 
}
::-webkit-scrollbar { width: 6px; height: 6px; } 
::-webkit-scrollbar-track { background: transparent; } 
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; } 
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.hidden { display: none !important; }
@media (max-width: 600px) { .hidden-mobile { display: none !important; } }
.layout { display: flex; height: 100vh; overflow: hidden; }

/* 沉浸侧边栏高级浅色化与拖拽重构 */
.sidebar { 
    width: var(--sidebar-width); 
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%); 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.03); 
    border-right: 1px solid var(--border);
    z-index: 10; 
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    overflow: hidden; 
    position: relative; 
}
.sidebar.collapsed { width: 0 !important; min-width: 0 !important; border-right: none; }
.sidebar.dragging { transition: none !important; }

/* 侧边栏拖拽控制手柄 */
.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background-color: transparent;
    z-index: 100;
    transition: background-color 0.2s ease;
}
.resizer:hover, .sidebar.dragging .resizer {
    background-color: var(--primary);
    box-shadow: -1px 0 6px rgba(59, 130, 246, 0.4);
}

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; transition: all 0.3s; }
.topbar { height: 60px; background: var(--bg-surface); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); z-index: 5; }
.page { flex: 1; overflow-y: auto; padding: 24px; scroll-behavior: smooth; }
.flex-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } 
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; } 
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.f1 { flex: 1; } .w-full { width: 100%; } 
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 20px; } .mt-3 { margin-top: 14px; }
.tc { text-align: center; } .tr { text-align: right; } .tl { text-align: left; } 
.bold { font-weight: 600; } .mono { font-family: 'JetBrains Mono', Consolas, monospace; font-weight: 500; letter-spacing: 0.5px; }
.text-sm { font-size: 12.5px; } .text-xs { font-size: 11.5px; } 
.color-p { color: var(--primary); } .color-d { color: var(--danger); } .color-s { color: var(--success); } .color-m { color: var(--text-muted); } .color-i { color: var(--info); }
.cursor-pointer { cursor: pointer; }

/* 卡片美化 */
.card { background: var(--bg-surface); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.scard { background: var(--bg-surface); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); transition: all 0.25s ease; position: relative; overflow: hidden; } 
.scard:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #cbd5e1; }
.ctitle { font-size: 17px; font-weight: 700; color: var(--text-main); margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }

/* 交互组件美化 */
.btn { padding: 8px 16px; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); outline: none; user-select: none; gap: 6px; } 
.btn:active { transform: scale(0.96); } .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-p { background: var(--primary); color: #fff; box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2); } .btn-p:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.3); transform: translateY(-1px); }
.btn-s { background: var(--success); color: #fff; box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2); } .btn-s:hover:not(:disabled) { background: var(--success-hover); transform: translateY(-1px); }
.btn-d { background: var(--danger); color: #fff; } .btn-d:hover:not(:disabled) { background: var(--danger-hover); transform: translateY(-1px); } 
.btn-w { background: var(--warning); color: #fff; } .btn-w:hover:not(:disabled) { background: var(--warning-hover); transform: translateY(-1px); }
.btn-i { background: var(--info); color: #fff; } .btn-i:hover:not(:disabled) { background: var(--info-hover); transform: translateY(-1px); } 
.btn-n { background: #fff; color: var(--text-main); border: 1px solid #d1d5db; box-shadow: 0 1px 2px rgba(0,0,0,0.05); } .btn-n:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; transform: translateY(-1px); }
.btn-text { background: transparent; color: var(--text-muted); padding: 6px 10px; border-radius: 6px; } .btn-text:hover { background: #f1f5f9; color: var(--primary); } 
.btn-text.danger { color: var(--danger); } .btn-text.danger:hover { background: var(--danger-light); color: var(--danger-hover); }

/* 输入框与下拉框更柔和 */
.inp, .sel { padding: 9px 14px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; font-size: 13.5px; color: var(--text-main); transition: all 0.2s; width: 100%; box-shadow: inset 0 1px 2px rgba(0,0,0,0.01); font-family: inherit; }
.inp:hover, .sel:hover { border-color: #9ca3af; }
.inp:focus, .sel:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); background: #fff; } 
.inp:disabled, .sel:disabled { background: #f3f4f6; color: var(--text-muted); cursor: not-allowed; border-color: #e5e7eb; }
label { display: block; font-weight: 500; color: var(--text-muted); margin-bottom: 8px; font-size: 12.5px; }

/* 徽章美化 */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 11.5px; font-weight: 600; white-space: nowrap; letter-spacing: 0.3px; } 
.badge.blue { background: #e0e7ff; color: #3730a3; } 
.badge.green { background: #d1fae5; color: #065f46; } 
.badge.orange { background: #fef3c7; color: #92400e; } 
.badge.purple { background: #f3e8ff; color: #6b21a8; } 
.badge.gray { background: #f1f5f9; color: #475569; } 
.badge.red { background: #fee2e2; color: #991b1b; } 
.badge.cyan { background: #e0f2fe; color: #075985; }

/* 提示框美化 */
.alert { padding: 14px 18px; border-radius: 10px; font-size: 13.5px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.6; } 
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; } 
.alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* 表格优雅化 */
.table-wrap { overflow: auto; max-height: 65vh; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: #fff; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; } 
.tbl th, .tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); color: var(--text-main); } 
.tbl th:last-child, .tbl td:last-child { border-right: none; }
.tbl th { background: #f8fafc; font-weight: 600; color: #475569; text-transform: uppercase; font-size: 12px; position: sticky; top: 0; z-index: 2; border-bottom: 2px solid var(--border); letter-spacing: 0.5px; } 
.tbl tbody tr { transition: background 0.2s; } 
.tbl tbody tr:hover { background: #f8fafc; } 
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.highlight { background: #fffbeb; font-weight: 600; }
.dr-val { color: var(--danger); font-family: 'JetBrains Mono', Consolas, monospace; } 
.cr-val { color: var(--success); font-family: 'JetBrains Mono', Consolas, monospace; }

/* 报表表格 */
.rep-tbl { border: 2px solid #94a3b8; border-collapse: collapse; width: 100%; min-width: 800px; background: #fff; border-radius: 8px; overflow: hidden; } 
.rep-tbl th { background: #f8fafc; border: 1px solid #cbd5e1; border-bottom: 2px solid #94a3b8; color: var(--text-main); font-weight: bold; text-align: center; font-size: 13.5px; padding: 14px; } 
.rep-tbl td { border: 1px solid #e2e8f0; font-size: 13.5px; padding: 10px 14px; } 
.rep-tbl tbody tr:hover { background: #f8fafc; }

/* 侧边栏导航美化 - 浅色系 SaaS 风格 */
.logo { height: 60px; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 19px; font-weight: 800; background: transparent; letter-spacing: 1.5px; border-bottom: 1px solid var(--border); white-space: nowrap; text-shadow: none; } 
.book-bar { padding: 16px; background: #f8fafc; border-bottom: 1px solid var(--border); min-width: 200px; } 
.menu-area { flex: 1; overflow-y: auto; padding: 16px 12px; min-width: 200px; } 
.menu-group { font-size: 11.5px; color: #94a3b8; padding: 16px 12px 8px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; } 
.menu-item { padding: 11px 16px; margin-bottom: 6px; border-radius: 8px; cursor: pointer; color: #475569; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 13.5px; border: 1px solid transparent; } 
.menu-item:hover { color: #ffffff; background: var(--primary-hover); transform: translateX(4px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); } 
.menu-item.active { color: #ffffff; background: var(--primary); transform: translateX(4px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); font-weight: 700; border-color: transparent; }
/* 弹窗与遮罩高级感 */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 9999; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.25s ease-out; } 
.dlg { background: var(--bg-surface); border-radius: 16px; padding: 28px; width: 520px; max-height: 85vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); border: 1px solid rgba(255,255,255,0.2); } 
.dlg-lg { width: 800px; } .dlg-xl { width: 1050px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } 
@keyframes slideUp { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* 下拉联想美化 */
.accdrop { position: absolute; top: calc(100% + 6px); left: 0; width: max-content; min-width: 100%; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 8000; border-radius: 8px; } 
.accitem { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; transition: background 0.15s; } 
.accitem:last-child { border-bottom: none; }
.accitem:hover, .accitem.active { background: #e0e7ff; }

/* 启动引导大厅重设 */
.boot { height: 100vh; background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; } 
.boot::before { content: ''; position: absolute; width: 600px; height: 600px; background: rgba(79, 70, 229, 0.1); filter: blur(80px); border-radius: 50%; top: -200px; right: -100px; z-index: 0; }
.bootbox { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); width: 900px; border-radius: 20px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.1), 0 0 0 1px rgba(255,255,255,0.5) inset; overflow: hidden; display: flex; flex-direction: column; z-index: 1; border: 1px solid rgba(255,255,255,0.4); } 
.bitem { padding: 16px 20px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; cursor: pointer; background: #fff; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm); } 
.bitem:hover { border-color: var(--primary); box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1); transform: translateY(-3px) scale(1.01); }

/* 凭证输入框无缝感 */
.v-input-cell { padding: 0 !important; position: relative; } 
.v-inp { width: 100%; height: 100%; border: none; outline: none; padding: 10px 12px; background: transparent; font-size: 13.5px; transition: background 0.2s; } 
.v-inp:focus { background: #fffbeb; box-shadow: inset 0 0 0 2px var(--warning); border-radius: 2px; }

/* 原版级别无损全黑打印视图 */
@media print{
    body *{visibility:hidden} #printArea,#printArea *{visibility:visible} 
    #printArea{position:absolute;left:0;top:0;width:100%;background:#fff;padding:20px;color:#000;} 
    .btn,.no-print{display:none!important} .rep-tbl,.tbl,.ptbl{border-collapse:collapse!important;min-width:100%!important;} 
    .rep-tbl{border:2px solid #000!important;} .rep-tbl th,.rep-tbl td,.tbl th,.tbl td,.ptbl th,.ptbl td{border:1px solid #000!important;color:#000!important;padding:4px 6px!important;} 
    .rep-tbl thead th,.tbl thead th,.ptbl thead th{background:transparent!important;border-bottom:2px solid #000!important;} @page{margin:10mm}
}
#printArea{display:none} body.printing #printArea{display:block} .ptbl{width:100%;border-collapse:collapse;margin-bottom:10px;font-size:13px;color:#000;} .ptbl th,.ptbl td{border:1px solid #000;padding:8px;} .ptbl th{text-align:center;font-weight:bold;background:#f8fafc;}
/* =========================================================
   新增：侧边栏响应式迷你模式 (仅显示彩色图像图标)
   ========================================================= */
.sidebar.mini { 
    width: 70px !important; 
    min-width: 70px !important; 
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 隐藏所有文本和区块 */
.sidebar.mini .logo-text,
.sidebar.mini .book-bar,
.sidebar.mini .menu-group,
.sidebar.mini .menu-text,
.sidebar.mini .exit-btn-text { 
    display: none !important; 
}

/* 针对迷你模式重塑布局 */
.sidebar.mini .logo { 
    font-size: 24px; 
    padding: 16px 0; 
    justify-content: center; 
}
.sidebar.mini .menu-area { 
    padding: 16px 8px; 
    min-width: auto; 
}
.sidebar.mini .menu-item { 
    justify-content: center; 
    padding: 12px 0; 
    margin-bottom: 12px; 
}
.sidebar.mini .menu-icon { 
    margin-right: 0 !important; 
    font-size: 24px !important; /* 放大图标增强辨识度 */
    transition: transform 0.2s;
}
.sidebar.mini .menu-item:hover .menu-icon {
    transform: scale(1.15); /* 鼠标悬浮图标呼吸放大效果 */
}
.sidebar.mini #exitArea { 
    padding: 16px 8px !important; 
    min-width: auto !important; 
}
.sidebar.mini #exitArea button { 
    padding: 12px 0; 
    justify-content: center; 
}