/* ==========================================================================
 * 超级工作台 Superwork · 设计系统 base.css
 * 基调：专业克制的企业级财税 SaaS（参考飞书清爽 + 金融级稳重）
 * 主色 #2B5FDD 面积 <10%，仅用于主操作/选中态/品牌
 * ========================================================================== */

:root {
  /* 品牌与语义色 */
  --sw-primary: #2B5FDD;
  --sw-primary-hover: #1F4DC9;
  --sw-primary-active: #1A44B4;
  --sw-primary-bg: #EEF3FE;
  --sw-success: #16A34A;
  --sw-success-bg: #E8F7EE;
  --sw-warning: #D97706;
  --sw-warning-bg: #FEF3E2;
  --sw-danger: #DC2626;
  --sw-danger-bg: #FDECEC;
  --sw-purple: #7C3AED;
  --sw-purple-bg: #F3EEFD;
  --sw-teal: #0D9488;
  --sw-teal-bg: #E6F7F5;

  /* 中性灰阶 10 级 */
  --sw-gray-1: #F8FAFC;
  --sw-gray-2: #F1F5F9;
  --sw-gray-3: #E2E8F0;
  --sw-gray-4: #CBD5E1;
  --sw-gray-5: #94A3B8;
  --sw-gray-6: #64748B;
  --sw-gray-7: #475569;
  --sw-gray-8: #334155;
  --sw-gray-9: #1E293B;
  --sw-gray-10: #0F172A;

  /* 布局 */
  --sw-sidebar-w: 220px;
  --sw-sidebar-min: 64px;
  --sw-topbar-h: 56px;
  --sw-radius: 10px;
  --sw-radius-sm: 6px;
  --sw-gap: 16px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-2: 0 4px 16px rgba(15, 23, 42, .10);
  --shadow-3: 0 12px 40px rgba(15, 23, 42, .16);

  --sw-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sw-font);
  font-size: 14px;
  color: var(--sw-gray-8);
  background: var(--sw-gray-2);
  line-height: 1.5715;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #C9DAFB; }
a { color: var(--sw-primary); text-decoration: none; }
a:hover { color: var(--sw-primary-hover); }
svg { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }
button { font-family: inherit; }

/* 数字等宽 */
.num, .sw-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ============================ 布局骨架 ============================ */
.sw-layout { display: flex; min-height: 100vh; }

.sw-sidebar {
  width: var(--sw-sidebar-w); flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--sw-gray-3);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: width .18s ease;
  overflow: hidden; z-index: 40;
}
.sw-sidebar.collapsed { width: var(--sw-sidebar-min); }
.sw-sidebar-logo {
  height: var(--sw-topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid var(--sw-gray-3);
}
.sw-sidebar-logo .logo-mark { width: 28px; height: 28px; flex-shrink: 0; }
.sw-sidebar-logo .logo-name { font-size: 15px; font-weight: 700; color: var(--sw-gray-10); white-space: nowrap; }
.sw-sidebar-logo .logo-sub { font-size: 11px; color: var(--sw-gray-5); white-space: nowrap; }
.sw-sidebar.collapsed .logo-name, .sw-sidebar.collapsed .logo-sub, .sw-sidebar.collapsed .nav-group-title, .sw-sidebar.collapsed .nav-item-text { display: none; }
.sw-sidebar.collapsed .sw-sidebar-logo { justify-content: center; padding: 0; }
.sw-sidebar.collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }

.sw-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group-title {
  font-size: 11px; color: var(--sw-gray-5); padding: 14px 10px 6px;
  letter-spacing: .06em;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px; margin-bottom: 2px;
  border-radius: 8px; color: var(--sw-gray-7); cursor: pointer;
  white-space: nowrap; position: relative; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--sw-gray-2); color: var(--sw-gray-9); }
.nav-item.active { background: var(--sw-primary-bg); color: var(--sw-primary); font-weight: 600; }
.nav-item .nav-item-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item-text { font-size: 14px; flex: 1; }
.nav-item .nav-badge {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--sw-danger); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; font-weight: 600;
}
.sw-sidebar.collapsed .nav-badge { position: absolute; top: 4px; right: 6px; }
.sw-sidebar-foot { padding: 10px; border-top: 1px solid var(--sw-gray-3); }
.sw-sidebar-fold {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 34px; border: none; background: transparent;
  color: var(--sw-gray-6); cursor: pointer; border-radius: 8px; font-size: 12px;
}
.sw-sidebar-fold:hover { background: var(--sw-gray-2); color: var(--sw-gray-8); }

.sw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sw-topbar {
  height: var(--sw-topbar-h); flex-shrink: 0;
  background: #FFFFFF; border-bottom: 1px solid var(--sw-gray-3);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 30;
}
.sw-topbar .org-name { font-size: 15px; font-weight: 600; color: var(--sw-gray-10); }
.sw-topbar .env-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 4px;
  background: var(--sw-success-bg); color: var(--sw-success);
  border: 1px solid #BFE8CC;
}
.sw-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 8px; border: none;
  background: transparent; color: var(--sw-gray-6); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.topbar-icon-btn:hover { background: var(--sw-gray-2); color: var(--sw-gray-8); }
.topbar-icon-btn .dot {
  position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--sw-danger); border: 2px solid #fff;
}
.sw-user { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.sw-user:hover { background: var(--sw-gray-2); }
.sw-user-name { font-size: 13px; color: var(--sw-gray-8); }
.sw-user-role { font-size: 11px; color: var(--sw-gray-5); }

.sw-content { padding: 24px; flex: 1; min-width: 0; }
.sw-page-head { display: flex; align-items: center; margin-bottom: 16px; gap: 12px; }
.sw-page-title { font-size: 20px; font-weight: 600; color: var(--sw-gray-10); line-height: 28px; }
.sw-page-desc { font-size: 13px; color: var(--sw-gray-6); margin-top: 2px; }
.sw-page-head .sw-btn { margin-left: auto; }

/* ============================ 卡片 ============================ */
.sw-card {
  background: #fff; border: 1px solid var(--sw-gray-3);
  border-radius: var(--sw-radius); box-shadow: var(--shadow-1);
}
.sw-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--sw-gray-2);
}
.sw-card-title { font-size: 15px; font-weight: 600; color: var(--sw-gray-9); }
.sw-card-sub { font-size: 12px; color: var(--sw-gray-5); }
.sw-card-head .head-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sw-card-body { padding: 16px 20px; }
.sw-card-body.p0 { padding: 0; }

/* ============================ 按钮（default/hover/active/disabled/loading） ============================ */
.sw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--sw-gray-3); background: #fff;
  font-size: 14px; color: var(--sw-gray-8); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  white-space: nowrap; user-select: none;
}
.sw-btn:hover { background: var(--sw-gray-1); border-color: var(--sw-gray-4); color: var(--sw-gray-9); }
.sw-btn:active { background: var(--sw-gray-2); transform: translateY(.5px); }
.sw-btn:focus-visible { outline: 2px solid #9DBAFF; outline-offset: 1px; }

.sw-btn.primary { background: var(--sw-primary); border-color: var(--sw-primary); color: #fff; }
.sw-btn.primary:hover { background: var(--sw-primary-hover); border-color: var(--sw-primary-hover); color: #fff; }
.sw-btn.primary:active { background: var(--sw-primary-active); }

.sw-btn.danger { background: var(--sw-danger); border-color: var(--sw-danger); color: #fff; }
.sw-btn.danger:hover { background: #B91C1C; border-color: #B91C1C; color: #fff; }
.sw-btn.danger-plain { color: var(--sw-danger); border-color: #F5C2C2; }
.sw-btn.danger-plain:hover { background: var(--sw-danger-bg); border-color: var(--sw-danger); color: var(--sw-danger); }

.sw-btn.success { background: var(--sw-success); border-color: var(--sw-success); color: #fff; }
.sw-btn.success:hover { background: #15803D; border-color: #15803D; color: #fff; }

.sw-btn.sm { height: 28px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.sw-btn.lg { height: 40px; padding: 0 22px; font-size: 15px; border-radius: 9px; }

.sw-btn:disabled, .sw-btn.disabled {
  background: var(--sw-gray-2); border-color: var(--sw-gray-3);
  color: var(--sw-gray-5); cursor: not-allowed; transform: none;
}
.sw-btn.loading { pointer-events: none; color: transparent !important; position: relative; }
.sw-btn.primary.loading, .sw-btn.danger.loading { color: transparent !important; }
.sw-btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid var(--sw-gray-4); border-top-color: var(--sw-primary);
  border-radius: 50%; animation: sw-spin .7s linear infinite;
}
.sw-btn.primary.loading::after { border-color: rgba(255,255,255,.35); border-top-color: #fff; }

@keyframes sw-spin { to { transform: rotate(360deg); } }

/* ============================ 徽章 ============================ */
.sw-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 5px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.sw-badge .badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sw-badge.blue   { background: var(--sw-primary-bg); color: var(--sw-primary); }
.sw-badge.green  { background: var(--sw-success-bg);  color: var(--sw-success); }
.sw-badge.orange { background: var(--sw-warning-bg);  color: var(--sw-warning); }
.sw-badge.red    { background: var(--sw-danger-bg);   color: var(--sw-danger); }
.sw-badge.purple { background: var(--sw-purple-bg);   color: var(--sw-purple); }
.sw-badge.teal   { background: var(--sw-teal-bg);     color: var(--sw-teal); }
.sw-badge.gray   { background: var(--sw-gray-2);      color: var(--sw-gray-6); }
.sw-badge.solid-blue { background: var(--sw-primary); color: #fff; }
/* 状态点 + 呼吸 */
.sw-badge.pulse .badge-dot { animation: sw-pulse 1.6s ease infinite; }
@keyframes sw-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 95, 221, .35); }
  50% { box-shadow: 0 0 0 4px rgba(43, 95, 221, 0); }
}

/* ============================ 头像 ============================ */
.sw-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.sw-avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.sw-avatar.lg { width: 44px; height: 44px; font-size: 17px; }
.sw-avatar.xl { width: 56px; height: 56px; font-size: 21px; }

/* ============================ 表格 ============================ */
.sw-table-wrap { overflow-x: auto; }
.sw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sw-table th {
  text-align: left; font-weight: 500; color: var(--sw-gray-6);
  background: var(--sw-gray-1); padding: 10px 16px;
  border-bottom: 1px solid var(--sw-gray-3); white-space: nowrap;
}
.sw-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--sw-gray-2);
  color: var(--sw-gray-8); vertical-align: middle;
}
.sw-table tbody tr { transition: background .1s; }
.sw-table tbody tr:hover { background: #FAFBFD; }
.sw-table.zebra tbody tr:nth-child(even) { background: var(--sw-gray-1); }
.sw-table.zebra tbody tr:hover { background: #F4F7FC; }
.sw-table .align-r, .sw-table td.num, .sw-table th.num { text-align: right; }
.sw-table .row-failed td { background: #FFF7F7; }
.sw-table .row-failed:hover td { background: #FDEDED; }
.sw-table .link { color: var(--sw-primary); cursor: pointer; }
.sw-table .link:hover { text-decoration: underline; }

/* ============================ 表单 ============================ */
.sw-input, .sw-select {
  height: 34px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--sw-gray-3); background: #fff;
  font-size: 14px; color: var(--sw-gray-9); outline: none;
  transition: border-color .12s, box-shadow .12s; font-family: inherit;
}
.sw-input:hover, .sw-select:hover { border-color: var(--sw-gray-4); }
.sw-input:focus, .sw-select:focus { border-color: var(--sw-primary); box-shadow: 0 0 0 3px rgba(43, 95, 221, .12); }
.sw-input::placeholder { color: var(--sw-gray-5); }
.sw-select { padding-right: 28px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.sw-form-item { margin-bottom: 18px; }
.sw-form-label { display: block; font-size: 13px; color: var(--sw-gray-7); margin-bottom: 7px; font-weight: 500; }
.sw-form-label .req { color: var(--sw-danger); margin-left: 2px; }

/* ============================ 步骤条 ============================ */
.sw-steps { display: flex; align-items: flex-start; }
.sw-step { flex: 1; min-width: 0; position: relative; }
.sw-step .step-dot {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; position: relative; z-index: 2;
  background: #fff; border: 2px solid var(--sw-gray-4); color: var(--sw-gray-5);
  transition: all .25s;
}
.sw-step .step-line { position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--sw-gray-3); z-index: 1; }
.sw-step .step-name { font-size: 12px; color: var(--sw-gray-6); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-step.done .step-dot { background: var(--sw-success); border-color: var(--sw-success); color: #fff; }
.sw-step.done .step-line { background: var(--sw-success); }
.sw-step.done .step-name { color: var(--sw-gray-7); }
.sw-step.current .step-dot { background: var(--sw-primary); border-color: var(--sw-primary); color: #fff; animation: sw-step-breath 1.8s ease infinite; }
.sw-step.current .step-name { color: var(--sw-primary); font-weight: 600; }
.sw-step.waiting .step-dot { background: var(--sw-purple-bg); border-color: var(--sw-purple); color: var(--sw-purple); animation: sw-step-breath 1.8s ease infinite; }
.sw-step.waiting .step-name { color: var(--sw-purple); font-weight: 600; }
.sw-step.failed .step-dot { background: var(--sw-danger-bg); border-color: var(--sw-danger); color: var(--sw-danger); }
.sw-step.failed .step-name { color: var(--sw-danger); font-weight: 600; }
@keyframes sw-step-breath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 95, 221, .30); }
  50% { box-shadow: 0 0 0 6px rgba(43, 95, 221, 0); }
}
.sw-step.waiting .step-dot { animation-name: sw-step-breath-purple; }
@keyframes sw-step-breath-purple {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .30); }
  50% { box-shadow: 0 0 0 6px rgba(124, 58, 237, 0); }
}

/* ============================ 时间线（事件类型分色） ============================ */
.sw-timeline { position: relative; padding-left: 4px; }
.sw-timeline-item { position: relative; padding: 0 0 22px 34px; }
.sw-timeline-item::before {
  content: ""; position: absolute; left: 11px; top: 24px; bottom: -2px;
  width: 2px; background: var(--sw-gray-3);
}
.sw-timeline-item:last-child::before { display: none; }
.tl-icon {
  position: absolute; left: 0; top: 1px; width: 24px; height: 24px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid transparent; z-index: 2; background: #fff;
}
.tl-icon svg { width: 12px; height: 12px; }
.tl-icon.plan     { border-color: var(--sw-gray-4); color: var(--sw-gray-6); }
.tl-icon.step     { border-color: var(--sw-primary); color: var(--sw-primary); background: var(--sw-primary-bg); }
.tl-icon.tool     { border-color: var(--sw-teal); color: var(--sw-teal); background: var(--sw-teal-bg); }
.tl-icon.decision { border-color: var(--sw-gray-7); color: var(--sw-gray-7); background: var(--sw-gray-2); }
.tl-icon.approval { border-color: var(--sw-warning); color: var(--sw-warning); background: var(--sw-warning-bg); }
.tl-icon.wait     { border-color: var(--sw-purple); color: var(--sw-purple); background: var(--sw-purple-bg); }
.tl-icon.ok       { border-color: var(--sw-success); color: var(--sw-success); background: var(--sw-success-bg); }
.tl-icon.fail     { border-color: var(--sw-danger); color: var(--sw-danger); background: var(--sw-danger-bg); }
.tl-time { font-size: 12px; color: var(--sw-gray-5); margin-right: 8px; font-variant-numeric: tabular-nums; }
.tl-title { font-size: 13px; font-weight: 600; color: var(--sw-gray-9); }
.tl-desc { font-size: 12.5px; color: var(--sw-gray-6); margin-top: 4px; line-height: 1.6; max-width: 640px; }
.tl-desc code {
  font-family: Consolas, Menlo, monospace; font-size: 11.5px;
  background: var(--sw-gray-2); padding: 1px 6px; border-radius: 4px; color: var(--sw-gray-8);
}

/* ============================ 标签页 ============================ */
.sw-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--sw-gray-3); }
.sw-tab {
  padding: 10px 16px; font-size: 14px; color: var(--sw-gray-6);
  cursor: pointer; border: none; background: none; position: relative;
  display: inline-flex; align-items: center; gap: 6px;
}
.sw-tab:hover { color: var(--sw-gray-9); }
.sw-tab.active { color: var(--sw-primary); font-weight: 600; }
.sw-tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; background: var(--sw-primary); border-radius: 2px;
}
.sw-tab .tab-count {
  font-size: 11px; padding: 0 6px; border-radius: 8px;
  background: var(--sw-gray-2); color: var(--sw-gray-6); line-height: 17px;
}
.sw-tab.active .tab-count { background: var(--sw-primary-bg); color: var(--sw-primary); }

/* ============================ 进度条 ============================ */
.sw-progress { height: 8px; border-radius: 4px; background: var(--sw-gray-2); overflow: hidden; }
.sw-progress .bar { height: 100%; border-radius: 4px; background: var(--sw-primary); transition: width .5s ease; }
.sw-progress .bar.green { background: var(--sw-success); }
.sw-progress .bar.orange { background: var(--sw-warning); }
.sw-progress .bar.red { background: var(--sw-danger); }
.sw-progress.warn80 .bar { background: var(--sw-warning); }

/* ============================ 骨架屏 ============================ */
.sw-skeleton {
  position: relative; overflow: hidden; background: var(--sw-gray-2); border-radius: 6px;
}
.sw-skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: translateX(-100%); animation: sw-shimmer 1.4s infinite;
}
@keyframes sw-shimmer { 100% { transform: translateX(100%); } }

/* ============================ 空态 ============================ */
.sw-empty { padding: 48px 24px; text-align: center; }
.sw-empty svg { width: 72px; height: 72px; color: var(--sw-gray-4); margin-bottom: 12px; }
.sw-empty-title { font-size: 14px; color: var(--sw-gray-7); font-weight: 500; }
.sw-empty-desc { font-size: 12.5px; color: var(--sw-gray-5); margin-top: 6px; line-height: 1.7; }
.sw-empty .sw-btn { margin-top: 16px; }

/* ============================ Toast ============================ */
.sw-toast-wrap { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.sw-toast {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 9px;
  background: var(--sw-gray-10); color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow-3); opacity: 0; transform: translateY(-8px);
  transition: opacity .22s, transform .22s; max-width: 480px;
}
.sw-toast.show { opacity: 1; transform: translateY(0); }
.sw-toast .t-icon { width: 16px; height: 16px; }
.sw-toast.success .t-icon { color: #4ADE80; }
.sw-toast.warn .t-icon { color: #FBBF24; }
.sw-toast.error .t-icon { color: #F87171; }
.sw-toast.info .t-icon { color: #7EB1FF; }

/* ============================ 弹窗 ============================ */
.sw-modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  z-index: 900; display: none; align-items: center; justify-content: center;
}
.sw-modal-mask.show { display: flex; animation: sw-fade .15s ease; }
.sw-modal {
  width: 420px; max-width: calc(100vw - 48px);
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-3);
  animation: sw-pop .18s ease;
}
.sw-modal-head { padding: 18px 22px 0; display: flex; align-items: center; gap: 8px; }
.sw-modal-title { font-size: 16px; font-weight: 600; color: var(--sw-gray-10); }
.sw-modal-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sw-modal-icon.danger { background: var(--sw-danger-bg); color: var(--sw-danger); }
.sw-modal-body { padding: 14px 22px 4px; font-size: 13.5px; color: var(--sw-gray-7); line-height: 1.7; }
.sw-modal-foot { padding: 16px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
@keyframes sw-fade { from { opacity: 0; } }
@keyframes sw-pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }

/* ============================ 抽屉 ============================ */
.sw-drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .40); z-index: 900; display: none; }
.sw-drawer-mask.show { display: block; animation: sw-fade .15s ease; }
.sw-drawer {
  position: fixed; top: 0; right: -560px; bottom: 0; width: 560px; max-width: 92vw;
  background: #fff; z-index: 901; box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; transition: right .22s ease;
}
.sw-drawer.show { right: 0; }
.sw-drawer-head { padding: 16px 22px; border-bottom: 1px solid var(--sw-gray-3); display: flex; align-items: center; }
.sw-drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }

/* ============================ 下拉菜单 ============================ */
.sw-dropdown { position: relative; }
.sw-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 160px;
  background: #fff; border: 1px solid var(--sw-gray-3); border-radius: 10px;
  box-shadow: var(--shadow-2); padding: 6px; z-index: 100;
  display: none; animation: sw-pop .14s ease;
}
.sw-menu.show { display: block; }
.sw-menu-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 7px; font-size: 13px; color: var(--sw-gray-7); cursor: pointer;
}
.sw-menu-item:hover { background: var(--sw-gray-2); color: var(--sw-gray-9); }
.sw-menu-item.danger { color: var(--sw-danger); }
.sw-menu-item.danger:hover { background: var(--sw-danger-bg); }
.sw-menu-item svg { width: 15px; height: 15px; color: var(--sw-gray-5); }
.sw-menu-item.danger svg { color: var(--sw-danger); }
.sw-menu-divider { height: 1px; background: var(--sw-gray-2); margin: 5px 8px; }

/* ============================ 通用工具类 ============================ */
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.text-12 { font-size: 12px; } .text-13 { font-size: 13px; }
.text-gray { color: var(--sw-gray-6); } .text-gray-deep { color: var(--sw-gray-7); }
.text-bold { font-weight: 600; }
.text-primary { color: var(--sw-primary); }
.text-success { color: var(--sw-success); } .text-danger { color: var(--sw-danger); }
.text-warning { color: var(--sw-warning); } .text-purple { color: var(--sw-purple); }
.text-right { text-align: right; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: var(--sw-primary); cursor: pointer; }
.link:hover { color: var(--sw-primary-hover); text-decoration: underline; }

/* 键值对快照（审批卡/详情面板） */
.kv-list { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 13px; }
.kv-list .k { color: var(--sw-gray-6); }
.kv-list .v { color: var(--sw-gray-9); word-break: break-all; }
.kv-list .v.hl { color: var(--sw-gray-10); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

/* 筛选栏 */
.sw-filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.sw-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: 15px; border: 1px solid var(--sw-gray-3); background: #fff;
  font-size: 12.5px; color: var(--sw-gray-7); cursor: pointer; transition: all .12s;
}
.sw-chip:hover { border-color: var(--sw-primary); color: var(--sw-primary); }
.sw-chip.active { background: var(--sw-primary-bg); border-color: var(--sw-primary); color: var(--sw-primary); font-weight: 500; }

/* 描述列表（详情页） */
.desc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 24px; }
.desc-item .d-label { font-size: 12px; color: var(--sw-gray-5); margin-bottom: 3px; }
.desc-item .d-value { font-size: 13.5px; color: var(--sw-gray-9); }

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 窄屏兜底（≥1024 保持三栏可用，以下收起侧栏） */
@media (max-width: 1024px) {
  .sw-sidebar { position: fixed; left: -230px; transition: left .2s; }
  .sw-sidebar.mobile-show { left: 0; box-shadow: var(--shadow-3); }
}
