/* ============================================================
   SOP 建设中心 · 通用结构与组件样式
   ------------------------------------------------------------
   本文件只负责「结构与组件」，颜色 / 圆角 / 阴影 / 字体
   全部走设计令牌（定义在 theme-minimal.css / theme-chinese.css 的 :root）。
   换肤 = 替换 <link id="skin-css"> 指向的主题文件，本文件无需改动。
   规则：本文件内不得出现硬编码颜色（图表 SVG 除外，用 data 属性写入）。
   ============================================================ */

/* ---------- 1. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--tr), color var(--tr);
}
h1, h2, h3, h4, p, figure { margin: 0; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
img { max-width: 100%; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor;
      stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }
.ic-xl { width: 30px; height: 30px; }

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 2. 布局骨架 ---------- */
.app { min-height: 100vh; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--tr);
}

/* ----- 侧边栏 ----- */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w); z-index: 60;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: transform var(--tr), background var(--tr);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  height: var(--topbar-h); padding: 0 16px; flex: none;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em;
  box-shadow: 0 6px 16px var(--primary-ring);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.28; min-width: 0; }
.brand-text b { font-size: 14.5px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; font-family: var(--font-title, var(--font)); }
.brand-text i { font-style: normal; font-size: 10.5px; color: var(--text-3); letter-spacing: .06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; }
.nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  color: var(--text-3); text-transform: uppercase; padding: 14px 10px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; margin-bottom: 3px;
  border-radius: var(--r-sm);
  color: var(--text-2); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all var(--tr); position: relative;
  width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav-item .nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center; border-radius: var(--r-full);
  background: var(--surface-3); color: var(--text-2);
}
.nav-item.active .nav-badge { background: var(--primary); color: #fff; }

.sidebar-user {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-top: 1px solid var(--border);
}
.su-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.su-meta b { font-size: 13px; font-weight: 650; }
.su-meta i { font-style: normal; font-size: 11.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----- 顶部栏 ----- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar { background: color-mix(in srgb, var(--surface) 86%, transparent); }
}
.topbar-title { font-size: 16px; font-weight: 700; white-space: nowrap;
  font-family: var(--font-title, var(--font)); }
.topbar-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 340px; height: 38px; padding: 0 13px;
  border-radius: var(--r-full); background: var(--surface-3); color: var(--text-3);
  transition: box-shadow var(--tr), background var(--tr);
}
.search-box:focus-within { background: var(--surface); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-box input { border: 0; background: none; outline: none; width: 100%;
  font-size: 13.5px; color: var(--text); }
.search-box input::placeholder { color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
  position: relative; width: 38px; height: 38px; flex: none;
  display: grid; place-items: center; border-radius: var(--r-sm);
  color: var(--text-2); transition: all var(--tr);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
}

/* ----- 内容区 / 视图 ----- */
.content { flex: 1; padding: 22px; max-width: 1440px; width: 100%; }
.view { display: none; }
.view.active { display: block; animation: fadeUp .34s cubic-bezier(.4, 0, .2, 1); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; max-width: 760px; }
.page-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 3. 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-1); padding: 18px;
  transition: box-shadow var(--tr), border-color var(--tr), background var(--tr);
}
.card.hoverable:hover { box-shadow: var(--sh-2); border-color: var(--border-2); }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
.card-head h2, .card-head h3 { margin-right: auto; }
.card-title { display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--primary); }
.card-sub { font-size: 12.5px; color: var(--text-3); margin-top: -8px; margin-bottom: 14px; }

/* ---------- 4. 栅格 ---------- */
.grid { display: grid; gap: var(--gap); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- 5. 统计卡 ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.i-blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.i-green  { background: linear-gradient(135deg, #34d399, #0ea371); }
.i-amber  { background: linear-gradient(135deg, #fbbf24, #d99413); }
.i-violet { background: linear-gradient(135deg, #a78bfa, #7c5cfc); }
.i-red    { background: linear-gradient(135deg, #fb7185, #e5484d); }
.i-teal   { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.stat-num { font-size: 27px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 10px; }
.spark i { flex: 1; border-radius: 3px 3px 0 0; min-height: 4px;
  background: var(--primary-soft); transition: background var(--tr); }
.spark i.on { background: var(--primary); }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; transition: all var(--tr);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px var(--primary-ring); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { border-color: var(--border-2); color: var(--text-2); background: var(--surface); }
.btn-outline:hover { border-color: var(--text-3); color: var(--text); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-soft); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-icon { width: 32px; padding: 0; }

/* ---------- 7. 标签 / 徽章 / 碎片 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.b-blue   { background: var(--primary-soft); color: var(--primary); }
.b-green  { background: var(--success-soft); color: var(--success); }
.b-amber  { background: var(--warning-soft); color: var(--warning); }
.b-red    { background: var(--danger-soft);  color: var(--danger); }
.b-gray   { background: var(--surface-3);    color: var(--text-2); }
.b-violet { background: var(--violet-soft);  color: var(--violet); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2);
}
.chip.tiny { height: 22px; padding: 0 9px; font-size: 11.5px; }
.chip button { display: grid; place-items: center; color: var(--text-3); }
.chip button:hover { color: var(--danger); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r-sm); }
.segmented button {
  height: 30px; padding: 0 14px; border-radius: 7px;
  font-size: 13px; font-weight: 550; color: var(--text-2); transition: all var(--tr);
}
.segmented button.active { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: var(--sh-1); }

.kbd { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px;
  border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; color: var(--text-2); }

/* ---------- 8. 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px -18px; padding: 0 18px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .04em;
  color: var(--text-3); padding: 10px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.table thead th:first-child { border-radius: var(--r-xs) 0 0 var(--r-xs); }
.table thead th:last-child  { border-radius: 0 var(--r-xs) var(--r-xs) 0; }
.table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--tr); }
.table tbody tr:hover { background: var(--surface-2); }
.table .ta-r { text-align: right; }
.table .strong { font-weight: 650; }
.table .mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }

/* ---------- 9. 列表 ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px;
  border-bottom: 1px solid var(--border); transition: background var(--tr); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main b { display: block; font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-main span { font-size: 12px; color: var(--text-3); }
.li-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ---------- 10. 头像 ---------- */
.avatar {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: #fff; font-size: 13px; font-weight: 650;
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 54px; height: 54px; font-size: 19px; }
.avatar.gray { background: var(--surface-3); color: var(--text-2); }

/* ---------- 11. 表单 ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .half-right { grid-column: 2 / 3; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-3); }

.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 13px;
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  background: var(--surface); font-size: 13.5px; outline: none;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:disabled, .textarea:disabled { background: var(--surface-3); color: var(--text-3); }
.select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2393a0b4' stroke-width='1.8' stroke-linecap='round'><path d='M4 6.5l4 4 4-4'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input-group { display: flex; align-items: center; gap: 8px; }
.input-mini { height: 34px; font-size: 12.5px; padding: 0 10px; }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--text-2); cursor: pointer; transition: all var(--tr);
}
.radio-row input { display: none; }
.radio-row label:hover { border-color: var(--text-3); }
.radio-row label.sel, .radio-row label:has(input:checked) {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600;
}

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.check input { display: none; }
.check .box {
  width: 19px; height: 19px; flex: none;
  border: 1.6px solid var(--border-2); border-radius: 6px;
  display: grid; place-items: center; color: transparent; transition: all var(--tr);
}
.check input:checked + .box { background: var(--primary); border-color: var(--primary); color: #fff; }
.check input:checked + .box::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex: none; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: var(--border-2); transition: background var(--tr); }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 19px; height: 19px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--tr);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(19px); }

.switch-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .sr-main { flex: 1; }
.switch-row .sr-main b { display: block; font-size: 13.5px; font-weight: 600; }
.switch-row .sr-main span { font-size: 12px; color: var(--text-3); }

.upload {
  display: grid; place-items: center; gap: 6px; padding: 26px; text-align: center;
  border: 1.5px dashed var(--border-2); border-radius: var(--r);
  background: var(--surface-2); color: var(--text-3); cursor: pointer; transition: all var(--tr);
}
.upload:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.upload b { font-size: 13.5px; font-weight: 600; color: var(--text-2); }

/* ---------- 12. 进度 / 时间线 / 空状态 ---------- */
.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--primary);
  transition: width .6s cubic-bezier(.4, 0, .2, 1); }
.progress.green > i { background: var(--success); }
.progress.amber > i { background: var(--warning); }
.progress.red > i { background: var(--danger); }
.progress.thin { height: 5px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border); border-radius: 2px; }
.timeline li { position: relative; padding-bottom: 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -22px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--border-2);
}
.timeline li.done::before { border-color: var(--success); background: var(--success); }
.timeline li.now::before  { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline b { display: block; font-size: 13.5px; font-weight: 600; }
.timeline span { font-size: 12px; color: var(--text-3); }

.empty { display: grid; place-items: center; gap: 10px; padding: 46px 20px; text-align: center; color: var(--text-3); }
.empty .ic { width: 40px; height: 40px; stroke-width: 1.2; opacity: .5; }
.empty b { font-size: 14px; font-weight: 600; color: var(--text-2); }

/* ---------- 13. 图表 ---------- */
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.donut { width: 148px; height: 148px; flex: none; }
.donut .track { stroke: var(--surface-3); }
.donut .val { stroke: var(--primary); transition: stroke-dasharray .8s ease; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-center { position: relative; }
.donut-center .num { position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 168px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; gap: 8px; height: 100%; }
.bars .bar > i { width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  transition: height .7s cubic-bezier(.4, 0, .2, 1); }
.bars .bar > span { font-size: 11.5px; color: var(--text-3); }
.bars .bar.alt > i { background: linear-gradient(180deg, var(--violet), var(--violet-2)); }

/* ---------- 14. 快捷入口 ---------- */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick a, .quick button {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 15px 8px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2); transition: all var(--tr); text-align: center;
}
.quick a:hover, .quick button:hover {
  border-color: var(--primary); color: var(--primary);
  transform: translateY(-2px); box-shadow: var(--sh-2);
}
.quick .ic { width: 22px; height: 22px; }

/* ---------- 15. Toast / 遮罩 / 弹层 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 200;
  transform: translate(-50%, 24px);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--r-sm);
  background: var(--text); color: var(--surface);
  font-size: 13.5px; font-weight: 550; box-shadow: var(--sh-3);
  opacity: 0; pointer-events: none; transition: all .3s cubic-bezier(.4, 0, .2, 1);
  max-width: min(90vw, 460px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { color: var(--success); flex: none; }
.toast.warn .ic { color: var(--warning); }
.toast.err .ic { color: var(--danger); }

.overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--tr);
}
.overlay.show { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed; z-index: 90; left: 50%; top: 50%;
  transform: translate(-50%, -48%) scale(.97);
  width: min(92vw, 560px); max-height: 86vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: 22px;
  opacity: 0; pointer-events: none; transition: all .22s cubic-bezier(.4, 0, .2, 1);
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal.doc-modal { width: min(94vw, 820px); }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin-right: auto; }

/* ---------- 16. 工具类 ---------- */
.muted { color: var(--text-3); font-size: 12.5px; }
.text-2 { color: var(--text-2); }
.green { color: var(--success); }
.red { color: var(--danger); }
.amber { color: var(--warning); }
.blue { color: var(--primary); }
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.only-mobile { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }

/* ============================================================
   SOP 建设相关的业务组件
   ============================================================ */

/* ----- 建设进度环 ----- */
.meter { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.meter-ring { position: relative; width: 108px; height: 108px; flex: none; }
.meter-ring svg { width: 108px; height: 108px; transform: rotate(-90deg); }
.meter-ring .track { stroke: var(--surface-3); }
.meter-ring .val { stroke: var(--primary); stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.4,0,.2,1); }
.meter-ring .pct { position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 22px; font-weight: 750; letter-spacing: -.02em; }

/* 预览栏（桌面端吸顶跟随） */
.preview-pane { position: sticky; top: calc(var(--topbar-h) + 18px); align-self: start; }

/* ----- 步骤导轨（向导）----- */
.steps-rail { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; }
.steps-rail .st {
  flex: 1 0 auto; min-width: 132px; text-align: left;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: all var(--tr); cursor: pointer;
}
.steps-rail .st:hover { border-color: var(--border-2); }
.steps-rail .st .n {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  background: var(--surface-3); color: var(--text-3);
}
.steps-rail .st .t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.steps-rail .st .t b { font-size: 13px; font-weight: 650; color: var(--text-2); }
.steps-rail .st .t span { font-size: 11px; color: var(--text-3); }
.steps-rail .st.done .n { background: var(--success-soft); color: var(--success); }
.steps-rail .st.now { border-color: var(--primary); background: var(--primary-soft); }
.steps-rail .st.now .n { background: var(--primary); color: #fff; }
.steps-rail .st.now .t b { color: var(--primary); }

/* ----- 动作步骤编辑行 ----- */
.step-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.step-row .sn {
  width: 28px; height: 28px; flex: none; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--primary); color: #fff;
}
.step-row .sf { flex: 1; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.step-row .sf [data-sf="what"] { grid-column: 1 / -1; }
.step-row .sx { display: flex; gap: 4px; }

/* ----- SOP 卡片（预览 / 库）----- */
.sop-card {
  border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
  background: var(--surface); transition: all var(--tr);
}
.sop-card:hover { box-shadow: var(--sh-2); border-color: var(--border-2); }
.sop-card .sc-head { padding: 15px 17px 13px; border-bottom: 1px solid var(--border); }
.sop-card .sc-body { padding: 14px 17px; }
.sop-card .sc-title { font-size: 15.5px; font-weight: 700; }
.sop-card .sc-foot { padding: 12px 17px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 三要素三栏 */
.tri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tri-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 16px 18px; border-top: 3px solid var(--primary); }
.tri-card.c2 { border-top-color: var(--violet); }
.tri-card.c3 { border-top-color: var(--success); }
.tri-card .idx { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--text-3); }
.tri-card h3 { font-size: 16px; margin: 2px 0 3px; }
.tri-card .one-line { font-size: 12.5px; color: var(--primary); font-weight: 600; margin-bottom: 9px; }
.tri-card.c2 .one-line { color: var(--violet); }
.tri-card.c3 .one-line { color: var(--success); }
.tri-card ul { padding-left: 16px; list-style: disc; font-size: 13px; color: var(--text-2); }
.tri-card li { margin-bottom: 5px; }

/* 公式条 */
.formula {
  text-align: center; padding: 22px 18px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 17px; font-weight: 700; line-height: 1.7;
}
.formula em { font-style: normal; }
.formula .f1 { color: var(--primary); }
.formula .f2 { color: var(--violet); }
.formula .f3 { color: var(--success); }

/* 提示条 */
.callout { background: var(--primary-soft); border-left: 3px solid var(--primary);
  border-radius: var(--r-sm); padding: 13px 16px; font-size: 13.5px; color: var(--text-2); }
.callout b { display: block; margin-bottom: 3px; font-size: 12.5px; color: var(--primary); }
.callout.warn { background: var(--danger-soft); border-left-color: var(--danger); }
.callout.warn b { color: var(--danger); }
.callout.good { background: var(--success-soft); border-left-color: var(--success); }
.callout.good b { color: var(--success); }
.callout.amber { background: var(--warning-soft); border-left-color: var(--warning); }
.callout.amber b { color: var(--warning); }

/* 坑位列表 */
.mistake { display: flex; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.mistake:last-child { border-bottom: none; }
.mistake .x { flex: none; width: 26px; height: 26px; border-radius: 7px;
  background: var(--danger-soft); color: var(--danger);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.mistake .txt b { display: block; font-size: 14px; }
.mistake .txt span { font-size: 13px; color: var(--text-3); }

/* 自查清单 */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.checklist label {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 12px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 13.5px; transition: background var(--tr);
}
.checklist label:hover { background: var(--surface-2); }
.checklist input { display: none; }
.checklist .box {
  width: 19px; height: 19px; flex: none; margin-top: 1px;
  border: 1.6px solid var(--border-2); border-radius: 6px;
  display: grid; place-items: center; transition: all var(--tr);
}
.checklist input:checked + .box { background: var(--success); border-color: var(--success); }
.checklist input:checked + .box::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -2px);
}
.checklist label.ok { color: var(--text-3); }

/* 模板卡 */
.tmpl-card {
  border: 1px solid var(--border); border-radius: var(--r); padding: 16px;
  background: var(--surface); display: flex; flex-direction: column; gap: 10px;
  transition: all var(--tr); cursor: pointer;
}
.tmpl-card:hover { border-color: var(--primary); box-shadow: var(--sh-2); transform: translateY(-2px); }
.tmpl-card .tm-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.tmpl-card h3 { font-size: 15px; }
.tmpl-card p { font-size: 12.5px; color: var(--text-3); flex: 1; }
.tmpl-card .tm-meta { display: flex; gap: 6px; flex-wrap: wrap; }

/* 分节标题 */
h2.section { font-size: 18px; font-weight: 700; margin: 30px 0 14px; padding-left: 12px; border-left: 4px solid var(--primary); }
h2.section.first { margin-top: 0; }
h2.section.teal { border-left-color: var(--success); }

/* 打印预览用的 SOP 单据 */
.doc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 26px 28px;
}
.doc-title { text-align: center; font-size: 19px; font-weight: 750; letter-spacing: .02em; }
.doc-meta { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3); margin-top: 6px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 16px; }
.doc-table th, .doc-table td { border: 1px solid var(--border); padding: 9px 11px; vertical-align: top; text-align: left; }
.doc-table th { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.doc-table .dim { width: 116px; font-weight: 600; color: var(--text-2); background: var(--surface-2); }

/* ============================================================
   响应式适配
   ============================================================ */
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .tri { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .sidebar { width: 264px; transform: translateX(-100%); box-shadow: var(--sh-3); border-right: 0; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .only-mobile { display: grid !important; }
  .content { padding: 18px 16px 28px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-title { font-size: 15px; }
  .topbar-sub { display: none; }
  .search-box { max-width: none; }
  .preview-pane { position: static; }
}
@media (max-width: 700px) {
  body { font-size: 13.5px; }
  h1 { font-size: 19px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 16px 13px 30px; }
  :root { --gap: 14px; }
  .card { padding: 15px; border-radius: var(--r-sm); }
  .page-head { align-items: flex-start; margin-bottom: 16px; }
  .page-actions { margin-left: 0; width: 100%; }
  .page-actions .btn { flex: 1; }
  .search-box { display: none; }
  .topbar { height: 58px; }
  .brand { height: 58px; }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .quick a, .quick button { padding: 12px 4px; font-size: 11.5px; gap: 6px; }
  .stat-num { font-size: 23px; }
  .bars { height: 140px; gap: 8px; }
  .table-wrap { margin: 0 -15px -15px; padding: 0 15px; }
  .step-row .sf { grid-template-columns: minmax(0, 1fr); }
  .table.responsive thead { display: none; }
  .table.responsive tbody tr { display: block; padding: 13px 0; border-bottom: 1px solid var(--border); }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive tbody td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 5px 0; border: 0; text-align: right !important;
  }
  .table.responsive tbody td::before {
    content: attr(data-label); flex: none; font-size: 12px; font-weight: 600;
    color: var(--text-3); text-align: left;
  }
  .table.responsive tbody td:first-child { padding-bottom: 10px; font-weight: 700;
    justify-content: flex-start; text-align: left !important; }
  .table.responsive tbody td:first-child::before { display: none; }
  .table.responsive td .btn { margin-left: auto; }
  .doc { padding: 18px 14px; }
}
@media (max-width: 420px) {
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .donut-wrap { justify-content: center; }
  .page-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .topbar, .page-actions, .toast, .overlay { display: none !important; }
  .main { margin-left: 0; }
  .card, .doc, .sop-card { box-shadow: none; border-color: #ddd; }
  .doc { border: 0; padding: 0; }

  /* 打印单条 SOP 时：只输出单据本身 */
  body.modal-open .app, body.modal-open .toast { display: none !important; }
  body.modal-open .overlay { display: none !important; }
  body.modal-open .modal {
    position: static; transform: none; width: auto; max-width: none;
    max-height: none; overflow: visible; padding: 0; border: 0;
    border-radius: 0; box-shadow: none; opacity: 1;
  }
  body.modal-open .modal-head, body.modal-open #modalBody > .row { display: none !important; }
  .doc-table, .doc { break-inside: auto; }
  .doc-table tr { break-inside: avoid; }
}

/* ============================================================
   账号体系 · 登录门 / 用户菜单 / 成员管理
   ============================================================ */
[hidden] { display: none !important; }
.row-wrap { flex-wrap: wrap; }
.dim { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12.8px; }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main span { font-size: 12px; color: var(--text-3); }

/* ----- 登录门 ----- */
body.auth-locked { overflow: hidden; }

.auth-gate {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 20px; overflow: auto; background: var(--bg);
}
.auth-gate::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(720px 460px at 10% 4%, var(--primary-soft), transparent 68%),
    radial-gradient(560px 420px at 94% 96%, var(--primary-soft), transparent 68%);
}

.auth-shell {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.04fr .96fr;
  width: min(1000px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
  animation: fadeUp .4s cubic-bezier(.4, 0, .2, 1);
}

/* 左：品牌叙事 */
.auth-aside {
  position: relative; display: flex; flex-direction: column; gap: 22px;
  padding: 38px 36px 30px;
  background: linear-gradient(155deg, var(--primary), var(--primary-2));
  color: #fff;
}
.auth-aside::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(320px 220px at 88% 6%, rgba(255, 255, 255, .20), transparent 70%),
    radial-gradient(280px 220px at 6% 96%, rgba(255, 255, 255, .12), transparent 70%);
}
.auth-aside > * { position: relative; z-index: 1; }

.aa-brand { display: flex; align-items: center; gap: 12px; }
.aa-brand .brand-logo {
  width: 42px; height: 42px; border-radius: var(--r-sm);
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  letter-spacing: .04em;
  background: rgba(255, 255, 255, .18); color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
}
.aa-brand-txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.aa-brand-txt b { font-size: 14.5px; font-weight: 700; }
.aa-brand-txt i { font-style: normal; font-size: 11.5px; opacity: .8; }

.aa-title {
  font-size: 25px; line-height: 1.42; font-weight: 700; letter-spacing: -.01em;
  font-family: var(--font-title, var(--font));
}
.aa-desc { font-size: 13px; line-height: 1.75; opacity: .85; margin-top: -8px; }

.aa-points { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.aa-points li { display: flex; gap: 11px; align-items: flex-start; }
.aa-points b { display: block; font-size: 13px; font-weight: 650; margin-bottom: 2px; }
.aa-points span { font-size: 12px; line-height: 1.6; opacity: .8; }
.aa-dot {
  width: 7px; height: 7px; flex: none; margin-top: 7px;
  background: #fff; border-radius: var(--r-full);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .22);
}

.aa-foot { margin-top: auto; font-size: 11.5px; opacity: .7; padding-top: 10px; }

/* 右：表单 */
.auth-main {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 40px 34px;
}
.auth-form { width: 100%; max-width: 344px; display: flex; flex-direction: column; gap: 15px; }
.af-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.af-head h1 { font-size: 21px; }
.af-head p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.af-badge {
  width: 42px; height: 42px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}

.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 42px; }
.pwd-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--r-xs); color: var(--text-3);
}
.pwd-eye:hover { background: var(--surface-3); color: var(--text-2); }

.auth-err {
  font-size: 12.5px; line-height: 1.6; padding: 9px 12px;
  border-radius: var(--r-xs); color: var(--danger);
  background: var(--danger-soft);
  border-left: 3px solid var(--danger);
}
.auth-err.info {
  color: var(--text-2); background: var(--surface-3); border-left-color: var(--border-2);
}

.af-foot {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--text-3); margin-top: 2px;
}
.dot-live {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--text-3); box-shadow: 0 0 0 3px var(--surface-3);
}
.dot-live.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

/* ----- 模式标记（顶栏） ----- */
.mode-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; margin-right: 2px;
  border-radius: var(--r-full); background: var(--surface-3);
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  white-space: nowrap;
}
.mode-chip .dot-live { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.mode-chip.local { color: var(--warning); }
.mode-chip.local .dot-live { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

/* ----- 侧边栏用户区 ----- */
.sidebar-user { position: relative; display: block; padding: 10px; }
.user-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; border-radius: var(--r-sm);
  text-align: left; transition: background var(--tr);
}
.user-btn:hover { background: var(--surface-3); }
.user-btn .su-caret {
  width: 14px; height: 14px; color: var(--text-3);
  transform: rotate(-90deg); transition: transform var(--tr); flex: none;
}
.user-btn[aria-expanded="true"] .su-caret { transform: rotate(90deg); }

.user-menu {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% - 2px);
  z-index: 70; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-3);
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(.98);
  transform-origin: bottom center;
  transition: opacity var(--tr), transform var(--tr), visibility var(--tr);
}
.user-menu.show { opacity: 1; visibility: visible; transform: none; }
.um-head {
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 5px;
}
.um-head b { font-size: 13px; font-weight: 650; }
.um-head span { font-size: 11.5px; color: var(--text-3); }
.um-item {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--r-xs);
  font-size: 13px; color: var(--text-2); text-align: left;
  transition: background var(--tr), color var(--tr);
}
.um-item:hover { background: var(--surface-3); color: var(--text); }
.um-item.danger { color: var(--danger); }
.um-item.danger:hover { background: var(--danger-soft); }
.um-sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* ----- 设置页账号卡 ----- */
.acct-row { display: flex; align-items: center; gap: 12px; }
.acct-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.acct-main b { font-size: 14px; font-weight: 650; }
.acct-main span { font-size: 12px; color: var(--text-3); }

/* ----- 复制地址 ----- */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .input { flex: 1; }

/* ----- 成员表 ----- */
#view-users .table td { font-size: 13px; }
#view-users .table .avatar { flex: none; }

/* ----- 响应式 ----- */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding: 34px 24px 30px; }
  .auth-form { max-width: none; }
}
@media (max-width: 560px) {
  .auth-gate { padding: 0; align-items: stretch; }
  .auth-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .mode-chip { display: none; }
}

/* ============================================================
   只读分享视图
   ============================================================ */
.share-banner {
  display: none;
  align-items: flex-start; gap: 10px;
  padding: 12px 15px; margin-bottom: 16px;
  border-radius: var(--r);
  background: var(--primary-soft);
  border: 1px solid var(--border);
}
.share-banner .ic { color: var(--primary); flex: none; margin-top: 2px; }
.share-banner .sb-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-banner b { font-size: 13.2px; font-weight: 650; color: var(--text); }
.share-banner span { font-size: 12.2px; line-height: 1.6; color: var(--text-2); }

body.share-mode .share-banner { display: flex; }

/* 分享视图里，一切「写入型」入口全部收起来 */
body.share-mode [data-go="wizard"],
body.share-mode [data-go="templates"],
body.share-mode [data-view="wizard"],
body.share-mode [data-view="templates"],
body.share-mode [data-view="settings"],
body.share-mode #navSystemLabel,
body.share-mode #libExport,
body.share-mode #libShare,
body.share-mode #bellBtn,
body.share-mode #userMenu,
body.share-mode .su-caret { display: none !important; }
body.share-mode #userBtn { pointer-events: none; cursor: default; }

/* 分享链接失效 / 打不开 */
.share-fail {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.share-fail .sf-ico {
  width: 56px; height: 56px; border-radius: 17px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.share-fail .sf-ico .ic { width: 24px; height: 24px; }
.share-fail h1 { font-size: 19px; letter-spacing: -.01em; }
.share-fail p { font-size: 13px; line-height: 1.75; color: var(--text-3); }
.share-fail .btn { margin-top: 8px; }

/* ============================================================
   部门与分类
   ============================================================ */
.chip-all { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.req { color: var(--danger); margin-left: 2px; }
.hint { font-size: 11.8px; color: var(--text-3); line-height: 1.6; }

.filter-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.filter-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.filter-item .select { height: 32px; min-width: 132px; font-size: 12.8px; padding: 0 10px; }
.select-sm { height: 32px; font-size: 12.8px; padding: 0 10px; }

.inline-form { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 120px; height: 38px; }
.inline-form .btn { flex: none; }

.tax-list { display: flex; flex-direction: column; }
.tax-row { display: flex; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.tax-row:last-child { border-bottom: 0; }
.tax-ico {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: grid; place-items: center; background: var(--surface-3); color: var(--text-2);
}
.tax-ico.sys { background: var(--primary-soft); color: var(--primary); }
.tax-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tax-main b { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.tax-main span { font-size: 11.8px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tax-count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tax-ops { display: flex; gap: 2px; flex: none; }

/* 总览 · 部门分布 */
.dept-bars { display: flex; flex-direction: column; gap: 12px; }
.dept-bar-row { display: grid; grid-template-columns: minmax(130px, 1.1fr) 2fr 92px; gap: 14px; align-items: center; }
.dept-bar-row .db-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.dept-bar-row .db-name b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dept-bar-row .db-note { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-bar-row .db-num { text-align: right; font-variant-numeric: tabular-nums; }
.dept-bar-row .db-num b { font-size: 14px; }
.dept-bar-row .db-num span { display: block; font-size: 11px; color: var(--text-3); }
.dept-bar-row.zero { opacity: .5; }
.cat-summary {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.cat-summary .cs-label { font-size: 12px; color: var(--text-3); }

/* 高级选项折叠 */
.adv-box { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); padding: 2px 14px 12px; }
.adv-box > summary {
  cursor: pointer; list-style: none; padding: 12px 0;
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.adv-box > summary::-webkit-details-marker { display: none; }
.adv-box > summary::before { content: "▸"; color: var(--text-3); font-size: 12px; transition: transform var(--tr); }
.adv-box[open] > summary::before { transform: rotate(90deg); }
.adv-box[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }

body.share-mode [data-view="departments"] { display: none !important; }

@media (max-width: 720px) {
  .dept-bar-row { grid-template-columns: 1fr 76px; }
  .dept-bar-row .progress { display: none; }
}

@media (max-width: 560px) {
  .inline-form .input { flex: 1 1 100%; }
  .filter-bar { gap: 10px; }
  .filter-item { flex: 1 1 auto; }
  .filter-item .select { min-width: 0; flex: 1; }
}

/* ============================================================
   部门 → 分类（两级树）
   ============================================================ */
.tax-tree { display: flex; flex-direction: column; gap: 10px; }
.tax-node {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); overflow: hidden;
}
.tax-node.sys { border-color: var(--primary-ring); }

.tax-row { border-bottom: 0; }
.tax-row.parent {
  padding: 11px 13px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tax-node.sys .tax-row.parent { background: var(--primary-soft); }
.tax-row.parent .tax-main b { font-size: 14px; }

.tax-kids {
  position: relative;
  padding: 2px 12px 6px 30px;
  background: var(--surface);
}
.tax-kids::before {
  content: ""; position: absolute; left: 17px; top: 0; bottom: 14px;
  width: 1px; background: var(--border);
}
.tax-row.kid {
  position: relative;
  padding: 7px 2px;
  border-bottom: 1px dashed var(--border);
}
.tax-row.kid::before {
  content: ""; position: absolute; left: -13px; top: 50%;
  width: 11px; height: 1px; background: var(--border);
}
.tax-row.kid .tax-main b { font-weight: 550; font-size: 13px; }
.tax-row.kid.ghost { opacity: .62; }
.tax-row.kid.ghost .tax-main span { font-size: 11px; color: var(--text-3); }
.tax-ico.sm { width: 22px; height: 22px; border-radius: 6px; }
.tax-dot {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
}
.tax-dot::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-3);
}
.tax-empty {
  font-size: 12px; color: var(--text-3);
  padding: 10px 2px 8px;
}
.tax-add { display: flex; gap: 6px; align-items: center; padding: 9px 0 3px; }
.tax-add .input { flex: 1; min-width: 0; height: 30px; font-size: 12.5px; }
.tax-add .btn { flex: none; height: 30px; }

/* 右侧层级说明 */
.tax-explain { display: flex; flex-direction: column; gap: 14px; padding: 2px 0 4px; }
.tx-step { display: flex; gap: 11px; align-items: flex-start; }
.tx-n {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-size: 11.5px; font-weight: 700;
}
.tx-step b { display: block; font-size: 13px; margin-bottom: 2px; }
.tx-step span { font-size: 12px; color: var(--text-3); line-height: 1.6; }

.tx-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.tx-stats > div { text-align: center; }
.tx-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.tx-stats span { font-size: 11px; color: var(--text-3); }

@media (max-width: 720px) {
  .tax-kids { padding-left: 22px; }
  .tax-kids::before { left: 12px; }
  .tax-row.kid::before { left: -10px; width: 8px; }
  .tx-stats { grid-template-columns: repeat(2, 1fr); gap: 12px 8px; }
}

/* 部门树与说明栏：宽屏两列，窄屏堆叠 */
.tax-layout { grid-template-columns: minmax(0, 1.45fr) minmax(0, .85fr); align-items: start; }
@media (max-width: 980px) { .tax-layout { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 560px) {
  .tax-row.parent { flex-wrap: wrap; }
  .tax-row.parent .tax-main { flex: 1 1 60%; }
  .tax-row.parent .tax-count { order: 3; }
  .tax-row.kid .tax-main b { font-size: 12.5px; }
  .tax-add .input { font-size: 12px; }
}

/* 部门树与说明栏：宽屏两列，窄屏堆叠 */
.tax-layout { grid-template-columns: minmax(0, 1.45fr) minmax(0, .85fr); align-items: start; }
@media (max-width: 980px) { .tax-layout { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 560px) {
  .tax-row.parent { flex-wrap: wrap; }
  .tax-row.parent .tax-main { flex: 1 1 60%; }
  .tax-row.parent .tax-count { order: 3; }
  .tax-row.kid .tax-main b { font-size: 12.5px; }
  .tax-add .input { font-size: 12px; }
}

/* ============================================================
   单页 SOP 表单（不再分步，一栏到底）
   ============================================================ */
.fsec { padding: 2px 0 20px; }
.fsec + .fsec { border-top: 1px solid var(--border); padding-top: 20px; }
.fsec:last-of-type { padding-bottom: 4px; }

.fsec-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 15px; }
.fsec-n {
  width: 24px; height: 24px; flex: none; margin-top: 1px;
  border-radius: 8px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.fsec-head > div { min-width: 0; }
.fsec-head > div b { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.35; }
.fsec-head > div span { display: block; font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* 折叠区标题里的次级说明 */
.adv-box > summary .muted {
  font-weight: 400; font-size: 11.8px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.adv-box > summary { flex-wrap: wrap; row-gap: 3px; }
.adv-box > summary .badge { flex: none; }

@media (max-width: 560px) {
  .fsec-head > div b { font-size: 14px; }
  .adv-box > summary .muted { display: none; }
}

/* 窄屏页头操作：清空 / 预览 并排，保存独占一行 */
@media (max-width: 420px) {
  .page-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .page-actions .btn { flex: 1 1 calc(50% - 4px); min-width: 0; padding-inline: 8px; font-size: 12.5px; }
  .page-actions .btn-primary { flex: 1 1 100%; }
}

/* 部门 / 分类下拉与「＋」按钮：窄屏时下拉可压缩，按钮不被挤出去 */
.input-group { min-width: 0; }
.input-group .select { flex: 1 1 auto; min-width: 0; }
@media (max-width: 560px) {
  .input-group { gap: 6px; }
  .input-group .btn { padding-inline: 8px; font-size: 12px; }
}
