/* ============================================================
   建筑施工企业工程项目管理系统 · 静态演示设计系统
   所有页面共用。页面只写内容区，外壳（侧边栏/顶栏）由 demo.js 注入。
   ============================================================ */
:root {
  --primary: #0d5aa5;
  --primary-dark: #0a3a6d;
  --primary-darker: #082c54;
  --primary-light: #e3eefb;
  --accent: #dd7d18;
  --accent-light: #fdf0e1;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #1b2430;
  --muted: #5c6a7c;
  --rule: #dde4ec;
  --rule-light: #edf1f6;
  --green: #2e7d43;
  --green-light: #e8f1e7;
  --red: #c0392b;
  --red-light: #fbe9e7;
  --purple: #7a4b9f;
  --purple-light: #f1e9f7;
  --shadow: 0 2px 10px rgba(10, 58, 109, 0.08);
  --radius: 10px;
  --sidebar-w: 232px;
  --topbar-h: 56px;
  --font: 'PingFang SC', 'Microsoft YaHei', '微软雅黑', 'Segoe UI', sans-serif;
  --mono: 'Consolas', 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--primary-light); }

/* ============ 外壳布局 ============ */
#app-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
  color: #cfdceb;
  overflow-y: auto;
  z-index: 100;
}
#app-sidebar::-webkit-scrollbar { width: 4px; }
#app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
.logo-box { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #f2a44a);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.logo-text { color: #fff; font-size: 15px; font-weight: 700; line-height: 1.3; }
.logo-text small { display: block; font-size: 10.5px; font-weight: 400; color: rgba(255,255,255,.55); letter-spacing: .06em; }
.nav-group-title {
  padding: 14px 18px 6px; font-size: 11px; color: rgba(255,255,255,.4);
  letter-spacing: .1em; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; color: #cfdceb; font-size: 13.5px;
  border-left: 3px solid transparent; cursor: pointer;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .75; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }
.nav-item.active { color: #fff; background: rgba(13,90,165,.35); border-left-color: var(--accent); }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 11px; border-radius: 8px; padding: 0 7px; line-height: 16px; font-weight: 600;
}
.sidebar-foot { padding: 14px 18px; font-size: 11px; color: rgba(255,255,255,.35); border-top: 1px solid rgba(255,255,255,.08); margin-top: 18px; }

#app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
#app-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; z-index: 90;
}
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar-spacer { flex: 1; }
.project-select { min-width: 180px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--rule); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.user-chip .u-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip .u-role { font-size: 11px; color: var(--muted); }

.demo-banner {
  background: var(--accent-light); color: #b35f10;
  font-size: 12px; text-align: center; padding: 5px 16px;
  border-bottom: 1px solid #f3d9b8;
}
.demo-banner b { font-weight: 700; }

.page { padding: 20px 24px 40px; flex: 1; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; font-weight: 700; }
.page-head .desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; }

/* ============ 卡片 ============ */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .card + .grid, .grid + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--rule-light);
}
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-head .more { margin-left: auto; font-size: 13px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; margin: 16px 0; }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g4 { grid-template-columns: repeat(4, 1fr); }

/* 统计卡 */
.stat-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.stat-card.orange::before { background: var(--accent); }
.stat-card.green::before { background: var(--green); }
.stat-card.red::before { background: var(--red); }
.stat-card .s-label { font-size: 12.5px; color: var(--muted); }
.stat-card .s-value { font-size: 26px; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.stat-card .s-value small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.stat-card .s-foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat-card .s-foot b.up { color: var(--green); }
.stat-card .s-foot b.down { color: var(--red); }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink); font-size: 13px; font-weight: 500;
  border-radius: 7px; padding: 7px 15px; cursor: pointer;
  font-family: inherit; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #0c5296; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: #c97213; }
.btn.danger { color: var(--red); border-color: #ecc8c3; }
.btn.danger:hover { background: var(--red-light); border-color: var(--red); }
.btn.success { color: var(--green); border-color: #bcd8c2; }
.btn.success:hover { background: var(--green-light); border-color: var(--green); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-link { background: none; border: none; color: var(--primary); font-size: 13px; cursor: pointer; padding: 4px 6px; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
table.dt thead th {
  background: #f5f8fc; color: var(--muted); font-weight: 600; text-align: left;
  padding: 10px 14px; white-space: nowrap; border-bottom: 1px solid var(--rule);
}
table.dt tbody td { padding: 11px 14px; border-bottom: 1px solid var(--rule-light); vertical-align: middle; }
table.dt tbody tr:hover { background: #f8fafd; }
table.dt tbody tr:last-child td { border-bottom: none; }
table.dt td.num { font-family: var(--mono); }
table.dt .ops { white-space: nowrap; }
.mono { font-family: var(--mono); }
.td-sub { font-size: 12px; color: var(--muted); line-height: 1.4; }
.cell-title { font-weight: 600; }
.pagination { display: flex; align-items: center; gap: 6px; padding: 14px 18px; justify-content: flex-end; font-size: 13px; color: var(--muted); }
.pagination .pg { min-width: 28px; height: 28px; border: 1px solid var(--rule); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: var(--surface); }
.pagination .pg.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .pg:hover:not(.active):not(.disabled) { border-color: var(--primary); color: var(--primary); }
.pagination .pg.disabled { opacity: .4; cursor: not-allowed; }

/* ============ 标签 ============ */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; border-radius: 5px; padding: 2px 9px; white-space: nowrap; }
.tag.blue { background: var(--primary-light); color: var(--primary); }
.tag.green { background: var(--green-light); color: var(--green); }
.tag.orange { background: var(--accent-light); color: var(--accent); }
.tag.red { background: var(--red-light); color: var(--red); }
.tag.purple { background: var(--purple-light); color: var(--purple); }
.tag.gray { background: #eef1f5; color: var(--muted); }
.tag.solid-blue { background: var(--primary); color: #fff; }
.tag.solid-orange { background: var(--accent); color: #fff; }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============ 筛选栏 / 表单 ============ */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--rule-light); }
.filter-bar .f-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.filter-bar .spacer { flex: 1; }
.input, .select, .textarea {
  font-family: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 7px;
  padding: 7px 11px; background: var(--surface); outline: none; transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(13,90,165,.1); }
.select { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235c6a7c' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.textarea { resize: vertical; min-height: 70px; width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.form-item label .req { color: var(--red); margin-left: 2px; }
.form-item .input, .form-item .select { width: 100%; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule-light); }

/* 复选/单选行 */
.check-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--rule-light); border-radius: 7px; font-size: 13px; margin-bottom: 8px; cursor: pointer; }
.check-row:hover { border-color: var(--primary); }
.check-row input { accent-color: var(--primary); }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

/* ============ 标签页 ============ */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--rule-light); padding: 0 18px; }
.tab-btn { padding: 12px 16px; font-size: 14px; color: var(--muted); cursor: pointer; border: none; background: none; font-family: inherit; border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 500; }
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-btn .tag { margin-left: 5px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============ 弹窗 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 30, 50, .45); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 60px 20px; overflow-y: auto; }
.modal-mask.open { display: flex; }
.modal { background: var(--surface); border-radius: 12px; width: 640px; max-width: 100%; box-shadow: 0 20px 60px rgba(8, 44, 84, .3); animation: pop .18s ease-out; }
.modal.lg { width: 820px; }
.modal.sm { width: 460px; }
@keyframes pop { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--rule-light); }
.modal-head h3 { font-size: 15.5px; font-weight: 700; }
.modal-head .close { margin-left: auto; background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-head .close:hover { color: var(--ink); }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--rule-light); display: flex; justify-content: flex-end; gap: 10px; }

/* ============ 审批步骤条 ============ */
.steps { display: flex; align-items: flex-start; margin: 8px 0; }
.step { flex: 1; text-align: center; position: relative; min-width: 72px; }
.step::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--rule); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before { background: var(--primary); }
.step .dot {
  width: 28px; height: 28px; border-radius: 50%; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted); position: relative; z-index: 1;
}
.step.done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.current .dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px rgba(13,90,165,.15); }
.step.rejected .dot { background: var(--red); border-color: var(--red); color: #fff; }
.step .s-label { font-size: 12px; margin-top: 6px; color: var(--muted); font-weight: 600; }
.step.done .s-label { color: var(--primary); }
.step .s-time { font-size: 11px; color: var(--muted); margin-top: 2px; }
.step .s-comment { font-size: 11.5px; color: var(--ink); margin-top: 3px; max-width: 110px; margin-left: auto; margin-right: auto; line-height: 1.4; }

/* 审批意见块 */
.appr-comment { background: #f8fafd; border: 1px solid var(--rule-light); border-radius: 8px; padding: 12px 14px; margin-top: 12px; font-size: 13px; }
.appr-comment .c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-weight: 600; }
.appr-comment .c-time { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* ============ 垂直时间线 ============ */
.timeline-v { position: relative; padding-left: 24px; }
.timeline-v::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--rule); }
.tl-node { position: relative; padding-bottom: 18px; }
.tl-node::before { content: ''; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--primary); }
.tl-node.warn::before { border-color: var(--accent); }
.tl-node.done::before { background: var(--primary); }
.tl-node .t-title { font-size: 13.5px; font-weight: 600; }
.tl-node .t-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-node .t-body { font-size: 13px; margin-top: 4px; color: var(--ink); }

/* ============ 进度条 ============ */
.progress { height: 8px; background: var(--rule-light); border-radius: 4px; overflow: hidden; min-width: 90px; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.progress.orange i { background: var(--accent); }
.progress.green i { background: var(--green); }
.progress-text { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ============ 甘特图（CSS 版） ============ */
.gantt { min-width: 860px; }
.gantt-head { display: flex; border-bottom: 2px solid var(--rule); }
.gantt-months { margin-left: 220px; flex: 1; display: flex; }
.gantt-months span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0; border-left: 1px solid var(--rule-light); }
.gantt-row { display: flex; border-bottom: 1px solid var(--rule-light); align-items: center; }
.gantt-row:hover { background: #f8fafd; }
.gantt-name { width: 220px; padding: 10px 14px; font-size: 13px; flex-shrink: 0; }
.gantt-name b { display: block; font-weight: 600; font-size: 13px; }
.gantt-name .td-sub { font-size: 11.5px; }
.gantt-track { flex: 1; position: relative; height: 40px; background-image: linear-gradient(to right, var(--rule-light) 1px, transparent 1px); background-size: 10% 100%; }
.gantt-bar {
  position: absolute; top: 9px; height: 22px; border-radius: 5px;
  display: flex; align-items: center; padding: 0 10px;
  font-size: 11.5px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden;
}
.gantt-bar.plan { background: rgba(13,90,165,.35); border: 1px dashed var(--primary); color: var(--primary); }
.gantt-bar.doing { background: linear-gradient(90deg, var(--primary), #1a6cb8); }
.gantt-bar.done { background: linear-gradient(90deg, var(--green), #3c9958); }
.gantt-bar.late { background: linear-gradient(90deg, var(--accent), #f2a44a); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; }

/* ============ 图片占位（照片取证） ============ */
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.photo-item {
  aspect-ratio: 4/3; border-radius: 8px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #dfe8f2, #c9d8e8);
  display: flex; align-items: center; justify-content: center;
  color: #8fa5bc; font-size: 12px; font-weight: 600;
}
.photo-item.add { border: 1.5px dashed var(--rule); background: var(--surface); color: var(--muted); font-size: 20px; cursor: pointer; }
.photo-item .p-tag { position: absolute; left: 6px; bottom: 6px; background: rgba(8,44,84,.75); color: #fff; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; }

/* ============ 空状态 / 提示条 ============ */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); font-size: 13px; }
.empty .e-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; background: var(--rule-light); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 22px; }
.notice { display: flex; gap: 10px; background: var(--primary-light); color: var(--primary-dark); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.notice.warn { background: var(--accent-light); color: #b35f10; }
.notice.success { background: var(--green-light); color: var(--green); }
.notice b { font-weight: 700; }

/* 列表项（待办/消息） */
.row-list { }
.row-list .r-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--rule-light); font-size: 13.5px; }
.row-list .r-item:last-child { border-bottom: none; }
.row-list .r-item:hover { background: #f8fafd; }
.row-list .r-title { font-weight: 600; }
.row-list .r-sub { font-size: 12px; color: var(--muted); }
.row-list .r-time { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 字段详情栅格 */
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px; }
.field-grid .f-item .f-label { font-size: 12px; color: var(--muted); }
.field-grid .f-item .f-value { font-size: 13.5px; font-weight: 600; margin-top: 2px; }

/* ============ Toast ============ */
#toast-box { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fff; font-size: 13px;
  border-radius: 8px; padding: 9px 18px; box-shadow: 0 6px 24px rgba(8,44,84,.25);
  animation: pop .2s ease-out; display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--green); }
.toast.warn { background: var(--accent); }
.toast.error { background: var(--red); }

/* ============ 流程设计器 ============ */
.designer { display: grid; grid-template-columns: 160px 1fr 240px; gap: 0; min-height: 460px; }
.designer .dz-palette { border-right: 1px solid var(--rule); padding: 14px; }
.designer .dz-canvas { position: relative; background-image: radial-gradient(var(--rule-light) 1px, transparent 1px); background-size: 18px 18px; padding: 30px 20px; overflow-x: auto; }
.designer .dz-props { border-left: 1px solid var(--rule); padding: 14px; }
.pal-node { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; margin-bottom: 8px; cursor: grab; background: var(--surface); }
.pal-node:hover { border-color: var(--primary); color: var(--primary); }
.pal-node .pn-ico { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; flex-shrink: 0; }
.flow-col { display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 130px; }
.flow-node { background: var(--surface); border: 1.5px solid var(--primary); border-radius: 9px; padding: 9px 14px; font-size: 12.5px; text-align: center; min-width: 118px; box-shadow: var(--shadow); position: relative; cursor: pointer; }
.flow-node:hover { box-shadow: 0 4px 14px rgba(13,90,165,.25); }
.flow-node.selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.flow-node .fn-role { font-size: 11px; color: var(--muted); margin-top: 2px; }
.flow-node.start { background: var(--green-light); border-color: var(--green); }
.flow-node.end { background: var(--rule-light); border-color: var(--muted); }
.flow-node.branch { border-style: dashed; border-color: var(--accent); background: var(--accent-light); }
.flow-node .fn-badge { position: absolute; top: -9px; right: -9px; background: var(--accent); color: #fff; border-radius: 8px; font-size: 10px; padding: 0 6px; line-height: 16px; }
.flow-arrow { color: var(--muted); font-size: 16px; line-height: 1; padding: 6px 0; font-family: var(--mono); }
.flow-split { display: flex; justify-content: center; gap: 26px; align-items: flex-start; width: 100%; }
.flow-branch-label { font-size: 11px; color: var(--accent); font-weight: 700; background: var(--accent-light); border-radius: 4px; padding: 1px 7px; margin-bottom: 4px; }

/* ============ 组织树 / 文件树 ============ */
.tree { font-size: 13.5px; }
.tree .t-node { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.tree .t-node:hover { background: var(--rule-light); }
.tree .t-node.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.tree .t-node .tw { color: var(--muted); font-size: 11px; width: 14px; text-align: center; font-family: var(--mono); }
.tree .t-children { padding-left: 22px; }
.split-view { display: grid; grid-template-columns: 240px 1fr; min-height: 480px; }
.split-view .sv-left { border-right: 1px solid var(--rule); padding: 14px; background: #f8fafd; border-radius: var(--radius) 0 0 var(--radius); }
.split-view .sv-right { padding: 0; }

/* ============ 登录页 ============ */
.login-page { display: grid; grid-template-columns: 1fr 460px; min-height: 100vh; }
.login-hero { background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 70%, #1a6cb8 100%); color: #fff; padding: 64px 56px; display: flex; flex-direction: column; }
.login-hero .lh-badge { border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 3px 14px; font-size: 12px; letter-spacing: .12em; align-self: flex-start; }
.login-hero h1 { font-size: 30px; line-height: 1.4; margin-top: 22px; font-weight: 700; }
.login-hero .lh-sub { margin-top: 12px; color: rgba(255,255,255,.8); font-size: 15px; }
.login-hero .lh-feats { margin-top: auto; display: grid; gap: 14px; }
.login-hero .lh-feat { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: rgba(255,255,255,.9); }
.login-hero .lh-feat i { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); margin-top: 7px; flex-shrink: 0; }
.login-panel { background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 360px; }
.login-card h2 { font-size: 21px; font-weight: 700; margin-bottom: 4px; }
.login-card .lc-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.role-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 20px; }
.role-chip { border: 1.5px solid var(--rule); border-radius: 8px; padding: 8px 4px; text-align: center; font-size: 12.5px; cursor: pointer; transition: all .15s; }
.role-chip b { display: block; font-size: 13px; }
.role-chip span { font-size: 11px; color: var(--muted); }
.role-chip.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.role-chip.active span { color: var(--primary); opacity: .75; }

/* ============ 小程序模拟 ============ */
.mobile-stage { min-height: 100vh; background: linear-gradient(150deg, var(--primary-dark), var(--primary) 60%, #1a6cb8); display: flex; flex-direction: column; align-items: center; padding: 30px 16px 50px; }
.mobile-stage .ms-title { color: #fff; text-align: center; margin-bottom: 24px; }
.mobile-stage .ms-title h1 { font-size: 21px; }
.mobile-stage .ms-title p { font-size: 13px; color: rgba(255,255,255,.7); margin-top: 4px; }
.phone {
  width: 375px; height: 812px; background: var(--bg); border-radius: 44px;
  border: 10px solid #10233a; box-shadow: 0 30px 80px rgba(3,16,32,.55);
  overflow: hidden; position: relative; display: flex; flex-direction: column;
}
.phone .notch { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 160px; height: 24px; background: #10233a; border-radius: 0 0 16px 16px; z-index: 30; }
.mini-screen { flex: 1; display: none; flex-direction: column; overflow-y: auto; background: var(--bg); }
.mini-screen.active { display: flex; }
.mini-screen::-webkit-scrollbar { width: 0; }
.mini-status { height: 34px; background: var(--primary); color: #fff; font-size: 11.5px; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 22px 3px; flex-shrink: 0; }
.mini-header { background: linear-gradient(160deg, var(--primary-dark), var(--primary)); color: #fff; padding: 14px 18px 16px; flex-shrink: 0; }
.mini-header .mh-row { display: flex; align-items: center; }
.mini-header .mh-back { font-family: var(--mono); font-size: 16px; opacity: .85; cursor: pointer; margin-right: 10px; }
.mini-header h3 { font-size: 16px; font-weight: 600; }
.mini-header .mh-sub { font-size: 11.5px; color: rgba(255,255,255,.7); margin-top: 3px; }
.mini-body { flex: 1; padding: 12px 14px 20px; }
.mini-card { background: var(--surface); border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(10,58,109,.07); }
.mini-card h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.mini-card h4::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: var(--accent); }
.mini-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.mini-stat { background: var(--surface); border-radius: 10px; padding: 10px 8px; text-align: center; box-shadow: 0 1px 4px rgba(10,58,109,.07); }
.mini-stat b { display: block; font-size: 17px; color: var(--primary); }
.mini-stat span { font-size: 10.5px; color: var(--muted); }
.mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-app { background: var(--surface); border-radius: 12px; padding: 13px 4px; text-align: center; cursor: pointer; box-shadow: 0 1px 4px rgba(10,58,109,.07); }
.mini-app:hover { background: #f8fafd; }
.mini-app .ma-ico { width: 38px; height: 38px; border-radius: 10px; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 700; }
.mini-app span { font-size: 11px; color: var(--ink); font-weight: 500; }
.mini-list .ml-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule-light); font-size: 13px; }
.mini-list .ml-item:last-child { border-bottom: none; }
.mini-list .ml-main { flex: 1; min-width: 0; }
.mini-list .ml-title { font-weight: 600; font-size: 13px; }
.mini-list .ml-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.mini-form-item { margin-bottom: 13px; }
.mini-form-item label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.mini-form-item label .req { color: var(--red); }
.mini-form-item .input, .mini-form-item .select { width: 100%; }
.mini-worker { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule-light); font-size: 13px; }
.mini-worker:last-child { border-bottom: none; }
.mini-worker .w-name { font-weight: 600; }
.mini-worker .w-role { font-size: 11px; color: var(--muted); }
.mini-worker .w-switch { margin-left: auto; display: flex; gap: 6px; }
.mini-toggle { border-radius: 999px; font-size: 11px; padding: 3px 12px; border: 1px solid var(--rule); background: var(--surface); color: var(--muted); cursor: pointer; font-family: inherit; }
.mini-toggle.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.mini-toggle.off { background: var(--rule-light); }
.mini-toggle.late { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.mini-tabbar { display: flex; background: var(--surface); border-top: 1px solid var(--rule); padding: 6px 0 14px; flex-shrink: 0; }
.mini-tab { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted); cursor: pointer; }
.mini-tab .t-ico { width: 22px; height: 22px; margin: 0 auto 2px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--rule-light); color: var(--muted); font-family: var(--mono); }
.mini-tab.active { color: var(--primary); font-weight: 700; }
.mini-tab.active .t-ico { background: var(--primary-light); color: var(--primary); }
.mini-fab { position: absolute; right: 18px; bottom: 88px; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #f2a44a); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 300; box-shadow: 0 8px 20px rgba(221,125,24,.4); cursor: pointer; z-index: 10; }
.mini-notice { background: linear-gradient(90deg, var(--accent-light), #fff); border-left: 3px solid var(--accent); border-radius: 8px; padding: 9px 12px; font-size: 11.5px; color: #b35f10; margin-bottom: 12px; }

/* 小程序页面切换提示条 */
.mobile-hint { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.85); border-radius: 10px; padding: 10px 18px; font-size: 12.5px; margin-top: 22px; max-width: 420px; text-align: center; }

/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .grid.g4 { grid-template-columns: repeat(2, 1fr); }
  .grid.g3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: repeat(2, 1fr); }
}
@media print { #app-sidebar, #app-topbar, .demo-banner { display: none; } #app-main { margin: 0; } }
