:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e6e9ef;
  --line-strong: #d5dae3;
  --text: #1d2330;
  --text-2: #5b6474;
  --text-3: #8c95a4;
  --primary: #1668dc;
  --primary-hover: #0f57c2;
  --primary-soft: #e9f1ff;
  --green: #18794e;
  --green-soft: #e3f5ec;
  --red: #c4320a;
  --red-soft: #fdebe4;
  --orange: #9a5b00;
  --orange-soft: #fff3da;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .05), 0 4px 16px rgba(20, 30, 50, .04);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--primary); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.sub { color: var(--text-2); font-size: 13px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.gap-lg { gap: 20px; }

/* ---------- 外壳 ---------- */
.boot { padding: 80px; text-align: center; color: var(--text-3); }
.shell { display: flex; min-height: 100vh; }
.side {
  width: 200px; flex: none; background: #101828; color: #c9d1e0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 18px; font-size: 16px; font-weight: 600; color: #fff; }
.logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.side nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.side nav a { color: #c9d1e0; padding: 9px 12px; border-radius: 8px; }
.side nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.side nav a.on { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.side-foot { margin-top: auto; padding: 14px 18px 18px; font-size: 12.5px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot .mode { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #f5a524; flex: none; }
.dot.ok { background: #2fbf71; }
.dot.bad { background: #f0553a; }
.side-foot a { color: #9fb6e0; margin-left: 8px; }
.main { flex: 1; min-width: 0; }
.banner { background: var(--orange-soft); color: var(--orange); padding: 9px 28px; font-size: 13px; border-bottom: 1px solid #f3e1b5; }
.page { max-width: 1240px; margin: 0 auto; padding: 24px 28px 96px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; min-height: 36px; }
.page-head h1 { font-size: 20px; font-weight: 650; }
.back { color: var(--text-2); }

/* ---------- 基础控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: #b8c0cc; background: #fafbfc; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--red); border-color: #f0c4b6; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); padding: 0 8px; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.btn.lg { height: 40px; padding: 0 20px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, select.input, textarea.input {
  height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
  outline: none; width: 100%;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 64px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 104, 220, .14); }
.input.short { width: 76px; text-align: center; }
.input.mid { width: 220px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 20px; background: #eef0f4; color: var(--text-2); white-space: nowrap; }
.tag.blue { background: var(--primary-soft); color: var(--primary); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.orange { background: var(--orange-soft); color: var(--orange); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #c9cfd9; border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(22, 104, 220, .25); }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); margin: 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15px; font-weight: 650; position: relative; padding-left: 10px; }
.panel-head h2::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--primary); }
.panel-body { padding: 16px 18px; }
.field { display: flex; align-items: flex-start; gap: 14px; padding: 9px 0; }
.field > label.name, .field > .name { width: 108px; flex: none; color: var(--text-2); padding-top: 6px; }
.field > .ctl { flex: 1; min-width: 0; }
.req::after { content: " *"; color: var(--red); }
.hint { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.alert.warn { background: var(--orange-soft); color: #7a4700; }
.alert.err { background: var(--red-soft); color: #8f2506; }
.alert.info { background: var(--primary-soft); color: #0c4aa6; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.empty { padding: 56px 20px; text-align: center; color: var(--text-3); }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12.5px; padding: 9px 14px; background: #f8f9fb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl .r { text-align: right; }
.tbl td.dept { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl .act { white-space: nowrap; text-align: right; }
.tbl .act a + a { margin-left: 12px; }
.tbl-wrap { overflow: auto; }

/* ---------- 登录 ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 30px 30px 26px; }
.auth-box h1 { font-size: 20px; margin: 14px 0 4px; }
.auth-box .f { margin-top: 14px; }
.auth-box .f label { display: block; color: var(--text-2); font-size: 13px; margin-bottom: 5px; }
.auth-box .btn { width: 100%; margin-top: 20px; }

/* ---------- 列表 ---------- */
.progress { height: 6px; border-radius: 3px; background: #e9ecf2; overflow: hidden; width: 120px; }
.progress i { display: block; height: 100%; background: #2fbf71; }
.intro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px auto 26px; max-width: 760px; text-align: left; }
.intro div { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 14px; color: var(--text-2); font-size: 13px; }
.intro b { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- 向导 ---------- */
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 18px; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border-radius: 999px; background: #e9ecf2; color: var(--text-3); font-size: 13.5px; }
.steps li i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.steps li.can { cursor: pointer; color: var(--text-2); }
.steps li.on { background: var(--primary); color: #fff; font-weight: 600; }
.steps li.on i { color: var(--primary); }
.steps li.done i { background: var(--green-soft); color: var(--green); }
.save-state { color: var(--text-3); font-size: 12.5px; margin-left: auto; }

.drop { border: 2px dashed var(--line-strong); border-radius: 14px; background: #fff; padding: 56px 24px; text-align: center; transition: border-color .12s, background .12s; }
.drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop h2 { font-size: 17px; margin-bottom: 6px; }
.drop .btn { margin-top: 18px; }
.drop ul { display: inline-block; text-align: left; color: var(--text-2); font-size: 13px; margin: 18px 0 0; padding-left: 18px; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.facts div { color: var(--text-2); }
.facts b { color: var(--text); font-size: 15px; margin-right: 2px; }
.sheet { max-height: 430px; overflow: auto; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.sheet table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; min-width: 100%; }
.sheet th, .sheet td { padding: 6px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.sheet th { background: #f4f6fa; font-weight: 600; text-align: center; position: sticky; top: 0; z-index: 2; }
.sheet tr.leaf th { top: 31px; }
.sheet th.g { color: var(--text-2); }
.sheet td.n { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .stick { position: sticky; left: 0; z-index: 1; background: #fff; font-weight: 600; box-shadow: 1px 0 0 var(--line-strong); }
.sheet th.stick { z-index: 3; background: var(--primary-soft); color: var(--primary); }
.sheet td.rn, .sheet th.rn { color: var(--text-3); text-align: center; background: #f8f9fb; }
.sheet tr.hd td { background: #fff8e6; }
.sheet td.namecol { background: var(--primary-soft); }
.layout-form { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; margin-bottom: 14px; }
.layout-form label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.aside { position: sticky; top: 16px; }
.colbox { border: 1px solid var(--line); border-radius: 8px; max-height: 330px; overflow: auto; }
.colbox .grp { padding: 6px 12px; background: #f8f9fb; color: var(--text-2); font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.colbox label { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.colbox label:last-child { border-bottom: none; }
.colbox label:hover { background: #fafbfd; }
.colbox label.off span.nm { color: var(--text-3); }
.colbox .sv { margin-left: auto; color: var(--text-3); font-size: 12.5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colbox input { accent-color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-size: 12.5px; user-select: none; }
.chip.on { background: var(--primary-soft); border-color: #a9c8f7; color: var(--primary); }
.subset { background: #f8f9fb; border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.footbar {
  position: fixed; left: 200px; right: 0; bottom: 0; background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line); padding: 12px 28px; display: flex; align-items: center; gap: 12px; z-index: 20;
  backdrop-filter: blur(6px);
}
.footbar .count b { font-size: 17px; color: var(--primary); }

/* ---------- 手机预览与卡片 ---------- */
.pv-tools { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.seg { display: inline-flex; background: #e9ecf2; border-radius: 8px; padding: 2px; }
.seg button { border: none; background: transparent; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.phone { width: 320px; max-width: 100%; margin: 0 auto; border: 9px solid #1c2230; border-radius: 34px; background: #eef0f4; overflow: hidden; box-shadow: 0 12px 30px rgba(20, 30, 50, .18); }
.phone-bar { background: #fff; padding: 10px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13.5px; }
.phone-bar .av { width: 26px; height: 26px; border-radius: 7px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.phone-body { height: 520px; overflow-y: auto; padding: 12px 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.phone-body.fit { height: auto; max-height: 560px; }
.pcard { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(20, 30, 50, .08); font-size: 13px; flex: none; }
.pcard-top { background: var(--orange-soft); color: #7a4700; padding: 6px 12px; font-size: 12px; }
.pcard-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 4px; font-weight: 650; font-size: 14.5px; }
.pcard-head .ic { width: 22px; height: 22px; border-radius: 6px; background: #f5b83d; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.pcard-care, .pcard-desc { padding: 4px 12px 0; color: var(--text-2); }
.pcard-care { color: var(--text); }
.pcard-net { margin: 10px 12px 4px; padding: 12px; border-radius: 10px; background: linear-gradient(135deg, #1668dc, #3d8bf2); color: #fff; }
.pcard-net .l { font-size: 12px; opacity: .85; }
.pcard-net .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.pcard-grp { padding: 2px 12px 0; }
.pcard-grp + .pcard-grp { margin-top: 6px; padding-top: 4px; border-top: 6px solid #f4f6f9; }
.pcard-grp .g { margin-top: 6px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.pcard-grp .it { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f0f2f5; }
.pcard-grp .it:last-child { border-bottom: none; }
.pcard-grp .it span { color: var(--text-2); }
.pcard-grp .it b { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.pcard-note { margin: 8px 12px 0; padding: 8px 10px; border-radius: 8px; background: var(--orange-soft); color: #7a4700; font-size: 12.5px; }
.pcard-status { margin: 10px 12px 0; color: var(--green); font-weight: 600; }
.pcard-tip { margin: 10px 12px 0; padding: 6px 10px; border-left: 3px solid #d5dae3; color: var(--text-3); font-size: 12px; }
.pcard-btns { display: flex; gap: 8px; padding: 12px; }
.pcard-btns button { flex: 1; height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; }
.pcard-btns button.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pcard-btns button:disabled { cursor: default; }
.pcard-pad { height: 12px; }
.bubble { align-self: flex-start; max-width: 86%; background: #fff; border-radius: 4px 12px 12px 12px; padding: 8px 11px; font-size: 13px; box-shadow: 0 1px 2px rgba(20, 30, 50, .06); white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: #cfe2ff; border-radius: 12px 4px 12px 12px; }
.phone-input { display: flex; gap: 6px; padding: 8px; background: #fff; border-top: 1px solid var(--line); }
.phone-input .input { height: 32px; }
.quick { display: flex; gap: 6px; padding: 6px 8px 0; background: #fff; flex-wrap: wrap; }

/* ---------- 详情 ---------- */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .k { color: var(--text-2); font-size: 12.5px; }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); }
.tabs button { border: none; background: none; padding: 8px 12px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.fb { color: var(--orange); font-size: 12.5px; max-width: 260px; }

/* ---------- 模拟员工端 ---------- */
.mock { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.people { max-height: 640px; overflow: auto; }
.people a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.people a:hover { background: #fafbfd; text-decoration: none; }
.people a.on { background: var(--primary-soft); }
.people .av { width: 32px; height: 32px; border-radius: 8px; background: #dfe6f3; color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }

/* ---------- 弹窗与提示 ---------- */
.mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 440px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(16, 24, 40, .3); }
.modal-head { padding: 18px 22px 0; font-size: 16px; font-weight: 650; }
.modal-body { padding: 12px 22px 4px; overflow: auto; color: var(--text-2); }
.modal-body .f { margin-top: 10px; }
.modal-foot { padding: 16px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #101828; color: #fff; padding: 9px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(16, 24, 40, .25); font-size: 13.5px; max-width: 520px; }
.toast.err { background: #b42318; }

@media (max-width: 1080px) {
  .split { grid-template-columns: 1fr; }
  .aside { position: static; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .mock { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .side { display: none; }
  .footbar { left: 0; }
  .page { padding: 16px 14px 96px; }
}
