/* 三项岗位人员培训管理系统 · 紫金安全咨询企业视觉设计系统 v3.2（Zijin B × A + 通用 .sx-* 小件）
 * 基调：安静、清楚、紫金矿脉清透微矿白（#F5F7F6 画布 + #DFE7E4 细线白卡 + #007569 松石青绿 + #DDA400 非文字金丝点睛）。
 * 技术底线：严禁任何全局 outline:0 / outline:none，全程键盘焦点环可见。
 */

@font-face {
  font-family: "SX Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/sans-Regular.5904f15f26cd.woff2") format("woff2");
}
@font-face {
  font-family: "SX Sans";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/sans-Medium.b6f0e28ac163.woff2") format("woff2");
}
@font-face {
  font-family: "SX Sans";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/sans-Bold.43c703db4308.woff2") format("woff2");
}

:root {
  /* 画布与表面：紫金矿脉清透微矿白 + 纯白瓷卡（Zijin B × A） */
  --sx-canvas: #F5F7F6;
  --sx-sunken: #ECEFED;
  --sx-surface: #FFFFFF;
  --sx-hover: #F3F8F6;
  --sx-scrim: rgba(10, 34, 30, .40);

  /* 文字 */
  --sx-ink: #12211E;
  --sx-ink-2: #4A5D58;
  --sx-ink-3: #5C6F6A;
  --sx-ink-4: #768883;
  --sx-ink-disabled: #A3ACB8;
  --sx-ink-on-brand: #FFFFFF;

  /* 线条 */
  --sx-line: #DFE7E4;
  --sx-line-strong: #C8D4D0;
  --sx-line-control: #6E817C;

  /* 主色：紫金松石青绿 + 典章深松绿 + 金丝辅色（金仅用于线条与图形，严禁作文字前景） */
  --sx-brand-50: #E8F4F1;
  --sx-brand-100: #D5EBE5;
  --sx-brand-200: #B2DBD1;
  --sx-brand-600: #007569;
  --sx-brand-700: #005E54;
  --sx-brand-800: #00423B;
  --sx-brand: var(--sx-brand-600);
  --sx-brand-hover: var(--sx-brand-700);
  --sx-brand-deep: #003A34;
  --sx-brand-deep-2: #00554C;
  --sx-brand-soft: var(--sx-brand-50);
  --sx-brand-soft-hover: var(--sx-brand-100);
  --sx-brand-border: var(--sx-brand-200);
  --sx-brand-ink: #005950;
  --sx-focus: #005950;
  --sx-focus-on-dark: #FFFFFF;
  --sx-accent-bar: #DDA400;

  /* 语义胶囊：浅底 + 深字 + 圆点 */
  --sx-ok-bg: #E7F5EE;
  --sx-ok-ink: #166534;
  --sx-ok-dot: #22864B;
  --sx-ok-solid: #22864B;
  --sx-ok-border: #B9E2C9;
  --sx-warn-bg: #FEF4E2;
  --sx-warn-ink: #965200;
  --sx-warn-dot: #C97600;
  --sx-warn-solid: #C97600;
  --sx-warn-border: #F2D096;
  --sx-danger-bg: #FDECEC;
  --sx-danger-ink: #B42318;
  --sx-danger-dot: #CF3025;
  --sx-danger-solid: #B42318;
  --sx-danger-solid-hover: #96141C;
  --sx-danger-border: #F5C2C0;
  --sx-info-bg: #EAF2FD;
  --sx-info-ink: #1C54A8;
  --sx-info-dot: #2B6CD1;
  --sx-info-solid: #2B6CD1;
  --sx-info-border: #B9D2F7;
  --sx-mute-bg: #EEF2F1;
  --sx-mute-ink: #5A6B66;

  /* 浮动批量条 */
  --sx-bulk-bg: #0D2925;
  --sx-bulk-border: rgba(255, 255, 255, .12);

  /* 圆角 */
  --sx-r-xs: 4px;
  --sx-r-sm: 6px;
  --sx-r-md: 8px;
  --sx-r-pill: 999px;

  /* 阴影：矿瓷多层微浮 */
  --sx-shadow-card: 0 1px 2px rgba(0, 48, 43, .035), 0 2px 6px rgba(0, 48, 43, .025);
  --sx-shadow-hover: 0 4px 12px rgba(0, 48, 43, .06), 0 1px 3px rgba(0, 48, 43, .04);
  --sx-shadow-pop: 0 6px 14px rgba(0, 38, 34, .07), 0 14px 32px rgba(0, 38, 34, .12);
  --sx-shadow-modal: 0 20px 56px rgba(0, 38, 34, .22), 0 4px 14px rgba(0, 38, 34, .08);
  --sx-shadow-float: 0 12px 34px rgba(0, 38, 34, .18), 0 2px 8px rgba(0, 38, 34, .08);
  --sx-shadow-drawer: -14px 0 40px rgba(0, 38, 34, .14);

  /* 间距（4px 基准） */
  --sx-1: 4px;
  --sx-2: 8px;
  --sx-3: 12px;
  --sx-4: 16px;
  --sx-5: 20px;
  --sx-6: 24px;
  --sx-8: 32px;
  --sx-10: 40px;
  --sx-12: 48px;

  /* 字号 / 行高 */
  --sx-font: "SX Sans", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --sx-fs-12: 12px;
  --sx-lh-12: 18px;
  --sx-fs-13: 13px;
  --sx-lh-13: 20px;
  --sx-fs-14: 14px;
  --sx-lh-14: 22px;
  --sx-fs-16: 16px;
  --sx-lh-16: 24px;
  --sx-fs-20: 20px;
  --sx-lh-20: 28px;
  --sx-fs-24: 24px;
  --sx-lh-24: 32px;
  --sx-fw-regular: 400;
  --sx-fw-medium: 500;
  --sx-fw-bold: 700;

  /* 尺寸 */
  --sx-side-w: 236px;
  --sx-top-h: 60px;
  --sx-content-max: 1640px;
  --sx-ctl-h: 36px;
  --sx-ctl-h-sm: 28px;
  --sx-row-h: 44px;
  --sx-tbl-row: 40px;
  --sx-drawer-w: 396px;

  /* 动效与层级（9 级层叠序列：05 §1.2） */
  --sx-fast: 120ms;
  --sx-base: 180ms;
  --sx-ease: cubic-bezier(.2, 0, 0, 1);
  --sx-z-bulk: 150;
  --sx-z-pop: 200;
  --sx-z-drawer: 250;
  --sx-z-top: 260;
  --sx-z-scrim: 270;
  --sx-z-drawer-modal: 280;
  --sx-z-nav: 290;
  --sx-z-modal: 300;
  --sx-z-toast: 400;
}

/* ========== 全站基线 ========== */
*, *::before, *::after { box-sizing: border-box; }
html { margin: 0; padding: 0; background: var(--sx-canvas); color: var(--sx-ink); scrollbar-gutter: stable; }
body { margin: 0; padding: 0; background: var(--sx-canvas); color: var(--sx-ink); overflow-x: clip; }
.sx-narrow-wrap { width: 100%; max-width: 1120px; }
body.sx-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sx-canvas);
  color: var(--sx-ink);
  font: var(--sx-fw-regular) var(--sx-fs-14)/var(--sx-lh-14) var(--sx-font);
  -webkit-font-smoothing: antialiased;
}
:where(.sx-app) a { color: var(--sx-brand-700); text-decoration: none; }
:where(.sx-app) a:hover { color: var(--sx-brand-800); text-decoration: underline; }
.sx-num, .sx-app table td, .sx-app table th { font-variant-numeric: tabular-nums; }
.sx-hidden, .sx-app [hidden] { display: none; }

/* 键盘焦点环（严禁全局 outline:0/none） */
.sx-app :focus-visible { outline: 2px solid var(--sx-focus); outline-offset: 2px; border-radius: var(--sx-r-xs); }
.sx-app input:focus-visible, .sx-app select:focus-visible, .sx-app textarea:focus-visible {
  outline: 2px solid var(--sx-focus);
  outline-offset: 0;
  border-color: var(--sx-focus);
}

/* 无障碍辅助 */
.sx-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sx-skip-link {
  position: fixed; top: var(--sx-2); left: var(--sx-2); z-index: var(--sx-z-toast);
  padding: var(--sx-2) var(--sx-4); min-height: var(--sx-row-h);
  display: inline-flex; align-items: center; border-radius: var(--sx-r-sm);
  background: var(--sx-brand-600); color: var(--sx-ink-on-brand); font-weight: 500;
  transform: translateY(-220%);
}
.sx-skip-link:focus, .sx-skip-link:focus-visible { transform: translateY(0); text-decoration: none; color: var(--sx-ink-on-brand); }

/* htmx 加载指示 */
.htmx-indicator { opacity: 0; transition: opacity var(--sx-base) var(--sx-ease); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .sx-app * { transition-duration: 0ms; animation-duration: 0ms; }
}

/* ========== 线性图标 ========== */
.sx-ico { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; vertical-align: -0.18em; }
.sx-ico-sm { width: 14px; height: 14px; flex-shrink: 0; display: inline-block; vertical-align: -0.15em; }
.sx-ico-md { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; }
.sx-ico-lg { width: 28px; height: 28px; flex-shrink: 0; display: inline-block; }

/* ========== 侧栏导航（暖矿浅底 #F9FBFA 与白卡主区自然分离；响应式抽屉断点见 app.css §9） ========== */
.sx-sidebar {
  position: sticky; top: var(--sx-top-h); align-self: start;
  height: calc(100vh - var(--sx-top-h)); overflow-y: auto;
  background: #F9FBFA; border-right: 1px solid var(--sx-line);
  padding: 10px var(--sx-3) 12px;
  display: flex; flex-direction: column; gap: 0;
}
.sx-nav-group { display: flex; flex-direction: column; }
.sx-nav-group + .sx-nav-group { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--sx-line); }
.sx-nav-heading {
  margin: 0; padding: 4px 12px 4px;
  font-size: var(--sx-fs-12); line-height: var(--sx-lh-12); letter-spacing: .04em;
  font-weight: var(--sx-fw-medium); color: var(--sx-ink-3);
}
.sx-nav-list { display: flex; flex-direction: column; gap: 2px; }
.sx-nav-link {
  position: relative; display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 10px 0 12px; border-radius: 7px;
  color: var(--sx-ink-2); font-size: var(--sx-fs-14); font-weight: var(--sx-fw-regular);
  text-decoration: none;
  transition: background var(--sx-fast) var(--sx-ease), color var(--sx-fast) var(--sx-ease);
}
.sx-nav-ico {
  width: 18px; height: 18px; flex-shrink: 0; color: var(--sx-ink-4);
  transition: color var(--sx-fast) var(--sx-ease);
}
.sx-nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-app a.sx-nav-link:hover { background: #ECF4F2; color: var(--sx-ink); text-decoration: none; }
.sx-app a.sx-nav-link:hover .sx-nav-ico { color: var(--sx-brand-700); }
.sx-app a.sx-nav-link.is-active {
  background: linear-gradient(90deg, #E3F2EE 0%, rgba(230, 244, 241, .52) 100%);
  color: #005249; font-weight: var(--sx-fw-medium);
}
.sx-app a.sx-nav-link.is-active .sx-nav-ico { color: #005249; }
.sx-nav-link.is-active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--sx-brand-600);
}
.sx-sidebar-foot {
  margin-top: auto; padding: 10px 12px 2px; border-top: 1px solid var(--sx-line);
  display: flex; flex-direction: column; gap: 3px;
}
.sx-sidebar-foot-rule {
  width: 22px; height: 2px; border-radius: 1px; background: var(--sx-accent-bar); margin-bottom: 4px;
}
.sx-sidebar-foot-org { font-size: 11px; line-height: 16px; font-weight: var(--sx-fw-medium); color: var(--sx-ink-2); }
.sx-sidebar-foot-sub { font-size: 11px; line-height: 15px; color: var(--sx-ink-3); }
.sx-nav-badge {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  min-width: 18px; height: 18px; padding: 0 6px; border-radius: var(--sx-r-pill);
  font-size: var(--sx-fs-12); font-weight: var(--sx-fw-medium); font-variant-numeric: tabular-nums;
  background: var(--sx-mute-bg); color: var(--sx-mute-ink);
}
.sx-nav-badge.is-warn { background: var(--sx-warn-bg); color: var(--sx-warn-ink); }
.sx-nav-badge.is-danger { background: var(--sx-danger-bg); color: var(--sx-danger-ink); }
.sx-mobile-nav-head, .sx-mobile-search { display: none; }

/* ========== 通用小件（.sx-*） ========== */
.sx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--sx-ctl-h); padding: 0 var(--sx-4); border-radius: var(--sx-r-sm);
  border: 1px solid var(--sx-brand-600); background: var(--sx-brand-600);
  color: var(--sx-ink-on-brand); font-family: inherit;
  font-size: var(--sx-fs-14); font-weight: var(--sx-fw-medium);
  line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 58, 52, .14);
  transition: background var(--sx-fast) var(--sx-ease), border-color var(--sx-fast) var(--sx-ease), box-shadow var(--sx-fast) var(--sx-ease);
}
.sx-app a.sx-btn:hover { text-decoration: none; }
.sx-btn:hover:not(:disabled) {
  background: var(--sx-brand-700); border-color: var(--sx-brand-700); color: var(--sx-ink-on-brand);
  box-shadow: 0 2px 6px rgba(0, 58, 52, .20);
}
.sx-btn:active:not(:disabled) {
  background: var(--sx-brand-800); border-color: var(--sx-brand-800); box-shadow: none;
}
.sx-btn.is-ghost {
  background: var(--sx-surface); border-color: var(--sx-line-control); color: var(--sx-ink); box-shadow: none;
}
.sx-btn.is-ghost:hover:not(:disabled) {
  background: var(--sx-hover); border-color: var(--sx-brand-600); color: var(--sx-ink); box-shadow: none;
}
.sx-btn.is-soft {
  background: var(--sx-brand-50); border-color: var(--sx-brand-200); color: var(--sx-brand-700); box-shadow: none;
}
.sx-btn.is-soft:hover:not(:disabled) {
  background: var(--sx-brand-100); border-color: var(--sx-brand-200); color: var(--sx-brand-800); box-shadow: none;
}
.sx-btn.is-text {
  background: transparent; border-color: transparent; color: var(--sx-brand-700); padding: 0 var(--sx-2); box-shadow: none;
}
.sx-btn.is-text:hover:not(:disabled) {
  background: var(--sx-brand-50); color: var(--sx-brand-800); box-shadow: none;
}
.sx-btn.is-danger {
  background: var(--sx-danger-solid); border-color: var(--sx-danger-solid); color: var(--sx-ink-on-brand);
}
.sx-btn.is-danger:hover:not(:disabled) {
  background: var(--sx-danger-solid-hover); border-color: var(--sx-danger-solid-hover); color: var(--sx-ink-on-brand);
}
.sx-btn.is-danger-ghost {
  background: var(--sx-surface); border-color: var(--sx-danger-border); color: var(--sx-danger-ink);
}
.sx-btn.is-danger-ghost:hover:not(:disabled) {
  background: var(--sx-danger-bg); border-color: var(--sx-danger-ink); color: var(--sx-danger-ink);
}
.sx-btn.is-sm { height: var(--sx-ctl-h-sm); padding: 0 10px; font-size: var(--sx-fs-13); }
.sx-btn.is-lg { height: 40px; font-size: var(--sx-fs-14); }
.sx-btn:disabled, .sx-btn[aria-disabled="true"] {
  background: var(--sx-sunken); border-color: var(--sx-line); color: var(--sx-ink-disabled); cursor: not-allowed;
}

.sx-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: var(--sx-r-sm);
  border: 1px solid transparent; background: transparent; color: var(--sx-ink-2);
  cursor: pointer; transition: background var(--sx-fast) var(--sx-ease), color var(--sx-fast) var(--sx-ease);
}
.sx-icon-btn:hover { background: var(--sx-hover); color: var(--sx-ink); }

.sx-input {
  width: 100%; height: var(--sx-ctl-h); padding: 0 var(--sx-3);
  border: 1px solid var(--sx-line-control); border-radius: var(--sx-r-sm);
  background: var(--sx-surface); color: var(--sx-ink);
  font-family: inherit; font-size: var(--sx-fs-14); line-height: var(--sx-lh-14);
}
textarea.sx-input { height: auto; min-height: 76px; padding: var(--sx-2) var(--sx-3); resize: vertical; }
select.sx-input {
  appearance: none;
  padding-right: 32px;
  text-overflow: ellipsis;
  background-image: url("../img/chevron-down.4e47a50723ff.svg");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
}
.sx-app input[type="checkbox"], .sx-app input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sx-brand-600);
}
input[type="file"].sx-input {
  height: auto; min-height: 40px; padding: 6px 10px; font-size: var(--sx-fs-13);
  border-style: dashed; border-color: var(--sx-line-strong); background: #FAFCFB; cursor: pointer;
  transition: border-color var(--sx-fast) var(--sx-ease), background var(--sx-fast) var(--sx-ease);
}
input[type="file"].sx-input:hover, input[type="file"].sx-input:focus-visible {
  border-color: var(--sx-brand-600); background: #F7FBFA;
}
.sx-input::placeholder { color: var(--sx-ink-3); }
.sx-input.is-error { border-color: var(--sx-danger-solid); }
.sx-input:disabled { background: var(--sx-sunken); color: var(--sx-ink-disabled); }

.sx-pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 var(--sx-2); border-radius: var(--sx-r-pill);
  border: 1px solid transparent; background: var(--sx-mute-bg); color: var(--sx-mute-ink);
  font-size: var(--sx-fs-12); font-weight: var(--sx-fw-medium); line-height: 1; white-space: nowrap;
}
.sx-pill.is-ok { background: var(--sx-ok-bg); color: var(--sx-ok-ink); }
.sx-pill.is-warn { background: var(--sx-warn-bg); color: var(--sx-warn-ink); }
.sx-pill.is-danger { background: var(--sx-danger-bg); color: var(--sx-danger-ink); }
.sx-pill.is-info { background: var(--sx-info-bg); color: var(--sx-info-ink); }
.sx-pill.is-mute { background: var(--sx-mute-bg); color: var(--sx-mute-ink); }
.sx-pill.is-void { border-style: dashed; border-color: var(--sx-line-strong); }
:where(.sx-pill:is(.is-ok, .is-warn, .is-danger, .is-info, .is-mute, .is-void):not(:has(> .sx-pill-dot, > svg)))::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: currentColor;
}
.sx-pill.is-ok::before { background: var(--sx-ok-dot); }
.sx-pill.is-warn::before { background: var(--sx-warn-dot); }
.sx-pill.is-danger::before { background: var(--sx-danger-dot); }
.sx-pill.is-info::before { background: var(--sx-info-dot); }
.sx-pill.is-mute::before, .sx-pill.is-void::before { background: var(--sx-mute-ink); }

.sx-card {
  background: var(--sx-surface); border: 1px solid var(--sx-line);
  border-radius: var(--sx-r-md); box-shadow: var(--sx-shadow-card);
  padding: var(--sx-5); min-width: 0; max-width: 100%;
}
.sx-card.is-sunken {
  background: var(--sx-canvas); border: 1px solid var(--sx-line);
  border-radius: var(--sx-r-md); box-shadow: none; padding: var(--sx-4); min-width: 0; max-width: 100%;
}

/* 弹出菜单（.sx-menu） */
.sx-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: var(--sx-z-pop);
  min-width: 168px; padding: var(--sx-1); background: var(--sx-surface);
  border: 1px solid var(--sx-line); border-radius: var(--sx-r-md); box-shadow: var(--sx-shadow-pop);
  display: flex; flex-direction: column; gap: 2px;
}
.sx-menu-head {
  padding: 6px 10px; font-size: var(--sx-fs-12); color: var(--sx-ink-3);
  border-bottom: 1px solid var(--sx-line); margin-bottom: 2px;
}
.sx-menu-sep { height: 1px; background: var(--sx-line); margin: 4px 0; border: 0; }
.sx-menu-item {
  width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: var(--sx-r-sm);
  background: transparent; color: var(--sx-ink); font-family: inherit;
  font-size: var(--sx-fs-13); font-weight: var(--sx-fw-regular);
  text-align: left; text-decoration: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
}
.sx-menu-item:hover { background: var(--sx-hover); color: var(--sx-ink); text-decoration: none; }
.sx-menu-item.is-danger { color: var(--sx-danger-ink); }
.sx-menu-item.is-danger:hover { background: var(--sx-danger-bg); color: var(--sx-danger-ink); }
.sx-menu-desc { font-size: var(--sx-fs-12); line-height: 16px; color: var(--sx-ink-3); font-weight: 400; }

/* 消息条（.sx-alert） */
.sx-messages { display: flex; flex-direction: column; gap: var(--sx-2); margin-bottom: var(--sx-3); }
.sx-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px 10px 14px; border-radius: var(--sx-r-md);
  border: 1px solid var(--sx-info-border); border-left-width: 3px; border-left-color: var(--sx-info-solid);
  background: var(--sx-info-bg); color: var(--sx-info-ink);
  font-size: var(--sx-fs-13); line-height: var(--sx-lh-13);
}
.sx-alert.is-ok { background: var(--sx-ok-bg); color: var(--sx-ok-ink); border-color: var(--sx-ok-border); border-left-color: var(--sx-ok-solid); }
.sx-alert.is-warn { background: var(--sx-warn-bg); color: var(--sx-warn-ink); border-color: var(--sx-warn-border); border-left-color: var(--sx-warn-solid); }
.sx-alert.is-danger { background: var(--sx-danger-bg); color: var(--sx-danger-ink); border-color: var(--sx-danger-border); border-left-color: var(--sx-danger-solid); }
.sx-alert.is-info { background: var(--sx-info-bg); color: var(--sx-info-ink); border-color: var(--sx-info-border); border-left-color: var(--sx-info-solid); }
.sx-hint > svg, .sx-alert > svg { margin-top: 3px; }
.sx-hint.is-warn .sx-pill.is-warn { background: rgba(255, 255, 255, .78); border-color: var(--sx-warn-border); }
.sx-alert-body { flex: 1; min-width: 0; }
.sx-alert-title { font-weight: var(--sx-fw-bold); margin-right: var(--sx-1); }
.sx-alert-close {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  align-self: flex-start; width: 24px; height: 24px; margin: -2px -2px -2px 0; padding: 0;
  border: 0; border-radius: var(--sx-r-xs); background: transparent; color: inherit; cursor: pointer;
  transition: background var(--sx-fast) var(--sx-ease);
}
.sx-alert-close:hover { background: rgba(18, 33, 30, .08); }

/* 纯 .sx-* 表单、面包屑、空态、卡片头与单点切换胶囊 */
.sx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sx-label, .sx-field-label { display: block; font-size: var(--sx-fs-13); font-weight: var(--sx-fw-medium); color: var(--sx-ink); }
fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
legend { padding: 0; }
fieldset.sx-stack > legend { margin-bottom: var(--sx-2); }
.sx-help, .sx-muted { font-size: var(--sx-fs-13); line-height: var(--sx-lh-13); color: var(--sx-ink-2); margin: 0; }
.sx-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--sx-fs-13); padding: 1px 6px; background: var(--sx-sunken); border-radius: var(--sx-r-xs); }
.sx-input-cap { max-width: 260px; }
.sx-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--sx-fs-13); color: var(--sx-ink-3); }
.sx-breadcrumb a { color: var(--sx-brand-700); }
.sx-breadcrumb a:hover { color: var(--sx-brand-800); }
.sx-card-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sx-3);
  padding-bottom: var(--sx-3); border-bottom: 1px solid var(--sx-line);
}
.sx-empty {
  padding: var(--sx-6) var(--sx-4); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--sx-2);
  color: var(--sx-ink-2); font-size: var(--sx-fs-13);
}
.sx-form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sx-3) var(--sx-4); }
.sx-form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sx-3); }
.sx-pill-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 10px; border-radius: var(--sx-r-pill);
  border: 1px solid var(--sx-line-strong); background: var(--sx-surface); color: var(--sx-ink-2);
  font-family: inherit; font-size: var(--sx-fs-12); font-weight: var(--sx-fw-medium);
  line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background var(--sx-fast) var(--sx-ease), border-color var(--sx-fast) var(--sx-ease), color var(--sx-fast) var(--sx-ease);
}
.sx-pill-toggle:hover:not(:disabled) { background: var(--sx-hover); color: var(--sx-ink); }
.sx-pill-toggle.is-ok { background: var(--sx-ok-bg); border-color: var(--sx-ok-border); color: var(--sx-ok-ink); }
.sx-pill-toggle.is-warn { background: var(--sx-warn-bg); border-color: var(--sx-warn-border); color: var(--sx-warn-ink); }
.sx-pill-toggle.is-mute { background: var(--sx-mute-bg); border-color: transparent; color: var(--sx-mute-ink); }
.sx-pill-toggle:disabled { opacity: .65; cursor: not-allowed; }

/* 弹窗（.sx-modal-backdrop） */
.sx-modal-backdrop {
  position: fixed; inset: 0; z-index: var(--sx-z-modal);
  background: var(--sx-scrim); backdrop-filter: blur(2px); display: none;
  align-items: center; justify-content: center; padding: var(--sx-4);
  overscroll-behavior: contain;
}
.sx-modal-backdrop.is-open { display: flex; }
.sx-modal-panel {
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--sx-surface); border: 1px solid var(--sx-line);
  border-top: 3px solid var(--sx-brand-600);
  border-radius: var(--sx-r-md); box-shadow: var(--sx-shadow-modal);
  padding: var(--sx-6); display: flex; flex-direction: column; gap: var(--sx-4);
  animation: sxModalIn 160ms var(--sx-ease);
}
@keyframes sxModalIn {
  from { opacity: 0; transform: translateY(6px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sx-modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sx-3); }
.sx-modal-title { margin: 0; font-size: var(--sx-fs-16); line-height: var(--sx-lh-16); font-weight: var(--sx-fw-bold); color: var(--sx-ink); }
#sx-confirm-modal-body .sx-modal-title { display: none; }
.sx-modal-desc { margin: 0; font-size: var(--sx-fs-14); line-height: var(--sx-lh-14); color: var(--sx-ink); }
.sx-modal-actions { display: flex; justify-content: flex-end; gap: var(--sx-2); padding-top: var(--sx-4); border-top: 1px solid var(--sx-line); }

/* 移动侧栏导航遮罩 */
.sx-nav-backdrop {
  position: fixed; inset: 0; z-index: var(--sx-z-scrim);
  background: var(--sx-scrim); display: none;
}
.sx-nav-backdrop.is-open { display: block; }

/* 纯 .sx-* 布局与排版原子类（Step 3 建齐） */
.sx-stack { display: flex; flex-direction: column; gap: var(--sx-3); min-width: 0; }
.sx-stack-lg { display: flex; flex-direction: column; gap: var(--sx-5); min-width: 0; }
.sx-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sx-2); min-width: 0; }
.sx-row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sx-3); min-width: 0; }
.sx-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sx-3); }
.sx-subsection-title { font-size: var(--sx-fs-14); line-height: var(--sx-lh-14); font-weight: var(--sx-fw-bold); color: var(--sx-ink); margin: 0; }
.sx-choice { display: inline-flex; align-items: center; gap: 6px; font-size: var(--sx-fs-13); color: var(--sx-ink); cursor: pointer; }
.sx-choice:has(.sx-cell-sub) { align-items: flex-start; }
.sx-choice:has(.sx-cell-sub) > input { margin-top: 2px; flex-shrink: 0; }
.sx-divider { border: 0; border-top: 1px solid var(--sx-line); margin: var(--sx-2) 0; }

/* 05 §1.4 红线：窄屏表单网格一律单列（按选择器名保留，勿删） */
@media (max-width: 767px) {
  .sx-form-grid-2, .sx-form-grid-3, .sx-grid-4 { grid-template-columns: 1fr; }
}

/* ========== 打印页眉基线（完整 @media print 置于末尾加载的 sx-widgets.css，确保压过 app.css 窄屏断点） ========== */
.sx-print-banner { display: none; }
