/* ============================================================
   控件语汇
   规则：交互控件的 transition 只留 color / background / border-color / box-shadow，
   transform 与 opacity 归 GSAP（按压、悬停、入场）。
   ============================================================ */

/* ── 按钮 ───────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--control-h);
  padding: 0 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 620;
  letter-spacing: .005em;
  white-space: nowrap;
  flex: none;
  user-select: none;
  transform-origin: 50% 68%;
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:disabled { opacity: .5; }
.btn-sm { height: var(--control-h-sm); padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); gap: 5px; }
.btn-block { width: 100%; }

.btn-primary { color: #fff; background: var(--blue); box-shadow: var(--e-accent); font-weight: 660; }
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); box-shadow: var(--e-accent-hover); }

.btn-secondary { color: var(--ink); }
.btn-secondary:hover:not(:disabled) { box-shadow: var(--e2), var(--edge-strong), var(--pill-inset); color: var(--ink); }

.btn-ghost { color: var(--ink-muted); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--hover-bg); }

.btn-text { color: var(--blue); height: auto; padding: 4px 6px; border-radius: var(--r-xs); font-weight: 600; }
.btn-text:hover:not(:disabled) { background: var(--blue-soft); }
.btn-text.is-danger { color: var(--red-text); }
.btn-text.is-danger:hover:not(:disabled) { background: var(--red-soft); }

.btn-danger { color: #fff; background: var(--red); box-shadow: var(--e-danger); font-weight: 660; }
.btn-danger:hover:not(:disabled) { background: #f14c42; }

.btn .spinner { width: 14px; height: 14px; }

/* 执行中的图标呼吸：只动 opacity */
.spinner {
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 图标按钮 ───────────────────────────────────────────────── */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-xs);
  color: var(--ink-soft);
  flex: none;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.icon-btn:hover:not(:disabled) { color: var(--ink); background: var(--hover-bg); }
.icon-btn:disabled { opacity: .45; }
.icon-btn.is-bordered { border: 1px solid var(--line-strong); background: var(--input-bg); box-shadow: var(--edge); }
.icon-btn.is-danger:hover:not(:disabled) { color: var(--red-text); background: var(--red-soft); }
.icon-btn-sm { width: 28px; height: 28px; }

/* ── 表单字段 ───────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
/* 自身定宽的控件（分段选择器等）不被纵向 flex 拉伸成整行，避免槽右侧大片空白 */
.field > .segmented { align-self: flex-start; max-width: 100%; }
.field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}
.field-label .req { color: var(--red-text); font-weight: 700; }
.field-hint { font-size: 11.5px; color: var(--ink-soft); }
.field-error { font-size: 11.5px; color: var(--red-text); }

/* 输入外壳：焦点环画在外壳上，跟随圆角 */
.input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: var(--control-h);
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--input-bg);
  box-shadow: var(--edge);
  color: var(--ink-soft);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.input-shell:hover { border-color: rgba(var(--shade), .18); }
:root[data-theme="dark"] .input-shell:hover { border-color: rgba(255, 255, 255, .16); }
.input-shell:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: transparent;
}
.input-shell.is-invalid { border-color: var(--red); }
.input-shell.is-invalid:focus-within { outline-color: var(--red); }
.input-shell.is-disabled { opacity: .6; background: var(--groove-bg); }
.input-shell.is-multiline { height: auto; align-items: stretch; padding: 9px 12px; }

.input-shell input,
.input-shell textarea {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}
.input-shell textarea { resize: vertical; min-height: 64px; line-height: 1.55; }
.input-shell input::placeholder,
.input-shell textarea::placeholder { color: var(--ink-faint); }
.input-shell input[type="number"]::-webkit-inner-spin-button { opacity: .4; }
.input-shell .input-clear {
  display: inline-flex;
  color: var(--ink-faint);
  border-radius: 999px;
}
.input-shell .input-clear:hover { color: var(--ink-muted); }

/* ── 下拉选择 ───────────────────────────────────────────────── */
.select-trigger {
  width: 100%;
  cursor: pointer;
  justify-content: space-between;
  text-align: left;
  color: var(--ink);
}
.select-trigger .select-value { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.select-trigger .select-value.is-placeholder { color: var(--ink-faint); }
.select-trigger .select-caret { color: var(--ink-soft); flex: none; transition: color .2s ease; }

.select-menu {
  position: fixed;
  z-index: 120;
  min-width: 160px;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: var(--r-md);
  overflow: hidden;
}
.select-search { padding: 2px 2px 6px; }
.select-search .input-shell { height: 32px; }
.select-options { overflow-y: auto; overscroll-behavior: contain; }
.select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.select-option .opt-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.select-option.is-active { background: var(--hover-bg); }
.select-option.is-selected { color: var(--blue); font-weight: 620; }
.select-option.is-disabled { color: var(--ink-faint); cursor: not-allowed; }
.select-empty { padding: 14px 10px; font-size: 12px; color: var(--ink-soft); text-align: center; }

/* ── 勾选框 ─────────────────────────────────────────────────── */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  user-select: none;
}
.checkbox.is-disabled { cursor: not-allowed; opacity: .5; }
.checkbox-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  /* 小尺寸控件的形状例外：5px 让方框在 17px 上仍读作方框 */
  border-radius: 5px;
  border: 1.5px solid rgba(var(--shade), .28);
  background: var(--input-bg);
  color: #fff;
  flex: none;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
:root[data-theme="dark"] .checkbox-box { border-color: rgba(255, 255, 255, .22); }
.checkbox:hover .checkbox-box { border-color: var(--blue); }
.checkbox.is-on .checkbox-box,
.checkbox.is-partial .checkbox-box { background: var(--blue); border-color: var(--blue); box-shadow: 0 2px 6px rgba(35, 109, 233, .28); }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox input:focus-visible + .checkbox-box { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── 开关：轨道从灰「注满」青柠，用注册过的 --fill 补间 ───────── */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--ink-muted);
}
.switch.is-disabled { cursor: not-allowed; opacity: .5; }
.switch-track {
  --fill: 0%;
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  flex: none;
  background: linear-gradient(90deg, var(--lime) var(--fill), rgba(var(--shade), .14) var(--fill));
  box-shadow: inset 0 1px 2px rgba(var(--shade), .14);
  transition: --fill .32s var(--ease-premium);
}
:root[data-theme="dark"] .switch-track { background: linear-gradient(90deg, var(--lime) var(--fill), rgba(255, 255, 255, .14) var(--fill)); }
.switch.is-on .switch-track { --fill: 100%; }
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 20, 24, .22), 0 2px 6px rgba(16, 20, 24, .1);
  transition: translate .32s var(--ease-premium);
}
.switch.is-on .switch-knob { translate: 16px 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ── 分段选择器：一块玻璃在槽里滑 ───────────────────────────── */
.segmented {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-sm);
  flex: none;
}
.segmented:has(button:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.segmented .seg-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: var(--r-xs);
  z-index: 0;
  pointer-events: none;
  animation: fade-in .2s ease both;
}
.segmented button {
  position: relative;
  z-index: 1;
  height: 28px;
  padding: 0 13px;
  border-radius: var(--r-xs);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  outline: none;
  transition: color .2s ease;
}
.segmented button:hover { color: var(--ink); }
.segmented button.is-active { color: var(--ink); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── 标签 ───────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-muted);
  background: rgba(var(--shade), .065);
}
:root[data-theme="dark"] .tag { background: rgba(255, 255, 255, .07); }
.tag-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.tag.tone-ok { color: var(--leaf-text); background: var(--lime-soft); }
.tag.tone-ok .tag-dot { background: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.tag.tone-info { color: var(--blue); background: var(--blue-soft); }
.tag.tone-danger { color: var(--red-text); background: var(--red-soft); }
.tag.tone-neutral .tag-dot { background: var(--ink-faint); }

/* ── 头像 ───────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  flex: none;
  font-weight: 650;
  color: #fff;
  letter-spacing: -.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 2px rgba(var(--shade), .12);
}

/* ── 卡片面板 ───────────────────────────────────────────────── */
.panel { border-radius: var(--r-lg); min-width: 0; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 14px 20px;
  flex-wrap: wrap;
}
.panel-head .panel-meta { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.panel-tools { display: flex; align-items: center; gap: 6px; }
.panel-body { padding: 0 20px 20px; }

/* ── 数据表格 ───────────────────────────────────────────────── */
.table-wrap { position: relative; overflow-x: auto; overflow-y: clip; }
.table {
  width: 100%;
  min-width: 720px;
  font-size: 13px;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 40px;
  padding: 0 var(--cell-px);
  text-align: left;
  font-size: 12px;
  font-weight: 620;
  color: var(--ink-soft);
  white-space: nowrap;
  background: var(--surface-solid);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.table th.is-sortable { cursor: pointer; user-select: none; }
.table th.is-sortable:hover { color: var(--ink); }
.table .th-inner { display: inline-flex; align-items: center; gap: 4px; }
.table .sort-ico { color: var(--ink-faint); }
.table .sort-ico.is-on { color: var(--blue); }
.table td {
  height: var(--row-h);
  padding: 0 var(--cell-px);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
  white-space: nowrap; /* 中文短字段不逐字折行；长文本由单元格插槽自行省略 */
}
.table .cell-text { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: var(--hover-bg); }
.table tbody tr.is-selected { background: var(--blue-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .col-check { width: 44px; padding-right: 0; }
.table .col-actions { text-align: right; white-space: nowrap; }
/* 操作列吸附在右侧：表格横向滚动时行操作始终可见 */
.table th.col-actions, .table td.col-actions { position: sticky; right: 0; z-index: 1; background: var(--surface-solid); box-shadow: inset 1px 0 0 var(--line); }
.table th.col-actions { z-index: 2; }
.table tbody tr:hover td.col-actions { background: linear-gradient(var(--hover-bg), var(--hover-bg)), var(--surface-solid); }
.table tbody tr.is-selected td.col-actions { background: linear-gradient(var(--blue-soft), var(--blue-soft)), var(--surface-solid); }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.tree-cell { display: inline-flex; align-items: center; gap: 4px; }
.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--ink-soft);
  flex: none;
}
.tree-toggle:hover { background: var(--hover-bg); color: var(--ink); }
.tree-toggle svg { transition: rotate .24s var(--ease-premium); }
.tree-toggle.is-open svg { rotate: 90deg; }
.tree-toggle.is-leaf { visibility: hidden; }

.cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-title { font-weight: 620; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.code-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--ink-muted);
  background: rgba(var(--shade), .06);
  white-space: nowrap;
}
:root[data-theme="dark"] .code-chip { background: rgba(255, 255, 255, .06); }

/* 选中批量操作条 */
/* ── 分页 ───────────────────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.pager-info { font-size: 12px; color: var(--ink-soft); }
.pager-info b { color: var(--ink); font-weight: 650; }
.pager-ctrl { display: flex; align-items: center; gap: 4px; }
.pg-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.pg-btn:hover:not(:disabled):not(.is-active) { background: var(--hover-bg); color: var(--ink); }
.pg-btn:disabled { opacity: .35; }
.pg-btn.is-active { color: var(--ink); }
.pg-dots { width: 22px; text-align: center; color: var(--ink-faint); }

/* ── 弹窗与抽屉 ─────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--layer-overlay);
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal {
  width: 100%;
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  box-shadow: var(--edge), var(--e3);
  background: var(--surface-solid);
}
.modal-head,
.drawer-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 6px;
}
.modal-title { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.modal-sub { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.modal-body { min-height: 0; padding: 14px 22px 20px; overflow-y: auto; }
.modal-foot,
.drawer-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

.drawer-overlay { place-items: stretch end; grid-template-rows: minmax(0, 1fr); padding: 8px; }
.drawer {
  height: 100%;
  min-height: 0;
  max-width: calc(100vw - 16px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--surface-solid);
  box-shadow: var(--edge), var(--e3);
}
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 22px 22px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}
.form-grid .span-2 { grid-column: 1 / -1; }

.confirm-body { display: flex; gap: 14px; align-items: flex-start; }
.confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  flex: none;
  color: var(--blue);
  background: var(--blue-soft);
}
.confirm-icon.is-danger { color: var(--red-text); background: var(--red-soft); }
.confirm-text { font-size: 13.5px; color: var(--ink-muted); line-height: 1.6; padding-top: 2px; }
.confirm-text b { color: var(--ink); }

/* ── 信息块：只读读数，不带可点的样子 ───────────────────────── */
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-radius: var(--r-md); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.kv { padding: 12px 14px; background: var(--surface-solid); min-width: 0; }
.kv.span-2 { grid-column: 1 / -1; }
.kv-label { font-size: 11px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.kv-value { font-size: 13px; color: var(--ink); word-break: break-all; }
.code-block {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: #d9e1e4;
  background: var(--dark-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: auto;
  white-space: pre;
}

/* ── 轻提示：牌堆 ───────────────────────────────────────────── */
.toast-host {
  --toast-h: 44px;
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: var(--layer-toast);
  width: min(460px, calc(100vw - 32px));
  height: var(--toast-h);
  translate: -50% 0;
  pointer-events: none;
}
.toast-host:empty { display: none; }
.toast-slot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  pointer-events: auto;
  transform-origin: 50% 100%;
  /* 牌堆：越旧越小、越靠后 */
  transform: translateY(calc(var(--depth) * -9px)) scale(calc(1 - var(--depth) * .05));
  opacity: calc(1 - var(--depth) * .28);
  z-index: calc(10 - var(--depth));
  transition: transform .42s var(--ease-premium), opacity .3s ease;
}
.toast-host.is-expanded .toast-slot {
  transform: translateY(calc(var(--depth) * (var(--toast-h) + 8px) * -1));
  opacity: 1;
}
.toast-slot:nth-last-child(n+4) { opacity: 0; }
.toast-host.is-expanded .toast-slot:nth-last-child(n+4) { opacity: 1; }
.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: var(--toast-h);
  padding: 8px 8px 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink);
}
.toast-msg { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.toast-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--blue); }
.toast.tone-ok .toast-dot { background: var(--lime); box-shadow: 0 0 0 4px var(--lime-soft); }
.toast.tone-info .toast-dot { box-shadow: 0 0 0 4px var(--blue-soft); }
.toast.tone-danger .toast-dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.toast-close { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 999px; color: var(--ink-faint); flex: none; transition: background .2s ease, color .2s ease; }
.toast-close:hover { background: var(--hover-bg); color: var(--ink); }
.toast-ring { overflow: visible; }
.toast-ring circle { fill: none; stroke-width: 1.6; }
.toast-ring .ring-track { stroke: var(--line-strong); }
/* 倒计时细环：短时（≤ 4.2s）的一次性进度，暂停时跟随计时器停住（导 Conduct） */
.toast-ring .ring-time {
  stroke: currentColor;
  stroke-dasharray: 44;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  animation: toast-count linear forwards;
}
.toast.is-paused .ring-time { animation-play-state: paused; }
.toast-ring path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
@keyframes toast-count { to { stroke-dashoffset: 44; } }

/* ── 空态 / 骨架 ────────────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.empty-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  color: var(--ink-faint);
}
.empty-title { font-weight: 620; color: var(--ink-muted); }

.skeleton {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: rgba(var(--shade), .08);
  animation: pulse 1.4s ease-in-out infinite;
}
:root[data-theme="dark"] .skeleton { background: rgba(255, 255, 255, .07); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ── 树 ─────────────────────────────────────────────────────── */
.tree { display: flex; flex-direction: column; gap: 1px; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding-right: 8px;
  border-radius: var(--r-xs);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tree-row:hover { background: var(--hover-bg); }
.tree-row.is-selected { background: var(--blue-soft); color: var(--blue); font-weight: 620; }
.tree-row .tree-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tree-row .tree-count { font-size: 11px; color: var(--ink-faint); }

.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 8px; }
.perm-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 560;
  color: var(--ink-muted);
  border: 1px solid var(--line-strong);
  background: var(--input-bg);
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.perm-chip:hover { border-color: var(--blue); color: var(--ink); }
.perm-chip.is-on { color: var(--blue); border-color: transparent; background: var(--blue-soft); }

/* ── 窄屏 ───────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .form-grid, .kv-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-head, .drawer-head { padding: 18px 18px 4px; }
  .modal-body, .drawer-body { padding: 12px 18px 18px; }
  .modal-foot, .drawer-foot { padding: 12px 18px; }
  .overlay { padding: 12px; }
}
