:root {
  --ink: #292520;
  --muted: #746a60;
  --line: #e5ded3;
  --bg: #f6f3ed;
  --card: #ffffff;
  --primary: #a95722;
  --primary-dark: #7c3a11;
  --primary-soft: #f8eee3;
  --accent: #b2761f;
  --danger: #b4392e;
  --ok: #2f7d57;
  --side: #25211e;
  --side-deep: #171411;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; height: 100vh; overflow: hidden; }

/* 侧边导航：石墨暖黑 + 铜橙 */
.sidebar {
  width: 200px;
  flex: 0 0 200px;
  background: linear-gradient(180deg, var(--side) 0%, var(--side-deep) 100%);
  color: #c7c0b7;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 12px rgba(18, 14, 11, .2);
}

.brand {
  display: flex; flex-direction: column; align-items: stretch; gap: 9px;
  padding: 14px 10px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: inherit;
}
.brand:hover { text-decoration: none; }
.brand-plate { display: block; padding: 3px 0 0; }
.brand-plate img { display: block; width: 140px; height: auto; filter: hue-rotate(190deg) saturate(.9) brightness(.9); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; padding-left: 2px; }
.brand-text b { color: #f3ede6; font-size: 14px; font-weight: 700; letter-spacing: 1.2px; }
.brand-text em {
  color: #958b80; font-style: normal; font-size: 10.5px; letter-spacing: .6px;
  margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar nav { flex: 1; overflow-y: auto; padding: 9px 10px 8px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  height: 39px; padding: 0 11px; margin-bottom: 2px; border-radius: 8px;
  color: #c7c0b7; font-size: 13.5px; position: relative;
  transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #f4efe8; text-decoration: none; }
.sidebar nav a.active { background: rgba(177, 92, 42, .3); color: #fff; }
.sidebar nav a.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: #e08a4b;
}
.sidebar nav a .ico { flex: none; opacity: .82; }
.sidebar nav a.active .ico { opacity: 1; }
.sidebar nav a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar nav .group { padding: 10px 10px 5px; font-size: 10.5px; color: #8b8178; letter-spacing: 1.1px; }

.side-foot { padding: 12px 12px 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px 8px; }
.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(208, 133, 76, .18); border: 1px solid rgba(208, 133, 76, .34);
  color: #f3ddca; font-size: 13px; display: grid; place-items: center;
}
.su-info { min-width: 0; display: flex; flex-direction: column; }
.su-info b { color: #f0eae3; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-info em { margin-top: 2px; color: #a2978c; font-style: normal; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-logout {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; margin-top: 4px; border-radius: 7px;
  color: #a79b90; font-size: 12px; background: rgba(255, 255, 255, .04);
}
.side-logout:hover { color: #f4efe8; background: rgba(255, 255, 255, .09); text-decoration: none; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line);
}
.page-head h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: .3px; color: var(--ink); }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.page-scroll { flex: 1; overflow-y: auto; padding: 18px 24px 28px; }

.flashes { padding: 0 24px; }
.flash {
  margin: 12px 0 0; padding: 9px 12px; border-radius: 8px; font-size: 13px;
  border-left: 4px solid var(--primary); background: var(--primary-soft);
}
.flash.error { border-color: var(--danger); background: #fbeeec; }
.flash.warn { border-color: var(--accent); background: #fdf4e6; }
.flash.success { border-color: var(--ok); background: #ecf6ef; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 7px 14px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-wecom { background: #07c160; border-color: #07c160; color: #fff; }
.btn-wecom:hover { background: #06ad56; border-color: #06ad56; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(60, 48, 35, .04); }
.card-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card-head h2 { margin: 0; font-size: 15px; }
.card-head .tip { color: var(--muted); font-size: 12px; }
.card-body { padding: 16px; }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kpi { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(60, 48, 35, .04); }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { margin-top: 8px; font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.kpi .unit { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.kpi.alert .value { color: var(--danger); }

/* 列表页：搜索栏固定、表头吸顶、表格内部滚动、分页常驻 */
.list-page { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 24px 0; }

.search-bar {
  flex: 0 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.search-bar .field { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.search-bar label { color: var(--muted); font-size: 12.5px; white-space: nowrap; flex: 0 0 auto; }
.search-bar .spacer { flex: 1; }
.equipment-search { gap: 8px; }
.equipment-search #q { width: 220px; }
.equipment-search #category { width: 130px; }
.equipment-search #workshop { width: 92px; }
.equipment-search #dept { width: 148px; }
.equipment-search #level, .equipment-search #state { width: 78px; }
.equipment-search #size { width: 70px; }
.equipment-search .btn { padding-left: 14px; padding-right: 14px; }

.table-wrap {
  flex: 1 1 auto; min-height: 0; margin-top: 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; overflow-y: scroll; overflow-x: auto;
}
.table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.table-wrap::-webkit-scrollbar-thumb { background: #c8c1b8; border-radius: 6px; }
.table-wrap::-webkit-scrollbar-track { background: #f3ede4; }

table { width: 100%; border-collapse: collapse; }
thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f3ede4; color: #45403a; font-weight: 600; font-size: 12.5px;
  text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid #efe9e0; font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #faf7f2; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; color: #413a32; }

.pager {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 10px 4px 12px; color: var(--muted); font-size: 12.5px;
}
.pager .left { display: flex; gap: 10px; align-items: center; }
.pager .pages { display: flex; gap: 6px; align-items: center; }
.pager a, .pager span.pg {
  min-width: 30px; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center; background: #fff; font-size: 12.5px;
}
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.pager span.pg.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 状态徽标 */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.st-wait { background: #fdf1dd; color: #96601a; }
.st-run { background: #e7f2ea; color: #2e7a52; }
.st-check { background: #f3edf7; color: #76558a; }
.st-done { background: #e6f4eb; color: #1c6b44; }
.st-back { background: #f1ede6; color: #6a6157; }
.st-hold { background: #f2ecf7; color: #6d4b8a; }
.st-out { background: #fdeae7; color: #a8392b; }

.level-tag { display: inline-block; padding: 2px 7px; border-radius: 3px; font-size: 11.5px; background: #f3ede4; color: #5b544b; }
.category-tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11.5px; background: #f6efe6; color: #5b4a3a; border: 1px solid #e6d7c6; }
.level-A { background: #fdeae7; color: #a8392b; }
.level-B { background: #fdf1dd; color: #96601a; }
.level-C { background: #f1eee8; color: #5b544b; }

.badge-due { background: var(--danger); color: #fff; }

/* 表单 */
.form-grid { display: grid; gap: 14px 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field-block label { display: block; margin-bottom: 6px; color: #4c453d; font-size: 12.5px; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px;
  font-family: inherit; font-size: 13px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(169, 87, 34, .13); }
textarea { min-height: 84px; resize: vertical; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.form-actions { margin-top: 16px; display: flex; gap: 10px; }

/* 详情 */
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; }
.detail-grid .item .k { color: var(--muted); font-size: 12px; }
.detail-grid .item .v { margin-top: 3px; font-size: 13.5px; }

.steps { display: flex; gap: 0; margin: 6px 0 2px; }
.step { flex: 1; position: relative; padding: 0 8px 0 22px; border-left: 3px solid #e9e1d6; }
.step:first-child { border-left-color: var(--primary); }
.step.done { border-left-color: var(--ok); }
.step .name { font-weight: 600; font-size: 13px; }
.step .time { color: var(--muted); font-size: 12px; margin-top: 2px; }
.step.late { border-left-color: var(--danger); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #e9e1d6; }
.timeline li { position: relative; padding: 0 0 18px 16px; }
.timeline li::before {
  content: ""; position: absolute; left: -23px; top: 3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
}
.timeline .t-head { display: flex; gap: 10px; align-items: baseline; }
.timeline .t-action { font-weight: 600; }
.timeline .t-time { color: var(--muted); font-size: 12px; }
.timeline .t-note { color: #4d463e; font-size: 12.5px; margin-top: 3px; }

.kv-list { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv-list .k { color: var(--muted); }

.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; }

.inline-form { display: inline; }

.empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

.stat-strip { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.stat-strip b { color: var(--ink); font-size: 15px; }

.notice { padding: 10px 14px; border-radius: 6px; background: #fdf4e6; border: 1px solid #f2ddb6; color: #7a5518; font-size: 12.5px; }
.notice.info { background: #faf1e6; border-color: #ecdcc9; color: #7a3e12; }

.table-actions { display: flex; gap: 8px; white-space: nowrap; }
.link-btn { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-size: 12.5px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }


/* 登录页：参照 EIMS 左右分栏 */
.login-page {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 36px 24px;
  background:
    radial-gradient(circle at 14% 18%, rgba(177, 100, 52, .14) 0, rgba(177, 100, 52, 0) 42%),
    radial-gradient(circle at 86% 82%, rgba(83, 66, 52, .12) 0, rgba(83, 66, 52, 0) 40%),
    linear-gradient(145deg, #faf6f0 0%, #f5f1ea 52%, #eee8de 100%);
}

.login-shell {
  width: 100%; max-width: 900px; min-height: 520px;
  display: grid; grid-template-columns: 1.05fr .95fr;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(64, 48, 34, .14), 0 2px 6px rgba(64, 48, 34, .04);
}

.login-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 44px 100px;
  background: linear-gradient(158deg, #fffdf9 0%, #f9f1e7 58%, #eee2d3 100%);
  color: #3b2d22;
}
.login-brand::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #b85f27 0%, #8a3b12 60%, rgba(138, 59, 18, 0) 100%);
}
.login-brand::after {
  content: ""; position: absolute; right: -80px; bottom: -100px;
  width: 280px; height: 280px; border-radius: 50%;
  border: 1px solid rgba(176, 92, 45, .16);
  background: radial-gradient(circle at 32% 32%, rgba(176, 92, 45, .07), rgba(176, 92, 45, 0) 70%);
}
.login-brand-main { position: relative; z-index: 1; }
.login-logo { width: 208px; max-width: 100%; height: auto; display: block; filter: hue-rotate(190deg) saturate(.9) brightness(.9); }
.login-brand h1 { margin: 26px 0 0; font-size: 22px; line-height: 1.4; font-weight: 700; letter-spacing: 1.3px; color: #3b2d22; }
.login-rule { display: block; width: 58px; height: 2px; margin-top: 28px; background: #b85f27; }
.login-brand-foot { position: absolute; z-index: 1; left: 44px; right: 44px; bottom: 40px; margin: 0; }
.login-brand-foot span { display: block; color: #9c8a78; font-size: 12px; letter-spacing: .3px; }
.login-brand-foot small { display: block; margin-top: 3px; color: #bba895; font-size: 11px; letter-spacing: .5px; }

.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px 44px; background: #fff; }
.login-panel-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .6px; color: var(--ink); }

.login-alert {
  margin: 18px 0 0; padding: 10px 12px; border-radius: 8px;
  background: #fbeeec; border: 1px solid #f3d2cc; color: #9a3326; font-size: 12.5px;
}
.login-alert.warn { background: #fdf4e6; border-color: #f0dfbd; color: #7a5518; }

.login-form { display: flex; flex-direction: column; gap: 15px; margin-top: 22px; }
.login-field { display: flex; flex-direction: column; gap: 7px; }
.login-field span { color: #6f6256; font-size: 12px; letter-spacing: .4px; }
.login-field input {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 9px; background: #fbf9f5;
  color: var(--ink); font: inherit; font-size: 14px; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.login-field input::placeholder { color: #b0a294; }
.login-field input:focus {
  border-color: #c0632b; background: #fff;
  box-shadow: 0 0 0 3px rgba(176, 92, 45, .14);
}
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-check { display: inline-flex; align-items: center; gap: 7px; color: #6f6256; font-size: 12.5px; cursor: pointer; }
.login-check input { width: 15px; height: 15px; margin: 0; accent-color: #a95722; }
.login-tip { color: #a29486; font-size: 11.5px; }
.login-submit {
  height: 44px; margin-top: 4px; border: 0; border-radius: 9px;
  background: linear-gradient(135deg, #bb632b 0%, #8a3b12 100%);
  color: #fff; font: inherit; font-size: 14px; font-weight: 600; letter-spacing: 1px;
  cursor: pointer; box-shadow: 0 8px 18px rgba(126, 55, 18, .2);
}
.login-submit:hover { background: linear-gradient(135deg, #a95722 0%, #742f0b 100%); }

.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: #b0a294; font-size: 11px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: #ece4db; }
.login-divider span { letter-spacing: 1px; }

.login-wecom {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 42px; border: 1px solid #d6e5dc; border-radius: 9px;
  background: #f4f8f5; color: #2f6b50; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.login-wecom:hover { background: #ebf4ef; border-color: #c2d9cb; color: #2f6b50; text-decoration: none; }

/* 企业微信扫码登录弹窗 */
.login-qr-mask {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(23, 20, 17, .56);
  backdrop-filter: blur(3px);
}
.login-qr-mask[hidden] { display: none; }
.login-qr-dialog {
  position: relative; width: 334px; max-width: 100%;
  padding: 28px 24px 24px; border-radius: 16px; background: #fff;
  box-shadow: 0 28px 70px rgba(35, 25, 16, .28);
  text-align: center;
}
.login-qr-dialog h3 {
  margin: 0; color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: .6px;
}
.login-qr-frame {
  position: relative; width: 196px; height: 196px;
  margin: 22px auto 0; padding: 8px; border: 1px solid var(--line); border-radius: 9px;
  background: #fbf9f5; display: flex; align-items: center; justify-content: center;
}
.login-qr-image { display: block; width: 178px; height: 178px; }
.login-qr-loading { color: #a29486; font-size: 12px; letter-spacing: .3px; }
.login-qr-tip { margin: 18px 0 0; color: var(--muted); font-size: 12.5px; }
.login-qr-status { margin: 7px 0 0; min-height: 17px; color: #938579; font-size: 11.5px; }
.login-qr-status.is-ok { color: var(--ok); }
.login-qr-status.is-error { color: var(--danger); }
.login-qr-refresh {
  margin-top: 14px; height: 34px; padding: 0 16px;
  border: 1px solid #d8cbbd; border-radius: 7px; background: #fff;
  color: var(--primary-dark); font: inherit; font-size: 12.5px; cursor: pointer;
}
.login-qr-refresh:hover { background: var(--primary-soft); border-color: #c08a65; }
.login-qr-close {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: transparent; color: #a29486;
  font-size: 20px; line-height: 1; cursor: pointer;
}
.login-qr-close:hover { color: var(--primary-dark); background: var(--primary-soft); }

/* 打印标签 */
.label-sheet { display: flex; gap: 18px; flex-wrap: wrap; }
.device-label { width: 300px; border: 1px solid #9b9289; border-radius: 6px; padding: 12px; background: #fff; display: flex; gap: 12px; }
.device-label .qr img { width: 100px; height: 100px; }
.device-label .info { flex: 1; font-size: 12px; line-height: 1.5; }
.device-label .info strong { display: block; font-size: 13px; margin-bottom: 2px; }

/* 提报层级人员选择器 */
.staff-picker { position: relative; width: 100%; max-width: 460px; }
.staff-picker-trigger {
  width: 100%; min-height: 44px; padding: 8px 28px 8px 10px; border: 1px solid var(--line);
  border-radius: 5px; background: #fff; color: var(--ink); font: inherit; text-align: left;
  cursor: pointer; display: flex; align-items: center;
}
.staff-picker-trigger:hover, .staff-picker-trigger[aria-expanded="true"] { border-color: var(--primary); }
.staff-picker-current { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.staff-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; width: 100%; }
.sp-field { display: flex; align-items: baseline; gap: 4px; min-width: 0; font-size: 12px; line-height: 1.45; }
.sp-field em { flex: none; font-style: normal; color: #8b8278; font-size: 11px; }
.sp-field > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-picker-placeholder { color: #8b8278; font-size: 12.5px; }
.staff-picker-caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #8b8278; font-size: 13px; pointer-events: none; }
.staff-picker-panel {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 40; width: 100%; min-width: 0;
  padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  box-shadow: 0 10px 28px rgba(30, 25, 20, .16);
}
.staff-picker-search { width: 100%; height: 34px; padding: 6px 10px; font-size: 12.5px; }
.staff-picker-list { max-height: 262px; margin-top: 7px; overflow-y: auto; }
.staff-picker-option {
  display: block; width: 100%; padding: 8px 9px; border: 0; border-radius: 5px;
  background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.staff-picker-option:hover, .staff-picker-option.selected { background: #f6efe6; }
.staff-picker-option.selected .sp-field em { color: var(--primary); }
.staff-picker-option[hidden], .staff-picker-empty[hidden], .staff-picker-panel[hidden] { display: none !important; }
.staff-picker-empty { padding: 14px 8px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* 员工档案：组织架构层级视图 */
.org-tree-toolbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding: 0 2px;
}
.org-tree-stat { color: var(--muted); font-size: 12.5px; }
.org-tree-stat b { color: #3d332a; }
.org-tree-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.org-tree-wrap {
  flex: 1 1 auto; min-height: 0; margin: 10px 0 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; overflow: auto;
}
.org-tree-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.org-tree-wrap::-webkit-scrollbar-thumb { background: #c8c1b8; border-radius: 6px; }
.org-tree-wrap::-webkit-scrollbar-track { background: #f3ede4; }
.org-tree {
  min-width: 1200px;
  --org-columns: minmax(360px, 460px) minmax(110px, .8fr) minmax(55px, .4fr) minmax(120px, .9fr)
                 minmax(110px, .8fr) minmax(95px, .7fr) minmax(82px, .55fr) minmax(105px, .75fr)
                 minmax(150px, 1fr);
}
.org-tree-head {
  position: sticky; top: 0; z-index: 3; display: grid;
  grid-template-columns: var(--org-columns);
  background: #f3ede4; border-bottom: 1px solid var(--line);
  color: #45403a; font-weight: 600; font-size: 12.5px;
}
.org-tree-head > span { padding: 11px 10px; white-space: nowrap; }
.org-tree-head > .org-head-main {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); padding: 0;
}
.org-head-main > span { padding: 11px 10px; white-space: nowrap; }
.org-head-main > .org-head-employee { padding-left: 12px; }
.org-row {
  display: grid;
  grid-template-columns: var(--org-columns);
  align-items: center; border-bottom: 1px solid #efe9e0; font-size: 13px;
}
.org-row:hover { background: #faf7f2; }
.org-dept-row { background: #faf7f2; cursor: pointer; }
.org-dept-row:hover { background: #f8f3eb; }
.org-main { display: flex; align-items: center; min-width: 0; padding: 9px 10px 9px 12px; }
.org-emp-main {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
}
.org-emp-gutter { display: flex; align-items: center; min-width: 0; }
.org-indent { flex: none; height: 1px; }
.org-toggle {
  flex: none; width: 18px; height: 22px; padding: 0; border: 0; background: transparent;
  color: #635b52; font-size: 14px; line-height: 22px; cursor: pointer; text-align: center;
}
.org-toggle-icon { display: inline-block; }
.org-branch { flex: none; margin-right: 4px; color: #a29a92; font-family: Consolas, monospace; }
.org-emp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-dept-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #3d332a; }
.org-dept-meta {
  grid-column: 2 / -1; display: flex; align-items: center; gap: 16px;
  min-width: 0; padding: 9px 10px; color: #756d65; font-size: 12px;
}
.org-dept-meta b { color: #3d332a; font-weight: 600; }
.org-hit { color: var(--primary); }
.org-cell {
  min-width: 0; padding: 9px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #413a32;
}
.org-cell.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.org-actions { padding: 7px 10px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.org-actions form { display: inline; margin: 0; }
.org-actions a { color: var(--primary); }
.org-actions .link-btn { padding: 0; border: 0; background: transparent; color: var(--primary); cursor: pointer; font: inherit; }
.org-children[hidden] { display: none !important; }
.org-empty { padding: 56px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* 权限角色 */
.role-layout { display: grid; grid-template-columns: 318px minmax(0, 1fr); gap: 14px; align-items: start; }
.role-list { display: flex; flex-direction: column; }
.role-item {
  display: block; padding: 12px 14px; border-bottom: 1px solid #efe9e0;
  color: var(--ink); text-decoration: none;
}
.role-item:last-child { border-bottom: 0; }
.role-item:hover { background: #fbf8f3; text-decoration: none; }
.role-item.active { background: #f6efe6; box-shadow: inset 3px 0 0 var(--primary); }
.role-item-main { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.role-item-main strong { font-size: 13.5px; }
.role-item-main .mono { color: var(--muted); font-size: 11.5px; }
.role-item-meta { margin-top: 5px; }
.role-item-meta .badge { background: #f3ede4; color: #655d54; }
.role-item-remark { margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.role-new { padding: 14px; border-top: 1px solid var(--line); background: #fdfaf6; }
.role-new h3 { margin: 0 0 12px; font-size: 13px; color: #413a32; }
.role-new .form-grid { grid-template-columns: 1fr; gap: 10px; }

.perm-groups { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.perm-group { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.perm-group h3 {
  margin: 0; padding: 9px 12px; font-size: 12.5px; color: #45403a;
  background: #f8f4ee; border-bottom: 1px solid var(--line);
}
.perm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.perm-option {
  display: flex; align-items: flex-start; gap: 7px; padding: 9px 12px;
  border-right: 1px solid #efe9e0; border-bottom: 1px solid #efe9e0;
  font-size: 12.5px; line-height: 1.35; cursor: pointer;
}
.perm-option:nth-child(3n) { border-right: 0; }
.perm-option:hover { background: #faf7f2; }
.perm-option input { flex: none; margin-top: 2px; }
.perm-option span { min-width: 0; }
.perm-option small { display: block; margin-top: 2px; color: #a29a92; font-size: 10.5px; font-family: Consolas, monospace; }
.perm-option input:disabled + span { color: #756d65; }

.role-users-table { min-width: 1010px; }
.role-check-cell { min-width: 360px; }
.role-check {
  display: inline-flex; align-items: center; gap: 4px; margin: 2px 8px 2px 0;
  font-size: 12px; white-space: nowrap; cursor: pointer;
}
.role-check input { margin: 0; }

@media (max-width: 1480px) {
  .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perm-option:nth-child(3n) { border-right: 1px solid #efe9e0; }
  .perm-option:nth-child(2n) { border-right: 0; }
}

@media (max-width: 1100px) {
  .role-layout { grid-template-columns: 1fr; }
}

/* 提报层级设置 */
.scope-card { margin-bottom: 0; }
.scope-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
}
.scope-row > label { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.scope-row select {
  min-width: 300px; height: 36px; padding: 5px 10px; border: 1px solid var(--line);
  border-radius: 5px; background: #fff; color: var(--ink); font: inherit;
}
.scope-row .hint { margin: 0; }
.level-empty { padding: 18px 14px; border-top: 1px solid var(--line); }
.level-empty .empty { padding: 16px 4px; text-align: center; color: var(--muted); font-size: 12.5px; }
.level-empty-card { max-width: 760px; }
.level-empty-body { display: flex; gap: 18px; align-items: flex-start; padding: 24px 22px 22px; }
.level-empty-mark {
  flex: none; width: 48px; height: 48px; border: 1px solid #ecdcc9; border-radius: 8px;
  background: #fbf5ed; color: var(--primary); font-family: Consolas, "Courier New", monospace;
  font-size: 22px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.level-empty-text { min-width: 0; }
.level-empty-text h3 { margin: 0 0 7px; font-size: 15px; color: var(--ink); }
.level-empty-text p { margin: 0 0 14px; color: #5a524a; font-size: 13px; line-height: 1.7; }
.level-empty-text .hint { margin: 10px 0 0; }
.level-dept-clear { padding: 0 14px 16px; }
.level-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.level-side { overflow: hidden; }
.level-list { display: flex; flex-direction: column; }
.level-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
  border-bottom: 1px solid #efe9e0; color: var(--ink); text-decoration: none;
}
.level-item:hover { background: #fbf8f3; text-decoration: none; }
.level-item.active { background: #f6efe6; box-shadow: inset 3px 0 0 var(--primary); }
.level-no {
  flex: none; width: 24px; height: 24px; border-radius: 4px; background: #f0e8de;
  color: #5a4a3a; font-family: Consolas, "Courier New", monospace; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.level-item.active .level-no { background: var(--primary); color: #fff; }
.level-item-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.level-item-main strong { font-size: 13px; line-height: 1.35; word-break: break-all; }
.level-item-main small { color: var(--muted); font-size: 11px; }
.level-add { padding: 14px; border-top: 1px solid var(--line); background: #fdfaf6; }
.level-add-title { margin-bottom: 10px; color: #413a32; font-size: 12.5px; font-weight: 600; }
.level-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.level-add .field-block, .level-add label { margin-bottom: 9px; }
.level-add label { display: block; color: #4c453d; font-size: 12px; }
.level-add label input { margin-top: 4px; }
.level-add .btn-block { margin-top: 4px; }
.btn-block { width: 100%; justify-content: center; }

.level-form-grid { display: grid; grid-template-columns: 1.5fr .7fr .9fr; gap: 13px 16px; }
.level-form-grid .span-3 { grid-column: 1 / -1; }
.level-checkbox { min-height: 34px; }
.level-section-head {
  margin-top: 22px; padding-top: 17px; border-top: 1px solid #efe9e0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.level-section-head h3 { margin: 0; color: #413a32; font-size: 13px; }
.level-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.receiver-head { margin-top: 20px; }
.receiver-head-actions { flex: none; display: flex; align-items: center; gap: 10px; }
.receiver-summary { flex: none; color: var(--primary); font-size: 13px; font-weight: 600; }
.receiver-summary span { font-family: Consolas, "Courier New", monospace; font-size: 16px; }
.receiver-selected-box {
  margin-top: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px;
  background: #fdfaf6; display: flex; align-items: flex-start; gap: 10px;
}
.receiver-selected-title { flex: none; color: #7a736a; font-size: 12px; line-height: 24px; }
.receiver-chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; max-height: 84px; overflow-y: auto; }
.receiver-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 2px 6px 2px 8px;
  border: 1px solid #e6d7c6; border-radius: 4px; background: #fff; color: #5b4a3a;
  font-size: 12px; line-height: 18px;
}
.receiver-chip-main { font-weight: 600; white-space: nowrap; }
.receiver-chip-dept { color: #7f776e; font-size: 11.5px; white-space: nowrap; }
.receiver-chip-dept::before { content: "·"; margin-right: 4px; color: #aaa39b; }
.receiver-chip-remove {
  border: 0; background: none; padding: 0 0 0 2px; color: #8b8278; cursor: pointer;
  font: inherit; font-size: 14px; line-height: 1;
}
.receiver-chip-remove:hover { color: var(--danger); }
.receiver-none { color: #8b8278; font-size: 12px; line-height: 24px; }
.receiver-picker[hidden] { display: none !important; }
.robot-grid { display: grid; grid-template-columns: 240px minmax(280px, 1fr) 190px; gap: 13px 16px; align-items: start; margin-top: 13px; }
.robot-url-field .mono { word-break: break-all; }
.robot-switch { display: flex; flex-direction: column; gap: 9px; padding-top: 24px; }
.clear-robot { color: var(--danger); font-size: 12px; }

.receiver-picker { margin-top: 8px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.receiver-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 190px auto auto; gap: 9px; padding: 9px 10px; background: #fdfaf6; border-bottom: 1px solid var(--line); }
.receiver-toolbar input[type=search] {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px;
  font-family: inherit; font-size: 13px; background: #fff;
}
.receiver-list-head {
  display: grid; grid-template-columns: 92px 1.2fr .8fr 1fr 1.2fr; gap: 10px;
  padding: 7px 12px 7px 46px; color: #7f776e; background: #f8f4ee;
  border-bottom: 1px solid var(--line); font-size: 11.5px;
}
.receiver-list { max-height: 210px; overflow-y: auto; scrollbar-gutter: stable; }
.receiver-row {
  display: grid; grid-template-columns: 24px 92px 1.2fr .8fr 1fr 1.2fr; gap: 10px; align-items: center;
  padding: 6px 12px; border-bottom: 1px solid #f2ece4; font-size: 12.5px; cursor: pointer;
}
.receiver-row:hover { background: #fcf9f4; }
.receiver-row[hidden], .receiver-empty[hidden] { display: none !important; }
.receiver-row input[type=checkbox] { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.receiver-no, .receiver-dept, .receiver-name, .receiver-pos, .receiver-wecom {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.receiver-no { color: #544d46; font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.receiver-name { color: #413a32; font-weight: 600; }
.receiver-dept, .receiver-pos { color: #544d46; }
.receiver-wecom.on { color: var(--ok); font-family: Consolas, "Courier New", monospace; font-size: 11.5px; }
.receiver-wecom.off { color: #aaa39b; font-size: 11.5px; }
.receiver-empty { padding: 20px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }
.receiver-footer { padding: 7px 12px; border-top: 1px solid #efe9e0; background: #fdfaf6; color: var(--muted); font-size: 11.5px; }
.receiver-footer span { font-family: Consolas, "Courier New", monospace; color: #413a32; }
.level-actions { border-top: 1px solid #efe9e0; padding-top: 14px; }
.level-delete-form { margin-top: 10px; padding-top: 12px; border-top: 1px dashed #efe9e0; display: flex; align-items: center; gap: 10px; }

@media (max-width: 1300px) {
  .level-layout { grid-template-columns: 270px minmax(0, 1fr); }
  .robot-grid { grid-template-columns: 210px minmax(0, 1fr); }
  .robot-switch { grid-column: 1 / -1; padding-top: 0; flex-direction: row; gap: 18px; }
}

@media (max-width: 1100px) {
  .role-layout { grid-template-columns: 1fr; }
  .level-layout { grid-template-columns: 1fr; }
  .level-form-grid { grid-template-columns: 1fr 1fr; }
  .level-form-grid .span-3 { grid-column: 1 / -1; }
  .receiver-toolbar { grid-template-columns: 1fr 180px; }
  .receiver-list-head { display: none; }
  .receiver-row { grid-template-columns: 24px 80px 1fr 1fr; }
  .receiver-pos, .receiver-wecom { display: none; }
}

@media (max-width: 860px) {
  .login-page { padding: 22px 16px; overflow-x: hidden; }
  .login-shell { grid-template-columns: minmax(0, 1fr); width: calc(100vw - 32px); max-width: 420px; min-height: 0; margin: 0 auto; }
  .login-brand { justify-content: flex-start; padding: 30px 26px 32px; }
  .login-logo { width: 148px; }
  .login-brand h1 { margin-top: 16px; font-size: 19px; letter-spacing: 1px; }
  .login-rule { margin-top: 16px; width: 42px; }
  .login-brand-foot { display: none; }
  .login-panel { min-width: 0; padding: 28px; }
  .login-panel-head h2 { font-size: 19px; }
  .login-form { margin-top: 18px; gap: 12px; }
  .login-divider { margin: 18px 0 13px; }
}

/* ===== 统一企业微信扫码登录弹窗 ===== */
.wq-mask{position:fixed;inset:0;z-index:1200;display:flex;align-items:center;justify-content:center;padding:20px;box-sizing:border-box;background:rgba(9,18,24,.55);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
.wq-mask[hidden]{display:none}
.wq-dialog{position:relative;width:400px;max-width:calc(100vw - 32px);background:#fff;border-radius:18px;overflow:hidden;isolation:isolate;box-shadow:0 30px 80px rgba(4,20,28,.28),0 2px 8px rgba(4,20,28,.08);font-family:"Microsoft YaHei","PingFang SC",sans-serif;--wq-accent:#A95722;--wq-soft:#F8EEE3;--wq-ink:#292520;--wq-muted:#8A7F74;--wq-border:#E5DED3}
.wq-dialog::before{content:"";position:absolute;top:0;left:0;right:0;height:3px;background:var(--wq-accent);z-index:2}
.wq-head{position:relative;padding:24px 24px 16px}
.wq-title{margin:0;font-size:17px;font-weight:700;line-height:1.3;color:var(--wq-ink);letter-spacing:.4px}
.wq-sub{margin-top:5px;font-size:11px;line-height:1.4;color:var(--wq-muted);letter-spacing:.8px}
.wq-close{position:absolute;right:14px;top:14px;width:30px;height:30px;border:0;border-radius:50%;background:#F3F7F8;color:#80939C;font:400 20px/1 "Microsoft YaHei","PingFang SC",sans-serif;cursor:pointer;z-index:3;transition:background .15s,color .15s}
.wq-close:hover{background:#EAF1F3;color:var(--wq-ink)}
.wq-body{padding:0 28px 22px;text-align:center}
.wq-frame{position:relative;width:200px;height:200px;margin:0 auto;padding:9px;box-sizing:border-box;border:1px solid var(--wq-border);border-radius:14px;background:#fff;box-shadow:0 8px 24px rgba(15,50,60,.08);display:flex;align-items:center;justify-content:center;overflow:hidden}
.wq-frame img{width:100%;height:100%;display:block;object-fit:contain;border-radius:8px}
.wq-frame img[hidden]{display:none}
.wq-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;border-radius:13px;background:rgba(255,255,255,.94);color:var(--wq-muted);font-size:12px;line-height:1.6;letter-spacing:.3px}
.wq-loading[hidden]{display:none}
.wq-tip{margin:15px 0 0;font-size:12.5px;line-height:1.7;color:var(--wq-ink);opacity:.78}
.login-qr-status{min-height:20px;margin:7px 0 0;font-size:12px;line-height:1.6;color:var(--wq-muted);transition:color .15s}
.login-qr-status.is-scanned{color:var(--wq-accent);font-weight:600}
.login-qr-status.is-ok{color:#12805C;font-weight:600}
.login-qr-status.is-error{color:#B05044;font-weight:600}
.wq-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:13px;border-top:1px solid var(--wq-border)}
.wq-refresh{border:1px solid var(--wq-border);background:#fff;color:var(--wq-accent);border-radius:8px;padding:7px 14px;font:inherit;font-size:12px;line-height:1.2;cursor:pointer;transition:background .15s,border-color .15s}
.wq-refresh:hover{background:var(--wq-soft);border-color:var(--wq-accent)}
.wq-refresh[hidden]{display:inline-block}
.wq-note{font-size:11px;color:var(--wq-muted);white-space:nowrap;letter-spacing:.2px}
.wq-note b{color:var(--wq-accent);font-weight:600}
@media(max-width:480px){.wq-dialog{width:360px;border-radius:16px}.wq-head{padding:22px 20px 14px}.wq-body{padding:0 20px 18px}.wq-frame{width:188px;height:188px;padding:8px}}

@media print {
  .sidebar, .page-head, .flashes, .print-hide { display: none !important; }
  .main, .page-scroll { overflow: visible; height: auto; }
  body { background: #fff; }
}
