/* ============================================================
   门户 v0.1 · 应用层样式（在 design/assets.css 基础上补充）
   ============================================================ */

/* 真实表单控件 */
input.real, select.real {
  width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 11px; font-size: 13.5px; font-family: inherit; color: var(--ink);
  background: #fff; outline: none;
}
textarea.real {
  width: 100%; min-height: 72px; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font-size: 13.5px; font-family: inherit; color: var(--ink);
  background: #fff; outline: none; resize: vertical; line-height: 1.65;
  display: block; box-sizing: border-box;
}
input.real::placeholder, textarea.real::placeholder { color: #a8b2c4; }
input.real:hover, select.real:hover, textarea.real:hover { border-color: #c9d2e0; }
input.real:focus, select.real:focus, textarea.real:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(61,123,247,.12);
}
textarea.real:disabled { background: #f7f8fa; color: var(--ink-4); resize: none; }
select.real { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #98a2b3 50%), linear-gradient(135deg, #98a2b3 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.field-sm { margin-bottom: 14px; }
.field-sm label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field-sm .hint { font-size: 11.5px; color: var(--ink-4); margin-top: 5px; }

/* 复选框组 */
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chk {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; user-select: none; background: #fff;
}
.chk.on { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.chk .dotbox { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #cfd6e2; background: #fff; position: relative; }
.chk.on .dotbox { background: var(--brand); border-color: var(--brand); }
.chk.on .dotbox::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 7px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.42); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  width: 460px; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(16,24,40,.28);
  overflow: hidden; animation: pop .16s ease-out;
}
/* 宽屏弹窗：审批、单据编辑这类内容多的表单 */
.modal.modal-wide { width: 820px; max-width: calc(100vw - 48px); }
.modal.modal-user { width: 860px; max-width: calc(100vw - 48px); }
.modal.modal-user .mb { max-height: 76vh; }
.user-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; }
.user-form-grid .field-sm { min-width: 0; }
.user-form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .modal.modal-user { width: calc(100vw - 32px); }
  .user-form-grid { grid-template-columns: 1fr; }
  .user-form-grid .span-2 { grid-column: auto; }
}
.modal.modal-wide .mb { max-height: 68vh; }
.modal.modal-wide .mf { align-items: center; }
/* 底部左侧的操作（如「驳回」），和右侧的取消/确定同一行 */
.modal .mf .mf-left { margin-right: auto; display: flex; gap: 8px; align-items: center; }
.modal .mf .mf-left .btn { height: 34px; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal .mh { padding: 18px 20px 12px; font-size: 15px; font-weight: 600; display: flex; align-items: center; }
.modal .mh .x { margin-left: auto; color: var(--ink-4); cursor: pointer; font-size: 18px; line-height: 1; }
.modal .mb { padding: 4px 20px 8px; max-height: 62vh; overflow: auto; }
.modal .mf { padding: 14px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line-2); }

/* 门户公用容器：把子系统的处理页嵌在弹窗里（iframe 同源共享会话） */
.modal.sub-panel { width: 1120px; max-width: calc(100vw - 40px); }
.sub-panel .sub-panel-hd { align-items: flex-start; gap: 16px; padding-bottom: 10px; }
.sub-panel-title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.sub-panel-sub { font-size: 12px; color: var(--ink-4); font-weight: 400; margin-top: 4px; line-height: 1.6; }
.sub-panel-body { border-top: 1px solid var(--line-2); background: #fff; }
.sub-panel-frame { display: block; width: 100%; height: min(74vh, 700px); border: 0; background: #fff; }
/* ── 流程中心：审批弹窗 / 节点进度 / 轨迹 / 定义编辑 ───── */

/* 弹窗顶部信息条（卡片式） */
.flow-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px 14px; margin-bottom: 14px;
  background: linear-gradient(180deg, #fbfcff, #f7f9fd);
  border: 1px solid var(--line-2); border-radius: 12px;
}
.flow-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.flow-head-row { display: flex; align-items: center; gap: 8px; }
.flow-head-def { font-size: 12px; color: var(--ink-4); }
.flow-head-meta { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.flow-head .btn { flex: 0 0 auto; }

/* 分区卡片 */
.appr-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: stretch; }
.appr-wrap.single { grid-template-columns: minmax(0, 1fr); }
.appr-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.appr-side { min-width: 0; display: flex; flex-direction: column; }

.appr-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.appr-card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; background: #fafbfd; border-bottom: 1px solid var(--line-2);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.appr-card-sub { font-weight: 400; color: var(--ink-4); font-size: 11.5px; }
.appr-card-bd { padding: 6px 14px 12px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.appr-scroll { max-height: 168px; overflow: auto; mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), transparent); }

/* 节点行 */
.flow-node { display: flex; gap: 10px; padding: 9px 0; }
.flow-node + .flow-node { border-top: 1px dashed var(--line-2); }
.flow-node-seq {
  flex: 0 0 22px; height: 22px; border-radius: 50%; margin-top: 1px;
  background: #eef1f7; color: #7a879c;
  font-size: 11.5px; display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.flow-node-seq.is-ok { background: #e7f6ee; color: #067647; }
.flow-node-seq.is-warn { background: #fff4e5; color: #b54708; }
.flow-node-seq.is-danger { background: #feeceb; color: #b42318; }
.flow-node-main { flex: 1; min-width: 0; }
.flow-node-name { font-size: 13px; color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.flow-node-meta { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; }

/* 轨迹行 */
.flow-log { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 7px 0; font-size: 12px; }
.flow-log + .flow-log { border-top: 1px dashed var(--line-2); }
.flow-log-time { color: var(--ink-4); font-variant-numeric: tabular-nums; font-size: 11.5px; padding-top: 1px; }
.flow-log-body { min-width: 0; color: var(--ink-3); line-height: 1.55; }
.flow-log-who { color: var(--ink-2); font-weight: 500; margin-right: 6px; }
.flow-log-cmt {
  margin-top: 6px; padding: 6px 9px; background: #f7f8fb; border-radius: 7px;
  color: var(--ink-3); white-space: pre-wrap; word-break: break-word;
}
.flow-empty { padding: 10px 0; color: var(--ink-4); font-size: 12px; }

/* 审批意见（右栏卡片） */
.appr-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.appr-quick button {
  height: 26px; padding: 0 10px; border-radius: 20px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-3); font: inherit; font-size: 12px; cursor: pointer;
}
.appr-quick button:hover { border-color: var(--brand-2); color: var(--brand); background: var(--brand-soft); }
.appr-quick button:disabled { opacity: .5; cursor: not-allowed; }
.appr-side .appr-card { height: 100%; }
.appr-side textarea.real { flex: 1; min-height: 132px; resize: none; }
.appr-hint { font-size: 11.5px; color: var(--ink-4); margin-top: 8px; line-height: 1.6; }

@media (max-width: 980px) {
  .appr-wrap { grid-template-columns: 1fr; }
  .appr-side { position: static; }
  .appr-side textarea.real { min-height: 90px; }
}

.modal.modal-wide .mb { max-height: calc(100vh - 136px); }

.flow-edit-node { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fcfcfd; }
.flow-edit-node-hd { display: flex; align-items: center; font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.flow-edit-row { display: flex; gap: 8px; }
.flow-edit-row .real { flex: 1; }
.flow-edit-row select.real { flex: 0 0 110px; }
.flow-edit-hint { font-size: 11.5px; color: var(--ink-4); margin-top: 6px; }
.flow-edit-node select[multiple] { height: auto; min-height: 76px; padding: 4px; }

/* ── 待办平台：筛选条 / 分组 / 未读 / 到期 ───────────────── */
.todo-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 0 12px; flex-wrap: wrap; }
.todo-chips { display: flex; gap: 6px; }
.todo-chip {
  height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-3); font-family: inherit; font-size: 12.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.todo-chip:hover { border-color: var(--brand-2); color: var(--brand); }
.todo-chip.on { background: var(--brand-soft); border-color: var(--brand-2); color: var(--brand); font-weight: 600; }
.todo-chip b { font-size: 11px; background: rgba(99, 102, 241, .12); border-radius: 8px; padding: 1px 5px; }

.todo-group { margin-top: 2px; }
.todo-group-hd { font-size: 12px; color: var(--ink-4); padding: 10px 8px 2px; display: flex; gap: 6px; align-items: center; }
.todo-group-hd b { color: var(--ink-3); }
.todo-group-hd.is-overdue, .todo-group-hd.is-overdue b { color: #b42318; }

.todo-item { cursor: pointer; border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.todo-item:hover { background: #fafbff; }
.todo-item.is-unread { background: #f7f8ff; }
.todo-item.is-unread:hover { background: #f1f3ff; }
.todo-item.is-unread .todo-title { font-weight: 600; }
.todo-item.is-unread .todo-title::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); margin-right: 6px; vertical-align: 1px;
}
.todo-sum { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.todo-due { color: var(--ink-3); white-space: nowrap; }
.todo-due.is-overdue { color: #b42318; font-weight: 600; }
.todo-due.is-soon { color: #b54708; font-weight: 600; }

/* toast */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #101828; color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 9px;
  box-shadow: 0 10px 24px rgba(16,24,40,.25); animation: pop .16s ease-out;
}
.toast.err { background: var(--danger); }
.toast.ok { background: #067647; }

/* 状态条 */
.demo-bar {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16,24,40,.12); padding: 10px 12px;
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3);
}
.demo-bar select { height: 30px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; padding: 0 6px; font-family: inherit; }

/* 空状态 */
.empty-box { text-align: center; padding: 54px 0 60px; }
.empty-box .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.empty-box .t { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.empty-box .d { font-size: 12.5px; color: var(--ink-4); margin-top: 6px; }

/* 表格里的角色标签 */
.role-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 12px; margin: 0 4px 2px 0; white-space: nowrap; }
.role-pill.gray { background: #f2f4f7; color: var(--ink-3); }

/* 骨架 */
.skeleton { background: linear-gradient(90deg, #f0f2f5 25%, #f7f9fc 37%, #f0f2f5 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* 侧栏里的次级入口 */
.menu-item .flag { margin-left: auto; font-size: 10px; color: #7d8aa3; border: 1px solid rgba(255,255,255,.16); padding: 1px 5px; border-radius: 4px; }
.menu-item.active .flag { color: #cfe0ff; border-color: rgba(255,255,255,.3); }

/* 登录页补充 */
.login-err {
  display: none; margin-bottom: 14px; padding: 10px 12px; border-radius: 9px;
  background: var(--danger-soft); color: #b42318; font-size: 12.5px;
}
.login-err.show { display: block; }
.demo-tip {
  margin-top: 18px; padding: 0; background: none; border: none;
  font-size: 12px; color: var(--ink-4); text-align: center; line-height: 1.7;
}
.demo-tip b { color: var(--ink-2); }

/* 让表格操作按钮居右 */
td.ops { text-align: right; white-space: nowrap; }
td.ops .btn { margin-left: 6px; }

/* 有独立品牌图标的子系统 */
.app-brand-logo { width: 100%; height: 100%; display: block; object-fit: cover; }
.app .ic, .app-mini .ic, .sub-item .ic, .sys-hd .ic, .sys-line .ic { overflow: hidden; }
/* 图标自带紫色圆角底，容器不要再叠系统色，否则透明圆角会露出旧底色 */
.app .ic:has(> .app-brand-logo),
.app-mini .ic:has(> .app-brand-logo),
.sub-item .ic:has(> .app-brand-logo),
.sys-hd .ic:has(> .app-brand-logo),
.sys-line .ic:has(> .app-brand-logo) { background: transparent !important; }

/* ============================================================
   页面组件（从设计稿各页 <style> 归并）
   ============================================================ */

/* —— 工作台 —— */
.hero-bar {
  background: var(--hero-grad, linear-gradient(120deg, #1b2f5e 0%, #2b5fd9 60%, #4b86f7 100%));
  border-radius: 14px; padding: 20px 24px; color: #fff; position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 24px; margin-bottom: 14px;
}
.hero-bar::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%);
}
.hero-bar h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .3px; }
.hero-bar p { margin: 8px 0 0; font-size: 13px; color: #cddcff; }
.hero-bar p b { color: #fff; }
.hero-actions { margin-left: auto; display: flex; gap: 10px; position: relative; }
.hero-actions .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); color: #fff; }
.hero-actions .btn:hover { background: rgba(255,255,255,.24); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.cols { display: grid; grid-template-columns: 1fr 336px; gap: 14px; align-items: start; }

/* 工作台重排：待办 7 / 公告 5，常用应用 8 / 状态 4；两行等高 */
.wb-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.wb-cell { min-width: 0; }
.wb-cell-todo { grid-column: span 6; }
.wb-cell-notice { grid-column: span 6; }
/* 公告高度翻倍（约 600px），只列标题，不展示正文 */
.wb-cell-notice .wb-card { min-height: 620px; }
.wb-cell-notice .wb-card-bd { max-height: none; }
.wb-card { height: 100%; display: flex; flex-direction: column; }
.wb-card-bd { flex: 1 1 auto; overflow: auto; max-height: 460px; }
.notice-foot { font-size: 11.5px; color: var(--ink-4); text-align: center; padding: 10px 0 2px; }
@media (max-width: 1180px) {
  .wb-cell-todo, .wb-cell-notice { grid-column: span 12; }
  .wb-card-bd { max-height: none; }
}

/* 公告条目：标题 + 正文摘要（两行截断）+ 发布信息 */
.notice-hd { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-4); padding: 2px 0 8px; border-bottom: 1px solid var(--line); }
.notice-hd b { color: var(--brand); font-weight: 600; }
.notice-item { cursor: pointer; border-radius: 8px; padding: 14px 8px; }
.notice-item:hover { background: #fafbff; }
.notice-item.unread .notice-t { font-weight: 600; color: var(--ink); }
.notice-main { min-width: 0; flex: 1; }
.notice-t { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.notice-b {
  font-size: 12px; color: var(--ink-4); margin-top: 3px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notice-m { font-size: 11px; color: var(--ink-4); margin-top: 5px; }

.app-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.app-mini {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  display: flex; align-items: center; gap: 10px; cursor: pointer; background: #fff;
}
.app-mini:hover { border-color: #c7d7ff; background: #fafbff; }
.app-mini .ic {
  width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 14px; flex: 0 0 32px;
}
.app-mini .n { font-size: 13px; font-weight: 500; }
.app-mini .s { font-size: 11px; color: var(--ink-4); margin-top: 2px; }

.notice-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.notice-item:last-child { border-bottom: none; }
.notice-item .dotc { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-2); margin-top: 7px; flex: 0 0 6px; }
.notice-item .t { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.notice-item .d { font-size: 11px; color: var(--ink-4); margin-top: 3px; }

.health-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 12.5px; }
.health-row .nm { color: var(--ink-2); }
.health-row .st { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--ok); font-size: 12px; }
.health-row .st.warn { color: var(--warn); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(18,183,106,.15); }

/* —— 应用中心 —— */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab { height: 34px; padding: 0 16px; border-radius: 8px; font-size: 13px; color: var(--ink-3); display: flex; align-items: center; cursor: pointer; }
.tab:hover { background: #eef1f7; }
.tab.on { background: var(--ink); color: #fff; font-weight: 500; }

.section-label { font-size: 13px; color: var(--ink-3); margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-label b { color: var(--ink); font-size: 14px; font-weight: 600; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.app {
  background: #fff; border-radius: 12px; padding: 16px; cursor: pointer;
  border: 1px solid rgba(16,24,40,.05); box-shadow: var(--shadow);
  position: relative; transition: .16s;
}
.app:hover { border-color: #c7d7ff; box-shadow: 0 8px 22px rgba(43,95,217,.12); transform: translateY(-2px); }
.app .hd { display: flex; align-items: center; gap: 11px; }
.app .ic {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 18px; font-weight: 600; flex: 0 0 44px;
}
.app .nm { font-size: 15px; font-weight: 600; }
.app .code { font-size: 11px; color: var(--ink-4); margin-top: 2px; letter-spacing: .4px; }
.app .ds { font-size: 12px; color: var(--ink-3); line-height: 1.6; margin-top: 12px; min-height: 36px; }
.app .ft {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding-top: 11px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--ink-4);
}
.app .role { background: var(--brand-soft); color: var(--brand); padding: 2px 7px; border-radius: 5px; font-weight: 500; }
.app .go { margin-left: auto; color: var(--brand); font-weight: 500; }
.app.off { opacity: .62; }
.app.off:hover { transform: none; box-shadow: var(--shadow); border-color: rgba(16,24,40,.05); }

/* —— 子系统授权 —— */
.split { display: grid; grid-template-columns: 248px 1fr; gap: 16px; align-items: start; }
.side-card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid rgba(16,24,40,.04); overflow: hidden; }
.side-hd { padding: 14px 16px 10px; font-size: 13px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.sub-list { padding: 8px; }
.sub-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; margin-bottom: 2px; }
.sub-item:hover { background: #f7f9fc; }
.sub-item.on { background: var(--brand-soft); }
.sub-item .ic { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; flex: 0 0 28px; }
.sub-item .nm { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.sub-item.on .nm { color: var(--brand); font-weight: 600; }
.sub-item .ct { margin-left: auto; font-size: 11.5px; color: var(--ink-4); }
.sub-item.on .ct { color: var(--brand); }

.sys-hd { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.sys-hd .ic { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; font-weight: 600; }
.sys-hd .nm { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sys-hd .meta { font-size: 12px; color: var(--ink-4); margin-top: 4px; display: flex; gap: 10px; }
.sys-hd .meta code { background: #f2f4f7; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 1px; background: var(--line-2); }
.kpi { background: #fff; padding: 14px 20px; }
.kpi .k { font-size: 12px; color: var(--ink-4); }
.kpi .v { font-size: 19px; font-weight: 700; margin-top: 4px; }
.kpi .v span { font-size: 12px; font-weight: 400; color: var(--ink-4); }
.body { padding: 16px 20px 20px; }

.obj { display: flex; align-items: center; gap: 9px; }
.obj .av { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 28px; }
.av-dept { background: #eef2ff; color: #4453c4; }
.av-user { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; }
.role-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 12px; margin-right: 4px; white-space: nowrap; }

/* —— 用户与角色 —— */
.panel { background: #fff; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid rgba(16,24,40,.04); overflow: hidden; }
.panel-hd { padding: 16px 18px 14px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.panel-bd { padding: 16px 18px; }
.u-hero { display: flex; align-items: center; gap: 12px; }
.u-hero .av { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg,#6ea0ff,#2b5fd9); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; }
.u-hero .nm { font-size: 16px; font-weight: 600; }
.u-hero .dp { font-size: 12px; color: var(--ink-4); margin-top: 3px; }
.kv { display: flex; padding: 8px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { width: 74px; color: var(--ink-4); flex: 0 0 74px; }
.kv .v { color: var(--ink-2); }
.sys-line { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.sys-line:last-child { border-bottom: none; }
.sys-line .ic { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; flex: 0 0 26px; }
.sys-line .n { font-size: 12.5px; color: var(--ink-2); }
.sys-line .r { margin-left: auto; font-size: 11px; color: var(--brand); background: var(--brand-soft); padding: 2px 6px; border-radius: 5px; }
.panel-title { font-size: 13px; font-weight: 600; margin: 18px 0 6px; color: var(--ink); }
.panel-title:first-child { margin-top: 0; }

/* 响应式：窄屏收起侧栏两列 */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}

/* 用户页：左表右详情 */
.split-users { display: grid; grid-template-columns: 1fr 330px; gap: 16px; align-items: start; }
@media (max-width: 1180px) { .split-users { grid-template-columns: 1fr; } }

/* ============================================================
   多页签（Tab Bar）
   ============================================================ */

.tabbar {
  height: 38px; flex: 0 0 38px;
  background: #f7f9fc; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px; overflow-x: auto; overflow-y: hidden;
}
.tabbar::-webkit-scrollbar { height: 0; }

.tab-item {
  height: 27px; padding: 0 9px; border-radius: 7px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-3); cursor: pointer;
  background: #fff; border: 1px solid transparent;
  white-space: nowrap; user-select: none; flex: 0 0 auto;
  transition: background .12s, color .12s;
}
.tab-item:hover { background: #fff; border-color: var(--line); color: var(--ink-2); }
.tab-item.on {
  background: #fff; border-color: #c9d6ef; color: var(--brand); font-weight: 600;
  box-shadow: 0 1px 2px rgba(16,24,40,.06);
}
.tab-item .pin { color: #c9d0dc; font-size: 14px; line-height: 1; }
.tab-item .x {
  width: 15px; height: 15px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #98a2b3;
}
.tab-item .x:hover { background: #e8edf6; color: #b42318; }

.tab-tools { margin-left: auto; display: flex; gap: 4px; flex: 0 0 auto; padding-left: 8px; }
.tab-btn {
  height: 24px; padding: 0 9px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--ink-3); font-size: 11.5px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.tab-btn:hover { background: #fff; border-color: var(--line); color: var(--ink-2); }

/* 多页签容器：每个页签一个独立滚动面板，切换时保留滚动位置与表单状态 */
#viewport { position: relative; padding: 0; overflow: hidden; }
.pane { position: absolute; inset: 0; overflow-y: auto; padding: 20px 24px 28px; }
.pane:not(.on) { visibility: hidden; pointer-events: none; }


/* 危险操作按钮 & 确认弹窗 */
.btn-danger { background: #d92d20; border-color: #d92d20; color: #fff; box-shadow: 0 1px 2px rgba(217,45,32,.3); }
.btn-danger:hover { background: #b42318; border-color: #b42318; }
.confirm-ic {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; line-height: 1;
}
.confirm-ic.danger { background: #fee4e2; color: #d92d20; }
.confirm-ic.info { background: #e8f2fe; color: #175cd3; }
.confirm-body { flex: 1; min-width: 0; }
.confirm-title { font-size: 15px; font-weight: 600; color: #101828; margin-bottom: 6px; }
.confirm-msg { font-size: 12.5px; color: #667085; line-height: 1.75; white-space: pre-line; }

/* hidden 属性要被类选择器尊重，否则 display:flex 会盖掉它 */
.demo-bar[hidden] { display: none; }


/* ── 身份类型：多选下拉 ───────────────────────── */
.ms { position: relative; }
.ms-box {
  min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 6px 34px 6px 12px; cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s;
}
.ms-box:hover { border-color: #c7d2fe; }
.ms-box.open { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.ms-ph { font-size: 13px; color: var(--ink-4); }
.ms-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-4); font-size: 12px; }
.ms-chip {
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; padding: 2px 8px; border-radius: 6px; line-height: 1.7;
}
.ms-panel {
  margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  box-shadow: 0 8px 24px rgba(16,24,40,.10); overflow: hidden;
}
.ms-opt {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.ms-opt:hover { background: #f8f9fc; }
.ms-opt + .ms-opt { border-top: 1px solid var(--line-2); }
.ms-tick {
  width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid #d0d5dd;
  flex: 0 0 16px; position: relative; background: #fff;
}
.ms-opt.on .ms-tick { background: var(--brand); border-color: var(--brand); }
.ms-opt.on .ms-tick::after {
  content: ""; position: absolute; left: 4.5px; top: 1px;
  width: 4px; height: 8px; border: solid #fff; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg);
}
.ms-code { margin-left: auto; font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

/* 列表 / 详情里的身份类型小标签 */
.id-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.id-tag {
  font-size: 11px; line-height: 1.6; padding: 0 6px; border-radius: 5px;
  background: #eef2ff; color: #4f46e5; border: 1px solid #e0e7ff;
}
/* ── 审批弹窗：单据内容（kv 两列）+ 变更对比 + 折叠轨迹 ── */
.appr-badge {
  margin-left: 8px; padding: 1px 7px; border-radius: 20px; font-style: normal;
  background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 500;
}
.appr-link {
  border: 0; background: none; padding: 0; cursor: pointer; font: inherit;
  font-size: 12px; color: var(--brand);
}
.appr-link:hover { text-decoration: underline; }

.appr-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.appr-kv-row { display: flex; gap: 10px; padding: 6px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line-2); }
.appr-kv-row .k { flex: 0 0 82px; color: var(--ink-4); }
.appr-kv-row .v { flex: 1; min-width: 0; color: var(--ink-2); word-break: break-word; }
@media (max-width: 720px) { .appr-kv { grid-template-columns: 1fr; } }

.appr-diff { margin-top: 12px; }
.appr-diff-hd { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.appr-diff-hd b { color: var(--brand); }
.appr-diff-tb { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.appr-diff-tb th, .appr-diff-tb td { padding: 6px 8px; border-bottom: 1px dashed var(--line-2); text-align: left; }
.appr-diff-tb th { color: var(--ink-4); font-weight: 500; font-size: 11.5px; }
.appr-diff-tb .old { color: #b42318; text-decoration: line-through; opacity: .85; }
.appr-diff-tb .new { color: #067647; font-weight: 500; }

/* 节点列表在卡片里去掉最后一行分隔感 */
.appr-nodes .flow-node:last-child { padding-bottom: 2px; }

/* 轨迹折叠 */
.appr-details { border-top: 1px solid var(--line-2); }
.appr-details > summary {
  list-style: none; cursor: pointer; padding: 9px 14px;
  font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px;
  user-select: none;
}
.appr-details > summary::-webkit-details-marker { display: none; }
.appr-details > summary::before {
  content: "▸"; color: var(--ink-4); font-size: 11px; transition: transform .15s;
}
.appr-details[open] > summary::before { transform: rotate(90deg); }
.appr-details > summary span { color: var(--ink-4); font-size: 11.5px; }
.appr-details > summary:hover { background: #fafbfd; color: var(--ink-2); }
/* 审批进度卡片里的节点：两列排布（压缩高度、避免第 5 个被裁） */
.appr-card-bd.appr-nodes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding-top: 8px; }
.appr-nodes .flow-node { padding: 8px 0; }
.appr-nodes .flow-node + .flow-node { border-top: none; }
.appr-nodes .flow-node:nth-child(n+3) { border-top: 1px dashed var(--line-2); }
.appr-nodes .flow-node:nth-child(2n) { padding-left: 0; }
@media (max-width: 720px) {
  .appr-card-bd.appr-nodes { grid-template-columns: 1fr; }
  .appr-nodes .flow-node + .flow-node { border-top: 1px dashed var(--line-2); }
}
/* ── 流程定义编辑器（重做） ───────────────────────────── */
.fd-section { margin-bottom: 20px; }
.fd-section:last-child { margin-bottom: 4px; }
.fd-section-hd {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px;
}
.fd-section-sub { font-weight: 400; color: var(--ink-4); font-size: 11.5px; }
.fd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.fd-field label { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.fd-req { color: #d92d20; margin-left: 3px; }
.fd-opt { color: var(--ink-4); margin-left: 6px; font-size: 11px; }
@media (max-width: 720px) { .fd-grid { grid-template-columns: 1fr; } }

.fd-nodes { display: flex; flex-direction: column; gap: 10px; }
.fd-node { border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.fd-node:hover { border-color: #d7dded; box-shadow: 0 2px 10px rgba(16,24,40,.05); }
.fd-node-hd { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.fd-seq {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  font-size: 12px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.fd-node .fd-name { flex: 1; min-width: 0; height: 32px; }
.fd-seg { display: inline-flex; background: #f2f4f8; border-radius: 8px; padding: 2px; flex: 0 0 auto; }
.fd-seg button {
  height: 26px; padding: 0 10px; border: 0; background: none; border-radius: 6px;
  font: inherit; font-size: 12px; color: var(--ink-3); cursor: pointer;
}
.fd-seg button.on { background: #fff; color: var(--brand); font-weight: 500; box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.fd-node-tools { display: flex; gap: 2px; flex: 0 0 auto; }
.fd-icon {
  width: 26px; height: 26px; border: 0; background: none; border-radius: 6px;
  color: var(--ink-4); cursor: pointer; font-size: 13px; line-height: 1;
}
.fd-icon:hover:not(:disabled) { background: #f2f4f8; color: var(--ink-2); }
.fd-icon.danger:hover:not(:disabled) { background: #feeceb; color: #b42318; }
.fd-icon:disabled { opacity: .32; cursor: not-allowed; }

.fd-node-bd { padding: 0 12px 12px 44px; }
.fd-approvers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px;
  border-radius: 20px; background: #eef2fe; color: #3b4a6b; font-size: 12px;
}
.fd-chip em { font-style: normal; color: #8792a8; font-size: 11px; }
.fd-chip button {
  border: 0; background: none; color: #7a869c; cursor: pointer; font-size: 11px;
  line-height: 1; padding: 2px; border-radius: 50%;
}
.fd-chip button:hover { color: #b42318; background: #fff; }
.fd-chip-add {
  height: 26px; padding: 0 10px; border: 1px dashed #c3ccdd; border-radius: 20px;
  background: #fff; color: var(--ink-3); font: inherit; font-size: 12px; cursor: pointer;
}
.fd-chip-add:hover { border-color: var(--brand-2); color: var(--brand); background: var(--brand-soft); }
.fd-note { font-size: 11.5px; color: var(--ink-4); }

.fd-pick { margin-top: 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fbfcfe; padding: 8px; }
.fd-pick .fd-pick-q { height: 30px; margin-bottom: 8px; }
.fd-pick-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-height: 170px; overflow: auto; }
@media (max-width: 720px) { .fd-pick-list { grid-template-columns: 1fr 1fr; } }
.fd-user {
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 9px;
  border: 1px solid transparent; border-radius: 7px; background: #fff;
  font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer; text-align: left;
}
.fd-user:hover { border-color: #d7dded; }
.fd-user .fd-check {
  flex: 0 0 14px; height: 14px; border-radius: 4px; border: 1px solid #cfd6e2; background: #fff;
  font-size: 10px; color: transparent; display: flex; align-items: center; justify-content: center;
}
.fd-user em { font-style: normal; color: var(--ink-4); font-size: 11px; margin-left: auto; }
.fd-user.on { border-color: var(--brand-2); background: var(--brand-soft); }
.fd-user.on .fd-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.fd-pick-ft { display: flex; justify-content: flex-end; margin-top: 8px; }
.fd-add {
  width: 100%; height: 40px; margin-top: 10px; border: 1px dashed #c3ccdd; border-radius: 10px;
  background: #fff; color: var(--ink-3); font: inherit; font-size: 12.5px; cursor: pointer;
}
.fd-add:hover { border-color: var(--brand-2); color: var(--brand); background: var(--brand-soft); }
/* 弹窗内的分区卡片之间留出间距（单栏排版时卡片是兄弟节点） */
.modal .mb > .appr-card { margin-bottom: 14px; }
.modal .mb > .appr-card:last-child { margin-bottom: 2px; }
.modal .mb > .flow-head + .appr-card { margin-top: 0; }
/* ── 消息中心 ─────────────────────────────────────────── */
.page-sub { font-size: 12.5px; color: var(--ink-4); margin-top: 4px; }
.head-actions { display: flex; gap: 8px; align-items: center; }

.msg-list { display: flex; flex-direction: column; }
.msg-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 4px;
  border-bottom: 1px dashed var(--line-2); cursor: pointer;
}
.msg-item:last-child { border-bottom: none; }
.msg-item:hover { background: #fafbfd; }
.msg-dot {
  flex: 0 0 7px; height: 7px; border-radius: 50%; margin-top: 7px;
  background: transparent;
}
.msg-item.is-unread .msg-dot { background: var(--brand); }
.msg-main { flex: 1; min-width: 0; }
.msg-title { font-size: 13.5px; color: var(--ink-2); font-weight: 500; line-height: 1.5; }
.msg-item.is-unread .msg-title { color: var(--ink); font-weight: 600; }
.msg-preview {
  font-size: 12.5px; color: var(--ink-4); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--ink-4); flex-wrap: wrap; }
.msg-time { margin-left: auto; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.msg-go { flex: 0 0 auto; font-size: 12px; color: var(--brand); align-self: center; }

.msg-detail-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-4); }
.msg-detail-body {
  font-size: 13px; color: var(--ink-2); line-height: 1.9; white-space: pre-wrap;
  background: #fafbfd; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px;
}
/* ── 消息通知设置页 ─────────────────────────────────── */
.msg-hint { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
.msg-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-var {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font: inherit; font-size: 11.5px; color: var(--brand); cursor: pointer; line-height: 1.3;
}
.msg-var em { font-style: normal; color: var(--ink-4); font-size: 10.5px; }
.msg-var:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.msg-preview { border: 1px solid var(--line-2); border-radius: 10px; background: #fafbfd; padding: 12px 14px; }
.msg-preview-t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.msg-preview-b { font-size: 12.5px; color: var(--ink-2); line-height: 1.9; margin-top: 6px; white-space: pre-wrap; }
.msg-preview-m { font-size: 11.5px; color: var(--ink-4); margin-top: 10px; }
/* ── 通知模板编辑器（v2）────────────────────────────── */
.mt-field { margin-bottom: 16px; }
.mt-field > label {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; color: var(--ink-3); margin-bottom: 7px;
}
.mt-label-hint { font-size: 11px; color: var(--ink-4); }
.mt-mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px; }
.mt-mono::placeholder { font-family: inherit; color: #a8b2c4; }
textarea.mt-mono { line-height: 1.85; }

.mt-top { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 720px) { .mt-top { grid-template-columns: 1fr; } }

/* 渠道选择：胶囊 + 勾 */
.msg-chs { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-ch {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font: inherit; font-size: 12.5px; color: var(--ink-3); cursor: pointer; transition: .15s;
}
.msg-ch:hover { border-color: #cdd5e3; }
.msg-ch-box {
  width: 15px; height: 15px; border-radius: 4px; border: 1px solid #cfd6e2; background: #fff;
  font-size: 10px; line-height: 1; color: transparent; display: flex; align-items: center; justify-content: center;
}
.msg-ch.on { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.msg-ch.on .msg-ch-box { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 变量：单行小胶囊，按类别分组 */
.mt-vars { display: flex; flex-direction: column; gap: 7px; }
.mt-var-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mt-var-group {
  flex: 0 0 auto; width: 34px; font-size: 11px; color: var(--ink-4); letter-spacing: .5px;
}
.mt-var {
  height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line-2);
  background: #fbfcfe; color: #4f5b76; cursor: pointer; font: inherit;
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; white-space: nowrap;
}
.mt-var:hover { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand); }

/* 预览：微信气泡 */
.mt-preview { background: #f2f3f5; border-radius: 12px; padding: 16px; }
.mt-bubble {
  max-width: 420px; background: #fff; border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(16,24,40,.06); position: relative;
}
.mt-bubble::before {
  content: ""; position: absolute; left: -6px; top: 14px;
  border: 6px solid transparent; border-right-color: #fff;
}
.mt-bubble-t { font-size: 13.5px; font-weight: 600; color: #1b2338; line-height: 1.5; }
.mt-bubble-b { font-size: 12.5px; color: #475467; line-height: 1.9; margin-top: 6px; word-break: break-word; }
.mt-bubble-m { font-size: 11.5px; color: var(--ink-4); margin-top: 10px; padding-left: 2px; }
/* ── 渠道配置弹窗 ───────────────────────────────────── */
.cfg-head { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.cfg-head-main { flex: 1; min-width: 0; }
.cfg-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.cfg-meta { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; }
.cfg-meta code { font-family: ui-monospace, Consolas, monospace; background: #f2f4f8; padding: 1px 5px; border-radius: 4px; }
.cfg-h { flex: 0 0 auto; font-size: 11.5px; padding: 2px 9px; border-radius: 20px; background: #f2f4f7; color: #667085; }
.cfg-h-ok { background: #e7f6ee; color: #067647; }
.cfg-h-bad { background: #feeceb; color: #b42318; }

.cfg-section-title { font-size: 12px; color: var(--ink-4); letter-spacing: .5px; margin-bottom: 10px; }
.cfg-field { margin-bottom: 14px; }
.cfg-field > label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.cfg-hint { font-size: 11.5px; color: var(--ink-4); margin-top: 5px; line-height: 1.6; }

.cfg-banner {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: 9px; background: #eef4ff; color: #3538cd;
  font-size: 12px; line-height: 1.65; margin-bottom: 16px;
}
.cfg-banner code { font-family: ui-monospace, Consolas, monospace; background: rgba(53,56,205,.1); padding: 1px 5px; border-radius: 4px; }
.cfg-banner-ic {
  flex: 0 0 16px; height: 16px; border-radius: 50%; background: #3538cd; color: #fff;
  font-size: 10px; font-style: italic; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}

.cfg-switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 14px; border-top: 1px solid var(--line-2);
}
.cfg-switch-t { font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* 开关 */
.switch {
  position: relative; flex: 0 0 auto; width: 44px; height: 24px; border-radius: 12px;
  border: 0; background: #e4e7ec; cursor: pointer; transition: background .18s; padding: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.24);
  transition: left .18s;
}
.switch.on { background: var(--brand); }
.switch.on::after { left: 23px; }

/* ── 选人浮层（不撑开弹窗）────────────────────────── */
.fd-pop {
  position: fixed; z-index: 4000; display: flex; flex-direction: column; gap: 8px;
  padding: 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 14px 36px rgba(16,24,40,.18);
}
.fd-pop-q { height: 34px !important; font-size: 12.5px !important; }
.fd-pop-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.fd-pop-user {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 9px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; text-align: left;
}
.fd-pop-user:hover { background: #f6f7fb; }
.fd-pop-user.on { background: var(--brand-soft); color: var(--brand); }
.fd-pop-check {
  width: 15px; height: 15px; flex: 0 0 15px; border-radius: 4px;
  border: 1px solid #cfd6e2; background: #fff; color: transparent;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.fd-pop-user.on .fd-pop-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.fd-pop-name { flex: 0 0 auto; }
.fd-pop-user em { font-style: normal; font-size: 11px; color: var(--ink-4); margin-left: auto; }
.fd-pop-ft { display: flex; justify-content: flex-end; border-top: 1px solid var(--line-2); padding-top: 8px; }

/* ── 子系统顶栏：切换系统（全局唯一样式） ───────────── */
.ss-wrap { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.ss-btn {
  height: 30px; padding: 0 9px; border-radius: 8px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; color: var(--ink-3);
  background: #f7f8fc; white-space: nowrap; transition: background .12s, border-color .12s;
}
.ss-btn:hover { background: var(--brand-soft); border-color: #c7d7fe; color: var(--brand); }
.ss-btn.cur { background: var(--brand-soft); border-color: #c7d7fe; color: var(--brand); font-weight: 600; cursor: default; }
.ss-logo { width: 18px; height: 18px; border-radius: 5px; object-fit: cover; display: block; }
.ss-caret { font-size: 9px; opacity: .6; margin-left: -1px; }
.ss-more.open .ss-caret { transform: rotate(180deg); }
.ss-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 3px; }
.ss-btn.ss-home { background: #fff; border-color: var(--line); }
.ss-btn.ss-home:hover { background: var(--brand-soft); border-color: #c7d7fe; color: var(--brand); }

.ss-pop {
  position: fixed; z-index: 3000; width: 288px; padding: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
}
.ss-pop-hd { font-size: 11.5px; color: var(--ink-4); padding: 2px 4px 8px; }
.ss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ss-tile {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 9px; background: #fbfcfe;
  font-family: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; text-align: left;
}
.ss-tile:hover { background: var(--brand-soft); border-color: #c7d7fe; color: var(--brand); }
@media (max-width: 1100px) {
  .ss-btn span:not(.ss-caret) { display: none; }
  .ss-btn { padding: 0 7px; }
}

/* ── 移动端权限 ────────────────────────────────────── */
.wb-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 12px; align-items: start; }
.wb-search input { width: 100%; height: 34px; }
.wb-stat { display: flex; gap: 14px; font-size: 12px; color: #667085; margin: 10px 0; }
.wb-stat b { color: #1b2338; }
.wb-list { border: 1px solid #eaecf0; border-radius: 10px; max-height: 520px; overflow: auto; }
.wb-user { display: flex; align-items: center; gap: 10px; padding: 9px 10px; cursor: pointer; border-bottom: 1px solid #f2f4f7; }
.wb-user:last-child { border-bottom: 0; }
.wb-user:hover { background: #fafbff; }
.wb-user.on { background: #eef2ff; }
.wb-check input { width: 15px; height: 15px; accent-color: #6366f1; }
.wb-user-main { flex: 1; min-width: 0; }
.wb-user-main .nm { font-size: 13px; color: #1b2338; }
.wb-user-main .sub { font-size: 11.5px; color: #98a2b3; }
.wb-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; font-size: 12px; color: #667085; }
.wb-detail-head { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid #f2f4f7; }
.wb-detail-name { font-size: 15px; font-weight: 600; color: #1b2338; }
.wb-detail-head .sub { font-size: 12px; color: #98a2b3; margin-top: 2px; }
.wb-perms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.wb-perm { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1px solid #eaecf0; border-radius: 10px; cursor: pointer; }
.wb-perm:hover { background: #fafbff; }
.wb-perm input { width: 15px; height: 15px; margin-top: 2px; accent-color: #6366f1; }
.wb-perm-txt { display: flex; flex-direction: column; }
.wb-perm-txt b { font-size: 13px; color: #1b2338; font-weight: 500; }
.wb-perm-txt i { font-size: 11.5px; color: #98a2b3; font-style: normal; }
.wb-detail-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid #f2f4f7; }
.wb-hint { font-size: 12px; color: #98a2b3; }
@media (max-width: 900px) { .wb-layout { grid-template-columns: 1fr; } .wb-perms { grid-template-columns: 1fr; } }

/* ── 弹窗标题：单行省略，不挤压关闭按钮 ── */
.modal .mh { gap: 12px; }
.modal .mh .mh-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-head-title {
  font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.45;
  margin-bottom: 4px; word-break: break-word;
}

/* ── 子系统授权：多选用户 ───────────────────────────── */
.grant-pick-list {
  max-height: 264px; overflow: auto; margin-top: 8px;
  border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
}
.grant-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f2f4f7;
  font-size: 13px;
}
.grant-pick:last-child { border-bottom: 0; }
.grant-pick:hover { background: #fafbff; }
.grant-pick.disabled { opacity: .55; cursor: not-allowed; }
.grant-pick input { width: 15px; height: 15px; accent-color: var(--brand); }
.grant-pick .gname { color: var(--ink); }
.grant-pick .gdept { margin-left: auto; font-size: 12px; color: var(--ink-4); }
.grant-pick-count { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--brand); }

/* ── 流程中心：行内按钮组 / 摘要省略 ── */
.todo-ops { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.todo-sum-ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 流程中心：三个页签统一单行元信息 ── */
.flow-row .todo-main { min-width: 0; }
.flow-row .todo-meta { flex-wrap: nowrap; overflow: hidden; }
.flow-row .todo-meta > span { white-space: nowrap; }
.flow-row .todo-sum-ellipsis { max-width: 240px; }

/* ── 流程中心：空态与有数据时工具条高度一致（胶囊距卡片顶相同） ── */
#flowBody .todo-toolbar { align-items: center; }
#flowBody .todo-toolbar .todo-appsel,
#flowBody .todo-toolbar .input { height: 30px; }

/* 门户 · 通知公告（双栏收件箱） */
.inbox-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); min-height: 480px; }
@media (max-width: 980px) { .inbox-grid { grid-template-columns: 1fr; } }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
@media (max-width: 980px) { .inbox-list { border-right: 0; border-bottom: 1px solid var(--line); } }
.inbox-items { flex: 1 1 auto; overflow: auto; max-height: 560px; }
.inbox-item { display: flex; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.inbox-item:hover { background: #fafbff; }
.inbox-item.on { background: var(--brand-soft); }
.inbox-item .d { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; margin-top: 7px; flex: 0 0 7px; }
.inbox-item.unread .d { background: var(--brand); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14); }
.inbox-item .t { font-size: 13px; color: var(--ink-2); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.inbox-item.unread .t { font-weight: 600; color: var(--ink); }
.inbox-item .m { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.inbox-item .clip { margin-left: auto; color: var(--ink-4); }
.inbox-pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line-2); }
.inbox-preview { padding: 18px 22px; min-width: 0; }
.inbox-preview h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.inbox-preview .meta { font-size: 11.5px; color: var(--ink-4); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.inbox-preview .body { font-size: 13.5px; color: var(--ink-2); line-height: 2; white-space: pre-wrap; word-break: break-word; }
.inbox-files { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 12px; }
.inbox-files .hd { font-size: 12px; color: var(--ink-4); margin-bottom: 8px; }
.inbox-file { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
.inbox-file:hover { border-color: #c7d7fe; background: #fafbff; color: var(--brand); }
.inbox-file .sz { margin-left: auto; font-size: 11.5px; color: var(--ink-4); }
