:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #1d4ed8;
  --brand-soft: #eef2ff;
  --ok: #059669;
  --watch: #b45309;
  --urgent: #c2410c;
  --danger: #b91c1c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef2ff, #f8fafc 60%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}
.login-card .brand { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.login-card .sub { color: var(--muted); margin-bottom: 22px; font-size: 13px; }

/* ---------- 布局 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .logo { font-weight: 700; font-size: 15px; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav button {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.nav button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav button:hover { background: #f3f4f6; }
.userchip { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.userchip .name { font-weight: 600; }
.tag-role { font-size: 12px; padding: 1px 7px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); }

main { padding: 20px; max-width: 1280px; margin: 0 auto; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat.red .num { color: var(--danger); }
.stat.orange .num { color: var(--urgent); }
.stat.yellow .num { color: var(--watch); }
.stat.green .num { color: var(--ok); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 13px; background: #fafbfc; position: sticky; top: 0; }
tbody tr:hover { background: #fafbff; }
td.actions { white-space: nowrap; }
td.actions button { margin-right: 6px; }

.table-wrap { overflow-x: auto; }

/* ---------- 标签 / 状态 ---------- */
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid transparent; }
.pill.ok { background: #ecfdf5; color: var(--ok); }
.pill.watch { background: #fffbeb; color: var(--watch); }
.pill.urgent { background: #fff7ed; color: var(--urgent); border-color: #fdba74; }
.pill.expired { background: #fef2f2; color: var(--danger); border-color: #fca5a5; font-weight: 600; }
.pill.closed, .pill.none { background: #f3f4f6; color: var(--muted); }
.pill.active { background: #ecfdf5; color: var(--ok); }
.pill.locked, .pill.disabled { background: #fef2f2; color: var(--danger); }

.row-urgent { background: #fffaf5; }
.row-expired { background: #fff6f6; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 140px; }
.hint { color: var(--muted); font-size: 12px; }

/* ---------- 按钮 ---------- */
button.btn, .btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
button.btn:hover { background: #f9fafb; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #1e40af; }
.btn.danger { color: var(--danger); border-color: #fca5a5; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { padding: 3px 9px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 100;
  overflow-y: auto;
}
.dialog {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .25);
}
.dialog.wide { max-width: 860px; }

/* ---------- 详情 ---------- */
.kv { display: grid; grid-template-columns: 96px 1fr 96px 1fr; gap: 6px 12px; font-size: 14px; }
.kv .k { color: var(--muted); }

.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 16px; }
.timeline .item { position: relative; padding-bottom: 16px; }
.timeline .item::before {
  content: ""; position: absolute; left: -23px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: #cbd5e1; border: 2px solid #fff;
}
.timeline .item.active::before { background: var(--ok); }
.timeline .item.expired::before { background: var(--danger); }
.timeline .item.terminated::before { background: var(--muted); }
.contract-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cat-tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 3px 12px; cursor: pointer; font-size: 13px; color: var(--muted);
}
.cat-tabs button.active { background: var(--brand-soft); border-color: #c7d2fe; color: var(--brand); }

.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.file-list li:last-child { border-bottom: 0; }

.notice { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.notice.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.notice.info { background: var(--brand-soft); border: 1px solid #c7d2fe; color: #3730a3; }
.notice.err { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 9px 18px; border-radius: 8px;
  z-index: 999; font-size: 14px; max-width: 90vw;
}
.toast.err { background: var(--danger); }
.toast.ok { background: #065f46; }

.empty { text-align: center; color: var(--muted); padding: 28px 0; }
.pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 12px; color: var(--muted); }

input[type=file] { padding: 5px 6px; font-size: 13px; }

@media (max-width: 720px) {
  .table-wrap table { min-width: 720px; }
  .grid2, .grid3, .kv { grid-template-columns: 1fr; }
  .topbar { gap: 10px; height: auto; padding: 8px 12px; flex-wrap: wrap; }
  main { padding: 12px; }
  .userchip .name { display: none; }
}

[v-cloak] { display: none !important; }
.mt6 { margin-top: 6px; }

/* ---------- 滑块验证码 ---------- */
.captcha-stage {
  position: relative;
  margin: 0 auto 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  user-select: none;
  touch-action: none;
}
.captcha-bg { display: block; }
.captcha-piece {
  position: absolute;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .35));
  pointer-events: none;
}
.slider {
  position: relative;
  height: 44px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.slider:active { cursor: grabbing; }
.slider-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #dbeafe, #bfdbfe);
  transition: width .05s;
}
.slider-handle {
  position: absolute; top: 3px; left: 0;
  width: 38px; height: 36px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .15);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-weight: 700;
  transition: left .05s;
}
.slider-handle.done { background: #ecfdf5; color: var(--ok); border-color: #6ee7b7; }
.slider-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted); pointer-events: none;
}

/* ---------- 密码可见切换 ---------- */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 40px; }
.pwd-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; padding: 6px;
  color: #9ca3af; display: flex; align-items: center; border-radius: 6px;
}
.pwd-eye:hover { color: #374151; background: #f3f4f6; }
.pwd-eye:focus-visible { outline: 2px solid #bfdbfe; outline-offset: 1px; }


/* ---------------- 看板分组 ---------------- */
.dash-group { margin-bottom: 18px; }
.group-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 8px 2px;
}
.group-head h2 { font-size: 14px; margin: 0; color: #1f2937; letter-spacing: .3px; }
.group-head .hint { font-size: 12px; }
a.stat { text-decoration: none; color: inherit; display: block; }
.stat.clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.stat.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(29,78,216,.12);
  border-color: #bfdbfe;
}
.stat.clickable:active { transform: translateY(0); }
a.pill { text-decoration: none; }
.pill.clickable-pill { cursor: pointer; }
.pill.clickable-pill:hover { filter: brightness(.94); }
