/* ========== 共享基础样式（HR 端 / 员工端通用） ========== */
:root {
  --bg: #f3f6f9; --card: #fff; --text: #1d2939; --muted: #667085; --faint: #98a2b3; --line: #e6eaf0; --line2: #f0f3f7;
  --pri: #0f9f74; --pri-d: #0b8761; --pri-l: #e6f7f0; --blue: #2f80ed; --blue-l: #eaf2fe;
  --purple: #7048e8; --purple-l: #f1edfd; --warn: #f08c00; --warn-l: #fff4e0; --red: #e5484d; --red-l: #fdecec;
  --gray-l: #f2f4f7; --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; color: var(--text); }
.btn:hover { background: #f8fafc; border-color: #d0d5dd; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.btn.pri:hover { background: var(--pri-d); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--red); border-color: #f5c2c4; }
.btn.danger.fill { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--gray-l); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn.lg { height: 46px; font-size: 16px; border-radius: 10px; padding: 0 20px; }
.btn.block { width: 100%; }

/* 徽标 */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 20px; white-space: nowrap; background: var(--gray-l); color: var(--muted); }
.badge.green { background: var(--pri-l); color: var(--pri-d); }
.badge.blue { background: var(--blue-l); color: #1d63c8; }
.badge.purple { background: var(--purple-l); color: var(--purple); }
.badge.warn { background: var(--warn-l); color: #b35c00; }
.badge.red { background: var(--red-l); color: #c4282d; }
.badge.dark { background: #1d2939; color: #fff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.green { background: var(--pri); } .dot.amber { background: var(--warn); } .dot.red { background: var(--red); } .dot.blue { background: var(--blue); }

/* 表单 */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field > label .req { color: var(--red); margin-left: 2px; }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(15, 159, 116, .12); }
.input.err { border-color: var(--red); }
.ferr { color: var(--red); font-size: 12px; margin-top: 4px; }
.hint { color: var(--faint); font-size: 12px; margin-top: 4px; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--pri); flex: none; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line2); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 0; }
.card-h h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-h .sub { color: var(--faint); font-size: 12px; font-weight: 400; }
.card-b { padding: 14px 16px 16px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .bold { font-weight: 700; }
.red-t { color: var(--red); } .green-t { color: var(--pri-d); } .warn-t { color: #b35c00; } .blue-t { color: var(--blue); }
.row { display: flex; align-items: center; gap: 8px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .between { justify-content: space-between; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--faint); padding: 28px 12px; font-size: 13px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }

/* 进度条 */
.bar { height: 6px; border-radius: 3px; background: var(--line2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--pri); border-radius: 3px; transition: width .4s; }
.bar.red > i { background: var(--red); } .bar.amber > i { background: var(--warn); }

/* 提示框 */
.alert { border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.alert.red { background: var(--red-l); color: #a61b20; } .alert.warn { background: var(--warn-l); color: #8f4a00; }
.alert.blue { background: var(--blue-l); color: #174ea6; } .alert.green { background: var(--pri-l); color: #08664a; }

/* Toast / Modal */
#toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #1d2939; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: tin .2s; max-width: 86vw; }
.toast.err { background: #c4282d; } .toast.ok { background: #0b8761; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }
.mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fin .15s; }
@keyframes fin { from { opacity: 0; } }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal.wide { max-width: 860px; }
.modal-h { padding: 16px 18px 10px; font-size: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.modal-b { padding: 4px 18px 12px; overflow: auto; }
.modal-f { padding: 12px 18px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line2); }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--faint); padding: 2px 6px; }
@media (max-width: 640px) {
  .mask.sheet { align-items: flex-end; padding: 0; }
  .mask.sheet .modal { border-radius: 16px 16px 0 0; max-height: 92vh; animation: sup .2s; }
  @keyframes sup { from { transform: translateY(40px); } }
}

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); background: #f8fafc; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tr:hover td { background: #fafbfc; }
.tbl-wrap { overflow-x: auto; }

.spin { width: 18px; height: 18px; border: 2px solid rgba(0,0,0,.12); border-top-color: var(--pri); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--faint); padding: 40px; }
.watermark { position: fixed; right: 10px; bottom: 6px; font-size: 11px; color: var(--faint); pointer-events: none; }
