/* ============================================================
   创芯智能SEC · 样式表
   设计基调：浅色现代 SaaS 后台，白卡片 + 浅灰底 + 靛蓝主色
   ============================================================ */

/* —— 设计变量：改这里就能整体换肤 —— */
:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-soft: #fafbfe;
  --border: #e6e9f2;
  --border-strong: #d6dae8;
  --text: #1d2233;
  --text-2: #586180;
  --text-3: #8b93ad;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --success: #16a34a;
  --success-soft: #e8f7ee;
  --warning: #d97706;
  --warning-soft: #fef4e6;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --info: #0284c7;
  --info-soft: #e6f3fb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(29, 34, 51, .04), 0 4px 16px rgba(29, 34, 51, .06);
  --shadow-lg: 0 8px 40px rgba(29, 34, 51, .14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* 侧栏图标是实心风格，单独覆盖 */
.sidebar svg, .brand-mark ~ * svg { fill: none; }

/* ============================================================
   整体布局
   ============================================================ */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 18px;
  position: relative;            /* 折叠按钮 / 拖拽手柄以侧边栏右缘定位 */
  transition: width .18s ease, padding .18s ease;
}
/* 拖拽进行中关掉过渡，跟手不拖泥带水 */
.layout.sidebar-resizing .sidebar { transition: none; }

/* —— 右缘拖拽手柄：整条右缘都可拖，悬停时高亮提示 —— */
.sidebar-resizer {
  position: absolute; top: 0; right: -3px;
  width: 7px; height: 100%;
  cursor: col-resize; z-index: 70;
}
.sidebar-resizer::after {
  content: ''; position: absolute; top: 0; right: 2px;
  width: 3px; height: 100%;
  background: transparent; transition: background .15s;
}
.sidebar-resizer:hover::after, .layout.sidebar-resizing .sidebar-resizer::after {
  background: var(--primary);
  opacity: .45;
}

/* —— 折叠开关：骑在右缘上的小圆钮，折叠后箭头翻向 —— */
.sidebar-collapse {
  position: absolute; top: 26px; right: -12px; z-index: 80;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
  transition: transform .18s ease, color .15s;
  padding: 0;
}
.sidebar-collapse:hover { color: var(--primary); }
.sidebar-collapse svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.sidebar-collapse .chev-r { display: none; }
.layout.sidebar-collapsed .sidebar-collapse { transform: rotate(180deg); }
.layout.sidebar-collapsed .sidebar-collapse .chev-l { display: none; }
.layout.sidebar-collapsed .sidebar-collapse .chev-r { display: block; }

/* —— 折叠态：收成一列 64px 的图标栏 —— */
.layout.sidebar-collapsed .sidebar { width: 64px !important; padding: 18px 8px; }
.layout.sidebar-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.layout.sidebar-collapsed .brand-text { display: none; }
.layout.sidebar-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
.layout.sidebar-collapsed .nav-item span { display: none; }
.layout.sidebar-collapsed .nav-item.nav-sep-top { margin-top: 8px; }
.layout.sidebar-collapsed .engine-card { display: none; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 6px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
/* 品牌名由系统设置决定，名字特别长时用省略号收尾，不撑破侧边栏 */
.brand-text strong {
  font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-text span {
  font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 菜单超出高度时整列上下滚动（min-height:0 是关键：允许 flex 子项收缩到内容以下，
   否则 .nav 会被内容撑开、底部条目直接被裁掉看不见） */
.nav {
  display: flex; flex-direction: column; gap: 2px; flex: 1;
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
/* 细滚动条：平时几乎隐形，悬停侧边栏时才隐约可见 */
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.sidebar:hover .nav::-webkit-scrollbar-thumb { background: var(--border); }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; transition: all .15s;
}
.nav-item svg { stroke: var(--text-3); }
.nav-item:hover { background: var(--panel-soft); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active svg { stroke: var(--primary); }

/* ============================================================
   通用智能分页条（paged-list.js 配套样式）
   ============================================================ */
.paged-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; margin-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2);
}
.paged-bar .pb-info b { color: var(--text); }
.paged-bar .pb-adaptive { color: var(--text-3); }
.paged-bar .pb-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.paged-bar .pb-btn {
  border: 1px solid var(--border); background: var(--panel);
  border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; transition: all .15s;
}
.paged-bar .pb-btn:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.paged-bar .pb-btn:disabled { opacity: .45; cursor: not-allowed; }
.paged-bar .pb-chip {
  min-width: 28px; padding: 4px 6px; text-align: center;
  border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; font-size: 12.5px;
}
.paged-bar .pb-chip:hover:not(.cur) { background: var(--panel-soft); color: var(--text); }
.paged-bar .pb-chip.cur {
  background: var(--primary-soft); color: var(--primary); font-weight: 600; cursor: default;
}
.paged-bar .pb-ellipsis { color: var(--text-3); padding: 0 2px; }
.paged-bar .pb-jump { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.paged-bar .pb-input {
  width: 46px; text-align: center; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); font-size: 12.5px;
}
.paged-bar .pb-input:focus { outline: none; border-color: var(--primary); }

/* 统一待办：分页后的卡片列表需要自身可滚，滚到底触发翻页 */
.todo-list.paged { overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }

/* 底部智能引擎状态卡：不参与压缩，菜单区滚动时始终完整可见 */
.engine-card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  flex-shrink: 0;
}

/* —— 矮屏自动收缩：屏幕高度不足时整体压紧菜单行高，尽量一屏放下，
      放不下仍可上下滚动兜底 —— */
@media (max-height: 820px) {
  .sidebar { padding-top: 12px; padding-bottom: 12px; gap: 10px; }
  .nav-item { padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
  .nav-item.nav-sep-top { margin-top: 6px; }
  .engine-card { padding: 8px 10px; }
  .engine-desc { display: none; }
}
@media (max-height: 660px) {
  .nav-item { padding-top: 4px; padding-bottom: 4px; }
}
.engine-title { font-size: 11px; color: var(--text-3); letter-spacing: .5px; }
.engine-mode { font-size: 13px; font-weight: 600; color: var(--primary); margin-top: 2px; }
.engine-desc { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.5; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 64px; flex-shrink: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
}
.topbar-title h1 { font-size: 17px; font-weight: 650; }
.topbar-title p { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

.search-box { position: relative; }
.search-box input {
  width: 260px; height: 36px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 0 14px 0 36px; background: var(--panel-soft); outline: none; transition: all .15s;
}
.search-box input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.search-icon { position: absolute; left: 12px; top: 9px; width: 16px; height: 16px; stroke: var(--text-3); }

/* 顶栏跨模块搜索的即时联想下拉：CRM 客户 + ERP 往来单位统一结果 */
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .14); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.search-results .sr-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.search-results .sr-item:last-child { border-bottom: 0; }
.search-results .sr-item:hover { background: var(--panel-soft); }
.search-results .sr-type {
  flex: 0 0 auto; font-size: 11px; color: var(--primary); background: rgba(79, 70, 229, .1);
  padding: 1px 7px; border-radius: 6px; font-weight: 600;
}
/* 四种来源用不同颜色的胶囊区分，一眼就能看出结果属于哪个模块 */
.search-results .sr-type[data-t="商品"] { color: #0f9d58; background: rgba(15, 157, 88, .12); }
.search-results .sr-type[data-t="单据"] { color: #e8590c; background: rgba(232, 89, 12, .12); }
.search-results .sr-type[data-t="往来单位"] { color: #1c7ed6; background: rgba(28, 126, 214, .12); }
.search-results .sr-type[data-t="合同"] { color: #7048e8; background: rgba(112, 72, 232, .12); }
.search-results .sr-type[data-t="商机"] { color: #0b7285; background: rgba(11, 114, 133, .12); }
.search-results .sr-type[data-t="项目"] { color: #c2255c; background: rgba(194, 37, 92, .12); }
.search-results .sr-name { font-size: 13px; font-weight: 600; color: var(--text); }
.search-results .sr-sub { font-size: 12px; color: var(--text-3); margin-left: auto; }
.search-results .sr-empty { padding: 12px; font-size: 12.5px; color: var(--text-3); text-align: center; }

.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip strong { display: block; font-size: 13px; font-weight: 600; }
.user-chip span { display: block; font-size: 11.5px; color: var(--text-3); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.view { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

/* ============================================================
   通用组件
   ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.card-head h3 { font-size: 14.5px; font-weight: 650; }
.card-head .sub { font-size: 12px; color: var(--text-3); }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1280px) {
  .grid-5, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* 合规与风险页：检测规则 / 风险卡片左右两列排布（原来是上下堆叠） */
.risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;      /* 每张卡片按自身内容高度，不强行拉齐 */
}
/* 窄屏自动回落为单列，避免卡片内容被挤得太窄 */
@media (max-width: 1100px) {
  .risk-grid { grid-template-columns: 1fr; }
}

/* 模块数据全景：横向条形，直观呈现跨模块覆盖广度 */
.mc-wrap { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.mc-row { display: grid; grid-template-columns: 78px 1fr 56px; align-items: center; gap: 12px; }
.mc-label { font-size: 13px; color: var(--text-2); text-align: right; }
.mc-track { background: var(--bg-2, #f1f3f7); border-radius: 6px; height: 14px; overflow: hidden; }
.mc-track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #6366f1, #0ea5e9); }
.mc-num { font-size: 13px; font-weight: 650; color: var(--text); text-align: left; }

.section-title { font-size: 14.5px; font-weight: 650; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title .dot { width: 4px; height: 14px; border-radius: 2px; background: var(--primary); }

/* 指标卡 */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stat .meta { font-size: 12px; color: var(--text-3); }
.stat .meta .up { color: var(--success); font-weight: 600; }
.stat .meta .down { color: var(--danger); font-weight: 600; }
.stat-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.stat-icon svg { width: 16px; height: 16px; }

/* 徽标与标签 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge.s { background: #ede9fe; color: #6d28d9; }
.badge.a { background: var(--primary-soft); color: var(--primary); }
.badge.b { background: var(--info-soft); color: var(--info); }
.badge.c { background: #f1f3f9; color: var(--text-2); }
.badge.d { background: #f1f3f9; color: var(--text-3); }
.badge.high { background: var(--danger-soft); color: var(--danger); }
.badge.mid { background: var(--warning-soft); color: var(--warning); }
.badge.low { background: var(--success-soft); color: var(--success); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.neutral { background: #f1f3f9; color: var(--text-2); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.ok { background: var(--success-soft); color: var(--success); }

/* 扫码盘点：按名称搜索命中的资产条目 */
.scan-hit {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
}
.scan-hit b { font-size: 13px; }
.scan-hit .muted { margin-left: 2px; font-size: 12px; }
.scan-hit .btn { margin-left: auto; }

/* 商品条形码：等宽字体，方便肉眼比对与扫码枪录入的字符 */
.barcode { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 12px; letter-spacing: 0.5px; }

/* 扫码录入抽屉：操作说明块 / 批量模式开关 / 批量清单条目 */
.scan-guide { margin-bottom: 10px; border: 1px dashed var(--border); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; color: var(--text-2); }
.scan-guide summary { cursor: pointer; font-size: 13px; color: var(--text-1); user-select: none; }
.scan-guide ol { margin: 6px 0 2px; padding-left: 18px; }
.scan-guide li { margin-bottom: 4px; line-height: 1.55; }
.scan-mode { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-2); margin-left: 8px; white-space: nowrap; }
#scanBasketList .scan-hit .btn { margin-left: 0; }   /* 清单里按钮连排，不吃右对齐的旧规则 */
#scanBasketList .scan-qty { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
#scanBasketList .scan-qty input { width: 54px; text-align: center; padding: 2px 4px; }

.tag {
  display: inline-block; padding: 1.5px 8px; border-radius: 6px;
  background: var(--panel-soft); border: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-2); margin: 0 5px 5px 0;
}
.tag.dynamic { background: var(--primary-soft); border-color: #d8dcff; color: var(--primary); }
.tag[data-deltag] { cursor: pointer; }
.tag[data-deltag] .x { margin-left: 4px; opacity: .55; font-style: normal; }
.tag[data-deltag]:hover .x { opacity: 1; }

/* 按钮 */
.btn {
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: #fff;
  cursor: pointer; font-size: 13px; font-weight: 550;
  display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: var(--panel-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 表单控件 */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 550; }
.input, .select, textarea.input {
  height: 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 10px; background: #fff; outline: none; transition: all .15s;
}
textarea.input { height: auto; padding: 8px 10px; resize: vertical; min-height: 70px; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { min-width: 130px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
  text-align: left; padding: 9px 10px; font-size: 12px; font-weight: 600;
  color: var(--text-3); border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--panel-soft);
  position: relative;
}
table.table td { padding: 10px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
table.table tbody tr:hover { background: var(--panel-soft); cursor: pointer; }
.cell-name { display: flex; align-items: center; gap: 9px; }
.cell-name .avatar { width: 30px; height: 30px; font-size: 12px; }
.cell-name .sub { font-size: 11.5px; color: var(--text-3); }

/* 商品档案「单位」列：最小单位加粗 + 换算链小字横向排布，不再竖排堆叠撑爆行高 */
.unit-cell { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.unit-cell strong { font-weight: 600; }
.unit-cell .unit-chain { font-size: 11.5px; color: var(--text-3); }

/* 表格列宽拖动手柄：悬停到列头右缘出现，按住左右拖可调该列宽度 */
.col-resizer {
  position: absolute; top: 0; right: 0;
  width: 8px; height: 100%;
  cursor: col-resize; user-select: none; touch-action: none;
  z-index: 5;
}
.col-resizer::after {
  content: ''; position: absolute; top: 0; right: 2px;
  width: 3px; height: 100%;
  background: transparent; transition: background .15s;
}
th:hover > .col-resizer::after, .col-resizer:hover::after {
  background: var(--primary); opacity: .4;
}
table.col-resizing { user-select: none; }
table.col-resizing th, table.col-resizing td { cursor: col-resize; }
/* 用户开始拖动列宽后，表格切到固定布局，列宽由 <col> 精确控制、不再随内容重排 */
table.col-fixed { table-layout: fixed; }

/* 进度条 */
.bar { height: 6px; border-radius: 3px; background: #eef0f6; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.bar.risk > i { background: var(--danger); }

/* 列表项 */
.list-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f7; }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 空态与加载 */
.empty { padding: 40px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.loading { padding: 60px 0; text-align: center; color: var(--text-3); }
.skeleton { background: linear-gradient(90deg, #f0f2f7 25%, #e6e9f2 37%, #f0f2f7 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 提示条：层级必须高于所有弹层，否则弹窗开着时「保存成功 / 报错」会被压在下面看不见。
   弹层现在由 ui.js 动态领号（从 300 起，每层 +10），这里固定给到 9999 兜底。 */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: #1d2233; color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 9999;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   图表容器
   ============================================================ */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
/* 图表 SVG 自带内联尺寸（见 charts.js），这里再清掉全局图标规则
   svg { stroke: currentColor; stroke-width:1.8 } 误继承给图表文字的描边 */
svg.chart-svg { stroke: none; overflow: visible; }
svg.chart-svg text { stroke: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

/* ============================================================
   客户 360
   ============================================================ */
.c360 { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1180px) { .c360 { grid-template-columns: 1fr; } }

.profile-head { display: flex; gap: 12px; align-items: center; }
.profile-head .avatar { width: 48px; height: 48px; font-size: 18px; }
.profile-head .name { font-size: 16px; font-weight: 650; }
.profile-head .meta { font-size: 12px; color: var(--text-3); }

.kv { display: grid; grid-template-columns: 76px 1fr; gap: 7px 10px; font-size: 12.5px; }
.kv .k { color: var(--text-3); }
.kv .v { color: var(--text); word-break: break-all; }

/* 雷达图 */
.radar-box { display: flex; justify-content: center; padding: 6px 0; }

/* 智能洞察卡 */
.insight { display: flex; gap: 9px; padding: 9px 11px; border-radius: var(--radius-sm); background: var(--panel-soft); margin-bottom: 8px; font-size: 12.5px; line-height: 1.55; }
.insight .ic { width: 6px; border-radius: 3px; flex-shrink: 0; background: var(--text-3); }
.insight.danger { background: var(--danger-soft); }
.insight.danger .ic { background: var(--danger); }
.insight.warning { background: var(--warning-soft); }
.insight.warning .ic { background: var(--warning); }
.insight.success { background: var(--success-soft); }
.insight.success .ic { background: var(--success); }
.insight.info .ic { background: var(--info); }

/* 依据明细 */
.factor { margin-bottom: 10px; }
.factor-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.factor-row .w { color: var(--text-3); font-size: 11.5px; }

/* 时间线 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1.5px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item::before { content: ''; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.tl-item.event::before { border-color: var(--info); }
.tl-item.order::before { border-color: var(--success); }
.tl-item.message::before { border-color: var(--warning); }
.tl-time { font-size: 11.5px; color: var(--text-3); }
.tl-body { font-size: 13px; margin-top: 1px; }

/* 下一步动作卡 */
.nba { background: linear-gradient(135deg, #f5f4ff, #eef2ff); border: 1px solid #dcd9fb; border-radius: var(--radius); padding: 14px 16px; }
.nba .nba-title { font-size: 14px; font-weight: 650; color: #3730a3; }
.nba .nba-reason { font-size: 12.5px; color: #4c469b; margin-top: 5px; }
.nba ol { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; color: #4338ca; }
.nba ol li { margin-bottom: 3px; }

/* 话术卡 */
.script-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 10px; background: #fff; }
.script-card .sc-title { font-size: 13px; font-weight: 650; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.script-card .sc-content { font-size: 12.5px; color: var(--text-2); margin-top: 6px; line-height: 1.65; }
.script-card .sc-reason { font-size: 11.5px; color: var(--text-3); margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border); }
.script-card .sc-actions { display: flex; gap: 8px; margin-top: 9px; }

/* ============================================================
   会话中心
   ============================================================ */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1180px) { .chat-layout { grid-template-columns: 1fr; } }

.conv-item { display: flex; gap: 10px; padding: 11px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; border: 1px solid transparent; }
.conv-item:hover { background: var(--panel-soft); }
.conv-item.active { background: var(--primary-soft); border-color: #d8dcff; }
.conv-item .avatar { width: 34px; height: 34px; font-size: 13px; }
.conv-item .row1 { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.conv-item .nm { font-size: 13px; font-weight: 600; }
.conv-item .tm { font-size: 11px; color: var(--text-3); }
.conv-item .pv { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.conv-item .flags { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }

.msg-list { height: 380px; overflow-y: auto; padding: 4px 2px; }
.msg { display: flex; gap: 9px; margin-bottom: 14px; }
.msg .avatar { width: 30px; height: 30px; font-size: 12px; flex-shrink: 0; }
.msg .bubble { max-width: 76%; background: var(--panel-soft); border: 1px solid var(--border); padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.6; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--primary); border-color: var(--primary); color: #fff; }
.msg .who { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.msg.mine .who { text-align: right; }

.composer { display: flex; gap: 9px; align-items: flex-end; margin-top: 12px; }
.composer textarea { flex: 1; }

/* ============================================================
   营销旅程
   ============================================================ */
.journey-flow { display: flex; flex-direction: column; gap: 0; }
.jf-node { display: flex; gap: 12px; align-items: flex-start; }
.jf-left { display: flex; flex-direction: column; align-items: center; width: 30px; }
.jf-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.jf-dot.wait { background: var(--warning-soft); color: var(--warning); }
.jf-dot.branch { background: var(--info-soft); color: var(--info); }
.jf-line { width: 1.5px; flex: 1; background: var(--border); min-height: 16px; margin: 3px 0; }
.jf-body { flex: 1; padding: 0 0 14px; }
.jf-title { font-size: 13px; font-weight: 600; }
.jf-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.stat-strip { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.stat-strip b { font-size: 15px; color: var(--text); margin-right: 3px; }

/* —— 营销旅程 · 效果看板 —— */
.ef-panel { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--panel-soft, #f8fafc); }
.ef-head { font-size: 12.5px; font-weight: 650; color: var(--text); margin-bottom: 10px; }
.ef-row { display: grid; grid-template-columns: 52px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.ef-label { color: var(--text-2); }
.ef-track { background: var(--bg-2, #f1f3f7); border-radius: 6px; height: 10px; overflow: hidden; }
.ef-track i { display: block; height: 100%; border-radius: 6px; transition: width .3s; }
.ef-num { text-align: right; font-weight: 650; color: var(--text); }
.ef-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--border); }
.ef-meta b { color: var(--text); font-weight: 650; }
.ef-meta .up { color: #e11d48; }


/* ============================================================
   AI 助手
   ============================================================ */
.copilot-wrap { max-width: 880px; }
.suggestion { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--panel-soft); border: 1px solid var(--border); font-size: 12.5px; cursor: pointer; margin: 0 8px 8px 0; transition: all .15s; }
.suggestion:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.answer-box { background: linear-gradient(135deg, #f7f6ff, #f2f5ff); border: 1px solid #e0defa; border-radius: var(--radius); padding: 15px 17px; }
.answer-box .ab-title { font-size: 13.5px; font-weight: 650; color: #3730a3; }
.answer-box .ab-text { font-size: 13px; color: #3f3a8f; margin-top: 6px; line-height: 1.7; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* 漏斗 */
.funnel-row { margin-bottom: 10px; }
.funnel-label { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.funnel-track { height: 30px; background: #f2f4fa; border-radius: 6px; overflow: hidden; position: relative; }
.funnel-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #818cf8); display: flex; align-items: center; padding-left: 10px; color: #fff; font-size: 12px; font-weight: 600; }

.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.muted { font-size: 12px; color: var(--text-3); }

/* ——— 组织架构（OA · 树状部门 + 成员）——— */
.org-tree { display: flex; flex-direction: column; gap: 10px; }
.org-dept { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card, #fff); overflow: hidden; }
.org-dept-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; }
.org-dept-head:hover { background: var(--primary-soft); }
.org-caret { color: var(--text-3); font-size: 12px; width: 14px; }
.org-dept-name { font-weight: 650; font-size: 14px; }
.org-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; padding: 0 14px 14px; }
.org-member { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color .15s, transform .15s; }
.org-member:hover { border-color: var(--primary); transform: translateY(-1px); }
.org-member .avatar { width: 34px; height: 34px; font-size: 14px; flex-shrink: 0; }
.org-member-info { min-width: 0; }
.org-member-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ——— 组织架构（金字塔层级模型）——— */
.org-pyramid { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.org-layer { position: relative; padding-left: 12px; }
/* 层级分隔线：自顶向下串联，体现金字塔层级 */
.org-layer::before { content: ''; position: absolute; left: 0; top: 0; bottom: -16px; width: 2px; background: linear-gradient(var(--primary-soft), var(--border)); }
.org-layer:last-child::before { bottom: 0; }
.org-layer-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--primary, #4f46e5); background: var(--primary-soft, #eef2ff); border-radius: 999px; padding: 3px 10px; margin-bottom: 8px; }
.org-layer-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.org-dept-card { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card, #fff); padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
.org-dept-card:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(79, 70, 229, .08); }
.org-dept-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.org-dept-card-name { font-weight: 650; font-size: 14px; }
.org-dept-card-head .grow { flex: 1; }
.org-dept-card-head a { color: var(--text-3); font-size: 15px; padding: 0 3px; cursor: pointer; text-decoration: none; line-height: 1; }
.org-dept-card-head a:hover { color: var(--primary); }
.org-dept-card-head a.org-dept-del:hover { color: #e11d48; }
.org-dept-line { display: flex; gap: 8px; font-size: 12px; color: var(--text-2); line-height: 1.55; margin-top: 4px; }
.org-dept-label { flex-shrink: 0; font-weight: 600; color: var(--text-3); width: 32px; }


.right { text-align: right; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mt-20 { margin-top: 20px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.ac { align-items: center; }

/* ============================================================
   扩展模块样式：销售漏斗 / 合同 / 项目 / 管理后台 / 钻取 / 表单
   ============================================================ */

/* —— 指标卡片网格（驾驶舱与各业务模块共用） —— */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); transition: .15s;
}
.stat-card.drillable:hover { border-color: var(--primary); transform: translateY(-2px); cursor: pointer; }
.stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

/* —— 可穿透元素：鼠标手型 + 悬停高亮 —— */
.drillable { cursor: pointer; transition: .15s; }
.drillable:hover { opacity: .82; }
.drill-link { color: var(--primary); cursor: pointer; border-bottom: 1px dashed var(--primary); }
.drill-link:hover { color: var(--primary-hover); }
.hbar-row:hover { background: var(--panel-soft); border-radius: 6px; }
.small { font-size: 12px; }
.link { color: var(--primary); text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }
/* 草稿中心「操作结果」抽屉里每条去向的排版 */
.draft-result-row { padding: 10px 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; margin-bottom: 8px; background: var(--bg-soft, #f9fafb); }
.draft-result-row .link { cursor: pointer; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.ops { white-space: nowrap; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* —— 按钮 —— */
.btn {
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); color: #fff; }
.btn.danger { background: var(--danger-soft); border-color: #f3c4c4; color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.tiny { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* —— 小型表单控件（列表页筛选区） —— */
.mini-select, .mini-input {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 13px; background: #fff; color: var(--text); outline: none;
}
.mini-input { min-width: 150px; }
.mini-select:focus, .mini-input:focus { border-color: var(--primary); }
.check-inline { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-2); }

/* —— 迷你进度条 —— */
.mini-bar { display: inline-block; width: 62px; height: 6px; background: #eef0f7; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.mini-bar i { display: block; height: 100%; border-radius: 4px; }
.mini-num { font-size: 12px; color: var(--text-2); margin-left: 6px; }

/* —— 销售漏斗 —— */
.sf-row { display: grid; grid-template-columns: 96px 1fr 120px; align-items: center; gap: 12px; margin-bottom: 10px; padding: 4px 6px; border-radius: 8px; }
.sf-row:hover { background: var(--panel-soft); }
.sf-label { font-size: 13px; font-weight: 600; }
.sf-track { height: 30px; background: #f2f4fa; border-radius: 6px; overflow: hidden; }
.sf-fill { height: 100%; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: #fff; font-size: 12px; font-weight: 600; border-radius: 6px; transition: width .4s; }
.sf-meta { text-align: right; }
.sf-meta strong { font-size: 13px; }
.sf-meta .muted { display: block; }

/* —— 预警区 —— */
.alert-bar {
  background: var(--warning-soft); border: 1px solid #f6dcb4; color: #92400e;
  padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px;
}
.alert-bar.drillable:hover { border-color: var(--warning); }
.alert-inline { background: var(--panel-soft); border-left: 3px solid var(--warning); padding: 8px 12px; margin-bottom: 6px; font-size: 13px; border-radius: 0 6px 6px 0; }
.alert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.alert-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; transition: .15s; }
.alert-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.alert-card.high { background: var(--danger-soft); border-color: #f3c4c4; }
.alert-card.mid { background: var(--warning-soft); border-color: #f6dcb4; }
.alert-count { font-size: 26px; font-weight: 700; }
.alert-card.high .alert-count { color: var(--danger); }
.alert-card.mid .alert-count { color: var(--warning); }
.alert-label { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }

/* —— 页签（管理后台） —— */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { border: none; background: none; padding: 9px 16px; font-size: 13.5px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* —— 设置页布局 —— */
.settings-layout { display: grid; grid-template-columns: 190px 1fr; gap: 16px; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; }
.snav {
  text-align: left; border: none; background: none; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.snav:hover { background: var(--panel-soft); color: var(--primary); }
.snav.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.form-note { background: var(--info-soft); color: #075985; padding: 8px 12px; border-radius: 6px; font-size: 12.5px; margin-bottom: 14px; }

/* —— 表单 —— */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }

/* —— 业务单据内联增改小按钮 ——
   ＋ / ✎ / × 跟在字段名后面同一行；明细行商品列里让下拉自适应、
   按钮固定宽度，避免把 select 挤成一条缝。 */
.inline-acts { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.inline-acts .btn.tiny { padding: 1px 5px; font-size: 12px; line-height: 1.2; border-radius: 4px; }
.inline-acts .btn.ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.inline-acts .btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.inline-acts .btn.ghost.danger:hover { border-color: var(--danger); color: var(--danger); }
.inline-cell { display: flex; align-items: center; gap: 4px; }
.inline-cell select { flex: 1 1 auto; min-width: 0; }
.inline-cell .inline-acts { flex: 0 0 auto; margin-left: 0; }
.form-item input, .form-item select, .form-item textarea {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px;
  font-size: 13px; font-family: inherit; color: var(--text); background: #fff; outline: none;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-item textarea { resize: vertical; }
.form-hint { font-size: 11.5px; color: var(--text-3); }

/* —— 单位字段：输入框 + ▾ 候选面板 ——
   输入框保持可自由输入新名称；面板贴在输入框下方，点一下候选即回填。
   用 grid 排成多列，37 个常用单位也能一屏看完，不必滚动找。 */
.unit-input { position: relative; display: flex; align-items: center; gap: 4px; }
.unit-input input { flex: 1 1 auto; min-width: 0; }
.unit-input > .btn.tiny { flex: 0 0 auto; padding: 6px 8px; }
.unit-pick {
  position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 40;
  max-height: 190px; overflow-y: auto; padding: 4px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
}
.unit-pick[hidden] { display: none; }
.unit-pick-item {
  border: 1px solid var(--border); background: var(--panel-soft); color: var(--text);
  border-radius: 5px; padding: 5px 4px; font-size: 12px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.unit-pick-item:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.unit-pick-empty { grid-column: 1 / -1; padding: 8px; font-size: 12px; color: var(--text-3); }

/* —— 可检索档案下拉（往来单位 / 仓库 / 经手人 / 商品）——
   搜索框输入即过滤，▾ 展开全部；隐藏 select 存真实 id，保存链路不变。 */
.search-select { position: relative; display: flex; align-items: center; gap: 4px; }
.search-select .ss-input {
  flex: 1 1 auto; min-width: 0; width: 100%;
  height: 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0 10px; font-size: 13px; font-family: inherit; color: var(--text); background: #fff; outline: none;
}
.search-select .ss-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.search-select > .btn.tiny { flex: 0 0 auto; padding: 6px 9px; }
/* 可检索下拉的候选面板：改用 fixed 定位，left/top/width/maxHeight 由
   ui.js 的 ssPlace() 按搜索框的视口坐标写入。原 absolute 会被弹窗
   .modal-body(overflow-y:auto) 与明细表 .table-wrap(overflow-x:auto)
   裁掉，表格里的「物料」下拉因此看不到候选；fixed 不受祖先 overflow
   影响。z-index 高于弹窗内部其它内容，保证盖在表头/表尾之上。 */
.ss-panel {
  position: fixed; top: 0; left: 0; z-index: 400;
  max-height: 220px; overflow-y: auto; padding: 4px;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.ss-panel[hidden] { display: none; }
.ss-item {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  color: var(--text); border-radius: 5px; padding: 7px 8px; font-size: 13px; cursor: pointer;
}
.ss-item:hover, .ss-item.active { background: var(--primary-soft); color: var(--primary); }
.ss-empty { padding: 8px; font-size: 12px; color: var(--text-3); text-align: center; }
/* 台账里「来源单号 / 状态」可点击钻取来源单据的链接与徽标 */
.badge-link { text-decoration: none; cursor: pointer; }
.badge-link:hover .badge { filter: brightness(0.96); }

.req { color: var(--danger); font-style: normal; }
.form-error { color: var(--danger); font-size: 12.5px; margin-top: 10px; }
.static-field { padding: 8px 0; font-size: 13px; color: var(--text-2); }
/* 电话字段：输入框 + 右侧「显示 / 隐藏」小按钮 */
.phone-input { display: flex; gap: 6px; align-items: center; }
.phone-input input { flex: 1 1 auto; min-width: 0; letter-spacing: .3px; }
.phone-input .btn { flex: 0 0 auto; white-space: nowrap; }
/* 开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d6dae8; border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span:before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span:before { transform: translateX(18px); }

/* —— 模态框 —— */
.modal-mask { position: fixed; inset: 0; background: rgba(24, 28, 44, .45); display: flex; align-items: center; justify-content: center; z-index: 90; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 15px; }
.modal-x { border: none; background: none; font-size: 22px; line-height: 1; color: var(--text-3); cursor: pointer; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }
.confirm-text { font-size: 13.5px; line-height: 1.7; color: var(--text-2); }

/* —— 右侧抽屉：钻取明细 / 详情 —— */
.drill-panel {
  position: fixed; top: 0; right: 0; height: 100%; width: min(760px, 92vw);
  background: #fff; box-shadow: var(--shadow-lg); z-index: 95;
  display: flex; flex-direction: column; transform: translateX(102%); transition: transform .25s ease;
}
.drill-panel.show { transform: translateX(0); }
.drill-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drill-head strong { font-size: 15px; }
.drill-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.drill-close { border: 1px solid var(--border-strong); background: #fff; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text-2); }
.drill-close:hover { border-color: var(--primary); color: var(--primary); }
.drill-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.drill-sum { display: flex; gap: 18px; padding: 10px 18px; background: var(--panel-soft); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.drill-sum-item { display: flex; flex-direction: column; }
.drill-sum-item span { font-size: 11.5px; color: var(--text-3); }
.drill-sum-item strong { font-size: 15px; }
.drill-table { font-size: 13px; }
.drill-table td { padding: 7px 8px; }
.drill-row:hover { background: var(--primary-soft); }
.drill-foot { padding: 10px 0; font-size: 12px; color: var(--text-3); text-align: center; }
.drawer-foot { padding: 14px 0 4px; display: flex; gap: 10px; justify-content: flex-end; }

/* —— 详情字段网格 —— */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.detail-grid > div { background: var(--panel-soft); border-radius: 8px; padding: 10px 12px; }
.detail-grid span { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; }
.detail-grid strong { font-size: 13.5px; font-weight: 600; }
.sub-title { font-size: 13.5px; font-weight: 700; margin: 16px 0 8px; padding-left: 8px; border-left: 3px solid var(--primary); }

/* —— 权限矩阵 —— */
table.matrix th, table.matrix td { text-align: center; font-size: 12.5px; }
table.matrix td:first-child, table.matrix th:first-child { text-align: left; }
.perm-dot { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.perm-dot.p-admin { background: var(--primary-soft); color: var(--primary); }
.perm-dot.p-many { background: var(--info-soft); color: var(--info); }
.perm-dot.p-few { background: #f1f3f9; color: var(--text-2); }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }

/* —— 权限与模块：模块启停 / 草稿开关 / 权限单元格 —— */
.module-toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px; font-size: 13px; }
.switch-row > span { color: var(--text-1); }
.perm-cell {
  min-width: 52px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s; background: #fff; color: var(--text-2);
}
.perm-cell:hover { filter: brightness(0.97); }
.perm-cell.p-inherit { background: #f1f3f9; color: var(--text-2); border-color: #e2e6f0; }
.perm-cell.p-grant { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.perm-cell.p-deny { background: #fdecec; color: var(--danger); border-color: var(--danger); }
.role-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.role-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.role-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.6; }

/* —— 用户身份切换 —— */
.user-chip { position: relative; cursor: pointer; }
.caret { width: 14px; height: 14px; fill: var(--text-3); transform: rotate(90deg); }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.user-menu {
  display: none; position: absolute; right: 16px; top: 62px; width: 260px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 80; padding: 6px;
}
.user-menu.show { display: block; }
.um-head { font-size: 12px; color: var(--text-3); padding: 8px 10px; }
.um-foot { font-size: 11.5px; color: var(--text-3); padding: 8px 10px; border-top: 1px solid var(--border); line-height: 1.5; }
.um-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.um-item:hover { background: var(--panel-soft); }
.um-item.active { background: var(--primary-soft); }
.um-item strong { font-size: 13px; }
.um-item span { font-size: 11.5px; color: var(--text-3); display: block; }
.um-item .badge { margin-left: auto; }
.nav-admin { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; }

/* —— 窄屏适配 —— */
@media (max-width: 1100px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; }
  .sf-row { grid-template-columns: 80px 1fr; }
  .sf-meta { grid-column: 1 / -1; text-align: left; }
}

/* 用户菜单定位基准 */
.topbar-right { position: relative; }

/* ============================================================
   表格排序（点表头正序/倒序切换）
   ============================================================ */
.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; transition: .12s; }
.sortable-th:hover { color: var(--primary); }
.table thead th.sortable-th:hover { background: var(--panel-soft); }
/* 排序指示箭头：未排序时淡灰 ↕，当前排序列显示 ↑ 或 ↓ */
.sort-ind { display: inline-block; margin-left: 5px; font-style: normal; font-size: 11px; color: #c3c8d8; }
th.sort-active { color: var(--primary); }
th.sort-active .sort-ind { color: var(--primary); font-weight: 700; }
/* 表格右上角的排序说明 */
.sort-hint { font-size: 11.5px; color: var(--text-3); }

/* ============================================================
   报表分析页
   ============================================================ */

/* 工具条：时间范围 / 粒度 / 指标三行控件 */
.report-bar {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.rb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rb-row + .rb-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.rb-label { font-size: 12.5px; color: var(--text-3); min-width: 56px; font-weight: 600; }
.rb-label.ml { margin-left: 12px; }
.rb-sep { font-size: 12.5px; color: var(--text-3); }
.rb-custom input[type="date"] {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 5px 8px; font-size: 12.5px; color: var(--text); background: #fff;
}

/* 分段按钮组（时间范围、粒度、图表类型共用） */
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.seg-btn {
  border: 1px solid var(--border-strong); background: #fff; color: var(--text-2);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
  transition: .12s; white-space: nowrap;
}
.seg-btn:hover { border-color: var(--primary); color: var(--primary); }
.seg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 下拉选择 */
.sel {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  color: var(--text); font-size: 12.5px; padding: 5px 8px; cursor: pointer;
}
.card-head .sel { margin-left: auto; }

/* KPI 卡片行 */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; margin-top: 14px; }
.kpi-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; transition: .14s;
}
.kpi-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.kpi-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi-value {
  font-size: 26px; font-weight: 800; margin: 4px 0 8px; letter-spacing: -.4px;
  font-variant-numeric: tabular-nums; /* 数字等宽，位数不同的数值也能对齐 */
}
.kpi-rates { display: flex; gap: 14px; flex-wrap: wrap; }
.kpi-rate { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }

/* —— 增长率标记：国内报表习惯「涨红跌绿」 —— */
.rt { font-weight: 800; font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rt.up { color: #f43f5e; }      /* 上涨：红 */
.rt.down { color: #10b981; }    /* 下降：绿 */
.rt.flat { color: #94a3b8; }    /* 持平：灰 */
.rt.new { color: #0ea5e9; }     /* 基期为 0 的新增：蓝 */
.rt.na { color: #c3c8d8; }      /* 无可比数据：浅灰 */

/* 图表容器 */
.chart-box { width: 100%; overflow: hidden; }
.chart-box svg { width: 100%; height: auto; display: block; overflow: visible; }
.head-tools { margin-left: auto; }
.stat-line { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }

/* 回归区块 */
.reg-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.reg-item {
  background: var(--panel-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; display: flex; flex-direction: column; gap: 3px;
}
.reg-item span { font-size: 13px; color: var(--text-2); }
.reg-item strong { font-size: 18px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.reg-item em { font-style: normal; font-size: 12.5px; color: var(--text-2); font-weight: 400; }
.reg-note { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin-top: 10px; }
.reg-note code {
  background: var(--primary-soft); color: var(--primary); padding: 1px 6px;
  border-radius: 5px; font-size: 12px;
}

/* 构成区块：左图右图例 */
.g2.dim-head { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }

/* 明细表 / 构成表里的钻取行 */
.table tbody tr.drillable { cursor: pointer; }
.table tbody tr.drillable:hover { background: var(--primary-soft); }
.btn.xs { padding: 2px 9px; font-size: 11.5px; border-radius: 999px; }

@media (max-width: 1100px) {
  .g2.dim-head { grid-template-columns: 1fr; }
  .reg-stats { grid-template-columns: 1fr; }
}

/* —— 报表数字可读性增强 ——
   报表里数字密集，统一做三件事：字号加大、数字等宽对齐、关键值加粗变深。 */
#detailTable, #dimBox .table { font-size: 13.5px; }
#detailTable td, #dimBox .table td { font-variant-numeric: tabular-nums; }
#detailTable strong { font-size: 14.5px; font-weight: 800; color: var(--text); }
#detailTable .muted, #dimBox .table .muted { color: var(--text-3); }

/* 表格里的增长率标记：加粗 + 等宽，红绿一眼可辨 */
#detailTable .rt, #dimBox .table .rt { font-size: 13px; }

/* 图表区留白：图上的数字放大后需要更多呼吸空间，避免贴边被裁 */
.chart-box { padding: 4px 2px 2px; }

/* 位数特别多的 KPI 值（如 ¥10,920,700）自动降一档，防止撑破卡片 */
.kpi-value.long { font-size: 20px; letter-spacing: -.2px; }

/* —— 带数值的图例 ——
   饼图小扇区标不下百分比，用这份清单补齐每一项的准确数字 */
.dim-legend { display: flex; flex-direction: column; gap: 6px; }
.dl-row {
  display: grid; grid-template-columns: 12px 1fr auto auto auto;
  align-items: center; gap: 10px; font-size: 13px;
  padding: 5px 8px; border-radius: 8px; background: var(--panel-soft);
}
.dl-row:hover { background: var(--primary-soft); }
.dl-row i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.dl-name { color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-val { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.dl-share { color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }
.dl-rate { min-width: 62px; text-align: right; }

/* 数据点过多、柱状图自动降级为曲线时的说明条 */
.dense-hint {
  background: var(--warning-soft); border: 1px solid #f6d9a8; color: #92610a;
  border-radius: 8px; padding: 8px 12px; font-size: 12.5px; line-height: 1.6; margin-bottom: 10px;
}

/* —— 业财一体模块 ——
   侧边栏分组标题、表格选中行、助理对话气泡 */
.nav-label {
  font-size: 11px; color: var(--text-3); letter-spacing: .5px;
  padding: 12px 12px 4px; margin-top: 4px; border-top: 1px solid var(--border);
}
/* 「云服务」分组标题已移除，但这一组仍需与上一组分隔开，
   所以把原来由 .nav-label 承担的顶部分隔线交给首个条目自己画。
   （.nav-label 的 border-top 是它自带的上边线，标题一删线也跟着没了，
     结果「云服务」会和「业财智能助理」挤成一组，视觉上像同一栏目。） */
/* 分组分隔线已按需求去除，仅保留少量间距区分「主业务」与「进销存/云服务」分组 */
.nav-item.nav-sep-top {
  margin-top: 10px;
}
.table tr.erp-row { cursor: pointer; }
.table tr.erp-row:hover { background: var(--panel-soft); }
.table tr.erp-row.selected { background: var(--primary-soft); }
.chat-msg { display: flex; margin-bottom: 12px; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.7; background: var(--panel-soft);
  color: var(--text); border: 1px solid var(--border);
}
.chat-msg.user .chat-bubble { background: var(--primary); border-color: var(--primary); color: #fff; }
.chat-msg.ai .chat-bubble { border-top-left-radius: 4px; }
.chat-msg.user .chat-bubble { border-top-right-radius: 4px; }

/* 窄屏时把工作台的右侧上下文与助理的建议栏折到下方，避免挤成一团 */
@media (max-width: 1100px) {
  .nav-label { padding-top: 8px; }
}

/* ── 单据里的「选中即带出」紧凑提示条 ────────────────────────────
   目标：一行放完所有关键数字，所以全部用行内胶囊 + 自动换行，
   而不是每个指标独占一行的卡片；右侧 × 让不需要的人立刻收掉。 */
.ctx-bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  margin-top: 6px;
  padding: 4px 26px 4px 8px;   /* 右侧留白给关闭按钮，避免文字压到 × 下面 */
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  font-size: 12px;
  line-height: 1.7;
}
.ctx-chip { white-space: nowrap; color: var(--text-2); }
.ctx-chip i { font-style: normal; color: var(--text-3); margin-right: 3px; }
.ctx-chip b { color: var(--text); font-weight: 600; }
.ctx-chip small { color: var(--text-3); margin-left: 1px; font-weight: 400; }
.ctx-chip.bad b { color: var(--danger); }
.ctx-chip.good b { color: var(--success); }
.ctx-chip.warn b { color: var(--warning); }
.ctx-chip.muted b, .ctx-chip.muted { color: var(--text-3); }
.ctx-chip.dist i { color: var(--primary); }
/* 可穿透的胶囊：手型 + 悬停下划线，提示"这个数字能点开看构成" */
.ctx-chip.drillable { cursor: pointer; border-radius: 3px; }
.ctx-chip.drillable:hover { background: var(--border); }
.ctx-chip.drillable:hover b { text-decoration: underline; }
/* 基础 .btn 是 34px 高，会把这条 12px 字号的提示条顶成两行半，
   所以这里强制压到和胶囊同一行高，按钮才不会把整条撑高 */
.ctx-bar .btn.tiny {
  height: 20px; padding: 0 8px; font-size: 11.5px; line-height: 1; font-weight: 500;
}
/* 关闭按钮钉在右上角：换行多少次都不会跟着跑到中间去 */
.ctx-x {
  position: absolute; top: 2px; right: 3px;
  width: 20px; height: 20px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 4px; background: transparent;
  color: var(--text-3); font-size: 15px; line-height: 1; cursor: pointer;
}
.ctx-x:hover { background: var(--border); color: var(--text); }

/* —— 单据里「选中即带出」的整行块：横跨两列、紧贴往来单位那一行 —— */
/* 之前带出条被塞进「往来单位」半宽格子里只占了左半边；换成整行块后向右铺满。 */
.form-block { grid-column: 1 / -1; }

/* ————————————————————————————————————————————————
   商品扩展属性：表单分组标题 / 图片视频控件 / 列表缩略图 / 明细行批次区
   ———————————————————————————————————————————————— */

/* 分组标题：把 19 个字段的长表单切成「基础信息 / 规格与包装 / 批次与效期」几块，
   跨两列并带一条细线，滚动填表时能立刻知道自己填到哪一段 */
.form-group-title {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  margin: 6px 0 -2px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  letter-spacing: .3px;
}
.form-group-title::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: var(--primary);
}
.form-group-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}
.form-group-title:first-child { margin-top: 0; }

/* 媒体字段：整行铺满（缩略图横排更好看），控件内自带预览与上传按钮 */
.form-item.media-item { grid-column: 1 / -1; }
.media-field {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--panel-soft);
}
.media-list { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 auto; }
.media-list.readonly { flex: 1 1 100%; }
.media-empty {
  color: var(--text-3); font-size: 12.5px; padding: 10px 4px;
}
.media-card {
  position: relative; width: 108px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); overflow: hidden;
}
.media-card.is-video { width: 200px; }
.media-thumb { display: block; width: 100%; height: 74px; background: #000; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card video { width: 100%; height: 108px; background: #000; display: block; }
.media-meta {
  display: flex; justify-content: space-between; gap: 4px;
  padding: 4px 6px; font-size: 11px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-meta span { color: var(--text-3); opacity: .8; }
/* 删除按钮压在缩略图右上角：鼠标移上去才明显，避免误点 */
.media-del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; cursor: pointer; line-height: 1;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px;
  opacity: 0; transition: opacity .15s;
}
.media-card:hover .media-del { opacity: 1; }
.media-del:hover { background: var(--danger, #d9534f); }
.media-add {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 108px; height: 96px; cursor: pointer;
  border: 1px dashed var(--border); border-radius: 8px;
  color: var(--text-3); font-size: 12px; background: var(--panel);
  transition: border-color .15s, color .15s;
}
.media-add:hover { border-color: var(--primary); color: var(--primary); }
.media-add-ico { font-size: 20px; line-height: 1; }
.media-add.uploading { border-color: var(--primary); color: var(--primary); cursor: progress; }

/* 商品档案列表里的缩略图 */
.row-thumb-wrap { position: relative; display: inline-block; }
.row-thumb {
  width: 34px; height: 26px; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--border); display: block; background: var(--panel-soft);
}
.row-thumb-num {
  position: absolute; right: -4px; bottom: -4px;
  background: var(--primary); color: #fff; font-style: normal;
  font-size: 9px; line-height: 1; padding: 1px 4px; border-radius: 8px;
}

/* 批次胶囊：已启用批次给可点链接，其中有过期批次时转橙色提醒 */
.batch-chip {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11.5px; text-decoration: none;
  background: var(--panel-soft); border: 1px solid var(--border); color: var(--text-2);
}
.batch-chip:hover { border-color: var(--primary); color: var(--primary); }
.batch-chip.warn { background: rgba(230, 160, 40, .12); border-color: rgba(230, 160, 40, .45); color: #b8791a; }

/* 单据明细行的批次区：贴在商品下拉下方，不额外占一列（否则表格会横向溢出） */
.line-batch {
  display: grid; grid-template-columns: minmax(0, 1fr) 1fr 1fr; gap: 4px;
  margin-top: 4px;
}
.line-batch[hidden] { display: none; }
.line-batch select, .line-batch input {
  font-size: 11.5px; padding: 2px 4px; height: 24px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--panel); color: var(--text);
}
.erp-ctx-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 8px 10px 10px;
  margin-top: 2px;
}
.erp-ctx-box .ctx-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.erp-ctx-box .ctx-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.erp-ctx-box .ctx-x { position: static; width: 20px; height: 20px; }
/* 折叠容器：默认只露约一行，超出部分裁掉；加 .open 后展开全部 */
.erp-ctx-box .ctx-collapse {
  max-height: 30px; overflow: hidden; transition: max-height .2s ease;
}
.erp-ctx-box .ctx-collapse.open { max-height: 1200px; overflow: visible; }
/* 容器内不再需要为 × 留白、也不要自带边框底纹（外层盒子已提供） */
.erp-ctx-box .ctx-collapse > .ctx-bar,
.erp-ctx-box .ctx-exp-bar {
  margin-top: 0; padding: 2px 0; border: 0; background: transparent;
}
/* 展开全部：点一下展开/收起，只有内容真的超出一行时才出现 */
.erp-ctx-box .ctx-more {
  margin-top: 4px; padding: 1px 9px; height: 22px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--panel); color: var(--primary);
  font-size: 12px; cursor: pointer;
}
.erp-ctx-box .ctx-more:hover { background: var(--border); }
.erp-ctx-box .ctx-expenses {
  margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px;
}
.erp-ctx-box .ctx-exp-head { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.erp-ctx-box .ctx-chip.exp i { color: var(--primary); }

/* ————————————————————————————————————————————————
   AI 智能客服：顶部入口按钮 + 右侧对话面板
   ———————————————————————————————————————————————— */
.topbar-center { flex: 1; display: flex; align-items: center; justify-content: flex-end; padding-right: 18px; }
.helpdesk-btn {
  display: inline-flex; align-items: center; gap: 6px;
  /* 窄屏下顶栏空间不足时按钮会被压扁，中文逐字换行成竖排；锁宽且不收缩 */
  white-space: nowrap; flex-shrink: 0;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--primary); color: var(--primary);
  background: var(--primary-soft); border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.helpdesk-btn:hover { background: var(--primary); color: #fff; }
.helpdesk-btn .hd-icon { width: 16px; height: 16px; stroke: currentColor; }

/* 对话面板：占满抽屉内容区，只有消息列表滚动，输入框固定底部 */
.hk { display: flex; flex-direction: column; height: 100%; }
.hk-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.hk-hotline { font-size: 12.5px; color: var(--text-2); }
.hk-hotline b { color: var(--primary); }
.hk-mode { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.hk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.hk-chip {
  font-size: 12px; border: 1px solid var(--border-strong); background: var(--panel-soft);
  color: var(--text-2); border-radius: 999px; padding: 4px 10px; cursor: pointer; transition: all .15s;
}
.hk-chip:hover { border-color: var(--primary); color: var(--primary); }
.hk-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.hk-msg { display: flex; }
.hk-msg.user { justify-content: flex-end; }
.hk-msg.assistant { justify-content: flex-start; }
.hk-bubble { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.7; word-break: break-word; }
.hk-msg.user .hk-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.hk-msg.assistant .hk-bubble { background: var(--panel-soft); color: var(--text); border-bottom-left-radius: 3px; }
.hk-msg.loading .hk-bubble { color: var(--text-3); }
.hk-src { display: block; margin-top: 6px; font-size: 10.5px; color: var(--text-3); opacity: .85; }
.hk-input-row { display: flex; gap: 8px; margin-top: 10px; }
.hk-input-row .input { flex: 1; height: 38px; }

/* ===== AI 智能客服：语音交互 ===== */
/* 顶栏右侧一组：播报开关 + 引擎模式并排 */
.hk-bar-right { display: flex; align-items: center; gap: 6px; }
.hk-speak {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 9px; background: transparent; cursor: pointer;
  white-space: nowrap; transition: all .15s;
}
.hk-speak:hover { border-color: var(--primary); color: var(--primary); }
/* 开启态：主色描边 + 主色文字，一眼看出播报正开着 */
.hk-speak.on { border-color: var(--primary); color: var(--primary); background: rgba(59,130,246,.08); }
/* 麦克风按钮：和输入框同高，聆听中变红并呼吸闪烁 */
.hk-mic {
  width: 38px; height: 38px; flex: none; border-radius: 8px;
  border: 1px solid var(--border); background: transparent; cursor: pointer;
  font-size: 16px; line-height: 1; transition: all .15s;
}
.hk-mic:hover { border-color: var(--primary); }
.hk-mic.listening { border-color: #ef4444; color: #ef4444; animation: hk-pulse 1.1s ease-in-out infinite; }
@keyframes hk-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.35); }
  50% { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
}
/* 业财智能助理麦克风：复用统一语音引擎后同样有聆听态（红色呼吸） */
#btnVoice.listening { border-color: #ef4444; color: #ef4444; animation: hk-pulse 1.1s ease-in-out infinite; }
/* 消息气泡里的「重播」小按钮：低调放在来源标签旁 */
.hk-replay {
  display: inline-block; margin-top: 6px; margin-right: 8px;
  font-size: 10.5px; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px; background: transparent; cursor: pointer;
}
.hk-replay:hover { border-color: var(--primary); color: var(--primary); }


/* 统一待办中心 */
.todo-summary { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 14px; }
.todo-summary .stat-card.small .stat-value { font-size: 22px; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item { padding: 10px 12px; border: 1px solid var(--border, #e6e8ef); border-radius: 10px; cursor: pointer; transition: .15s; background: var(--card, #fff); }
.todo-item:hover { border-color: var(--primary, #6366f1); box-shadow: 0 2px 10px rgba(99,102,241,.12); transform: translateY(-1px); }
.todo-item.overdue { border-left: 3px solid #ef4444; }
.todo-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo-type { font-size: 12px; color: var(--text-3); }
.todo-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.todo-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; font-size: 12px; }
@media (max-width: 1280px) { .todo-summary { grid-template-columns: repeat(2, 1fr); } }

/* ERP 履约链路（合同 / 项目详情内） */
.fulfill-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 10px 0 4px; }
.fulfill-card { background: var(--bg-2, #f5f7fb); border-radius: 10px; padding: 10px 12px; }
.fulfill-label { font-size: 12px; color: var(--text-3); }
.fulfill-value { font-size: 18px; font-weight: 700; color: var(--text); margin: 2px 0; }
.fulfill-sub { font-size: 11.5px; color: var(--text-3); }
.fulfill-table { font-size: 12.5px; }
.fulfill-table th, .fulfill-table td { padding: 6px 8px; }
.sub-sub { font-size: 13px; font-weight: 650; margin: 14px 0 6px; color: var(--text); }
@media (max-width: 1280px) { .fulfill-summary { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   响应式：窄屏自适应 + 移动端侧边栏抽屉
   目标：内网 / 本机 / 外网任意设备打开都自适应，不破版
   ============================================================ */

/* 汉堡开关：桌面端隐藏，窄屏才出现 */
.menu-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-right: 10px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel); color: var(--text-2); cursor: pointer;
}
.menu-toggle svg { width: 20px; height: 20px; }

/* 侧边栏遮罩：窄屏抽屉打开时盖住主区 */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 150;
  background: rgba(15, 23, 42, .35);
}

/* —— 平板 / 笔记本：侧边栏收为可滑出抽屉 —— */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
    width: 248px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(15, 23, 42, .22);
  }
  .layout.sidebar-open .sidebar { transform: translateX(0); }
  .layout.sidebar-open .sidebar-backdrop { display: block; }
  .menu-toggle { display: inline-flex; }
  /* 侧边栏脱离文档流后，主区自然占满宽度 */
  .main { width: 100%; }
  /* 抽屉模式下固定宽度，拖拽调宽与桌面折叠按钮都无意义，藏掉 */
  .sidebar-resizer, .sidebar-collapse { display: none; }
}

/* —— 手机：进一步收敛顶栏与间距，筛选条件换行 —— */
@media (max-width: 640px) {
  .topbar { padding: 0 12px; height: 56px; }
  .topbar-title h1 { font-size: 15px; }
  .topbar-title p { display: none; }
  .topbar-center { display: none; }
  .search-box input { width: 150px; height: 34px; }
  .user-chip span { display: none; }
  .view { padding: 14px 12px 32px; }
  .card { padding: 13px 13px; }
  .filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .filters .field { min-width: 0; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ============================================================
   全局语音 / 文字指令台
   右下角常驻麦克风 + 浮层面板；层级要高于抽屉（150），低于提示条（200）
   ============================================================ */
.voice-btn { margin-right: 10px; }
.topbar-center .helpdesk-btn + .helpdesk-btn { margin-left: 10px; }

/* 常驻入口：圆形渐变按钮，面板展开时收起 */
.vc-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 155;
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 18px 0 14px;
  border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff; font-size: 13.5px; font-weight: 650;
  box-shadow: 0 10px 26px rgba(79, 70, 229, .38);
  transition: transform .18s, opacity .18s, box-shadow .18s;
}
.vc-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(79, 70, 229, .46); }
.vc-fab.hidden { opacity: 0; transform: translateY(160%); pointer-events: none; }
.vc-fab svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* 面板本体：固定右下，竖向三段（头 / 消息 / 输入） */
.vc-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 160;
  width: 404px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(20, 26, 50, .22);
  opacity: 0; transform: translateY(14px) scale(.98); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.vc-panel.show { opacity: 1; transform: none; pointer-events: auto; }

.vc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.vc-title { display: flex; gap: 9px; align-items: flex-start; }
.vc-title strong { display: block; font-size: 14px; }
.vc-title span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.vc-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 rgba(79, 70, 229, .5); animation: vcPulse 2.4s infinite; flex: none; }
@keyframes vcPulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .45); }
  70% { box-shadow: 0 0 0 9px rgba(79, 70, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}
.vc-tools { display: flex; gap: 6px; }
.vc-icon-btn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--panel-soft); border-radius: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-2); transition: all .15s;
}
.vc-icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* 消息区 */
.vc-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.vc-msg { display: flex; }
.vc-msg.user { justify-content: flex-end; }
.vc-bubble {
  max-width: 88%; padding: 9px 12px; border-radius: 12px;
  font-size: 12.8px; line-height: 1.65; color: var(--text);
  background: var(--panel-soft); border: 1px solid var(--border);
  border-top-left-radius: 4px; word-break: break-word;
}
.vc-msg.user .vc-bubble { background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 12px; border-top-right-radius: 4px; }
.vc-msg.ai .vc-bubble .btn { font-size: 11.5px; }
.vc-tag {
  display: inline-block; margin-bottom: 5px; padding: 1px 7px;
  font-size: 10.5px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px;
}
.vc-src { display: block; margin-top: 6px; font-size: 10.5px; color: var(--text-3); }

/* 数据卡片：库存数量 / 成本价 / 销售价这类关键数一眼可见 */
.vc-cards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vc-card {
  display: inline-flex; flex-direction: column; gap: 1px;
  padding: 5px 9px; border-radius: 8px; background: #fff;
  border: 1px solid var(--border);
}
.vc-card em { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.vc-card b { font-size: 13px; color: var(--text); }

/* 快捷指令 */
.vc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; max-height: 76px; overflow-y: auto; }
.vc-chip {
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--panel-soft); color: var(--text-2);
  transition: all .15s;
}
.vc-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* 输入行 */
.vc-input-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.vc-mic {
  width: 38px; height: 38px; flex: none; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--panel-soft);
  font-size: 16px; line-height: 1; color: var(--text);
  transition: all .15s;
}
.vc-mic:hover { border-color: var(--primary); }
.vc-mic.on { background: var(--danger); border-color: var(--danger); color: #fff; animation: vcMic 1.1s infinite; }
@keyframes vcMic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); }
  50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}
.vc-input-row input {
  flex: 1; min-width: 0; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  font-size: 13px; background: #fff; color: var(--text);
}
.vc-input-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.vc-send {
  height: 38px; padding: 0 16px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 650;
}
.vc-send:hover { background: var(--primary-hover); }
.vc-foot { padding: 0 14px 10px; font-size: 10.5px; color: var(--text-3); line-height: 1.5; }

/* ————————————————————————————————————————————————
   语音台三视图：语音指令 / AI 智能客服 / 操作流程
   ------------------------------------------------------------------
   同一浮层放三个独立视图，tab 切换，只切 display，不丢聊天状态。
   ———————————————————————————————————————————————— */

/* 顶部页签栏：紧贴头部下方，三个等分按钮 */
.vc-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--border); }
.vc-tabs button {
  flex: 1; padding: 7px 4px; border: none; border-bottom: 2px solid transparent;
  background: none; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-3);
  transition: color .15s, border-color .15s;
}
.vc-tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.vc-tabs button:hover { color: var(--primary); }

/* 视图容器：默认隐藏，.on 才显示；三视图共用一个滚动区高度 */
.vc-view { display: none; flex: 1; flex-direction: column; min-height: 0; }
.vc-view.on { display: flex; }

/* 客服视图消息区复用 .vc-log 样式，无需额外定义 */

/* 操作流程视图 */
.vc-flowview { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.vc-flow-lead { padding: 12px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--border); }
.vc-flow-lead b { display: block; font-size: 14px; color: var(--primary); margin-bottom: 4px; }
.vc-flow-lead span { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; }
.vc-flow-lead p { margin: 0; font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
.vc-flow-steps { display: flex; flex-direction: column; gap: 8px; }
.vc-fstep {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel-soft);
}
.vc-fno { font-size: 20px; line-height: 1; flex: none; }
.vc-fmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vc-fmain b { font-size: 13px; color: var(--text); }
.vc-fmain small { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.vc-fgo {
  flex: none; padding: 6px 12px; border: 1px solid var(--primary); border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.vc-fgo:hover { background: var(--primary-hover); }
.vc-flow-foot { font-size: 10.5px; color: var(--text-3); text-align: center; }

/* 窄屏：面板改成底部整宽抽屉，按钮位置同步上移 */
@media (max-width: 640px) {
  .vc-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: 76vh; }
  .vc-fab { right: 14px; bottom: 14px; padding: 0 14px; }
  .vc-fab span { display: none; }
  .vc-fab { width: 48px; justify-content: center; padding: 0; }
}

/* ————————————————————————————————————————————————
   智能陪护（引导式 / 顾问式 / 保姆式）
   ------------------------------------------------------------------
   与语音指令台（#vcFab）共用右下角竖栈：语音浮标 bottom:22px 高 46px，
   陪护浮标置于其上方 bottom:78px，两浮标垂直排列、互不遮挡。
   类名前缀 gd-，避免与语音台 vc- 冲突。
   ———————————————————————————————————————————————— */

/* 右下角常驻浮标：与语音浮标同宽高，位于其正上方 */
.gd-fab {
  position: fixed; right: 22px; bottom: 78px; z-index: 155;
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 18px 0 14px;
  border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff; font-size: 13.5px; font-weight: 650;
  box-shadow: 0 10px 26px rgba(14, 165, 233, .38);
  transition: transform .18s, opacity .18s, box-shadow .18s;
}
.gd-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(14, 165, 233, .46); }
.gd-fab.hidden { opacity: 0; transform: translateY(160%); pointer-events: none; }
.gd-fab-ico { font-size: 17px; line-height: 1; }

/* 陪护面板：固定右下，与语音面板同尺寸体系 */
.gd-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 160;
  width: 404px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(20, 26, 50, .22);
  opacity: 0; transform: translateY(14px) scale(.98); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  overflow: hidden;
}
.gd-panel.show { opacity: 1; transform: none; pointer-events: auto; }

/* 头部 */
.gd-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.gd-logo { font-size: 18px; color: var(--primary); line-height: 1.3; }
.gd-head-t { flex: 1; }
.gd-head-t b { display: block; font-size: 14px; }
.gd-sub { display: block; margin-top: 3px; font-size: 11px; color: var(--text-3); }
.gd-close {
  flex: none; width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); font-size: 14px; line-height: 1;
}
.gd-close:hover { border-color: var(--danger); color: var(--danger); }

/* 模式切换 tabs */
.gd-tabs { display: flex; gap: 6px; padding: 10px 14px 0; }
.gd-tab {
  flex: 1; height: 34px; border-radius: 10px; cursor: pointer; font-size: 12.5px;
  border: 1px solid var(--border-strong); background: var(--panel-soft); color: var(--text-2);
  transition: all .15s;
}
.gd-tab:hover { border-color: var(--primary); color: var(--primary); }
.gd-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 内容区 */
.gd-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.gd-loading, .gd-empty { padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.7; }
.gd-tip { font-size: 12px; color: var(--text-3); line-height: 1.6; }

/* 向导卡片 */
.gd-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--panel-soft); }
.gd-card-h { display: flex; align-items: center; gap: 8px; }
.gd-card-h b { font-size: 13.5px; }
.gd-prog { margin-left: auto; font-size: 11px; color: var(--text-3); }
.gd-card-d { margin-top: 8px; font-size: 12px; color: var(--text-2); line-height: 1.6; }
.gd-steps { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.gd-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.gd-dot {
  flex: none; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 18px; text-align: center;
  background: var(--panel); border: 1px solid var(--border-strong); color: var(--text-3);
}
.gd-step.done { color: var(--text-2); }
.gd-step.done .gd-dot { background: var(--success, #16a34a); border-color: var(--success, #16a34a); color: #fff; }
.gd-step.cur { color: var(--text); font-weight: 600; }
.gd-step.cur .gd-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.gd-step-cur { margin-top: 10px; padding: 10px; border-radius: 8px; background: var(--primary-soft); font-size: 12.5px; line-height: 1.6; }
.gd-step-cur b { color: var(--primary); }
.gd-hint { margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.gd-btns { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }

/* 动作按钮 */
.gd-act {
  height: 32px; padding: 0 14px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  transition: all .15s;
}
.gd-act:hover { border-color: var(--primary); color: var(--primary); }
.gd-act.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.gd-act.primary:hover { opacity: .9; }
.gd-act.ghost { background: transparent; color: var(--text-2); }
.gd-act.sm { height: 28px; padding: 0 10px; font-size: 11.5px; }

/* 顾问建议卡片 */
.gd-adv { border: 1px solid var(--border); border-left: 3px solid var(--text-3); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.gd-adv.gd-high { border-left-color: var(--danger); }
.gd-adv.gd-mid { border-left-color: var(--warning, #f59e0b); }
.gd-adv.gd-low { border-left-color: var(--success, #16a34a); }
.gd-adv-h { display: flex; align-items: center; gap: 8px; }
.gd-adv-h b { font-size: 13px; }
.gd-lvl {
  flex: none; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; color: #fff;
  background: var(--text-3);
}
.gd-adv.gd-high .gd-lvl { background: var(--danger); }
.gd-adv.gd-mid .gd-lvl { background: var(--warning, #f59e0b); }
.gd-adv.gd-low .gd-lvl { background: var(--success, #16a34a); }
.gd-metric { margin-top: 8px; font-size: 12px; color: var(--text-2); }
.gd-metric b { color: var(--text); }
.gd-metric em { font-style: normal; color: var(--text-3); }

/* 保姆待办卡片 */
.gd-todo { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--panel); }
.gd-todo.gd-high { border-color: rgba(220, 38, 38, .35); }
.gd-ico { flex: none; font-size: 14px; line-height: 1.4; }
.gd-todo-b { flex: 1; min-width: 0; }
.gd-todo-t { font-size: 13px; color: var(--text); line-height: 1.5; }
.gd-todo-r { margin-top: 4px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

/* 窄屏：陪护面板与浮标同步适配 */
@media (max-width: 640px) {
  .gd-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: 76vh; }
  .gd-fab { right: 14px; bottom: 72px; padding: 0 14px; }
  .gd-fab span { display: none; }
  .gd-fab { width: 48px; justify-content: center; padding: 0; }
}

/* 命中样本可点击标签：长得和普通 tag 一样，但可点、悬停高亮，提示可穿透到单据 */
a.sample-tag { text-decoration: none; cursor: pointer; transition: all .15s; }
a.sample-tag:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ————————————————————————————————————————————————
   账套选择门户（仿 ERP 登录的卡片选择）
   ———————————————————————————————————————————————— */
.ac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 6px;
}
.ac-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  background: var(--panel);
  transition: .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ac-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.ac-card.active { border-color: var(--primary); background: var(--primary-soft); }
.ac-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ac-name { font-size: 15px; font-weight: 650; color: var(--text); }
.ac-policy {
  font-size: 12.5px; color: var(--text-2); line-height: 1.5;
  background: var(--panel-soft); border-radius: 8px; padding: 7px 9px;
}
.ac-meta { font-size: 11px; color: var(--text-3); }
.ac-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.ac-admin { display: flex; gap: 6px; flex-wrap: wrap; }

/* 账套入口（顶栏，形似用户切换） */
#accountChip { cursor: pointer; }
#accountChip:hover { border-color: var(--primary); }
#accountChip #accountName { font-size: 13px; line-height: 1.2; }
#accountChip #accountBadge { font-size: 10.5px; color: var(--text-3); }
#accountChip .hd-icon { width: 18px; height: 18px; color: var(--primary); flex: 0 0 auto; }
#accountChip .caret { width: 12px; height: 12px; color: var(--text-3); transform: rotate(90deg); }

/* ============ 模块操作流程导航图 ============ */
/* 顶栏「操作流程」开关：展开态高亮 */
.flow-toggle.active { background: var(--primary); color: #fff; }
.flow-toggle.active .hd-icon { stroke: #fff; }

/* 抽屉：锚定在主区右侧，位于顶栏之下（顶栏高 64px） */
.main { position: relative; }
.flow-drawer {
  position: absolute; top: 64px; right: 0;
  height: calc(100% - 64px); width: 408px; max-width: 94vw;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease;
  z-index: 60;
}
.flow-drawer.open { transform: translateX(0); }

.flow-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 16px 14px; border-bottom: 1px solid var(--border);
  background: var(--panel-soft);
}
.flow-head-ic {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.flow-head-ic svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.flow-head-txt { flex: 1; min-width: 0; }
.flow-title { font-size: 14.5px; font-weight: 650; color: var(--text); }
.flow-scenario { font-size: 12.5px; color: var(--text); line-height: 1.55; margin-top: 4px; }
.flow-close {
  border: none; background: transparent; color: var(--text-3);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; flex: 0 0 auto;
  border-radius: 6px;
}
.flow-close:hover { color: var(--danger); background: var(--danger-soft); }

.flow-body { flex: 1; overflow-y: auto; padding: 18px 18px 8px; }
.flow-empty { color: var(--text-3); font-size: 13px; padding: 20px 4px; text-align: center; }

/* 时间线节点 */
.flow-list { list-style: none; margin: 0; padding: 0; }
.flow-step { display: flex; gap: 12px; }
.flow-rail { position: relative; width: 34px; flex: 0 0 34px; }
.flow-rail::before {
  content: ''; position: absolute; left: 16px; top: 36px; bottom: -10px;
  width: 2px; background: var(--border-strong);
}
.flow-step.is-last .flow-rail::before { display: none; }
.flow-dot {
  position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
}
.flow-dot svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; }
.flow-card {
  flex: 1; min-width: 0; margin-bottom: 22px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px;
  border-left: 3px solid var(--primary);
}
.flow-step-label { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.flow-step-note { font-size: 13px; color: var(--text); line-height: 1.62; margin-top: 6px; background: #f3f5fa; border-radius: 8px; padding: 7px 9px; }
.flow-type-tag {
  display: inline-block; font-size: 10.5px; font-weight: 600; line-height: 1;
  padding: 3px 7px; border-radius: 999px; margin-right: 7px; vertical-align: 1px;
  background: var(--primary-soft); color: var(--primary);
}

/* 节点类型配色：起点/操作/判断/数据/联动/完成 */
.t-start    { background: #4f46e5 !important; } .t-start.flow-type-tag    { background: #eef0ff; color: #4f46e5; }
.t-action   { background: #0284c7 !important; } .t-action.flow-type-tag   { background: #e6f3fb; color: #0284c7; }
.t-decision { background: #d97706 !important; } .t-decision.flow-type-tag { background: #fef4e6; color: #d97706; }
.t-data     { background: #16a34a !important; } .t-data.flow-type-tag     { background: #e8f7ee; color: #16a34a; }
.t-link     { background: #7c3aed !important; } .t-link.flow-type-tag     { background: #f3eefe; color: #7c3aed; }
.t-end      { background: #0d9488 !important; } .t-end.flow-type-tag      { background: #e6f6f4; color: #0d9488; }
.flow-card.t-start    { border-left-color: #4f46e5; }
.flow-card.t-action   { border-left-color: #0284c7; }
.flow-card.t-decision { border-left-color: #d97706; }
.flow-card.t-data     { border-left-color: #16a34a; }
.flow-card.t-link     { border-left-color: #7c3aed; }
.flow-card.t-end      { border-left-color: #0d9488; }

/* 图例 */
.flow-legend {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  padding: 11px 16px; border-top: 1px solid var(--border);
  background: var(--panel-soft); font-size: 11.5px; color: var(--text-2);
}
.flow-legend span { display: inline-flex; align-items: center; gap: 5px; }
.flow-legend .lg {
  width: 13px; height: 13px; border-radius: 50%; display: inline-block; flex: 0 0 13px;
}

/* 窄屏：导航图抽屉占满宽度（操作流程按钮已固定在永远可见的右侧区，不受中央区隐藏影响） */
@media (max-width: 860px) {
  .flow-drawer { width: 100%; max-width: 100%; }
}

/* ============================================================
   密码登录网关：全屏遮罩 + 居中卡片
   ------------------------------------------------------------
   login.js 只生成 DOM，之前全项目没有任何一处定义这些样式，
   登录框被当成普通 div 追加到 body 末尾、挤在页面最底部看不见，
   主区仍留着 index.html 里静态的「正在加载…」，
   用户看到的就像「系统卡死」。补齐样式后登录页才会正常盖在最上层。
   ============================================================ */
.login-overlay {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #eef1fb 0%, #f7f8fc 58%, #e8eefc 100%);
}
.login-card {
  width: 100%; max-width: 380px;
  padding: 34px 30px 26px;
  background: #fff;
  border: 1px solid #e6e8ef; border-radius: 16px;
  box-shadow: 0 18px 60px rgba(30, 41, 90, .16);
}
.login-brand {
  font-size: 22px; font-weight: 700; letter-spacing: 1px;
  color: #1d2233; text-align: center;
}
.login-sub {
  margin-top: 6px; font-size: 12.5px; color: #8a90a2; text-align: center;
}
.login-form { margin-top: 26px; display: grid; gap: 16px; }
.login-form label {
  display: grid; gap: 7px; font-size: 13px; color: #4a5068; font-weight: 600;
}
.login-form input {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px; font-size: 14px; color: #1d2233;
  border: 1px solid #dfe3ed; border-radius: 9px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-form input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
.login-form button {
  margin-top: 4px; padding: 12px; font-size: 14px; font-weight: 600;
  color: #fff; background: #4f46e5; border: 0; border-radius: 9px;
  cursor: pointer; transition: background .15s;
}
.login-form button:hover:not(:disabled) { background: #4338ca; }
.login-form button:disabled { opacity: .6; cursor: default; }
.login-error {
  min-height: 18px; font-size: 12.5px; color: #dc2626; text-align: center;
}
.login-foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid #f0f1f6;
  font-size: 11.5px; line-height: 1.6; color: #9399ab; text-align: center;
}
/* 组织属性选择面板：登录后账号被授权多个身份时弹出，让用户挑本次身份 */
.orgrole-list { margin-top: 22px; display: grid; gap: 10px; }
.orgrole-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border: 1px solid #e2e6f0; border-radius: 11px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.orgrole-item:hover { border-color: #a5b4fc; background: #f7f8fe; }
.orgrole-item.checked { border-color: #6366f1; background: #eef0ff; }
.orgrole-item input { accent-color: #4f46e5; }
.orgrole-item span { display: grid; gap: 3px; }
.orgrole-item b { font-size: 14px; color: #1d2233; }
.orgrole-item em { font-style: normal; font-size: 12px; color: #8a90a2; }
.orgrole-actions {
  margin-top: 20px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px;
}
.orgrole-actions button {
  padding: 12px; font-size: 14px; font-weight: 600;
  border-radius: 9px; cursor: pointer; border: 1px solid #dfe3ed;
  background: #fff; color: #4a5068;
}
.orgrole-actions button.primary {
  border: 0; color: #fff; background: #4f46e5;
}
.orgrole-actions button.primary:hover { background: #4338ca; }
/* 窄屏小留白，避免卡片贴边 */
@media (max-width: 420px) {
  .login-card { padding: 26px 20px 20px; }
}

/* ============================================================
   业务中枢 · 九大模块贯通视图
   全部使用 hub- 前缀，不影响其它模块的既有样式；配色沿用全局浅色主题变量。
   ============================================================ */

/* 顶部指标条：自适应列数，窄屏自动换行 */
.hub-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hub-kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.hub-kpi .lab { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.hub-kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; }
.hub-kpi .tip { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.hub-kpi.ok .val { color: var(--success); }
.hub-kpi.warn .val { color: var(--warning); }
.hub-kpi.bad .val { color: var(--danger); }

/* 九大模块九宫格：每格显示关联覆盖率与真正需要处理的信息壁垒 */
.hub-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.hub-mod { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.hub-mod .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hub-mod .nm { font-size: 13.5px; font-weight: 650; }
.hub-mod .ic { font-size: 17px; color: var(--primary); }
.hub-mod .nums { display: flex; gap: 12px; margin: 9px 0; font-size: 12px; color: var(--text-2); }
.hub-mod .nums b { color: var(--text); font-size: 14px; }
.hub-mod .barrier { font-size: 11.5px; color: var(--text-3); }

/* 通用进度条：宽度由内联 style 的 --p 变量控制，100% 时显示绿色 */
.hub-bar { height: 7px; border-radius: 99px; background: var(--panel-soft); border: 1px solid var(--border); overflow: hidden; }
.hub-bar > i { display: block; height: 100%; width: var(--p, 0%); background: var(--primary); border-radius: 99px; transition: width .35s ease; }
.hub-bar.done > i { background: var(--success); }
.hub-bar.mid > i { background: var(--warning); }

/* 链路健康度：一行一条链路，右侧给出可一键执行的动作 */
.hub-rows { display: flex; flex-direction: column; gap: 10px; }
.hub-row { display: grid; grid-template-columns: minmax(210px, 1.6fr) minmax(110px, 1fr) 76px 92px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-soft); }
.hub-row .nm { font-size: 12.5px; font-weight: 600; }
.hub-row .meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.hub-row .num { font-size: 12.5px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  .hub-row { grid-template-columns: 1fr 76px; }
  .hub-row .hub-bar { grid-column: 1 / -1; order: 3; }
}

/* 说明条：把「为什么有些单没进账」这类口径讲清楚，避免用户误判为故障 */
.hub-note { border-left: 3px solid var(--info); background: var(--info-soft); color: var(--text-2); padding: 10px 13px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 12px; line-height: 1.65; margin: 12px 0; }
.hub-note.ok { border-left-color: var(--success); background: var(--success-soft); }
.hub-note.warn { border-left-color: var(--warning); background: var(--warning-soft); }

/* 单据 360：按跳数分层展示上下游节点 */
.hub-chain { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hub-chain-level { display: flex; gap: 10px; align-items: flex-start; }
.hub-depth { flex: 0 0 46px; font-size: 11.5px; color: var(--text-3); padding-top: 9px; }
.hub-chain-items { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.hub-node { border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius-sm); padding: 8px 11px; font-size: 12px; cursor: pointer; min-width: 150px; }
.hub-node:hover { border-color: var(--primary); background: var(--primary-soft); }
.hub-node .t { font-weight: 600; margin-bottom: 3px; }
.hub-node .s { font-size: 11px; color: var(--text-3); }
.hub-node .k { display: inline-block; font-size: 10.5px; color: var(--info); margin-bottom: 3px; }

/* 对账表：差额为 0 用绿色，非 0 用红色，一眼看出业财是否一致 */
.hub-gap { display: grid; grid-template-columns: 1fr 120px 120px 100px; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hub-gap:last-child { border-bottom: none; }
.hub-gap.head { font-weight: 650; color: var(--text-2); background: var(--panel-soft); }
.hub-gap .diff0 { color: var(--success); font-weight: 650; }
.hub-gap .diff1 { color: var(--danger); font-weight: 650; }

/* 孤岛分级筛选按钮 */
.hub-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.hub-chip { border: 1px solid var(--border); background: var(--panel); color: var(--text-2); border-radius: 999px; padding: 5px 13px; font-size: 12px; cursor: pointer; }
.hub-chip:hover { border-color: var(--primary); color: var(--primary); }
.hub-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 贯通执行结果：成功绿、失败红，逐条链路列出新建数量 */
.hub-steps { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.hub-step { display: flex; justify-content: space-between; gap: 12px; padding: 7px 11px; border-radius: var(--radius-sm); background: var(--panel-soft); border: 1px solid var(--border); }
.hub-step.fail { background: var(--danger-soft); border-color: #f3c4c4; }

/* ==================================================================
   流程导航（#/flows 总览页 + 顶栏操作流程抽屉的可点击节点）
   ================================================================== */

/* —— 抽屉内：可点击节点与单据徽标 —— */
.flow-card.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.flow-card.clickable:hover { box-shadow: 0 3px 12px rgba(79, 70, 229, .18); transform: translateY(-1px); }
.flow-card.clickable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 单据徽标：穿透钻取入口，绿底白字与节点说明区分开 */
.flow-badge { display: inline-block; margin-top: 7px; border: 0; border-radius: 999px; cursor: pointer;
  background: #16a34a; color: #fff; font-size: 11.5px; line-height: 1; padding: 5px 10px; }
.flow-badge:hover { background: #15803d; }
.flow-src { margin-top: 10px; font-size: 11.5px; color: var(--text-3); text-align: center; }

/* ============================================================
   流程导航页 · 液态玻璃（Liquid Glass）
   ------------------------------------------------------------
   视觉层级（从底到顶，四级分明）：
     ① 极光底  —— 彩色渐变光斑，给玻璃提供「可被折射」的内容
     ② 玻璃面板 —— 半透明白 + 背景模糊 + 顶部镜面高光 + 内侧色晕
     ③ 玻璃球  —— 模块图标 / 分组标记：多层内阴影 + 高光点，做出立体球感
     ④ 内容    —— 深色字压在玻璃之上，标题粗、说明淡，主次一眼看清
   换色只需改两个变量：
     卡片 / 分组上的 --h（主色相，十大业务域各一个）
     节点上的 --t（节点类型色相，六类各一个，见 flows.js 的 TYPE_META）
   ============================================================ */

/* —— ① 页面底：彩色极光 + 三团缓慢漂移的光斑 —— */
.fl3-page { position: relative; isolation: isolate; padding: 2px 2px 6px; }
.fl3-page::before {
  content: ""; position: absolute; inset: 0; z-index: -2; border-radius: 22px;
  background:
    radial-gradient(760px 360px at 6% -2%, rgba(99, 102, 241, .46), transparent 62%),
    radial-gradient(680px 340px at 96% 4%, rgba(236, 72, 153, .34), transparent 64%),
    radial-gradient(720px 380px at 44% 38%, rgba(34, 211, 238, .30), transparent 66%),
    radial-gradient(680px 360px at 88% 74%, rgba(16, 185, 129, .28), transparent 64%),
    radial-gradient(640px 340px at 8% 96%, rgba(245, 158, 11, .26), transparent 62%),
    linear-gradient(180deg, #e7ebff 0%, #f4f0ff 26%, #eaf6ff 54%, #f3eeff 78%, #e9fbf6 100%);
}
.fl3-aurora { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: 22px; pointer-events: none; }
.fl3-aurora i { position: absolute; display: block; border-radius: 50%; filter: blur(58px); opacity: .5; }
.fl3-aurora .b1 { width: 460px; height: 460px; left: -90px; top: -110px;
  background: radial-gradient(circle, #8b7bff, transparent 68%); animation: fl3Float 17s ease-in-out infinite; }
.fl3-aurora .b2 { width: 380px; height: 380px; right: -80px; top: 4%;
  background: radial-gradient(circle, #fb7185, transparent 68%); animation: fl3Float 21s ease-in-out infinite reverse; }
.fl3-aurora .b3 { width: 420px; height: 420px; left: 38%; top: 42%;
  background: radial-gradient(circle, #38bdf8, transparent 68%); animation: fl3Float 25s ease-in-out infinite; }
@keyframes fl3Float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(26px, -20px, 0) scale(1.08); }
}

/* —— ② 首屏头图：一块大玻璃 —— */
.fl3-hero {
  position: relative; overflow: hidden; border-radius: 22px;
  padding: 22px 24px 18px; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .70) 0%, rgba(255, 255, 255, .34) 46%, rgba(255, 255, 255, .56) 100%);
  border: 1px solid rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .98),
    inset 0 -30px 50px -40px rgba(79, 70, 229, .70),
    0 0 0 1px rgba(255, 255, 255, .85),
    0 0 0 4px hsla(255, 82%, 72%, .22),
    0 18px 40px -26px rgba(36, 44, 96, .60);
}
/* 斜向镜面高光：模拟玻璃顶部受光 */
.fl3-hero::before {
  content: ""; position: absolute; left: -8%; top: -80%; width: 116%; height: 170%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .10) 46%, transparent 62%);
  transform: rotate(-9deg); pointer-events: none;
}
/* 右下角彩色折射光 */
.fl3-hero::after {
  content: ""; position: absolute; right: -60px; bottom: -90px; width: 320px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, .28), transparent 68%);
  filter: blur(24px); pointer-events: none;
}
.fl3-hero-in { position: relative; z-index: 1; }
.fl3-hero-top { display: flex; align-items: center; gap: 14px; }

/* 头图玻璃球：比模块球更大，带一圈光晕 */
.fl3-hero-ic {
  position: relative; width: 54px; height: 54px; border-radius: 18px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 120% at 26% 16%, rgba(255, 255, 255, .96) 0%, rgba(255, 255, 255, .40) 26%, transparent 56%),
    linear-gradient(158deg, #7c86ff, #4f46e5 52%, #22d3ee);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, .95),
    inset 0 -12px 18px -10px rgba(0, 0, 0, .38),
    0 16px 28px -12px rgba(79, 70, 229, .85),
    0 0 0 6px rgba(255, 255, 255, .35);
}
.fl3-hero-ic svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.fl3-hero-ic::after {
  content: ""; position: absolute; left: 10px; top: 7px; width: 17px; height: 10px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .05));
  transform: rotate(-20deg); opacity: .9;
}
.fl3-hero-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: 1.6px; color: #7d86a8; }
.fl3-hero-title {
  margin: 2px 0 0; font-size: 26px; font-weight: 900; letter-spacing: .4px; line-height: 1.25;
  background: linear-gradient(96deg, #2f21b8 0%, #5b45ef 30%, #0b7fc4 62%, #0b8f6a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fl3-hero-sub { margin: 7px 0 0; font-size: 12.8px; line-height: 1.75; color: #4d5674; max-width: 1000px; }
.fl3-hero-sub b { color: #3f36c9; font-weight: 800; }

/* 头图右侧装饰链条：六类节点色的玻璃小球串成一条短线，填充右侧留白又不抢文字 */
.fl3-hero-art {
  position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 0; z-index: 1; pointer-events: none;
}
.fl3-hero-art span {
  width: 26px; height: 26px; border-radius: 9px; flex: none;
  background:
    radial-gradient(120% 120% at 28% 18%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .32) 32%, transparent 60%),
    linear-gradient(155deg, hsl(var(--t), 92%, 66%), hsl(var(--t), 88%, 50%));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -8px 12px -8px rgba(0, 0, 0, .35),
    0 8px 16px -8px hsla(var(--t), 90%, 45%, .85);
}
.fl3-hero-art i {
  width: 20px; height: 2px; flex: none;
  background: linear-gradient(90deg, hsla(var(--t), 90%, 58%, .10), hsla(var(--t), 90%, 58%, .55));
}
@media (max-width: 1360px) { .fl3-hero-art { display: none; } }

/* 统计胶囊：数字大、单位小，玻璃质感与面板同源 */
.flw-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fl3-stat {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 12.5px; color: #454f74;
  background: linear-gradient(160deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .56));
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px -14px rgba(36, 44, 96, .8);
}
.fl3-stat b {
  font-size: 20px; font-weight: 900; letter-spacing: -.3px;
  background: linear-gradient(96deg, #4f46e5, #0ea5e9);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fl3-stat.ok { border-color: rgba(187, 235, 208, .95); background: linear-gradient(160deg, rgba(236, 253, 243, .95), rgba(255, 255, 255, .60)); }
.fl3-stat.ok b { background-image: linear-gradient(96deg, #0d9488, #16a34a); }

/* 六类节点图例：颜色即语义 */
.fl3-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(120, 130, 180, .16);
}
.fl3-legend-cap { font-size: 11.5px; font-weight: 800; letter-spacing: .8px; color: #7d86a8; }
.fl3-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #3d4666; }
.fl3-legend-item i {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 13%, hsl(var(--t), 92%, 62%) 46%, hsl(var(--t), 88%, 44%) 100%);
  box-shadow: 0 2px 6px -2px hsla(var(--t), 90%, 50%, .9), inset 0 -1px 1px hsla(var(--t), 80%, 30%, .5);
}

/* —— ③ 模块速览：27 个玻璃小球，长页面快速定位 —— */
.fl3-index {
  position: relative; overflow: hidden; border-radius: 20px;
  padding: 14px 16px 16px; margin-bottom: 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, .66), rgba(255, 255, 255, .34));
  border: 1px solid rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  box-shadow: inset 0 1px 0 #fff, 0 14px 30px -24px rgba(36, 44, 96, .65);
}
.fl3-index-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 11px; }
.fl3-index-title { font-size: 13.5px; font-weight: 900; color: #252c48; letter-spacing: .2px; }
.fl3-index-title::before {
  content: ""; display: inline-block; width: 3px; height: 13px; border-radius: 2px;
  margin-right: 8px; vertical-align: -1px;
  background: linear-gradient(180deg, #6366f1, #22d3ee);
}
.fl3-index-hint { font-size: 11.5px; color: #7c85a4; }
.fl3-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.fl3-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 9px 6px 8px; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 600; color: #2b3352;
  background: linear-gradient(160deg, rgba(255, 255, 255, .90), rgba(255, 255, 255, .50));
  border: 1px solid rgba(255, 255, 255, .90);
  box-shadow: inset 0 1px 0 #fff, 0 8px 16px -14px rgba(36, 44, 96, .9);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s, border-color .18s;
}
.fl3-tile:hover {
  transform: translateY(-2px); border-color: hsla(var(--h), 80%, 62%, .55);
  box-shadow: inset 0 1px 0 #fff, 0 14px 22px -16px hsla(var(--h), 85%, 45%, .85);
}
.fl3-tile-ic {
  width: 30px; height: 30px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 120% at 28% 18%, rgba(255, 255, 255, .92), rgba(255, 255, 255, .34) 30%, transparent 58%),
    linear-gradient(155deg, hsl(var(--h), 92%, 66%), hsl(var(--h), 88%, 50%));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -6px 10px -6px rgba(0, 0, 0, .35), 0 6px 12px -6px hsla(var(--h), 90%, 45%, .85);
}
.fl3-tile-ic svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.fl3-tile-tx { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* —— ④ 业务域分组标题：彩色玻璃球 + 主色标题 + 渐隐分隔线 —— */
.fl3-group { margin-bottom: 16px; }
.fl3-group-head { display: flex; align-items: center; gap: 10px; margin: 18px 2px 11px; }
.fl3-group-orb {
  position: relative; width: 26px; height: 26px; border-radius: 9px; flex: none;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .30) 34%, transparent 60%),
    linear-gradient(150deg, hsl(var(--h), 92%, 64%), hsl(var(--h), 88%, 48%));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .9), 0 6px 12px -6px hsla(var(--h), 90%, 45%, .9);
}
.fl3-group-orb i { position: absolute; inset: 9px; border-radius: 4px; background: rgba(255, 255, 255, .88); box-shadow: 0 0 6px rgba(255, 255, 255, .9); }
.flw-group-title { font-size: 15px; font-weight: 900; color: #1f2540; margin: 0; letter-spacing: .3px; }
.fl3-group-count {
  font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  color: #fff;
  background: linear-gradient(150deg, hsl(var(--h), 88%, 62%), hsl(var(--h), 92%, 48%));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 12px -7px hsla(var(--h), 90%, 45%, .95);
}
.fl3-group-rule { flex: 1; height: 1px; background: linear-gradient(90deg, hsla(var(--h), 85%, 58%, .55), hsla(var(--h), 85%, 58%, 0)); }

/* —— ⑤ 模块玻璃卡 —— */
/* 宽屏两列、超宽屏三列：每张卡内节点固定每行 3 个，行高列宽全面压缩，
   分辨率越高一屏能看到的模块越多（auto-fill 自动决定卡数，天然自适应） */
.flw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 12px; }
.flw-module {
  position: relative; overflow: hidden; border-radius: 18px; padding: 13px 13px 12px;
  background: linear-gradient(150deg, hsla(var(--h), 92%, 96%, .95) 0%, rgba(255, 255, 255, .54) 46%, hsla(var(--h), 90%, 96%, .88) 100%);
  border: 1px solid hsla(var(--h), 90%, 74%, .60);
  -webkit-backdrop-filter: blur(18px) saturate(175%);
  backdrop-filter: blur(18px) saturate(175%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .98),
    inset 0 -26px 40px -34px hsla(var(--h), 88%, 48%, .75),
    0 16px 34px -24px rgba(36, 44, 96, .75),
    0 2px 6px -3px rgba(36, 44, 96, .16);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1), box-shadow .22s;
}
/* 左上/右上彩色色晕：玻璃背后的折射 */
.flw-module::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(140% 90% at 0% 0%, hsla(var(--h), 92%, 58%, .40), transparent 60%),
    radial-gradient(100% 80% at 100% 0%, hsla(calc(var(--h) + 46), 92%, 62%, .20), transparent 62%);
}
/* 顶部镜面高光条 */
.flw-module::after {
  content: ""; position: absolute; left: -8%; top: -86%; width: 116%; height: 150%; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 52%);
  transform: rotate(-7deg); opacity: .6;
}
.flw-module > * { position: relative; z-index: 1; }
.flw-module:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -26px 40px -30px hsla(var(--h), 88%, 48%, .8),
    0 26px 42px -24px rgba(36, 44, 96, .7),
    0 0 0 1px hsla(var(--h), 85%, 62%, .40);
}
/* 从模块速览点过来的高亮脉冲 */
.flw-module.is-flash { animation: fl3Flash 1.4s ease-out; }
@keyframes fl3Flash {
  0% { box-shadow: 0 0 0 0 hsla(var(--h), 90%, 58%, .85), 0 16px 34px -24px rgba(36, 44, 96, .75); }
  45% { box-shadow: 0 0 0 10px hsla(var(--h), 90%, 58%, 0), 0 16px 34px -24px rgba(36, 44, 96, .75); }
  100% { box-shadow: 0 16px 34px -24px rgba(36, 44, 96, .75); }
}

/* 模块玻璃球图标：3D 立体感靠「顶部高光 + 底部内阴影 + 外投影」三层叠加 */
.flw-module-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 9px; }
.flw-module-ic {
  position: relative; width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 120% at 26% 16%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .40) 26%, transparent 56%),
    linear-gradient(158deg, hsl(var(--h), 92%, 68%), hsl(var(--h), 88%, 52%) 52%, hsl(calc(var(--h) - 24), 90%, 46%));
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, .95),
    inset 0 -10px 16px -9px rgba(0, 0, 0, .38),
    0 12px 22px -10px hsla(var(--h), 90%, 48%, .85),
    0 2px 4px -1px rgba(30, 36, 70, .25);
}
.flw-module-ic svg { width: 19px; height: 19px; stroke: #fff; fill: none; stroke-width: 2; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3)); }
.flw-module-ic::after {
  content: ""; position: absolute; left: 7px; top: 5px; width: 12px; height: 7px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .05));
  transform: rotate(-20deg); opacity: .9;
}
.flw-module-txt { min-width: 0; }
.flw-module-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 900; color: #1b2138; letter-spacing: .2px; }
.flw-module-scenario { margin-top: 3px; font-size: 11.5px; line-height: 1.5; color: #5a6383; }
.flw-chip {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  color: hsl(var(--h), 55%, 38%);
  background: hsla(var(--h), 90%, 60%, .16);
  border: 1px solid hsla(var(--h), 85%, 60%, .30);
}
.flw-chip.ok { color: #116b3f; background: linear-gradient(150deg, rgba(220, 252, 231, .95), rgba(240, 253, 244, .70)); border-color: rgba(134, 239, 172, .75); }

/* —— ⑥ 流程链条与节点 —— */
/* 固定每行 3 个节点（等宽自适应列）：不再靠定宽节点硬挤，屏幕多宽都整齐三列。
   跨行不需要箭头（编号已经表明顺序），只有行内相邻节点之间才显示箭头。 */
.flw-chain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
/* 一个「箭头 + 节点」组合占一个网格单元；min-width:0 让长说明文字能正常换行不撑破列 */
.flw-step { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
/* 每行第一个节点（第 1、4、7… 个）前面不画箭头，避免行首出现「指向不明」的箭头 */
.flw-step:nth-child(3n + 1) .flw-arrow { display: none; }
.flw-node {
  position: relative; overflow: hidden; min-width: 0; flex: 1;
  padding: 7px 9px 8px 11px; border-radius: 12px;
  background: linear-gradient(158deg, hsla(var(--t), 95%, 98%, .98) 0%, rgba(255, 255, 255, .86) 56%, hsla(var(--t), 92%, 97%, .95) 100%);
  border: 1px solid hsla(var(--t), 90%, 80%, .70);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -14px 22px -18px hsla(var(--t), 85%, 50%, 1),
    0 8px 16px -14px rgba(36, 44, 96, .85);
}

/* 左侧类型色条：一眼分出起点/判断/数据等六类 */
.flw-node::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, hsl(var(--t), 92%, 68%), hsl(var(--t), 88%, 48%));
  box-shadow: 0 0 10px hsla(var(--t), 90%, 60%, .7);
}
.flw-node.clickable { cursor: pointer; transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s, border-color .18s; }
.flw-node.clickable:hover {
  transform: translateY(-2px); border-color: hsla(var(--t), 85%, 62%, .85);
  box-shadow: inset 0 1px 0 #fff, 0 14px 22px -14px hsla(var(--t), 85%, 45%, .85), 0 0 0 1px hsla(var(--t), 85%, 62%, .35);
}
.flw-node.clickable:focus-visible { outline: 2px solid hsl(var(--t), 85%, 55%); outline-offset: 2px; }
.flw-node-head { display: flex; align-items: center; gap: 5px; }
/* 节点小图标：迷你玻璃球 */
.flw-node-ic {
  width: 18px; height: 18px; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 120% at 30% 22%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .35) 34%, transparent 62%),
    linear-gradient(155deg, hsl(var(--t), 92%, 66%), hsl(var(--t), 88%, 50%));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .9), 0 4px 8px -4px hsla(var(--t), 90%, 45%, .9);
}
.flw-node-ic svg { width: 11px; height: 11px; stroke: #fff; fill: none; stroke-width: 2.2; }
.flw-node-no {
  flex: none; padding: 0 4px; border-radius: 5px;
  font-size: 9.5px; font-weight: 900; line-height: 14px;
  color: hsl(var(--t), 65%, 40%);
  background: hsla(var(--t), 90%, 60%, .15);
}
.flw-node-type { font-size: 10px; font-weight: 800; letter-spacing: .3px; color: hsl(var(--t), 62%, 40%); }
.flw-node-label { margin-top: 4px; font-size: 12.5px; font-weight: 800; line-height: 1.35; color: #1b2138; }
/* 说明统一限两行：三列后列变窄，长句会换行，限行可保证同一行三个节点等高、卡片不被个别长文案撑高 */
.flw-node-note {
  margin-top: 2px; font-size: 11px; line-height: 1.45; color: #5d6685;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 单据徽标：绿→青渐变药丸，与节点说明明确区分 */
.flw-badge {
  margin-top: 5px; padding: 3px 8px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 10.5px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #22c55e, #0d9488);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 12px -6px rgba(13, 148, 136, .85);
}
.flw-badge b { margin-left: 5px; font-weight: 900; }
.flw-badge:hover { background: linear-gradient(140deg, #16a34a, #0f766e); }

/* 链条箭头：类型色圆形连接点，只在行内两个相邻节点之间出现 */
.flw-arrow {
  align-self: center; flex: none; width: 14px; height: 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: hsla(var(--t), 90%, 60%, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}
.flw-arrow svg { width: 9px; height: 9px; fill: none; stroke: hsl(var(--t), 80%, 46%); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }

/* —— 窄屏：卡片单列、链条退回单列纵排，手机上节点仍是整行宽、可读可点 —— */
@media (max-width: 720px) {
  .flw-grid { grid-template-columns: 1fr; }
  /* 手机上三列会挤成「一条竖线」，改回单列；箭头在单列里没必要，隐藏 */
  .flw-chain { grid-template-columns: 1fr; gap: 5px; }
  .flw-arrow { display: none; }
  .flw-node { width: 100%; }
  .flw-step { width: 100%; }
  .fl3-hero { padding: 18px 16px 14px; }
  .fl3-hero-title { font-size: 20px; }
  .fl3-hero-ic { width: 46px; height: 46px; border-radius: 15px; }
  .fl3-index-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}

/* —— 降低动效偏好：关掉漂浮与悬浮位移，保留静态玻璃质感 —— */
@media (prefers-reduced-motion: reduce) {
  .fl3-aurora i { animation: none; }
  .flw-module, .flw-node, .fl3-tile { transition: none; }
  .flw-module:hover, .flw-node.clickable:hover, .fl3-tile:hover { transform: none; }
}

/* —— 不支持背景模糊的浏览器：提高不透明度，保证文字对比度 —— */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .fl3-hero, .fl3-index, .flw-module { background: rgba(255, 255, 255, .94); }
  .fl3-hero::before, .flw-module::after { opacity: .25; }
}

/* ============================================================
   表格右键列菜单（显隐列 / 增加字段 / 成本毛利列 / 价格列 / 历史价格）
   ------------------------------------------------------------
   层级放在弹窗之上（modal 是 90、抽屉更低），因为用户可能在弹窗里的
   明细表上右键；再低就会被遮住、看起来像"点了没反应"。
   ============================================================ */
.colmenu {
  position: fixed; z-index: 120; min-width: 236px; max-width: 320px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; font-size: 13px; color: var(--text);
  user-select: none; animation: cmIn .12s ease-out;
}
@keyframes cmIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.cm-head {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 9px 8px; margin-bottom: 4px;
  font-size: 12px; font-weight: 700; color: var(--text-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 子菜单的返回按钮：做成圆形小按钮，避免和标题抢视线 */
.cm-back {
  width: 18px; height: 18px; flex: none; padding: 0; line-height: 1;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--panel-soft); color: var(--text-2); cursor: pointer; font-size: 13px;
}
.cm-back:hover { color: var(--primary); border-color: var(--primary); }

.cm-item {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 7px 9px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 13px;
  text-align: left; cursor: pointer; line-height: 1.35;
}
.cm-item:hover { background: var(--panel-soft); color: var(--primary); }
.cm-item[disabled] { color: var(--text-3); cursor: not-allowed; }
.cm-item[disabled]:hover { background: transparent; color: var(--text-3); }
/* 子菜单入口右侧的箭头推到最右 */
.cm-item b { margin-left: auto; color: var(--text-3); font-weight: 700; }

.cm-sep { height: 1px; margin: 5px 6px; background: var(--border); }

/* 勾选框：未选是空心描边，已选填主色并显示对勾 */
.cm-box {
  width: 13px; height: 13px; flex: none; border-radius: 3px;
  border: 1.5px solid var(--border); background: var(--panel);
  position: relative;
}
.cm-box.on { background: var(--primary); border-color: var(--primary); }
.cm-box.on::after {
  content: ""; position: absolute; left: 3.5px; top: 1px;
  width: 4px; height: 7px; border: solid #fff; border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}

.cm-empty { padding: 12px 10px; color: var(--text-3); font-size: 12.5px; line-height: 1.6; }

/* 列被隐藏后，浏览器自带的"这一列"阴影仍在，这里不额外处理，
   因为列本身已经 display:none，不会留下空隙。 */

/* ——— 历史价格抽屉 ——— */
.ph-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.ph-name { font-size: 16px; font-weight: 800; color: var(--text); }
.ph-sub { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.ph-card {
  padding: 10px 12px; border-radius: 10px;
  background: var(--panel-soft); border: 1px solid var(--border);
}
/* 最近成交价是核价时第一眼要看的数据，单独加重 */
.ph-card.main { background: linear-gradient(140deg, rgba(79, 70, 229, .12), rgba(14, 165, 233, .08)); border-color: rgba(79, 70, 229, .28); }
.ph-cap { font-size: 11.5px; color: var(--text-3); }
.ph-val { margin-top: 4px; font-size: 17px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.ph-val span { margin-left: 3px; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.ph-table .table { width: 100%; }
.ph-table th, .ph-table td { white-space: nowrap; }

@media (max-width: 720px) {
  .ph-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ——— AI 经营智脑 ——— */
.ai-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.ai-tab {
  border: none; background: none; padding: 9px 16px; cursor: pointer;
  font-size: 13.5px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ai-tab:hover { color: var(--text); }
.ai-tab.active { color: var(--text); font-weight: 700; border-bottom-color: var(--brand, #4f46e5); }

.ai-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.ai-sev-filter label { font-size: 13px; color: var(--text-2); }
.ai-sev-filter select, .ai-res, .ai-note {
  padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--panel-soft); color: var(--text);
}
.ai-note { flex: 1; min-width: 120px; }

.ai-loading, .ai-empty, .ai-notice, .ai-error {
  padding: 26px; text-align: center; border-radius: 10px; margin-top: 8px;
  border: 1px dashed var(--border); color: var(--text-2);
}
.ai-notice { border-style: solid; background: rgba(79,70,229,.06); color: var(--text); }
.ai-error { border-style: solid; border-color: rgba(220,38,38,.35); color: var(--danger); text-align: left; }

/* 异常表格：表头 + 行 用同一套网格列，保证对齐 */
.ai-table { border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
.ai-thead, .ai-grid {
  display: grid; gap: 8px; padding: 10px 12px; align-items: start;
  grid-template-columns: 64px 110px 120px 96px 160px minmax(220px,1fr) 120px 290px;
}
.ai-thead { background: var(--panel-soft); font-size: 12px; color: var(--text-3); font-weight: 700; border-bottom: 1px solid var(--border); }
.ai-row { border-top: 1px solid var(--border); }
.ai-row.reviewed { background: rgba(16,185,129,.05); }
.ai-grid { font-size: 13px; }

.ai-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; }
.sev-high { background: var(--danger); }
.sev-mid { background: var(--warn, #f59e0b); }
.sev-low { background: var(--text-3); }
.ai-rule { font-weight: 700; color: var(--text); }
.ai-summary { color: var(--text); }
.ai-reason { margin-top: 3px; color: var(--text-2); font-size: 12px; }
.ai-suggestion { margin-top: 2px; color: var(--text-3); font-size: 12px; }
.ai-amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.ai-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ai-reviewed { color: var(--ok, #10b981); font-size: 12px; font-weight: 700; }

/* AI 智脑穿透钻取链接：从 AI 结论一键跳到业务单据 / 档案 / 报表 */
.ai-drill { color: var(--primary, #4f46e5); font-size: 12px; text-decoration: none; border-bottom: 1px dashed var(--primary, #4f46e5); white-space: nowrap; }
.ai-drill:hover { opacity: 0.75; }
.ai-drill-row { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-3); }

/* 经营快报 */
.ai-cmt-range { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.ai-bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cmt-item { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-soft); border: 1px solid var(--border); align-items: flex-start; }
.cmt-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.cmt-warn .cmt-dot { background: var(--warn, #f59e0b); }
.cmt-ok .cmt-dot { background: var(--ok, #10b981); }
.cmt-info .cmt-dot { background: var(--text-3); }
.cmt-warn { border-color: rgba(245,158,11,.35); }
.cmt-ok { border-color: rgba(16,185,129,.3); }
.ai-narrative { margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: linear-gradient(140deg, rgba(79,70,229,.08), rgba(14,165,233,.05)); border: 1px solid rgba(79,70,229,.22); }
.ai-narrative-title { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.ai-narrative-body { font-size: 14px; line-height: 1.7; color: var(--text); }
.ai-engine { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.ai-engine.llm { background: rgba(79,70,229,.14); color: #4f46e5; }
.ai-engine.local { background: rgba(139,147,173,.16); color: var(--text-2); }

/* 治理看板 */
.gov-wrap { display: flex; flex-direction: column; gap: 14px; }
.gov-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.gov-stat { padding: 12px; border-radius: 10px; background: var(--panel-soft); border: 1px solid var(--border); text-align: center; }
/* 可穿透的统计卡：手型光标 + 悬停描边，与普通卡区分 */
.gov-stat-link { cursor: pointer; transition: border-color .15s, transform .15s; }
.gov-stat-link:hover { border-color: var(--primary); transform: translateY(-1px); }
.gov-stat-link:active { transform: translateY(0); }
.gov-stat-v { font-size: 13px; font-weight: 800; color: var(--text); }
.gov-stat-l { margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.gov-group { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.gov-group-title { font-size: 12px; color: var(--text-3); font-weight: 700; margin-bottom: 8px; }
.gov-cap { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); }
.gov-cap:first-of-type { border-top: none; }
.gov-switch { flex: none; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #fff; }
.gov-switch.on { background: var(--ok, #10b981); }
.gov-switch.off { background: var(--text-3); }
.gov-cap-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.gov-cap-desc { margin-top: 2px; font-size: 12px; color: var(--text-3); }
.gov-disclaimer { padding: 10px 12px; border-radius: 8px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3); color: var(--text-2); font-size: 12.5px; }

/* 现金流预警表：4 列网格（状态 / 日期 / 预计水位 / 原因） */
.ai-table.fc .ai-thead, .ai-table.fc .ai-grid { grid-template-columns: 80px 120px 140px minmax(200px, 1fr); }
/* 智能补货表：7 列网格（状态 / 商品 / 库存 / 日均销量 / 可卖 / 建议补 / 依据） */
.ai-table.rp .ai-thead, .ai-table.rp .ai-grid { grid-template-columns: 70px 160px 80px 100px 70px 110px minmax(200px, 1fr); }
.ai-table.rp .ai-thead .c-qty, .ai-table.rp .ai-grid .c-qty,
.ai-table.rp .ai-thead .c-sales, .ai-table.rp .ai-grid .c-sales,
.ai-table.rp .ai-thead .c-cover, .ai-table.rp .ai-grid .c-cover { text-align: right; font-variant-numeric: tabular-nums; }
.warn-row { background: rgba(220,38,38,.04); }

/* 经营问答（聊天） */
.ai-chat { display: flex; flex-direction: column; gap: 12px; }
.ai-chat-msgs { display: flex; flex-direction: column; gap: 12px; max-height: 460px; overflow-y: auto; padding: 4px 2px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.bot { justify-content: flex-start; }
.ai-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.ai-msg.user .ai-bubble { background: var(--brand, #4f46e5); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot .ai-bubble { background: var(--panel-soft); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.ai-msg-meta { margin: 4px 2px 0; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-snap { flex-basis: 100%; }
.ai-snap summary { cursor: pointer; color: var(--text-2); }
.ai-snap pre { margin-top: 6px; max-height: 220px; overflow: auto; padding: 10px; border-radius: 8px; background: var(--panel-soft); border: 1px solid var(--border); font-size: 11.5px; line-height: 1.5; color: var(--text-2); white-space: pre-wrap; }
.ai-chat-input { display: flex; gap: 10px; }
.ai-chat-input input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--panel-soft); color: var(--text); }
.ai-chat-hint { margin-top: 2px; }

@media (max-width: 980px) {
  .gov-summary { grid-template-columns: repeat(3, 1fr); }
  .ai-thead, .ai-grid { grid-template-columns: 56px 96px 100px 84px 140px 1fr 110px; }
  .ai-act { grid-column: 1 / -1; }
}

/* ———— 日程日历视图（办公 OA · 任务日程页签）———— */
.calendar { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.cal-head-row { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--text); border-bottom: 1px solid var(--border); background: var(--bg-2, #f7f8fa); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 76px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; font-size: 12px; overflow: hidden; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-head { min-height: auto; padding: 8px 6px; font-weight: 600; color: var(--text-2); text-align: center; background: var(--bg-2, #f7f8fa); }
.cal-empty { background: var(--bg-2, #f7f8fa); }
.cal-day { font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.cal-cell.today { background: var(--primary-soft, #eef2ff); }
.cal-cell.today .cal-day { color: var(--primary); }
.cal-chip { background: var(--primary); color: #fff; border-radius: 4px; padding: 1px 5px; margin-bottom: 2px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.remind { background: #f59e0b; }
.cal-more { color: var(--text-2); font-size: 11px; }

/* ———— 流程拓扑图（流程导航 · 拓扑图视图）———— */
/* 视图切换：顶部两个胶囊按钮，切换「导航卡片 / 流程拓扑图」两套渲染 */
.fl3-viewswitch {
  display: flex; gap: 6px; margin: 14px 2px 0;
  padding: 4px; border-radius: 12px; width: fit-content;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--border, #e6e8f0);
  box-shadow: 0 6px 16px -12px rgba(36, 44, 96, .5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.fl3-vs-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border: 0; border-radius: 9px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; color: #5a6383;
  background: transparent; transition: all .18s ease;
}
.fl3-vs-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.fl3-vs-btn:hover { color: #3f36c9; }
.fl3-vs-btn.active {
  color: #fff; background: linear-gradient(140deg, #4f46e5, #3f36c9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 14px -6px rgba(79, 70, 229, .7);
}

/* ===================================================================
 * 流程拓扑图 —— 工贸 MES 车间流程风格（浅蓝紫渐变 + 蓝色渐变节点 + 橙主线/浅蓝旁支）
 * 参考图视觉：柔和浅蓝紫渐变底、品牌蓝渐变圆形/胶囊节点、白色虚线描边小圆、
 * 橙色实线箭头贯穿主线、浅蓝箭头连接旁支、图标+文字节点。
 * =================================================================== */

/* 拓扑图整体容器：浅蓝紫渐变底，圆角大容器营造「车间看板」感 */
.tpn-grid {
  display: flex; flex-direction: column; gap: 18px;
}

/* 拓扑模块卡：浅蓝紫渐变背景，超大圆角，去掉玻璃底改为看板风 */
.tpn-module {
  padding: 20px 22px 22px;
  border-radius: 20px;
  background:
    radial-gradient(120% 160% at 12% 0%, #eef3fc 0%, rgba(238, 243, 252, 0) 55%),
    radial-gradient(130% 170% at 100% 100%, #e6e9f7 0%, rgba(230, 233, 247, 0) 50%),
    linear-gradient(160deg, #f5f7fd 0%, #eef1fa 45%, #e7ebf7 100%);
  border: 1px solid #e3e9f7;
  box-shadow: 0 14px 30px -22px rgba(43, 91, 215, .35);
  overflow: hidden;
  /* 彻底去除液态玻璃效果：禁用毛玻璃、清除彩色光斑与镜面高光 */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.tpn-module::before,
.tpn-module::after { display: none; }
.tpn-module:hover {
  transform: none;
  box-shadow: 0 14px 30px -22px rgba(43, 91, 215, .35);
}
/* 模块头文字在浅色底上用深色，保证对比 */
.tpn-module .flw-module-title { color: #22304f; }
.tpn-module .flw-module-scenario { color: #7a87a8; }
/* 模块头玻璃球图标去玻璃化：改纯色圆底 */
.tpn-module .flw-module-ic {
  background: linear-gradient(135deg, #2b5bd7, #3a7bf0);
  box-shadow: 0 5px 12px -6px rgba(43, 91, 215, .6);
}
.tpn-module .flw-module-ic::after { display: none; }

/* 拓扑轨道：一行横向主流程，允许横向滚动（模块步骤多时） */
.tpn-track {
  display: flex; align-items: center; gap: 0; overflow-x: auto;
  padding: 10px 4px 12px; scrollbar-width: thin;
}
.tpn-track.tpn-branch { padding-top: 4px; opacity: 1; }

/* 分叉引导线：decision 分叉点下方一条浅蓝斜向短线，暗示「主线分出一条旁支」 */
.tpn-split {
  height: 18px; margin-left: 78px; width: 2px;
  background: linear-gradient(180deg, #9db8e8, rgba(157, 184, 232, .2));
  position: relative;
}
.tpn-split::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 7px; height: 7px;
  border-bottom: 2px solid #9db8e8; border-left: 2px solid #9db8e8;
  transform: translateY(1px) rotate(-45deg) skew(10deg, 0); border-radius: 0 0 0 3px;
}

/* 拓扑节点：蓝色渐变胶囊（实心）或白底蓝虚线小圆（decision），图标+文字横向排列 */
.tpn-node {
  position: relative; flex: none; min-width: 96px; max-width: 200px;
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
  margin-right: 2px; padding: 9px 15px; border-radius: 999px;
  background: linear-gradient(135deg, #2b5bd7 0%, #3a7bf0 100%);
  border: none;
  box-shadow: 0 6px 16px -8px rgba(43, 91, 215, .55);
}
/* 白色虚线描边小圆：decision 判断点 */
.tpn-node.tpn-decision {
  min-width: 84px; max-width: 150px; padding: 9px 13px;
  background: #fff;
  border: 1.5px dashed #5b8def;
  box-shadow: 0 5px 14px -9px rgba(91, 141, 239, .5);
}
.tpn-node.clickable { cursor: pointer; transition: transform .18s ease, box-shadow .18s, border-color .18s; }
.tpn-node.clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 22px -10px rgba(43, 91, 215, .7), 0 0 0 3px rgba(58, 123, 240, .18);
}
.tpn-node.tpn-decision.clickable:hover { box-shadow: 0 10px 20px -10px rgba(91, 141, 239, .65), 0 0 0 3px rgba(91, 141, 239, .18); }
.tpn-node.clickable:focus-visible { outline: 2px solid #3a7bf0; outline-offset: 2px; }

/* 拓扑节点图标：实心蓝节点白色图标，白底 decision 蓝色图标 */
.tpn-ic {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .22);
}
.tpn-ic svg { width: 12px; height: 12px; stroke: #fff; fill: none; stroke-width: 2.2; }
.tpn-node.tpn-decision .tpn-ic { background: rgba(43, 91, 215, .12); }
.tpn-node.tpn-decision .tpn-ic svg { stroke: #2b5bd7; }

/* 拓扑节点文字：实心蓝节点用白色，白底 decision 用深蓝，居中粗体 */
.tpn-label {
  font-size: 13px; font-weight: 800; line-height: 1.3;
  color: #fff; text-align: center; white-space: nowrap;
}
.tpn-node.tpn-decision .tpn-label { color: #2b5bd7; }

/* 拓扑单据徽标：浅色底上改用蓝→青药丸，贴合看板风 */
.tpn-badge {
  margin-top: 2px; padding: 2px 8px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #3a7bf0, #0d9488);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 5px 12px -6px rgba(13, 148, 136, .8);
}
.tpn-badge b { margin-left: 4px; font-weight: 900; }
.tpn-badge:hover { background: linear-gradient(140deg, #2b5bd7, #0f766e); }

/* 拓扑箭头：主线橙色实线（贯穿主干），分支浅蓝实线（旁支），与参考图语义一致 */
.tpn-arrow { align-self: center; flex: none; display: flex; align-items: center; justify-content: center; width: 26px; }
.tpn-arrow svg {
  width: 20px; height: 20px; fill: none;
  stroke: #f5a623; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(245, 166, 35, .45));
}
.tpn-arrow.branch svg { stroke: #9db8e8; filter: drop-shadow(0 1px 2px rgba(157, 184, 232, .5)); }

/* 窄屏：拓扑节点允许更紧凑，主流程仍可横向滚动 */
@media (max-width: 720px) {
  .tpn-node { min-width: 78px; max-width: 140px; padding: 8px 11px; }
  .tpn-label { font-size: 12px; }
  .tpn-grid { gap: 12px; }
}

/* ———— 服务管理工作流图（服务管理 · 工作流页签）———— */
.svc-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc-node { min-width: 88px; text-align: center; padding: 12px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2, #f7f8fa); }
.svc-node.active { border-color: var(--primary); background: var(--primary-soft, #eef2ff); }
.svc-node-name { font-weight: 600; font-size: 13px; color: var(--text); }
.svc-node-count { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.svc-node.active .svc-node-count { color: var(--primary); }
.svc-arrow { color: var(--text-3); font-size: 18px; }

/* ———— 销售漏斗子页签（销售漏斗 / 跟单管理 / 任务绩效）———— */
.sf-subtabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.sf-subtab { border: none; background: none; padding: 9px 16px; font-size: 13.5px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; }
.sf-subtab:hover { color: var(--primary); }
.sf-subtab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ============================================================
   左侧导航分组（按模块同类属性收拢，解决 30 项平铺造成的下拉过长）
   ------------------------------------------------------------
   结构：.nav > .nav-group > (.nav-group-head + .nav-group-body > .nav-item)
   折叠只靠 .nav-group.collapsed 一个 class，脚本只负责加/删它；
   所有 .nav-item 原有规则（hover / active / 权限隐藏）一行不改，照常生效。
   ============================================================ */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
/* 组与组之间用一条浅分隔线分栏，代替原来逐个条目自己加的上边距 */
.nav-group + .nav-group { margin-top: 4px; padding-top: 5px; border-top: 1px solid var(--border); }

/* 分组标题：可点击按钮，左文字 + 中计数 + 右箭头；刻意不放图标，避免与菜单项图标抢注意力 */
.nav-group-head {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 7px 11px 5px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-3); font-family: inherit; font-size: 11.5px;
  font-weight: 600; line-height: 1.4; letter-spacing: .3px; text-align: left;
}
.nav-group-head:hover { color: var(--primary); }
.nav-group-head:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ng-label { flex: 1; }
.ng-count {
  font-size: 10.5px; color: var(--text-3);
  background: var(--panel-soft); border-radius: 8px; padding: 1px 6px;
}
.ng-chev { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; transition: transform .18s ease; }
/* 收起时箭头由「向下」转成「向右」，一眼看出这一组是折叠的 */
.nav-group.collapsed .ng-chev { transform: rotate(-90deg); }

.nav-group-body { display: flex; flex-direction: column; gap: 2px; }
.nav-group.collapsed .nav-group-body { display: none; }
/* 旧 .nav-sep-top 是给「无标题分组」留的上边距，现在有分组标题了，组内归零 */
.nav-group-body .nav-item.nav-sep-top { margin-top: 0; }

/* 侧边栏折成 64px 图标列时：标题放不下就隐藏，并强制展开所有组 ——
   图标列本来就靠图标找入口，再折一层反而找不到；分组感由浅分隔线保留。 */
.layout.sidebar-collapsed .nav-group-head { display: none; }
.layout.sidebar-collapsed .nav-group.collapsed .nav-group-body { display: flex; }
.layout.sidebar-collapsed .nav-group + .nav-group { margin-top: 6px; padding-top: 6px; }
.layout.sidebar-collapsed .nav-group-body .nav-item.nav-sep-top { margin-top: 0; }

/* ============================================================
   导航双模式切换：分级显示 ⇄ 全模块
   ------------------------------------------------------------
   开关放在 brand 与 nav 之间（sidebar 的直接子元素），滚动菜单时仍常显。
   用负 margin 抵掉一部分 .sidebar 的 18px 间距，避免把菜单往下挤太多。
   ============================================================ */
.nav-mode-switch {
  display: flex; gap: 2px; padding: 3px;
  background: var(--panel-soft); border-radius: var(--radius-sm);
  margin: -8px 0 -10px;
}
.nav-mode-btn {
  flex: 1; padding: 5px 4px; border: 0; cursor: pointer;
  background: transparent; color: var(--text-3);
  font-family: inherit; font-size: 11.5px; font-weight: 600;
  border-radius: calc(var(--radius-sm) - 2px);
}
.nav-mode-btn:hover { color: var(--primary); }
.nav-mode-btn.active {
  background: var(--panel); color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .10);
}
.nav-mode-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* 全模块模式：分组标题、计数、箭头、组间分隔线全部收起，
   所有组强制展开 → 30 个 .nav-item 连续平铺，回到旧版那种「一眼看全模块」的导航。 */
.layout.nav-mode-all .nav-group-head { display: none; }
.layout.nav-mode-all .nav-group + .nav-group { margin-top: 0; padding-top: 0; border-top: 0; }
.layout.nav-mode-all .nav-group.collapsed .nav-group-body { display: flex; }
/* 侧边栏折成 64px 图标列时放不下文字开关，直接隐藏（图标列本来就全展开） */
.layout.sidebar-collapsed .nav-mode-switch { display: none; }


/* ============================================================
   流程导航图 / 流程拓扑图 —— 统一改为干净浅色背景（2026-12-03）
   ------------------------------------------------------------
   需求：① 导航图回归截图那种浅灰白底；② 拓扑图去掉「液态玻璃」
   渐变底、只保留浅色；③ 拓扑图的节点/图标/箭头样式一律不动。
   做法：只覆盖「背景 / 模糊 / 高光 / 光斑」四类属性，放在文件末尾
   靠加载顺序获胜，不动任何 .tpn-node/.tpn-ic/.tpn-label/.tpn-arrow
   /.tpn-badge 及 .flw-* 节点与图标规则，颜色语义与交互保持不变。
   ============================================================ */

/* ① 页面底：五色极光径向渐变 + 彩色线性渐变 → 纯浅灰白（贴近截图 RGB 245,246,250） */
.fl3-page { background: #f5f6fa; }
.fl3-page::before { background: #f5f6fa; }          /* 去掉极光渐变，仅留浅色 */
.fl3-aurora { display: none; }                       /* 隐藏三团漂浮彩色光斑 */

/* ② 头图：去玻璃模糊与镜面高光，改白色实心浅底（文字/图标样式保留） */
.fl3-hero {
  background: #ffffff;
  border-color: #e6e9f2;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 6px 18px -14px rgba(36, 44, 96, .32);
}
.fl3-hero::before,
.fl3-hero::after { display: none; }                  /* 去镜面高光条 + 彩色折射光 */

/* ③ 模块速览：去玻璃，改白色实心浅底 */
.fl3-index {
  background: #ffffff;
  border-color: #e6e9f2;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 6px 18px -14px rgba(36, 44, 96, .30);
}

/* ④ 卡片视图模块卡：去液态玻璃，改白色实心；节点与彩色图标样式不动 */
.flw-module {
  background: #ffffff;
  border-color: #e6e9f2;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 8px 20px -16px rgba(36, 44, 96, .32);
}
.flw-module::before,
.flw-module::after { display: none; }                /* 去彩色色晕 + 顶部镜面高光 */
.flw-module:hover { box-shadow: 0 12px 24px -16px rgba(36, 44, 96, .38); }

/* ⑤ 拓扑视图模块卡：彻底去渐变/玻璃，改浅色实心；节点/图标/箭头样式一律不动 */
.tpn-module {
  background: #f7f9ff;
  border-color: #e6e9f2;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 8px 20px -16px rgba(43, 91, 215, .25);
}
.tpn-module::before,
.tpn-module::after { display: none; }
.tpn-module:hover { transform: none; box-shadow: 0 12px 24px -16px rgba(43, 91, 215, .30); }

/* ⑥ 拓扑轨道自适应换行：一行放不下时自动折到下一行铺开（两行），不再横向滚动截断。
      只改排布方式（flex-wrap + 取消横向滚动 + 行距），节点/图标/箭头/徽标样式一律不动；
      折行点自然落在节点之间，第二行行首的箭头仍指示流向，与「服务管理」分支两行观感一致。 */
.tpn-track {
  flex-wrap: wrap;
  overflow-x: visible;
  row-gap: 10px;
}

