/* ============================================================
   运营管理平台 · 紫色主题 V6.1（基于 base.css 的 ops 双框架变体）
   品牌色：紫红 #8A2B6B + 浅紫粉背景 + 与应用端蓝色完全独立
   ============================================================ */
@import url('./mdi-icon-font.css');
:root {
  /* —— 主色：紫 —— */
  --brand:        #8A2B6B;
  --brand-hover:  #A33880;
  --brand-active: #6B1F52;
  --brand-deep:   #4A1438;
  --brand-600:    #8A2B6B;
  --brand-500:    #A33880;
  --brand-300:    #DCC3D2;
  --brand-200:    #DCC3D2;
  --brand-100:    #E8D5DF;
  --brand-50:     #F5E6F0;
  --brand-25:     #FAF5F8;

  /* —— 辅色（图表数据色阶，6 色）—— */
  --c1: #8A2B6B; /* 钢蓝 */
  --c2: #06B6A4; /* 青绿 */
  --c3: #8B5CF6; /* 紫罗兰 */
  --c4: #F59E0B; /* 琥珀 */
  --c5: #EF476F; /* 玫红 */
  --c6: #64748B; /* 石墨 */
  --c7: #0EA5E9; /* 天青 */
  --c8: #10B981; /* 翠绿 */

  /* —— 语义色 —— */
  --success: #16A34A;
  --success-50: #E7F6EC;
  --warning: #F59E0B;
  --warning-50: #FEF4E2;
  --danger:  #EF4444;
  --danger-50: #FEECEC;
  --info:    #8A2B6B;
  --info-50: #F5E6F0;

  /* —— 文字 —— */
  --ink-1:  #0F1A33;
  --ink-2:  #3A4A66;
  --ink-3:  #7587A6;
  --ink-4:  #A4B3CC;
  --ink-5:  #C5D0E0;
  --ink-inv: #FFFFFF;

  /* —— 背景与分隔 —— */
  --bg-app:   #F4F7FC;  /* 一点点淡蓝 */
  --bg-app-2: #EEF2F9;
  --bg-card:  #FFFFFF;
  --bg-soft:  #F8FAFD;
  --bg-hover: #F2F5FB;
  --bg-active:#E9EFFB;
  --line-1: #E6EBF2;
  --line-2: #D5DEEC;
  --line-3: #C0CCE0;

  /* —— 形状（V4 略增圆润） —— */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl:24px;

  /* —— 阴影（柔和）—— */
  --shadow-xs: 0 1px 0 rgba(18,38,77,.04);
  --shadow-sm: 0 1px 2px rgba(18,38,77,.06), 0 1px 1px rgba(18,38,77,.03);
  --shadow:    0 2px 6px rgba(18,38,77,.07), 0 1px 2px rgba(18,38,77,.04);
  --shadow-md: 0 6px 16px rgba(18,38,77,.08), 0 2px 6px rgba(18,38,77,.04);
  --shadow-lg: 0 12px 32px rgba(18,38,77,.10), 0 4px 12px rgba(18,38,77,.05);
  --shadow-xl: 0 24px 48px rgba(18,38,77,.14);
  --shadow-blue: 0 8px 20px rgba(138,43,107,.18);
  --shadow-blue-sm: 0 2px 8px rgba(138,43,107,.14);

  /* —— 尺寸（V4 舒适密度，+4px）—— */
  --header-h: 56px;
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 60px;
  --tab-h: 40px;
  --row-h: 36px;
  --input-h: 36px;
  --input-h-sm: 30px;
  --input-h-lg: 42px;
  --btn-h: 36px;
  --btn-h-sm: 30px;
  --btn-h-xs: 24px;
  --btn-h-lg: 42px;
  /* 字号 */
  --fs-xs:  11.5px;
  --fs-sm:  12.5px;
  --fs:     14px;
  --fs-md:  15px;
  --fs-lg:  16px;
  --fs-xl:  18px;
  --fs-2xl: 22px;
  --fs-kpi: 30px;
  /* 过渡 */
  --ease:  cubic-bezier(.22,.82,.36,1);
  --ease-in: cubic-bezier(.4,0,.2,1);

  /* —— 字体 —— */
  --font-sans: "Inter","PingFang SC","HarmonyOS Sans","Microsoft YaHei","Source Han Sans CN",-apple-system,system-ui,sans-serif;
  --font-mono: "JetBrains Mono","Fira Code","Cascadia Code","SF Mono",Consolas,monospace;
  --font-num:  "DIN Alternate","DIN Pro","Inter",var(--font-mono);

  /* —— 间距 token (M4) —— */
  --gap-card:    12px;   /* 模块（卡片）间隔 */
  --gap-section: 18px;   /* 大区块间隔 */
  --gap-page:    14px;   /* 页面 padding */

  /* ===== v6.5 间距与圆角令牌（紫色主题保留，仅同步间距 token） ===== */
  --gap-page: 16px;        /* 页面四周外边距 */
  --gap-card: 14px;        /* 卡片之间间距 */
  --gap-section: 20px;     /* 大区段之间 */
  --gap-tight: 8px;        /* 紧凑区域 */
  --pad-card: 16px;        /* 卡片内边距 */
  --pad-card-lg: 18px;
  --radius-card: 12px;
  --radius-sm: 8px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  font-family: var(--font-sans);
  color: var(--ink-1);
  background: var(--bg-app);
  font-size: var(--fs);
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: .01em;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-hover); }
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 600; }

/* V4 滚动条：默认透明、悬浮时浮现、7px 细 */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover { scrollbar-color: rgba(117,135,166,.35) transparent; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 10px; border: 2px solid transparent;
  background-clip: padding-box;
  transition: background .2s;
}
*:hover::-webkit-scrollbar-thumb { background: rgba(146,160,188,.32); background-clip: padding-box; }
*:hover::-webkit-scrollbar-thumb:hover { background: rgba(102,120,156,.55); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Hoverable 通用悬浮效果 */
.hoverable { transition: background .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease); }
.hoverable:hover { background: var(--bg-hover); box-shadow: var(--shadow-sm); }
.lift:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.lift { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }

/* 页面淡入 */
.inner-page { animation: pageFadeIn .3s var(--ease); }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* 内页次级目录（sticky 不消失） */
.page-inner-nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  border-bottom: 1px solid var(--line-1);
  padding: 8px 14px; margin: -14px -14px 12px;
  display: flex; align-items: center; gap: 10px;
}
.page-inner-nav.floating { border-radius: 0 0 12px 12px; box-shadow: var(--shadow-sm); }

/* ============================================================
   Layout
   ============================================================ */
.app-shell { display:flex; height:100vh; overflow:hidden; background: var(--bg-app); }

/* ---- Sidebar（改白，淡蓝渐变顶部）---- */
.sidebar {
  width: var(--sidebar-w);
  background:
    linear-gradient(180deg, #F5F9FF 0%, #FFFFFF 140px),
    #FFFFFF;
  color: var(--ink-2);
  flex-shrink: 0;
  transition: width .24s cubic-bezier(.22,.82,.36,1);
  display: flex; flex-direction: column;
  position: relative; z-index: 20;
  border-right: 1px solid var(--line-1);
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar .logo {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  font-weight: 700; letter-spacing: .3px;
  color: var(--ink-1); font-size: 14px;
  border-bottom: 1px solid var(--line-1);
  background: #FFFFFF;
}
.sidebar .logo .logo-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--c7) 100%);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 10px rgba(138,43,107,.28);
  flex-shrink: 0;
}
.sidebar .logo .logo-icon iconify-icon { color:#fff; }
.sidebar.collapsed .logo-text { display: none; }
.sidebar.collapsed .logo { justify-content: center; padding: 0; }

.sidebar .menu-wrap { flex:1; overflow-y:auto; padding: 6px 0 20px; }
.sidebar .menu-wrap::-webkit-scrollbar-thumb { background: #D5DEEC; background-clip: padding-box; border: 2px solid transparent; }

.menu-group-title {
  padding: 12px 20px 4px;
  font-size: 11px; letter-spacing: 1.2px;
  color: var(--ink-4); font-weight: 600;
  text-transform: uppercase;
}
.sidebar.collapsed .menu-group-title {
  padding: 14px 0 4px; text-align:center; letter-spacing: 0;
  font-size:10px;
}
.sidebar.collapsed .menu-group-title span { display:none; }
.sidebar.collapsed .menu-group-title::after { content:'•'; color: var(--ink-4); }

.menu-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 0 18px; height: var(--row-h); cursor: pointer;
  color: var(--ink-2); font-size: var(--fs);
  transition: all .16s var(--ease); user-select: none;
  border-radius: 0;
}
.menu-item .iconify-icon,
.menu-item iconify-icon { font-size: 17px; flex-shrink: 0; color: var(--ink-3); transition: color .14s; }
.menu-item:hover { background: var(--bg-hover); color: var(--ink-1); padding-left: 20px; }
.menu-item:hover iconify-icon { color: var(--brand); }
.menu-item.active {
  color: var(--brand); background: var(--brand-50); font-weight: 500;
}
.menu-item.active iconify-icon { color: var(--brand); }
.menu-item.active::before {
  content:''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  background: var(--brand); border-radius: 0 3px 3px 0;
}
.menu-item .label { flex:1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item .chev {
  margin-left: auto; transition: transform .2s;
  font-size: 12px; opacity: .55;
}
.menu-item.open .chev { transform: rotate(90deg); color: var(--brand); opacity: 1; }

.sidebar.collapsed .menu-item { justify-content: center; padding: 0; }
.sidebar.collapsed .menu-item .label,
.sidebar.collapsed .menu-item .chev { display: none; }
.sidebar.collapsed .submenu { display: none !important; }

.submenu {
  overflow: hidden; max-height: 0;
  transition: max-height .28s cubic-bezier(.22,.82,.36,1);
  background: transparent;
}
.menu-item.open + .submenu { max-height: 1200px; }
.submenu .menu-item { padding-left: 44px; font-size: var(--fs-sm); color: var(--ink-2); height: 32px; }
.submenu .menu-item:hover { padding-left: 46px; }
.submenu .menu-item iconify-icon { display: inline-flex; font-size: 14px; opacity: .9; flex-shrink: 0; }
.submenu .menu-item.active { background: var(--brand-50); color: var(--brand); }
.submenu .menu-item.active::before { display: none; }
.submenu .menu-item::after {
  content:''; position: absolute; left: 22px; top: 50%; width: 4px; height: 4px;
  background: var(--ink-5); border-radius: 50%; transform: translateY(-50%);
  transition: background .14s;
}
.submenu .menu-item.active::after,
.submenu .menu-item:hover::after { background: var(--brand); }
.submenu .submenu .menu-item { padding-left: 62px; font-size: var(--fs-sm); height: 30px; }
.submenu .submenu .menu-item:hover { padding-left: 64px; }
.submenu .submenu .menu-item::after { left: 46px; }

.sidebar-collapse-btn {
  height: 36px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); cursor: pointer;
  border-top: 1px solid var(--line-1);
  transition: background .18s;
}
.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--brand); }

/* ---- Main ---- */
.main-wrap { flex:1; display:flex; flex-direction:column; min-width:0; background: var(--bg-app); }

.topbar {
  height: var(--header-h); background: #fff;
  border-bottom: 1px solid var(--line-1);
  display:flex; align-items:center; padding: 0 16px; gap: 14px;
  flex-shrink: 0;
  position: relative; z-index: 10;
}
.breadcrumb { color: var(--ink-3); font-size: var(--fs); display:flex; align-items:center; gap:7px; }
.breadcrumb .sep { color: var(--ink-5); font-size: var(--fs-sm); }
.breadcrumb .crumb { transition: color .14s; }
.breadcrumb .crumb:hover { color: var(--brand); cursor:pointer; }
.breadcrumb .current { color: var(--ink-1); font-weight: 500; }

.topbar-search { flex:1; max-width: 420px; position: relative; }
.topbar-search input {
  width: 100%; height: 34px;
  border: 1px solid var(--line-1); border-radius: 8px;
  padding: 0 12px 0 32px; background: var(--bg-app);
  font-size: var(--fs-sm); transition: all .18s var(--ease);
}
.topbar-search input:focus {
  outline:none; border-color: var(--brand);
  background: #fff; box-shadow: 0 0 0 3px rgba(138,43,107,.12);
}
.topbar-search .ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-4); }
.topbar-search .kbd {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 18px; padding: 0 5px;
  background: var(--bg-app); border: 1px solid var(--line-1);
  border-radius: 3px; font-size: 10px; color: var(--ink-3);
  display:flex; align-items:center;
}

.topbar-actions { display:flex; align-items:center; gap:2px; margin-left: auto; }
.tb-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-3); cursor: pointer; position: relative;
  transition: all .16s var(--ease);
  font-size: 17px;
}
.tb-btn:hover { background: var(--bg-hover); color: var(--brand); box-shadow: var(--shadow-sm); }
.tb-btn .badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 13px; height: 13px; padding: 0 3px;
  font-size: 9.5px; border-radius: 7px;
  background: var(--danger); color: #fff; line-height: 13px; text-align: center;
  border: 1.5px solid #fff;
  font-weight: 600;
}
.tb-divider { width: 1px; height: 18px; background: var(--line-1); margin: 0 6px; }

.tb-user { display:flex; align-items:center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 20px; cursor: pointer; transition: background .14s; }
.tb-user:hover { background: var(--bg-hover); }
.tb-user .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--c3) 100%);
  color: #fff; display:grid; place-items:center;
  font-size: 11.5px; font-weight: 600; flex-shrink:0;
}
.tb-user .nm { font-size: 12.5px; color: var(--ink-1); line-height: 1.2; }
.tb-user .rl { font-size: 10.5px; color: var(--ink-3); line-height: 1.2; }

/* ---- 顶部 Tab（多页签）---- */
.tabs-bar {
  height: var(--tab-h); background: #fff;
  border-bottom: 1px solid var(--line-1);
  display: flex; align-items: center; padding: 0 8px; gap: 2px;
  flex-shrink: 0; overflow-x: auto; scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-chip {
  height: 30px; padding: 0 10px 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 6px;
  font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer;
  border: 1px solid transparent; transition: all .18s var(--ease); white-space: nowrap;
  user-select: none; position: relative;
}
.tab-chip:hover { background: var(--bg-hover); color: var(--ink-1); box-shadow: var(--shadow-xs); }
.tab-chip.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.tab-chip.active::after {
  content:''; position: absolute; left: 8px; right: 8px; bottom: 1px; height: 2px;
  background: var(--brand); border-radius: 1px;
}
.tab-chip iconify-icon { font-size: 14px; }
.tab-chip .close {
  margin-left: 2px; width: 16px; height: 16px;
  display: grid; place-items: center; border-radius: 4px;
  color: var(--ink-4); transition: all .12s; font-size: 11px;
}
.tab-chip .close:hover { background: rgba(239,68,68,.12); color: var(--danger); }
.tab-chip.pinned .close { display: none; }
.tab-chip.pinned::before {
  content:''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--brand); margin-right: 2px;
}

/* ---- Content 区 ---- */
.content { flex: 1; overflow: auto; padding: 14px; background: var(--bg-app); }
.content.no-pad { padding: 0; }
.content-inner { display: flex; flex-direction: column; gap: 12px; }

/* ============================================================
   Cards / 面板
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card-hover { transition: all .18s; }
.card-hover:hover {
  border-color: var(--brand-100);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-1);
  min-height: 46px;
  background: #FDFEFF;
}
.card-title { font-weight: 600; font-size: var(--fs-md); color: var(--ink-1); display:flex; align-items:center; gap:7px; }
.card-title::before {
  content:''; width: 3px; height: 12px;
  background: linear-gradient(180deg, var(--brand), var(--c7));
  border-radius: 1.5px;
}
.card-title.no-bar::before { display: none; }
.card-desc { font-size: var(--fs-sm); color: var(--ink-3); margin-left: auto; }
.card-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px; }
.card-body.no-pad { padding: 0; }
.card-footer {
  padding: 10px 14px; border-top: 1px solid var(--line-1);
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft);
}

/* KPI Card V4（带图标头 + 渐变底 + 左色条）*/
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
  transition: all .22s var(--ease);
  min-height: 108px;
}
.kpi::before {
  content:''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 45%, var(--kpi-tint, rgba(138,43,107,.04)) 100%);
  pointer-events: none; opacity: 1; transition: opacity .22s;
}
.kpi:hover {
  border-color: var(--brand-100); box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi .kpi-head { display:flex; align-items:center; gap:8px; }
.kpi .kpi-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--kpi-color, var(--brand));
  background: var(--kpi-bg, var(--brand-50));
  font-size: 17px; flex-shrink: 0;
}
.kpi .kpi-label {
  font-size: var(--fs-sm); color: var(--ink-3);
  display: flex; align-items: center; gap: 4px;
  font-weight: 500;
}
.kpi .kpi-label .ic { color: var(--kpi-color, var(--brand)); }
.kpi .kpi-value {
  font-family: var(--font-num);
  font-size: var(--fs-kpi); font-weight: 700; color: var(--ink-1);
  letter-spacing: -.02em; line-height: 1.15;
  display: flex; align-items: baseline; gap: 4px;
}
.kpi .kpi-value .unit { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.kpi .kpi-trend { font-size: 12px; display:flex; align-items:center; gap:3px; }
.kpi .kpi-trend.up   { color: var(--success); }
.kpi .kpi-trend.down { color: var(--danger); }
.kpi .kpi-trend.flat { color: var(--ink-3); }
.kpi .kpi-spark { position: absolute; right: 0; bottom: 0; width: 70%; height: 40px; opacity: .9; pointer-events: none; }
.kpi.is-danger,
.kpi.is-warning,
.kpi.is-success,
.kpi.is-info,
.kpi.is-purple,
.kpi.is-cyan {
  position: relative;
}
.kpi.is-danger::after,
.kpi.is-warning::after,
.kpi.is-success::after,
.kpi.is-info::after,
.kpi.is-purple::after,
.kpi.is-cyan::after {
  content:''; position: absolute; inset: 0 auto 0 0; width: 3px; border-radius: 3px 0 0 3px;
  background: var(--kpi-color, var(--brand));
}
.kpi.is-info     { --kpi-color: var(--brand);   --kpi-bg: var(--brand-50);   --kpi-tint: rgba(138,43,107,.06); }
.kpi.is-success  { --kpi-color: var(--success); --kpi-bg: var(--success-50); --kpi-tint: rgba(22,163,74,.07); }
.kpi.is-warning  { --kpi-color: #B76E00;        --kpi-bg: var(--warning-50); --kpi-tint: rgba(245,158,11,.08); }
.kpi.is-danger   { --kpi-color: var(--danger);  --kpi-bg: var(--danger-50);  --kpi-tint: rgba(239,68,68,.07); }
.kpi.is-purple   { --kpi-color: var(--c3);      --kpi-bg: #F3EEFE;           --kpi-tint: rgba(139,92,246,.07); }
.kpi.is-cyan     { --kpi-color: #06897B;        --kpi-bg: #E0F4F6;           --kpi-tint: rgba(6,182,164,.07); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: var(--btn-h); padding: 0 14px; font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-1);
  cursor: pointer; transition: all .16s var(--ease);
  white-space: nowrap; font-weight: 500;
}
.btn:hover {
  border-color: var(--brand); color: var(--brand); background: var(--brand-25);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn iconify-icon { font-size: 16px; }

.btn-primary {
  background: linear-gradient(180deg, #A33880 0%, var(--brand) 100%);
  border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(138,43,107,.2);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #4D83F5 0%, #A33880 100%);
  border-color: var(--brand-hover); color: #fff;
  box-shadow: 0 4px 12px rgba(138,43,107,.28);
}

.btn-secondary { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand); }
.btn-secondary:hover { background: var(--brand-100); border-color: var(--brand-300); color: var(--brand-deep); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-50); color: var(--brand); }

.btn-text { border-color: transparent; background: transparent; color: var(--ink-2); padding: 0 8px; }
.btn-text:hover { background: var(--bg-hover); color: var(--brand); }

.btn-danger { color: var(--danger); border-color: var(--line-2); background: #fff; }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-50); color: var(--danger); }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #138a3f; color:#fff; border-color:#138a3f; }

.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover { background: #D98808; color:#fff; border-color:#D98808; }

.btn-sm { height: var(--btn-h-sm); padding: 0 12px; font-size: var(--fs-sm); }
.btn-sm iconify-icon { font-size: 14px; }
.btn-xs { height: var(--btn-h-xs); padding: 0 9px; font-size: var(--fs-xs); border-radius: 5px; gap: 3px; }
.btn-xs iconify-icon { font-size: 13px; }
.btn-lg { height: var(--btn-h-lg); padding: 0 20px; font-size: var(--fs-md); }

.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[disabled]:hover { border-color: var(--line-2); color: var(--ink-3); background:#fff; box-shadow:none; transform:none; }

.btn-icon { width: var(--btn-h); padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: var(--btn-h-sm); }
.btn-icon.btn-xs { width: var(--btn-h-xs); }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.btn-group .btn:last-child  { border-radius: 0 6px 6px 0; }
.btn-group .btn.active { background: var(--brand-50); border-color: var(--brand); color: var(--brand); z-index: 1; }

/* ============================================================
   Tags / Status
   ============================================================ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 8px; height: 22px;
  border-radius: 4px; font-size: var(--fs-xs);
  background: var(--bg-app-2); color: var(--ink-2);
  border: 1px solid transparent; font-weight: 500;
  white-space: nowrap;
}
.tag-brand   { background: var(--brand-50); color: var(--brand); }
.tag-success { background: var(--success-50); color: var(--success); }
.tag-warning { background: var(--warning-50); color: #B76E00; }
.tag-danger  { background: var(--danger-50); color: var(--danger); }
.tag-info    { background: var(--info-50); color: var(--brand); }
.tag-purple  { background: #F3EEFE; color: var(--c3); }
.tag-cyan    { background: #E0F4F6; color: #06897B; }
.tag-pink    { background: #FDECEF; color: var(--c5); }
.tag-gray    { background: var(--bg-app-2); color: var(--ink-3); }
.tag-dot::before { content:''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag-outlined { background: transparent; border-color: currentColor; }
.tag-lg { height: 26px; padding: 0 10px; font-size: var(--fs-sm); }
.tag-sm { height: 18px; padding: 0 6px; font-size: 10.5px; }

.status { display:inline-flex; align-items:center; gap: 6px; font-size: 12px; }
.status::before {
  content:''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}
.status-running { color: var(--success); }
.status-running::before { animation: dotPulse 1.6s infinite; }
.status-success { color: var(--success); }
.status-failed  { color: var(--danger); }
.status-waiting { color: var(--warning); }
.status-idle    { color: var(--ink-3); }
.status-paused  { color: var(--ink-3); }

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 35%, transparent); }
  50%      { box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 0%, transparent); }
}

/* ============================================================
   Forms / Inputs
   ============================================================ */
.form-row { display:flex; align-items:flex-start; gap: 10px; margin-bottom: 14px; }
.form-row.horizontal { align-items: center; }
.form-row .form-label { padding-top: 9px; }
.form-row.horizontal .form-label { padding-top: 0; }
.form-row .form-ctrl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.form-label { min-width: 110px; font-size: var(--fs-sm); color: var(--ink-2); text-align: right; font-weight: 500; }
.form-label.req::before { content:'*'; color: var(--danger); margin-right: 3px; }
.form-group { margin-bottom: 18px; }
.form-group-title { font-size: var(--fs-md); font-weight: 600; color: var(--ink-1); margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--line-1); display:flex; align-items:center; gap:6px; }
.form-group-title::before { content:''; width: 3px; height: 14px; background: linear-gradient(180deg, var(--brand), var(--c7)); border-radius: 2px; }

.input, .select, .textarea {
  height: var(--input-h); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 0 12px;
  font-size: var(--fs-sm); background: #fff; color: var(--ink-1);
  transition: all .16s var(--ease); outline: none;
  box-sizing: border-box;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); background:#FDFEFF; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(138,43,107,.14);
  background: #fff;
}
.input[disabled], .select[disabled], .textarea[disabled] {
  background: var(--bg-app); color: var(--ink-4); cursor: not-allowed;
}
.input-sm { height: var(--input-h-sm); font-size: var(--fs-xs); padding: 0 10px; }
.input-lg { height: var(--input-h-lg); font-size: var(--fs); padding: 0 14px; }
/* 多行文本框 */
.textarea { height: auto; min-height: 120px; padding: 10px 12px; font-family: var(--font-sans); resize: vertical; line-height: 1.6; }
.textarea.lg { min-height: 180px; }
.textarea.sm { min-height: 80px; }
/* 校验态 */
.input.is-error, .select.is-error, .textarea.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.input.is-success, .select.is-success, .textarea.is-success { border-color: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.form-hint  { color: var(--ink-3); font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* 原生 select 箭头重绘 */
select.select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'><path fill='%237587A6' d='M7 10l5 5 5-5H7z'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
select.select:focus { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'><path fill='%232E63E8' d='M7 10l5 5 5-5H7z'/></svg>"); }
/* 原生 date/time/file 自定义 */
input[type=date].input, input[type=time].input, input[type=datetime-local].input, input[type=month].input, input[type=week].input {
  padding-right: 10px; font-family: var(--font-sans);
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .6; filter: saturate(0) brightness(.85);
  transition: opacity .18s, filter .18s;
}
input[type=date]:hover::-webkit-calendar-picker-indicator,
input[type=time]:hover::-webkit-calendar-picker-indicator,
input[type=datetime-local]:hover::-webkit-calendar-picker-indicator { opacity: 1; filter: none; }

input[type=file].input, input[type=file] {
  padding: 0; display: inline-flex; align-items: center;
  font-size: var(--fs-sm);
}
input[type=file]::-webkit-file-upload-button {
  height: 100%; border: 0; border-right: 1px solid var(--line-2);
  background: var(--brand-50); color: var(--brand); font-weight: 500;
  padding: 0 14px; cursor: pointer; font-size: var(--fs-sm);
  transition: background .14s;
}
input[type=file]::-webkit-file-upload-button:hover { background: var(--brand-100); }

.input-group { display: inline-flex; align-items: stretch; }
.input-group .input { border-radius: 6px 0 0 6px; }
.input-group .btn { border-radius: 0 6px 6px 0; border-left: 0; }
.input-group.has-prefix .input { border-radius: 0 6px 6px 0; border-left: 0; }
.input-group .prefix, .input-group .suffix {
  display: inline-flex; align-items: center; padding: 0 10px;
  background: var(--bg-soft); border: 1px solid var(--line-2);
  color: var(--ink-3); font-size: 12px;
}
.input-group .prefix { border-right: 0; border-radius: 6px 0 0 6px; }
.input-group .suffix { border-left: 0; border-radius: 0 6px 6px 0; }

/* Checkbox / Radio - 自定义美化 */
.chk, .rdo {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: var(--fs-sm); color: var(--ink-1); user-select: none;
  line-height: 1.4;
}
.chk input[type=checkbox], .rdo input[type=radio] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; cursor: pointer;
  border: 1.5px solid var(--line-3); background: #fff;
  border-radius: 3px; transition: all .16s var(--ease);
  flex-shrink: 0; position: relative;
}
.rdo input[type=radio] { border-radius: 50%; }
.chk input[type=checkbox]:hover, .rdo input[type=radio]:hover { border-color: var(--brand); }
.chk input[type=checkbox]:checked {
  background: var(--brand); border-color: var(--brand);
}
.chk input[type=checkbox]:checked::after {
  content:''; position: absolute; inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'><path fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M5 12l5 5L20 7'/></svg>") center/11px no-repeat;
}
.chk input[type=checkbox]:indeterminate {
  background: var(--brand); border-color: var(--brand);
}
.chk input[type=checkbox]:indeterminate::after {
  content:''; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px;
  background: #fff; border-radius: 1px; transform: translateY(-50%);
}
.rdo input[type=radio]:checked { border-color: var(--brand); border-width: 5px; background: #fff; }
.chk input[type=checkbox]:focus, .rdo input[type=radio]:focus { box-shadow: 0 0 0 3px rgba(138,43,107,.18); outline: none; }
.chk.disabled, .rdo.disabled { opacity: .5; cursor: not-allowed; }

/* Switch */
.switch {
  position: relative; display: inline-block;
  width: 32px; height: 18px;
  background: var(--line-2); border-radius: 10px;
  cursor: pointer; transition: background .2s;
  flex-shrink: 0;
}
.switch::after {
  content:''; position: absolute; left: 2px; top: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: all .2s;
}
.switch.on { background: var(--brand); }
.switch.on::after { left: 16px; }
.switch.sm { width: 26px; height: 14px; }
.switch.sm::after { width: 10px; height: 10px; top: 2px; left: 2px; }
.switch.sm.on::after { left: 14px; }

/* Segment */
.segment {
  display: inline-flex; padding: 2px;
  background: var(--bg-app); border-radius: 6px;
  border: 1px solid var(--line-1);
}
.segment > div {
  padding: 3px 10px; font-size: 12px; color: var(--ink-2);
  border-radius: 4px; cursor: pointer; transition: all .14s;
  user-select: none;
}
.segment > div:hover { color: var(--ink-1); }
.segment > div.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-xs); font-weight: 500; }

/* Select dropdown 风格的按钮 */
.select-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--input-h); padding: 0 10px 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-1); font-size: var(--fs-sm);
  cursor: pointer; transition: all .16s var(--ease);
  min-width: 120px;
}
.select-btn:hover { border-color: var(--brand); color: var(--brand); box-shadow: var(--shadow-sm); }
.select-btn.active { border-color: var(--brand); color: var(--brand); background: var(--brand-25); box-shadow: 0 0 0 3px rgba(138,43,107,.12); }
.select-btn .cv { color: var(--ink-3); font-size: var(--fs-sm); transition: transform .18s; margin-left: auto; }
.select-btn.active .cv { transform: rotate(180deg); color: var(--brand); }

/* DT 自研下拉弹层 */
.dt-popover {
  position: absolute; z-index: 2100;
  background: #fff; border: 1px solid var(--line-1);
  border-radius: var(--radius-md); min-width: 160px;
  box-shadow: var(--shadow-lg);
  padding: 4px; animation: popIn .16s var(--ease);
  max-height: 320px; overflow-y: auto;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.dt-popover .pop-item {
  padding: 7px 10px; border-radius: 5px; cursor: pointer;
  font-size: var(--fs-sm); color: var(--ink-1);
  display: flex; align-items: center; gap: 6px;
  transition: background .12s;
}
.dt-popover .pop-item:hover { background: var(--brand-25); color: var(--brand); }
.dt-popover .pop-item.active { background: var(--brand-50); color: var(--brand); font-weight: 500; }
.dt-popover .pop-item.active::after { content:'✓'; margin-left:auto; color: var(--brand); font-weight:700; }
.dt-popover .pop-divider { height: 1px; background: var(--line-1); margin: 4px 0; }
.dt-popover .pop-search {
  padding: 4px; border-bottom: 1px solid var(--line-1); margin-bottom: 4px;
}
.dt-popover .pop-search input {
  width: 100%; border: 1px solid var(--line-1); border-radius: 4px;
  padding: 5px 8px; font-size: var(--fs-sm); outline: none;
}
.dt-popover .pop-search input:focus { border-color: var(--brand); }

/* 日期选择弹层 */
.dt-date-picker {
  padding: 10px;
}
.dt-date-picker .dp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px 10px; border-bottom: 1px solid var(--line-1); margin-bottom: 8px;
}
.dt-date-picker .dp-head .nav {
  width: 24px; height: 24px; border-radius: 4px;
  display: grid; place-items: center; cursor: pointer;
  color: var(--ink-3); transition: all .12s;
}
.dt-date-picker .dp-head .nav:hover { background: var(--bg-hover); color: var(--brand); }
.dt-date-picker .dp-head .title { font-weight: 600; font-size: var(--fs-sm); color: var(--ink-1); }
.dt-date-picker .dp-grid { display: grid; grid-template-columns: repeat(7, 32px); gap: 2px; }
.dt-date-picker .dp-grid .dow { font-size: 11px; color: var(--ink-3); text-align: center; padding: 4px 0; }
.dt-date-picker .dp-cell {
  height: 30px; border-radius: 5px; display: grid; place-items: center;
  font-size: var(--fs-sm); color: var(--ink-1); cursor: pointer;
  transition: all .12s;
}
.dt-date-picker .dp-cell:hover { background: var(--brand-25); color: var(--brand); }
.dt-date-picker .dp-cell.outside { color: var(--ink-5); }
.dt-date-picker .dp-cell.today { border: 1px solid var(--brand-100); }
.dt-date-picker .dp-cell.selected { background: var(--brand); color: #fff; font-weight: 600; }
.dt-date-picker .dp-cell.selected:hover { background: var(--brand-active); }

/* 级联选择弹层 */
.dt-cascader { display: flex; border: 1px solid var(--line-1); border-radius: 8px; overflow: hidden; }
.dt-cascader .cas-col {
  min-width: 150px; max-height: 260px; overflow-y: auto;
  border-right: 1px solid var(--line-1); padding: 4px;
}
.dt-cascader .cas-col:last-child { border-right: 0; }
.dt-cascader .cas-item {
  padding: 6px 10px; cursor: pointer; border-radius: 4px;
  font-size: var(--fs-sm); display: flex; align-items: center; justify-content: space-between;
  transition: background .12s;
}
.dt-cascader .cas-item:hover { background: var(--bg-hover); }
.dt-cascader .cas-item.active { background: var(--brand-50); color: var(--brand); }

/* ============================================================
   Table
   ============================================================ */
.tbl-wrap { background: #fff; border: 1px solid var(--line-1); border-radius: var(--radius-md); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl thead th {
  background: var(--bg-soft); color: var(--ink-2);
  text-align: left; font-weight: 600;
  padding: 10px 14px; border-bottom: 1px solid var(--line-1);
  white-space: nowrap; font-size: var(--fs-sm);
  letter-spacing: .02em;
  position: sticky; top: 0; z-index: 2;
}
.tbl thead th.th-num { text-align: right; }
.tbl tbody td {
  padding: 10px 14px; border-bottom: 1px solid var(--line-1);
  color: var(--ink-1);
}
.tbl tbody td.td-num { text-align: right; font-family: var(--font-num); }
.tbl tbody tr { transition: background .16s var(--ease), box-shadow .16s var(--ease); }
.tbl tbody tr:hover { background: #FAF5F8; box-shadow: inset 3px 0 0 var(--brand-300); }
.tbl tbody tr.selected { background: var(--brand-50); }
.tbl tbody tr.selected td { color: var(--ink-1); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .tbl-actions { display: inline-flex; gap: 2px; }
.tbl .tbl-actions .btn-link {
  background: transparent; border: none; color: var(--brand); cursor: pointer;
  font-size: 12.5px; padding: 2px 6px; border-radius: 4px; transition: background .12s;
}
.tbl .tbl-actions .btn-link:hover { background: var(--brand-50); }
.tbl .tbl-actions .btn-link.danger { color: var(--danger); }
.tbl .tbl-actions .btn-link.danger:hover { background: var(--danger-50); }
.tbl-compact tbody td, .tbl-compact thead th { padding: 6px 10px; }
.tbl-striped tbody tr:nth-child(even) { background: var(--bg-soft); }
.tbl-bordered td, .tbl-bordered th { border-right: 1px solid var(--line-1); }
.tbl-bordered td:last-child, .tbl-bordered th:last-child { border-right: 0; }

/* Pagination V4 */
.pagination {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: #fff;
  border-top: 1px solid var(--line-1);
  font-size: var(--fs-sm); color: var(--ink-2);
  flex-wrap: wrap;
}
.pagination .total { color: var(--ink-3); }
.pagination .total b { color: var(--ink-1); font-family: var(--font-num); font-weight: 600; }
.pagination .pager { display: flex; gap: 3px; margin-left: auto; }
.pagination .page {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink-2); font-size: var(--fs-sm);
  border: 1px solid transparent; transition: all .14s var(--ease);
  user-select: none;
}
.pagination .page:hover { background: var(--bg-hover); color: var(--brand); border-color: var(--brand-100); }
.pagination .page.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; box-shadow: var(--shadow-blue-sm); }
.pagination .page.disabled { color: var(--ink-5); cursor: not-allowed; }
.pagination .page.disabled:hover { background: transparent; color: var(--ink-5); border-color: transparent; }
.pagination .page.ellipsis { cursor: default; color: var(--ink-4); }
.pagination .size-select {
  height: 30px; border: 1px solid var(--line-2); border-radius: 5px;
  padding: 0 26px 0 10px; background: #fff; font-size: var(--fs-sm); color: var(--ink-2);
  cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'><path fill='%237587A6' d='M7 10l5 5 5-5H7z'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center;
}
.pagination .size-select:hover { border-color: var(--brand); color: var(--brand); }
.pagination .jumper { display: flex; align-items: center; gap: 5px; color: var(--ink-3); }
.pagination .jumper input {
  width: 46px; height: 30px; border: 1px solid var(--line-2); border-radius: 5px;
  text-align: center; font-size: var(--fs-sm); font-family: var(--font-num);
  transition: all .14s;
}
.pagination .jumper input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(138,43,107,.14); }

/* ============================================================
   Tabs（内部）
   ============================================================ */
.itab-bar {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line-1);
  padding: 0 2px; background: #fff;
}
.itab {
  padding: 10px 16px; font-size: var(--fs); color: var(--ink-2);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all .18s var(--ease); white-space: nowrap; user-select: none;
  display: inline-flex; align-items: center; gap: 5px;
  position: relative;
}
.itab:hover { color: var(--brand); background: var(--brand-25); border-radius: 6px 6px 0 0; }
.itab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.itab.active::before {
  content:''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand) 20%, var(--brand) 80%, transparent);
}
.itab iconify-icon { font-size: 14px; }
.itab-badge {
  font-size: 10px; background: var(--brand-100); color: var(--brand);
  padding: 0 5px; min-width: 16px; height: 15px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 2px; font-family: var(--font-num);
}

/* Pill tabs */
.ptab-bar {
  display: inline-flex; padding: 3px;
  background: var(--bg-app); border-radius: 8px;
  border: 1px solid var(--line-1);
  gap: 2px;
}
.ptab {
  padding: 4px 12px; font-size: 12.5px; color: var(--ink-2);
  cursor: pointer; border-radius: 5px; transition: all .14s;
  user-select: none; white-space: nowrap;
}
.ptab:hover { color: var(--ink-1); }
.ptab.active { background: #fff; color: var(--brand); font-weight: 500; box-shadow: var(--shadow-sm); }

/* ============================================================
   Divider
   ============================================================ */
.divider { height: 1px; background: var(--line-1); margin: 10px 0; }
.divider-v { width: 1px; background: var(--line-1); margin: 0 8px; align-self: stretch; }

/* ============================================================
   Modal
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15,26,51,.38); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 1000;
  animation: fadeIn .16s ease;
}
.modal {
  background: #fff; border-radius: var(--radius-lg);
  min-width: 480px; max-width: 92vw; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalUp .22s cubic-bezier(.22,.82,.36,1);
  overflow: hidden;
}
.modal-header {
  padding: 14px 20px; border-bottom: 1px solid var(--line-1);
  display: flex; align-items: center;
  font-size: var(--fs-lg); font-weight: 600; color: var(--ink-1);
}
.modal-header .close {
  margin-left: auto; cursor: pointer;
  color: var(--ink-3); font-size: 18px;
  width: 24px; height: 24px; border-radius: 4px;
  display: grid; place-items: center;
  transition: all .12s;
}
.modal-header .close:hover { background: var(--bg-hover); color: var(--ink-1); }
.modal-body { padding: 18px 20px; overflow: auto; flex: 1; color: var(--ink-1); font-size: var(--fs); }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--line-1);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--bg-soft);
}

/* Drawer */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(15,26,51,.28); z-index: 900;
  animation: fadeIn .16s;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 560px; max-width: 92vw; background: #fff;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 28px rgba(15,26,51,.14);
  z-index: 901; animation: slideInR .24s cubic-bezier(.22,.82,.36,1);
}

/* Popover / Tooltip */
.tooltip {
  position: absolute; z-index: 2000;
  padding: 6px 10px; font-size: var(--fs-xs);
  background: rgba(15,26,51,.94); color: #fff;
  border-radius: 6px; max-width: 280px;
  box-shadow: var(--shadow-md);
  pointer-events: none; white-space: normal; line-height: 1.45;
  animation: tooltipIn .14s var(--ease);
}
@keyframes tooltipIn { from { opacity: 0; transform: translateY(2px) scale(.96); } to { opacity: 1; transform: none; } }
.tooltip::after {
  content:''; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: -4px; border: 4px solid transparent; border-top-color: rgba(15,26,51,.94);
}
.tooltip.top::after { bottom: -4px; border-top-color: rgba(15,26,51,.94); border-bottom: 0; }
.tooltip.bottom::after { top: -4px; bottom: auto; border-bottom-color: rgba(15,26,51,.94); border-top: 0; }
.tooltip.left::after { right: -4px; left: auto; top: 50%; transform: translateY(-50%); border-left-color: rgba(15,26,51,.94); border-top: 0; border-right: 0; border-bottom: 4px solid transparent;}
.tooltip.right::after { left: -4px; top: 50%; transform: translateY(-50%); border-right-color: rgba(15,26,51,.94); border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left:0; }

/* Hover 提示 icon */
.tip-icon {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-app-2); color: var(--ink-3);
  font-size: 10px; cursor: help; margin-left: 4px;
  transition: all .16s;
}
.tip-icon:hover { background: var(--brand-100); color: var(--brand); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slideInR { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity: .45; } }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes shine {
  0%   { background-position: -160% 0; }
  100% { background-position:  260% 0; }
}
.pulse { animation: pulse 1.6s infinite; }
.spin  { animation: spin  .9s linear infinite; }

/* Skeleton */
.skel {
  background: linear-gradient(90deg, #EEF1F6 25%, #F5F7FA 37%, #EEF1F6 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s infinite;
  border-radius: 4px; min-height: 12px;
}
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Scan line 扫描线（大屏可用，也可在列表 loading 用）*/
@keyframes scanLine {
  0%  { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* ============================================================
   Toolbar / Filter
   ============================================================ */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: #fff;
  border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.toolbar .toolbar-left  { display:flex; gap: 10px; align-items:center; flex-wrap: wrap; }
.toolbar .toolbar-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.filter-row { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.filter-item { display: flex; align-items: center; gap: 8px; }
.filter-item .lbl { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }

/* 筛选 chip 组 */
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 2px; background: var(--bg-app); border-radius: 8px; border: 1px solid var(--line-1); }
.chips .chip {
  height: 28px; padding: 0 12px; border-radius: 6px;
  font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  transition: all .16s var(--ease); user-select: none;
  white-space: nowrap;
}
.chips .chip:hover { color: var(--ink-1); background: rgba(255,255,255,.5); }
.chips .chip.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); font-weight: 600; }
.chips .chip .cnt { font-family: var(--font-num); color: var(--ink-4); font-size: 11px; }
.chips .chip.active .cnt { color: var(--brand); }

/* Loading 骨架占位容器 */
.load-wrap { position: relative; min-height: 120px; }
.load-wrap.is-loading::after {
  content: attr(data-loading);
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.75); backdrop-filter: blur(3px);
  color: var(--ink-3); font-size: var(--fs-sm); z-index: 10;
}
.load-spin {
  width: 24px; height: 24px;
  border: 2.5px solid var(--brand-100); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* ============================================================
   Grid helpers
   ============================================================ */
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.row-gap-8 { gap: 8px; } .row-gap-16 { gap: 16px; } .row-gap-20 { gap: 20px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.col-gap-8 { gap: 8px; } .col-gap-16 { gap: 16px; }

.grid { display: grid; gap: 12px; }
.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); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-auto-fill { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ============================================================
   Utility / Helpers
   ============================================================ */
.flex { display: flex; } .inline-flex { display: inline-flex; } .block { display: block; } .inline-block { display: inline-block; } .hidden { display: none !important; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; } .items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; } .justify-center { justify-content: center; } .justify-start { justify-content: flex-start; }
.flex-1 { flex: 1; min-width: 0; } .flex-wrap { flex-wrap: wrap; } .flex-col { flex-direction: column; } .flex-shrink-0 { flex-shrink: 0; }
.gap-2 { gap: 2px; } .gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-14 { gap: 14px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.p-0{padding:0}.p-4{padding:4px}.p-6{padding:6px}.p-8{padding:8px}.p-10{padding:10px}.p-12{padding:12px}.p-14{padding:14px}.p-16{padding:16px}.p-20{padding:20px}.p-24{padding:24px}
.px-8{padding-left:8px;padding-right:8px}.px-12{padding-left:12px;padding-right:12px}.px-14{padding-left:14px;padding-right:14px}.px-16{padding-left:16px;padding-right:16px}
.py-4{padding-top:4px;padding-bottom:4px}.py-8{padding-top:8px;padding-bottom:8px}.py-10{padding-top:10px;padding-bottom:10px}.py-12{padding-top:12px;padding-bottom:12px}
.m-0{margin:0}.mt-0{margin-top:0}.mt-4{margin-top:4px}.mt-6{margin-top:6px}.mt-8{margin-top:8px}.mt-10{margin-top:10px}.mt-12{margin-top:12px}.mt-14{margin-top:14px}.mt-16{margin-top:16px}.mt-20{margin-top:20px}.mt-24{margin-top:24px}
.mb-0{margin-bottom:0}.mb-4{margin-bottom:4px}.mb-6{margin-bottom:6px}.mb-8{margin-bottom:8px}.mb-10{margin-bottom:10px}.mb-12{margin-bottom:12px}.mb-14{margin-bottom:14px}.mb-16{margin-bottom:16px}
.ml-auto{margin-left:auto}.mr-auto{margin-right:auto}
.w-full{width:100%}.h-full{height:100%}.min-w-0{min-width:0}
.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}
.text-xs{font-size:11px}.text-sm{font-size:12px}.text-md{font-size:13px}.text-lg{font-size:14.5px}.text-xl{font-size:16px}.text-2xl{font-size:20px}.text-3xl{font-size:26px}.text-4xl{font-size:32px}
.text-ink-1{color:var(--ink-1)}.text-ink-2{color:var(--ink-2)}.text-ink-3{color:var(--ink-3)}.text-ink-4{color:var(--ink-4)}
.text-brand{color:var(--brand)}.text-success{color:var(--success)}.text-danger{color:var(--danger)}.text-warning{color:var(--warning)}
.font-num{font-family:var(--font-num);font-variant-numeric:tabular-nums}.font-mono{font-family:var(--font-mono)}
.fw-400{font-weight:400}.fw-500{font-weight:500}.fw-600{font-weight:600}.fw-700{font-weight:700}
.rounded{border-radius:var(--radius)}.rounded-md{border-radius:var(--radius-md)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-full{border-radius:999px}
.bg-card{background:var(--bg-card)}.bg-app{background:var(--bg-app)}.bg-soft{background:var(--bg-soft)}.bg-brand-50{background:var(--brand-50)}.bg-brand-100{background:var(--brand-100)}
.border{border:1px solid var(--line-1)}.border-t{border-top:1px solid var(--line-1)}.border-b{border-bottom:1px solid var(--line-1)}.border-l{border-left:1px solid var(--line-1)}.border-r{border-right:1px solid var(--line-1)}
.border-brand{border-color:var(--brand) !important}
.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}
.shadow-none{box-shadow:none}.shadow-xs{box-shadow:var(--shadow-xs)}.shadow-sm{box-shadow:var(--shadow-sm)}.shadow{box-shadow:var(--shadow)}.shadow-md{box-shadow:var(--shadow-md)}.shadow-lg{box-shadow:var(--shadow-lg)}
.overflow-hidden{overflow:hidden}.overflow-auto{overflow:auto}
.relative{position:relative}.absolute{position:absolute}.fixed{position:fixed}
.z-10{z-index:10}.z-100{z-index:100}.z-1000{z-index:1000}
.op-50{opacity:.5}.op-70{opacity:.7}.op-90{opacity:.9}

/* Avatar */
.avatar-group { display: inline-flex; }
.avatar-group .avatar { border: 1.5px solid #fff; margin-left: -6px; }
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--c3) 100%);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatar.xl { width: 48px; height: 48px; font-size: 16px; }
.avatar.color-1 { background: linear-gradient(135deg, #8A2B6B, #0EA5E9); }
.avatar.color-2 { background: linear-gradient(135deg, #8B5CF6, #EC4899); }
.avatar.color-3 { background: linear-gradient(135deg, #06B6A4, #10B981); }
.avatar.color-4 { background: linear-gradient(135deg, #F59E0B, #EF476F); }
.avatar.color-5 { background: linear-gradient(135deg, #64748B, #334155); }

/* Progress bar */
.progress {
  height: 6px; background: var(--bg-app-2);
  border-radius: 3px; overflow: hidden; position: relative;
}
.progress .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--c7) 100%);
  border-radius: 3px; transition: width .4s ease;
  position: relative;
}
.progress .bar::after {
  content:''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shine 2.4s infinite;
  background-size: 50% 100%; background-repeat: no-repeat;
}
.progress.md { height: 8px; }
.progress.lg { height: 12px; }
.progress.success .bar { background: linear-gradient(90deg, var(--success), #34D399); }
.progress.warning .bar { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.progress.danger  .bar { background: linear-gradient(90deg, var(--danger),  #F87171); }

/* Alert banner */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 12.5px; border: 1px solid;
}
.alert iconify-icon { flex-shrink: 0; margin-top: 1px; }
.alert .alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-info    { background: var(--info-50); border-color: var(--brand-100); color: var(--brand); }
.alert-success { background: var(--success-50); border-color: #C6E9CF; color: var(--success); }
.alert-warning { background: var(--warning-50); border-color: #F7E2B9; color: #B76E00; }
.alert-danger  { background: var(--danger-50); border-color: #F8C4C4; color: var(--danger); }

/* Empty state */
.empty {
  text-align: center; padding: 40px 20px;
  color: var(--ink-3);
}
.empty .empty-icon {
  width: 80px; height: 80px; margin: 0 auto 12px;
  border-radius: 50%; background: var(--bg-app-2);
  display: grid; place-items: center;
  color: var(--ink-4);
}
.empty .empty-title { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.empty .empty-desc  { font-size: 12px; color: var(--ink-3); }

/* Stepper */
.stepper { display: flex; align-items: center; gap: 0; }
.step {
  flex: 1; display: flex; align-items: center; gap: 8px;
  position: relative;
}
.step .step-idx {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-app-2); color: var(--ink-3);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  flex-shrink: 0; transition: all .2s;
}
.step .step-label { font-size: 12.5px; color: var(--ink-2); }
.step .step-desc  { font-size: 11px; color: var(--ink-4); }
.step.done .step-idx { background: var(--success); color: #fff; }
.step.active .step-idx {
  background: var(--brand); color: #fff;
  box-shadow: 0 0 0 4px var(--brand-100);
}
.step.active .step-label { color: var(--ink-1); font-weight: 500; }
.step:not(:last-child)::after {
  content:''; flex: 1; height: 1px; background: var(--line-2);
  margin: 0 10px;
}
.step.done:not(:last-child)::after { background: var(--success); }

/* Toast V4 - 语义色 + 图标 + 进度 + 关闭 */
.toast-wrap {
  position: fixed; top: 80px; right: 20px;
  z-index: 2000; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: #fff; border: 1px solid var(--line-1);
  border-radius: var(--radius-md); overflow: hidden;
  padding: 12px 14px 12px 14px; min-width: 300px; max-width: 440px;
  box-shadow: var(--shadow-xl);
  display: flex; align-items: flex-start; gap: 10px;
  animation: toastIn .28s var(--ease);
  pointer-events: auto; font-size: var(--fs-sm);
  position: relative;
  border-left-width: 4px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.leaving { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
.toast.success { border-left-color: var(--success); background: #fff; }
.toast.error   { border-left-color: var(--danger);  }
.toast.warn    { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--brand);   }
.toast iconify-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.toast.success iconify-icon { color: var(--success); }
.toast.error   iconify-icon { color: var(--danger);  }
.toast.warn    iconify-icon { color: var(--warning); }
.toast.info    iconify-icon { color: var(--brand);   }
.toast .ts-body { flex: 1; min-width: 0; }
.toast .ts-title { font-weight: 600; color: var(--ink-1); font-size: var(--fs); margin-bottom: 2px; }
.toast .ts-msg { color: var(--ink-2); line-height: 1.5; word-break: break-word; }
.toast .ts-close {
  width: 20px; height: 20px; border-radius: 4px; cursor: pointer;
  display: grid; place-items: center; color: var(--ink-4); flex-shrink: 0;
  font-size: 14px; transition: all .14s;
}
.toast .ts-close:hover { background: var(--bg-hover); color: var(--ink-1); }
.toast .ts-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: currentColor; opacity: .5;
  transform-origin: left center;
  animation: toastPg linear forwards;
}
@keyframes toastPg { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast.success .ts-progress { color: var(--success); }
.toast.error   .ts-progress { color: var(--danger);  }
.toast.warn    .ts-progress { color: var(--warning); }
.toast.info    .ts-progress { color: var(--brand);   }

/* Dropdown */
.dropdown-menu {
  position: absolute; z-index: 800; min-width: 160px;
  background: #fff; border: 1px solid var(--line-1);
  border-radius: var(--radius-md); padding: 4px;
  box-shadow: var(--shadow-xl);
  animation: popIn .16s var(--ease);
}
.dropdown-item {
  padding: 8px 12px; font-size: var(--fs-sm); color: var(--ink-1);
  cursor: pointer; border-radius: 5px;
  display: flex; align-items: center; gap: 7px;
  transition: background .12s;
}
.dropdown-item iconify-icon { font-size: 15px; color: var(--ink-3); }
.dropdown-item:hover iconify-icon { color: var(--brand); }
.dropdown-item .hotkey { margin-left: auto; font-size: 11px; color: var(--ink-4); font-family: var(--font-mono); }
.dropdown-item:hover { background: var(--bg-hover); color: var(--brand); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-50); }
.dropdown-divider { height: 1px; background: var(--line-1); margin: 4px 0; }

/* 通用容器与区块 */
.section {
  background: #fff; border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.section-header {
  padding: 10px 14px; border-bottom: 1px solid var(--line-1);
  display: flex; align-items: center; gap: 8px;
  background: #FDFEFF;
}
.section-header .title {
  font-size: 13px; font-weight: 600; color: var(--ink-1);
  display: flex; align-items: center; gap: 6px;
}
.section-header .title::before {
  content:''; width: 3px; height: 12px;
  background: linear-gradient(180deg, var(--brand), var(--c7));
  border-radius: 1.5px;
}
.section-header .actions { margin-left: auto; display: flex; gap: 6px; }
.section-body { padding: 14px; }

/* 小标注（计数、单位）- 非 chips 容器内使用 */
.badge-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; height: 20px;
  background: var(--bg-app-2); border-radius: 4px;
  font-size: 11px; color: var(--ink-3);
  font-family: var(--font-num);
}

/* Tree 通用 */
.tree { font-size: 12.5px; }
.tree-node {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 4px; cursor: pointer;
  color: var(--ink-1); transition: background .12s;
  user-select: none;
}
.tree-node:hover { background: var(--bg-hover); }
.tree-node.active { background: var(--brand-50); color: var(--brand); }
.tree-node .tn-toggle {
  width: 14px; height: 14px; display: inline-grid; place-items: center;
  color: var(--ink-3); transition: transform .18s;
  flex-shrink: 0;
}
.tree-node.open > .tn-toggle { transform: rotate(90deg); }
.tree-node .tn-ic { color: var(--ink-3); font-size: 14px; flex-shrink: 0; }
.tree-node.active .tn-ic { color: var(--brand); }
.tree-children { padding-left: 14px; display: none; }
.tree-node.open + .tree-children { display: block; }

/* ============================================================
   Editor fullscreen shell（编辑器通用）
   ============================================================ */
.editor-shell {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  background: var(--bg-app);
}
.editor-topbar {
  height: 44px; background: #fff;
  border-bottom: 1px solid var(--line-1);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; flex-shrink: 0;
}
.editor-topbar .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--ink-1); font-size: 13px;
}
.editor-topbar .brand .logo-icon {
  width: 24px; height: 24px; border-radius: 6px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--c7) 100%);
  display: grid; place-items: center; color: #fff;
}
.editor-topbar .tb-divider { width: 1px; height: 18px; background: var(--line-1); margin: 0 6px; }
.editor-main {
  flex: 1; display: flex; min-height: 0;
}
.editor-toolbox {
  width: 56px; background: #fff; border-right: 1px solid var(--line-1);
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 0; flex-shrink: 0;
}
.editor-toolbox .tb-item {
  width: 40px; height: 40px; margin: 0 auto;
  border-radius: 6px; display: grid; place-items: center;
  color: var(--ink-2); cursor: pointer; transition: all .14s;
  position: relative;
}
.editor-toolbox .tb-item:hover { background: var(--bg-hover); color: var(--brand); }
.editor-toolbox .tb-item.active { background: var(--brand-50); color: var(--brand); }
.editor-toolbox .tb-label {
  font-size: 9.5px; margin-top: 2px; text-align: center; color: var(--ink-3);
}
.editor-panel {
  width: 260px; background: #fff; border-right: 1px solid var(--line-1);
  display: flex; flex-direction: column; flex-shrink: 0; min-width: 0;
}
.editor-canvas {
  flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--bg-app);
}
.editor-props {
  width: 300px; background: #fff; border-left: 1px solid var(--line-1);
  display: flex; flex-direction: column; flex-shrink: 0; min-width: 0;
}
.editor-statusbar {
  height: 26px; background: #fff; border-top: 1px solid var(--line-1);
  display: flex; align-items: center; gap: 12px; padding: 0 12px;
  font-size: 11.5px; color: var(--ink-3);
  flex-shrink: 0;
}
.editor-statusbar .st-item { display: flex; align-items: center; gap: 4px; }

/* 浮层消息/Toast 在编辑器里生效 */

/* ============================================================
   V4 新增：右键菜单 / 上下文菜单
   ============================================================ */
.dt-ctx-menu {
  position: fixed; z-index: 3000;
  background: #fff; border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl); padding: 4px;
  min-width: 180px; max-width: 280px;
  animation: popIn .14s var(--ease);
}
.dt-ctx-menu .ctx-item {
  padding: 8px 12px; font-size: var(--fs-sm); color: var(--ink-1);
  cursor: pointer; border-radius: 5px;
  display: flex; align-items: center; gap: 8px;
  transition: background .12s;
}
.dt-ctx-menu .ctx-item:hover { background: var(--brand-50); color: var(--brand); }
.dt-ctx-menu .ctx-item iconify-icon { font-size: 15px; color: var(--ink-3); }
.dt-ctx-menu .ctx-item:hover iconify-icon { color: var(--brand); }
.dt-ctx-menu .ctx-item.danger { color: var(--danger); }
.dt-ctx-menu .ctx-item.danger:hover { background: var(--danger-50); color: var(--danger); }
.dt-ctx-menu .ctx-item.disabled { color: var(--ink-5); cursor: not-allowed; }
.dt-ctx-menu .ctx-item.disabled:hover { background: transparent; color: var(--ink-5); }
.dt-ctx-menu .ctx-divider { height: 1px; background: var(--line-1); margin: 4px 0; }
.dt-ctx-menu .hotkey { margin-left: auto; font-size: 11px; color: var(--ink-4); font-family: var(--font-mono); }

/* ============================================================
   V4 新增：Confirm 确认弹框（语义色）
   ============================================================ */
.dt-confirm { min-width: 420px; max-width: 560px; }
.dt-confirm .confirm-body {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 22px;
}
.dt-confirm .confirm-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  font-size: 24px;
}
.dt-confirm.info    .confirm-icon { background: var(--brand-50);   color: var(--brand); }
.dt-confirm.success .confirm-icon { background: var(--success-50); color: var(--success); }
.dt-confirm.warning .confirm-icon { background: var(--warning-50); color: #B76E00; }
.dt-confirm.danger  .confirm-icon { background: var(--danger-50);  color: var(--danger); }
.dt-confirm .confirm-title { font-size: var(--fs-lg); font-weight: 600; color: var(--ink-1); margin-bottom: 6px; }
.dt-confirm .confirm-text { color: var(--ink-2); font-size: var(--fs); line-height: 1.6; }

/* ============================================================
   V4 新增：数据流光线条（DAG / 血缘）
   ============================================================ */
.dt-flow-line {
  stroke-dasharray: 6 4;
  animation: flowDash 1.4s linear infinite;
}
@keyframes flowDash { to { stroke-dashoffset: -20; } }
.dt-flow-line.reverse { animation: flowDashR 1.4s linear infinite; }
@keyframes flowDashR { to { stroke-dashoffset: 20; } }
.dt-flow-line.fast { animation-duration: .8s; }
.dt-flow-line.slow { animation-duration: 2.6s; }

/* ============================================================
   V4 新增：画布拖拽提示
   ============================================================ */
.dt-canvas-pan {
  position: relative; overflow: hidden; cursor: grab;
  user-select: none; touch-action: none;
}
.dt-canvas-pan.grabbing { cursor: grabbing; }
.dt-canvas-pan .dt-pan-inner {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  transition: transform .05s linear;
}
.dt-canvas-pan.panning .dt-pan-inner { transition: none; }
.dt-canvas-pan .dt-pan-ctrl {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line-1); border-radius: 8px;
  padding: 4px; z-index: 20;
  box-shadow: var(--shadow-md);
}
.dt-canvas-pan .dt-pan-ctrl .ctrl-btn {
  width: 28px; height: 28px; border-radius: 5px;
  display: grid; place-items: center; cursor: pointer;
  color: var(--ink-2); transition: all .14s;
  font-size: 13px;
}
.dt-canvas-pan .dt-pan-ctrl .ctrl-btn:hover { background: var(--brand-50); color: var(--brand); }
.dt-canvas-pan .dt-pan-ctrl .ctrl-zoom {
  font-size: 11px; color: var(--ink-3); font-family: var(--font-num);
  text-align: center; padding: 2px 0;
}

/* 画布边界视觉提示 */
.dt-canvas-pan .dt-pan-bound {
  position: absolute; inset: 10px; border: 1px dashed rgba(138,43,107,.18);
  border-radius: 10px; pointer-events: none; z-index: 1;
  opacity: 0; transition: opacity .24s;
}
.dt-canvas-pan:hover .dt-pan-bound { opacity: 1; }

/* ============================================================
   V4 新增：Result Bar（操作结果反馈条）
   ============================================================ */
.result-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 6px;
  font-size: var(--fs-sm); font-weight: 500;
  background: var(--success-50); color: var(--success);
  border-left: 3px solid var(--success);
  animation: slideInUp .22s var(--ease);
}
.result-bar.info    { background: var(--info-50); color: var(--brand); border-left-color: var(--brand); }
.result-bar.warn    { background: var(--warning-50); color: #B76E00; border-left-color: var(--warning); }
.result-bar.danger  { background: var(--danger-50); color: var(--danger); border-left-color: var(--danger); }

/* ============================================================
   V4 新增：Sitemap 顶部 Hero - 仅首页显示
   ============================================================ */
.hero {
  padding: 18px 20px; margin-bottom: 12px;
  background: linear-gradient(135deg, #EAF1FF 0%, #F5F9FF 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-100);
  max-height: 120px; overflow: hidden;
}
.hero .hero-title { font-size: 20px; font-weight: 700; color: var(--brand-deep); margin-bottom: 4px; }
.hero .hero-desc { font-size: var(--fs-sm); color: var(--ink-2); }
.home-only { display: none; }
body.is-home .home-only { display: block; }

/* ============================================================
   V4 新增：折叠图表容器（多图切换）
   ============================================================ */
.chart-tabs {
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid var(--line-1);
  overflow-x: auto; scrollbar-width: none;
  padding: 0 6px;
}
.chart-tabs::-webkit-scrollbar { display: none; }
.chart-tab {
  height: 32px; padding: 0 12px; font-size: var(--fs-sm);
  color: var(--ink-2); cursor: pointer;
  border-radius: 6px 6px 0 0;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .14s; white-space: nowrap; user-select: none;
  position: relative;
}
.chart-tab:hover { color: var(--brand); background: var(--brand-25); }
.chart-tab.active { color: var(--brand); font-weight: 600; }
.chart-tab.active::after {
  content:''; position: absolute; left: 8px; right: 8px; bottom: 0;
  height: 2px; background: var(--brand); border-radius: 1px;
}

/* ============================================================
   V4 新增：Validation 实时校验提示小三角
   ============================================================ */
.field-tip {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.4;
  display: flex; align-items: center; gap: 3px;
}
.field-tip iconify-icon { font-size: 13px; }
.field-tip.ok { color: var(--success); }
.field-tip.err { color: var(--danger); }

/* ============================================================
   V4 新增：表格行点击选中态（.row-selected）
   ============================================================ */
.tbl tbody tr.row-selected,
.table tbody tr.row-selected,
table tbody tr.row-selected {
  background: var(--brand-50) !important;
  box-shadow: inset 3px 0 0 var(--brand) !important;
}
.tbl tbody tr.row-selected:hover,
.table tbody tr.row-selected:hover,
table tbody tr.row-selected:hover {
  background: var(--brand-50) !important;
}

/* ===== V4.6 内页不限高度：允许页面自然高度与分页条可见（大屏编辑器除外） ===== */
body.inner:not(.screen):not([class*="screen-"]):not(.screen-body){ overflow-y:auto; overflow-x:hidden; }
body.inner:not(.screen):not([class*="screen-"]):not(.screen-body) .inner-page{ min-height:unset; height:auto; padding-bottom:24px; }
body.inner:not(.screen):not([class*="screen-"]):not(.screen-body) .pane{ min-height:unset; }
body.inner:not(.screen):not([class*="screen-"]):not(.screen-body) .pg-pager,
body.inner:not(.screen):not([class*="screen-"]):not(.screen-body) .pagination{ display:flex !important; margin-top:12px; }

/* ===== V4.7 轻量分页条 pg-pager，跨页通用 ===== */
.pg-pager{ display:flex; align-items:center; gap:12px; padding:10px 14px; background:#fff; border:1px solid var(--line-1); border-top:none; border-radius:0 0 var(--radius) var(--radius); }
.pg-pager .pg-info{ color:var(--ink-3); font-size:12.5px; }
.pg-pager .pg-info b{ color:var(--ink-1); font-family:var(--font-num); font-weight:600; padding:0 2px; }
.pg-pager .pg-ctrl{ display:flex; gap:4px; align-items:center; margin-left:auto; }
.pg-pager .pg-btn{
  min-width:30px; height:30px; padding:0 9px; border:1px solid var(--line-2); background:#fff; color:var(--ink-2);
  border-radius:5px; cursor:pointer; font-size:12.5px; font-family:var(--font-num);
  display:inline-flex; align-items:center; justify-content:center; transition:all .14s;
}
.pg-pager .pg-btn:hover:not(:disabled):not(.active){ color:var(--brand); border-color:var(--brand-300); background:var(--brand-50); }
.pg-pager .pg-btn.active{ background:var(--brand); color:#fff; border-color:var(--brand); font-weight:600; box-shadow:var(--shadow-blue-sm); }
.pg-pager .pg-btn:disabled{ color:var(--ink-5); cursor:not-allowed; background:var(--bg-app-2); }
.pg-pager .pg-size{
  height:30px; border:1px solid var(--line-2); border-radius:5px; padding:0 22px 0 10px;
  background:#fff; font-size:12.5px; color:var(--ink-2); cursor:pointer; appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path fill='%237587A6' d='M1 3l4 4 4-4z'/></svg>");
  background-repeat:no-repeat; background-position:right 7px center;
}
.pg-pager .pg-size:hover{ border-color:var(--brand); color:var(--brand); }

/* ===== V4.6 P2 全局不限高 + 元素间距 ===== */
/* 编辑器 / 大屏：必须占满视口并禁止滚动，由其内部 CSS 自行管理 */
body.editor,
body.screen,
body.screen-body,
body[class*="screen-"] {
  height: 100vh !important;
  overflow: hidden !important;
}
body.editor .inner-page,
body.screen .inner-page { height: 100%; min-height: 100%; }

/* 其他所有内页：不限高度、有合理间距 */
body.inner:not(.editor):not(.screen):not([class*="screen-"]) {
  height: auto !important;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}
body.inner:not(.editor):not(.screen) .inner-page {
  height: auto !important;
  min-height: unset !important;
  padding: 14px 18px 32px;
}
body.inner:not(.editor):not(.screen) .inner-page > .pane + .pane,
body.inner:not(.editor):not(.screen) .inner-page > .kpi-row + .pane,
body.inner:not(.editor):not(.screen) .inner-page > .toolbar + .pane,
body.inner:not(.editor):not(.screen) .inner-page > .pane + .kpi-row { margin-top: 14px; }
body.inner:not(.editor):not(.screen) .pane { min-height: unset; }
body.inner:not(.editor):not(.screen) .toolbar { padding-bottom: 10px; }
body.inner:not(.editor):not(.screen) .chips { margin-top: 6px; }
body.inner:not(.editor):not(.screen) .tbl-wrap { margin-top: 10px; }
body.inner:not(.editor):not(.screen) .pg-pager,
body.inner:not(.editor):not(.screen) .pagination { display: flex !important; margin-top: 14px; }

/* ============================================================
   M4 · 一页内 Tab（dt-tabs / dt-tab / dt-tab-pane）
   - 用于"一页功能太多"拆分多个 Tab，不需要 JS 也可手动切换
   ============================================================ */
.dt-tabs {
  display: flex; gap: 4px; padding: 0 4px;
  background: #fff; border: 1px solid var(--line-1, #E6EBF2);
  border-radius: 8px 8px 0 0; border-bottom: none;
  overflow-x: auto; scrollbar-width: none;
}
.dt-tabs::-webkit-scrollbar { display: none; }
.dt-tab {
  height: 38px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2, #4A5874); cursor: pointer;
  white-space: nowrap; user-select: none;
  border-bottom: 2px solid transparent; transition: all .15s var(--ease, ease);
}
.dt-tab:hover { color: var(--brand, #8A2B6B); }
.dt-tab.active {
  color: var(--brand, #8A2B6B); font-weight: 600;
  border-bottom-color: var(--brand, #8A2B6B);
}
.dt-tab iconify-icon { font-size: 14px; }
.dt-tab-pane { display: none; }
.dt-tab-pane.active { display: block; }

/* ============================================================
   M4 · 全局模块间距统一（gap token）
   - 不破坏既有 margin-top 规则；通过 flex/gap 优先生效
   - section 之间用 --gap-section
   ============================================================ */
body.inner:not(.editor):not(.screen):not([class*="screen-"]) .inner-page {
  display: flex;
  flex-direction: column;
  gap: var(--gap-card);
  padding: var(--gap-page) calc(var(--gap-page) + 4px) calc(var(--gap-page) * 2 + 4px);
}
body.inner:not(.editor):not(.screen):not([class*="screen-"]) .inner-page > * + * { margin-top: 0; }
.section + .section { margin-top: var(--gap-section); }

/* ============================================================
   系统级 · 双栏「左目录/树 + 右工作区」（与 base.css 同步；仅链 ops-base 的页面依赖此段）
   ============================================================ */
.cat-main,
.cat-split,
.tag-layout,
.pm-layout,
.fn-body,
.ml-wrap,
.tl-main,
.bd-main,
.ddl-main,
.cfg-layout,
.dp-layout {
  align-items: start;
}

aside.cat-tree,
.pane.cat-tree,
.pane.pm-tree,
.fn-tree,
.ml-wrap > .tree-col,
.tl-side,
.bd-tree-panel,
.ddl-main > .panel:first-child,
.sql-body > .panel:first-child,
.flow-list,
.cfg-layout > .cfg-col:first-child,
body.inner:not(.editor):not(.screen):not([class*="screen-"]) .inner-page .layout > .panel:first-child,
body.inner:not(.editor):not(.screen):not([class*="screen-"]) .inner-page .layout > aside:first-child,
body.inner:not(.editor):not(.screen):not([class*="screen-"]) .inner-page .layout > .list-card,
body.inner:not(.editor):not(.screen):not([class*="screen-"]) .inner-page .layout > .nav,
body.inner:not(.editor):not(.screen):not([class*="screen-"]) .inner-page .layout > .cat-side,
body.inner-page:not(.is-editor):not(.screen):not([class*="screen-"]) > .layout > aside:first-child,
body.inner-page:not(.is-editor):not(.screen):not([class*="screen-"]) > .layout > .panel:first-child,
aside.api-tree {
  align-self: start;
  height: fit-content;
  min-height: 0;
  box-sizing: border-box;
}

.tree-body.dt-tree,
.pm-tree-body.dt-tree,
.pane.cat-tree > .cat-body,
.bd-tree-body,
.tl-side-body,
.ml-wrap .tree-col > .tree-body,
.cfg-layout > .cfg-col:first-child > .cfg-b,
.ddl-main > .panel:first-child > .body,
.sql-body > .panel:first-child > .panel-bd,
.flow-list > .list {
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
}

.flow-list > .hd {
  flex-shrink: 0;
}

.dt-split-grid {
  display: grid;
  align-items: start;
  justify-items: stretch;
}

/* ============================================================
   ops 紫色专属增强（M0 v6.1）
   - topbar 紫色顶部高光线
   - logo-icon 紫色渐变
   - 链接/按钮焦点 紫色
   ============================================================ */
.topbar { box-shadow: inset 0 2px 0 0 #8A2B6B; }
.app-shell .sidebar .logo-icon { background: linear-gradient(135deg, #8A2B6B 0%, #5C1A47 100%) !important; box-shadow: 0 4px 10px rgba(138,43,107,.32); }
.tb-user .avatar { background: linear-gradient(135deg, #8A2B6B 0%, #A33880 100%) !important; }
a { color: #8A2B6B; }
a:hover { color: #A33880; }
.btn-primary, button.primary { background: linear-gradient(180deg, #A33880 0%, #8A2B6B 100%); }
.btn-primary:hover, button.primary:hover { background: linear-gradient(180deg, #8A2B6B 0%, #6B1F52 100%); }

/* ============================================================
   DT.Tree 目录树 · v8.0 彻底重写（扁平 DOM · 紫主题）
   结构与 base.css 完全一致，仅品牌色改为紫色
   ============================================================ */
.dt-tree {
  font-size: 12.5px;
  line-height: 1.4;
  user-select: none;
  color: var(--ink-2, #475569);
}

.dt-tree .dtn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 0;
  cursor: pointer;
  color: inherit;
  min-width: 0;
}
.dt-tree .dtn[data-hidden] { display: none; }
.dt-tree .dtn:hover { background: var(--bg-hover, #F1F5F9); }
.dt-tree .dtn.active {
  background: var(--brand-50, #F5E6F0);
  color: var(--brand, #8A2B6B);
  font-weight: 500;
}
.dt-tree:not([data-style="colorbar"]) .dtn.active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--brand, #8A2B6B);
}

.dt-tree .dtn-tog {
  width: 16px; flex-shrink: 0;
  color: var(--ink-4, #94A3B8);
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.dt-tree .dtn-tog.is-empty { visibility: hidden; padding: 0 !important; width: 16px; height: auto; }
.dt-tree .dtn-tog iconify-icon { transition: transform .16s var(--ease, ease); }
.dt-tree .dtn.open > .dtn-tog iconify-icon { transform: rotate(90deg); }

.dt-tree .dtn-ic { color: var(--brand, #8A2B6B); flex-shrink: 0; }

.dt-tree .dtn-nm {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dt-tree .dtn-st {
  width: 7px; height: 7px; border-radius: 50%;
  background: #2BA26B; flex-shrink: 0;
}
.dt-tree .dtn-st.warn { background: #F2A832; }
.dt-tree .dtn-st.err  { background: #E5484D; }
.dt-tree .dtn-st.off  { background: #94A3B8; }

.dt-tree .dtn-cnt {
  font-size: 11px; color: var(--ink-3, #64748B);
  background: var(--bg-app-2, #F1F5F9);
  padding: 0 6px; border-radius: 10px;
  font-family: var(--font-num, monospace);
  margin-left: auto; flex-shrink: 0;
  line-height: 1.6;
}
.dt-tree .dtn.active .dtn-cnt { background: #fff; color: var(--brand, #8A2B6B); }

.dt-tree .dtn-acts {
  display: none;
  gap: 2px; margin-left: 4px; flex-shrink: 0;
}
.dt-tree .dtn:hover .dtn-acts,
.dt-tree .dtn.active .dtn-acts { display: inline-flex; }
.dt-tree .dtn-acts iconify-icon {
  width: 18px; height: 18px;
  display: inline-grid; place-items: center;
  color: var(--ink-3, #64748B); border-radius: 3px; cursor: pointer;
}
.dt-tree .dtn-acts iconify-icon:hover {
  background: var(--brand, #8A2B6B); color: #fff;
}

/* colorbar 模式（主题域 / 业务域树） */
.dt-tree[data-style="colorbar"] .dtn {
  padding: 6px 8px 6px 0;
  border-radius: 6px;
}
.dt-tree[data-style="colorbar"] .dtn.active { font-weight: normal; }
.dt-tree[data-style="colorbar"] .dtn.active .dtn-nm { font-weight: 600; }
.dt-tree[data-style="colorbar"] .dtn-bar {
  position: absolute; left: 2px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 2px; background: transparent;
  pointer-events: none;
}
.dt-tree[data-style="colorbar"] .dtn[data-level="lv1"] .dtn-bar { background: var(--brand, #8A2B6B); }
.dt-tree[data-style="colorbar"] .dtn[data-level="lv2"] .dtn-bar { background: #0E8A7C; }
.dt-tree[data-style="colorbar"] .dtn[data-level="lv3"] .dtn-bar { background: #7A5BD9; }
.dt-tree[data-style="colorbar"] .dtn[data-level="lv4"] .dtn-bar { background: #B07300; }
.dt-tree[data-style="colorbar"] .dtn[data-level="lv5"] .dtn-bar { background: #94A3B8; }
.dt-tree[data-style="colorbar"] .dtn-childcount {
  position: absolute; right: -4px; bottom: -2px;
  font-size: 9px; color: #94A3B8;
  font-family: var(--font-num, monospace);
  background: #fff; padding: 0 2px; border-radius: 3px; line-height: 11px;
  pointer-events: none;
}

.dtn-hl { background: #FFF8C5; color: #92400E; padding: 0 1px; border-radius: 2px; }

.dtn-popover {
  position: absolute; right: 8px; top: 28px; z-index: 100;
  background: #fff; border: 1px solid var(--line-1, #E5E7EB);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 4px; min-width: 140px;
}
.dtn-popover .it {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 4px; cursor: pointer; font-size: 12.5px;
  color: var(--ink-1, #0F1A33);
}
.dtn-popover .it iconify-icon { color: var(--ink-3, #64748B); flex-shrink: 0; }
.dtn-popover .it:hover { background: #F1F5F9; color: var(--brand, #8A2B6B); }
.dtn-popover .it:hover iconify-icon { color: var(--brand, #8A2B6B); }
.dtn-popover .it.danger { color: #DC2626; }
.dtn-popover .it.danger iconify-icon { color: #DC2626; }
.dtn-popover .it.danger:hover { background: #FEE2E2; color: #DC2626; }

.dt-tree-resizer {
  position: absolute; right: -2px; top: 0; bottom: 0; width: 4px;
  cursor: col-resize; z-index: 5;
  background: transparent; transition: background .15s;
}
.dt-tree-resizer:hover { background: rgba(138,43,107,.18); }