/* ==========================================================
   企业电商化采购平台 · 设计系统 v2
   桌面端 1440 基准 / 零媒体查询 / 企业风浅色
   原则：白底 + 细线 + 克制的蓝；层级靠字重与留白，不靠色块
   ========================================================== */

:root {
  /* 底色 */
  --bg: #f4f6fa;
  --bg-2: #eef1f7;
  --panel: #ffffff;
  --panel-2: #fbfcfe;

  /* 线 */
  --line: #e5eaf2;
  --line-2: #eef1f6;
  --line-3: #d8e0ec;

  /* 文字 */
  --text: #16202e;
  --text-2: #354052;
  --muted: #667085;
  --muted-2: #8a94a6;

  /* 主色 */
  --primary: #1d4ed8;
  --primary-rgb: 29, 78, 216;
  --primary-2: #2f68e8;
  --primary-ink: #16357f;
  --primary-soft: #eff4ff;
  --primary-line: #d3e0fb;

  /* 语义色 */
  --ok: #0b7a55;
  --ok-2: #12a06d;
  --ok-soft: #e9f7f1;
  --ok-line: #c9e9dc;
  --warn: #a5670f;
  --warn-soft: #fdf4e3;
  --warn-line: #f0dcb6;
  --danger: #c62f27;
  --danger-soft: #fdeeec;
  --danger-line: #f2cdc8;

  /* 阴影 */
  --sh-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
  --sh-2: 0 2px 4px rgba(16, 24, 40, .05), 0 8px 20px rgba(16, 24, 40, .06);
  --sh-3: 0 20px 60px rgba(15, 25, 45, .22);
  --sh-primary: 0 1px 2px rgba(var(--primary-rgb), .18), 0 4px 12px rgba(var(--primary-rgb), .14);

  /* 圆角 */
  --r: 12px;
  --r-md: 10px;
  --r-sm: 8px;
  --r-xs: 6px;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-width: 1440px;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #d6e3ff; color: var(--primary-ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d7dee9; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c2ccdb; }
::-webkit-scrollbar-track { background: transparent; }

h1, h2, h3, h4, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }
b, strong { font-weight: 600; color: var(--text); }
table { border-collapse: collapse; width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: 13px; color: inherit; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.brand {
  display: flex; gap: 11px; align-items: center;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--line-2);
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  background: linear-gradient(145deg, var(--primary-ink) 0%, var(--primary) 55%, var(--primary-2) 100%);
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), .28), inset 0 1px 0 rgba(255, 255, 255, .35);
  letter-spacing: -.02em;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-txt strong { font-size: 13px; letter-spacing: -.01em; }
.brand-txt span { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; letter-spacing: .01em; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px 18px; }
.nav-group { margin-bottom: 4px; }
.nav-group > h4 {
  font-size: 10.5px; color: var(--muted-2); font-weight: 600;
  letter-spacing: .06em; padding: 10px 10px 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-group > h4 span:last-child {
  font-size: 10px; color: #a8b1c0; font-weight: 500;
  background: var(--bg-2); border-radius: 20px; padding: 0 6px; letter-spacing: 0;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px; border-radius: var(--r-xs);
  color: var(--text-2); cursor: pointer; font-size: 12.5px;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.nav-item:hover { background: #f3f6fc; color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, #eef4ff 0%, #f6f9ff 100%);
  color: var(--primary); font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px; color: #a3adbd; flex: 0 0 32px;
  letter-spacing: -.02em;
}
.nav-item.active .nav-code { color: var(--primary); }
.nav-item.disabled { opacity: .38; cursor: default; }
.nav-item.disabled:hover { background: transparent; }

.sidebar-foot {
  padding: 12px 16px 16px; border-top: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(255,255,255,0), #fafbfe);
}
.demo-flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; letter-spacing: .1em; font-weight: 600;
  color: var(--warn); background: var(--warn-soft);
  border: 1px solid var(--warn-line); border-radius: 4px;
  padding: 1px 6px; margin-bottom: 7px;
}
.demo-flag::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.sidebar-foot p { font-size: 10.5px; color: var(--muted-2); line-height: 1.55; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px; flex: 0 0 58px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 36px; position: sticky; top: 0; z-index: 20;
}
.tb-left { display: flex; align-items: center; gap: 14px; }
.crumb {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
}
.crumb::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}
.role-switch { display: flex; align-items: center; gap: 6px; }
.role-label { font-size: 10.5px; color: var(--muted-2); }
.role-select {
  border: 1px solid var(--line); border-radius: 20px;
  padding: 3px 10px; background: #fbfcfe; outline: none;
  font-size: 12px; color: var(--text-2); cursor: pointer;
  transition: border-color .14s, box-shadow .14s;
}
.role-select:hover { border-color: var(--line-3); }
.role-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1); }

.tb-right { display: flex; align-items: center; gap: 16px; }
.org-box { display: flex; align-items: center; gap: 9px; text-align: right; line-height: 1.32; }
.org-box::before {
  content: "中"; order: 2;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(145deg, #eaf1ff, #dbe8ff);
  color: var(--primary); font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--primary-line); flex: 0 0 26px;
}
.org-name { display: block; font-size: 11.5px; color: var(--text-2); }
.org-budget { font-size: 10.5px; color: var(--muted-2); }
.org-budget b { color: var(--ok); font-size: 11px; font-variant-numeric: tabular-nums; }

.view { padding: 26px 36px 44px; }
.foot {
  padding: 16px 36px 24px; font-size: 10.5px; color: #a3adbd;
  border-top: 1px solid var(--line-2); margin-top: auto; letter-spacing: .01em;
}

/* ---------- 页头 ---------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 18px; gap: 20px;
}
.page-head h2 {
  font-size: 20px; font-weight: 600; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px; color: var(--text);
  line-height: 1.4;
}
.page-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; max-width: 980px; }
.page-actions { display: flex; gap: 8px; flex: 0 0 auto; padding-top: 2px; }
.page-head .tagline {
  display: inline-flex; align-items: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px; font-weight: 500; letter-spacing: .02em;
  color: var(--primary-ink); background: var(--primary-soft);
  border: 1px solid var(--primary-line); border-radius: 5px;
  padding: 1px 6px; vertical-align: 2px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.card:hover { box-shadow: var(--sh-2); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #fdfeff, #fbfcfe);
  gap: 12px;
}
.card-head h3 {
  font-size: 13px; font-weight: 600; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.card-head .hint { font-size: 10.5px; color: var(--muted-2); }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ---------- KPI ---------- */
.kpi {
  position: relative;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px 13px;
  box-shadow: var(--sh-1); overflow: hidden;
  transition: box-shadow .18s var(--ease);
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}
.kpi:hover { box-shadow: var(--sh-2); }
.kpi .k-label {
  font-size: 11px; color: var(--muted); letter-spacing: .01em;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.kpi .k-value {
  font-size: 26px; font-weight: 600; letter-spacing: -.03em;
  margin-top: 3px; color: var(--text); line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi .k-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi .k-foot { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; }
.kpi.alert { background: linear-gradient(180deg, #fffdfd, #fff); border-color: var(--danger-line); }
.kpi.alert::before { background: linear-gradient(180deg, var(--danger), #ec7a6c); }
.kpi.alert .k-value { color: var(--danger); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 31px; padding: 0 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line-3); background: #fff; color: var(--text-2);
  cursor: pointer; white-space: nowrap; font-size: 12.5px;
  transition: all .14s var(--ease);
  box-shadow: 0 1px 1px rgba(16, 24, 40, .03);
}
.btn:hover { border-color: #c1cddf; background: #fafcff; color: var(--text); box-shadow: 0 2px 6px rgba(16, 24, 40, .06); }
.btn:active { transform: translateY(.5px); }
.btn.primary {
  background: linear-gradient(180deg, #2a5ce4, var(--primary));
  border-color: #1a45c4; color: #fff; box-shadow: var(--sh-primary);
}
.btn.primary:hover { background: linear-gradient(180deg, #3569ee, #2050dc); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger-line); background: #fffafa; }
.btn.danger:hover { background: var(--danger-soft); border-color: #e8b6b0; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: #f3f6fc; border-color: transparent; color: var(--text); }
.btn.sm { height: 27px; padding: 0 10px; font-size: 11.5px; border-radius: var(--r-xs); }
.btn.lg { height: 37px; padding: 0 20px; font-size: 13px; border-radius: 9px; }
.btn[disabled], .btn[disabled]:hover {
  opacity: .44; cursor: not-allowed; box-shadow: none; transform: none;
  background: #f7f9fc; border-color: var(--line); color: var(--muted-2);
}
.btn-link {
  color: var(--primary); cursor: pointer; font-size: 12px;
  border-bottom: 1px solid transparent; transition: border-color .14s, color .14s;
}
.btn-link:hover { color: var(--primary-2); border-bottom-color: var(--primary-line); }
.btn-link + .btn-link { margin-left: 12px; }
.tag + .btn-link, .tag + .btn { margin-left: 12px; }

.icon-btn {
  width: 28px; height: 28px; border-radius: var(--r-xs);
  border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 13px;
  transition: all .14s;
}
.icon-btn:hover { background: #f3f6fc; color: var(--text); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: 10.5px; line-height: 1; white-space: nowrap;
  background: #f2f5fa; color: #5b6577;
  border: 1px solid transparent; font-weight: 500;
  letter-spacing: .01em;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.tag.info { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-line); }
.tag.plain { background: #fff; border-color: var(--line); color: var(--muted); }
.tag.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { font-size: 12.5px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--muted);
  background: #f9fbfd; border-bottom: 1px solid var(--line);
  padding: 9px 14px; white-space: nowrap; font-size: 11px;
  letter-spacing: .02em;
}
.tbl td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle; color: var(--text-2);
}
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #f8fbff; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 600; color: var(--text); }
.tbl .muted { color: var(--muted-2); font-size: 11px; }
.tbl .mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px; color: #4a5568; letter-spacing: -.01em;
}
.tbl .row-actions { white-space: nowrap; }
.tbl a:hover { text-decoration: underline; text-underline-offset: 2px; }

.filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 16px; border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #fdfeff, #fbfcfe);
}
.filter-bar .spacer { flex: 1; }
.field { display: flex; align-items: center; gap: 6px; }
.field > label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.input, .select {
  height: 30px; padding: 0 10px; border: 1px solid var(--line-3);
  border-radius: var(--r-xs); background: #fff; outline: none;
  min-width: 120px; font-size: 12.5px; color: var(--text-2);
  transition: border-color .14s, box-shadow .14s;
}
.input::placeholder { color: #a9b2c1; }
.input:hover, .select:hover { border-color: #c1cddf; }
.input:focus, .select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1);
}
.input.wide { min-width: 420px; }
textarea.input { line-height: 1.65; padding: 10px; resize: vertical; }

input[type="range"] {
  -webkit-appearance: none; height: 4px; border-radius: 4px;
  background: #e6ebf3; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary); cursor: pointer;
  box-shadow: 0 1px 4px rgba(var(--primary-rgb), .3);
}

.pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--line-2);
  font-size: 11px; color: var(--muted);
  background: #fdfeff;
}
.pager .pages { display: flex; gap: 4px; }
.pager .pg {
  min-width: 27px; height: 27px; border-radius: var(--r-xs);
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; color: var(--muted); transition: all .14s;
}
.pager .pg:hover { border-color: var(--line-3); color: var(--text); }
.pager .pg.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--sh-primary); }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(14, 22, 36, .36);
  backdrop-filter: blur(2px);
  z-index: 100; display: flex; justify-content: flex-end;
}
.drawer-mask.hidden { display: none; }
.drawer {
  width: 640px; background: #fff; height: 100%;
  display: flex; flex-direction: column;
  box-shadow: var(--sh-3); animation: slideIn .22s var(--ease);
}
@keyframes slideIn { from { transform: translateX(28px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fdfeff, #fbfcfe);
}
.drawer-head h3 { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.drawer-body { padding: 18px 20px 32px; overflow-y: auto; }

/* ---------- 表单 / 键值 ---------- */
.kv { display: grid; grid-template-columns: 118px 1fr; gap: 10px 14px; font-size: 12.5px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; color: var(--text); }
.kv dd .mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }

.section-title {
  font-size: 12px; font-weight: 600; color: var(--text);
  margin: 20px 0 10px; padding-left: 9px;
  border-left: 3px solid var(--primary); line-height: 1.3;
  letter-spacing: -.01em;
}
.section-title:first-child { margin-top: 0; }

.notice {
  border-radius: var(--r-sm); padding: 10px 13px; font-size: 12px;
  background: #f7f9fd; border: 1px solid var(--line); color: #4b5768;
  display: flex; gap: 8px; align-items: flex-start; line-height: 1.6;
}
.notice.warn { background: var(--warn-soft); border-color: var(--warn-line); color: #7a5518; }
.notice.danger { background: var(--danger-soft); border-color: var(--danger-line); color: #8f2b24; }
.notice.ok { background: var(--ok-soft); border-color: var(--ok-line); color: #0d5c42; }
.notice b { font-weight: 600; flex: 0 0 auto; }
.notice b + span { flex: 1; }

/* ---------- 价格 ---------- */
.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-now {
  font-size: 31px; font-weight: 600; color: var(--danger);
  letter-spacing: -.04em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.price-now .cur { font-size: 16px; margin-right: 2px; font-weight: 500; }
.price-unit { font-size: 11.5px; color: var(--muted); }
.price-list { font-size: 12px; color: var(--muted-2); text-decoration: line-through; }
.price-guide { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

/* ---------- 商品行 ---------- */
.sku-list { display: flex; flex-direction: column; }
.sku-row {
  display: grid; grid-template-columns: 76px 1fr 210px 150px 132px;
  gap: 14px; padding: 15px 16px; border-bottom: 1px solid var(--line-2);
  align-items: center; transition: background .14s;
}
.sku-row:hover { background: #f8fbff; }
.sku-row:last-child { border-bottom: none; }
.sku-thumb {
  width: 76px; height: 76px; border-radius: 10px;
  background: linear-gradient(145deg, #f4f7fc 0%, #eaf0f9 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10.5px; color: #93a0b4; border: 1px solid var(--line-2);
  gap: 2px; letter-spacing: .02em; text-align: center; line-height: 1.4;
  font-family: ui-monospace, Menlo, monospace;
}
.sku-title { font-size: 13px; font-weight: 500; line-height: 1.5; }
.sku-title a { color: var(--text); }
.sku-title a:hover { color: var(--primary); }
.sku-meta {
  font-size: 11px; color: var(--muted-2); margin-top: 4px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.sku-meta .mono { color: #5b6a80; }
.sku-price .p {
  font-size: 17px; font-weight: 600; color: var(--danger);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.sku-price .p small { font-size: 10.5px; font-weight: 400; color: var(--muted); }
.sku-price .tier { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; line-height: 1.5; }
.sku-stock { font-size: 12px; }
.sku-stock .eta { color: var(--muted); font-size: 10.5px; margin-top: 4px; }
.sku-buy { display: flex; flex-direction: column; gap: 6px; }

/* 左筛选 */
.catalog-layout { display: grid; grid-template-columns: 218px 1fr; gap: 16px; align-items: start; }
.filter-panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px 0 12px; position: sticky; top: 74px;
  box-shadow: var(--sh-1);
}
.fp-group { padding: 11px 14px 8px; border-bottom: 1px solid var(--line-2); }
.fp-group:last-child { border-bottom: none; }
.fp-group h5 {
  font-size: 10.5px; color: var(--muted-2); font-weight: 600;
  margin-bottom: 7px; letter-spacing: .05em;
}
.fp-item {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 4px 6px; margin: 0 -6px; border-radius: var(--r-xs);
  color: var(--text-2); cursor: pointer; transition: all .12s;
}
.fp-item:hover { background: #f4f7fc; color: var(--primary); }
.fp-item.on { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.fp-cnt { margin-left: auto; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* ---------- 时间轴 ---------- */
.timeline { padding-left: 4px; }
.tl-item { position: relative; padding: 0 0 22px 26px; border-left: 2px solid var(--line-2); }
.tl-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid #cfd9e8;
  box-shadow: 0 0 0 3px #fff;
}
.tl-item.done::before { background: var(--ok-2); border-color: var(--ok-2); }
.tl-item.doing::before {
  background: var(--primary); border-color: var(--primary);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(var(--primary-rgb), .12);
}
.tl-item .tl-t { font-size: 12.5px; font-weight: 600; color: var(--text); }
.tl-item .tl-d { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.tl-item .tl-x { font-size: 10.5px; color: var(--muted-2); margin-top: 5px; }

/* ---------- 步骤条 ---------- */
.steps { display: flex; margin-bottom: 22px; }
.step { flex: 1; position: relative; text-align: center; }
.step::after {
  content: ""; position: absolute; top: 14px; left: 50%; width: 100%;
  height: 2px; background: var(--line);
}
.step:last-child::after { display: none; }
.step .dot {
  width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 7px;
  background: #fff; border: 2px solid var(--line-3); color: var(--muted-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600;
  position: relative; z-index: 1;
  transition: all .18s var(--ease);
}
.step .t { font-size: 11.5px; color: var(--muted); }
.step.on .dot {
  border-color: var(--primary); background: var(--primary); color: #fff;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12);
}
.step.on .t { color: var(--primary); font-weight: 600; }
.step.ok .dot { border-color: var(--ok-2); background: var(--ok-2); color: #fff; }
.step.ok .t { color: var(--ok); }

/* ---------- 三栏比价 ---------- */
.compare-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cmp-card {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 15px; background: linear-gradient(180deg, #fdfeff, #fbfcfe);
  min-height: 106px; display: flex; flex-direction: column;
}
.cmp-card .v { margin-top: 6px; }
.cmp-card.self {
  border-color: var(--primary-line);
  background: linear-gradient(180deg, #f7faff, #f1f6ff);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), .04);
}
.cmp-card h5 { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.cmp-card .v {
  font-size: 22px; font-weight: 600; margin: 5px 0 3px;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text);
}
.cmp-card .s { font-size: 10.5px; color: var(--muted-2); line-height: 1.5; }

/* ---------- 进度条 ---------- */
.bar { height: 6px; border-radius: 4px; background: #eaeff6; overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width .4s var(--ease);
}
.bar.ok > i { background: linear-gradient(90deg, var(--ok), var(--ok-2)); }
.bar.warn > i { background: linear-gradient(90deg, #b7791f, #e3a53a); }
.bar.danger > i { background: linear-gradient(90deg, #c62f27, #e8695f); }

/* ---------- 状态页 ---------- */
.state { padding: 60px 20px; text-align: center; color: var(--muted-2); font-size: 12.5px; }
.state .ico { font-size: 30px; margin-bottom: 10px; opacity: .35; }
.state b { display: block; color: var(--text-2); font-size: 13px; margin-bottom: 6px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 42px; transform: translateX(-50%);
  background: rgba(22, 32, 46, .95); color: #fff;
  padding: 11px 20px; border-radius: 10px;
  font-size: 12.5px; z-index: 300;
  box-shadow: 0 12px 32px rgba(15, 25, 45, .28);
  animation: toastIn .2s var(--ease);
  backdrop-filter: blur(6px);
}
@keyframes toastIn { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast.hidden { display: none; }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); padding: 0 16px; }
.tab {
  padding: 12px 0; font-size: 12.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: color .14s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab .cnt {
  font-size: 10px; color: var(--muted-2); margin-left: 5px;
  background: var(--bg-2); border-radius: 20px; padding: 1px 6px;
}
.tab.on .cnt { background: var(--primary-soft); color: var(--primary); }

/* ---------- 提醒条 ---------- */
.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--r-md); margin-bottom: 16px;
  font-size: 12.5px; border: 1px solid; line-height: 1.55;
}
.banner.warn { background: var(--warn-soft); border-color: var(--warn-line); color: #7a5518; }
.banner.danger { background: var(--danger-soft); border-color: var(--danger-line); color: #8f2b24; }
.banner.info { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-ink); }
.banner b { flex: 0 0 auto; }
.banner .spacer { flex: 1; }

/* ---------- 清单 ---------- */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.55; }
.check-box {
  width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--line-3);
  flex: 0 0 15px; margin-top: 3px; display: flex; align-items: center;
  justify-content: center; font-size: 9px; color: #fff; background: #fff;
}
.check-item.done .check-box { background: var(--ok-2); border-color: var(--ok-2); }
.check-item.done .check-box::after { content: "✓"; }
.check-item.warn .check-box { background: #e0a13a; border-color: #e0a13a; }
.check-item.warn .check-box::after { content: "!"; font-weight: 700; }
.check-item .ck-s { display: block; color: var(--muted-2); font-size: 10.5px; margin-top: 2px; line-height: 1.5; }

/* ---------- 附件 ---------- */
.attach {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  border: 1px dashed var(--line-3); border-radius: var(--r-sm);
  font-size: 11.5px; color: var(--muted); background: #fcfdff;
  transition: all .14s;
}
.attach:hover { border-color: var(--primary-line); background: #f9fbff; }
.attach .nm { color: var(--text-2); font-weight: 500; }
.attach .sz { font-size: 10.5px; color: var(--muted-2); }

/* ---------- 页面地图 ---------- */
.map-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.map-item {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; background: #fff;
  display: flex; flex-direction: column; gap: 5px;
  transition: all .16s var(--ease);
}
.map-item .code {
  font-family: ui-monospace, Menlo, monospace; font-size: 9.5px;
  color: var(--muted-2); letter-spacing: .02em;
}
.map-item .nm { font-size: 12.5px; font-weight: 500; color: var(--text); }
.map-item .st { font-size: 10.5px; }
.map-item.on { cursor: pointer; border-color: #dfe7f3; }
.map-item.on:hover {
  border-color: var(--primary-line); box-shadow: var(--sh-2);
  transform: translateY(-1px);
}
.map-item.off { opacity: .55; background: #fbfcfe; }

/* ---------- 杂项 ---------- */
.hr { height: 1px; background: var(--line-2); margin: 16px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.fs11 { font-size: 11px; } .fs12 { font-size: 12px; }
.muted { color: var(--muted); } .muted2 { color: var(--muted-2); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: -.01em; }
.hl { background: #fff6d8; padding: 0 3px; border-radius: 3px; }

/* ==========================================================
   v2.1 · 图标 / 图表 / 行内操作
   ========================================================== */

.i { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }
.btn .i { width: 15px; height: 15px; vertical-align: -3px; opacity: .92; }
.btn.primary .i { opacity: .95; }
.tag .i { width: 11px; height: 11px; vertical-align: -1px; }
.tabs .i, .nav-item .i { width: 15px; height: 15px; }

/* 行内操作 */
.act {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--primary); cursor: pointer; font-size: 12px;
  padding: 2px 0; transition: color .13s;
}
.act:hover { color: var(--primary-2); }
.act .i { width: 13px; height: 13px; }
.act + .act { margin-left: 14px; }
.act.danger { color: var(--danger); }
.act.danger:hover { color: #a8251f; }
.act.muted { color: var(--muted); }

.act-only {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--r-xs);
  color: var(--muted); cursor: pointer; transition: all .13s;
}
.act-only:hover { background: #f1f5fd; color: var(--primary); }
.act-only.danger:hover { background: var(--danger-soft); color: var(--danger); }
.act-only + .act-only { margin-left: 2px; }

/* KPI 右上角淡图标 */
.kpi .k-lb { display: inline-flex; align-items: center; gap: 5px; }
.kpi .k-lb .i { color: #9fb2cf; width: 13px; height: 13px; }
.kpi.alert .k-ico { color: #e4b7b2; }

/* 空状态图标 */
.state .ico svg { color: #c3cfe2; }

/* 导航分组图标 */
.nav-group > h4 .i { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; }
.nav-group > h4 span:first-child { display: inline-flex; align-items: center; }

/* ---------- 图表 ---------- */
.spark { margin: 2px 0 0; }
.donut-wrap { position: relative; margin: 0; flex: 0 0 auto; }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
  font-size: 18px; font-weight: 600; letter-spacing: -.02em; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.donut-center small { display: block; font-size: 10px; font-weight: 500; color: var(--muted-2); letter-spacing: 0; }
.legend { display: flex; flex-direction: column; gap: 7px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-2); }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; }
.legend-val { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11px; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 68px; align-items: center; gap: 10px; }
.bar-lb { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 7px; border-radius: 4px; background: #eef2f8; overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 4px; }
.bar-vl { font-size: 11px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }

/* 图表卡内的说明 */
.chart-cap { font-size: 10.5px; color: var(--muted-2); margin-top: 10px; line-height: 1.55; }
.axis-x { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted-2); margin-top: 6px; }

/* ==========================================================
   v3 · Vben 风格外壳：多标签 / 面包屑 / 折叠侧栏 / 顶栏图标
   ========================================================== */

/* 面包屑 */
.cb { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.cb-s { color: #cbd5e4; font-style: normal; font-size: 11px; }
.cb-i { color: var(--muted); }
.cb-g { color: var(--muted); }
.cb-c { color: var(--text); font-weight: 600; }

/* 顶栏图标组 */
.tb-icons { display: flex; align-items: center; gap: 1px; }
.tb-ico {
  position: relative; width: 30px; height: 30px; border-radius: 6px;
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all .14s;
}
.tb-ico:hover { background: #f2f6fd; color: var(--primary); }
.tb-ico .i { width: 16px; height: 16px; }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 14px; height: 14px;
  border-radius: 7px; background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 600; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 1.5px solid #fff;
}

/* 多标签栏 */
.tabbar {
  height: 39px; flex: 0 0 39px;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; position: sticky; top: 58px; z-index: 19;
}
.tabs-scroll { display: flex; align-items: center; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs-scroll::-webkit-scrollbar { height: 0; }
.vtab {
  display: inline-flex; align-items: center; gap: 6px; height: 26px;
  padding: 0 7px 0 9px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--line); background: #fbfcfe;
  font-size: 11.5px; color: var(--text-2); white-space: nowrap;
  transition: all .13s;
}
.vtab:hover { border-color: var(--primary-line); color: var(--primary); }
.vtab.on {
  background: var(--primary-soft); border-color: var(--primary-line);
  color: var(--primary); font-weight: 600;
}
.vt-dot { width: 5px; height: 5px; border-radius: 50%; background: #c8d2e2; flex: 0 0 5px; }
.vtab.on .vt-dot { background: var(--primary); }
.vt-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 3px; font-style: normal;
  color: var(--muted-2); opacity: .55;
}
.vtab:hover .vt-x { opacity: 1; }
.vt-x:hover { background: #e6ecf7; color: var(--danger); }
.vt-empty { font-size: 11.5px; color: var(--muted-2); }

.tabs-acts { display: flex; gap: 2px; flex: 0 0 auto; }
.tabs-act {
  width: 24px; height: 24px; border-radius: 5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all .13s;
}
.tabs-act:hover { background: #f2f6fd; color: var(--primary); }

/* 侧栏折叠 */
.collapse-btn {
  margin-left: auto; width: 22px; height: 22px; flex: 0 0 22px;
  border: 1px solid var(--line); border-radius: 5px; background: #fff;
  color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.collapse-btn:hover { border-color: var(--primary-line); color: var(--primary); }

.app.collapsed .sidebar { width: 64px; flex: 0 0 64px; }
.app.collapsed .brand { padding: 18px 12px 16px; justify-content: center; }
.app.collapsed .brand-txt,
.app.collapsed .nav-txt,
.app.collapsed .ng-name,
.app.collapsed .nav-cnt,
.app.collapsed .sidebar-foot { display: none; }
.app.collapsed .collapse-btn { position: absolute; right: -11px; top: 62px; transform: rotate(180deg); background: #fff; z-index: 5; }
.app.collapsed .nav { padding: 10px 8px; }
.app.collapsed .nav-item { justify-content: center; padding: 7px 0; }
.app.collapsed .nav-code { flex: none; font-size: 10px; }
.app.collapsed .nav-group { margin-bottom: 4px; }
.app.collapsed .nav-group > h4 {
  justify-content: center; padding: 7px 0; border-radius: var(--r-xs);
  color: var(--muted-2); transition: background .14s var(--ease), color .14s var(--ease);
}
.app.collapsed .nav-group > h4:hover { background: var(--bg-2); color: var(--primary); }
.app.collapsed .nav-group.on > h4 { color: var(--primary); background: var(--primary-soft); }
.app.collapsed .nav-group > h4 .chev { display: none; }
.app.collapsed .nav-item.active::before { left: -8px; }

/* 分组折叠 */
.nav-group.folded .nav-item { display: none; }
.nav-group.folded > h4 { opacity: .68; }
.nav-group > h4 { cursor: pointer; user-select: none; }

/* 设置项 */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 13px 0; border-bottom: 1px solid var(--line-2);
}
.set-row b { font-size: 12.5px; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: 0 0 36px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; background: #d6dee9; border-radius: 20px;
  transition: background .18s; cursor: pointer;
}
.switch i::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .2);
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(16px); }

/* 紧凑密度 */
body.compact .view { padding: 18px 36px 32px; }
body.compact .tbl td { padding: 7px 14px; }
body.compact .tbl th { padding: 7px 14px; }
body.compact .card-body { padding: 12px; }
body.compact .card { margin-bottom: 12px; }
body.compact .kpi { padding: 11px 14px 10px; }
body.compact .kpi .k-value { font-size: 22px; }
body.compact .page-head { margin-bottom: 12px; }
body.compact .page-head h2 { font-size: 18px; }
body.compact .sku-row { padding: 11px 16px; }

/* 表格工具栏 */
.tbl-tools { display: inline-flex; align-items: center; gap: 1px; margin-left: 10px; }
.tt {
  width: 24px; height: 24px; border-radius: 5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-2); transition: all .13s;
}
.tt:hover { background: #f2f6fd; color: var(--primary); }

/* 顶栏图标与组织信息之间的分隔 */
.tb-icons { border-right: 1px solid var(--line-2); padding-right: 8px; margin-right: 6px; }

/* ==========================================================
   登录页
   ========================================================== */
.app.auth .sidebar,
.app.auth .topbar,
.app.auth .tabbar,
.app.auth .foot { display: none; }
.app.auth .view { padding: 0; }
.app.auth .main { min-height: 100vh; }

.auth { display: flex; min-height: 100vh; }

.auth-left {
  flex: 0 0 56%; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #081734 0%, #12275a 42%, var(--primary) 100%);
  color: #fff; padding: 40px 48px; display: flex; flex-direction: column;
}
.auth-deco { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-deco.d1 {
  width: 560px; height: 560px; right: -180px; top: -140px;
  background: radial-gradient(circle at 32% 32%, rgba(96, 158, 255, .30), transparent 62%);
  border: 1px solid rgba(255, 255, 255, .08);
}
.auth-deco.d2 {
  width: 360px; height: 360px; left: -130px; bottom: -110px;
  background: radial-gradient(circle, rgba(70, 120, 255, .24), transparent 66%);
}
.auth-deco.d3 { width: 200px; height: 200px; right: 90px; bottom: 130px; border-color: rgba(255, 255, 255, .12); }

.auth-brand { display: flex; gap: 12px; align-items: center; position: relative; z-index: 2; }
.auth-brand .brand-mark {
  width: 38px; height: 38px; border-radius: 10px; font-size: 17px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
  box-shadow: none;
}
.auth-brand-txt strong { font-size: 14px; color: #fff; }
.auth-brand-txt span { display: block; font-size: 10px; color: rgba(255, 255, 255, .55); letter-spacing: .06em; margin-top: 2px; }

.auth-hero { margin: auto 0; position: relative; z-index: 2; max-width: 520px; }
.auth-hero h1 {
  font-size: 38px; line-height: 1.3; letter-spacing: -.02em;
  font-weight: 600; color: #fff;
}
.auth-hero p { margin-top: 15px; font-size: 13px; color: rgba(255, 255, 255, .70); }
.auth-points { margin-top: 38px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.ap { display: flex; gap: 11px; align-items: flex-start; }
.ap-ico {
  width: 32px; height: 32px; border-radius: 8px; flex: 0 0 32px;
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .16);
  display: flex; align-items: center; justify-content: center; color: #a8c6ff;
}
.ap b { display: block; font-size: 12.5px; color: #fff; font-weight: 600; }
.ap span { display: block; font-size: 11px; color: rgba(255, 255, 255, .58); margin-top: 3px; }

.auth-left-foot {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 10px;
  font-size: 10.5px; color: rgba(255, 255, 255, .48);
}
.auth-left-foot i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .38); }

.auth-right {
  flex: 1; background: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 56px; position: relative;
}
.auth-form { width: 100%; max-width: 392px; }
.auth-htop { display: flex; align-items: center; justify-content: space-between; }
.auth-welcome { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.auth-sub { font-size: 12px; color: var(--muted); margin: 6px 0 22px; }

.auth-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.at {
  padding: 0 0 10px; font-size: 12.5px; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.at:hover { color: var(--text); }
.at.on { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

.auth-field { margin-bottom: 14px; }
.auth-field > label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.af-wrap {
  display: flex; align-items: center; gap: 8px; height: 38px;
  border: 1px solid var(--line-3); border-radius: 8px; padding: 0 11px;
  background: #fff; transition: all .14s;
}
.af-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .10); }
.af-wrap .i { color: #9fb0c9; }
.af-wrap .input { border: none; box-shadow: none; height: auto; padding: 0; flex: 1; min-width: 0; background: transparent; }
.af-wrap .input:focus { box-shadow: none; }
.af-eye { cursor: pointer; color: #9fb0c9; display: inline-flex; }
.af-eye:hover { color: var(--primary); }

.captcha {
  width: 92px; height: 38px; border-radius: 8px; border: 1px solid var(--line);
  background: linear-gradient(135deg, #f2f6fd, #e4edfb);
  display: flex; align-items: center; justify-content: center;
  font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 600;
  letter-spacing: 5px; color: #25406b; cursor: pointer; user-select: none;
  text-decoration: line-through; text-decoration-color: rgba(37, 64, 107, .26);
}
.cap-refresh {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--muted); cursor: pointer;
}
.cap-refresh:hover { background: #f2f6fd; color: var(--primary); }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 12px; }
.chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); }
.chk input { display: none; }
.chk i { width: 15px; height: 15px; border: 1.5px solid var(--line-3); border-radius: 4px; display: inline-block; position: relative; }
.chk input:checked + i { background: var(--primary); border-color: var(--primary); }
.chk input:checked + i::after {
  content: "✓"; position: absolute; inset: 0; color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}

.auth-submit { width: 100%; height: 42px; font-size: 14px; letter-spacing: .08em; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 14px; color: var(--muted-2); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.auth-others { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ao {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 11px 6px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); cursor: pointer; transition: all .14s; font-size: 11px;
}
.ao:hover { border-color: var(--primary-line); color: var(--primary); background: #f9fbff; }
.ao em { font-style: normal; }

.auth-demo {
  margin-top: 20px; background: #f7f9fd; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 11.5px; color: #4b5768;
  display: flex; gap: 8px; line-height: 1.6;
}
.auth-demo b { color: var(--primary-ink); flex: 0 0 auto; }
.auth-legal { margin-top: 14px; font-size: 10.5px; color: var(--muted-2); text-align: center; }
.auth-legal a { color: var(--muted); }
.auth-copy { position: absolute; bottom: 18px; font-size: 10.5px; color: #a9b2c1; }

.spin {
  width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff; border-radius: 50%; display: inline-block;
  animation: spin .7s linear infinite; margin-right: 6px; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================
   v3.1 · 动效层（参考 Vben 过渡）
   ========================================================== */

@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes popIn  { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawLine { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

/* 路由切换：内容逐块入场 */
.view.anim > * { animation: pageIn .34s var(--ease) both; }
.view.anim > *:nth-child(1) { animation-delay: .00s; }
.view.anim > *:nth-child(2) { animation-delay: .045s; }
.view.anim > *:nth-child(3) { animation-delay: .085s; }
.view.anim > *:nth-child(4) { animation-delay: .12s; }
.view.anim > *:nth-child(5) { animation-delay: .15s; }
.view.anim > *:nth-child(n+6) { animation-delay: .17s; }

/* 卡片内的图表 / 图表条轻微上浮 */
.view.anim .donut-wrap,
.view.anim .spark,
.view.anim .bars { animation: fadeUp .5s var(--ease) both; animation-delay: .12s; }
.view.anim .bar-row { animation: fadeUp .42s var(--ease) both; }
.view.anim .bar-row:nth-child(1) { animation-delay: .10s; }
.view.anim .bar-row:nth-child(2) { animation-delay: .14s; }
.view.anim .bar-row:nth-child(3) { animation-delay: .18s; }
.view.anim .bar-row:nth-child(4) { animation-delay: .22s; }
.view.anim .bar-row:nth-child(5) { animation-delay: .26s; }
.view.anim .bar-row:nth-child(n+6) { animation-delay: .30s; }

/* 折线描边动画 */
.view.anim .spark path:nth-of-type(2) {
  stroke-dasharray: 900;
  animation: drawLine 1.1s cubic-bezier(.3, .8, .2, 1) .15s both;
}

/* 抽屉：遮罩淡入 + 面板滑入（已有 slideIn） */
.drawer-mask { animation: maskIn .18s var(--ease) both; }

/* 按钮 / 导航 / 标签的微交互 */
.btn { will-change: transform; }
.btn:hover:not([disabled]) { transform: translateY(-1px); }
.btn:active:not([disabled]) { transform: translateY(0); }
.btn.primary:hover:not([disabled]) { box-shadow: 0 2px 4px rgba(var(--primary-rgb), .22), 0 8px 20px rgba(var(--primary-rgb), .18); }

.nav-item { will-change: transform; }
.nav-item:hover { transform: translateX(1px); }
.nav-item.active::before { transition: top .18s var(--ease), bottom .18s var(--ease); }

.vtab { animation: popIn .2s var(--ease) both; }
.vtab:hover { transform: translateY(-1px); }

.card { will-change: box-shadow; }
.map-item.on:hover .nm { color: var(--primary); }

/* KPI 数字滚动时保持等宽，避免抖动 */
.kpi .k-value { font-variant-numeric: tabular-nums; }

/* 登录页入场 */
.auth-left { animation: slideRight .5s var(--ease) both; }
.auth-form { animation: fadeUp .5s var(--ease) .08s both; }
.auth-brand, .auth-hero, .auth-left-foot { animation: fadeUp .5s var(--ease) both; }
.auth-hero { animation-delay: .1s; }
.auth-left-foot { animation-delay: .18s; }
.ap { animation: fadeUp .45s var(--ease) both; }
.ap:nth-child(1) { animation-delay: .16s; }
.ap:nth-child(2) { animation-delay: .21s; }
.ap:nth-child(3) { animation-delay: .26s; }
.ap:nth-child(4) { animation-delay: .31s; }

/* 标签栏切换时的进度条式高亮（小圆点脉冲） */
.vtab.on .vt-dot { animation: dotPulse 1.8s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), .35); } 50% { box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0); } }

/* 无障碍：尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* 关闭动效模式（?nomotion=1 或设置里开启） */
body.no-motion *, body.no-motion *::before, body.no-motion *::after {
  animation: none !important;
  transition: none !important;
}

/* ==========================================================
   菜单 v2：业务两级菜单
   ========================================================== */
.nav-search {
  display: flex; align-items: center; gap: 6px;
  margin: 2px 8px 10px; padding: 0 9px; height: 31px;
  border: 1px solid var(--line); border-radius: 7px; background: #fbfcfe;
  transition: border-color .14s, box-shadow .14s;
}
.nav-search:focus-within { border-color: var(--primary-line); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .07); background: #fff; }
.nav-search .i { color: #a3adbd; }
.nav-search input {
  flex: 1; min-width: 0; border: none; background: transparent;
  outline: none; font-size: 12px; color: var(--text-2);
}
.nav-search input::placeholder { color: #a9b2c1; }
.ns-clear { display: inline-flex; cursor: pointer; color: var(--muted-2); }
.ns-clear:hover { color: var(--danger); }

.nav-group { margin-bottom: 2px; }
.nav-group > h4 {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px 7px; font-size: 11px; font-weight: 600;
  color: #8c97a8; letter-spacing: .04em; cursor: pointer;
}
.nav-group > h4 > span { display: inline-flex; align-items: center; gap: 6px; }
.nav-group > h4 .chev { display: inline-flex; transition: transform .2s var(--ease); opacity: .55; }
.nav-group.folded > h4 .chev { transform: rotate(-90deg); }
.nav-group.folded .nav-body { display: none; }
.nav-group > h4:hover { color: var(--text-2); }

.nav-sub {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 4px 12px; margin-top: 2px;
  font-size: 10.5px; color: #9aa5b6; cursor: pointer;
  letter-spacing: .02em;
}
.nav-sub:hover { color: var(--primary); }
.nav-sub .chev { display: inline-flex; transition: transform .2s var(--ease); opacity: .45; }
.nav-sub-items { padding-bottom: 2px; }
.nav-sub-items.folded { display: none; }

.nav-item { padding: 6px 10px 6px 22px; gap: 8px; }
.nav-dot {
  width: 4px; height: 4px; border-radius: 50%; flex: 0 0 4px;
  background: #c8d2e2; opacity: 0; transition: opacity .14s, background .14s, width .14s, height .14s;
}
.nav-item:hover .nav-dot { opacity: 1; }
.nav-item.active .nav-dot { opacity: 1; background: var(--primary); width: 5px; height: 5px; }
.nav-item.active { padding-left: 22px; }
.nav-item.active::before { left: -10px; }

/* 折叠态：只留圆点 */
.app.collapsed .nav-search { display: none; }
.app.collapsed .nav-sub { display: none; }
.app.collapsed .nav-item { padding: 8px 0; justify-content: center; }
.app.collapsed .nav-dot { opacity: 1; width: 6px; height: 6px; }
.app.collapsed .nav-item.active .nav-dot { width: 7px; height: 7px; }

/* ---------- 菜单 v3：计数 / 搜索 / 最近访问 / 折叠浮层 ---------- */
.nav-group > h4 { gap: 6px; }
.nav-group > h4 .ng-ico { display: inline-flex; align-items: center; color: var(--muted-2); }
.nav-group.on > h4 .ng-ico { color: var(--primary); }
.nav-cnt {
  margin-left: auto;
  font-style: normal; font-size: 10px; font-weight: 500;
  color: var(--muted-2); background: var(--bg-2);
  border-radius: 20px; padding: 0 5px; line-height: 15px;
  letter-spacing: 0;
}
.nav-group.on > h4 { color: var(--primary); }
.nav-group.on > h4 .nav-cnt { color: var(--primary-ink); background: var(--primary-soft); }
.nav-group.on > h4 .chev { opacity: .8; }

.nav-sec {
  padding: 9px 10px 4px;
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  color: var(--muted-2);
}
.nav-recent { padding-left: 22px; }
.nav-recent .nav-txt { color: var(--text-2); }

.nav-hint {
  padding: 0 12px 6px;
  font-size: 10px; color: var(--muted-2); letter-spacing: .01em;
}
.nav-hit { padding-right: 10px; }
.nav-hit .nav-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-hit.sel { background: var(--primary-soft); color: var(--primary); }
.nav-hit.sel .nav-dot { opacity: 1; background: var(--primary); }
.nav-path {
  flex: 0 0 auto; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-style: normal; font-size: 10px; color: var(--muted-2);
}
.nav-mark {
  background: var(--primary-soft); color: var(--primary-ink);
  border-radius: 3px; padding: 0 1px; font-weight: 700;
}

.nav-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 26px 16px 20px; color: var(--muted-2);
  border: 1px dashed var(--line-3); border-radius: 8px; margin: 6px 8px;
}
.nav-empty p { font-size: 12px; color: var(--text-2); margin: 0; }
.nav-empty span { font-size: 10.5px; line-height: 1.6; text-align: center; color: var(--muted-2); }
.nav-empty .i { color: var(--line-3); }

/* 折叠态弹出层：模块子菜单 / 页面名称 */
.nav-fly {
  position: fixed; left: 72px; z-index: 60;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 11px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .14);
  opacity: 0; pointer-events: none;
  transform: translateX(-6px);
  transition: opacity .13s var(--ease), transform .13s var(--ease);
}
.nav-fly.show { opacity: 1; pointer-events: auto; transform: none; }
.nav-fly.label { max-width: 220px; }
.nav-fly .fly-title { display: block; font-size: 12.5px; color: var(--text); }
.nav-fly .fly-path { display: block; font-size: 10px; color: var(--muted-2); margin-top: 2px; white-space: nowrap; }
.nav-fly.panel { width: 210px; max-height: 76vh; overflow-y: auto; padding: 5px 6px 8px; }
.nav-fly.panel .fly-title { padding: 5px 8px 3px; font-weight: 700; }
.nav-fly .fly-sub {
  display: block; padding: 8px 8px 3px;
  font-size: 10px; font-weight: 600; letter-spacing: .05em; color: var(--muted-2);
}
.nav-fly .fly-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
  font-size: 12px; color: var(--text-2); text-decoration: none;
}
.nav-fly .fly-link:hover { background: var(--primary-soft); color: var(--primary); }
.nav-fly .fly-link em {
  font-style: normal; font-size: 9.5px; color: var(--muted-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* 标签右键菜单 */
.ctx-menu {
  position: fixed; z-index: 70; min-width: 152px; padding: 5px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 10px 28px rgba(16, 24, 40, .14);
  opacity: 0; visibility: hidden;
  transition: opacity .12s var(--ease);
}
.ctx-menu.show { opacity: 1; visibility: visible; }
.ctx-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 5px; cursor: pointer;
  font-size: 12px; color: var(--text-2);
}
.ctx-item:hover { background: var(--bg-2); color: var(--primary); }
.ctx-item .i { color: var(--muted-2); }
.ctx-item:hover .i { color: var(--primary); }
.ctx-item.is-off { opacity: .38; pointer-events: none; }
.ctx-sep { height: 1px; background: var(--line-2); margin: 4px 2px; }

/* ==========================================================
   加载态：进度条 / 骨架屏 / 按钮 loading
   ========================================================== */
.nprog {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 8px rgba(var(--primary-rgb), .45);
  z-index: 999; opacity: 0; border-radius: 0 2px 2px 0;
  transition: width .24s var(--ease), opacity .22s;
}
.nprog.on { opacity: 1; }

.sk {
  background: linear-gradient(90deg, #edf1f8 25%, #f8fafd 37%, #edf1f8 63%);
  background-size: 400% 100%;
  animation: skShimmer 1.25s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.sk-page { padding: 26px 36px 44px; }
.sk-title { height: 22px; width: 260px; margin-bottom: 14px; }
.sk-line { height: 11px; margin-bottom: 20px; }
.sk-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.sk-kpi > div { height: 86px; border-radius: 12px; }
.sk-card { height: 228px; border-radius: 12px; margin-bottom: 16px; }

.sk-tbl { padding: 6px 16px 16px; }
.sk-row {
  display: grid; grid-template-columns: 2.2fr 1fr 1fr 1.2fr 1fr;
  gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2);
}
.sk-row:last-child { border-bottom: none; }
.sk-cell { height: 12px; }

.spin-dark {
  width: 13px; height: 13px; border: 2px solid rgba(var(--primary-rgb), .25);
  border-top-color: var(--primary); border-radius: 50%;
  display: inline-block; animation: spin .7s linear infinite;
  margin-right: 6px; vertical-align: -2px;
}
.btn.is-loading { pointer-events: none; opacity: .82; }
.btn.primary.is-loading .spin-dark { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

/* 表格加载遮罩 */
.card { position: relative; }
.tbl-mask {
  position: absolute; left: 0; right: 0; top: 42px; bottom: 0;
  background: rgba(255, 255, 255, .96); z-index: 4;
  animation: fadeUp .2s var(--ease);
}

/* 动画兜底：1 秒后强制回到终态，避免低端设备/后台标签页卡在透明态 */
.motion-done .view > *,
.motion-done .ap,
.motion-done .auth-left,
.motion-done .auth-form,
.motion-done .auth-hero,
.motion-done .auth-brand,
.motion-done .auth-left-foot,
.motion-done .donut-wrap,
.motion-done .spark,
.motion-done .bars,
.motion-done .bar-row,
.motion-done .vtab {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* ==========================================================
   顶栏下拉：用户 / 通知
   ========================================================== */
.dd-wrap { position: relative; }

.user-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px 4px 4px; border-radius: 8px;
  border: 1px solid transparent; background: transparent;
  cursor: pointer; transition: all .14s;
}
.user-btn:hover { background: #f4f7fc; border-color: var(--line); }
.user-btn > .i { color: var(--muted-2); margin-left: 2px; }

.user-av {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px;
  background: linear-gradient(145deg, #eaf1ff, #dbe8ff);
  color: var(--primary); font-size: 11.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--primary-line);
}
.user-av.lg { width: 34px; height: 34px; font-size: 13px; flex: 0 0 34px; }
.user-av.xl { width: 44px; height: 44px; font-size: 16px; flex: 0 0 44px; }

.user-info { display: flex; flex-direction: column; line-height: 1.28; text-align: left; }
.user-info b { font-size: 12px; font-weight: 600; }
.user-info em { font-style: normal; font-size: 10.5px; color: var(--muted-2); }

.dd {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--sh-3);
  min-width: 214px; padding: 6px; display: none; z-index: 80;
}
.dd.on { display: block; animation: popIn .16s var(--ease); }
.dd-notif { width: 330px; padding: 8px; }

.dd-head { display: flex; align-items: center; gap: 10px; padding: 7px 9px; }
.dd-head > div { line-height: 1.3; }
.dd-head b { font-size: 12.5px; }
.dd-head em { font-style: normal; display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.dd-head.notif-h { justify-content: space-between; padding: 2px 8px 8px; }

.dd-sep { height: 1px; background: var(--line-2); margin: 6px 4px; }

.dd-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 6px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer;
  transition: background .12s, color .12s;
}
.dd-item:hover { background: #f4f7fc; color: var(--primary); }
.dd-item.danger { color: var(--danger); }
.dd-item.danger:hover { background: var(--danger-soft); }

.dd-foot {
  padding: 8px 10px; text-align: center; font-size: 11.5px;
  color: var(--primary); cursor: pointer;
  border-top: 1px solid var(--line-2); margin-top: 4px;
}
.dd-foot:hover { background: var(--primary-soft); border-radius: 0 0 6px 6px; }

.notif-i { align-items: flex-start; gap: 10px; }
.ni-ico {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 26px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.ni-body { flex: 1; min-width: 0; }
.ni-body b { display: block; font-size: 12px; font-weight: 500; color: var(--text); line-height: 1.45; }
.ni-body em { font-style: normal; display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.ni-time { font-size: 10px; color: var(--muted-2); white-space: nowrap; }

.cb-l { cursor: pointer; color: var(--muted); transition: color .13s; }
.cb-l:hover { color: var(--primary); }

/* 通知详情 */
.nd-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 4px; }
.nd-head b { font-size: 14px; line-height: 1.5; display: block; }
.nd-head > div { min-width: 0; }
.nd-head .ni-ico.lg { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; }
.nd-p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.8; color: var(--text-2); }
.nd-p:last-child { margin-bottom: 0; }
.nd-ref {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  cursor: pointer; transition: all .14s; background: #fcfdff;
}
.nd-ref:hover { border-color: var(--primary-line); background: #f8fbff; box-shadow: var(--sh-1); }
.dd-item.notif-i { position: relative; }
.dd-item.notif-i.unread::before {
  content: ""; position: absolute; left: 2px; top: 15px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--danger);
}
.dd-item.notif-i.unread .ni-body b { font-weight: 600; }

/* ==========================================================
   确认弹窗
   ========================================================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(14, 22, 36, .38); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  animation: maskIn .16s var(--ease);
}
.modal-mask.out { opacity: 0; transition: opacity .14s; }
.modal {
  width: 440px; background: #fff; border-radius: 12px;
  box-shadow: var(--sh-3); overflow: hidden;
  animation: popIn .18s var(--ease);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { font-size: 14px; font-weight: 600; }
.modal-body { padding: 16px 18px; }
.modal-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 12px; }
.modal-input, .modal-select {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--line-3); border-radius: 8px;
  outline: none; font-size: 12.5px; background: #fff;
}
textarea.modal-input { height: 72px; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.modal-input:focus, .modal-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.1); }
.modal-input.err, .modal-select.err { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(198,47,39,.08); }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--line-2); background: #fcfdff;
}
.modal-field { margin-bottom: 12px; }
.modal-field > label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }

/* 登录输入错误态 */
.af-wrap:has(.input.err) { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(198,47,39,.08); }
.input.err { border-color: var(--danger); }

/* 折叠态：模块内子分组分隔 */
.rail-sep { height: 1px; background: var(--line-2); margin: 6px 16px; }

/* ---------- 主题色板（设置抽屉） ---------- */
.set-row.col { display: block; }
.swatches { display: flex; gap: 8px; margin-top: 10px; }
.sw {
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  background: var(--sw); border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .06);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
  position: relative;
}
.sw:hover { transform: translateY(-1px); }
.sw.on { border-color: var(--panel); box-shadow: 0 0 0 2px var(--sw), inset 0 0 0 1px rgba(16, 24, 40, .06); }
.sw.on::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M3.4 8.4 6.4 11.4 12.6 5'/></svg>") center/13px no-repeat;
}

/* ---------- 顶栏全局搜索 + ⌘K 命令面板 ---------- */
.tb-search { width: auto; padding: 0 7px; gap: 6px; }
.tb-kbd, .pal-esc {
  font: 500 10px/1 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--muted-2); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px;
}
.tb-search:hover .tb-kbd { color: var(--primary); border-color: var(--primary-line); }

.pal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(16, 24, 40, .30);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 11vh; opacity: 0; visibility: hidden;
  transition: opacity .16s var(--ease), visibility .16s;
}
.pal-mask.show { opacity: 1; visibility: visible; }
.pal {
  width: 560px; max-width: 92vw; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(16, 24, 40, .22);
  transform: translateY(-10px); transition: transform .18s var(--ease);
}
.pal-mask.show .pal { transform: none; }
.pal-in {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 52px; border-bottom: 1px solid var(--line-2);
}
.pal-in .i { color: var(--muted-2); }
.pal-in input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text);
}
.pal-in input::placeholder { color: var(--muted-2); }
.pal-list { max-height: 372px; overflow-y: auto; padding: 6px; }
.pal-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background .12s var(--ease);
}
.pal-item.sel { background: var(--primary-soft); }
.pal-ico { display: inline-flex; color: var(--muted-2); }
.pal-item.sel .pal-ico { color: var(--primary); }
.pal-txt { flex: 1; min-width: 0; }
.pal-txt b { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.pal-txt em {
  display: block; font-style: normal; font-size: 11px; color: var(--muted-2);
  margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pal-item.sel .pal-txt b { color: var(--primary-ink); }
.pal-tag {
  font-size: 10px; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}
.pal-code {
  font: 500 10.5px/1 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--muted-2); flex: 0 0 auto;
}
.pal-empty { padding: 36px 20px; text-align: center; font-size: 12.5px; color: var(--muted-2); }
.pal-foot {
  display: flex; gap: 14px; padding: 7px 14px 9px;
  border-top: 1px solid var(--line-2);
  font-size: 10.5px; color: var(--muted-2);
}

/* 菜单内的数量徽标（购物车） */
.nav-badge {
  margin-left: auto; flex: 0 0 auto;
  font-style: normal; font-size: 10px; font-weight: 600;
  color: var(--primary); background: var(--primary-soft);
  border: 1px solid var(--primary-line); border-radius: 20px;
  padding: 0 5px; line-height: 14px;
}

/* 商品详情媒体区（示意图，避免空白占位） */
.sku-media {
  position: relative; width: 180px; height: 180px;
  border: 1px solid var(--line); border-radius: 10px;
  background:
    linear-gradient(var(--panel-2), var(--panel-2)) padding-box,
    repeating-linear-gradient(0deg, var(--line-2) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 22px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  overflow: hidden;
}
.sku-media::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 42%, var(--panel) 0%, transparent 68%);
  pointer-events: none;
}
.sku-media-ico { color: var(--muted-2); opacity: .62; position: relative; z-index: 1; display: block; line-height: 0; }
.sku-media-ico .i { width: 52px; height: 52px; }
.sku-media-model {
  font-size: 10.5px; color: var(--muted); letter-spacing: .02em;
  position: relative; z-index: 1;
}
.sku-media-tag {
  position: absolute; left: 8px; bottom: 8px; z-index: 1;
  font-size: 9.5px; color: var(--muted-2);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px;
}

/* 标签栏溢出滚动箭头 */
.tabs-nav {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 5px;
  display: none; align-items: center; justify-content: center;
  color: var(--muted-2); cursor: pointer;
  border: 1px solid var(--line); background: var(--panel);
  transition: color .13s var(--ease), border-color .13s var(--ease);
}
#tabbar.has-overflow .tabs-nav { display: inline-flex; }
#tabbar.at-start .tabs-nav.l,
#tabbar.at-end .tabs-nav.r { opacity: .28; pointer-events: none; }
.tabs-nav:hover { color: var(--primary); border-color: var(--primary-line); }

/* 让标签容器可以被压缩，否则内容撑开后永远不会溢出、箭头也不出现 */
.tabs-scroll { min-width: 0; }
#tabbar { min-width: 0; }

/* 表格交互：排序表头 / 可点行 */
#view .tbl th { cursor: pointer; user-select: none; transition: background .12s, color .12s; }
#view .tbl th:hover { background: var(--bg-2); color: var(--text); }
#view .tbl th.sorted { color: var(--primary); }
#view .tbl th.sorted::after {
  font-size: 9px; margin-left: 4px; vertical-align: 1px; opacity: .85;
}
#view .tbl th.sorted[data-dir="asc"]::after { content: "▲"; }
#view .tbl th.sorted[data-dir="desc"]::after { content: "▼"; }
#view .tbl tbody tr:has(a[href^="#/"]) { cursor: pointer; }

/* ---------- 筛选 chips / 批量条 / 空表 / 预览抽屉 ---------- */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--primary-ink);
  background: var(--primary-soft); border: 1px solid var(--primary-line);
  border-radius: 14px; padding: 2px 4px 2px 9px;
}
.chip em {
  font-style: normal; cursor: pointer; width: 14px; height: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--primary); line-height: 1;
}
.chip em:hover { background: var(--primary); color: var(--panel); }
.chip-clear { font-size: 11.5px; color: var(--muted-2); cursor: pointer; }
.chip-clear:hover { color: var(--primary); text-decoration: underline; }

.bulk-bar {
  display: none; align-items: center; gap: 8px;
  padding: 7px 16px; font-size: 12px;
  color: var(--primary-ink); background: var(--primary-soft);
  border-bottom: 1px solid var(--primary-line);
}
.bulk-bar.on { display: flex; }
.bulk-n { font-weight: 700; }
.sel-box { width: 13px; height: 13px; accent-color: var(--primary); cursor: pointer; flex: 0 0 auto; }
.approve-row.picked { background: var(--primary-soft) !important; }

.tbl-empty td { padding: 0 !important; border: 0; }
.tbl-empty-in {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 34px 16px; color: var(--muted-2);
}
.tbl-empty-in .i { color: var(--line-3); }
.tbl-empty-in b { font-size: 12.5px; color: var(--text-2); }
.tbl-empty-in span { font-size: 11px; }

.pv-head {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
}
.pv-ico {
  width: 38px; height: 38px; border-radius: 9px; flex: 0 0 38px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.pv-head b { display: block; font-size: 13px; }
.pv-head span { font-size: 10.5px; color: var(--muted-2); }
