* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: #303133; background: #f0f2f5; }
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }

/* ---------- 布局 ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fff; color: #303133; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid #ebeef5; }
.logo { height: 60px; display: flex; align-items: center; gap: 9px; padding: 0 18px; color: #1f2d3d; font-size: 16px; font-weight: 700; border-bottom: 1px solid #f2f4f8; }
.logo-icon { display: inline-flex; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #3b82f6, #2f6fed); align-items: center; justify-content: center; color: #fff; font-size: 15px; }
#menu { padding: 12px 10px; flex: 1; }
.menu-item { display: flex; align-items: center; gap: 9px; padding: 11px 14px; margin-bottom: 2px; border-radius: 8px; color: #303133; cursor: pointer; transition: background .15s, color .15s; font-size: 14px; }
.menu-item:hover { background: #f5f7fa; color: #2f6fed; }
.menu-item.active { background: #2f6fed; color: #fff; font-weight: 600; }
.menu-item .mi { width: 20px; text-align: center; font-size: 15px; }
.menu-group-title { padding: 14px 14px 6px; font-size: 12px; color: #a0a6b1; letter-spacing: 1px; }
.menu-item.sub { font-size: 13.5px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #f5f7fb; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid #e8eaf0; display: flex; align-items: center; padding: 0 24px; gap: 12px; position: sticky; top: 0; z-index: 10; }
#crumb { font-size: 15px; font-weight: 600; }
.spacer { flex: 1; }
.admin-name { color: #606266; }
.avatar-dot { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #2f6fed); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.topbar-link { color: #2f6fed; font-size: 13px; }
.topbar-link:hover { opacity: .8; }
.view { padding: 20px 24px; flex: 1; }

/* ---------- 通用组件 ---------- */
.card { background: #fff; border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #dcdfe6; background: #fff; color: #606266; padding: 7px 14px; border-radius: 5px; cursor: pointer; font-size: 13px; transition: all .15s; }
.btn:hover { color: #2f6fed; border-color: #2f6fed; }
.btn.primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.btn.primary:hover { background: #2563d8; }
.btn.danger { color: #f56c6c; border-color: #fbc4c4; }
.btn.danger:hover { background: #fef0f0; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea { border: 1px solid #dcdfe6; border-radius: 5px; padding: 8px 10px; font-size: 13px; outline: none; transition: border-color .15s; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: #2f6fed; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid #ebeef5; font-size: 13px; white-space: nowrap; }
th { color: #909399; font-weight: 500; background: #fafbfc; }
tr:hover td { background: #f7f9fc; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 12px; }
.tag.green { background: #f0f9eb; color: #67c23a; }
.tag.orange { background: #fdf6ec; color: #e6a23c; }
.tag.red { background: #fef0f0; color: #f56c6c; }
.tag.blue { background: #ecf5ff; color: #2f6fed; }
.tag.gray { background: #f4f4f5; color: #909399; }

.pagination { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 14px; font-size: 13px; color: #606266; }
.pagination button { border: 1px solid #dcdfe6; background: #fff; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.pagination button.active { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filter-bar input, .filter-bar select { width: 160px; }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { border-radius: 8px; padding: 16px; color: #fff; }
.stat-card .num { font-size: 22px; font-weight: 700; margin-top: 6px; }
.stat-card .label { font-size: 13px; opacity: .9; }
.sc-green { background: linear-gradient(135deg, #67c23a, #5daf34); }
.sc-orange { background: linear-gradient(135deg, #e6a23c, #cf8f2e); }
.sc-red { background: linear-gradient(135deg, #f56c6c, #dd5454); }
.sc-blue { background: linear-gradient(135deg, #2f6fed, #2458c4); }
.sc-purple { background: linear-gradient(135deg, #7b5cf0, #6344d8); }
.sc-cyan { background: linear-gradient(135deg, #36cfc9, #2ab5b0); }

/* 表单弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 10px; width: 560px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid #ebeef5; font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; }
.modal-close { cursor: pointer; color: #909399; font-size: 18px; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.form-row { display: flex; align-items: flex-start; margin-bottom: 14px; }
.form-row label { width: 110px; text-align: right; padding: 8px 12px 0 0; color: #606266; flex-shrink: 0; }
.form-row label.req::before { content: '*'; color: #f56c6c; margin-right: 3px; }
.form-row .ctrl { flex: 1; }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.form-row textarea { min-height: 90px; font-family: Menlo, Consolas, monospace; font-size: 12px; }
.form-tip { font-size: 12px; color: #909399; margin-top: 4px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid #ebeef5; display: flex; justify-content: flex-end; gap: 10px; }

/* 二维码弹窗 */
.qr-area { text-align: center; padding: 8px 0 4px; }
.qr-loading { color: #909399; padding: 80px 0; }
.qr-tip, .qr-tips2 { font-size: 13px; color: #606266; margin-top: 10px; }
.qr-tips2 { color: #909399; font-size: 12px; }

/* 首页仪表盘（新版） */
.dash-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.dash-head .title { font-size: 17px; font-weight: 700; }
.dash-grid { display: grid; grid-template-columns: 1fr 240px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-main { min-width: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { background: #fff; border-radius: 12px; padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: 0 1px 3px rgba(16,42,100,.06); }
.kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.kpi-icon.blue { background: #ecf3ff; }
.kpi-icon.green { background: #e8f8ee; }
.kpi-icon.cyan { background: #e6f9f8; }
.kpi-icon.red { background: #feecec; }
.kpi-card .label { font-size: 12.5px; color: #909399; }
.kpi-card .num { font-size: 22px; font-weight: 700; color: #1f2d3d; margin-top: 2px; }
.kpi-card .num small { font-size: 13px; font-weight: 600; color: #606266; }

.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .dash-row { grid-template-columns: 1fr; } }
.dash-row .card { margin-bottom: 0; }

.recent-tbl td { padding: 9px 8px; }
.recent-tbl .amt { color: #1f2d3d; font-weight: 600; }
.recent-tbl .link-more { color: #2f6fed; font-size: 12.5px; cursor: pointer; }

.quick-card { padding: 16px; }
.quick-card .card-title { margin-bottom: 12px; }
.quick-btn { display: flex; align-items: center; gap: 9px; width: 100%; border: 1px solid #dce7fb; background: #f5f9ff; color: #2f6fed; border-radius: 8px; padding: 11px 14px; font-size: 13.5px; cursor: pointer; margin-bottom: 10px; transition: all .15s; text-align: left; }
.quick-btn:hover { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.quick-btn.primary { background: #2f6fed; border-color: #2f6fed; color: #fff; font-weight: 600; }
.quick-btn.primary:hover { background: #2563d8; }

/* 兼容旧首页组件（趋势图等） */
.dash-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.dash-icon-card { background: #fff; border-radius: 8px; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.dash-icon-card .icon { font-size: 34px; color: #e05454; }
.dash-icon-card .val { font-size: 20px; font-weight: 700; }

/* 登录 */
.login-mask { position: fixed; inset: 0; background: #1f2d3d; display: flex; align-items: center; justify-content: center; z-index: 200; }
.login-box { background: #fff; border-radius: 12px; padding: 36px; width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-title { text-align: center; font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.login-box input { padding: 11px 12px; }
.login-box button { background: #2f6fed; color: #fff; border: none; border-radius: 6px; padding: 11px; font-size: 15px; cursor: pointer; }
.login-err { color: #f56c6c; font-size: 13px; min-height: 18px; text-align: center; }
.login-links { text-align: right; font-size: 13px; margin-top: -6px; }
.login-links a { color: #2f6fed; text-decoration: none; }
.login-links a:hover { text-decoration: underline; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: #dcdfe6; border-radius: 22px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .2s; }
.switch input:checked + .slider { background: #2f6fed; }
.switch input:checked + .slider::before { transform: translateX(18px); }

.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: #303133; color: #fff; padding: 10px 20px; border-radius: 6px; font-size: 13px; z-index: 300; opacity: 0; transition: opacity .25s; }
.toast.show { opacity: .95; }
.toast.error { background: #f56c6c; }

.avatar-mini { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #eee; }
.empty-tip { text-align: center; color: #909399; padding: 30px 0; }

/* ---------- 用工档案 / 薪资批次 / 接口日志 ---------- */
.modal.wide { width: 920px; }
.op-cell { white-space: nowrap; }
.mini-tip { font-size: 11px; color: #909399; margin-top: 2px; }
.form-tip { font-size: 12px; color: #909399; line-height: 1.6; }
.muted { color: #a8abb2; font-size: 12.5px; }
tr.row-active td { background: #f2f7ff; }

/* 薪资明细表（弹窗内） */
.batch-items { border: 1px solid #ebeef5; border-radius: 8px; overflow: hidden; margin-top: 4px; }
.bi-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f7f9fc; border-bottom: 1px solid #ebeef5; font-size: 13px; font-weight: 600; color: #303133; }
.bi-table-wrap { max-height: 330px; overflow: auto; }
.tbl-sm { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl-sm th, .tbl-sm td { border-bottom: 1px solid #f0f2f5; padding: 6px 8px; text-align: left; white-space: nowrap; }
.tbl-sm thead th { background: #fafbfd; color: #606266; font-weight: 600; position: sticky; top: 0; z-index: 1; }
.tbl-sm input { width: 78px; padding: 4px 6px; border: 1px solid #dcdfe6; border-radius: 4px; font-size: 12.5px; }
.tbl-sm select { width: 100%; min-width: 150px; padding: 4px 6px; border: 1px solid #dcdfe6; border-radius: 4px; font-size: 12.5px; }
.tbl-sm .b-net { color: #2f6fed; }

/* 详情信息栅格 */
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 18px; padding: 4px 2px 12px; }
.detail-grid > div { display: flex; flex-direction: column; gap: 4px; }
.detail-grid span { color: #909399; font-size: 12px; }
.detail-grid b { font-size: 13.5px; color: #303133; }

/* 接口调用日志详情 */
.log-block { margin-top: 12px; }
.log-block .lb-title { font-size: 12.5px; color: #606266; font-weight: 600; margin-bottom: 5px; }
.log-block pre { background: #f7f9fc; border: 1px solid #ebeef5; border-radius: 6px; padding: 10px 12px; max-height: 220px; overflow: auto; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; margin: 0; font-family: Menlo, Consolas, monospace; }

/* ---------- 页脚备案信息 ---------- */
.site-footer { padding: 18px 24px 22px; text-align: center; font-size: 12.5px; color: #a0a6b1; line-height: 1.8; }
.site-footer .sep { margin: 0 6px; }
.site-footer a { color: #a0a6b1; text-decoration: none; }
.site-footer a:hover { color: #2f6fed; text-decoration: underline; }
.login-beian { text-align: center; font-size: 12px; color: #b6bcc7; margin-top: 2px; }
.login-beian a { color: #b6bcc7; text-decoration: none; }
.login-beian a:hover { color: #2f6fed; text-decoration: underline; }
