/* ================================================================
   审批中心 · 企业级设计系统
   深色侧栏 + 浅色内容 | 主色 #1677ff | 完整响应式（桌面/平板/手机）
   ================================================================ */
:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-active: #0958d9;
  --primary-bg: #e8f3ff;
  --success: #16a34a;
  --success-bg: #e6f6ee;
  --warning: #d97706;
  --warning-bg: #fef3e2;
  --danger: #dc2626;
  --danger-bg: #fdecec;
  --purple: #7c3aed;
  --purple-bg: #f1eafd;
  --cyan: #0891b2;

  --side-bg: #001529;
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(22, 119, 255, .22);

  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2329;
  --text2: #646a73;
  --text3: #8f959e;
  --border: #e5e6eb;
  --border2: #f0f1f3;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 1px 6px -1px rgba(0, 0, 0, .02), 0 2px 4px rgba(0, 0, 0, .02);
  --shadow-lg: 0 6px 16px -8px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03);
  --sidebar-w: 232px;
  --sidebar-mini: 68px;
  --topbar-h: 56px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5715;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button { font-family: inherit; cursor: pointer; }
svg { vertical-align: -3px; flex-shrink: 0; }
::selection { background: var(--primary-bg); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 15px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-size: 13px; font-weight: 400;
  transition: all .18s cubic-bezier(.4, 0, .2, 1); white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 0 rgba(5, 76, 193, .12); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 2px 0 rgba(190, 18, 18, .08); }
.btn.danger:hover { filter: brightness(1.06); color: #fff; }
.btn.danger.ghost { background: #fff; color: var(--danger); border-color: #f3c1c1; }
.btn.danger.ghost:hover { border-color: var(--danger); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover { filter: brightness(1.06); color: #fff; }
.btn.warn { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn.warn:hover { filter: brightness(1.05); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 5px; }
.btn.block { width: 100%; height: 40px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.link { border: none; background: none; color: var(--primary); padding: 0 4px; height: auto; }
.btn.link:hover { color: var(--primary-hover); }

/* ---------------- 输入控件 ---------------- */
input:not([type]), input[type=text], input[type=password], input[type=number], input[type=email], input[type=search], select, textarea {
  width: 100%; height: 34px; padding: 4px 11px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .18s, box-shadow .18s;
}
textarea { height: auto; min-height: 108px; padding: 8px 11px; line-height: 1.6; resize: vertical; }
input:not([type]):hover, input[type=text]:hover, input[type=password]:hover, input[type=number]:hover, input[type=email]:hover, input[type=search]:hover, select:hover, textarea:hover { border-color: #c9cdd4; }
input:not([type]):focus, input[type=text]:focus, input[type=password]:focus, input[type=number]:focus, input[type=email]:focus, input[type=search]:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22, 119, 255, .12); }
input::placeholder, textarea::placeholder { color: var(--text3); }
label.field { display: block; margin-bottom: 15px; }
label.field > span { display: block; margin-bottom: 6px; color: var(--text); font-size: 13px; font-weight: 500; }
label.field > span .opt { color: var(--text3); font-weight: 400; }
.req::after { content: " *"; color: var(--danger); }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; min-width: 0; }
.help { font-size: 12px; color: var(--text3); margin-top: 4px; line-height: 1.5; }

/* 带图标前缀的输入框（登录/搜索） */
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .lead { position: absolute; left: 12px; color: var(--text3); display: inline-flex; pointer-events: none; }
.input-wrap input { padding-left: 36px; height: 40px; }
.input-wrap input:focus ~ .lead { color: var(--primary); }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: var(--sidebar-w); background: var(--side-bg); color: rgba(255, 255, 255, .65);
  flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
  transition: width .2s cubic-bezier(.4, 0, .2, 1);
}
.side .logo { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: var(--topbar-h); flex-shrink: 0; border-bottom: 1px solid rgba(255, 255, 255, .08); overflow: hidden; }
.side .logo .mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #1677ff, #36cfc9); display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; font-weight: 700; }
.side .logo .txt { font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; letter-spacing: .5px; line-height: 1.25; }
.side .logo .txt .sys { display: block; font-size: 10.5px; color: rgba(255, 255, 255, .45); font-weight: 400; letter-spacing: 2.5px; }
.side nav { flex: 1; padding: 8px; overflow-y: auto; overflow-x: hidden; }
.side nav::-webkit-scrollbar { width: 4px; }
.side nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 4px; }
.nav-group-title { padding: 14px 12px 6px; font-size: 11px; color: rgba(255, 255, 255, .35); letter-spacing: 1px; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; margin-bottom: 2px;
  color: rgba(255, 255, 255, .68); cursor: pointer; border-radius: 6px; font-size: 13.5px;
  transition: all .15s; white-space: nowrap; text-decoration: none; overflow: hidden;
}
.nav-item:hover { color: #fff; background: var(--side-hover); }
.nav-item.active { color: #fff; background: var(--side-active); font-weight: 500; }
.nav-item .badge { margin-left: auto; background: #ff4d4f; color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; line-height: 17px; min-width: 17px; text-align: center; }
.side .side-foot { padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 11px; color: rgba(255, 255, 255, .3); white-space: nowrap; overflow: hidden; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border2); display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
}
.topbar .crumb { color: var(--text2); font-size: 13px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .crumb b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.g-search { width: 260px; }
.bell { position: relative; width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text2); transition: all .15s; }
.bell:hover { background: #f2f3f5; color: var(--text); }
.bell .dot { position: absolute; top: 1px; right: 0; background: #ff4d4f; color: #fff; border-radius: 9px; font-size: 10px; padding: 0 5px; line-height: 15px; min-width: 15px; text-align: center; border: 1.5px solid #fff; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: background .15s; }
.user-chip:hover { background: #f2f3f5; }
.user-chip .uname { font-size: 13px; color: var(--text); font-weight: 500; }
.user-chip .urole { font-size: 11px; color: var(--text3); line-height: 1.3; }
.hamburger { display: none; width: 36px; height: 36px; border-radius: 8px; align-items: center; justify-content: center; cursor: pointer; color: var(--text); }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #1677ff, #36cfc9); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; overflow: hidden; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.avatar.lg { width: 72px; height: 72px; font-size: 26px; border-radius: 50%; }
.avatar.editable { position: relative; cursor: pointer; }
.avatar.editable:hover::after { content: "更换"; position: absolute; inset: 0; background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }

.content { padding: 20px; max-width: 1280px; width: 100%; margin: 0 auto; }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--border2); border-radius: 8px; box-shadow: var(--shadow-lg); min-width: 170px; z-index: 60; overflow: hidden; padding: 4px; animation: ddIn .12s ease-out; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }
.dropdown-menu .dd-item { padding: 8px 12px; cursor: pointer; font-size: 13px; border-radius: 6px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.dropdown-menu .dd-item:hover { background: #f5f7fa; }

/* ---------------- 卡片 / 表格 ---------------- */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); border: 1px solid var(--border2); }
.card h3 { font-size: 15px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
.card h3 .hint { font-size: 12px; color: var(--text3); font-weight: 400; margin-left: -2px; }
.card h3 .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.page-title { font-size: 20px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title .sub { font-size: 13px; color: var(--text2); font-weight: 400; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--border2); border-radius: 8px; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 640px; }
.tbl th, .tbl td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--border2); font-size: 13px; vertical-align: middle; white-space: nowrap; }
.tbl th { color: var(--text2); font-weight: 500; background: #fafbfc; position: sticky; top: 0; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: #f7f9fc; }
.tbl .empty { text-align: center; color: var(--text3); padding: 42px 0 !important; white-space: normal; }
.cell-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }
.tno { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }

/* ---------------- 标签 ---------------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 4px; font-size: 12px; line-height: 20px; font-weight: 400; white-space: nowrap; }
.tag .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag.blue { background: var(--primary-bg); color: var(--primary); }
.tag.green { background: var(--success-bg); color: var(--success); }
.tag.red { background: var(--danger-bg); color: var(--danger); }
.tag.orange { background: var(--warning-bg); color: var(--warning); }
.tag.gray { background: #f2f3f5; color: var(--text2); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.tag.cyan { background: #e0f7fa; color: var(--cyan); }

/* ---------------- 统计卡 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--border2); cursor: pointer; transition: all .18s; display: flex; gap: 14px; align-items: center; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .ic { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .num { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-card .lbl { color: var(--text2); font-size: 12.5px; margin-top: 3px; }

/* ---------------- 图表区 ---------------- */
.chart-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; margin-bottom: 16px; }
.chart-grid.single { grid-template-columns: 1fr; }
.chart-card { background: var(--card); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border2); }
.chart-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.chart-card .cap { font-size: 12px; color: var(--text3); margin-bottom: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text2); margin-top: 12px; }
.legend .li { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 9px; height: 9px; border-radius: 2px; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; padding: 6px 0; }
.donut-center { font-size: 24px; font-weight: 700; }
.donut-center .u { font-size: 12px; color: var(--text3); font-weight: 400; }

/* ---------------- 工单类型选择 ---------------- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.type-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 16px 12px; text-align: center; cursor: pointer; transition: all .18s; background: #fff; }
.type-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(22, 119, 255, .1); transform: translateY(-2px); }
.type-card.sel { border-color: var(--primary); background: #f5f9ff; box-shadow: 0 0 0 3px rgba(22, 119, 255, .08); }
.type-card .ticon { width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 10px; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.type-card .nm { font-weight: 600; font-size: 13.5px; }
.type-card .ds { font-size: 11.5px; color: var(--text3); margin-top: 5px; line-height: 1.5; min-height: 34px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- AI 流式输出 ---------------- */
.ai-think { border: 1px dashed var(--border); border-radius: 8px; margin-bottom: 12px; background: #fafbfc; }
.ai-think-head { padding: 8px 12px; cursor: pointer; font-size: 12.5px; color: var(--text2); user-select: none; }
.ai-think-body { max-height: 180px; overflow-y: auto; margin: 0; padding: 0 12px 10px; font-size: 12px; color: var(--text3); white-space: pre-wrap; word-break: break-all; line-height: 1.6; }
.ai-out { white-space: pre-wrap; word-break: break-all; font-size: 13.5px; line-height: 1.8; max-height: calc(90vh - 220px); overflow-y: auto; min-height: 60px; }
.ai-msg { display: flex; margin-bottom: 14px; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.bot { justify-content: flex-start; flex-direction: column; align-items: flex-start; max-width: 88%; }
.ai-msg .bubble { padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }
.ai-msg.user .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.ai-msg.bot .bubble { background: #f5f7fa; border: 1px solid var(--border2); border-bottom-left-radius: 3px; }
.ai-msg-think { margin-bottom: 6px; font-size: 12px; color: var(--text3); }
.ai-msg-think summary { cursor: pointer; user-select: none; }
.ai-msg-think pre { max-height: 150px; overflow-y: auto; background: #fafbfc; border: 1px dashed var(--border); border-radius: 6px; padding: 8px 10px; margin-top: 6px; white-space: pre-wrap; word-break: break-all; }

/* ---------------- 执行任务卡片 ---------------- */
.task-card { border: 1px solid var(--border2); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.task-card:hover { border-color: #c9cdd4; }
.tc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tc-head b { font-size: 14px; }
.tc-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--text2); font-size: 12.5px; flex-wrap: wrap; }
.tc-qa { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; background: #fff7e6; border: 1px solid #f5e0bd; border-radius: 6px; padding: 8px 10px; font-size: 12.5px; line-height: 1.55; }
.tc-qa.ans { background: var(--primary-bg); border-color: #cfe5ff; }
.tc-qa.prog { background: var(--success-bg); border-color: #c8ecd8; }

/* ---------------- 组织架构 ---------------- */
.org-member { display: inline-flex; align-items: center; gap: 6px; background: #fafbfc; border: 1px solid var(--border2); border-radius: 18px; padding: 4px 10px 4px 5px; font-size: 12.5px; }
.org-member .nm { font-weight: 500; }

.fp-dot.intercepted { background: var(--danger); color: #fff; border-color: rgba(220, 38, 38, .25); }
.tl-ico.a-intercept { background: var(--danger-bg); color: var(--danger); border-color: #f6cfcf; }

/* ---------------- 横向流程进度图（流转图） ---------------- */
.fp-wrap { display: flex; align-items: flex-start; overflow-x: auto; padding: 10px 4px 6px; }
.fp-wrap::-webkit-scrollbar { height: 5px; }
.fp-wrap::-webkit-scrollbar-thumb { background: #d5d9e0; border-radius: 4px; }
.fp-node { display: flex; flex-direction: column; align-items: center; min-width: 132px; max-width: 168px; text-align: center; flex-shrink: 0; }
.fp-dot { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f2f3f5; color: #b0b6bf; border: 2px solid #e5e6eb; position: relative; z-index: 1; }
.fp-dot.done { background: var(--success); color: #fff; border-color: rgba(22, 163, 74, .25); }
.fp-dot.current { background: var(--primary); color: #fff; border-color: rgba(22, 119, 255, .3); animation: fpPulse 2s infinite; }
.fp-dot.rejected { background: var(--danger); color: #fff; border-color: rgba(220, 38, 38, .25); }
.fp-dot.returned { background: var(--warning); color: #fff; border-color: rgba(217, 119, 6, .25); }
.fp-dot.confirming { background: var(--purple); color: #fff; border-color: rgba(124, 58, 237, .25); animation: fpPulse2 2s infinite; }
@keyframes fpPulse2 { 0%, 100% { box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); } 50% { box-shadow: 0 0 0 9px rgba(124, 58, 237, .05); } }
.fp-dot.stopped { background: #eef0f3; color: var(--text3); opacity: .7; }
@keyframes fpPulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(22, 119, 255, .14); } 50% { box-shadow: 0 0 0 9px rgba(22, 119, 255, .05); } }
.fp-line { flex: 1; min-width: 34px; height: 2px; margin-top: 21px; background: #e5e6eb; }
.fp-line.passed { background: var(--success); }
.fp-who { margin-top: 9px; display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-name { font-size: 12.5px; font-weight: 600; margin-top: 3px; line-height: 1.4; }
.fp-tagline { margin-top: 4px; }
.fp-time { font-size: 11px; color: var(--text3); margin-top: 3px; }
.fp-cm { font-size: 11px; color: var(--text3); margin-top: 4px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; background: #f7f8fa; border-radius: 5px; padding: 4px 7px; width: 100%; word-break: break-all; }

/* ---------------- 步骤条（流程节点） ---------------- */
.flow-steps { display: flex; flex-direction: column; }
.flow-step { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.flow-step:last-child { padding-bottom: 0; }
.flow-step::before { content: ""; position: absolute; left: 14px; top: 32px; bottom: 2px; width: 2px; background: var(--border); }
.flow-step:last-child::before { display: none; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; background: #f2f3f5; color: var(--text3); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; z-index: 1; border: 2px solid #f2f3f5; }
.flow-step.active .step-dot { background: var(--primary); color: #fff; border-color: rgba(22, 119, 255, .25); box-shadow: 0 0 0 4px rgba(22, 119, 255, .12); }
.flow-step.approved .step-dot { background: var(--success); color: #fff; border-color: rgba(22, 163, 74, .2); }
.flow-step.rejected .step-dot, .flow-step.returned .step-dot { background: var(--danger); color: #fff; border-color: rgba(220, 38, 38, .2); }
.step-body { flex: 1; min-width: 0; padding-top: 4px; }
.step-body .nm { font-weight: 600; font-size: 13.5px; }
.step-body .meta { color: var(--text3); font-size: 12px; margin-top: 3px; }
.step-body .cm { margin-top: 7px; background: #f7f8fa; border: 1px solid var(--border2); padding: 8px 12px; border-radius: 6px; font-size: 12.5px; color: var(--text2); white-space: pre-wrap; word-break: break-all; }

/* ---------------- 时间线（流转日志） ---------------- */
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 38px; bottom: 4px; width: 2px; background: var(--border2); }
.tl-item:last-child::before { display: none; }
.tl-ico { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; z-index: 1; background: #f2f3f5; color: var(--text2); border: 1px solid var(--border2); }
.tl-ico.a-create, .tl-ico.a-resubmit { background: var(--primary-bg); color: var(--primary); border-color: #cfe5ff; }
.tl-ico.a-approve { background: var(--success-bg); color: var(--success); border-color: #c8ecd8; }
.tl-ico.a-reject { background: var(--danger-bg); color: var(--danger); border-color: #f6cfcf; }
.tl-ico.a-return, .tl-ico.a-urge, .tl-ico.a-sendback { background: var(--warning-bg); color: var(--warning); border-color: #f5e0bd; }
.tl-ico.a-transfer, .tl-ico.a-confirm { background: var(--purple-bg); color: var(--purple); border-color: #e2d6fb; }
.tl-ico.a-done { background: var(--success-bg); color: var(--success); border-color: #c8ecd8; }
.tl-body { flex: 1; min-width: 0; }
.tl-body .hd { font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tl-body .hd b { font-weight: 600; }
.tl-body .tm { color: var(--text3); font-size: 12px; margin-top: 2px; }
.tl-body .tx { margin-top: 6px; background: #f7f8fa; border: 1px solid var(--border2); border-radius: 6px; padding: 8px 12px; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; color: var(--text2); }
.tl-body .files a { margin-right: 10px; font-size: 12.5px; }

/* ---------------- 附件 ---------------- */
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border2); border-radius: 8px; margin-bottom: 8px; background: #fff; transition: all .15s; }
.file-row:hover { border-color: #c9cdd4; background: #fafbfc; }
.file-row .fi { width: 36px; height: 36px; border-radius: 8px; background: #f2f6ff; color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-row .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-row .fs { color: var(--text3); font-size: 12px; flex-shrink: 0; }
.up-zone { border: 1.5px dashed var(--border); border-radius: 8px; padding: 20px; text-align: center; color: var(--text3); cursor: pointer; transition: all .15s; font-size: 13px; background: #fafbfc; }
.up-zone:hover { border-color: var(--primary); color: var(--primary); background: #f5f9ff; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 28px; margin-bottom: 16px; flex-wrap: wrap; border-bottom: none; }
.tab { padding: 8px 2px; cursor: pointer; color: var(--text2); border-bottom: 2px solid transparent; font-size: 14px; display: flex; align-items: center; gap: 6px; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab .cnt { background: #ff4d4f; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; line-height: 16px; min-width: 16px; text-align: center; }

/* ---------------- 筛选条 ---------------- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select { width: auto; min-width: 150px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--text2); font-size: 13px; }

/* ---------------- 登录 / 注册 ---------------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% 0%, #0e2a52 0%, #001529 55%); padding: 20px; position: relative; overflow: hidden; }
.auth-wrap::before, .auth-wrap::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; }
.auth-wrap::before { width: 420px; height: 420px; background: #1677ff; top: -120px; left: -80px; }
.auth-wrap::after { width: 380px; height: 380px; background: #13c2c2; bottom: -140px; right: -60px; }
.auth-box { background: rgba(255, 255, 255, .98); border-radius: 16px; padding: 40px 36px; width: 420px; max-width: 100%; box-shadow: 0 24px 64px rgba(0, 0, 0, .35); position: relative; z-index: 1; }
.auth-box h1 { font-size: 22px; text-align: center; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.corp-brand { display: flex; align-items: center; justify-content: center; gap: 13px; margin-bottom: 8px; }
.corp-brand .mark { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, #1677ff, #36cfc9); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 24px; box-shadow: 0 6px 16px rgba(22, 119, 255, .35); }
.corp-lines .corp { font-size: 18px; font-weight: 700; letter-spacing: 1px; color: var(--text); white-space: nowrap; }
.corp-lines .sys { font-size: 12px; color: var(--text3); letter-spacing: 4px; margin-top: 2px; }
.auth-box .sub { text-align: center; color: var(--text3); font-size: 13px; margin-bottom: 28px; }
.auth-box label.field > span { color: var(--text2); }
.auth-box .link-line { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text3); }
.auth-feats { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border2); display: flex; justify-content: space-between; color: var(--text3); font-size: 11.5px; }
.auth-feats span { display: flex; align-items: center; gap: 5px; }

/* ---------------- 模态框 ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 12px; width: 560px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: slideUp .18s cubic-bezier(.4, 0, .2, 1); }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal.lg { width: 820px; }
.modal.xl { width: 96vw; height: 92vh; }
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--border2); display: flex; align-items: center; }
.modal-head .t { font-size: 16px; font-weight: 600; flex: 1; }
.modal-head .x { cursor: pointer; width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text3); font-size: 18px; }
.modal-head .x:hover { background: #f2f3f5; color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border2); display: flex; justify-content: flex-end; gap: 10px; background: #fafbfc; border-radius: 0 0 12px 12px; }

/* ---------------- 附件预览 ---------------- */
.preview-frame { width: 100%; height: calc(92vh - 150px); border: 1px solid var(--border2); border-radius: 8px; background: #fff; }
.preview-bar { display: flex; align-items: center; gap: 12px; padding: 0 4px 14px; color: var(--text2); font-size: 13px; }
.preview-bar .fn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text); }

/* ---------------- Toast / 加载 / 空状态 ---------------- */
#toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #fff; color: var(--text); padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg); border: 1px solid var(--border2); animation: slideUp .2s; max-width: 80vw; display: flex; align-items: center; gap: 8px; }
.toast.ok { border-left: 3px solid var(--success); }
.toast.err { border-left: 3px solid var(--danger); }
.loading-box { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 0; color: var(--text3); font-size: 13px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-box { text-align: center; padding: 48px 20px; color: var(--text3); }
.empty-box .eico { color: #d5d9e0; margin-bottom: 12px; }
.empty-box .etxt { font-size: 13px; }

/* ---------------- 强制改密遮罩 ---------------- */
.force-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .78); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }

/* ---------------- 部门树 ---------------- */
.dept-node { border: 1px solid var(--border2); border-radius: 10px; margin-bottom: 12px; background: #fff; }
.dept-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; flex-wrap: wrap; }
.dept-head .nm { font-weight: 600; font-size: 14px; }
.dept-children { margin: 0 14px 12px 34px; }
.dept-teams { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 16px 12px 34px; }
.team-chip { background: #fafbfc; border: 1px solid var(--border2); border-radius: 8px; padding: 7px 12px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; }

/* ---------------- 流程编辑器 ---------------- */
.flow-editor .fe-node { border: 1px solid var(--border); border-radius: 8px; padding: 13px; margin-bottom: 10px; background: #fafbfc; }
.flow-editor .fe-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.flow-editor .fe-head .idx { background: var(--primary); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }

/* ---------------- 操作区 ---------------- */
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- 人员选择 ---------------- */
.search-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border2); border-radius: 8px; margin-top: 8px; }
.search-list .sl-item { padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--border2); transition: background .1s; }
.search-list .sl-item:last-child { border-bottom: none; }
.search-list .sl-item:hover { background: #f5f9ff; }
.search-list .sl-item.sel { background: var(--primary-bg); }

/* ---------------- 杂项 ---------------- */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 14px; font-size: 13px; }
.kv .k { color: var(--text3); }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }
.muted { color: var(--text3); font-size: 12.5px; }
.hr { border: none; border-top: 1px solid var(--border2); margin: 16px 0; }
.spacer { flex: 1; }

/* ================================================================
   响应式
   ================================================================ */
/* 平板：侧栏收窄为纯图标 */
@media (max-width: 1100px) {
  .side { width: var(--sidebar-mini); }
  .side .logo .txt, .side .nav-group-title, .side .side-foot, .nav-item .badge { display: none; }
  .side .logo { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item .ntxt { display: none; }
  .nav-item { position: relative; }
  .nav-item .badge { display: none; }
  .nav-item:has(.badge)::after { content: ""; position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; background: #ff4d4f; border-radius: 50%; }
  .g-search { width: 180px; }
  .chart-grid { grid-template-columns: 1fr; }
}
/* 手机：侧栏变抽屉 */
@media (max-width: 768px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s cubic-bezier(.4, 0, .2, 1); width: var(--sidebar-w); height: 100vh; }
  .side.open { transform: none; box-shadow: 8px 0 24px rgba(0, 0, 0, .18); }
  .side .logo .txt, .side .nav-group-title, .nav-item .ntxt { display: block; }
  .nav-item .badge { display: inline-flex; margin-left: auto; }
  .nav-item:has(.badge)::after { display: none; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
  .side-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  .hamburger { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .crumb .uname-wrap, .g-search { display: none; }
  .user-chip .uname, .user-chip .urole { display: none; }
  .content { padding: 14px; }
  .form-row { flex-direction: column; gap: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-card .ic { width: 38px; height: 38px; }
  .stat-card .num { font-size: 21px; }
  .page-title { font-size: 18px; }
  .card { padding: 15px; border-radius: 10px; }
  .tabs { gap: 16px; }
  .filter-bar input, .filter-bar select { min-width: 0; flex: 1; }
  .auth-box { padding: 30px 22px; }
  .modal { max-height: 94vh; }
  .pager { justify-content: center; }
}
/* 超小屏 */
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card .lbl { font-size: 11px; }
}
