﻿/* 欧客 AI 智能管理系统 · 深空指挥舱视觉系统
   设计原则：
   1) 深空底 + 极光 + 细颗粒，靠层次而不是装饰堆高级感；
   2) 主色只用于「可操作」与「关键状态」，其余靠灰阶层级；
   3) 所有边界都是发丝线，所有容器都有内外两层光；
   4) 动效只做入场与悬停反馈，不做循环闪烁（除在线指示灯）。 */

:root {
  --oke-primary: #366ecf;
  --oke-primary-soft: #5b8df0;
  --oke-cyan: #57d7ff;
  --oke-violet: #8b6bff;
  --oke-deep: #1f005e;
  --oke-abyss: #05030f;
  --oke-ink: #08051c;

  --oke-glass: rgba(22, 16, 58, 0.62);
  --oke-glass-2: rgba(30, 22, 76, 0.52);
  --oke-line: rgba(130, 160, 255, 0.12);
  --oke-line-strong: rgba(130, 165, 255, 0.26);

  --oke-text: #eef2ff;
  --oke-muted: #9faed6;
  --oke-dim: #69769f;

  --oke-good: #3ce0a4;
  --oke-warn: #ffc857;
  --oke-bad: #ff6b8b;

  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 60px -40px rgba(0, 0, 0, 0.95);
  --shadow-pop: 0 40px 80px -50px rgba(0, 0, 0, 1), 0 0 0 1px rgba(120, 160, 255, 0.06);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;

  /* ================= 设计 token（全站唯一来源） =================
     #3 之后的规则只允许引用 token，不再写死像素值；命名约定：
     --oke-space-* 间距 / --oke-radius-* 圆角 / --oke-text-* 字号 /
     --oke-line-* 线宽与描边色。（注意 --oke-text 本身是正文颜色，历史命名保留） */

  /* 间距：4 的倍数，偶数节奏 */
  --oke-space-1: 4px;
  --oke-space-2: 8px;
  --oke-space-3: 12px;
  --oke-space-4: 16px;
  --oke-space-5: 20px;
  --oke-space-6: 24px;
  --oke-space-7: 32px;

  /* 圆角 */
  --oke-radius-xs: 6px;
  --oke-radius-sm: 8px;
  --oke-radius-md: 12px;   /* 卡片标准圆角，与驾驶舱一致 */
  --oke-radius-lg: 16px;
  --oke-radius-xl: 20px;
  --oke-radius-pill: 999px;

  /* 字号阶梯 */
  --oke-text-2xs: 9.5px;
  --oke-text-xs: 10.5px;
  --oke-text-sm: 11.5px;
  --oke-text-base: 12px;
  --oke-text-md: 13px;
  --oke-text-lg: 15px;
  --oke-text-xl: 20px;

  /* 线：一根发丝、一根分隔、一根聚焦 */
  --oke-line-hair: rgba(126, 156, 255, 0.07);
  --oke-line-divider: rgba(126, 156, 255, 0.13);
  --oke-line-focus: rgba(87, 215, 255, 0.55);
  --oke-line-hair-width: 1px;

  /* 控件与行高 */
  --oke-control-h: 32px;      /* 按钮 / 输入 / 选择器统一高度 */
  --oke-control-h-sm: 26px;   /* 表格内联操作 */
  --oke-row-h: 36px;          /* 表格行高 */
  --oke-th-h: 34px;           /* 表头高度 */
  --oke-empty-h: 72px;        /* 表格内空态行的最小高度 */
  --oke-accent-w: 2px;        /* 状态条 / 强调竖线宽度 */
  --oke-skeleton-h: 10px;     /* 骨架条高度 */

  /* 强调色与反馈 */
  --oke-accent: #57d7ff;
  --oke-accent-ink: #a9f0ff;
  --oke-accent-soft: rgba(87, 215, 255, 0.12);
  --oke-focus-ring: 0 0 0 3px rgba(87, 215, 255, 0.18);
  --oke-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --oke-card-bg: radial-gradient(420px 180px at 8% 0%, rgba(84, 120, 220, 0.1), transparent 72%),
                 linear-gradient(160deg, rgba(24, 17, 58, 0.66), rgba(8, 5, 22, 0.78));

  /* 兼容别名：审批流旧样式引用了 --line/--card/--primary/--text-*，此前未定义 */
  --primary: var(--oke-primary);
  --primary-soft: var(--oke-primary-soft);
  --card: var(--oke-glass);
  --line: var(--oke-line-divider);
  --text: var(--oke-text);
  --text-2: var(--oke-muted);
  --text-3: var(--oke-dim);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--oke-abyss);
  color: var(--oke-text);
  font-family: var(--font);
  font-size: 14px;
  font-feature-settings: "ss01", "cv01", "tnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 极光：两层缓慢漂移的径向光，固定不随滚动 */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(900px 620px at 14% 6%, rgba(54, 110, 207, 0.34), transparent 62%),
    radial-gradient(760px 520px at 84% 2%, rgba(31, 0, 94, 0.92), transparent 66%),
    radial-gradient(700px 480px at 62% 100%, rgba(87, 215, 255, 0.12), transparent 64%),
    radial-gradient(520px 380px at 96% 78%, rgba(139, 107, 255, 0.14), transparent 70%),
    linear-gradient(180deg, #090522 0%, #05030f 100%);
  z-index: -3;
  animation: drift 36s var(--ease) infinite alternate;
}

/* 网格 + 细颗粒：把纯色空间压出材质 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(126, 156, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 156, 255, 0.045) 1px, transparent 1px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 56px 56px, 56px 56px, 180px 180px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 82%);
  opacity: 0.55;
  z-index: -2;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate3d(-1.2%, -0.8%, 0) scale(1.02); }
  to { transform: translate3d(1.2%, 1%, 0) scale(1.05); }
}

::selection { background: rgba(54, 110, 207, 0.5); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 150, 255, 0.2);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(120, 150, 255, 0.32); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 骨架 ---------------- */
.app {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 14px 16px;
  background: linear-gradient(180deg, rgba(18, 12, 48, 0.9), rgba(6, 4, 18, 0.94));
  border-right: 1px solid var(--oke-line);
}

.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 20px; }
.brand-mark {
  position: relative;
  width: 40px; height: 40px; flex: none;
  border-radius: 11px;
  display: block;
  object-fit: contain;
  background: #f6f4f1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.auth-brand .brand-mark { width: 52px; height: 52px; border-radius: 14px; }
.brand-mark::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 16px;
  border: 1px solid rgba(120, 170, 255, 0.16);
}
.brand-title { font-size: 14.5px; font-weight: 700; letter-spacing: 0.4px; }
.brand-sub {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--oke-dim);
}

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; padding-right: 2px; }
.nav-group {
  margin: 16px 10px 8px;
  font-size: 9.5px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--oke-dim);
  display: flex; align-items: center; gap: 8px;
}
.nav-group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--oke-line), transparent); }

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--oke-muted);
  font-size: 12.5px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}
.nav-item:hover { color: var(--oke-text); background: rgba(96, 130, 230, 0.09); transform: translateX(2px); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(54, 110, 207, 0.28), rgba(54, 110, 207, 0.04));
  border-color: rgba(91, 141, 240, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -1px; top: 50%;
  width: 2px; height: 18px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: linear-gradient(180deg, #57d7ff, #366ecf);
  box-shadow: 0 0 12px rgba(87, 215, 255, 0.8);
}
.nav-item .dot {
  width: 6px; height: 6px; flex: none;
  border-radius: 50%;
  background: rgba(120, 150, 255, 0.45);
  transition: background 0.18s, box-shadow 0.18s;
}
.nav-item.active .dot { background: var(--oke-cyan); box-shadow: 0 0 10px rgba(87, 215, 255, 0.9); }
.nav-item .count { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--oke-dim); }

.side-foot {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid var(--oke-line);
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--oke-dim);
}
.side-foot b { color: var(--oke-muted); font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }

/* ---------------- 顶栏 ---------------- */
.top {
  position: sticky; top: 0; z-index: 20;
  height: 62px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  background: linear-gradient(180deg, rgba(7, 5, 20, 0.94), rgba(6, 4, 18, 0.9));
  border-bottom: 1px solid var(--oke-line);
}
.top::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(87, 215, 255, 0.28), rgba(54, 110, 207, 0.22), transparent);
}
.top .title-block { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.top h1 { font-size: 15.5px; margin: 0; font-weight: 700; letter-spacing: 0.2px; white-space: nowrap; }
.top .crumb { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--oke-dim); }
.top .spacer { flex: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  background: rgba(54, 110, 207, 0.1);
  border: 1px solid rgba(91, 141, 240, 0.22);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.4px;
  color: var(--oke-muted);
  white-space: nowrap;
}
.pill .led {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--oke-good);
  box-shadow: 0 0 8px var(--oke-good);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------------- 表单控件 ---------------- */
select, input, textarea, button { font-family: inherit; font-size: 12.5px; color: var(--oke-text); }
select, input[type="text"], input[type="number"], input[type="password"], textarea {
  background: rgba(8, 5, 24, 0.78);
  border: 1px solid var(--oke-line-strong);
  border-radius: var(--oke-radius-sm);
  min-height: var(--oke-control-h);
  padding: 6px 11px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
select:hover, input:hover, textarea:hover { border-color: rgba(130, 165, 255, 0.4); }
select:focus, input:focus, textarea:focus {
  border-color: var(--oke-accent);
  box-shadow: var(--oke-focus-ring), 0 0 24px -12px rgba(87, 215, 255, 0.55);
}
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--oke-dim) 50%), linear-gradient(135deg, var(--oke-dim) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
textarea { width: 100%; resize: vertical; font-family: var(--mono); line-height: 1.6; }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--oke-control-h); padding: 0 var(--oke-space-4);
  border-radius: var(--oke-radius-sm);
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgba(91, 141, 240, 0.35);
  background: linear-gradient(180deg, rgba(72, 122, 222, 0.42), rgba(38, 76, 164, 0.34));
  color: #eef4ff;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 24px -16px rgba(54, 110, 207, 1);
  transition: transform 0.12s var(--ease), filter 0.16s, border-color 0.16s;
}
.btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.16) 46%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease);
}
.btn:hover { filter: brightness(1.1); border-color: rgba(120, 170, 255, 0.55); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: rgba(16, 11, 40, 0.6);
  border-color: var(--oke-line-strong);
  color: var(--oke-muted);
  box-shadow: none;
}
.btn.ghost:hover { color: var(--oke-text); }
.btn.danger { border-color: rgba(255, 107, 139, 0.35); background: rgba(84, 20, 42, 0.4); }
.btn.sm { height: var(--oke-control-h-sm); padding: 0 var(--oke-space-3); font-size: var(--oke-text-xs); border-radius: var(--oke-radius-xs); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--oke-accent); outline-offset: 2px; }
.btn.ghost:focus-visible { outline-offset: 2px; }

/* ---------------- 内容区 ---------------- */
.content {
  padding: 26px 26px 72px;
  display: flex; flex-direction: column; gap: 18px;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

.grid { display: grid; gap: 16px; align-items: start; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1360px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 60px; }
  .top { padding: 0 14px; }
}

/* 入场：只做一次性上浮，避免高频闪烁 */
.content > * { animation: rise 0.5s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: 0.04s; }
.content > *:nth-child(3) { animation-delay: 0.08s; }
.content > *:nth-child(4) { animation-delay: 0.12s; }
.content > *:nth-child(5) { animation-delay: 0.16s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 指挥带 ---------------- */
.deck {
  display: flex; align-items: center; gap: 22px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 160px at 0% 0%, rgba(54, 110, 207, 0.22), transparent 70%),
    linear-gradient(120deg, rgba(26, 18, 66, 0.72), rgba(9, 6, 26, 0.7));
  border: 1px solid rgba(120, 160, 255, 0.16);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}
.deck::after {
  content: "";
  position: absolute; right: -60px; top: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(87, 215, 255, 0.14), transparent 62%);
  pointer-events: none;
}
.deck-main { min-width: 0; }
.deck-eyebrow {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: rgba(120, 170, 255, 0.75);
  margin-bottom: 8px;
}
.deck-main h2 { margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.deck-main p { margin: 0; font-size: 12px; color: var(--oke-muted); line-height: 1.6; }
.deck-stats { margin-left: auto; display: flex; align-items: stretch; gap: 0; }
.deck-stat { padding: 0 22px; border-left: 1px solid var(--oke-line); min-width: 118px; }
.deck-stat:first-child { border-left: none; }
.deck-stat b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.6px;
  color: #fff;
}
.deck-stat span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--oke-dim); letter-spacing: 0.4px; }
@media (max-width: 1100px) { .deck { flex-direction: column; align-items: flex-start; } .deck-stats { margin-left: 0; width: 100%; } .deck-stat { padding: 0 16px; } }

/* ---------------- 卡片 ---------------- */
.card {
  position: relative;
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(400px 160px at 12% 0%, rgba(90, 130, 235, 0.12), transparent 70%),
    linear-gradient(160deg, rgba(30, 22, 76, 0.6), rgba(9, 6, 26, 0.72));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px) saturate(130%);
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
/* 发丝渐变描边：比 1px 纯色边更有金属感 */
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(150, 185, 255, 0.32), rgba(90, 120, 220, 0.05) 42%, rgba(87, 215, 255, 0.16));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card), 0 0 40px -22px rgba(87, 215, 255, 0.5);
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title { font-size: 12.5px; font-weight: 650; letter-spacing: 0.5px; color: var(--oke-text); }
.card-title .sub { margin-left: 8px; font-size: 10.5px; font-weight: 400; letter-spacing: 0.3px; color: var(--oke-dim); }
.card-head .spacer { flex: 1; }
.card-hint { font-size: 10.5px; line-height: 1.6; color: var(--oke-dim); }

/* ---------------- KPI ---------------- */
.kpi { display: flex; flex-direction: column; gap: 8px; min-height: 118px; }
.kpi-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--oke-muted);
}
.kpi-label i { width: 5px; height: 5px; border-radius: 50%; background: var(--oke-primary-soft); box-shadow: 0 0 8px var(--oke-primary-soft); }
.kpi-value {
  font-family: var(--mono);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -1.2px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #b9c9f2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kpi-value .unit { font-family: var(--font); font-size: 12px; letter-spacing: 0; margin-left: 5px; color: var(--oke-dim); -webkit-text-fill-color: var(--oke-dim); }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 10.5px; color: var(--oke-dim); }
.trend { font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.trend.up { color: var(--oke-good); background: rgba(60, 224, 164, 0.1); }
.trend.down { color: var(--oke-bad); background: rgba(255, 107, 139, 0.1); }
.trend.flat { color: var(--oke-muted); background: rgba(120, 150, 255, 0.08); }
.spark { margin-top: 2px; opacity: 0.9; }

/* ---------------- 健康环 ---------------- */
.ring-card { display: flex; align-items: center; gap: 22px; }
.ring { position: relative; width: 136px; height: 136px; flex: none; filter: drop-shadow(0 0 18px rgba(54, 110, 207, 0.35)); }
.ring svg { transform: rotate(-90deg); }
.ring .score { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.ring .score b { font-family: var(--mono); font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -1px; }
.ring .score span { margin-top: 5px; font-size: 9px; letter-spacing: 2.4px; color: var(--oke-dim); }
.ring-meta { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ring-meta h4 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: 0.2px; }
.ring-meta p { margin: 0; font-size: 11.5px; line-height: 1.7; color: var(--oke-muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 10.5px; color: var(--oke-muted); }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; max-height: 460px; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
thead th {
  position: sticky; top: 0;
  text-align: left;
  padding: 8px 10px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--oke-dim);
  background: rgba(8, 5, 24, 0.9);
  border-bottom: 1px solid var(--oke-line);
  white-space: nowrap;
  z-index: 1;
}
td { padding: 9px 10px; border-bottom: 1px solid rgba(126, 156, 255, 0.07); color: var(--oke-text); }
tbody tr { transition: background 0.14s; }
tbody tr:hover { background: rgba(84, 120, 220, 0.07); }
tr:last-child td { border-bottom: none; }
td.mono, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted, td .muted { color: var(--oke-dim); }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}
.tag.blue { color: #a8c6ff; background: rgba(54, 110, 207, 0.14); border-color: rgba(91, 141, 240, 0.26); }
.tag.green { color: var(--oke-good); background: rgba(60, 224, 164, 0.09); border-color: rgba(60, 224, 164, 0.24); }
.tag.amber { color: var(--oke-warn); background: rgba(255, 200, 87, 0.09); border-color: rgba(255, 200, 87, 0.24); }
.tag.red { color: var(--oke-bad); background: rgba(255, 107, 139, 0.09); border-color: rgba(255, 107, 139, 0.24); }
.tag.dim { color: var(--oke-dim); background: rgba(120, 150, 255, 0.05); border-color: var(--oke-line); }

/* ---------------- 风险 / 时间线 ---------------- */
.risk-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(126, 156, 255, 0.07); }
.risk-item:last-child { border-bottom: none; }
.risk-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.risk-dot.high { background: var(--oke-bad); box-shadow: 0 0 14px rgba(255, 107, 139, 0.75); }
.risk-dot.medium { background: var(--oke-warn); box-shadow: 0 0 14px rgba(255, 200, 87, 0.55); }
.risk-dot.low { background: var(--oke-cyan); box-shadow: 0 0 14px rgba(87, 215, 255, 0.55); }
.risk-body { min-width: 0; }
.risk-body b { display: block; margin-bottom: 3px; font-size: 12px; font-weight: 600; }
.risk-body span { font-size: 10.5px; line-height: 1.6; color: var(--oke-muted); }
.risk-level { margin-left: auto; align-self: flex-start; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.8px; color: var(--oke-dim); }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, rgba(87, 215, 255, 0.5), rgba(54, 110, 207, 0.1)); }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item::before { content: ""; position: absolute; left: -18px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--oke-primary-soft); box-shadow: 0 0 10px var(--oke-primary); }
.tl-item .tl-time { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.4px; color: var(--oke-dim); }
.tl-item .tl-title { margin: 3px 0 2px; font-size: 12px; }
.tl-item .tl-sub { font-size: 10.5px; color: var(--oke-muted); }

/* ---------------- 模块网格 ---------------- */
.mod-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1440px) { .mod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1020px) { .mod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mod {
  position: relative;
  padding: 15px;
  border-radius: var(--radius);
  cursor: pointer;
  background: linear-gradient(155deg, rgba(26, 19, 62, 0.66), rgba(10, 7, 28, 0.5));
  border: 1px solid var(--oke-line);
  transition: transform 0.18s var(--ease), border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.mod::after {
  content: "→";
  position: absolute; right: 14px; top: 13px;
  font-size: 12px;
  color: rgba(120, 170, 255, 0.55);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s, transform 0.18s;
}
.mod:hover {
  transform: translateY(-3px);
  border-color: rgba(120, 170, 255, 0.45);
  background: linear-gradient(155deg, rgba(34, 26, 80, 0.78), rgba(12, 8, 32, 0.62));
  box-shadow: 0 24px 44px -34px rgba(87, 215, 255, 0.58);
}
.mod:hover::after { opacity: 1; transform: none; }
.mod-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.mod-name { font-size: 13px; font-weight: 650; letter-spacing: 0.2px; }
.mod-route { font-family: var(--mono); font-size: 9.5px; color: var(--oke-dim); }
.mod-desc { min-height: 36px; font-size: 10.5px; line-height: 1.6; color: var(--oke-muted); }
.mod-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-family: var(--mono); font-size: 9.5px; color: var(--oke-dim); }

/* ---------------- 成员 / 头像 ---------------- */
.member {
  display: flex; gap: 11px;
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(24, 17, 58, 0.6), rgba(9, 6, 24, 0.5));
  border: 1px solid var(--oke-line);
}
.avatar {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #366ecf, #1f005e 78%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 8px 18px -12px rgba(54, 110, 207, 0.9);
}
.member b { display: block; font-size: 12px; }
.member span { font-size: 10.5px; color: var(--oke-dim); }
.member .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* ---------------- 流程 / DAG ---------------- */
.dag { width: 100%; overflow-x: auto; }
.dag svg { display: block; }
.step-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(16, 11, 40, 0.62);
  border: 1px solid var(--oke-line);
  font-size: 11.5px;
}
.step .n {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(54, 110, 207, 0.22);
  color: #bcd2ff;
  font-family: var(--mono);
  font-size: 9.5px;
}
.step.done { border-color: rgba(60, 224, 164, 0.28); }
.step.done .n { background: rgba(60, 224, 164, 0.16); color: var(--oke-good); }
.arrow { color: var(--oke-dim); font-size: 11px; }

/* ---------------- 控制台 / 空态 / 提示 ---------------- */
.console {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(4, 2, 12, 0.86);
  border: 1px solid var(--oke-line);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.65;
  color: #b9c8f5;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.console .ok { color: var(--oke-good); }
.console .err { color: var(--oke-bad); }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 34px 12px;
  text-align: center;
  font-size: 11.5px;
  color: var(--oke-dim);
  border: 1px dashed rgba(126, 156, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(10, 7, 26, 0.3);
}
.empty::before {
  content: "◇";
  font-size: 20px;
  color: rgba(120, 170, 255, 0.4);
}

.toast {
  position: fixed; right: 26px; bottom: 26px; z-index: 99;
  min-width: 240px; max-width: 440px;
  padding: 13px 16px;
  border-radius: var(--radius);
  background: rgba(16, 11, 42, 0.96);
  border: 1px solid var(--oke-line-strong);
  box-shadow: var(--shadow-pop);
  font-size: 12px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  backdrop-filter: blur(18px);
}
.toast.show { opacity: 1; transform: none; }
.toast.err { border-color: rgba(255, 107, 139, 0.45); }
.toast b { display: block; margin-bottom: 3px; }

/* ---------------- 登录 ---------------- */
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 11px; color: #b9c8f5; }

.auth {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.auth::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 520px at 18% 12%, rgba(84, 72, 255, 0.28), transparent 62%),
    radial-gradient(700px 480px at 84% 84%, rgba(47, 190, 255, 0.2), transparent 66%);
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 30px 30px 24px;
  border-radius: var(--radius-lg);
  background: var(--oke-glass);
  border: 1px solid var(--oke-line-strong);
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(22px);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card h2 { margin: 0 0 8px; font-size: 19px; letter-spacing: 0.4px; }
.auth-hint { margin: 0 0 20px; font-size: 11.5px; line-height: 1.7; color: var(--oke-dim); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; letter-spacing: 0.6px; color: var(--oke-muted); }
.auth-form input { height: 40px; font-size: 13px; }
.auth-submit { margin-top: 4px; height: 42px; font-size: 13px; }
.auth-error {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  line-height: 1.6;
  color: #ffc2cf;
  background: rgba(255, 107, 139, 0.1);
  border: 1px solid rgba(255, 107, 139, 0.3);
}
.auth-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--oke-line); font-size: 10.5px; line-height: 1.7; color: var(--oke-dim); }

/* ---------------- 顶栏身份 ---------------- */
.user-chip {
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 4px 12px 4px 10px;
  border-left: 1px solid var(--oke-line);
  border-right: 1px solid var(--oke-line);
  min-width: 96px;
}
.user-chip b { font-size: 11.5px; font-weight: 600; color: var(--oke-text); }
.user-chip span { font-size: 9.5px; letter-spacing: 0.4px; color: var(--oke-dim); }

/* ---------------- 账号管理 ---------------- */
.table .row-actions { text-align: right; white-space: nowrap; }
.table .row-actions .btn { padding: 3px 8px; font-size: 10.5px; }
.table td .tag { vertical-align: middle; }
.tag.ok { color: var(--oke-good); background: rgba(60, 224, 164, 0.09); border-color: rgba(60, 224, 164, 0.24); }
.tag.warn { color: var(--oke-warn); background: rgba(255, 200, 87, 0.09); border-color: rgba(255, 200, 87, 0.24); }
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; letter-spacing: 0.5px; color: var(--oke-muted); }
.form-grid .btn { align-self: flex-start; }

/* ---------------- 基础设置：角色与权限 / 用户管理 / 部门管理 ---------------- */
.settings-hero { margin: 2px 0 18px; display: flex; flex-direction: column; gap: 6px; }
.settings-hero h2 { margin: 0; font-size: 20px; letter-spacing: 0.2px; color: var(--oke-text); }
.settings-hero p { margin: 0; max-width: 860px; font-size: 13px; line-height: 1.75; color: var(--oke-muted); }

.settings-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1080px) { .settings-layout { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .grid.g2, .grid.g3 { grid-template-columns: 1fr; } }

.role-list { display: flex; flex-direction: column; gap: 10px; }
.role-list input, .toolbar input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--oke-line); background: rgba(8, 12, 34, 0.6);
  color: var(--oke-text); font-size: 13px; font-family: inherit; outline: none;
}
.role-list input:focus, .toolbar input:focus { border-color: rgba(87, 215, 255, 0.5); }
.role-list-body { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow: auto; padding-right: 3px; }
.role-item {
  text-align: left; width: 100%; padding: 12px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--oke-line); background: rgba(14, 20, 48, 0.5);
  color: var(--oke-text); cursor: pointer; transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.role-item:hover { border-color: rgba(87, 215, 255, 0.36); background: rgba(22, 32, 70, 0.6); }
.role-item.active { border-color: rgba(87, 215, 255, 0.62); background: rgba(54, 110, 207, 0.18); box-shadow: 0 0 0 1px rgba(87, 215, 255, 0.18) inset; }
.role-item.retired { opacity: 0.72; }
.role-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.role-item-top b { font-weight: 600; }
.role-item-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 13px; color: var(--oke-muted); }
.role-item-foot { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--oke-dim); }
.role-state.ok { color: var(--oke-good); }
.role-state.warn { color: var(--oke-warn); }

.role-detail { border: 1px solid var(--oke-line); border-radius: var(--radius); padding: 18px 20px; background: rgba(9, 13, 34, 0.45); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: flex-end; }
.step { border-top: 1px dashed var(--oke-line); padding: 18px 0 4px; }
.step:first-of-type { border-top: none; padding-top: 6px; }
.step-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; font-weight: 600; color: var(--oke-text); }
.step-badge { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--oke-line); background: rgba(10, 15, 38, 0.6); font-size: 13px; font-weight: 400; color: var(--oke-dim); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--oke-muted); }
.field input, .field select, .field textarea {
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--oke-line);
  background: rgba(8, 12, 34, 0.6); color: var(--oke-text); font-size: 13px; font-family: inherit; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(87, 215, 255, 0.5); }
.field input:disabled, .field select:disabled, .field textarea:disabled { opacity: 0.55; }
.field-head { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 8px; font-size: 13px; color: var(--oke-text); }

.perm-wrap { max-height: 540px; overflow: auto; border: 1px solid var(--oke-line); border-radius: var(--radius-sm); padding: 4px 14px 10px; }
.perm-wrap.readonly { opacity: 0.75; }
.perm-group { border-bottom: 1px solid rgba(90, 120, 200, 0.14); padding: 8px 0; }
.perm-group:last-child { border-bottom: none; }
.perm-group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; cursor: pointer; list-style: none; font-size: 14px; color: var(--oke-text); }
.perm-group-head::-webkit-details-marker { display: none; }
.perm-group-head::before { content: '▸'; margin-right: 8px; color: var(--oke-dim); font-size: 12px; }
.perm-group[open] > .perm-group-head::before { content: '▾'; }
.perm-group-head b { flex: 1; font-weight: 600; }
.perm-group-head span { font-size: 13px; color: var(--oke-dim); white-space: nowrap; }
.perm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 10px 0 8px 18px; border-top: 1px solid rgba(90, 120, 200, 0.1); }
.perm-main { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; min-width: 0; }
.perm-switch { width: 18px; height: 18px; margin-top: 2px; accent-color: #57d7ff; flex: none; }
.perm-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.perm-text b { font-size: 14px; font-weight: 600; color: var(--oke-text); }
.perm-text span { font-size: 13px; line-height: 1.6; color: var(--oke-muted); }
.perm-high { padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(255, 107, 139, 0.4); background: rgba(255, 107, 139, 0.1); color: #ff9db2; font-size: 12.5px; white-space: nowrap; }
.perm-phases { display: none; grid-column: 1 / -1; flex-wrap: wrap; gap: 8px 16px; padding: 2px 0 4px 28px; }
.perm-wrap.adv-open .perm-phases { display: flex; }
.phase-check { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--oke-muted); cursor: pointer; }
.phase-check input { accent-color: #57d7ff; }

.adv { margin-bottom: 12px; border: 1px solid var(--oke-line); border-radius: var(--radius-sm); background: rgba(10, 15, 38, 0.4); padding: 0 14px; }
.adv summary { padding: 10px 0; cursor: pointer; list-style: none; font-size: 13px; color: #9fb4ee; }
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before { content: '▸'; margin-right: 7px; color: var(--oke-dim); }
.adv[open] summary::before { content: '▾'; }
.adv[open] summary { border-bottom: 1px dashed var(--oke-line); }
.adv .card-hint { padding: 10px 0; font-size: 13px; }

.summary-card { display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px dashed rgba(87, 215, 255, 0.38); background: rgba(87, 215, 255, 0.06); font-size: 13px; line-height: 1.7; color: var(--oke-muted); }
.summary-card b { font-size: 13px; color: #a9f0ff; }

.toolbar { display: flex; gap: 10px; margin: 4px 0 12px; }
.toolbar input { flex: 1; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(3, 5, 16, 0.72); backdrop-filter: blur(6px);
}
.dialog {
  width: min(560px, 100%); max-height: 86vh; overflow: auto; padding: 20px 22px;
  border-radius: var(--radius); border: 1px solid rgba(120, 160, 255, 0.28);
  background: linear-gradient(180deg, rgba(16, 24, 58, 0.98), rgba(8, 12, 32, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(87, 215, 255, 0.08) inset;
}
.dialog.wide { width: min(700px, 100%); }
.dialog-head { margin-bottom: 12px; }
.dialog-title { font-size: 16px; font-weight: 600; color: var(--oke-text); }
.dialog-body { display: flex; flex-direction: column; gap: 12px; font-size: 13px; line-height: 1.7; color: var(--oke-muted); }
.dialog-body p { margin: 0; }
.dialog-body .field { margin-bottom: 4px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--oke-line); }
.dialog .form-error, .dialog-error {
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.6;
  color: #ffc2cf; background: rgba(255, 107, 139, 0.1); border: 1px solid rgba(255, 107, 139, 0.3);
}
.form-error { padding: 9px 12px; margin-top: 10px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.6; color: #ffc2cf; background: rgba(255, 107, 139, 0.1); border: 1px solid rgba(255, 107, 139, 0.3); }
.account-list { margin: 0; padding-left: 20px; max-height: 190px; overflow: auto; font-size: 13px; line-height: 1.9; }
.account-list .mono { font-size: 12.5px; color: var(--oke-dim); }
.check-line { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--oke-text); }
.check-line input { accent-color: #57d7ff; }
.secret-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px dashed rgba(87, 215, 255, 0.4); background: rgba(87, 215, 255, 0.07); }
.secret-box code { flex: 1; font-family: var(--mono); font-size: 16px; letter-spacing: 1px; color: #a9f0ff; word-break: break-all; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 审批流 / 审计日志 / 基础设置：统一深空玻璃语言
   作用域说明：设置区没有页面级 class，用 #view:has(.settings-hero) 做纯 CSS 作用域，
   不触碰 app.js 的任何类名与行为；错误页（卡片单独成页）由 #view > .card:only-child 兜底。 */

/* ---------- 作用域内的卡片：12px 圆角 + 发丝描边 + 内层高光 ---------- */
#view:has(.settings-hero) .card,
#view > .card:only-child {
  padding: var(--oke-space-5);
  border-radius: var(--oke-radius-md);
  border: var(--oke-line-hair-width) solid var(--oke-line-divider);
  background: var(--oke-card-bg);
  box-shadow: var(--oke-highlight), 0 26px 48px -40px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(18px) saturate(130%);
}
/* 设置区卡片不做位移动效：读表时卡片跳动会打断视线 */
#view:has(.settings-hero) .card:hover,
#view > .card:only-child:hover {
  transform: none;
  box-shadow: var(--oke-highlight), 0 30px 56px -40px rgba(0, 0, 0, 1);
}
#view:has(.settings-hero) .card-head {
  margin-bottom: var(--oke-space-3);
  padding-bottom: var(--oke-space-2);
  border-bottom: var(--oke-line-hair-width) solid var(--oke-line-hair);
}
#view:has(.settings-hero) .card-title { font-size: var(--oke-text-md); letter-spacing: 0.3px; }
#view:has(.settings-hero) .card-title .sub { font-size: var(--oke-text-2xs); color: var(--oke-dim); letter-spacing: 0.6px; }
#view:has(.settings-hero) .card-hint { font-size: var(--oke-text-xs); color: var(--oke-dim); }

/* ---------- 页头：左侧一道极光竖线做锚点 ---------- */
#view:has(.settings-hero) .settings-hero {
  position: relative;
  margin: 0;
  padding-left: var(--oke-space-4);
  gap: var(--oke-space-1);
}
#view:has(.settings-hero) .settings-hero::before {
  content: "";
  position: absolute;
  left: 0; top: var(--oke-space-1); bottom: var(--oke-space-1);
  width: var(--oke-accent-w);
  border-radius: var(--oke-radius-pill);
  background: linear-gradient(180deg, var(--oke-accent), rgba(54, 110, 207, 0.12));
}
#view:has(.settings-hero) .settings-hero h2 { font-size: var(--oke-text-xl); letter-spacing: 0.2px; }
#view:has(.settings-hero) .settings-hero p { font-size: var(--oke-text-md); line-height: 1.7; color: var(--oke-muted); }

/* ---------- 表格：36px 行高、表头吸顶、发丝分隔、操作列右对齐 ---------- */
#view:has(.settings-hero) .table-wrap {
  max-height: 560px;
  border: var(--oke-line-hair-width) solid var(--oke-line-hair);
  border-radius: var(--oke-radius-sm);
  background: rgba(6, 4, 18, 0.35);
}
#view:has(.settings-hero) table { font-size: var(--oke-text-base); }
#view:has(.settings-hero) thead th {
  height: var(--oke-th-h);
  padding: 0 var(--oke-space-3);
  background: rgba(10, 7, 28, 0.97);
  border-bottom: var(--oke-line-hair-width) solid var(--oke-line-divider);
  font-size: var(--oke-text-2xs);
  letter-spacing: 1.1px;
  color: var(--oke-muted);
}
#view:has(.settings-hero) tbody td {
  height: var(--oke-row-h);
  padding: 0 var(--oke-space-3);
  border-bottom: var(--oke-line-hair-width) solid var(--oke-line-hair);
  font-size: var(--oke-text-base);
  vertical-align: middle;
}
#view:has(.settings-hero) tbody tr:last-child td { border-bottom: none; }
#view:has(.settings-hero) tbody tr:hover td { background: rgba(84, 120, 220, 0.06); }
#view:has(.settings-hero) td.row-actions { text-align: right; white-space: nowrap; }
#view:has(.settings-hero) table:has(td.row-actions) thead th:last-child { text-align: right; }
#view:has(.settings-hero) td.row-actions .btn {
  height: var(--oke-control-h-sm);
  padding: 0 var(--oke-space-2);
  font-size: var(--oke-text-xs);
  margin-left: var(--oke-space-1);
}
#view:has(.settings-hero) td .muted { color: var(--oke-muted); font-size: var(--oke-text-sm); }
#view:has(.settings-hero) td .mono { font-size: var(--oke-text-xs); }

/* 表格里的空态不能撑成 flex 容器，否则会破坏表列 */
#view:has(.settings-hero) tbody td.empty {
  display: table-cell;
  height: var(--oke-empty-h);
  padding: 0 var(--oke-space-3);
  text-align: center;
  color: var(--oke-muted);
  font-size: var(--oke-text-sm);
  border-bottom: none;
  background: transparent;
}
#view:has(.settings-hero) tbody td.empty::before { content: none; }

/* ---------- 空态：虚线框 + 一行中文提示 ---------- */
#view:has(.settings-hero) .empty {
  padding: var(--oke-space-6) var(--oke-space-4);
  border: 1px dashed var(--oke-line);
  border-radius: var(--oke-radius-md);
  background: rgba(10, 7, 26, 0.28);
  font-size: var(--oke-text-sm);
  color: var(--oke-muted);
  gap: var(--oke-space-2);
}
#view:has(.settings-hero) .empty::before { font-size: var(--oke-text-lg); opacity: 0.7; }

/* ---------- 表单：32px 控件、统一焦点环 ---------- */
#view:has(.settings-hero) .field { gap: var(--oke-space-1); margin-bottom: var(--oke-space-3); font-size: var(--oke-text-sm); color: var(--oke-muted); }
#view:has(.settings-hero) .field input,
#view:has(.settings-hero) .field select,
#view:has(.settings-hero) .role-list input,
#view:has(.settings-hero) .toolbar input,
#view:has(.settings-hero) .select {
  height: var(--oke-control-h);
  min-height: var(--oke-control-h);
  padding: 0 var(--oke-space-3);
  border: var(--oke-line-hair-width) solid var(--oke-line-strong);
  border-radius: var(--oke-radius-sm);
  background: rgba(8, 5, 24, 0.74);
  color: var(--oke-text);
  font-size: var(--oke-text-sm);
}
#view:has(.settings-hero) .field textarea { min-height: 72px; padding: var(--oke-space-2) var(--oke-space-3); font-size: var(--oke-text-sm); }
#view:has(.settings-hero) .field input:focus,
#view:has(.settings-hero) .field select:focus,
#view:has(.settings-hero) .field textarea:focus,
#view:has(.settings-hero) .role-list input:focus,
#view:has(.settings-hero) .toolbar input:focus,
#view:has(.settings-hero) .select:focus {
  border-color: var(--oke-accent);
  box-shadow: var(--oke-focus-ring);
  outline: none;
}
#view:has(.settings-hero) .field input::placeholder,
#view:has(.settings-hero) .role-list input::placeholder { color: var(--oke-dim); }
#view:has(.settings-hero) .field-head { margin: var(--oke-space-4) 0 var(--oke-space-2); font-size: var(--oke-text-md); }

/* ---------- 角色列表 / 详情 ---------- */
#view:has(.settings-hero) .role-list { gap: var(--oke-space-2); }
#view:has(.settings-hero) .role-list-body { gap: var(--oke-space-2); max-height: 600px; }
#view:has(.settings-hero) .role-item {
  padding: var(--oke-space-3);
  border: var(--oke-line-hair-width) solid var(--oke-line-divider);
  border-radius: var(--oke-radius-sm);
  background: rgba(14, 20, 48, 0.4);
  box-shadow: var(--oke-highlight);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
#view:has(.settings-hero) .role-item:hover { border-color: rgba(87, 215, 255, 0.34); background: rgba(20, 29, 66, 0.55); }
#view:has(.settings-hero) .role-item.active {
  border-color: rgba(87, 215, 255, 0.58);
  background: rgba(54, 110, 207, 0.16);
  box-shadow: inset 0 0 0 1px rgba(87, 215, 255, 0.14), 0 10px 26px -22px rgba(87, 215, 255, 0.8);
}
#view:has(.settings-hero) .role-item-top { font-size: var(--oke-text-md); }
#view:has(.settings-hero) .role-item-sub { margin-top: var(--oke-space-1); font-size: var(--oke-text-sm); color: var(--oke-muted); }
#view:has(.settings-hero) .role-item-foot { margin-top: var(--oke-space-1); gap: var(--oke-space-3); font-size: var(--oke-text-xs); color: var(--oke-dim); }
#view:has(.settings-hero) .role-detail {
  padding: var(--oke-space-5);
  border: var(--oke-line-hair-width) solid var(--oke-line-divider);
  border-radius: var(--oke-radius-md);
  background: rgba(10, 14, 36, 0.5);
  box-shadow: var(--oke-highlight);
}
#view:has(.settings-hero) .step { padding: var(--oke-space-4) 0 var(--oke-space-1); }
#view:has(.settings-hero) .step-title { margin-bottom: var(--oke-space-3); font-size: var(--oke-text-md); }
#view:has(.settings-hero) .step-badge { font-size: var(--oke-text-2xs); }
#view:has(.settings-hero) .perm-wrap { max-height: 520px; padding: 0 var(--oke-space-3) var(--oke-space-2); border-radius: var(--oke-radius-sm); }
#view:has(.settings-hero) .perm-group-head { font-size: var(--oke-text-md); }
#view:has(.settings-hero) .perm-group-head span { font-size: var(--oke-text-2xs); }
#view:has(.settings-hero) .perm-row { padding: var(--oke-space-2) 0; }
#view:has(.settings-hero) .perm-text b { font-size: var(--oke-text-base); }
#view:has(.settings-hero) .perm-text span { font-size: var(--oke-text-sm); line-height: 1.55; }
#view:has(.settings-hero) .perm-high { font-size: var(--oke-text-2xs); }
#view:has(.settings-hero) .phase-check,
#view:has(.settings-hero) .adv summary { font-size: var(--oke-text-xs); }
#view:has(.settings-hero) .summary-card { padding: var(--oke-space-3); font-size: var(--oke-text-sm); border-radius: var(--oke-radius-sm); }
#view:has(.settings-hero) .adv .card-hint { font-size: var(--oke-text-xs); }

/* ---------- 审批流卡片：标题行 / 条件行 / 审批人行，操作靠右 ---------- */
.flow-list { display: flex; flex-direction: column; gap: var(--oke-space-2); }
.flow-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--oke-space-2) var(--oke-space-4);
  padding: var(--oke-space-3) var(--oke-space-4) var(--oke-space-3) calc(var(--oke-space-4) + 2px);
  border: var(--oke-line-hair-width) solid var(--oke-line-divider);
  border-radius: var(--oke-radius-md);
  background: linear-gradient(150deg, rgba(22, 16, 54, 0.55), rgba(8, 5, 22, 0.62));
  box-shadow: var(--oke-highlight);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.flow-item::before {
  content: "";
  position: absolute;
  left: 0; top: var(--oke-space-3); bottom: var(--oke-space-3);
  width: var(--oke-accent-w);
  border-radius: var(--oke-radius-pill);
  background: linear-gradient(180deg, var(--oke-accent), rgba(54, 110, 207, 0.15));
  opacity: 0.6;
}
.flow-item:hover { border-color: rgba(120, 170, 255, 0.34); background: linear-gradient(150deg, rgba(28, 21, 66, 0.68), rgba(10, 7, 26, 0.7)); }
.flow-main { min-width: 0; flex: 1; }
.flow-name {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--oke-space-2);
  font-size: var(--oke-text-md);
  font-weight: 650;
  letter-spacing: 0.2px;
  color: var(--oke-text);
}
.flow-name .tag { font-family: var(--mono); font-size: var(--oke-text-2xs); letter-spacing: 0.4px; }
.flow-cond {
  margin-top: var(--oke-space-2);
  font-size: var(--oke-text-base);
  line-height: 1.55;
  color: var(--oke-muted);
}
.flow-cond::before {
  content: "条件";
  display: inline-block;
  margin-right: var(--oke-space-2);
  padding: 1px var(--oke-space-2);
  border: var(--oke-line-hair-width) solid rgba(87, 215, 255, 0.22);
  border-radius: var(--oke-radius-xs);
  background: var(--oke-accent-soft);
  color: var(--oke-accent-ink);
  font-size: var(--oke-text-2xs);
  letter-spacing: 0.6px;
  vertical-align: 1px;
}
.flow-meta {
  margin-top: var(--oke-space-2);
  font-size: var(--oke-text-sm);
  color: var(--oke-dim);
}
.flow-meta b { color: var(--oke-text); font-weight: 600; }
.flow-item > .row-actions { flex: none; align-items: center; justify-content: flex-end; gap: var(--oke-space-1); }

/* ---------- 审计时间线 ---------- */
#view:has(.settings-hero) .timeline { padding-left: var(--oke-space-5); }
#view:has(.settings-hero) .timeline::before { left: 4px; background: linear-gradient(180deg, rgba(87, 215, 255, 0.45), rgba(54, 110, 207, 0.08)); }
#view:has(.settings-hero) .tl-item { padding-bottom: var(--oke-space-3); }
#view:has(.settings-hero) .tl-item::before { left: calc(var(--oke-space-5) * -1); width: 6px; height: 6px; }
#view:has(.settings-hero) .tl-time { font-size: var(--oke-text-2xs); letter-spacing: 0.5px; }
#view:has(.settings-hero) .tl-title { margin: 3px 0 2px; font-size: var(--oke-text-base); font-weight: 600; }
#view:has(.settings-hero) .tl-sub { font-size: var(--oke-text-sm); line-height: 1.6; }

/* ---------- 选择器 / 复选框 / 单选框 ---------- */
.select { min-width: 120px; }
#view:has(.settings-hero) .choice { font-size: var(--oke-text-xs); color: var(--oke-muted); }
#view:has(.settings-hero) .choices { gap: var(--oke-space-2) var(--oke-space-4); }
.field textarea { resize: vertical; }

/* ---------- Toast / 弹窗：沿用同一套圆角与描边 ---------- */
.toast {
  border-radius: var(--oke-radius-md);
  border-left: var(--oke-accent-w) solid var(--oke-accent);
  box-shadow: var(--shadow-pop), var(--oke-highlight);
}
.toast.err { border-left-color: var(--oke-bad); }
.toast b { font-size: var(--oke-text-md); letter-spacing: 0.2px; }
.dialog {
  border-radius: var(--oke-radius-md);
  border: var(--oke-line-hair-width) solid var(--oke-line-strong);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), var(--oke-highlight);
}
.dialog-title { font-size: var(--oke-text-lg); }
.dialog-body { font-size: var(--oke-text-md); }

/* 二次确认：居中窄卡，不用整屏抽屉 */
.dialog.confirm {
  width: min(400px, 100%);
  padding: 18px 20px 16px;
  border-radius: var(--oke-radius-md);
}
.dialog.confirm .dialog-title { font-size: 15px; font-weight: 650; letter-spacing: 0.2px; }
.dialog.confirm .dialog-head { margin-bottom: 8px; }
.dialog.confirm .dialog-body { gap: 6px; font-size: 13px; line-height: 1.6; }
.dialog.confirm .dialog-body .card-hint { margin: 0; font-size: 12px; }
.dialog.confirm .dialog-foot {
  margin-top: 14px; padding-top: 12px; gap: 8px; align-items: center;
}
.dialog.confirm .dialog-foot .btn {
  height: 32px; padding: 0 14px; font-size: 13px; border-radius: var(--oke-radius-sm);
}
.dialog.confirm .dialog-foot .btn.danger {
  border-color: rgba(255, 107, 139, 0.55);
  background: linear-gradient(180deg, rgba(122, 26, 54, 0.85), rgba(86, 16, 38, 0.9));
  color: #ffd9e1;
}
.dialog.confirm .dialog-foot .btn.danger:hover { border-color: rgba(255, 107, 139, 0.85); }
.dialog.confirm .dialog-foot .spacer { flex: 1; }
.dialog.confirm #role-delete-accounts { max-height: 132px; overflow: auto; }

/* ---------- 加载：骨架条，不用转圈 ---------- */
@keyframes oke-shimmer {
  from { background-position: 140% 0; }
  to { background-position: -140% 0; }
}
.skeleton,
.skeleton-bar {
  display: block;
  height: var(--oke-skeleton-h);
  border-radius: var(--oke-radius-xs);
  background: linear-gradient(90deg, rgba(120, 150, 255, 0.07) 0%, rgba(120, 150, 255, 0.26) 38%, rgba(120, 150, 255, 0.07) 76%);
  background-size: 220% 100%;
  animation: oke-shimmer 1.4s linear infinite;
}
/* 页面级「加载中…」：两条骨架脉冲替代文案与任何转圈（文字仍留给读屏） */
#view > .empty:only-child {
  align-items: flex-start;
  text-align: left;
  gap: var(--oke-space-2);
  padding: var(--oke-space-6);
  border-style: dashed;
  font-size: 0;
  color: transparent;
}
#view > .empty:only-child::before,
#view > .empty:only-child::after {
  content: "";
  display: block;
  height: var(--oke-skeleton-h);
  border-radius: var(--oke-radius-pill);
  background: linear-gradient(90deg, rgba(120, 150, 255, 0.08) 0%, rgba(120, 150, 255, 0.3) 40%, rgba(120, 150, 255, 0.08) 80%);
  background-size: 220% 100%;
  animation: oke-shimmer 1.2s linear infinite;
}
#view > .empty:only-child::before { width: min(480px, 100%); }
#view > .empty:only-child::after { width: min(300px, 62%); }

/* ---------- 响应式：窄屏审批流改为纵向，操作落到下一行 ---------- */
@media (max-width: 1080px) {
  #view:has(.settings-hero) .settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .flow-item { grid-template-columns: 1fr; }
  .flow-item > .row-actions { justify-content: flex-start; }
  #view:has(.settings-hero) .card { padding: var(--oke-space-4); }
}

/* ================================================================
   R5 · 统一版式：页头 / 筛选条 / 表格卡 / 右侧抽屉 / 顶栏账号菜单
   目标：五页同一套骨架，管理员在任何一页都知道「先看哪、点哪、保存后发生什么」。
   ================================================================ */
.content { max-width: 1280px; gap: 16px; }

/* ---------- 页头 ---------- */
.page-head {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 2px 2px 4px;
}
.page-head-main { min-width: 0; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: 0.2px; }
.page-head p { margin: 6px 0 0; color: var(--oke-muted); font-size: 13px; line-height: 1.65; max-width: 68ch; }
.page-head .page-action { margin-left: auto; flex: none; display: flex; gap: 8px; align-items: center; }
.page-head .page-action .btn { height: 32px; padding: 0 14px; font-size: 13px; }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-bar .search {
  flex: 1 1 240px; min-width: 180px;
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--oke-line-divider); border-radius: 8px;
  background: rgba(6, 4, 18, 0.55);
}
.filter-bar .search input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--oke-text);
  font-size: 13px; outline: none;
}
.filter-bar .search .icon { color: var(--oke-dim); font-size: 13px; }
.filter-bar select, .filter-bar .select { height: 32px; min-width: 128px; font-size: 13px; }
.filter-bar .result-count { margin-left: auto; color: var(--oke-dim); font-size: 12px; white-space: nowrap; }

/* ---------- 表格卡 ---------- */
.data-card { padding: 0; overflow: hidden; }
.data-card .card-head { padding: 14px 16px; margin: 0; border-bottom: 1px solid var(--oke-line-hair); }
.data-card .card-title { font-size: 13px; }
.data-card .table-wrap { max-height: calc(100vh - 300px); overflow: auto; border: 0; border-radius: 0; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.data-table thead th {
  position: sticky; top: 0; z-index: 2;
  height: 36px; padding: 0 14px; text-align: left;
  font-size: 12px; font-weight: 600; color: var(--oke-muted);
  background: #0c0820; border-bottom: 1px solid var(--oke-line-divider);
  white-space: nowrap;
}
.data-table tbody td {
  height: 44px; padding: 0 14px; border-bottom: 1px solid var(--oke-line-hair);
  color: var(--oke-text); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: rgba(84, 120, 220, 0.06); }
.data-table .num { font-variant-numeric: tabular-nums; color: var(--oke-muted); }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions .btn { height: 26px; padding: 0 10px; font-size: 12px; }
.data-table .name-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.data-table .name-cell b { font-weight: 600; }
.data-table .sub { color: var(--oke-dim); font-size: 12px; }
.data-table .empty-row td { height: 96px; text-align: center; color: var(--oke-dim); }
.data-table tr.is-selected td { background: rgba(87, 215, 255, 0.07); }

/* ---------- 右侧抽屉 ---------- */
body.overlay-open { overflow: hidden; }
.overlay.drawer-overlay { justify-content: flex-end; align-items: stretch; padding: 0; }
.dialog.drawer {
  width: min(560px, 100vw); height: 100vh; max-height: 100vh;
  display: flex; flex-direction: column;
  border-radius: 0; border-right: 0; border-top: 0; border-bottom: 0;
  animation: drawer-in 0.22s var(--ease) both;
}
@keyframes drawer-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog.drawer .dialog-head {
  flex: none; padding: 16px 18px; border-bottom: 1px solid var(--oke-line-divider);
}
.dialog.drawer .dialog-body, .dialog.drawer .drawer-body {
  flex: 1; overflow: auto; padding: 16px 18px;
}
.dialog.drawer .dialog-foot, .dialog.drawer .drawer-foot {
  flex: none; position: sticky; bottom: 0; padding: 12px 18px;
  border-top: 1px solid var(--oke-line-divider); background: rgba(9, 6, 24, 0.96);
}
.drawer-step { margin-bottom: 18px; }
.drawer-step > h4 {
  margin: 0 0 8px; font-size: 12px; letter-spacing: 0.4px; color: var(--oke-dim); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.drawer-step > h4::before {
  content: attr(data-step); width: 18px; height: 18px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 11px;
  background: var(--oke-primary-soft); color: var(--oke-accent-ink);
}

/* ---------- 顶栏账号菜单 ---------- */
.user-menu { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px; cursor: pointer;
  border: 1px solid var(--oke-line-divider); border-radius: 999px;
  background: rgba(10, 7, 26, 0.6); color: var(--oke-text); font-size: 12.5px;
}
.user-chip:hover { border-color: rgba(87, 215, 255, 0.4); }
.user-avatar {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--oke-primary), var(--oke-violet));
  font-size: 11px; color: #fff;
}
.user-chip .chev { color: var(--oke-dim); font-size: 10px; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 148px; padding: 6px;
  border: 1px solid var(--oke-line-divider); border-radius: 10px;
  background: #0d0922; box-shadow: var(--shadow-pop);
}
.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 7px; background: transparent;
  color: var(--oke-text); font-size: 12.5px; cursor: pointer;
}
.menu-item:hover { background: rgba(84, 120, 220, 0.16); }
.menu-item.danger { color: var(--oke-bad); }

/* ---------- 侧栏组头 ---------- */
.nav-group-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 10px; margin: 6px 0 2px; border: 0; background: transparent;
  color: var(--oke-dim); font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase;
  cursor: pointer; border-radius: 7px;
}
.nav-group-head:hover { color: var(--oke-muted); background: rgba(120, 150, 255, 0.06); }
.nav-group-head .group-count { margin-left: auto; color: var(--oke-dim); letter-spacing: 0; }
.group-caret { color: var(--oke-dim); font-size: 10px; transition: transform 0.2s var(--ease); }
.nav-group.collapsed .group-caret { transform: rotate(-90deg); }
.nav-group-body { display: flex; flex-direction: column; gap: 2px; }
.nav-group.collapsed .nav-group-body { display: none; }

/* ---------- 反馈 ---------- */
.spinner {
  display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px;
  border: 1.6px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading { opacity: 0.75; cursor: progress; }
.field.has-error input, .field.has-error select, .field.has-error textarea {
  border-color: rgba(255, 107, 139, 0.7) !important; box-shadow: 0 0 0 3px rgba(255, 107, 139, 0.12);
}
.field-error { margin-top: 5px; color: var(--oke-bad); font-size: 12px; line-height: 1.5; }

/* ---------- 类型徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge.role { color: #9cc3ff; background: rgba(54, 110, 207, 0.16); border-color: rgba(54, 110, 207, 0.35); }
.badge.approval { color: #ffd98a; background: rgba(255, 200, 87, 0.12); border-color: rgba(255, 200, 87, 0.32); }
.badge.account { color: #7ef0c4; background: rgba(60, 224, 164, 0.12); border-color: rgba(60, 224, 164, 0.3); }
.badge.flow { color: #c9b6ff; background: rgba(139, 107, 255, 0.14); border-color: rgba(139, 107, 255, 0.34); }

/* ---------- 审计展开 ---------- */
.audit-detail td { background: rgba(6, 4, 18, 0.6); padding: 10px 14px 14px !important; height: auto !important; }
.audit-detail .kv { font-size: 12px; line-height: 1.8; color: var(--oke-muted); }
.audit-detail b { color: var(--oke-text); font-weight: 600; }

/* ---------- 审批流条件换行 ---------- */
.data-table td.cond { max-width: 420px; white-space: normal; line-height: 1.55; color: var(--oke-muted); }
.data-table td.cond b { color: var(--oke-text); font-weight: 600; }

@media (max-width: 900px) {
  .page-head { flex-direction: column; }
  .page-head .page-action { margin-left: 0; width: 100%; }
  .page-head .page-action .btn { flex: 1; }
  .filter-bar .result-count { display: none; }
  .dialog.drawer { width: 100vw; }
  .data-card .table-wrap { max-height: none; }
}

/* ---------- R5 nav/header fix ---------- */
/* legacy .nav-group was a row label; it is now the section container */
.nav-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0;
  font-size: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}
.nav-group::after { display: none; }
.nav-group-body { width: 100%; }
.nav-item { white-space: nowrap; }
.nav-item > span:not(.count):not(.dot) { overflow: hidden; text-overflow: ellipsis; }

/* 三级导航：企业智能工作台 > PMC中心 > 页面 */
.nav-subgroup {
  margin: 4px 0 2px;
  padding-left: 10px;
  border-left: 1px solid rgba(120, 150, 220, 0.16);
}
.nav-subgroup::after { display: none; }
.nav-subgroup .nav-group-head { height: 28px; font-size: 12px; color: var(--oke-muted); letter-spacing: 0.4px; }
.nav-subgroup .nav-item { padding-left: 14px; font-size: 12.5px; }
.nav-subgroup .nav-item.active { background: rgba(84, 120, 220, 0.14); }

/* PMC · AI 智能排产 */
.aps-load { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.aps-load-row { display: grid; grid-template-columns: 52px 1fr 56px; align-items: center; gap: 10px; }
.aps-load-day { font-size: 12px; color: var(--oke-muted); font-variant-numeric: tabular-nums; }
.aps-load-track { position: relative; height: 10px; border-radius: 999px; background: rgba(96, 130, 230, 0.1); overflow: hidden; }
.aps-load-track i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, rgba(87,215,255,.85), rgba(120,150,250,.85)); }
.aps-load-num { font-size: 12px; text-align: right; color: var(--oke-dim); font-variant-numeric: tabular-nums; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
.big .unit { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--oke-dim); }


.top .title-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  max-width: 52vw;
}
.top .title-block h1 {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
  white-space: nowrap;
}
.top .title-block .crumb {
  font-size: 11px;
  letter-spacing: 0.2px;
  text-transform: none;
  color: var(--oke-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* legacy .user-chip was a stacked block; the pill rule must win */
.user-chip {
  flex-direction: row;
  min-width: 0;
  border: 1px solid var(--oke-line-divider);
  padding: 0 10px;
}
.user-chip span { font-size: 12.5px; letter-spacing: 0; color: var(--oke-text); }
.user-chip .chev { color: var(--oke-dim); font-size: 10px; }

/* t36: four row actions must stay on one line */
.data-table td.row-actions { flex-wrap: nowrap; }
.data-table td.actions { white-space: nowrap; }

/* 侧栏可读性：分组标题与条目提亮一档 */
.side .nav-group-head { color: #b9c7e6; font-weight: 600; }
.side .nav-group-head .group-count { color: #94a6cc; }
.side .nav-item { color: #dbe3f6; font-weight: 500; }
.side .nav-item .count { color: #a9b8d8; }
.side .nav-subgroup .nav-group-head { color: #cdd8f0; }
.side .nav-subgroup .nav-item { color: #e6ecfb; }
.side .nav-item:hover { color: #ffffff; }
.side .nav-item.active { color: #ffffff; }
.side .side-label { color: #a9b8d8; }

/* 数据中心 */
.dc-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 10px; }
.dc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--oke-radius-sm); background: rgba(96, 130, 230, 0.06); }
.dc-main { flex: 1; font-size: 13px; color: var(--oke-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-sub { font-size: 11px; color: var(--oke-dim); }

/* ---------------- 数据中心 · 订单数据获取 ---------------- */
.aw-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.aw-form .field { flex: 1; min-width: 240px; max-width: 360px; margin: 0; }
.aw-form .btn { height: 36px; padding: 0 20px; }
.aw-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.aw-order-tags { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.aw-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--oke-line-hair); color: var(--oke-dim); font-size: 12px; }
.aw-meta b { margin-left: 6px; color: var(--oke-text); font-weight: 600; }
.aw-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(120, 150, 220, 0.22); background: rgba(255, 255, 255, 0.02); color: var(--oke-muted); font-size: 12px; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.chip span { color: var(--oke-dim); font-size: 11px; }
.chip:hover { border-color: rgba(87, 215, 255, 0.35); color: var(--oke-text); }
.chip.active { border-color: rgba(87, 215, 255, 0.55); background: rgba(87, 215, 255, 0.1); color: #eaf4ff; }
.link { color: var(--oke-accent); text-decoration: none; font-size: 12px; border-bottom: 1px dashed rgba(87, 215, 255, 0.35); }
.link:hover { color: #ffffff; }

/* 订单数据获取 · 紧凑统计条 */
.aw-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: rgba(120, 150, 220, 0.12); border-radius: 14px; overflow: hidden; }
.aw-stat { display: flex; flex-direction: column; gap: 2px; padding: 9px 14px 10px; background: rgba(16, 20, 44, 0.92); }
.aw-stat-label { color: var(--oke-dim); font-size: 11px; letter-spacing: .04em; }
.aw-stat b { color: var(--oke-text); font-size: 19px; font-weight: 650; line-height: 1.15; }
.aw-stat b i { margin-left: 4px; color: var(--oke-dim); font-size: 11px; font-style: normal; font-weight: 500; }
.aw-stat-foot { color: var(--oke-dim); font-size: 10px; }
@media (max-width: 1200px) { .aw-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .aw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 订单数据获取 · 明细表：单行不折行，横向滚动 */
.aw-table th, .aw-table td { white-space: nowrap; }
.aw-table td:nth-child(4) { white-space: normal; min-width: 120px; }

/* 订单数据获取 · 口径提示 */
.aw-note { margin: 10px 0 4px; padding: 8px 12px; border-radius: var(--oke-radius-sm);
  background: rgba(87, 215, 255, .06); border: 1px solid rgba(87, 215, 255, .18);
  color: var(--oke-text-xs); line-height: 1.6; color: #cfe2ff; }

/* 订单数据获取 · 柜体筛选宽度 */
#aw-cabinet { min-width: 190px; max-width: 280px; }

/* 订单数据获取 · 统计条支持 7 项 */
.aw-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

/* 订单明细 · 表头筛选行 */
.aw-filter-row th { padding: 3px 6px; background: rgba(12, 20, 44, 0.72); }
.aw-filter-row input.aw-filter,
.aw-filter-row input.aw-dfilter {
  width: 100%; min-width: 56px; height: 26px; padding: 0 6px; font-size: 12px;
  border-radius: 6px; border: 1px solid rgba(120, 150, 220, 0.22);
  background: rgba(8, 14, 32, 0.7); color: var(--text);
}
.aw-filter-row input::placeholder { color: rgba(160, 178, 214, 0.55); }

/* 整单明细：近全屏宽弹窗，17 列一屏可见 */
.dialog.full { width: min(1800px, 98vw); max-height: 92vh; overflow: auto; }
.dialog.full .aw-table th,
.dialog.full .aw-table td { padding: 0 6px; font-size: 11.5px; }
.dialog.full .aw-table thead th { height: 30px; }
.dialog.full .table-wrap { border-radius: 10px; }

/* 明细弹窗 · 数量对账区块 */
.aw-acc { margin-top: 14px; border-top: 1px solid var(--oke-line-hair, rgba(255,255,255,.08)); padding-top: 12px; }
.aw-acc .card-title { margin-bottom: 6px; }
.aw-acc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.aw-acc .table-wrap { margin-top: 8px; }

/* ============================================================
   贵族蓝工业科技 SaaS 主题层（纯 CSS 覆盖，不动结构与文案）
   ============================================================ */
:root {
  --noble-blue-bg: #061530;
  --gem-blue-card: rgba(16, 40, 82, 0.62);
  --ice-blue-glow: rgba(96, 182, 255, 0.42);
  --cyan-border: rgba(110, 196, 255, 0.36);
  --nb-text-1: #eef5ff;
  --nb-text-2: #c2d8f5;
  --nb-text-3: #8fadcd;
}

body {
  background:
    radial-gradient(circle, rgba(160, 215, 255, 0.45) 1px, transparent 1.6px) 0 0 / 180px 160px,
    repeating-linear-gradient(0deg, rgba(140, 200, 255, 0.03) 0 1px, transparent 1px 4px),
    linear-gradient(rgba(120, 190, 255, 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(120, 190, 255, 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(1100px 560px at 16% -12%, rgba(34, 100, 186, 0.34) 0%, transparent 60%),
    radial-gradient(820px 460px at 92% -8%, rgba(18, 64, 130, 0.28) 0%, transparent 56%),
    linear-gradient(160deg, #061530 0%, #0a2350 42%, #08203f 74%, #061630 100%);
  background-attachment: fixed;
  color: var(--nb-text-2);
}

/* 伪元素留给玻璃高光，避免和背景网格打架 */
body::before, body::after { background-image: none; opacity: 0; }

/* 侧栏：深蓝半透明 + 冷蓝选中 */
.side {
  background: linear-gradient(180deg, rgba(10, 32, 68, 0.94) 0%, rgba(7, 22, 48, 0.9) 100%);
  border-right: 1px solid rgba(110, 196, 255, 0.16);
  backdrop-filter: blur(14px) saturate(1.05);
}
.brand-name { color: var(--nb-text-1); }
.nav-group-head, .side .nav-group-head { color: #a9c6ea; }
.side .nav-item { color: #cfe0f7; }
.side .nav-item:hover { background: rgba(64, 120, 200, 0.16); color: #ffffff; }
.side .nav-item.active {
  background: linear-gradient(90deg, rgba(64, 158, 255, 0.24) 0%, rgba(64, 158, 255, 0.04) 100%);
  box-shadow: inset 2px 0 0 #55b0ff, 0 0 18px rgba(64, 158, 255, 0.16);
  color: #ffffff;
}

/* 顶栏 */
.top {
  background: rgba(8, 24, 52, 0.72);
  border-bottom: 1px solid rgba(110, 196, 255, 0.14);
  backdrop-filter: blur(12px);
}
#page-title { color: var(--nb-text-1); }

/* 玻璃卡片 + 冰蓝发光边（含 #view 下唯一卡片的高特异度覆盖） */
.card,
#view > .card:only-child,
#view:has(.settings-hero) .card {
  background: linear-gradient(180deg, rgba(28, 66, 122, 0.72) 0%, rgba(15, 40, 82, 0.64) 100%);
  border: 1px solid rgba(120, 200, 255, 0.45);
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(70, 150, 240, 0.26),
    0 0 22px rgba(70, 170, 255, 0.22),
    0 18px 42px rgba(2, 10, 28, 0.45),
    inset 0 1px 0 rgba(180, 225, 255, 0.12);
  backdrop-filter: blur(12px) saturate(1.06);
}
.card-head { border-bottom-color: rgba(110, 196, 255, 0.12); }
.card-title { color: var(--nb-text-1); }
.card-hint, .hint, .sub { color: var(--nb-text-3); }

/* 输入框：深蓝透明底、focus 冰蓝发光 */
.input, input[type="text"], input[type="search"], input[type="password"], select, textarea {
  background: rgba(9, 26, 54, 0.72);
  border: 1px solid rgba(110, 196, 255, 0.26);
  color: var(--nb-text-1);
  border-radius: 10px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #6fc3ff;
  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.16), 0 0 14px rgba(80, 180, 255, 0.32);
}
::placeholder { color: rgba(150, 180, 215, 0.6); }

/* 按钮 */
.btn {
  background: linear-gradient(180deg, #4189ea 0%, #2a63c6 100%);
  border: 1px solid rgba(150, 210, 255, 0.42);
  color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(64, 158, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn:hover { background: linear-gradient(180deg, #4f96f2 0%, #2f6ed4 100%); box-shadow: 0 0 18px rgba(80, 170, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn.ghost {
  background: rgba(26, 52, 94, 0.62);
  border-color: rgba(120, 180, 255, 0.3);
  color: var(--nb-text-2);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(34, 66, 116, 0.72); color: #fff; }
.btn.danger { background: linear-gradient(180deg, rgba(150, 40, 70, 0.9), rgba(104, 22, 46, 0.92)); border-color: rgba(255, 120, 150, 0.42); }

/* 状态胶囊：低饱和 */
.badge { border: 1px solid rgba(110, 196, 255, 0.24); background: rgba(40, 90, 160, 0.24); color: #b7d8ff; }
.badge.account { background: rgba(40, 150, 118, 0.18); border-color: rgba(80, 200, 160, 0.35); color: #86e3bd; }
.badge.role { background: rgba(60, 110, 190, 0.22); border-color: rgba(120, 180, 255, 0.3); color: #b7d3f8; }
.badge.approval { background: rgba(190, 140, 40, 0.16); border-color: rgba(230, 180, 80, 0.32); color: #f0cf8c; }

/* 表格 */
.data-table th { background: rgba(12, 32, 64, 0.9); color: #a9c6ea; border-bottom-color: rgba(110, 196, 255, 0.16); }
.data-table td { border-bottom-color: rgba(110, 196, 255, 0.08); color: var(--nb-text-2); }
.data-table tr:hover td { background: rgba(64, 130, 210, 0.1); }
.mono { color: #cfe6ff; }

/* 玻璃浮层 */
.overlay { background: rgba(4, 14, 32, 0.66); backdrop-filter: blur(6px); }
.dialog, .drawer {
  background: linear-gradient(180deg, rgba(18, 44, 86, 0.96) 0%, rgba(9, 26, 54, 0.97) 100%);
  border: 1px solid rgba(110, 196, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(40, 110, 200, 0.2), 0 0 24px rgba(64, 158, 255, 0.16), 0 30px 70px rgba(2, 8, 22, 0.6);
}

/* 空状态 */
.empty { color: var(--nb-text-3); border-color: rgba(110, 196, 255, 0.18); }

/* 搜索框 */
.search { background: rgba(9, 26, 54, 0.7); border: 1px solid rgba(110, 196, 255, 0.22); border-radius: 10px; }
.search input { background: transparent; border: none; box-shadow: none; }




/* 指挥带与主题统一 */
.deck {
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(70, 150, 240, 0.18), transparent 65%),
    linear-gradient(135deg, rgba(22, 58, 110, 0.74) 0%, rgba(10, 30, 62, 0.72) 100%);
  border: 1px solid rgba(110, 196, 255, 0.28);
  box-shadow: 0 0 18px rgba(64, 158, 255, 0.14), inset 0 1px 0 rgba(180, 225, 255, 0.08);
}
.deck-eyebrow { color: #8fb6df; }
/* 明细弹窗：两行表头吸顶，滚动时不跟着走 */
.dialog .table-wrap { overflow: auto; }
.dialog .table-wrap thead th {
  position: sticky; top: 0; z-index: 3;
  background: rgba(10, 28, 60, 0.98);
  box-shadow: inset 0 -1px 0 rgba(110, 196, 255, 0.18);
}
.dialog .table-wrap thead tr.aw-filter-row th { top: 33px; z-index: 2; }

/* 工艺配置弹窗 */
.craft-body { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.craft-table { max-height: 300px; }
.craft-form { border-top: 1px solid rgba(120, 200, 255, 0.18); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.craft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.craft-actions { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.craft-preview { border-top: 1px dashed rgba(120, 200, 255, 0.2); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { .craft-grid { grid-template-columns: minmax(0, 1fr); } }

/* 工艺配置 · 条件构建器 */
.craft-cond-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; font-size: 12px; color: var(--oke-muted, #93a3bd); }
.craft-conds { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.craft-cond { display: grid; grid-template-columns: 180px 150px minmax(160px, 1fr) auto; gap: 8px; align-items: center; }
.craft-cond select, .craft-cond input { width: 100%; }
.craft-value { display: flex; align-items: center; gap: 8px; min-width: 0; }
.craft-value input[type='file'] { max-width: 260px; }
@media (max-width: 900px) { .craft-cond { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* 工艺条件行控件配色（避免浏览器默认浅底） */
.craft-cond select, .craft-cond input[type='text'], .craft-cond input:not([type]) {
  background: rgba(9, 26, 52, 0.66) !important;
  color: #e7eefc !important;
  border: 1px solid rgba(120, 200, 255, 0.24) !important;
  height: 32px;
  border-radius: 8px;
  padding: 0 10px;
}
.aw-craft { min-width: 96px; white-space: nowrap; }
body .badge.locked { background: rgba(255, 190, 92, 0.16); color: #ffcf80; border: 1px solid rgba(255, 190, 92, 0.35); }
