:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --border: #e4e8f0;
  --border-strong: #d3d9e6;
  --text: #1e2637;
  --text-2: #4a5468;
  --muted: #8a93a6;
  --primary: #2f6fed;
  --primary-dark: #2559c9;
  --primary-soft: #eaf0ff;
  --danger: #d93f33;
  --danger-soft: #fdeceb;
  --warn: #d98014;
  --warn-soft: #fdf3e3;
  --green: #17915c;
  --green-soft: #e7f6ee;
  --blue-soft: #e9f0ff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(24, 39, 75, .06), 0 6px 20px rgba(24, 39, 75, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #25408f 0%, #2f6fed 55%, #3c86e8 100%);
  position: relative; overflow: hidden;
}
.login-wrap::after {
  content: ''; position: absolute; right: -140px; bottom: -180px;
  width: 520px; height: 520px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.login-card {
  width: 380px; background: #fff; border-radius: 14px; padding: 34px 34px 26px;
  box-shadow: 0 18px 50px rgba(12, 30, 74, .28); position: relative; z-index: 1;
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-logo .mark {
  width: 38px; height: 38px; border-radius: 9px; background: var(--primary);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px;
}
.login-title { font-size: 19px; font-weight: 700; }
.login-sub { color: var(--muted); font-size: 12.5px; margin: 6px 0 22px; }
.login-tip { margin-top: 16px; padding: 10px 12px; background: var(--primary-soft); border-radius: 8px; font-size: 12.5px; color: var(--primary-dark); line-height: 1.7; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; background: #16233d; color: #c7d0e0; flex: 0 0 210px;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
}
.sidebar .brand {
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px;
}
.sidebar .brand .mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.sidebar .brand b { color: #fff; font-size: 15px; display: block; }
.sidebar .brand span { font-size: 11px; color: #7d89a3; }
.nav { padding: 12px 10px; flex: 1; overflow: auto; }
.nav-group { font-size: 11px; color: #67738c; padding: 12px 12px 6px; letter-spacing: .5px; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px;
  color: #c7d0e0; font-size: 13.5px; margin-bottom: 2px; cursor: pointer; transition: .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav a .ico { width: 16px; text-align: center; opacity: .9; }
.side-user { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12.5px; }
.side-user .nm { color: #fff; font-weight: 600; }
.side-user .rl { color: #7d89a3; font-size: 11.5px; }

.main { margin-left: 210px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; }
.topbar .crumb { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.topbar .right { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }
.content { padding: 22px 24px 60px; max-width: 1440px; width: 100%; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text-2); cursor: pointer;
  transition: .15s; font-size: 13.5px; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.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); border-color: #f0c5c1; }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 18px; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat .k { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.5px; }
.stat .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.stat.red .v { color: var(--danger); }
.stat.orange .v { color: var(--warn); }
.stat.blue .v { color: var(--primary); }
.stat.green .v { color: var(--green); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px;
  border: 1px solid transparent; white-space: nowrap; line-height: 1.7;
}
.badge.grey { background: #f1f3f7; color: var(--text-2); border-color: var(--border); }
.badge.blue { background: var(--blue-soft); color: var(--primary-dark); border-color: #c9dbff; }
.badge.green { background: var(--green-soft); color: #0f6d45; border-color: #b9e4cd; }
.badge.red { background: var(--danger-soft); color: #b02d23; border-color: #f5c9c5; }
.badge.orange { background: var(--warn-soft); color: #a8630d; border-color: #f2dcb4; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; padding: 10px 12px; background: var(--panel-2); color: var(--text-2);
  font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 13px;
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
table.tbl tr:hover td { background: #fafbfd; }
table.tbl .act a { margin-right: 10px; cursor: pointer; }
.tbl-wrap { overflow: auto; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; opacity: .5; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }

input[type=text], input[type=password], input[type=tel], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: #fff; outline: none; transition: .15s; color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.12); }
textarea { resize: vertical; min-height: 68px; }
label.fl { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 600; }
label.fl .req { color: var(--danger); margin-left: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.form-grid .col-3 { grid-column: span 3; }
.form-grid .col-2 { grid-column: span 2; }
@media (max-width: 1100px) { .form-grid { grid-template-columns: repeat(2, 1fr); } .form-grid .col-3 { grid-column: span 2; } }
.field { margin-bottom: 2px; }
.field .tip { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.hr { height: 1px; background: var(--border); margin: 22px 0 16px; }
.sect-title { font-size: 14px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.sect-title .dot { width: 8px; height: 8px; border-radius: 3px; }

.cat-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.cat-opt {
  flex: 1; min-width: 190px; border: 1.5px solid var(--border-strong); border-radius: 10px; padding: 12px 14px;
  cursor: pointer; background: #fff; transition: .15s; display: flex; gap: 10px; align-items: flex-start;
}
.cat-opt:hover { border-color: #b9c7e8; }
.cat-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.cat-opt .box {
  width: 18px; height: 18px; border: 1.5px solid var(--border-strong); border-radius: 5px; flex: 0 0 18px;
  margin-top: 2px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: transparent;
}
.cat-opt.on .box { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-opt b { font-size: 14px; display: block; }
.cat-opt .d { font-size: 11.5px; color: var(--muted); }
.cat-block { border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: var(--panel-2); margin-top: 14px; }

.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; margin-bottom: 18px; }

/* ---- 到期看板：6 个板块固定 3 列 × 2 行 ---- */
.board-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin-bottom: 18px; align-items: stretch;
}
.board-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 268px; }
.board-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.board-card .panel-head { padding-top: 16px; }
/* 列表区可滚动：条目多时不把卡片撑高，六张卡保持整齐 */
.board-card .panel-body { flex: 1; padding: 12px 14px; overflow: auto; max-height: 330px; }
.board-card .panel-body::-webkit-scrollbar { width: 6px; }
.board-card .panel-body::-webkit-scrollbar-thumb { background: #d6dbe3; border-radius: 3px; }
@media (max-width: 1280px) { .board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px)  { .board-grid { grid-template-columns: 1fr; } }

/* ---- 回款进度（资质行内） ---- */
.paylogs-trigger {
  width: 100%; font-size: 12px; padding: 5px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.paylogs-trigger.has { background: #e8f3ff; border-color: #c9dbff; color: var(--primary-dark); font-weight: 600; }
.paylogs-list { max-height: 300px; overflow: auto; }
.paylogs-row {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed var(--border);
}
.paylogs-row .idx { flex: 0 0 52px; font-size: 12px; color: var(--muted); line-height: 30px; }
.paylogs-row .fld { flex: 1; min-width: 0; }
.paylogs-row .fld .fl { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.paylogs-row .fld input { width: 100%; }
.paylogs-addbar { margin-top: 12px; }
.paylogs-total {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  font-weight: 700; color: var(--primary-dark); font-size: 14px;
}
/* 自动合计的只读框：能看能复制，但不许手改 */
.rows-td input.ro { background: #f4f6f9; color: var(--text-2); cursor: default; }

.exp-list { max-height: 340px; overflow: auto; }
.exp-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed #eef1f6; cursor: pointer;
}
.exp-item:hover { background: #fafbfd; }
.exp-item:last-child { border-bottom: none; }
.exp-item .days {
  flex: 0 0 58px; text-align: center; padding: 5px 0; border-radius: 8px; font-weight: 700; font-size: 13px; line-height: 1.25;
}
.exp-item .days small { display: block; font-size: 10px; font-weight: 400; opacity: .8; }
.days.expired, .days.danger { background: var(--danger-soft); color: #b02d23; }
.days.warn { background: var(--warn-soft); color: #a8630d; }
.days.info { background: var(--blue-soft); color: var(--primary-dark); }
.days.ok { background: var(--green-soft); color: #0f6d45; }
.exp-item .info { flex: 1; min-width: 0; }
.exp-item .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-item .sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -19px; top: 6px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary-soft);
}
.tl-item .meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tl-item .ct { margin-top: 3px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; white-space: pre-wrap; }
.tl-item .del { margin-left: auto; cursor: pointer; color: var(--muted); }
.tl-item .del:hover { color: var(--danger); }

.kv-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px 22px; }
.kv { display: flex; gap: 10px; border-bottom: 1px dashed #eef1f6; padding-bottom: 8px; }
.kv .k { color: var(--muted); flex: 0 0 92px; font-size: 13px; }
.kv .v { flex: 1; word-break: break-all; }
.kv .v.empty { color: #b8bfcd; }

.cat-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; color: #fff; margin-right: 4px; }

/* 弹层 */
.mask {
  position: fixed; inset: 0; background: rgba(17, 26, 44, .45); display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 20px; z-index: 100; overflow: auto;
}
.modal { background: #fff; border-radius: 12px; width: 720px; max-width: 100%; box-shadow: 0 20px 60px rgba(10,20,45,.3); }
.modal.narrow { width: 440px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-body { padding: 20px; max-height: 74vh; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.x { cursor: pointer; font-size: 22px; line-height: 1; color: var(--muted); }

#toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item {
  background: #1e2637; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: drop .22s ease;
}
.toast-item.ok { background: #17915c; }
.toast-item.err { background: #d93f33; }
@keyframes drop { from { transform: translateY(-14px); opacity: 0; } }

.loading { padding: 40px; text-align: center; color: var(--muted); }
.row-flex { display: flex; gap: 18px; flex-wrap: wrap; }
.row-flex > .grow { flex: 1; min-width: 320px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono-num { font-variant-numeric: tabular-nums; }
.pill-ghost { border: 1px dashed var(--border-strong); background: transparent; border-radius: 20px; padding: 3px 10px; font-size: 12px; color: var(--muted); }

/* 多选 chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.chip {
  padding: 4px 11px; border: 1px solid var(--border-strong); border-radius: 16px; font-size: 12.5px;
  cursor: pointer; background: #fff; user-select: none; transition: .12s; line-height: 1.6;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }

/* ---------- 资质序列级联多选 ---------- */
.qc { position: relative; }
.qc-top { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.qc-trigger { min-width: 200px; justify-content: flex-start; }
.qc-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 260px; align-items: center; }
.qc-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 6px;
  background: var(--primary-soft); border: 1px solid #c9dbff; font-size: 12.5px; color: var(--primary-dark);
}
.qc-tag b { font-weight: 600; }
.qc-tag .lv { color: #4a6fd4; }
.qc-tag .x { cursor: pointer; color: #7d97d8; font-size: 14px; line-height: 1; padding: 0 2px; }
.qc-tag .x:hover { color: var(--danger); }
.qc-panel {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0;
  display: flex; background: #fff; border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(20, 40, 90, .18); overflow: hidden;
}
.qc-col { width: 170px; max-height: 320px; overflow: auto; padding: 6px; border-right: 1px solid var(--border); }
.qc-col:nth-child(2) { width: 280px; background: var(--panel-2); }
.qc-col:nth-child(3) { width: 130px; border-right: none; }
.qc-col.narrow { width: 170px; }
.qc-col.narrow:nth-child(2) { width: 190px; background: var(--panel-2); }
.qc-hint { font-size: 11.5px; color: var(--muted); padding: 6px 8px; }
.qc-item {
  display: flex; align-items: center; gap: 4px; padding: 6px 9px; border-radius: 6px;
  font-size: 12.5px; cursor: pointer; transition: .1s; line-height: 1.4; justify-content: space-between;
}
.qc-item .qc-count { color: var(--muted); font-size: 11px; }
.qc-item:hover, .qc-item.hover { background: var(--primary-soft); color: var(--primary-dark); }
.qc-item.grp { font-weight: 600; }
.qc-item.lvl { justify-content: flex-start; font-weight: 400; }
.qc-item.lvl .tick { width: 14px; color: var(--primary); font-weight: 700; }
.qc-item.lvl.on { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
/* 无等级项目（如 安许办理 · 新办 / 延期）：点项目本身即选中 */
.qc-item.nolvl::after { content: '点击选中'; font-size: 10.5px; color: var(--muted); font-weight: 400; }
.qc-item.nolvl:hover::after, .qc-item.nolvl.hover::after { color: var(--primary-dark); }

/* 自动合计的只读字段（已收款） */
.field-auto .auto-num {
  width: 100%; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: 8px;
  background: var(--panel-2); color: var(--primary-dark); font-weight: 700; font-size: 14px;
  cursor: not-allowed;
}
.field-auto .auto-num:focus { outline: none; }

/* ---------- 行式录入（聘用/考试/收款） ---------- */
.rows-box { border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; }
.rows-scroll { overflow-x: auto; padding: 4px; }
.rows-tr {
  display: flex; align-items: center; gap: 6px; padding: 6px 4px;
  border-bottom: 1px dashed #eef1f6; min-width: max-content;
}
.rows-tr:last-child { border-bottom: none; }
.rows-head { background: var(--panel-2); border-radius: 8px; border-bottom: 1px solid var(--border); }
.rows-th {
  flex: 1; min-width: 90px; font-size: 11.5px; color: var(--text-2); font-weight: 600;
  padding: 2px 4px; white-space: nowrap;
}
.rows-th[style*="width"] { flex: 0 0 auto; }
.rows-th-op { flex: 0 0 26px; min-width: 26px; }
.rows-td { flex: 1; min-width: 90px; padding: 1px 2px; }
.rows-td[style*="width"] { flex: 0 0 auto; }
.rows-td .btn.sm { width: 100%; justify-content: flex-start; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.rows-td .rc-cascade-btn:not(.filled) { color: var(--muted); }
.rows-td-op { flex: 0 0 26px; min-width: 26px; text-align: center; }
.rows-del {
  cursor: pointer; color: var(--muted); font-size: 17px; line-height: 1; padding: 3px;
  border-radius: 5px; user-select: none;
}
.rows-del:hover { color: var(--danger); background: var(--danger-soft); }
.rows-empty { padding: 16px 12px; color: var(--muted); font-size: 12.5px; text-align: center; }
.rows-addbar { padding: 8px 6px 10px; display: flex; }
.rows-add { border-style: dashed; }
.rc-cascade { position: relative; }
.rc-cascade-panel {
  position: absolute; z-index: 70; top: calc(100% + 6px); left: 0;
  display: flex; background: #fff; border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(20, 40, 90, .18); overflow: hidden;
}
/* ---------- 资质行：多选三级级联（序列 → 项目 → 等级 → 已选） ----------
   行式录入区是横向滚动容器，绝对定位的面板会被 overflow 裁掉 → 改用 fixed + JS 定位 */
.rc-cascade-panel.multi { position: fixed; z-index: 120; left: 0; top: 0; }
.rc-cascade-panel.multi .qc-col.narrow { width: 170px; }
.rc-cascade-panel.multi .qc-col.projs { width: 250px; background: var(--panel-2); }
.rc-cascade-panel.multi .qc-col.lvls { width: 130px; }
.rc-cascade-panel.multi .qc-col.picked { width: 240px; border-right: none; background: #f6f9ff; }
.rc-cascade-panel.multi .qc-item.has { color: var(--primary-dark); font-weight: 600; }
.rc-cascade-panel.multi .qc-item.has .qc-count { color: var(--primary); font-weight: 700; }
.qc-picked-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--muted); padding: 2px 4px 6px; border-bottom: 1px dashed var(--border); margin-bottom: 6px;
}
.qc-clear { cursor: pointer; color: var(--primary); }
.qc-clear:hover { color: var(--danger); text-decoration: underline; }
.qc-picked-item {
  display: flex; align-items: flex-start; gap: 6px; padding: 5px 7px; margin-bottom: 5px;
  border: 1px solid #e3ebff; border-radius: 6px; background: #fff; font-size: 12px; line-height: 1.35;
}
.qc-picked-item .lv { color: #4a6fd4; }
.qc-picked-item .g { color: var(--muted); font-size: 11px; }
.qc-picked-item .x { margin-left: auto; cursor: pointer; color: #8ea3d6; font-size: 14px; line-height: 1; padding: 0 2px; }
.qc-picked-item .x:hover { color: var(--danger); }
/* 行内小输入框 */
.rows-tr input, .rows-tr select { padding: 6px 8px; font-size: 12.5px; border-radius: 6px; }
.rows-tr input[type="date"] { min-width: 116px; }
/* 窄排、点击看全：默认按列宽收窄，聚焦时该格展开（宽度由行内 style 设定，需 !important 覆盖） */
.rows-td { position: relative; }
.rows-td:focus-within {
  width: 240px !important; z-index: 30; background: #fff;
  box-shadow: 0 0 0 2px var(--primary); border-radius: 6px;
}
.rows-td:focus-within input, .rows-td:focus-within select { width: 100%; }

/* ---------- 详情页对象列表 ---------- */
.mini-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.mini-tbl th {
  text-align: left; padding: 5px 8px; background: var(--panel-2); color: var(--text-2);
  font-weight: 600; border: 1px solid var(--border); white-space: nowrap; font-size: 12px;
}
.mini-tbl td { padding: 5px 8px; border: 1px solid #eef1f6; }
.mini-tbl td.empty { color: #b8bfcd; }
/* 到期日预警：哪一条进入提醒期就只标这一格，同行其它列不染
   exp-red = 已过期（深红）；exp-soon = 提前 150 天内即将到期（橙） */
.mini-tbl td.exp-red {
  color: #d92d20; background: #fdecea; font-weight: 700;
  box-shadow: inset 0 0 0 1px #f3b3ac; white-space: nowrap;
}
.mini-tbl td.exp-soon {
  color: #b45309; background: #fff5e6; font-weight: 700;
  box-shadow: inset 0 0 0 1px #f5cf9a; white-space: nowrap;
}
/* 编辑/新增表单里的到期输入框：与明细表同一口径，哪个到期标哪个 */
.rows-td input.exp-red {
  color: #d92d20; background: #fdecea; border-color: #f3b3ac; font-weight: 700;
}
.rows-td input.exp-soon {
  color: #b45309; background: #fff5e6; border-color: #f5cf9a; font-weight: 700;
}
.rows-td input.exp-red::-webkit-datetime-edit,
.rows-td input.exp-soon::-webkit-datetime-edit { color: inherit; }

/* ================= 手机竖屏适配 =================
   原因：侧栏固定 210px + main 左缩进 210px，竖屏 390px 宽时内容区只剩不到 180px，
   右侧被压扁。小屏改为：侧栏变顶部横向导航，内容占满全宽，宽表格改为横向滚动。 */
@media (max-width: 820px) {
  /* 登录页：原来是固定 380px，窄屏会溢出 */
  .login-card { width: calc(100% - 28px); max-width: 380px; padding: 26px 20px 20px; }

  .shell { flex-direction: column; }
  .sidebar {
    position: sticky; top: 0; bottom: auto; left: auto; z-index: 30;
    width: 100%; height: auto; flex: none; flex-direction: row; align-items: center;
    box-shadow: 0 2px 10px rgba(10, 20, 45, .18);
  }
  .sidebar .brand { display: none; }
  .nav {
    flex: 1; min-width: 0; display: flex; flex-direction: row; align-items: center;
    gap: 4px; padding: 7px 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-group { display: none; }
  .nav a { flex: 0 0 auto; margin-bottom: 0; padding: 7px 11px; white-space: nowrap; font-size: 13px; }
  .side-user {
    flex: 0 0 auto; height: 44px; display: flex; align-items: center; gap: 10px;
    padding: 0 12px; border-top: none; border-left: 1px solid rgba(255, 255, 255, .08);
  }
  .side-user .rl { display: none; }
  .side-user .nm { font-size: 12.5px; }

  /* 侧栏已吸顶，标题栏不再 sticky，避免两层叠在一起 */
  .main { margin-left: 0; }
  .topbar { position: static; height: auto; min-height: 46px; padding: 10px 12px; }
  .topbar h1 { font-size: 15px; }
  .topbar .right { font-size: 12px; gap: 8px; }
  .content { padding: 12px 12px 70px; }

  /* 宽表格不再挤压列，改为横向滚动 */
  table.tbl { min-width: 720px; }
  .mini-tbl { min-width: 520px; }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid .col-2, .form-grid .col-3 { grid-column: span 1; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 13px; }
  .stat .v { font-size: 21px; }

  /* flex/grid 子项默认 min-width:auto，会把内部的横向滚动容器撑破，必须显式归零 */
  .row-flex { flex-wrap: wrap; }
  /* 小屏改堆叠：否则两个面板各占 175px，键值列表放不下反而撑破整页 */
  .row-flex > * { min-width: 0; }
  .row-flex > .grow { flex: 1 1 100%; min-width: 0; }
  .panel, .panel-body { min-width: 0; }
  /* 表单 grid 的格子同理：明细行区（rows-box）装在 col-3 里，不归零会被行内容撑破整页 */
  .form-grid > * { min-width: 0; }
  .tbl-wrap { max-width: 100%; }
  .qc-trigger { min-width: 0; }
  .qc-chips { min-width: 0; }
  .panel-head { padding: 12px 13px; }
  .panel-body { padding: 13px; }
  .toolbar { gap: 8px; }
  .toolbar .grow { min-width: 120px; }

  .modal { width: calc(100% - 20px); max-width: 100%; }
  .modal-body { padding: 14px; max-height: 66vh; }

  /* 资质行多选面板：790px 横向排不开 → 改成纵向堆叠，占满屏宽内部再滚动 */
  .rc-cascade-panel.multi {
    flex-direction: column; width: calc(100vw - 20px) !important;
    max-height: 76vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .rc-cascade-panel.multi .qc-col {
    width: auto !important; max-height: 168px; flex: none;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .rc-cascade-panel.multi .qc-col.picked { border-bottom: none; }
}

@media (max-width: 480px) {
  .content { padding: 10px 9px 70px; }
  .stat .v { font-size: 19px; }
  .topbar .crumb { display: none; }
}

/* ---------- 微信内置浏览器引导条 ---------- */
.wx-tip {
  position: sticky; left: 0; right: 0; top: 0; z-index: 999;
  background: #fff8e6; border-bottom: 1px solid #f2dcb4; color: #7a4d09;
  padding: 10px 14px; font-size: 13px; line-height: 1.6;
  display: flex; align-items: flex-start; gap: 10px;
  box-shadow: 0 2px 8px rgba(10, 20, 45, .08);
}
.wx-tip .txt { flex: 1; min-width: 0; }
.wx-tip b { color: #a8630d; }
.wx-tip .x {
  flex: 0 0 auto; cursor: pointer; font-size: 18px; line-height: 1;
  color: #b08a4a; padding: 0 2px;
}

/* ---------- 交付进度流程图 ---------- */
.flow-steps {
  display: flex; align-items: flex-start; flex-wrap: wrap;
  row-gap: 18px;
}
.flow-node {
  position: relative; flex: 0 0 auto; max-width: 148px;
  padding: 0 18px; text-align: center; cursor: default;
}
.flow-node:not(:last-child)::after {
  content: ''; position: absolute; top: 9px; left: calc(50% + 13px);
  width: calc(100% - 26px); height: 2px; background: var(--border);
}
.flow-node.done:not(:last-child)::after { background: var(--green); }
.flow-node .fn-dot {
  width: 18px; height: 18px; border-radius: 50%; margin: 0 auto 6px;
  background: #e6ebf3; border: 2px solid #b9c3d4; position: relative; z-index: 1;
}
.flow-node.done .fn-dot { background: var(--green); border-color: var(--green); }
.flow-node.cur .fn-dot { background: #fff; border-color: var(--warn); box-shadow: inset 0 0 0 4px var(--warn); }
.flow-node.final .fn-dot { background: var(--primary); border-color: var(--primary); }
.flow-node .fn-name { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.flow-node.done .fn-name { color: var(--green); }
.flow-node.cur .fn-name { color: var(--warn); }
.flow-node.final .fn-name { color: var(--primary); }
.flow-node .fn-date { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 页脚 ICP 备案号（合规展示） ---------- */
.icp-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 25;
  text-align: center; padding: 7px 12px; font-size: 12px;
  color: #8a93a6; background: rgba(255, 255, 255, .94);
  border-top: 1px solid var(--border);
}
.icp-footer a { color: #8a93a6; }
.icp-footer a:hover { color: var(--primary); }
/* 宽屏主界面有左侧栏，页脚避开侧栏；登录页无侧栏、窄屏侧栏吸顶，均铺满 */
@media (min-width: 821px) {
  body:has(.sidebar) .icp-footer { left: 210px; }
}
/* 登录页深蓝底：页脚改半透明白字，不出现一条突兀白条 */
body:has(.login-wrap) .icp-footer {
  background: rgba(255, 255, 255, .12);
  border-top-color: rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .85);
}
body:has(.login-wrap) .icp-footer a { color: rgba(255, 255, 255, .9); }
