/* ============ 苍穹 CQ-POWER - 样式（浅蓝配色） ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #eef5fd;              /* 页面底色：浅蓝 */
  --panel: #ffffff;
  --line: #dce8f6;            /* 浅蓝描边 */
  --line2: #c5d9ef;
  --txt: #17263b;
  --txt2: #5a7291;
  --txt3: #94a9c4;
  --pri: #2e86de;             /* 主色：浅蓝 */
  --pri-d: #1f6fc4;
  --pri-l: #e6f1fc;
  --ok: #17a673;
  --ok-l: #e4f7f0;
  --warn: #dd8a1c;
  --warn-l: #fdf3e3;
  --err: #d64550;
  --err-l: #fdecee;
  --dark: #14293f;            /* 侧栏：深蓝，与浅蓝主色同族 */
  --r: 8px;
  --sh: 0 1px 3px rgba(24, 60, 110, .06), 0 6px 18px -8px rgba(24, 60, 110, .12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg); color: var(--txt); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.side {
  width: 218px; flex: 0 0 218px; background: var(--dark); color: #c6d0dd;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand h1 { font-size: 15px; color: #fff; font-weight: 600; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.brand .logo {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 26px;
  background: #fff; display: grid; place-items: center;
  overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.brand .logo img { width: 100%; height: 100%; display: block; object-fit: contain; padding: 2px; }
.brand p { font-size: 11px; color: #7d8b9e; margin-top: 5px; letter-spacing: .2px; }

.nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-g { padding: 12px 18px 6px; font-size: 10.5px; color: #63718a; letter-spacing: 1px; text-transform: uppercase; }
/* 分组标题可点击折叠 */
.nav-g[data-gtoggle] { cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; }
.nav-g[data-gtoggle]:hover { color: #9fb0c4; }
.nav-g .nav-arrow { font-size: 9px; opacity: .8; }
.nav-sec.closed a { display: none; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: #c6d0dd;
  text-decoration: none; font-size: 13.5px; border-left: 3px solid transparent; transition: .15s;
}
.nav a:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav a.on { background: rgba(46,134,222,.24); border-left-color: var(--pri); color: #fff; font-weight: 500; }
.nav a .ic { width: 16px; text-align: center; opacity: .85; font-size: 14px; }
.nav a .cnt {
  margin-left: auto; background: rgba(255,255,255,.1); color: #b9c5d6; font-size: 11px;
  padding: 1px 7px; border-radius: 9px; min-width: 22px; text-align: center;
}
.nav a.on .cnt { background: var(--pri); color: #fff; }

.side-ft { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #63718a; }

/* ---------- 侧栏收起（桌面端） ---------- */
.side-toggle {
  display: none; flex: 0 0 auto; width: 28px; height: 28px; margin-right: 10px;
  background: transparent; border: 1px solid var(--line); border-radius: 7px;
  color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1;
}
.side-toggle:hover { border-color: var(--pri); color: var(--pri); }
.app.mini .side { width: 54px; flex-basis: 54px; }
.app.mini .brand { padding: 14px 8px 12px; }
.app.mini .brand h1 { font-size: 0; gap: 0; justify-content: center; }
.app.mini .brand p, .app.mini .proj-sel, .app.mini .nav-g, .app.mini .uinfo { display: none; }
.app.mini .nav a { padding: 11px 0; justify-content: center; gap: 0; font-size: 0; }
.app.mini .nav a .ic { font-size: 16px; width: auto; }
.app.mini .nav a .cnt { display: none; }
.app.mini .side-ft { padding: 10px 8px; }
.app.mini .side-ft .btn { font-size: 0; padding: 6px 0; }
.app.mini .side-ft .user-box { justify-content: center; }
@media (min-width: 769px) { .side-toggle { display: inline-block; } }

/* 侧栏是深色背景，底部按钮需要浅色文字，否则默认深色文字会"隐形" */
.side-ft .btn.ghost {
  color: #c7d2e4; border-color: rgba(255,255,255,.22); background: transparent;
}
.side-ft .btn.ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

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

.top {
  background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 22px;
  height: 58px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 30;
}
.top h2 { font-size: 17px; font-weight: 600; }
.top .sp { flex: 1; }
.proj-chip {
  font-size: 12px; color: var(--txt2); background: var(--bg); border: 1px solid var(--line);
  padding: 5px 11px; border-radius: 20px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.body { padding: 20px 22px 60px; flex: 1; }
.view { display: none; }
.view.on { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 组件 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 8px 15px; border-radius: 6px; border: 1px solid var(--line2); background: #fff;
  color: var(--txt); font-size: 13.5px; cursor: pointer; font-family: inherit;
  transition: .14s; white-space: nowrap; font-weight: 500;
}
.btn:hover { background: #f7f9fc; border-color: #b9c2cf; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primary:hover { background: var(--pri-d); border-color: var(--pri-d); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.xs { padding: 4px 9px; font-size: 12px; border-radius: 5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.toolbar {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; margin-bottom: 16px;
}
.toolbar .sp { flex: 1; }
.search {
  padding: 8px 12px; border: 1px solid var(--line2); border-radius: 6px; font-size: 13.5px;
  width: 210px; font-family: inherit; background: #fff;
}
.search:focus, select:focus, input:focus, textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-l); }
select.f, input.f { padding: 8px 11px; border: 1px solid var(--line2); border-radius: 6px; font-size: 13.5px; font-family: inherit; background: #fff; }

/* 表格 */
.tw { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; box-shadow: var(--sh); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  background: #f7f9fc; text-align: left; padding: 11px 13px; font-weight: 600; color: var(--txt2);
  font-size: 12.5px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
tbody td { padding: 10px 13px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfd; }
.row-act { display: flex; gap: 5px; }
.empty { padding: 46px 20px; text-align: center; color: var(--txt3); font-size: 13.5px; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 11.5px; font-weight: 500;
  white-space: nowrap; line-height: 1.7;
}
.b-gray { background: #eef1f5; color: #5e6b7d; }
.b-blue { background: var(--pri-l); color: var(--pri-d); }
.b-green { background: var(--ok-l); color: #15803d; }
.b-amber { background: var(--warn-l); color: #b45309; }
.b-red { background: var(--err-l); color: #b91c1c; }

/* 统计 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh); }
.stat-l { font-size: 12.5px; color: var(--txt2); margin-bottom: 5px; }
.stat-v { font-size: 25px; font-weight: 700; line-height: 1.25; letter-spacing: -.5px; }
.stat-s { font-size: 11.5px; color: var(--txt3); margin-top: 3px; }
.c-blue .stat-v { color: var(--pri); }
.c-green .stat-v { color: var(--ok); }
.c-amber .stat-v { color: var(--warn); }
.c-red .stat-v { color: var(--err); }

/* 卡片 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 16px; }
.card-hd { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-hd h3 { font-size: 14.5px; font-weight: 600; }
.card-hd .sp { flex: 1; }
.card-bd { padding: 16px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1080px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.fi { display: flex; flex-direction: column; gap: 5px; }
.fi.col2 { grid-column: span 2; }
.fi.col3 { grid-column: span 2; }
.fi label { font-size: 12.5px; color: var(--txt2); font-weight: 500; }
.fi label i { color: var(--err); font-style: normal; }
.fi input, .fi select, .fi textarea {
  padding: 8px 11px; border: 1px solid var(--line2); border-radius: 6px; font-size: 13.5px;
  font-family: inherit; background: #fff; width: 100%; color: var(--txt);
}
.fi textarea { resize: vertical; line-height: 1.65; }
.readonly-val { padding: 8px 0; font-size: 13.5px; color: var(--txt2); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .fi.col2, .fi.col3 { grid-column: span 1; } }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 38, .5); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px 16px; overflow-y: auto;
  animation: fade .15s;
}
.modal {
  background: #fff; border-radius: 10px; width: 100%; max-width: 660px; box-shadow: 0 24px 60px -12px rgba(0,0,0,.4);
  animation: pop .18s cubic-bezier(.2,.9,.3,1.1);
}
.modal.sm { max-width: 400px; }
.modal.lg { max-width: 860px; }
@keyframes pop { from { transform: scale(.96) translateY(-8px); opacity: 0; } }
.modal-hd { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-hd h3 { font-size: 15.5px; font-weight: 600; flex: 1; }
.modal-x { background: none; border: none; font-size: 22px; color: var(--txt3); cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-x:hover { color: var(--txt); }
.modal-bd { padding: 18px; max-height: 68vh; overflow-y: auto; }
.modal-ft { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }

/* Toast */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translate(-50%, -18px); background: var(--dark); color: #fff;
  padding: 10px 20px; border-radius: 7px; font-size: 13.5px; z-index: 400; opacity: 0;
  transition: .25s; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4); pointer-events: none; max-width: 88vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }

/* 进度条 */
/* 横向排名条（TOP-N 榜单，V2.3.2 人工成本/超耗分析用） */
.bar-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.bar-row .bar-l { flex: 0 0 150px; font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-t { flex: 1; height: 9px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.bar-row .bar-f { display: block; height: 100%; background: var(--pri); border-radius: 4px; transition: width .3s; }
.bar-row .bar-v { flex: 0 0 auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.bar { height: 7px; background: #eef1f5; border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--pri); border-radius: 4px; transition: width .3s; }
.bar > i.ok { background: var(--ok); }
.bar > i.warn { background: var(--warn); }

/* 甘特 */
.gantt { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.gantt-inner { min-width: 100%; }
.gantt-row { display: flex; align-items: stretch; border-bottom: 1px solid #eef1f5; }
.gantt-row:last-child { border-bottom: none; }
.gantt-name {
  flex: 0 0 210px; padding: 8px 12px; font-size: 12.5px; border-right: 1px solid var(--line);
  background: #fbfcfe; position: sticky; left: 0; z-index: 2;
}
.gantt-track { flex: 1; position: relative; min-height: 34px; }
.gantt-bar {
  position: absolute; height: 18px; top: 8px; border-radius: 4px; background: var(--pri);
  font-size: 10.5px; color: #fff; display: flex; align-items: center; padding: 0 6px;
  overflow: hidden; white-space: nowrap; cursor: default;
}
.gantt-bar.done { background: var(--ok); }
.gantt-bar.late { background: var(--err); }
.gantt-head { display: flex; border-bottom: 1px solid var(--line); background: #f7f9fc; position: sticky; top: 0; z-index: 3; }
.gantt-head .gantt-name { font-weight: 600; color: var(--txt2); background: #f7f9fc; font-size: 12px; }
.gantt-days { flex: 1; display: flex; }
.gantt-days > span { flex: 1; text-align: center; font-size: 10px; color: var(--txt3); border-right: 1px solid #f0f3f7; padding: 6px 0; }
.gantt-days > span.today { background: var(--pri-l); color: var(--pri); font-weight: 600; }

/* Tab */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  background: none; border: none; padding: 9px 15px; font-size: 13.5px; color: var(--txt2); cursor: pointer;
  border-bottom: 2px solid transparent; font-family: inherit; white-space: nowrap; font-weight: 500;
}
.tabs button:hover { color: var(--txt); }
.tabs button.on { color: var(--pri); border-bottom-color: var(--pri); }

/* 其它 */
.hint {
  background: var(--pri-l); border-left: 3px solid var(--pri); padding: 10px 14px;
  border-radius: 0 6px 6px 0; font-size: 12.5px; color: #2c4a7c; margin-bottom: 16px; line-height: 1.7;
}
.hint.warn { background: var(--warn-l); border-left-color: var(--warn); color: #92400e; }
.hint b { font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--txt3); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.detail-row { display: flex; padding: 9px 0; border-bottom: 1px dashed #eef1f5; font-size: 13.5px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { flex: 0 0 108px; color: var(--txt2); font-size: 12.5px; }
.detail-row .v { flex: 1; word-break: break-word; white-space: pre-wrap; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.chk input { width: 15px; height: 15px; accent-color: var(--pri); cursor: pointer; }

.mob-top { display: none; }
@media (max-width: 860px) {
  .side {
    position: fixed; left: 0; top: 0; z-index: 100; transform: translateX(-100%); transition: .22s;
    box-shadow: 4px 0 24px rgba(0,0,0,.2);
  }
  .side.open { transform: none; }
  .mob-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 90; }
  .mob-top button { background: rgba(255,255,255,.12); border: none; color: #fff; font-size: 17px; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
  .mob-top span { font-size: 13.5px; font-weight: 500; }
  .top { display: none; }
  .body { padding: 14px 13px 60px; }
  .modal-bd { max-height: 62vh; }
  .gantt-name { flex: 0 0 130px; font-size: 11.5px; }
}
.mask-bg { display: none; }
@media (max-width: 860px) { .mask-bg.on { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 99; } }

@media print {
  .side, .top, .toolbar, .mob-top, .no-print, .row-act { display: none !important; }
  body { background: #fff; }
  .body { padding: 0; }
  .card, .tw { box-shadow: none; border-color: #ccc; page-break-inside: avoid; }
  .stat { box-shadow: none; }
}

/* ============ 后端版新增样式 ============ */
.proj-sel { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.proj-sel label { display: block; font-size: 10.5px; color: #63718a; letter-spacing: .6px; margin-bottom: 6px; text-transform: uppercase; }
.proj-sel select {
  width: 100%; padding: 7px 9px; border-radius: 6px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07); color: #e3eaf4; font-size: 12.5px; font-family: inherit; cursor: pointer;
}
.proj-sel select option { background: #14293f; color: #e3eaf4; }

.user-box { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; padding-bottom: 11px; border-bottom: 1px solid rgba(255,255,255,.07); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; display: grid; place-items: center;
  background: linear-gradient(135deg, #1a5fb4, #2563d4); color: #fff; font-size: 13px; font-weight: 600;
}
.uinfo { min-width: 0; }
.uname { font-size: 13px; color: #e3eaf4; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.urole { font-size: 11px; color: #7d8b9e; }

/* 文件/照片 */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.file-item { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fafbfd; }
.file-item img { width: 100%; height: 92px; object-fit: cover; display: block; cursor: pointer; }
.file-item .fi-body { padding: 7px 9px; }
.file-item .fi-name { font-size: 11.5px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item .fi-size { font-size: 10.5px; color: var(--txt3); margin-top: 2px; }
.file-item .fi-del {
  position: absolute; top: 5px; right: 5px; background: rgba(220,38,38,.92); color: #fff; border: none;
  width: 21px; height: 21px; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1; display: grid; place-items: center;
}
.file-drop {
  border: 1.5px dashed var(--line2); border-radius: 8px; padding: 18px; text-align: center;
  color: var(--txt3); font-size: 12.5px; cursor: pointer; transition: .15s; margin-bottom: 12px;
}
.file-drop:hover, .file-drop.over { border-color: var(--pri); background: var(--pri-l); color: var(--pri); }

/* 审批流 */
.appr-flow { display: flex; align-items: center; gap: 0; margin: 16px 0; overflow-x: auto; padding-bottom: 4px; }
.appr-node { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.appr-dot {
  width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
  background: #eef1f5; color: var(--txt3); font-size: 12px; font-weight: 600; flex: 0 0 27px;
}
.appr-dot.done { background: var(--ok); color: #fff; }
.appr-dot.now { background: var(--pri); color: #fff; box-shadow: 0 0 0 4px var(--pri-l); }
.appr-dot.rej { background: var(--err); color: #fff; }
.appr-label { font-size: 12px; color: var(--txt2); white-space: nowrap; }
.appr-line { width: 34px; height: 2px; background: #e3e7ed; margin: 0 8px; flex: 0 0 34px; }
.appr-line.done { background: var(--ok); }

.appr-rec { padding: 10px 0; border-bottom: 1px dashed #eef1f5; font-size: 13px; }
.appr-rec:last-child { border-bottom: none; }
.appr-rec .ah { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.appr-rec .ac { color: var(--txt2); font-size: 12.5px; }

/* 登录页切换 */
.toast.warn { background: var(--warn); }
.stat.clickable { cursor: pointer; transition: .15s; }
.stat.clickable:hover { border-color: var(--pri); transform: translateY(-2px); }

/* 密码弹窗等 */
.kv-list { font-size: 13.5px; }
.kv-list .r { display: flex; padding: 8px 0; border-bottom: 1px dashed #eef1f5; }
.kv-list .r:last-child { border-bottom: none; }
.kv-list .k { flex: 0 0 100px; color: var(--txt2); font-size: 12.5px; }
.kv-list .v { flex: 1; }

.badge.b-orange { background: #fef4e6; color: #b45309; }
.badge.b-purple { background: #f3e8ff; color: #7e22ce; }

@media (max-width: 860px) {
  .proj-sel { padding: 10px 14px; }
  .mob-top .sp { flex: 1; }
}

/* ============ 方案编制模块 ============ */
.plan-editor { display: flex; gap: 14px; margin-top: 14px; align-items: flex-start; }
.plan-side {
  flex: 0 0 260px; background: #fff; border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px; overflow: hidden; position: sticky; top: 10px;
  max-height: calc(100vh - 140px); overflow-y: auto;
}
.plan-side-hd {
  padding: 11px 14px; font-weight: 600; font-size: 13px;
  background: #f8fafc; border-bottom: 1px solid var(--line, #e2e8f0);
}
.sec-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  font-size: 13px; color: var(--txt, #1e293b); text-decoration: none;
  border-bottom: 1px solid #f1f5f9; transition: .15s;
}
.sec-item:hover { background: #f8fafc; }
.sec-item.on { background: #eff6ff; border-left: 3px solid var(--pri, #1a4d8f); padding-left: 9px; }
.sec-item .sec-no {
  flex: 0 0 22px; text-align: center; font-size: 11.5px; color: var(--txt2, #64748b);
  background: #f1f5f9; border-radius: 4px; padding: 1px 0;
}
.sec-item .sec-t { flex: 1; line-height: 1.4; }
.sec-item .sec-req { color: #d9534f; font-weight: 700; }
.sec-item .sec-dot {
  flex: 0 0 7px; height: 7px; border-radius: 50%; background: #e2e8f0;
}
.sec-item .sec-dot.ok { background: #2e9e5b; }

.plan-main {
  flex: 1; background: #fff; border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px; padding: 18px 20px; min-width: 0;
}
.plan-sec-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-sec-hd h3 { margin: 0; font-size: 16.5px; }
.plan-sec-hd .req { font-size: 12px; color: #d9534f; font-weight: 500; }
.sec-hint {
  background: #f8fafc; border-left: 3px solid #94a3b8; padding: 9px 12px;
  border-radius: 6px; font-size: 13px; color: var(--txt2, #475569); margin: 10px 0 12px;
}
.sec-editor {
  width: 100%; padding: 13px 15px; font-size: 14px; line-height: 1.85;
  font-family: inherit; border: 1px solid #cbd5e1; border-radius: 8px;
  resize: vertical; box-sizing: border-box; color: var(--txt, #1e293b);
}
.sec-editor:focus { outline: none; border-color: var(--pri, #1a4d8f); box-shadow: 0 0 0 3px rgba(26,77,143,.08); }
.sec-readonly {
  font-size: 14px; line-height: 1.9; padding: 12px 0; color: var(--txt, #1e293b);
}
.ai-note {
  margin-top: 12px; padding: 10px 13px; background: #f0f7ff;
  border-left: 3px solid #1a4d8f; border-radius: 6px; font-size: 13px; color: #1e40af;
}
.tpl-pick:hover { background: #f8fafc; }

@media (max-width: 860px) {
  .plan-editor { flex-direction: column; }
  .plan-side { flex: none; width: 100%; position: static; max-height: 220px; }
  .plan-main { padding: 14px; }
}

/* ---------- 表单只读派生字段（如身份证→年龄/生日/性别） ---------- */
.form-grid input.ro {
  background: #f3f6fa; color: var(--muted); cursor: default;
  border-style: dashed; font-weight: 500;
}
.form-grid input.ro:focus { outline: none; border-color: var(--line2); }

/* ============================================================
   v2.2.0 新增：成本预算 / 消息中心 / 组织架构 / 操作审计
   ============================================================ */

/* ---------- 成本执行分析 ---------- */
.cost-list { display: flex; flex-direction: column; gap: 15px; }
.cost-row { }
.cost-row .cr-hd { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.cost-row .cr-hd b { min-width: 56px; }
.cost-row .cr-pct { font-size: 13px; font-weight: 600; min-width: 52px; text-align: right; }
.cost-row .cr-pct.ok { color: var(--ok); }
.cost-row .cr-pct.warn { color: var(--warn); }
.cost-row .cr-pct.red { color: var(--err); }
.cost-row .bar > i.err { background: var(--err); }
.cost-row .cr-src { font-size: 11.5px; color: var(--txt3); margin-top: 5px; line-height: 1.7; }
.cost-row .cr-src .mono { color: var(--txt2); }

.txt-red { color: var(--err); font-weight: 600; }

/* ---------- 消息中心 ---------- */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 11px; }
.todo-card {
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 13px;
  cursor: pointer; transition: .15s; background: linear-gradient(180deg, #fbfdff, #fff);
}
.todo-card:hover { border-color: var(--pri); transform: translateY(-2px); box-shadow: var(--sh); }
.todo-card .tc-ic { font-size: 17px; margin-bottom: 5px; }
.todo-card .tc-t { font-size: 12.5px; color: var(--txt2); }
.todo-card .tc-n { font-size: 18px; font-weight: 700; margin-top: 3px; letter-spacing: -.3px; }

.msg-list { display: flex; flex-direction: column; gap: 9px; }
.msg {
  display: flex; gap: 11px; align-items: flex-start; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px;
  box-shadow: var(--sh); transition: .15s; position: relative;
}
.msg:hover { border-color: var(--line2); }
.msg.read { opacity: .62; background: #fbfcfe; }
.msg.urgent { border-left: 3px solid var(--err); }
.msg .msg-ic { font-size: 18px; flex: 0 0 24px; text-align: center; line-height: 1.5; }
.msg .msg-bd { flex: 1; min-width: 0; cursor: pointer; }
.msg .msg-hd { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; }
.msg .msg-tx { color: var(--txt2); font-size: 12.5px; margin-top: 4px; line-height: 1.7; }
.msg .msg-del {
  flex: 0 0 24px; height: 24px; border: none; background: transparent; color: var(--txt3);
  font-size: 17px; cursor: pointer; border-radius: 5px; line-height: 1;
}
.msg .msg-del:hover { background: var(--err-l); color: var(--err); }
.dot-unread { width: 7px; height: 7px; border-radius: 50%; background: var(--pri); display: inline-block; }

/* ---------- 组织架构 ---------- */
.dept-tree { display: flex; flex-direction: column; gap: 14px; }
.dept-node { }
.dept-node .dn-hd {
  display: flex; align-items: center; gap: 7px; padding: 9px 11px; font-size: 13.5px;
  background: #f6fafe; border: 1px solid var(--line); border-radius: var(--r);
}
.dept-node .dn-ic { font-size: 13px; color: var(--txt3); }
.dept-node .dn-child {
  display: flex; align-items: center; gap: 7px; padding: 7px 11px 7px 32px;
  font-size: 13px; color: var(--txt2); border-bottom: 1px dashed #eef1f5;
}
.dept-users { display: flex; flex-direction: column; }
.du-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 0;
  border-bottom: 1px dashed #eef1f5; font-size: 13px;
}
.du-row:last-child { border-bottom: none; }
.du-row select.f { width: 145px; }

/* 审批链配置 */
.chain-card .card-hd h3 { font-size: 14px; }
.chain-steps { display: flex; flex-direction: column; gap: 8px; }
.chain-step {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: var(--r);
}
.chain-step .cs-no {
  flex: none; width: 22px; height: 22px; line-height: 22px; text-align: center;
  border-radius: 50%; background: var(--pri); color: #fff; font-size: 12px; font-weight: 600;
}
.chain-step .cs-name { flex: 1; min-width: 90px; }
.chain-step .cs-roles { flex: none; width: 130px; min-height: 34px; }
.chain-ft {
  display: flex; align-items: center; gap: 8px; margin-top: 11px; padding-top: 11px;
  border-top: 1px dashed #eef1f5;
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; flex: 0 0 26px; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 0 4px; font-size: 13px; }

/* ============================================================
   移动端优化：卡片式表格 + 加大触控区 + 悬浮操作按钮
   ============================================================ */
@media (max-width: 640px) {
  /* 表格转卡片：每个单元格一行，标签在前 */
  .tw { border: none; background: transparent; box-shadow: none; overflow: visible; }
  .tw table, .tw thead, .tw tbody, .tw tr, .tw td { display: block; width: 100%; }
  .tw thead { display: none; }
  .tw tr {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
    margin-bottom: 10px; padding: 6px 12px; box-shadow: var(--sh);
  }
  .tw td {
    display: flex; align-items: flex-start; gap: 10px; padding: 7px 0;
    border-bottom: 1px dashed #eef1f5; text-align: left !important; width: auto !important;
  }
  .tw td:last-child { border-bottom: none; }
  .tw td::before {
    content: attr(data-l); flex: 0 0 80px; color: var(--txt3); font-size: 12px;
    font-weight: 500; padding-top: 1px;
  }
  .tw td:empty { display: none; }
  .tw .row-act { flex-wrap: wrap; width: 100%; }

  /* 过滤栏纵向排列 */
  .toolbar { flex-wrap: wrap; }
  .toolbar .search { width: 100%; }
  .toolbar .f { flex: 1; min-width: 0; }

  /* 统计卡两列 */
  .stats { grid-template-columns: repeat(2, 1fr) !important; gap: 9px; }
  .stat { padding: 11px 12px; }
  .stat-v { font-size: 20px; }
  .stat-l { font-size: 11.5px; }
  .stat-s { font-size: 10.5px; }

  /* 加大触控区到 ≥44px */
  .btn { min-height: 40px; padding: 9px 15px; }
  .btn.xs { min-height: 34px; padding: 6px 11px; }
  .row-act .btn { min-height: 36px; }
  .tw td .row-act { gap: 8px; }
  .nav a { padding: 12px 18px; }
  .msg .msg-del { width: 34px; height: 34px; font-size: 20px; }
  .du-row select.f { width: 120px; min-height: 38px; }
  .todo-grid { grid-template-columns: repeat(2, 1fr); }

  /* 侧栏抽屉加宽 */
  .side { width: 78vw; max-width: 300px; }
  .cost-row .cr-hd { flex-wrap: wrap; }
}

/* 悬浮操作按钮（移动端快速新增） */
.fab {
  position: fixed; right: 18px; bottom: 22px; width: 54px; height: 54px;
  border-radius: 50%; background: var(--pri); color: #fff; border: none;
  font-size: 26px; line-height: 1; box-shadow: 0 6px 20px rgba(46,134,222,.42);
  z-index: 60; display: none; place-items: center; cursor: pointer;
  transition: .15s;
}
.fab:active { transform: scale(.94); }
@media (max-width: 640px) { .fab.on { display: grid; } }

/* ============ 权限配置页（V2.3.2） ============ */
.perm-wrap {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); overflow: auto; box-shadow: var(--sh);
  max-height: calc(100vh - 260px);
}
.perm-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.perm-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f4f9ff; border-bottom: 2px solid var(--line2);
  padding: 9px 6px; text-align: center; font-weight: 600;
  color: var(--txt); white-space: nowrap;
}
.perm-table thead th.pm-hd { text-align: left; padding-left: 14px; min-width: 150px; }
.pm-rolekey { font-size: 10px; color: var(--txt2); font-weight: 400; letter-spacing: .3px; }

/* 模块列：左粘，横向滚动时保持可见 */
.perm-table tbody td.pm-mod {
  position: sticky; left: 0; z-index: 2;
  background: var(--panel); text-align: left;
  padding: 7px 14px; border-right: 1px solid var(--line2);
  border-bottom: 1px solid var(--line); min-width: 150px;
  font-weight: 500; color: var(--txt);
}
.pm-modkey { font-size: 10px; color: var(--txt2); font-weight: 400; }
.perm-table tbody td {
  border-bottom: 1px solid var(--line); border-right: 1px solid #eef4fb;
  padding: 5px 4px; text-align: center;
}
.perm-table tbody tr:hover td { background: #f8fbff; }
.perm-table tbody tr:hover td.pm-mod { background: #f2f8ff; }

.pm-group td {
  background: #eaf3fd !important; text-align: left !important;
  padding: 6px 14px !important; font-weight: 600; font-size: 12px;
  color: var(--pri-d); letter-spacing: .4px;
  position: sticky; left: 0;
}

.pm-cell { display: flex; gap: 3px; justify-content: center; align-items: center; }
.pm-cb {
  display: inline-flex; align-items: center; justify-content: center;
  width: 25px; height: 25px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--line2); background: #fff; transition: .12s;
  user-select: none;
}
.pm-cb span { font-size: 11px; color: var(--txt2); pointer-events: none; }
.pm-cb input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.pm-cb:hover { border-color: var(--pri); background: var(--pri-l); }
.pm-cb:has(input:checked) { background: var(--pri); border-color: var(--pri); }
.pm-cb:has(input:checked) span { color: #fff; font-weight: 600; }
.pm-cb:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--pri-l); }

/* 角色列聚焦：核对单个角色时用 */
.perm-table th.pm-dim, .perm-table td.pm-dim { opacity: .28; }
.perm-table th.pm-focus, .perm-table td.pm-focus { background: #e8f4ff; }
.perm-table tbody tr:hover td.pm-focus { background: #ddedff; }

@media (max-width: 720px) {
  .perm-table { font-size: 11.5px; }
  .pm-cb { width: 22px; height: 22px; }
  .perm-table tbody td.pm-mod { padding: 6px 8px; min-width: 104px; }
  .perm-wrap { max-height: calc(100vh - 230px); }
}

/* ============================================================
   一键生成整本方案 · 进度面板（v4.0 第1期）
   ------------------------------------------------------------
   设计取舍：做成右下角悬浮卡而不是全屏遮罩。
   全屏遮罩会逼用户盯着进度条不能干别的；生成一本方案要几分钟，
   用户完全可能顺手去改别的章节。所以允许「后台运行」，随时可以再打开。
   ============================================================ */
.gen-fixed {
  position: fixed; right: 20px; bottom: 20px; z-index: 9000;
  width: 380px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .08);
  overflow: hidden; font-size: 13px;
  animation: genIn .22s ease-out;
}
@keyframes genIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.gen-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid #eef1f5; background: #f8fafc;
}
.gen-bar { height: 4px; background: #eef1f5; overflow: hidden; }
.gen-bar > i {
  display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1a4d8f, #2e9e5b);
  transition: width .35s ease;
}
.gen-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; font-size: 12px; color: var(--txt2);
  border-bottom: 1px solid #f4f6f9;
}
.gen-list { max-height: 240px; overflow-y: auto; padding: 4px 0; }
.gen-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; line-height: 1.5;
}
.gen-row .gen-ic { width: 14px; text-align: center; font-weight: 700; flex: none; }
.gen-row .gen-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-row.ok .gen-ic { color: #2e9e5b; }
.gen-row.err .gen-ic { color: #d9534f; }
.gen-row.run { background: #f0f7ff; }
.gen-row.run .gen-ic { color: #1a4d8f; animation: genSpin 1.1s linear infinite; }
@keyframes genSpin { to { transform: rotate(360deg); } }
.gen-row.wait { color: #94a3b8; }
.gen-ft {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-top: 1px solid #eef1f5; background: #fcfdfe;
}

/* 进度行文字过长时允许换行（章节标题常有 10+ 字） */
.gen-row .gen-t { white-space: nowrap; }

@media (max-width: 520px) {
  .gen-fixed { right: 8px; left: 8px; bottom: 8px; width: auto; }
  .gen-list { max-height: 180px; }
}

/* ============ V4.0 第2批：版本比对差异高亮 ============ */
.diff-box {
  border: 1px solid #e5e8ee;
  border-radius: 6px;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.7;
  max-height: 340px;
  overflow-y: auto;
  background: #fff;
}
.dif-eq { padding: 0 10px; color: #8a94a3; white-space: pre-wrap; word-break: break-all; }
.dif-del { padding: 0 10px; background: #fdecec; color: #b91c1c; white-space: pre-wrap; word-break: break-all; }
.dif-add { padding: 0 10px; background: #e8f6ec; color: #15803d; white-space: pre-wrap; word-break: break-all; }
.dif-skip { padding: 2px 10px; background: #f5f6f8; color: #a5adba; font-style: italic; text-align: center; font-size: 12px; }

/* ============ V4.0 第3期：OA 协同（公告 + 工作汇报） ============ */
.ann-revoked { opacity: .55; }
.ann-ops {
  display: flex; flex-direction: column; gap: 4px;
  align-self: flex-start; margin-left: 6px;
}
.ann-roster { display: flex; flex-wrap: wrap; gap: 6px; }
.ann-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 12.5px;
  background: #f1f4f9; border: 1px solid #e2e8f2; color: #5a7291;
}
.ann-chip.ok { background: #e4f7f0; border-color: #bfe8d9; color: #0e7a57; }
.ann-chip i { font-style: normal; font-size: 11px; opacity: .75; }

.rep-sec { margin-top: 10px; }
.rep-sec b { font-size: 12.5px; color: #5a7291; }
.rep-sec p {
  margin: 3px 0 0; padding: 8px 12px; background: #f8fafc;
  border-radius: 6px; line-height: 1.7; white-space: pre-wrap; word-break: break-all;
}
.rep-sec.hl p { background: #e6f1fc; }
.rep-cm {
  margin-top: 8px; padding: 8px 12px; background: #fdf9ee;
  border-left: 3px solid #dd8a1c; border-radius: 0 6px 6px 0;
}
.rep-cm p { margin-top: 3px; font-size: 13.5px; }
.rc-hd { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }

/* ============ V4.0 第3期：审批流程可视化 ============ */
.chain-flow {
  margin-bottom: 10px; padding: 6px 4px 2px;
  background: #f8fbff; border: 1px dashed #d5e3f5; border-radius: 8px;
}
.flow-svg { display: block; width: 100%; height: auto; min-height: 64px; }

.tl { display: flex; align-items: center; margin: 12px 0 4px; overflow-x: auto; padding: 4px 0; }
.tl-node { display: flex; flex-direction: column; align-items: center; min-width: 64px; text-align: center; flex: 0 0 auto; }
.tl-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  background: #eef1f6; color: #94a3b8; border: 2px solid #dfe5ee;
}
.tl-node.done .tl-dot { background: #e4f7f0; color: #0e7a57; border-color: #8fd8bf; }
.tl-node.cur .tl-dot {
  background: #e6f1fc; color: #2e86de; border-color: #2e86de;
  animation: tlPulse 1.6s ease-in-out infinite;
}
.tl-node.reject .tl-dot { background: #fdecee; color: #d64550; border-color: #ee9aa2; }
@keyframes tlPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 134, 222, .35); }
  50% { box-shadow: 0 0 0 7px rgba(46, 134, 222, 0); }
}
.tl-line { flex: 1 1 20px; min-width: 18px; height: 2px; background: #dfe5ee; margin: 0 2px 26px; }
.tl-line.passed { background: #8fd8bf; }
.tl-name { margin-top: 5px; font-size: 11.5px; color: #17263b; font-weight: 600; max-width: 96px; }
.tl-node.pend .tl-name { color: #94a3b8; font-weight: 400; }
.tl-who { font-size: 11px; color: #94a9c4; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
