:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-soft: #e6f4ff;
  --primary-border: #91caff;
  --page: #f4f6f8;
  --surface: #fff;
  --line: #e8ebef;
  --line-strong: #d8dde5;
  --text: #17233d;
  --muted: #667085;
  --subtle: #98a2b3;
  --danger: #e5484d;
  --warning: #f79009;
  --success: #17a673;
  --purple: #7a5af8;
  --sidebar: 208px;
  --shadow: 0 6px 20px rgba(23, 35, 61, .06);
}

* { box-sizing: border-box; }
html, body, #app { min-width: 1180px; min-height: 100%; margin: 0; }
body {
  color: var(--text);
  background: var(--page);
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20;
  width: var(--sidebar); background: #fff; border-right: 1px solid #edf0f3;
  display: flex; flex-direction: column;
}
.brand { height: 64px; padding: 0 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #f0f2f5; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; background: #1677ff; font-weight: 700; box-shadow: 0 5px 12px rgba(22,119,255,.25); }
.brand-copy strong { display: block; font-size: 15px; letter-spacing: .02em; }
.brand-copy span { display: block; margin-top: 2px; font-size: 11px; color: var(--subtle); }
.nav { flex: 1; padding: 10px 8px 20px; overflow-y: auto; }
.nav-group { margin-bottom: 4px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 6px; color: #344054; user-select: none; }
.nav-item.parent { font-weight: 500; }
.nav-item.parent.active { color: var(--primary); background: var(--primary-soft); }
.nav-item.parent.active .nav-icon, .nav-item.parent.active .chevron { color: var(--primary); }
.nav-item .nav-icon { width: 20px; color: #344054; font-size: 17px; text-align: center; }
.nav-item .chevron { margin-left: auto; color: #98a2b3; font-size: 11px; }
.nav-children { margin: 1px 0 5px; }
.nav-child { height: 40px; display: flex; align-items: center; padding-left: 43px; border-radius: 6px; color: #475467; cursor: pointer; position: relative; }
.nav-child:hover { background: #f5f8fc; }
.nav-child.active { color: var(--primary); background: #eaf4ff; font-weight: 500; }
.nav-child.active::before { content: ""; width: 3px; height: 18px; border-radius: 2px; background: var(--primary); position: absolute; left: 0; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12px; }

.topbar { position: fixed; left: var(--sidebar); right: 0; top: 0; height: 64px; z-index: 15; background: rgba(255,255,255,.97); border-bottom: 1px solid #edf0f3; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb b { color: var(--text); font-weight: 500; }
.top-actions { display: flex; gap: 18px; align-items: center; }
.device-preview-link { height: 30px; padding: 0 11px; display: inline-flex; align-items: center; border: 1px solid #c7e0ff; border-radius: 5px; background: #f2f8ff; color: var(--primary); font-size: 12px; text-decoration: none; }
.device-preview-link:hover { border-color: var(--primary); background: #eaf4ff; }
.bell { position: relative; font-size: 18px; }
.bell::after { content: "3"; position: absolute; right: -9px; top: -8px; min-width: 16px; height: 16px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; display: grid; place-items: center; border: 2px solid #fff; }
.user { display: flex; align-items: center; gap: 9px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #4c8bf5; font-size: 12px; }
.user-meta strong { display: block; font-size: 13px; font-weight: 500; }
.user-meta span { color: var(--subtle); font-size: 11px; }

.main { margin-left: var(--sidebar); padding-top: 64px; min-height: 100vh; }
.page { padding: 18px 22px 36px; max-width: 1740px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.page-title { margin: 0; font-size: 20px; line-height: 30px; font-weight: 600; letter-spacing: .01em; }
.page-desc { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; }

.btn { height: 34px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: #344054; transition: .16s ease; }
.btn:hover { color: var(--primary); border-color: var(--primary-border); }
.btn.primary { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 2px 5px rgba(22,119,255,.2); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #f3b9bc; }
.btn.text { height: auto; padding: 0; border: 0; background: transparent; color: var(--primary); box-shadow: none; }
.btn.text.danger { color: var(--danger); }
.btn.small { height: 28px; padding: 0 10px; }
.btn:disabled { cursor: not-allowed; opacity: .5; }

.card { background: #fff; border: 1px solid #edf0f3; border-radius: 7px; box-shadow: 0 1px 2px rgba(16,24,40,.02); }
.card-head { height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 600; }
.card-subtitle { color: var(--subtle); font-size: 12px; margin-left: 8px; font-weight: 400; }
.card-body { padding: 16px; }

.my-task-card { margin-bottom: 14px; }
.scope-label { min-height: 24px; padding: 0 9px; display: inline-flex; align-items: center; color: #52627a; background: #f2f5f8; border-radius: 4px; font-size: 11px; }
.task-type { display: inline-flex; align-items: center; padding: 3px 8px; color: #315b87; background: #edf6ff; border-radius: 4px; font-size: 12px; }
.select-help { margin-top: 5px; color: var(--subtle); font-size: 11px; line-height: 1.5; }
.control.person-multi { height: auto; min-height: 142px; padding: 5px; }
.control.person-multi option { padding: 7px 8px; border-radius: 3px; }

.todo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.todo-card { cursor: pointer; position: relative; overflow: hidden; min-height: 104px; padding: 17px 18px; background: #fff; border: 1px solid #edf0f3; border-radius: 7px; transition: .18s ease; }
.todo-card:hover { transform: translateY(-2px); border-color: #c8ddff; box-shadow: var(--shadow); }
.todo-card::after { content: ""; width: 54px; height: 54px; position: absolute; right: -7px; bottom: -10px; border-radius: 50%; background: var(--accent-soft); }
.todo-label { color: #475467; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.todo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.todo-value { margin-top: 8px; font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: 30px; line-height: 34px; color: #101828; font-weight: 600; }
.todo-unit { margin-left: 4px; color: var(--subtle); font-size: 12px; font-family: inherit; font-weight: 400; }
.workspace-grid { display: grid; grid-template-columns: minmax(660px, 1.7fr) minmax(340px, .8fr); gap: 14px; margin-bottom: 14px; }
.urgent-row { display: grid; grid-template-columns: 65px minmax(210px,1fr) 105px 115px 145px; gap: 10px; align-items: center; min-height: 60px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; cursor: pointer; }
.urgent-row:last-child { border: 0; }
.urgent-row:hover .urgent-name { color: var(--primary); }
.urgent-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secondary { color: var(--muted); font-size: 12px; margin-top: 4px; }
.status-summary { display: flex; align-items: center; gap: 26px; min-height: 235px; }
.donut { --value: 72%; width: 150px; height: 150px; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(var(--primary) 0 28%, #f79009 28% 45%, #7a5af8 45% 63%, #17a673 63% 88%, #d0d5dd 88% 100%); position: relative; }
.donut::after { content: ""; position: absolute; inset: 21px; border-radius: 50%; background: #fff; }
.donut-center { position: absolute; z-index: 1; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: 27px; }
.donut-center span { color: var(--subtle); font-size: 12px; }
.legend { flex: 1; }
.legend-item { display: flex; align-items: center; margin: 12px 0; }
.legend-color { width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; }
.legend-name { color: #475467; }
.legend-value { margin-left: auto; font-family: "Bahnschrift", sans-serif; }
.segment { display: inline-flex; padding: 3px; border-radius: 5px; background: #f2f4f7; }
.segment button { height: 26px; padding: 0 10px; border: 0; background: transparent; border-radius: 4px; color: var(--muted); font-size: 12px; }
.segment button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(16,24,40,.1); }

/* 工作台保持高密度信息布局，1920×1080 下可在单屏完成浏览。 */
.workbench-page { padding-top: 14px; padding-bottom: 8px; }
.workbench-page .page-head { margin-bottom: 9px; }
.workbench-page .page-title { font-size: 18px; line-height: 24px; }
.workbench-page .todo-grid { margin-bottom: 10px; }
.workbench-page .todo-card { min-height: 68px; padding: 9px 14px; }
.workbench-page .todo-value { margin-top: 3px; font-size: 25px; line-height: 27px; }
.workbench-page .my-task-card { margin-bottom: 10px; }
.workbench-page .my-task-card .card-head,
.workbench-page .workspace-grid .card-head,
.workbench-page > .card:last-child .card-head { height: 40px; }
.workbench-page .my-task-card th,
.workbench-page > .card:last-child th { height: 30px; }
.workbench-page .my-task-card td,
.workbench-page > .card:last-child td { height: 32px; }
.workbench-page .my-task-card td,
.workbench-page > .card:last-child td { font-size: 12px; line-height: 1.2; }
.workbench-page .my-task-card .secondary,
.workbench-page > .card:last-child .secondary { margin-top: 1px; line-height: 1.2; }
.workbench-page .workspace-grid { margin-bottom: 10px; }
.workbench-page .workspace-grid .card-body { padding-top: 4px; padding-bottom: 4px; }
.workbench-page .urgent-row { grid-template-columns: 52px minmax(220px,1fr) 135px 95px 125px; gap: 8px; min-height: 36px; padding: 3px 0; font-size: 12px; line-height: 1.2; }
.workbench-page .urgent-row .secondary { margin-top: 1px; font-size: 11px; line-height: 1.2; }
.workbench-page .status-summary { min-height: 150px; gap: 18px; }
.workbench-page .donut { width: 100px; height: 100px; }
.workbench-page .donut::after { inset: 15px; }
.workbench-page .legend-item { margin: 5px 0; }
.workbench-page + footer { display: none; }
.route-preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; padding: 12px 14px; border: 1px solid #d9e8f8; border-radius: 6px; background: #f7fbff; }
.route-preview-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.route-preview-item label { margin: 0; color: var(--subtle); font-size: 11px; }
.route-preview-item strong { overflow: hidden; color: #173b65; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.route-preview-item span { color: #8091a5; font-size: 11px; }
.route-handler-select { width: 100%; height: 32px; padding: 0 9px; border: 1px solid #b9cce2; border-radius: 5px; background: #fff; color: #173b65; font-size: 13px; outline: 0; }
.route-handler-select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.route-preview-status { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid #e3edf7; color: #718198; font-size: 12px; }
.route-preview-empty { padding: 14px; border: 1px dashed #cbd7e6; border-radius: 6px; background: #fafbfd; color: var(--subtle); font-size: 12px; }
.workflow-preview-section { margin-bottom: 72px; }
.workflow-preview-section .flow-steps { min-height: 128px; }

.filter-card { margin-bottom: 12px; }
.filter-card .card-body { padding: 16px 16px 12px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(190px,1fr)); gap: 14px 18px; align-items: end; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 7px; color: #475467; font-size: 13px; }
.required::before { content: "*"; color: var(--danger); margin-right: 3px; }
.control { width: 100%; height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: #344054; outline: 0; transition: .15s; }
.control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.control::placeholder { color: #b1b8c4; }
textarea.control { min-height: 82px; padding: 9px 11px; resize: vertical; line-height: 1.7; }
.suffix-control { position: relative; }
.suffix-control .control { padding-right: 48px; }
.suffix { position: absolute; right: 11px; top: 8px; color: var(--subtle); }
.filter-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; grid-column: 4; grid-row: 1; white-space: nowrap; }
.advanced { display: none; grid-column: 1 / -1; grid-template-columns: repeat(4,minmax(190px,1fr)); gap: 14px 18px; }
.advanced.show { display: grid; }

.tabs { height: 47px; display: flex; align-items: flex-end; gap: 28px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tab { height: 47px; padding: 0 2px; border: 0; background: transparent; color: #475467; position: relative; }
.tab.active { color: var(--primary); font-weight: 500; }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }
.tab-count { min-width: 20px; height: 18px; display: inline-grid; place-items: center; margin-left: 5px; padding: 0 6px; border-radius: 10px; background: #f2f4f7; color: var(--muted); font-size: 11px; }
.tab.active .tab-count { background: var(--primary-soft); color: var(--primary); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { height: 40px; padding: 0 10px; background: #fafafa; border-bottom: 1px solid var(--line); color: #344054; font-size: 12px; text-align: left; font-weight: 600; }
td { height: 52px; padding: 0 10px; border-bottom: 1px solid #f0f1f3; color: #344054; font-size: 13px; }
tbody tr:hover { background: #f8fbff; }
.link { color: var(--primary); cursor: pointer; }
.name-cell { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 4px; font-size: 12px; line-height: 22px; border: 1px solid transparent; }
.tag.blue { color: #1677ff; background: #eaf4ff; border-color: #c7e0ff; }
.tag.orange { color: #d46b08; background: #fff7e6; border-color: #ffe0a3; }
.tag.red { color: #d9363e; background: #fff1f0; border-color: #ffc7c4; }
.tag.green { color: #12805c; background: #edf9f4; border-color: #b8ead7; }
.tag.gray { color: #667085; background: #f2f4f7; border-color: #e4e7ec; }
.tag.purple { color: #6941c6; background: #f4f0ff; border-color: #d9ccff; }
.priority { display: inline-flex; align-items: center; gap: 5px; }
.priority::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.priority.emergency { color: var(--danger); }
.priority.important { color: var(--warning); }
.priority.normal { color: #667085; }
.ops { display: flex; align-items: center; gap: 12px; }
.command-data-table { min-width: 1840px; }
.task-data-table { min-width: 1610px; }
.table-preview-btn { height: auto; padding: 0; border: 0; background: transparent; color: #1677ff; font-size: 12px; line-height: 1.5; cursor: pointer; transition: color .15s ease, text-decoration-color .15s ease; }
.table-preview-btn:hover,
.table-preview-btn:focus-visible { background: transparent; color: #095fd1; text-decoration: underline; text-underline-offset: 3px; outline: 0; }
.table-hover-detail { position: fixed; z-index: 140; max-height: min(620px,calc(100vh - 24px)); overflow-y: auto; border: 1px solid #cfe0f6; border-radius: 8px; background: #fff; box-shadow: 0 16px 42px rgba(28,55,90,.2); color: #344054; white-space: normal; animation: popIn .14s ease; }
.table-hover-detail[hidden] { display: none; }
.hover-detail-head { min-height: 62px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e5edf7; background: #f7fbff; }
.hover-detail-head div { min-width: 0; }
.hover-detail-head span { display: block; margin-bottom: 3px; color: #1677ff; font-size: 11px; }
.hover-detail-head strong { display: block; overflow: hidden; color: #172b4d; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.hover-detail-head em { flex: none; padding: 3px 8px; border-radius: 10px; background: #eaf4ff; color: #38658f; font-size: 11px; font-style: normal; }
.hover-detail-body { padding: 12px 15px 15px; }
.hover-command-grid,
.hover-reply-block dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; margin: 0; border-top: 1px solid #edf1f6; border-left: 1px solid #edf1f6; }
.hover-command-grid > div,
.hover-reply-block dl > div { min-width: 0; padding: 7px 9px; border-right: 1px solid #edf1f6; border-bottom: 1px solid #edf1f6; }
.hover-command-grid .wide,
.hover-reply-block dl .wide { grid-column: 1 / -1; }
.hover-command-grid dt,
.hover-reply-block dt { margin-bottom: 3px; color: #7c8ba1; font-size: 11px; }
.hover-command-grid dd,
.hover-reply-block dd { margin: 0; color: #243b5a; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.hover-reply-block + .hover-reply-block { margin-top: 12px; }
.hover-reply-block h4 { margin: 0 0 7px; color: #172b4d; font-size: 13px; }
.pager { min-height: 56px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.page-buttons { display: flex; align-items: center; gap: 7px; }
.page-button { width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: #475467; }
.page-button.active { color: var(--primary); border-color: var(--primary); }

.form-shell { max-width: 1380px; margin: 0 auto; padding-bottom: 66px; }
.backline { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.back { color: var(--muted); cursor: pointer; }
.form-section { margin-bottom: 12px; }
.section-head { height: 48px; padding: 0 18px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); font-weight: 600; }
.section-num { width: 20px; height: 20px; border-radius: 4px; color: var(--primary); background: var(--primary-soft); display: grid; place-items: center; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(260px,1fr)); gap: 17px 32px; padding: 20px 22px; }
.span-2 { grid-column: 1 / -1; }
.readonly { background: #f7f8fa; color: #667085; }
.char-count { margin-top: 4px; text-align: right; color: var(--subtle); font-size: 11px; }
.upload-box { width: 92px; height: 92px; border: 1px dashed #c9ced6; border-radius: 5px; display: grid; place-content: center; text-align: center; color: #667085; background: #fafbfc; cursor: pointer; }
.upload-box b { color: #98a2b3; font-size: 25px; font-weight: 300; line-height: 24px; }
.upload-note { margin-top: 5px; color: var(--subtle); font-size: 11px; }
.flow-steps { display: flex; align-items: flex-start; padding: 22px; overflow-x: auto; }
.flow-step { min-width: 165px; display: flex; align-items: flex-start; }
.flow-node { min-width: 120px; text-align: center; }
.flow-circle { width: 28px; height: 28px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--primary); box-shadow: 0 0 0 4px #e8f3ff; }
.flow-node strong { display: block; font-size: 13px; }
.flow-node span { color: var(--subtle); font-size: 11px; }
.flow-line { height: 1px; flex: 1; margin-top: 14px; background: #c8d8eb; }
.rule-note { margin: 0 22px 22px; padding: 11px 13px; border-radius: 5px; background: #f6f9fd; color: #52627a; font-size: 12px; }
.sticky-actions { position: fixed; z-index: 12; left: var(--sidebar); right: 0; bottom: 0; height: 58px; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); box-shadow: 0 -5px 16px rgba(23,35,61,.05); }

/* 调度指令新增/编辑：高密度三列信息布局，长文本仍独占整行。 */
.compact-command-page { max-width: 1540px; }
.compact-command-page .backline { margin-bottom: 9px; }
.compact-command-page .form-section { margin-bottom: 9px; }
.compact-command-page .section-head { height: 40px; padding: 0 15px; }
.compact-command-page .form-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px 18px; padding: 12px 16px; }
.compact-command-page .form-grid .span-2 { grid-column: 1 / -1; }
.compact-command-page #dynamic-fields .form-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 10px 18px; }
.compact-command-page .field label { margin-bottom: 4px; }
.compact-command-page textarea.control { min-height: 62px; padding: 7px 10px; line-height: 1.5; }
.compact-command-page .char-count { margin-top: 2px; }
.compact-command-page .subsection-title { margin-bottom: 8px; }
.compact-command-page .notice { margin-bottom: 10px; padding: 8px 11px; line-height: 1.45; }
.compact-command-page .upload-box { width: 72px; height: 72px; }
.compact-command-page .upload-box b { font-size: 21px; line-height: 20px; }
.compact-command-page .flow-steps { min-height: 102px; padding: 14px 16px; }
.compact-command-page .flow-step { min-width: 145px; }
.compact-command-page .rule-note { margin: 0 16px 14px; padding: 8px 11px; line-height: 1.45; }
.compact-command-page .route-preview-grid { padding: 9px 12px; }

/* 指令详情及带操作详情页：三列字段 + 更紧凑的分区密度。 */
.detail-page .backline { margin-bottom: 8px; }
.detail-page .detail-hero { padding: 12px 18px; margin-bottom: 9px; }
.detail-page .detail-no { margin-top: 5px; }
.detail-page .detail-section-head { min-height: 40px; padding: 0 15px; }
.detail-page .detail-pane { padding: 12px 15px; }
.detail-page .subsection { margin-bottom: 12px; }
.detail-page .subsection-title { margin-bottom: 8px; }
.detail-page .description-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.detail-page .description-item { min-height: 50px; grid-template-columns: 92px minmax(0,1fr); }
.detail-page .description-item dt,
.detail-page .description-item dd { padding: 8px 10px; line-height: 1.45; }
.detail-page .description-item.wide { grid-column: 1 / -1; }
.detail-page .detail-operation-section { margin-top: 9px; }
.detail-page .detail-operation-body { padding: 12px 15px 2px; }
.detail-page .detail-operation-body .notice { margin-bottom: 10px; padding: 8px 11px; }
.detail-page .detail-operation-body .form-stack { gap: 10px; }
.detail-page .detail-operation-body textarea.control { min-height: 62px; }
.detail-page .detail-operation-actions { padding: 10px 15px 12px; }

.detail-hero { padding: 19px 22px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.detail-titleline { display: flex; align-items: center; gap: 10px; }
.detail-titleline h2 { margin: 0; font-size: 18px; font-weight: 600; }
.detail-no { margin-top: 9px; color: var(--muted); font-size: 12px; }
.detail-mode-note { margin-left: 16px; color: var(--primary); font-size: 12px; }
.detail-status { display: flex; gap: 28px; align-items: center; }
.detail-metric label { display: block; color: var(--subtle); font-size: 11px; margin-bottom: 5px; }
.detail-content { overflow: hidden; }
.detail-section { border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section-head { min-height: 48px; padding: 0 18px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); color: #203a5e; }
.detail-section-head .card-subtitle { margin-left: 2px; }
.description-grid { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.description-item { min-height: 66px; display: grid; grid-template-columns: 105px 1fr; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.description-item dt { padding: 13px 12px; background: #fafbfc; color: var(--muted); }
.description-item dd { margin: 0; padding: 13px 12px; line-height: 1.7; }
.description-item.wide { grid-column: span 2; }
.detail-pane { display: block; padding: 18px; }
.detail-audit-footer { display: flex; justify-content: center; gap: 12px; padding: 18px 0 4px; border-top: 1px solid var(--line); margin-top: 12px; }
.subsection { margin-bottom: 20px; }
.subsection:last-child { margin-bottom: 0; }
.subsection-title { margin: 0 0 12px; padding-left: 9px; border-left: 3px solid var(--primary); font-size: 14px; font-weight: 600; }
.flow-record-heading { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 10px; color: #203a5e; }
.flow-record-heading span { color: var(--subtle); font-size: 12px; }
.flow-integrated { border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; overflow: hidden; }
.flow-integrated-records { padding: 0 14px 8px; }
.flow-integrated-records .flow-record-heading { margin: 14px 0 8px; padding-bottom: 8px; border-bottom: 1px solid #edf1f5; }
.flow-integrated-records > .timeline { padding-left: 8px; }
.flow-integrated-records .master-timeline-card { margin: 0 0 12px; }
.flow-integrated-records .branch-timeline-section-title { margin-top: 8px; }
.node-record-list { padding: 4px 8px 8px; }
.node-record { display: flex; align-items: flex-start; gap: 12px; min-height: 54px; padding: 9px 10px; border-bottom: 1px solid #edf1f5; }
.node-record:last-child { border-bottom: 0; }
.node-record-index { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 50%; background: #f1f3f6; color: #98a2b3; font-size: 11px; }
.node-record.done .node-record-index { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px #e8f3ff; }
.node-record-main { min-width: 0; padding-top: 1px; }
.node-record-main strong { display: block; color: #203a5e; font-size: 13px; font-weight: 500; }
.node-record.pending .node-record-main strong { color: #667085; font-weight: 400; }
.node-record-meta { margin-top: 4px; color: var(--subtle); font-size: 11px; }
.master-node-record { border: 1px solid #d9e8f8; border-radius: 7px; background: #f7fbff; overflow: hidden; }
.master-node-record .node-record-list { padding: 4px 10px 8px; }
.branch-node-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.branch-node-record { border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; overflow: hidden; }
.branch-node-record .node-record-list { padding: 4px 10px 8px; }
.progress-line { height: 8px; border-radius: 5px; background: #edf0f3; overflow: hidden; }
.progress-line span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.timeline { padding: 4px 8px 4px 18px; }
.timeline-item { position: relative; padding: 0 0 26px 28px; border-left: 1px solid #d9e1eb; }
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot { position: absolute; left: -6px; top: 1px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); }
.timeline-time { color: var(--subtle); font-size: 11px; }
.timeline-title { margin: 5px 0; font-weight: 500; }
.timeline-info { color: var(--muted); font-size: 12px; }

.config-layout { display: grid; grid-template-columns: 210px 1fr; gap: 12px; }
.config-menu { padding: 8px; align-self: start; }
.config-menu-item { height: 42px; display: flex; align-items: center; padding: 0 13px; border-radius: 5px; color: #475467; cursor: pointer; }
.config-menu-item.active { color: var(--primary); background: var(--primary-soft); font-weight: 500; }
.config-menu-item em { margin-left: auto; min-width: 20px; text-align: center; font-style: normal; color: var(--subtle); font-size: 11px; }
.config-menu-item.active em { color: var(--primary); }
.config-content { min-width: 0; overflow: hidden; }
.config-head { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.config-content .table-wrap { min-height: 220px; }
.config-content th { height: 43px; }
.config-content td { height: 58px; }
.person-module-tabs { display: flex; gap: 4px; padding: 12px 16px 0; border-bottom: 1px solid var(--line); background: #fff; }
.person-module-tab { min-width: 170px; height: 39px; padding: 0 13px; display: flex; align-items: center; gap: 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #667085; cursor: pointer; font-weight: 500; }
.person-module-tab span { color: var(--subtle); font-size: 11px; font-weight: 400; }
.person-module-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.person-module-tab.active span { color: #6b9de1; }
.role-table td { height: 56px; }
.role-table td:nth-child(3) { color: var(--muted); }
.role-scope-note { display: flex; align-items: center; gap: 8px; margin: 0 16px 12px; padding: 10px 12px; border: 1px solid #d7e8fb; border-radius: 5px; background: #f5faff; color: #5b7698; font-size: 12px; }
.info-dot { width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 17px; border-radius: 50%; background: #2f80ed; color: #fff; font-size: 11px; font-weight: 700; }
.people-toolbar { min-height: 66px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.people-search { display: flex; align-items: center; gap: 8px; width: min(440px, 55%); }
.people-search .control { flex: 1; }
.config-people-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 440px; }
.org-tree { padding: 16px 10px; border-right: 1px solid var(--line); background: #fbfcfe; }
.tree-title { padding: 0 10px 11px; color: var(--muted); font-size: 12px; font-weight: 600; }
.org-node { height: 39px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border-radius: 5px; color: #475467; cursor: pointer; }
.org-node.active { color: var(--primary); background: var(--primary-soft); }
.tree-caret { width: 12px; color: var(--subtle); }
.tree-dot { width: 7px; height: 7px; border-radius: 50%; background: #91caff; }
.org-node em { margin-left: auto; color: var(--subtle); font-style: normal; font-size: 11px; }
.people-table { min-width: 0; }
.people-table td { height: 52px; }
.role-pill { display: inline-flex; padding: 4px 9px; border-radius: 4px; color: #315b87; background: #edf6ff; font-size: 12px; }
.task-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; color: #d46b08; background: #fff7e6; font-size: 12px; }
.config-form { display: grid; gap: 14px; }
.config-section { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.config-section-head { min-height: 43px; padding: 0 13px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.config-section-head strong { font-size: 13px; }
.section-tip { color: var(--subtle); font-size: 11px; font-weight: 400; }
.config-section-head .btn.text { margin-left: auto; }
.compact-grid { padding: 15px 16px; gap: 14px 22px; }
.inline-control { display: flex; align-items: center; gap: 10px; }
.inline-control .control { flex: 1; }
.radio-row { display: flex; align-items: center; gap: 24px; height: 34px; }
.radio-row label { margin: 0; color: #344054; }
.radio-row input { accent-color: var(--primary); }
.field-table { padding: 0 13px 12px; }
.field-table-head, .field-table-row { display: grid; grid-template-columns: 36px 1.4fr 1fr .8fr 54px; gap: 10px; align-items: center; }
.field-table-head { min-height: 32px; color: var(--muted); font-size: 11px; }
.field-table-row { padding: 5px 0; }
.field-table-row .control { height: 31px; }
.field-index { color: var(--primary); font-size: 12px; text-align: center; }
.field-table-row .btn.text { font-size: 12px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border: 1px dashed #c8d8eb; border-radius: 5px; background: #f6f9fd; color: var(--muted); font-size: 12px; }
.workflow-designer { display: flex; align-items: stretch; padding: 18px 14px 22px; overflow-x: auto; min-width: 760px; }
.designer-node { min-width: 150px; padding: 10px 9px; display: flex; align-items: flex-start; gap: 8px; border: 1px solid #d9e5f2; border-radius: 6px; background: #fafdff; }
.designer-node b { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--primary); font-size: 12px; }
.designer-node strong { display: block; font-size: 12px; white-space: nowrap; }
.designer-node span { display: block; margin-top: 4px; color: var(--subtle); font-size: 10px; white-space: nowrap; }
.designer-node .btn.text { margin-left: auto; font-size: 11px; }
.designer-node.start, .designer-node.end { background: #f6f9fd; }
.designer-node.receive { border-color: #b8ead7; background: #f5fcf8; }
.designer-node.assign { border-color: #d9ccff; background: #fbf9ff; }
.designer-line { width: 32px; flex: 0 0 32px; align-self: center; height: 1px; margin: 0 5px; background: #c8d8eb; position: relative; }
.designer-line::after { content: ""; position: absolute; right: -1px; top: -3px; border-left: 5px solid #c8d8eb; border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.workflow-editor-wrap { padding: 15px 16px 18px; }
.workflow-editor-note { margin-bottom: 12px; padding: 10px 12px; border-radius: 5px; color: #52627a; background: #f6f9fd; font-size: 12px; }
.workflow-rule-example { margin: 12px 0; padding: 10px 12px; border: 1px solid #b8ead7; border-radius: 5px; color: #256b53; background: #f3fbf7; font-size: 12px; line-height: 1.7; }
.workflow-config-table { min-width: 980px; }
.workflow-config-table th { height: 38px; }
.workflow-config-table td { height: 52px; padding: 6px 8px; }
.workflow-config-table .control { min-width: 116px; height: 32px; }
.workflow-config-table td:nth-child(3) .control { min-width: 160px; }
.workflow-config-table td:nth-child(5) .control { min-width: 190px; }
.node-order { width: 42px; color: var(--primary); font-family: "Bahnschrift", sans-serif; font-weight: 600; text-align: center; }
.node-fixed { display: inline-flex; min-width: 100px; padding: 7px 9px; border-radius: 4px; color: #667085; background: #f2f4f7; }
.switch { position: relative; display: inline-flex; width: 34px; height: 20px; }
.switch input { width: 0; height: 0; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: #d0d5dd; cursor: pointer; transition: .16s ease; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.18); transition: .16s ease; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:disabled + span { opacity: .55; cursor: default; }

.empty { padding: 65px 0; text-align: center; color: var(--subtle); }
.empty-icon { font-size: 34px; opacity: .45; }
.branch-summary { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 10px 12px; border: 1px solid #d9e8f8; border-radius: 5px; background: #f6faff; color: #52627a; font-size: 12px; }
.branch-summary b { color: #1677ff; font-weight: 600; }
.branch-summary em { color: #17a673; font-style: normal; }
.branch-route-list { display: grid; gap: 8px; padding: 4px 0; }
.branch-route-row { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #d9e8f8; border-radius: 5px; background: #f7fbff; color: #52627a; font-size: 12px; }
.branch-route-row strong { color: #203a5e; }
.branch-route-row b { color: #1677ff; font-weight: 500; }
.branch-route-row em { color: #17a673; font-style: normal; }
.branch-stat { min-height: 92px; }
.branch-table-wrap { margin-top: 8px; }
.branch-table-wrap table { min-width: 920px; }
.branch-timeline-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.master-timeline-card { margin-bottom: 14px; border: 1px solid #d9e8f8; border-radius: 7px; background: #f7fbff; overflow: hidden; }
.master-timeline-card .timeline { padding: 12px 14px 4px; }
.master-timeline-card .timeline-item { padding-left: 18px; }
.branch-timeline-section-title { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 10px; color: #203a5e; }
.branch-timeline-section-title span { color: var(--subtle); font-size: 12px; }
.branch-timeline { border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; overflow: hidden; }
.branch-timeline-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #e8edf3; background: #f8fafc; color: #203a5e; }
.branch-timeline .timeline { padding: 12px 14px 4px; }
.branch-timeline .timeline-item { padding-left: 18px; }
.branch-timeline .timeline-info { max-width: none; }

.overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.38); animation: fadeIn .16s ease; }
.modal { width: 470px; max-height: calc(100vh - 80px); overflow: auto; background: #fff; border-radius: 8px; box-shadow: 0 18px 50px rgba(15,23,42,.2); animation: popIn .18s ease; }
.modal-head { height: 54px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-weight: 600; }
.close { width: 28px; height: 28px; border: 0; background: transparent; color: var(--subtle); font-size: 20px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 12px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.confirm-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #fff7e6; color: var(--warning); font-size: 22px; }
.confirm-layout { display: flex; gap: 14px; }
.confirm-layout h3 { margin: 1px 0 8px; font-size: 16px; }
.confirm-layout p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.drawer-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15,23,42,.42); animation: fadeIn .16s ease; }
.drawer { position: relative; width: min(1280px, calc(100vw - 72px)); height: min(900px, calc(100vh - 48px)); max-height: calc(100vh - 48px); background: #fff; border: 1px solid rgba(216,221,229,.9); border-radius: 10px; box-shadow: 0 22px 64px rgba(15,23,42,.24); animation: popIn .22s ease; display: flex; flex-direction: column; overflow: hidden; }
.drawer.drawer-wide { width: min(1520px, calc(100vw - 72px)); }
.drawer.drawer-compact { width: min(680px, calc(100vw - 48px)); height: min(500px, calc(100vh - 48px)); }
.drawer-head { height: 60px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { height: 62px; padding: 0 20px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.notice { margin-bottom: 16px; padding: 11px 13px; display: flex; gap: 9px; border: 1px solid #bae0ff; border-radius: 5px; background: #e6f4ff; color: #3c5f87; font-size: 12px; line-height: 1.6; }
.form-stack { display: grid; gap: 17px; }
.detail-operation-section { margin-top: 14px; border: 1px solid #bcd7ff; border-radius: 8px; background: #fff; }
.detail-operation-body { padding: 18px 20px 4px; }
.detail-operation-body .notice { margin-bottom: 16px; }
.detail-branch-forms { display: grid; gap: 12px; }
.detail-operation-actions { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }
.branch-assign-entry { padding: 14px 16px; border: 1px solid #e5eaf2; border-radius: 8px; background: #fbfcfe; }
.branch-assign-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: #172b4d; }
.branch-assign-entry .field { margin-top: 0; }
.role-assignment-form { display: grid; gap: 18px; max-width: 600px; margin: 0 auto; }
.assignment-person { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; border: 1px solid #d9e8f8; border-radius: 7px; background: #f6faff; color: #6b7f99; font-size: 13px; }
.assignment-person strong { color: #16385f; font-size: 17px; }
.assignment-person em { color: #8294aa; font-style: normal; font-size: 12px; }
.form-section-label { display: flex; align-items: baseline; gap: 10px; padding-bottom: 2px; }
.form-section-label strong { color: #203a5e; font-size: 14px; }
.form-section-label span { color: var(--subtle); font-size: 12px; }
.multi-select { position: relative; }
.multi-select-trigger { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border: 1px solid #cbd7e6; border-radius: 5px; background: #fff; color: #344054; font-size: 13px; cursor: pointer; text-align: left; transition: border-color .16s, box-shadow .16s; }
.multi-select-trigger > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-select-trigger:hover, .multi-select-trigger[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47,128,237,.1); }
.multi-select-arrow { color: #687b91; font-size: 14px; }
.multi-select-menu { position: absolute; z-index: 5; top: calc(100% + 5px); left: 0; right: 0; max-height: 245px; overflow-y: auto; padding: 6px; border: 1px solid #cbd7e6; border-radius: 6px; background: #fff; box-shadow: 0 12px 28px rgba(27,55,89,.16); }
.multi-option { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 9px; border-radius: 4px; cursor: pointer; }
.multi-option:hover { background: #f2f7fd; }
.multi-option input { width: 15px; height: 15px; accent-color: var(--primary); }
.multi-option-main { display: flex; flex-direction: column; gap: 2px; }
.multi-option-main strong { color: #253b58; font-size: 13px; font-weight: 500; }
.multi-option-main small { color: #8a9aae; font-size: 11px; }
.assignment-rule { display: flex; align-items: flex-start; gap: 8px; padding: 11px 12px; border: 1px solid #e2e8f0; border-radius: 5px; background: #fafbfd; color: #718198; font-size: 12px; line-height: 1.6; }
.toast { position: fixed; z-index: 200; left: 50%; top: 80px; transform: translateX(-50%); padding: 10px 15px; border-radius: 5px; background: rgba(25,35,50,.93); color: #fff; box-shadow: var(--shadow); animation: toastIn .2s ease; }
.toast.success::before { content: "✓"; color: #65d6a9; margin-right: 8px; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(5px); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%,-8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 1400px) {
  :root { --sidebar: 196px; }
  .page { padding-left: 16px; padding-right: 16px; }
  .todo-grid { gap: 9px; }
  .workspace-grid { grid-template-columns: 1.55fr .85fr; }
  .description-grid { grid-template-columns: repeat(3,1fr); }
}
