:root {
  --ps-side-w: 260px;
  --ps-side-bg: #ffffff;
  --ps-side-text: #475569;
  --ps-side-muted: #94a3b8;
  --ps-side-hover: #f4f6fb;
  --ps-side-active-bg: #eef2ff;
  --ps-side-active-text: #4338ca;
  --ps-side-border: #e8ecf4;
  --ps-accent: #6366f1;
  --ps-accent-hover: #4f46e5;
  --ps-accent-soft: #eef2ff;
  --ps-secondary: #8b5cf6;
  --ps-primary: var(--ps-accent);
  --ps-border: #e5e7ef;
  --ps-bg: #fafbff;
  --ps-card: #ffffff;
  --ps-text: #111827;
  --ps-muted: #6b7280;
  --ps-label: #374151;
  --ps-placeholder: #c5cad3;
  --ps-radius: 10px;
  --ps-radius-sm: 6px;
  --ps-radius-xs: 4px;
  --ps-shadow: 0 4px 24px rgba(17, 24, 39, 0.06);
  --ps-shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --ps-focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.22);
  --ps-control-h: 36px;
  --ps-control-h-sm: 32px;
  --ps-body-bg-image: none;
  --ps-btn-bg: #ffffff;
  --ps-btn-border: var(--ps-border);
  --ps-btn-color: #000000;
  --ps-btn-hover-bg: #f9fafb;
  --ps-btn-font-size: 14px;
  --ps-btn-min-width: auto;
  --ps-btn-toolbar-min-width: auto;
  --ps-btn-row-min-width: auto;
  --ps-btn-row-height: var(--ps-control-h-sm);
  --ps-btn-row-font-size: 13px;
  --ps-btn-save-bg: #16a34a;
  --ps-btn-save-color: #ffffff;
  --ps-btn-save-hover-bg: #15803d;
  --ps-btn-edit-bg: var(--ps-accent);
  --ps-btn-edit-color: #ffffff;
  --ps-btn-edit-hover-bg: var(--ps-accent-hover);
  --ps-btn-danger-bg: #dc2626;
  --ps-btn-danger-color: #ffffff;
  --ps-btn-danger-hover-bg: #b91c1c;
  --ps-btn-primary-bg: #16a34a;
  --ps-btn-primary-color: #ffffff;
  --ps-btn-primary-hover-bg: #15803d;
  --ps-font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --ps-nav-group-size: 14px;
  --ps-nav-group-color: var(--ps-text);
  --ps-nav-group-weight: 700;
  --ps-nav-item-size: 13px;
  --ps-nav-item-color: var(--ps-side-text);
  --ps-nav-item-active-color: var(--ps-side-active-text);
  --ps-table-header-size: 12px;
  --ps-table-header-color: #4b5563;
  --ps-table-cell-size: 14px;
  --ps-table-cell-color: var(--ps-text);
  --ps-table-header-bg: #f6f7fb;
  --ps-list-row-h: 44px;
  --ps-page-title-size: 20px;
  --ps-page-title-color: var(--ps-text);
  --ps-page-desc-size: 13px;
  --ps-page-desc-color: var(--ps-muted);
  --ps-hint-size: 12px;
  --ps-hint-color: var(--ps-muted);
  --ps-brand-title-size: 16px;
  --ps-brand-title-color: var(--ps-text);
  --ps-brand-subtitle-size: 12px;
  --ps-brand-subtitle-color: var(--ps-muted);
}

html, body.ps-body { height: 100%; margin: 0; }
.ps-body {
  background: var(--ps-bg);
  background-image: var(--ps-body-bg-image);
  color: var(--ps-text);
  font-family: var(--ps-font-family);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}
.ps-body.miniapp-h5,
.ps-body.mp-table-page,
.ps-body.mp-agent-page {
  font-family: "Microsoft YaHei", "微软雅黑", "SimHei", "黑体", sans-serif;
}

.ps-app { display: flex; height: 100vh; min-height: 100vh; overflow: hidden; }

.ps-sidenav {
  width: var(--ps-side-w);
  flex-shrink: 0;
  background: var(--ps-side-bg);
  color: var(--ps-side-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ps-side-border);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.8);
}
.ps-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--ps-side-border);
  flex-shrink: 0;
}
.ps-brand img {
  width: auto; height: 36px; max-width: 100%;
  border-radius: 0;
  box-shadow: none;
}
.ps-brand strong,
.ps-brand-portal,
.ps-brand > span { display: none !important; }
.ps-nav {
  flex: 1; min-height: 0;
  padding: 12px 12px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.ps-nav-group { margin-bottom: 6px; }
.ps-nav-group:last-child { margin-bottom: 8px; }
.ps-nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0 0 2px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--ps-radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ps-text);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}
.ps-nav-group-title:hover {
  background: var(--ps-side-hover);
  color: var(--ps-text);
}
.ps-nav-group-title::after {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: -2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.55;
  transition: transform 0.15s ease;
}
.ps-nav-group.is-open .ps-nav-group-title {
  color: var(--ps-side-active-text);
}
.ps-nav-group.is-open .ps-nav-group-title::after {
  transform: rotate(45deg);
  margin-top: 2px;
}
.ps-nav-group-items {
  display: none;
  padding: 2px 0 6px 4px;
}
.ps-nav-group.is-open .ps-nav-group-items {
  display: block;
}
.ps-nav a {
  display: block;
  margin: 0 0 4px;
  padding: 8px 12px 8px 16px;
  border-radius: var(--ps-radius-sm);
  color: var(--ps-side-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  border-left: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.ps-nav a:hover {
  background: var(--ps-side-hover);
  color: var(--ps-text);
}
.ps-nav a.active {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  color: var(--ps-side-active-text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.18);
}
.ps-nav.is-loading { opacity: 0.55; pointer-events: none; }
.ps-nav a[aria-disabled="true"] { pointer-events: none; cursor: wait; }
.ps-side-foot {
  flex-shrink: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--ps-side-border);
  background: linear-gradient(180deg, #fcfcff 0%, #f8f9ff 100%);
  font-size: 12px;
  color: var(--ps-muted);
  line-height: 1.45;
}
.ps-side-foot #ps-user-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-side-foot button {
  width: 100%; margin-top: 10px; padding: 8px 12px; border-radius: var(--ps-radius-sm);
  border: 1px solid var(--ps-border); background: #fff; color: var(--ps-text);
  font-size: 13px; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ps-side-foot button:hover { background: var(--ps-side-hover); border-color: #cbd5e1; }

.ps-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.ps-topbar {
  flex-shrink: 0; padding: 16px 24px; background: var(--ps-card);
  border-bottom: 1px solid var(--ps-border);
  box-shadow: var(--ps-shadow-sm);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ps-topbar.ps-topbar-tabs {
  padding: 0 20px 0 24px;
  align-items: flex-end;
  gap: 16px;
  background: var(--ps-card);
  border-bottom: 1px solid var(--ps-border);
  min-height: 48px;
  box-shadow: var(--ps-shadow-sm);
}
.ps-topbar h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.ps-topbar-tabs .ps-user-chip,
.ps-topbar-tabs .ps-user {
  font-size: 13px; color: var(--ps-muted); flex-shrink: 0;
  align-self: center; padding: 10px 0;
}
.ps-user { font-size: 13px; color: var(--ps-muted); flex-shrink: 0; align-self: center; }
.ps-user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 13px; font-weight: 500; color: var(--ps-muted);
  max-width: min(280px, 42vw);
}
.ps-user-chip span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-user-avatar {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--ps-accent);
  box-shadow: none;
}

.ps-work-tabs-bar {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 10px;
  padding-top: 6px;
}
.ps-work-tabs {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px;
  overflow-x: auto; overflow-y: hidden; padding: 0;
  scrollbar-width: thin;
}
.ps-work-tab {
  flex-shrink: 0; display: inline-flex; align-items: stretch; max-width: 220px;
  border: 1px solid transparent; border-bottom: none;
  border-radius: var(--ps-radius-sm) var(--ps-radius-sm) 0 0; background: #f3f4fb;
  overflow: hidden; margin-bottom: -1px; position: relative;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.ps-work-tab:hover:not(.is-active) { background: #eceef8; }
.ps-work-tab.is-active {
  background: var(--ps-bg);
  border-color: var(--ps-border);
  border-bottom-color: var(--ps-bg);
  z-index: 1;
  box-shadow: 0 -1px 0 var(--ps-border);
}
.ps-work-tab-label {
  border: none; background: transparent; padding: 8px 4px 8px 14px;
  font-size: 13px; color: var(--ps-muted); cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 168px;
  font-family: inherit; line-height: 1.35;
}
.ps-work-tab:hover:not(.is-active) .ps-work-tab-label { color: var(--ps-text); }
.ps-work-tab.is-active .ps-work-tab-label { color: var(--ps-text); font-weight: 600; }
.ps-work-tab-close {
  border: none; background: transparent; padding: 0 10px 0 2px;
  font-size: 15px; line-height: 1; color: var(--ps-muted); cursor: pointer;
  align-self: center; font-family: inherit;
}
.ps-work-tab-close:hover { color: #b91c1c; }

.ps-tab-panels {
  flex: 1; min-height: 0; position: relative; background: var(--ps-bg);
}
.ps-tab-panel {
  position: absolute; inset: 0; display: none;
}
.ps-tab-panel.is-active { display: block; }
.ps-tab-frame {
  width: 100%; height: 100%; border: none; display: block; background: var(--ps-bg);
}
.ps-tab-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--ps-muted); font-size: 14px;
}
.ps-work-tab-menu-backdrop {
  position: fixed; inset: 0; z-index: 1199; background: transparent;
}
.ps-work-tab-menu {
  position: fixed; z-index: 1200; margin: 0;
  min-width: 168px; background: #fff; border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm); box-shadow: var(--ps-shadow); padding: 6px;
}
.ps-work-tab-menu-item {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  padding: 8px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--ps-text);
  font-family: inherit;
}
.ps-work-tab-menu-item:hover:not(:disabled) { background: #f1f5f9; }
.ps-work-tab-menu-item.is-disabled,
.ps-work-tab-menu-item:disabled {
  color: var(--ps-muted); cursor: default; opacity: 0.55;
}

.ps-body.ps-embed-page { height: 100%; overflow: hidden; }
.ps-embed-root {
  height: 100%; min-height: 0; padding: 20px 24px 24px; box-sizing: border-box;
  display: flex; flex-direction: column; overflow: hidden;
}
.ps-embed-head {
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-bottom: 14px;
  padding: 14px 18px;
  background: var(--ps-card);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow-sm);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px;
  overflow: visible;
}
.ps-embed-head .ps-field-hint { margin: 0; line-height: 1.55; }
.ps-embed-head a { color: var(--ps-accent); }
.ps-embed-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ps-embed-page-layout {
  height: 100%;
  min-height: 0;
}
.ps-embed-body .ps-list-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ps-embed-page-layout > .ps-panel.ps-list-page {
  flex: 1 1 auto;
  min-height: 0;
}
.ps-embed-body > .ps-panel.ps-list-page {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.ps-embed-page-layout > .ps-smart-table-manage {
  flex: 1 1 auto;
  min-height: 0;
}
.ps-page-subtitle { margin: 0 0 6px; font-size: 18px; font-weight: 600; flex-shrink: 0; }
.ps-page-desc { margin: 0 0 12px; font-size: 13px; color: var(--ps-muted); flex-shrink: 0; }

.ps-content { flex: 1; min-height: 0; padding: 20px 24px 24px; display: flex; flex-direction: column; }

.ps-panel {
  flex: 1; min-height: 0; background: var(--ps-card); border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius); box-shadow: var(--ps-shadow-sm);
  display: flex; flex-direction: column; overflow: hidden;
}
.ps-panel[hidden] { display: none !important; }

.ps-toolbar {
  flex-shrink: 0; padding: 14px 16px; border-bottom: 1px solid var(--ps-border);
  display: flex; flex-wrap: wrap; align-items: center;
  column-gap: 10px; row-gap: 10px;
}
.ps-list-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 16px;
  row-gap: 10px;
}
.ps-list-toolbar .ps-toolbar-left {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}
.ps-list-toolbar .ps-toolbar-left.ps-toolbar-left-compact {
  flex: 1 1 auto;
}
.ps-list-toolbar .ps-toolbar-right {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: 0;
  max-width: 100%;
}
.ps-list-toolbar-primary,
.ps-list-view-tools {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ps-list-view-tools .ps-block-span-control {
  width: 120px;
  flex: 0 0 120px;
  max-width: 120px;
  min-width: 0;
}
.ps-list-view-tools .ps-block-span-control .ps-select {
  width: 100%;
  max-width: 120px;
}
@media (max-width: 640px) {
  .ps-list-toolbar {
    flex-wrap: wrap;
  }
  .ps-list-toolbar .ps-toolbar-left {
    flex-wrap: wrap;
    width: 100%;
  }
  .ps-list-toolbar .ps-toolbar-right {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }
  .ps-list-toolbar-primary,
  .ps-list-view-tools {
    flex-wrap: wrap;
  }
  .ps-list-query-group {
    flex-wrap: wrap;
  }
}
.ps-toolbar-left {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  flex: 1 1 200px; min-width: 0;
}
.ps-toolbar-left.ps-toolbar-left-compact {
  flex: 0 1 auto;
}
.ps-list-query-group {
  display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 10px;
  flex: 0 1 auto; min-width: 0; max-width: 100%;
}
.ps-list-query-group .ps-list-filter {
  width: 148px;
  flex: 0 0 auto;
  min-width: 0;
}
.ps-list-query-group .ps-list-filter .ps-select {
  min-width: 0;
}
.ps-list-query-group .ps-list-search-input {
  width: 148px;
  min-width: 96px;
  max-width: 200px;
  flex: 0 0 auto;
}
.ps-list-query-filter {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  flex: 0 0 auto;
  width: auto;
}
.ps-list-filter-label {
  font-size: 12px; color: var(--ps-muted); white-space: nowrap;
}
.ps-list-query-range {
  width: 132px; flex: 0 1 auto; min-width: 0;
}
.ps-list-query-sep {
  font-size: 12px; color: var(--ps-muted); padding: 0 2px;
}
.ps-list-query-group .ps-list-query-check-wrap {
  width: auto;
  flex: 0 0 auto;
}
.ps-list-query-group .ps-list-query-check {
  margin: 0;
  gap: 6px;
  font-size: 13px;
  color: var(--ps-text);
  white-space: nowrap;
}
.ps-list-query-group .ps-list-query-check span {
  cursor: pointer;
}
.ps-toolbar-right {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 10px; margin-left: auto; flex: 0 1 auto;
}
.ps-toolbar .ps-grow { flex: 1; min-width: 120px; }
/* 列表顶栏 / 页头：输入、按钮、下拉、视图切换同高 */
.ps-toolbar .ps-input:not(textarea),
.ps-embed-head .ps-input:not(textarea),
.ps-kb-docs-search-row .ps-input:not(textarea),
.ps-toolbar .ps-select-trigger,
.ps-embed-head .ps-select-trigger,
.ps-kb-docs-search-row .ps-select-trigger {
  height: var(--ps-control-h);
  min-height: var(--ps-control-h);
}
.ps-toolbar .ps-btn,
.ps-embed-head .ps-btn,
.ps-kb-docs-search-row .ps-btn,
.ps-config-inline-row .ps-btn {
  height: var(--ps-control-h);
  min-height: var(--ps-control-h);
  min-width: var(--ps-btn-toolbar-min-width);
  padding-top: 0;
  padding-bottom: 0;
}
.ps-input {
  padding: 0 12px; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  font-size: 14px; min-width: 0; width: 100%; box-sizing: border-box;
  background: #fff; color: var(--ps-text);
  line-height: calc(var(--ps-control-h) - 2px);
  height: var(--ps-control-h); min-height: var(--ps-control-h);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ps-input::placeholder {
  color: var(--ps-placeholder);
  opacity: 1;
}
.ps-input::-webkit-input-placeholder { color: var(--ps-placeholder); }
.ps-input::-moz-placeholder { color: var(--ps-placeholder); opacity: 1; }
.ps-input:focus {
  outline: none;
  border-color: var(--ps-accent);
  box-shadow: var(--ps-focus-ring);
}
textarea.ps-input {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}
.ps-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ps-control-h); min-height: var(--ps-control-h);
  min-width: var(--ps-btn-min-width);
  padding: 0 14px; border-radius: var(--ps-radius-sm); border: 1px solid var(--ps-btn-border);
  font-size: var(--ps-btn-font-size); font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap; box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  box-shadow: var(--ps-shadow-sm);
}
.ps-btn:not(.ps-btn-save):not(.ps-btn-edit):not(.ps-btn-danger):not(.ps-btn-primary):not(.ps-btn-ghost) {
  background: var(--ps-btn-bg);
  color: var(--ps-btn-color);
}
.ps-btn:not(.ps-btn-save):not(.ps-btn-edit):not(.ps-btn-danger):not(.ps-btn-primary):not(.ps-btn-ghost):hover {
  background: var(--ps-btn-hover-bg); border-color: #d1d5db;
}
.ps-btn:active { transform: translateY(1px); }
/* 默认白底黑字；彩色语义按钮白字（复合选择器避免表格 color 继承覆盖） */
.ps-btn.ps-btn-save,
.ps-toolbar .ps-btn.ps-btn-save,
.ps-table .ps-btn.ps-btn-save,
.ps-action-btns .ps-btn.ps-btn-save {
  background: var(--ps-btn-save-bg); border-color: var(--ps-btn-save-bg); color: var(--ps-btn-save-color, #ffffff);
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}
.ps-btn.ps-btn-save:hover,
.ps-toolbar .ps-btn.ps-btn-save:hover,
.ps-table .ps-btn.ps-btn-save:hover {
  background: var(--ps-btn-save-hover-bg); border-color: var(--ps-btn-save-hover-bg); color: var(--ps-btn-save-color, #ffffff);
}
.ps-btn.ps-btn-edit,
.ps-toolbar .ps-btn.ps-btn-edit,
.ps-table .ps-btn.ps-btn-edit,
.ps-action-btns .ps-btn.ps-btn-edit {
  background: var(--ps-btn-edit-bg); border-color: var(--ps-btn-edit-bg); color: var(--ps-btn-edit-color, #ffffff);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.ps-btn.ps-btn-edit:hover,
.ps-toolbar .ps-btn.ps-btn-edit:hover,
.ps-table .ps-btn.ps-btn-edit:hover {
  background: var(--ps-btn-edit-hover-bg); border-color: var(--ps-btn-edit-hover-bg); color: var(--ps-btn-edit-color, #ffffff);
}
.ps-btn.ps-btn-danger,
.ps-toolbar .ps-btn.ps-btn-danger,
.ps-table .ps-btn.ps-btn-danger,
.ps-action-btns .ps-btn.ps-btn-danger {
  background: var(--ps-btn-danger-bg); border-color: var(--ps-btn-danger-bg); color: var(--ps-btn-danger-color, #ffffff);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.28);
}
.ps-btn.ps-btn-danger:hover,
.ps-toolbar .ps-btn.ps-btn-danger:hover,
.ps-table .ps-btn.ps-btn-danger:hover {
  background: var(--ps-btn-danger-hover-bg); border-color: var(--ps-btn-danger-hover-bg); color: var(--ps-btn-danger-color, #ffffff);
}
.ps-btn.ps-btn-primary,
.ps-toolbar .ps-btn.ps-btn-primary,
.ps-table .ps-btn.ps-btn-primary {
  background: var(--ps-btn-primary-bg); border-color: var(--ps-btn-primary-bg); color: var(--ps-btn-primary-color, #ffffff);
}
.ps-btn.ps-btn-primary:hover,
.ps-toolbar .ps-btn.ps-btn-primary:hover,
.ps-table .ps-btn.ps-btn-primary:hover {
  background: var(--ps-btn-primary-hover-bg); border-color: var(--ps-btn-primary-hover-bg); color: var(--ps-btn-primary-color, #ffffff);
}
.ps-btn-ghost { border-color: transparent; background: transparent; color: var(--ps-muted); box-shadow: none; }
.ps-btn-ghost:hover { background: var(--ps-side-hover); color: var(--ps-text); }
.ps-btn-sm {
  height: var(--ps-btn-row-height); min-height: var(--ps-btn-row-height);
  min-width: var(--ps-btn-row-min-width);
  padding: 0 10px; font-size: var(--ps-btn-row-font-size);
}

.ps-action-btns {
  display: flex; flex-wrap: wrap; align-items: center;
  column-gap: 8px; row-gap: 8px;
}
.ps-action-btns.ps-action-btns-block {
  flex-wrap: wrap;
  overflow: visible;
  max-width: 100%;
  row-gap: 8px;
  column-gap: 8px;
  align-items: center;
  align-content: flex-start;
}
.ps-action-btns.ps-action-btns-row {
  flex-wrap: nowrap; overflow: hidden; max-width: 100%;
  align-items: center; row-gap: 0;
}
.ps-action-more-trigger {
  flex-shrink: 0; min-width: 32px; padding: 0 8px;
}
.ps-action-more-panel {
  display: none; flex-direction: column; align-items: stretch; gap: 6px;
  padding: 8px; background: #fff; border: 1px solid var(--ps-border);
  border-radius: 8px; box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
  z-index: 12050; pointer-events: auto;
  min-width: 120px;
}
.ps-action-more-panel.is-open {
  display: flex; position: fixed;
}
.ps-list-table tbody tr.ps-row-action-menu-open td.ps-col-actions {
  position: relative;
  z-index: 30;
  overflow: visible;
}
.ps-block-card-actions {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--ps-border);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.ps-block-card .ps-action-btns {
  margin-top: 0;
  padding-top: 0;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  height: auto;
  max-height: none;
  overflow: visible;
}
.ps-block-card .ps-block-card-actions .ps-action-btns.ps-action-btns-block {
  width: 100%;
}

/* PsListPage：列表区滚动，分页固定贴底（凡 .ps-panel.ps-list-page 一致） */
.ps-panel.ps-list-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.ps-embed-root > .ps-panel.ps-list-page {
  flex: 1 1 auto;
  min-height: 0;
}

.ps-list-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ps-list-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; }
.ps-list-empty {
  flex: 1; min-height: 200px; display: flex; align-items: center; justify-content: center;
  color: var(--ps-muted); font-size: 14px;
}
.ps-list-empty.ps-list-empty-actions {
  flex-direction: column; gap: 12px;
}
.ps-list-empty-msg { margin: 0; }
.ps-list-scroll[hidden],
.ps-block-grid[hidden],
.ps-list-empty[hidden] {
  display: none !important;
}

.ps-view-toggle {
  display: inline-flex; flex-shrink: 0; align-items: stretch;
  height: var(--ps-control-h);
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm); overflow: hidden;
}
.ps-view-toggle .ps-btn {
  border: none; border-radius: 0; margin: 0; box-shadow: none;
  height: 100%; min-height: 0; padding: 0 14px; font-size: 14px; min-width: 56px;
  box-sizing: border-box;
}
.ps-view-toggle .ps-btn + .ps-btn { border-left: 1px solid var(--ps-border); }
.ps-view-toggle .ps-btn.is-active {
  background: var(--ps-accent); color: #fff;
}
.ps-view-toggle .ps-btn.is-active:hover { filter: brightness(0.95); }

.ps-customer-related-list {
  display: flex; flex-direction: column; min-height: 0; height: 100%; width: 100%;
}
.ps-customer-related-list-mount {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.ps-customer-related-list-mount .ps-list-page {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}

/* 客户 360 详情弹窗 */
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub,
.ps-dialog-viewport-80 .ps-dialog-body > .ps-product-hub,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-product-hub {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
/* 详情选项卡弹窗：页签区与弹窗边距及页签内容区内边距相对默认减半 */
.ps-dialog-viewport-80 .ps-dialog-body:has(> .ps-customer-hub),
.ps-dialog-viewport-90 .ps-dialog-body:has(> .ps-customer-hub),
.ps-dialog-viewport-80 .ps-dialog-body:has(> .ps-ext-config-wrap),
.ps-dialog-viewport-90 .ps-dialog-body:has(> .ps-ext-config-wrap) {
  padding: 8px 12px;
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-customer-hub-tabs-wrap,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-customer-hub-tabs-wrap {
  padding-left: 4px;
  padding-right: 4px;
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-customer-hub-tabs-wrap .ps-tabs,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-customer-hub-tabs-wrap .ps-tabs {
  padding-top: 2px;
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-customer-hub-tabs-wrap .ps-tab,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-customer-hub-tabs-wrap .ps-tab {
  padding: 5px 7px 6px;
}
.ps-dialog-viewport-80 .ps-customer-hub.ps-embed-root,
.ps-dialog-viewport-90 .ps-customer-hub.ps-embed-root {
  --ps-hub-tab-pad-top: 8px;
  --ps-hub-tab-pad-x: 10px;
  --ps-hub-tab-pad-bottom: 12px;
  --ps-hub-tab-gap-below-tabs: 6px;
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-tab-panel--scroll,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-tab-panel--scroll,
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-tab-panel--plain,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-tab-panel--plain,
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-tab-panel:not(.ps-hub-tab-panel--form):not(.ps-hub-tab-panel--list),
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-tab-panel:not(.ps-hub-tab-panel--form):not(.ps-hub-tab-panel--list) {
  padding: var(--ps-hub-tab-pad-top) var(--ps-hub-tab-pad-x) var(--ps-hub-tab-pad-bottom);
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-form-scroll,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-form-scroll {
  padding: 8px 10px;
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-form-foot,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-form-foot {
  padding: 5px 10px 8px;
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-list-shell,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-list-shell {
  padding: var(--ps-hub-tab-pad-top) var(--ps-hub-tab-pad-x) var(--ps-hub-tab-pad-bottom);
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-field-hint.ps-hub-list-hint,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-field-hint.ps-hub-list-hint {
  padding-left: 2px;
  padding-right: 2px;
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-table-empty,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-table-empty,
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-list-mount .ps-list-body .ps-list-empty,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-list-mount .ps-list-body .ps-list-empty,
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-list-mount .ps-hub-simple-table-wrap > .ps-muted,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-list-mount .ps-hub-simple-table-wrap > .ps-muted,
.ps-dialog-viewport-80 .ps-dialog-body > .ps-customer-hub .ps-hub-list-mount .ps-hub-simple-table-wrap > p,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-customer-hub .ps-hub-list-mount .ps-hub-simple-table-wrap > p {
  padding: 8px 9px;
}
.ps-dialog-viewport-80 .ps-dialog-body > .ps-ext-config-wrap,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-ext-config-wrap {
  gap: 6px;
}
.ps-customer-hub.ps-embed-root {
  gap: 0;
  background: var(--ps-card);
  --ps-hub-tab-pad-top: 16px;
  --ps-hub-tab-pad-x: 20px;
  --ps-hub-tab-pad-bottom: 24px;
  --ps-hub-tab-gap-below-tabs: 8px;
}
.ps-hub-timeline-inner {
  max-width: 960px;
}
.ps-hub-timeline-list {
  list-style: none;
  margin: 0;
  padding: 4px 0 0;
}
.ps-hub-timeline-item {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin: 0;
  padding: 0;
}
.ps-hub-timeline-item + .ps-hub-timeline-item {
  margin-top: 2px;
}
.ps-hub-timeline-axis {
  position: relative;
  flex: 0 0 16px;
  display: flex;
  justify-content: center;
  padding-top: 11px;
}
.ps-hub-timeline-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ps-accent);
  box-shadow: 0 0 0 3px var(--ps-accent-soft, rgba(99, 102, 241, 0.14));
  flex-shrink: 0;
  z-index: 1;
}
.ps-hub-timeline-item:not(:last-child) .ps-hub-timeline-axis::after {
  content: '';
  position: absolute;
  top: 22px;
  bottom: -6px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--ps-accent) 0%, rgba(99, 102, 241, 0.25) 72%, var(--ps-border) 100%);
  border-radius: 1px;
  opacity: 0.85;
}
.ps-hub-timeline-event {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 6px 0 14px;
}
.ps-hub-timeline-time {
  flex: 0 0 140px;
  font-size: 13px;
  color: var(--ps-muted);
  font-variant-numeric: tabular-nums;
}
.ps-hub-timeline-kind {
  flex: 0 0 88px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ps-text);
}
.ps-hub-timeline-summary {
  flex: 1 1 200px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ps-text);
  min-width: 0;
}
.ps-customer-hub-tabs-wrap {
  flex-shrink: 0;
  background: var(--ps-card);
  padding: 0 8px;
  box-sizing: border-box;
}
.ps-customer-hub-tabs-wrap .ps-tabs {
  flex-wrap: wrap;
  align-items: flex-end;
  width: 100%;
  gap: 2px 4px;
  padding: 4px 0 0;
  border-bottom: 1px solid var(--ps-border);
}
.ps-customer-hub-tabs-wrap .ps-tab {
  flex: 0 0 auto;
  white-space: normal;
  max-width: 100%;
  text-align: center;
}
.ps-hub-tab-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  vertical-align: middle;
}
.ps-hub-tab-icon {
  display: block;
  flex-shrink: 0;
  opacity: 0.72;
}
.ps-tab.active .ps-hub-tab-icon {
  opacity: 1;
}
.ps-hub-tab-text {
  line-height: 1.35;
}
.ps-customer-hub .ps-tabs {
  background: var(--ps-card);
}
.ps-customer-hub .ps-hub-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ps-card);
  padding-top: var(--ps-hub-tab-gap-below-tabs, 8px);
  box-sizing: border-box;
}
.ps-customer-hub .ps-hub-tab-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.ps-customer-hub .ps-hub-tab-panel[hidden] {
  display: none !important;
}
.ps-customer-hub .ps-hub-tab-panel--scroll,
.ps-customer-hub .ps-hub-tab-panel--plain,
.ps-customer-hub .ps-hub-tab-panel:not(.ps-hub-tab-panel--form):not(.ps-hub-tab-panel--list) {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: var(--ps-hub-tab-pad-top) var(--ps-hub-tab-pad-x) var(--ps-hub-tab-pad-bottom);
  box-sizing: border-box;
}
.ps-customer-hub .ps-hub-tab-panel--form {
  overflow: hidden;
  padding: 0;
}
.ps-customer-hub .ps-hub-form-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.ps-customer-hub .ps-hub-form-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--ps-hub-tab-pad-top) var(--ps-hub-tab-pad-x);
  box-sizing: border-box;
}
.ps-customer-hub .ps-hub-basic-form {
  max-width: 760px;
}
.ps-customer-hub .ps-hub-form-foot {
  flex-shrink: 0;
  padding: 10px var(--ps-hub-tab-pad-x) var(--ps-hub-tab-pad-top);
  border-top: 1px solid var(--ps-border);
  background: var(--ps-card);
  box-sizing: border-box;
}
.ps-customer-hub .ps-hub-form-foot .ps-config-actions,
.ps-customer-hub .ps-hub-basic-toolbar .ps-config-actions,
.ps-customer-hub .ps-hub-collab-root > .ps-config-actions {
  margin-top: 0;
  justify-content: flex-end;
  width: 100%;
}
.ps-customer-hub .ps-hub-basic-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 var(--ps-hub-tab-pad-x) 10px;
  box-sizing: border-box;
}
.ps-customer-hub .ps-hub-basic-view .ps-detail-view {
  max-width: 760px;
}
.ps-customer-hub .ps-hub-form-shell .ps-hub-basic-form[hidden],
.ps-customer-hub .ps-hub-form-shell .ps-hub-basic-view[hidden],
.ps-customer-hub .ps-hub-form-shell .ps-hub-form-foot[hidden] {
  display: none !important;
}
.ps-customer-hub .ps-hub-form-foot-err {
  margin: 0 0 8px;
  color: #b91c1c;
  font-size: 13px;
  min-height: 0;
}
.ps-customer-hub .ps-hub-form-foot-err:empty {
  display: none;
}
.ps-customer-hub .ps-hub-tab-panel--list {
  padding: 0;
}
.ps-customer-hub .ps-hub-list-shell {
  height: 100%;
  padding: var(--ps-hub-tab-pad-top) var(--ps-hub-tab-pad-x) var(--ps-hub-tab-pad-bottom);
  box-sizing: border-box;
}
.ps-customer-hub .ps-field-hint.ps-hub-list-hint {
  margin: 0 0 8px;
  padding: 0 4px;
}
.ps-hub-table-empty {
  margin: 0;
  padding: 16px 18px;
}
.ps-customer-hub .ps-hub-tab-panel--scroll > .ps-hub-table-empty,
.ps-customer-hub .ps-hub-tab-panel--scroll > .ps-field-hint.ps-hub-table-empty,
.ps-customer-hub .ps-hub-tab-panel--plain > .ps-hub-table-empty,
.ps-customer-hub .ps-hub-tab-panel:not(.ps-hub-tab-panel--form):not(.ps-hub-tab-panel--list) > .ps-hub-table-empty,
.ps-customer-hub .ps-hub-tab-panel:not(.ps-hub-tab-panel--form):not(.ps-hub-tab-panel--list) > .ps-field-hint.ps-hub-table-empty {
  padding: 0;
}
.ps-customer-hub .ps-hub-tab-panel--scroll .ps-hub-list-hint,
.ps-customer-hub .ps-hub-tab-panel--plain .ps-hub-list-hint,
.ps-customer-hub .ps-hub-tab-panel:not(.ps-hub-tab-panel--form):not(.ps-hub-tab-panel--list) .ps-hub-list-hint {
  margin: 0 0 12px;
  padding: 0;
}
.ps-customer-hub .ps-hub-tab-panel--scroll .ps-hub-simple-table-wrap,
.ps-customer-hub .ps-hub-tab-panel--plain .ps-hub-simple-table-wrap,
.ps-customer-hub .ps-hub-tab-panel:not(.ps-hub-tab-panel--form):not(.ps-hub-tab-panel--list) .ps-hub-simple-table-wrap {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  overflow-x: auto;
  background: var(--ps-card);
}
.ps-customer-hub .ps-hub-tab-panel--scroll > table.ps-table.ps-hub-linked-table,
.ps-customer-hub .ps-hub-tab-panel:not(.ps-hub-tab-panel--form):not(.ps-hub-tab-panel--list) > table.ps-table.ps-hub-linked-table {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
}
.ps-hub-list-mount .ps-list-body .ps-list-empty,
.ps-hub-list-mount .ps-hub-simple-table-wrap > .ps-muted,
.ps-hub-list-mount .ps-hub-simple-table-wrap > p {
  padding: 16px 18px;
  box-sizing: border-box;
  margin: 0;
}
.ps-hub-table-error {
  color: #b91c1c;
}
.ps-customer-hub .ps-hub-list-mount .ps-hub-simple-table-wrap {
  background: var(--ps-card);
}
.ps-hub-collab-root {
  max-width: 760px;
  padding: 4px 0;
}
.ps-hub-collab-hint {
  margin: 0 0 12px;
}
.ps-hub-collab-selected {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: #fafbfc;
}
.ps-hub-collab-selected-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 8px;
}
.ps-hub-collab-selected-head .ps-muted {
  font-size: 13px;
}
.ps-hub-list-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ps-hub-list-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.ps-customer-hub .ps-hub-tab-panel--scroll .ps-hub-list-toolbar,
.ps-customer-hub .ps-hub-tab-panel:not(.ps-hub-tab-panel--form):not(.ps-hub-tab-panel--list) .ps-hub-list-toolbar {
  margin-bottom: 12px;
}
.ps-hub-list-mount {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ps-hub-list-mount .ps-list-page,
.ps-hub-list-mount.ps-customer-related-list-mount .ps-list-page {
  flex: 1;
  min-height: 0;
}
.ps-hub-list-mount .ps-list-page.ps-list-page--toolbar-external {
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
}
.ps-hub-list-mount .ps-list-page.ps-list-page--toolbar-external .ps-list-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: var(--ps-card);
}
.ps-hub-list-mount .ps-list-page.ps-list-page--toolbar-external .ps-list-toolbar[hidden] {
  display: none !important;
}
.ps-hub-simple-table-wrap {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  overflow-x: auto;
  background: var(--ps-card);
  box-sizing: border-box;
}
.ps-hub-list-mount .ps-hub-simple-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
/* 内嵌 PsListPage 时禁止外包层滚动，分页须贴面板底 */
.ps-hub-simple-table-wrap--list-host,
.ps-hub-list-mount .ps-hub-simple-table-wrap--list-host {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.ps-hub-simple-table-wrap--list-host > .ps-list-page,
.ps-hub-list-mount .ps-hub-simple-table-wrap--list-host > .ps-list-page {
  flex: 1;
  min-height: 0;
  height: 100%;
}
.ps-hub-registry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px 20px;
  max-width: 1080px;
}
.ps-hub-registry-item label {
  display: block;
  font-size: 12px;
  color: var(--ps-muted);
  margin-bottom: 4px;
}
.ps-hub-registry-item span {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.ps-hub-registry-item--wide {
  grid-column: 1 / -1;
}

.ps-kb-docs-dialog {
  display: flex; flex-direction: column; min-height: 0; height: 100%; width: 100%;
}
.ps-kb-docs-search { flex-shrink: 0; margin-bottom: 12px; }
.ps-kb-docs-search-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.ps-kb-docs-search-row .ps-input { flex: 1; min-width: 200px; }
.ps-kb-docs-search-result {
  margin-top: 8px; max-height: min(28vh, 220px); overflow: auto;
}
.ps-kb-docs-list-mount {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.ps-kb-docs-list-mount .ps-list-page {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}

.ps-scheduled-task-runs {
  display: flex; flex-direction: column; min-height: 0; height: 100%; width: 100%;
}
.ps-scheduled-task-runs-mount {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.ps-scheduled-task-runs-mount .ps-list-page {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}

.ps-dialog-viewport-80 .ps-dialog-body > .ps-staff-remind-queue-wrap,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-staff-remind-queue-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.ps-staff-remind-queue-wrap {
  display: flex; flex-direction: column; min-height: 0; height: 100%; width: 100%;
}
.ps-staff-remind-queue-mount {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.ps-staff-remind-queue-mount .ps-list-page {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}

.ps-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: var(--ps-table-cell-size); color: var(--ps-table-cell-color); }
.ps-table.ps-table-col-resize {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}
.ps-table.ps-table-col-resize thead th {
  overflow: visible;
}
.ps-table.ps-table-col-resize tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}
.ps-table.ps-table-col-resize td.ps-col-actions,
.ps-table.ps-table-col-resize th.ps-col-actions {
  overflow: visible;
  max-width: none;
}
.ps-table.ps-list-table {
  table-layout: fixed;
  width: 100%;
  min-width: 100%;
  max-width: none;
}
.ps-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--ps-table-header-bg); border-bottom: 1px solid var(--ps-border);
  padding: 11px 14px; text-align: left; font-weight: 600; color: var(--ps-table-header-color);
  white-space: nowrap; user-select: none; font-size: var(--ps-table-header-size); letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ps-table tbody td {
  border-bottom: 1px solid #eef0f6; padding: 12px 14px; background: #fff;
  vertical-align: middle;
}
.ps-list-table { --ps-list-row-lines: 1; }
.ps-list-table tbody tr { height: var(--ps-list-row-h); }
.ps-list-table tbody td {
  height: var(--ps-list-row-h); max-height: var(--ps-list-row-h);
  overflow: hidden; box-sizing: border-box;
  padding-top: 6px; padding-bottom: 6px;
}
.ps-list-table thead th {
  overflow: visible;
  text-overflow: ellipsis;
}
.ps-list-table tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-list-table td.ps-col-actions,
.ps-list-table th.ps-col-actions {
  overflow: visible;
}
.ps-list-table td.ps-col-actions .ps-action-btns-row {
  width: 100%; min-width: 0; box-sizing: border-box;
}
.ps-list-table .ps-cell-inner {
  display: block; max-height: calc(var(--ps-list-row-h) - 12px);
  overflow: hidden; min-width: 0;
}
.ps-list-table .ps-cell-inner.ps-cell-html {
  text-overflow: ellipsis; white-space: nowrap;
}
.ps-list-table .ps-cell-inner.ps-ellipsis {
  text-overflow: ellipsis; white-space: nowrap;
}
.ps-list-table[data-row-lines] .ps-cell-inner.ps-ellipsis {
  white-space: normal; display: -webkit-box;
  -webkit-box-orient: vertical; -webkit-line-clamp: var(--ps-list-row-lines);
}
.ps-list-cell-editable { cursor: cell; }
.ps-list-cell-editable:has(.ps-list-cell-switch),
.ps-list-cell-editable:has(.ps-list-binary-val) { cursor: pointer; }

.ps-inline-cell-edit {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; width: 100%;
  padding: 2px 0;
}
.ps-inline-cell-edit .ps-input {
  width: 100%; min-width: 0; box-sizing: border-box;
  height: auto; min-height: var(--ps-control-h);
}
.ps-inline-cell-edit textarea.ps-input { min-height: 52px; padding: 6px 10px; line-height: 1.4; }
.ps-inline-cell-edit-select { min-width: 0; width: 100%; }
.ps-inline-cell-edit-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px;
}
.ps-inline-cell-edit-radio .ps-check-row,
.ps-inline-cell-edit-checkbox.ps-check-row {
  flex-wrap: wrap; gap: 4px 8px; font-size: 12px; max-height: 120px; overflow-y: auto;
}
.ps-inline-cell-edit-datetime { min-width: 0; width: 100%; }
.ps-list-table td:has(.ps-inline-cell-edit) {
  overflow: visible; vertical-align: top;
}
.ps-list-binary-val {
  display: inline-block; max-width: 100%; padding: 2px 10px; border-radius: 999px;
  background: var(--ps-accent-soft); color: #4338ca; font-size: 13px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.ps-list-table .ps-list-cell-switch { pointer-events: none; flex-shrink: 0; }
.ps-table tbody tr:hover td { background: #fafbff; }
.ps-th-inner { display: flex; align-items: center; gap: 6px; position: relative; padding-right: 8px; }
.ps-col-resizer {
  position: absolute; right: 0; top: 0; bottom: 0; width: 10px; cursor: col-resize;
  z-index: 6; touch-action: none;
}
body.ps-col-resizing { cursor: col-resize !important; user-select: none; }
body.ps-col-resizing * { cursor: col-resize !important; }
.ps-action-more-trigger[hidden] { display: none !important; }
.ps-list-table thead th { position: sticky; }
.ps-row-height-resizer {
  position: absolute; left: 0; right: 0; bottom: -4px; height: 8px;
  cursor: row-resize; z-index: 6;
}
.ps-col-fixed-left { position: sticky; left: 0; z-index: 2; box-shadow: 2px 0 4px rgba(15,23,42,0.04); }
.ps-col-fixed-right { position: sticky; right: 0; z-index: 2; box-shadow: -2px 0 4px rgba(15,23,42,0.04); }
.ps-table thead .ps-col-fixed-left,
.ps-table thead .ps-col-fixed-right { z-index: 4; background: #f8fafc; }

.ps-contract-versions-table { width: 100%; table-layout: auto; }
.ps-contract-versions-table tbody td {
  overflow: visible;
  text-overflow: clip;
  max-width: none;
  vertical-align: top;
}
.ps-contract-ver-review,
.ps-contract-ver-ops {
  min-width: 200px;
}
.ps-contract-ver-actions.ps-action-btns {
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 8px;
  max-width: 100%;
  overflow: visible;
}
.ps-contract-review-status { display: inline-block; margin-bottom: 6px; }
.ps-contract-poll-hint { margin: 10px 0 0; font-size: 12px; color: var(--ps-muted); }
.ps-contract-risk-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 6px;
  vertical-align: middle;
}
.ps-contract-risk-high { color: #b91c1c; background: #fee2e2; }
.ps-contract-risk-medium { color: #c2410c; background: #ffedd5; }
.ps-contract-risk-low { color: #1d4ed8; background: #dbeafe; }
.ps-contract-risk-unknown { color: #475569; background: #f1f5f9; }

.ps-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--ps-accent-soft); color: #4338ca; }
.ps-tag-off { background: #fee2e2; color: #b91c1c; }

.ps-kb-ingest {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.ps-kb-ingest-pending { background: #fef3c7; color: #92400e; }
.ps-kb-ingest-processing { background: #dbeafe; color: #1d4ed8; }
.ps-kb-ingest-success { background: #d1fae5; color: #047857; }
.ps-kb-ingest-failed { background: #fee2e2; color: #b91c1c; }
.ps-kb-ingest-skipped { background: #f3f4f6; color: #6b7280; }
.ps-kb-ingest-unknown { background: #f3f4f6; color: #6b7280; }
.ps-kb-ingest-processing::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
  animation: ps-kb-ingest-pulse 1.2s ease-in-out infinite;
}
@keyframes ps-kb-ingest-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.ps-kb-ingest-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.ps-frp-status {
  margin-top: 12px; padding: 12px 14px; border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius); font-size: 13px; line-height: 1.55; color: var(--ps-text-muted);
}
.ps-frp-status.is-busy { opacity: .85; }
.ps-frp-status.is-error { background: #fff5f5; border-color: #fecaca; color: #b42318; }
.ps-frp-status.is-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

.ps-block-grid {
  flex: 1; min-height: 0; overflow: auto; padding: 16px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
  align-items: stretch;
  grid-auto-rows: minmax(min-content, auto);
  width: 100%;
  box-sizing: border-box;
  --ps-block-span: 3;
}
.ps-block-card {
  grid-column: span var(--ps-block-span, 3);
  min-width: 0;
  max-width: 100%;
  min-height: auto;
  height: 100%;
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius); padding: 16px;
  background: #fff; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--ps-shadow-sm);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
  overflow: hidden;
}
.ps-block-span-control {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
  max-width: 140px;
}
@media (max-width: 639px) {
  .ps-block-card { grid-column: span 12 !important; }
}
.ps-block-card:hover {
  border-color: #d8dcf0;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}
.ps-block-card-title,
.ps-block-card > h4 {
  flex-shrink: 0;
}
.ps-block-card h4 { margin: 0; font-size: 15px; min-width: 0; }
.ps-block-meta { font-size: 13px; color: var(--ps-muted); line-height: 1.5; }
.ps-block-kv-list {
  display: flex; flex-direction: column; gap: 6px; margin-top: 4px;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.ps-block-kv {
  display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; min-width: 0;
  max-width: 100%;
}
.ps-block-kv-label { flex: 0 0 88px; color: var(--ps-muted); word-break: break-word; }
.ps-block-kv-val {
  flex: 1; min-width: 0; max-width: 100%; overflow: hidden;
  color: var(--ps-text); cursor: default;
}
/* 卡片字段：最多 3 行截断 + 悬停 tip 看全文（与列表单行省略同一套 tip，避免长文本撑破卡片） */
.ps-block-kv-val .ps-cell-inner {
  display: block; min-width: 0; max-width: 100%; overflow: hidden;
  line-height: 1.45;
}
.ps-block-kv-val .ps-cell-inner.ps-ellipsis,
.ps-block-kv-val .ps-cell-inner.ps-cell-html {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ps-block-card-title { margin: 0; font-size: 15px; min-width: 0; font-weight: 600; }
.ps-block-card-title .ps-cell-inner { font-size: inherit; font-weight: inherit; }
.ps-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-block-more-hint { font-size: 12px; color: var(--ps-muted); margin-top: 2px; }

.ps-floating-tip {
  position: fixed;
  z-index: 10050;
  max-width: min(420px, 92vw);
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ps-text);
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
}
.ps-floating-tip[hidden] { display: none !important; }
.ps-floating-tip.ps-floating-tip--json {
  max-width: min(520px, 94vw);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}
.ps-floating-tip.ps-floating-tip--interactive {
  pointer-events: auto;
  max-width: min(520px, 92vw);
  max-height: min(60vh, 440px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  white-space: normal;
}
.ps-floating-tip.ps-floating-tip--interactive.ps-floating-tip--json .ps-floating-tip-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}
.ps-floating-tip-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.ps-floating-tip-foot {
  flex-shrink: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--ps-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fafbfc;
}

.ps-pagination {
  flex-shrink: 0; border-top: 1px solid var(--ps-border); padding: 10px 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  background: #fafbfc; font-size: 13px; color: var(--ps-muted);
}
.ps-pagination select.ps-input { width: auto; padding: 6px 10px; }

.ps-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 1000;
  box-sizing: border-box;
}
.ps-mask-viewport-80,
.ps-mask-viewport-90 {
  padding: 0;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.ps-mask-nested {
  background: rgba(15, 23, 42, 0.28);
}
/* 嵌套弹窗：遮罩铺满上一级 .ps-dialog，子窗尺寸由 JS 按父级 80% 计算 */
.ps-mask-nested-in-parent {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.ps-mask-nested-in-parent .ps-dialog.ps-dialog-viewport-80,
.ps-mask-nested-in-parent .ps-dialog.ps-dialog-viewport-90 {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
}
.ps-mask[hidden] { display: none !important; }
.ps-dialog {
  box-sizing: border-box;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 48px rgba(17, 24, 39, 0.12);
  border: 1px solid var(--ps-border);
  width: min(640px, 100%);
  max-height: min(90vh, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
}
.ps-dialog-head {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background: #fff;
  padding: 20px 24px 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--ps-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ps-dialog-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.ps-dialog-foot {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background: #fff;
  margin-top: 0;
  padding: 12px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--ps-border);
}
.ps-dialog-wide { width: min(960px, 92vw); }
.ps-dialog-form { width: min(960px, 92vw); min-width: 60vw; }
.ps-mask-viewport-80 .ps-dialog.ps-dialog-viewport-80 {
  width: 80%;
  height: 80%;
  max-width: 80%;
  max-height: 80%;
  min-width: 0;
  min-height: 240px;
}
.ps-mask-viewport-90 .ps-dialog.ps-dialog-viewport-90 {
  width: 90%;
  height: 90%;
  max-width: 90%;
  max-height: 90%;
  min-width: 0;
  min-height: 240px;
}
.ps-dialog-form.ps-dialog-viewport-80,
.ps-dialog-form.ps-dialog-viewport-90 { min-width: 0; }
.ps-dialog-viewport-80 .ps-dialog-body,
.ps-dialog-viewport-90 .ps-dialog-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.ps-dialog-viewport-80 .ps-dialog-body > form.ps-skill-install-form,
.ps-dialog-viewport-90 .ps-dialog-body > form.ps-skill-install-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0;
  gap: 0;
}
.ps-skill-install-form .ps-skill-install-hint,
.ps-skill-install-form .ps-skill-install-url {
  flex-shrink: 0;
}
.ps-skill-install-form .ps-skill-install-progress:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
}
.ps-skill-install-form .ps-skill-install-progress:not([hidden]) > label,
.ps-skill-install-form .ps-skill-install-progress:not([hidden]) #skill-install-status {
  flex-shrink: 0;
}
.ps-skill-install-form .ps-skill-install-log {
  flex: 1;
  min-height: 120px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  box-sizing: border-box;
}
.ps-file-preview-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 8px;
  box-sizing: border-box;
}
.ps-file-preview-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.ps-file-preview-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.ps-file-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 1px solid var(--ps-border);
  border-radius: 8px;
  background: #fff;
}
.ps-file-preview-notice {
  margin: 0 0 10px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ps-muted, #6b7280);
  background: rgba(180, 83, 9, 0.08);
  border-radius: 6px;
}
.ps-file-preview-video,
.ps-file-preview-audio {
  width: 100%;
  max-height: min(70vh, 520px);
  border-radius: 6px;
  background: #000;
}
.ps-file-preview-audio {
  max-height: none;
  background: transparent;
}
.ps-file-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.ps-agent-tool-files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.ps-tool-catalog-list-mount {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.ps-tool-catalog-list-mount .ps-panel.ps-list-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ps-tool-invoke-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.ps-tool-invoke-form > .ps-field-hint {
  flex-shrink: 0;
}
.ps-tool-invoke-fields {
  flex-shrink: 0;
  max-height: min(36vh, 280px);
  overflow-x: hidden;
  overflow-y: auto;
  margin-bottom: 8px;
}
.ps-tool-invoke-result-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.ps-tool-invoke-result-wrap label {
  flex-shrink: 0;
}
.ps-tool-invoke-result {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(42vh, 360px);
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--ps-border);
  border-radius: 6px;
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  width: 100%;
}
.ps-dialog-compact.ps-dialog-form {
  width: min(560px, 92vw);
  min-width: 0;
  max-height: min(88vh, 720px);
}
.ps-smart-field-config-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}
.ps-smart-field-config-wrap .ps-field-hint { flex-shrink: 0; margin: 0 0 12px; line-height: 1.55; }
.ps-smart-field-config-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ps-smart-field-config-toolbar .ps-input[type="search"] { flex: 1; min-width: 160px; max-width: 320px; }
.ps-smart-field-config-table {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--ps-border);
  border-radius: 8px;
}
.ps-smart-field-config-table .ps-table { margin: 0; }
.ps-smart-field-config-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ps-border);
}
.ps-kv-dl { margin: 0; font-size: 14px; line-height: 1.5; }
.ps-kv-dl dt { color: var(--ps-muted); font-size: 13px; margin: 10px 0 4px; }
.ps-kv-dl dt:first-child { margin-top: 0; }
.ps-kv-dl dd { margin: 0; word-break: break-all; }

/* 弹窗「查看/详情」：标签右对齐固定列宽，内容与标签分列对齐 */
.ps-detail-view {
  --ps-detail-label-w: 7.5rem;
  --ps-detail-gap: 16px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 100%;
}
.ps-detail-row {
  display: grid;
  grid-template-columns: var(--ps-detail-label-w) var(--ps-detail-gap) minmax(0, 1fr);
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--ps-border);
}
.ps-detail-row:last-child { border-bottom: none; }
.ps-detail-label {
  grid-column: 1;
  text-align: right;
  color: var(--ps-muted);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.5;
  padding-top: 1px;
}
.ps-detail-value {
  grid-column: 3;
  color: var(--ps-text);
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ps-detail-value--multiline { white-space: pre-wrap; }
.ps-detail-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ps-text);
  margin: 14px 0 6px;
  padding-top: 10px;
  border-top: 1px solid var(--ps-border);
}
.ps-detail-section-body { margin: 4px 0 0; min-width: 0; }
.ps-detail-section-rows .ps-detail-row:first-child { padding-top: 4px; }
.ps-detail-pre {
  margin: 0;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(48vh, 420px);
  overflow: auto;
}
.ps-detail-follow-list { list-style: none; margin: 0; padding: 0; }
.ps-detail-follow-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--ps-border);
}
.ps-detail-follow-item:last-child { border-bottom: none; }
.ps-detail-follow-meta { font-size: 13px; color: var(--ps-muted); margin-bottom: 4px; }

.ps-agent-page-root {
  height: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.ps-agent-page {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.ps-agent-records-filter {
  flex-shrink: 0;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--ps-card);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
}
.ps-agent-records-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 12px;
  align-items: end;
}
.ps-agent-records-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ps-agent-session-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ps-agent-session-time {
  font-size: 11px;
  color: var(--ps-muted);
  line-height: 1.3;
}
.ps-agent-sidebar-pager {
  padding: 8px 10px;
  font-size: 12px;
  gap: 6px;
}
.ps-agent-sidebar-pager .ps-btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}
.ps-agent-session-meta {
  font-size: 11px;
  color: var(--ps-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-agent-layout {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  gap: 0;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  overflow: hidden;
  background: #fff;
}
.ps-agent-layout--compact .ps-agent-sidebar { display: none; }
.ps-agent-layout--compact .ps-agent-main { flex: 1; width: 100%; }
.ps-ba-embed-root { position: fixed; inset: 0; pointer-events: none; z-index: 2147483000; }
.ps-ba-embed-fab,
.ps-ba-embed-panel { pointer-events: auto; }
.ps-ba-embed-fab {
  position: fixed;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.22);
  background: var(--ps-card, #fff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ps-ba-embed-fab:hover { transform: scale(1.04); box-shadow: 0 8px 28px rgba(15, 23, 42, 0.28); }
.ps-ba-embed-fab-icon { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.ps-ba-embed-panel {
  position: fixed;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--ps-border, #e2e8f0);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.24);
  background: var(--ps-bg, #f8fafc);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.ps-ba-embed-panel.is-open { opacity: 1; transform: translateY(0) scale(1); }
.ps-ba-embed-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--ps-card, #fff);
  border-bottom: 1px solid var(--ps-border, #e2e8f0);
}
.ps-ba-embed-panel-title { font-size: 14px; font-weight: 600; color: var(--ps-text, #0f172a); }
.ps-ba-embed-panel-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ps-muted, #64748b);
  padding: 2px 6px;
}
.ps-ba-embed-panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.ps-ba-embed-iframe { width: 100%; height: 100%; border: none; display: block; flex: 1; min-height: 0; }
.ps-agent-main-head.ps-agent-embed-head {
  position: relative;
  display: block;
  flex-shrink: 0;
  margin: 0;
  padding: 12px 44px 12px 14px;
  background: var(--ps-card, #fff);
  border-bottom: 1px solid var(--ps-border, #e2e8f0);
}
.ps-agent-embed-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ps-text, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-agent-embed-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ps-muted, #64748b);
  padding: 4px 8px;
  border-radius: 6px;
}
.ps-agent-embed-close:hover { color: var(--ps-text, #0f172a); background: #f1f5f9; }
.ps-agent-layout--compact.ps-agent-embed-layout {
  border: none;
  border-radius: 0;
  height: 100%;
}
.ps-agent-page--embed {
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.ps-agent-layout--compact.ps-agent-embed-layout .ps-agent-main-head:not(.ps-agent-embed-head) { display: none; }
.ps-skill-usage-card p { margin: 6px 0; line-height: 1.5; }
.ps-skill-usage-list { margin: 8px 0 0 18px; padding: 0; }
.ps-skill-usage-list li { margin-bottom: 8px; line-height: 1.45; }
.ps-dialog-viewport-80 .ps-dialog-body > .ps-skill-agent-test-wrap,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-skill-agent-test-wrap {
  flex: 1;
  min-height: 0;
}
.ps-skill-agent-test-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}
.ps-skill-agent-test-wrap > .ps-skill-usage-card {
  flex-shrink: 0;
  max-height: 28vh;
  overflow: auto;
}
.ps-skill-agent-test-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ps-skill-agent-test-chat-host,
.ps-skill-agent-test-chat > .ps-agent-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ps-skill-agent-test-chat .ps-agent-layout {
  flex: 1;
  min-height: 0;
  height: auto;
}
.ps-skill-agent-test-chat .ps-agent-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ps-skill-agent-test-chat .ps-agent-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.ps-skill-agent-test-chat .ps-agent-compose {
  flex-shrink: 0;
}
.ps-agent-sidebar {
  width: 280px; flex-shrink: 0; border-right: 1px solid var(--ps-border);
  display: flex; flex-direction: column; min-height: 0; background: #fafbfc;
}
.ps-agent-sidebar-head { padding: 12px; border-bottom: 1px solid var(--ps-border); }
.ps-agent-session-list { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.ps-agent-session-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px;
  cursor: pointer; margin-bottom: 4px;
}
.ps-agent-session-item:hover { background: #eef2f7; }
.ps-agent-session-item.is-active { background: var(--ps-accent-soft); box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15); }
.ps-agent-session-title { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-agent-session-ignore {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
}
.ps-agent-session-item.is-ignored {
  opacity: 0.72;
}
.ps-agent-session-ignored-tag {
  color: var(--ps-muted);
}
.ps-agent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.ps-agent-main-head {
  flex-shrink: 0; padding: 12px 16px; border-bottom: 1px solid var(--ps-border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
}
.ps-agent-ext-customer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  flex-wrap: nowrap;
}
.ps-agent-ext-customer-label {
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0;
}
.ps-agent-ext-customer #agent-customer-select { flex: 1; min-width: 160px; }
.ps-agent-attach-btn {
  border: 1px solid var(--ps-border);
  background: #fff;
}
.ps-agent-voice-btn {
  border: 1px solid var(--ps-border);
  background: #fff;
  font-size: 12px;
  line-height: 1.2;
  padding: 4px 6px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.ps-agent-voice-btn.is-recording {
  background: var(--ps-accent);
  border-color: var(--ps-accent);
  color: #fff;
}
.ps-agent-is-sending .ps-agent-voice-btn { opacity: 0.65; pointer-events: none; }
.ps-agent-messages { flex: 1; min-height: 0; overflow: auto; padding: 16px; background: #f8fafc; }
.ps-agent-empty { color: var(--ps-muted); text-align: center; padding: 48px 16px; font-size: 14px; }
.ps-agent-bubble { display: flex; margin-bottom: 12px; }
.ps-agent-bubble.is-user { justify-content: flex-end; }
.ps-agent-bubble.is-assistant { justify-content: flex-start; }
.ps-agent-bubble-inner {
  max-width: min(720px, 92%); padding: 10px 14px; border-radius: 10px; font-size: 14px; line-height: 1.55;
  border: 1px solid var(--ps-border); background: #fff;
  min-width: 0;
  overflow: hidden;
}
.ps-agent-bubble-text,
.ps-agent-answer {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ps-agent-bubble.is-user .ps-agent-bubble-inner { background: #eff6ff; border-color: #bfdbfe; }
.ps-agent-bubble-time { margin-top: 6px; font-size: 12px; color: var(--ps-muted); }
.ps-agent-attach-meta { font-size: 12px; color: var(--ps-muted); margin-bottom: 6px; }
.ps-agent-compose {
  flex-shrink: 0;
  border-top: 1px solid var(--ps-border);
  padding: 12px 16px;
  background: #fff;
}
.ps-agent-compose-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}
.ps-agent-compose-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  min-height: 72px;
}
.ps-agent-compose-input-wrap textarea {
  width: 100%;
  box-sizing: border-box;
  resize: none;
  flex: 1;
  min-height: 72px;
  max-height: 160px;
  overflow-y: auto;
  margin: 0;
}
.ps-agent-file-hint { margin: 8px 0 0; font-size: 12px; min-height: 0; display: block; }
.ps-agent-compose-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 8px;
  width: 76px;
  min-height: 72px;
}
.ps-agent-compose-side .ps-btn {
  flex: 1 1 0;
  min-width: 76px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.ps-agent-compose-side .ps-btn[hidden] {
  display: none !important;
}
.ps-agent-compose-side .ps-agent-send-btn {
  background: var(--ps-accent);
  border-color: var(--ps-accent);
  color: #fff;
  font-weight: 500;
}
.ps-agent-compose-side .ps-agent-send-btn:hover:not(:disabled) {
  background: var(--ps-accent-hover);
  border-color: var(--ps-accent-hover);
  color: #fff;
}
.ps-agent-is-sending .ps-agent-compose-side .ps-agent-send-btn { opacity: 0.65; cursor: wait; }
.ps-agent-is-sending .ps-agent-sidebar,
.ps-agent-is-sending .ps-agent-main-head,
.ps-agent-is-sending .ps-agent-messages,
.ps-agent-is-sending .ps-agent-compose-input-wrap {
  pointer-events: auto;
}

.ps-agent-process {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed var(--ps-border);
  background: #f8fafc;
  max-height: min(42vh, 360px);
  overflow: auto;
}
.ps-agent-is-sending .ps-agent-process {
  max-height: min(55vh, 480px);
}
.ps-agent-process-label {
  font-size: 11px;
  color: var(--ps-muted);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}
.ps-agent-process-text {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ps-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: none;
  overflow: visible;
}
.ps-md-body { font-size: 14px; line-height: 1.6; }
.ps-md-body .ps-md-p { margin: 0 0 10px; }
.ps-md-body .ps-md-h { margin: 12px 0 8px; font-size: 15px; font-weight: 600; }
.ps-md-ul, .ps-md-ol { margin: 0 0 10px 1.2em; padding: 0; }
.ps-md-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 13px;
  table-layout: fixed;
}
.ps-md-table th, .ps-md-table td {
  border: 1px solid var(--ps-border);
  padding: 6px 10px;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
}
.ps-md-table th { background: #f1f5f9; font-weight: 600; }
.ps-md-pre {
  margin: 8px 0;
  padding: 10px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 12px;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow-x: auto;
}
.ps-md-pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ps-md-code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f1f5f9;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ps-md-body a {
  overflow-wrap: anywhere;
  word-break: break-all;
}
.ps-md-media { margin: 10px 0; }
.ps-md-video, .ps-md-audio { max-width: 100%; border-radius: 8px; }
.ps-md-media-cap { font-size: 12px; color: var(--ps-muted); margin-top: 4px; }
.ps-md-file {
  margin: 10px 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.ps-md-file-dl,
.ps-agent-file-dl {
  font-size: 13px;
}
.ps-md-file-url {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ps-muted);
  overflow-wrap: anywhere;
  word-break: break-all;
}
.ps-md-chart { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.ps-md-bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.ps-md-bar-label { width: 72px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-md-bar-track { flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.ps-md-bar-fill { height: 100%; background: var(--ps-accent, #2563eb); border-radius: 4px; }
.ps-md-bar-val { width: 36px; text-align: right; flex-shrink: 0; color: var(--ps-muted); }
.ps-ext-maint-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.ps-ext-maint-wrap .ps-field-hint {
  flex-shrink: 0;
  margin: 0 0 12px;
  line-height: 1.55;
}
.ps-ext-maint-wrap #ext-field-list { flex: 1 1 auto; min-height: 0; overflow: auto; }
.ps-dialog-head h3 { margin: 0; font-size: 18px; }
.ps-dialog-close {
  border: none; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ps-muted);
}
.ps-field { margin-bottom: 14px; }
.ps-field > label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--ps-label); margin-bottom: 6px;
}
.ps-field-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 6px; min-width: 0;
}
.ps-field-label-row > label {
  display: block; margin-bottom: 0; flex: 1 1 auto; min-width: 0;
  font-size: 13px; font-weight: 500; color: var(--ps-label);
}
.ps-field-label-row > .ps-btn { flex: 0 0 auto; white-space: nowrap; }

.ps-datetime { position: relative; max-width: 420px; }
.ps-datetime-bar { display: flex; align-items: stretch; gap: 8px; }
.ps-datetime-trigger {
  flex: 1; min-width: 0; text-align: left; cursor: pointer;
  background: #fff; font-family: inherit;
}
.ps-datetime-trigger.is-placeholder { color: var(--ps-placeholder); }
.ps-datetime-panel {
  margin-top: 6px; padding: 12px; border: 1px solid var(--ps-border); border-radius: 10px;
  background: #fff; box-shadow: var(--ps-shadow);
}
.ps-datetime-panel-floating { margin-top: 0; }
.ps-datetime-cal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px;
}
.ps-datetime-cal-title { font-weight: 600; font-size: 14px; flex: 1; text-align: center; }
.ps-datetime-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px;
  font-size: 12px; color: var(--ps-muted); text-align: center;
}
.ps-datetime-days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px;
}
.ps-datetime-day {
  border: none; background: transparent; border-radius: 8px; padding: 6px 0; font-size: 13px;
  cursor: pointer; color: var(--ps-text);
}
.ps-datetime-day:hover:not(.is-empty) { background: #f1f5f9; }
.ps-datetime-day.is-selected { background: var(--ps-accent); color: #fff; }
.ps-datetime-day.is-empty { pointer-events: none; }
.ps-datetime-time {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px;
  padding: 10px 0 12px; border-top: 1px solid var(--ps-border);
}
.ps-datetime-time-label { font-size: 13px; color: var(--ps-muted); margin-right: 4px; }
.ps-datetime-num { width: 52px; text-align: center; padding: 8px 6px; }
.ps-datetime-sep { color: var(--ps-muted); font-weight: 600; }
.ps-datetime-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  padding-top: 4px; border-top: 1px solid var(--ps-border);
}
.ps-field-hint-inline { font-size: 12px; color: var(--ps-muted); margin-top: 4px; }
.ps-toggle { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ps-toggle-switch {
  position: relative; width: 52px; height: 28px; padding: 0; border: none; border-radius: 999px;
  background: #94a3b8; cursor: pointer; flex-shrink: 0; transition: background 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.ps-toggle-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25); transition: transform 0.2s ease;
}
.ps-toggle-switch[aria-checked="true"] {
  background: var(--ps-primary, #2563eb); box-shadow: none;
}
.ps-toggle-switch[aria-checked="true"]::after { transform: translateX(24px); }
.ps-toggle-switch:focus-visible { outline: 2px solid var(--ps-primary, #2563eb); outline-offset: 2px; }
.ps-toggle-caption { font-size: 14px; font-weight: 600; color: #64748b; min-width: 3em; line-height: 1.2; }
.ps-toggle-caption.is-on { color: var(--ps-primary, #2563eb); }
.ps-toggle-field {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; max-width: 640px;
}
.ps-toggle-field-body { flex: 1; min-width: 0; }
.ps-toggle-field-title { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--ps-muted); line-height: 1.4; }
.ps-toggle-field-desc { margin: 0; font-size: 12px; color: var(--ps-muted); line-height: 1.55; opacity: 0.92; }
.ps-miniapp-status-banner {
  padding: 12px 14px; border-radius: 8px; border: 1px solid var(--ps-border);
  background: var(--ps-surface-alt, #f8fafc); font-size: 13px; line-height: 1.55; color: var(--ps-text); max-width: 720px;
}
.ps-miniapp-status-banner.is-warn { border-color: #fcd34d; background: #fffbeb; color: #92400e; }

.ps-check-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.ps-check-row label {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 0;
  font-size: 14px; color: var(--ps-text); cursor: pointer;
}
.ps-check-row input[type="checkbox"],
.ps-check-row input[type="radio"] { width: 16px; height: 16px; margin: 0; cursor: pointer; flex-shrink: 0; }
.ps-lead-follow-flags { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.ps-lead-follow-flags .ps-check-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin: 0;
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  background: var(--ps-card); cursor: pointer; user-select: none;
  font-size: 14px; color: var(--ps-text); line-height: 1.45;
}
.ps-lead-follow-flags .ps-check-row:hover { background: var(--ps-side-hover, #f4f6fb); }
.ps-lead-follow-flags .ps-check-row input[type="checkbox"] {
  width: 20px; height: 20px; flex-shrink: 0; cursor: pointer;
}
.ps-lead-follow-flags .ps-check-row span { flex: 1; cursor: pointer; }
.ps-radio-row { column-gap: 20px; row-gap: 10px; }
.ps-radio-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: var(--ps-text); }
.ps-field-hint { font-size: 12px; color: var(--ps-muted); margin: 0 0 10px; line-height: 1.5; }

.ps-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px;
}
@media (max-width: 640px) {
  .ps-form-grid { grid-template-columns: 1fr; }
}
.ps-form-grid .ps-field-span-2 { grid-column: 1 / -1; }

.ps-follow-form { width: 100%; box-sizing: border-box; }
/* 跟进表单：整表双列，每项仅占一列（禁止 span-2） */
.ps-follow-form-grid .ps-field { margin-bottom: 12px; min-width: 0; }
.ps-follow-form-grid .ps-field-span-2 { grid-column: auto; }
.ps-follow-form-extra:not([hidden]) { display: contents; }
.ps-follow-form-extra[hidden] { display: none !important; }
.ps-follow-form-extra .ps-field[hidden],
#follow-call-direction-field[hidden] { display: none !important; }
.ps-follow-score-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ps-follow-score-row .ps-input { flex: 1; min-width: 0; }
.ps-follow-form-err {
  color: #b91c1c;
  font-size: 13px;
  margin: 8px 0 0;
}

.ps-upload { width: 100%; }
.ps-upload-zone {
  border: 1.5px dashed var(--ps-border); border-radius: 12px; background: #f8fafc;
  padding: 28px 20px; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s;
  outline: none;
}
.ps-upload-zone:hover, .ps-upload-zone:focus-visible {
  border-color: var(--ps-accent); background: #f0f9ff;
}
.ps-upload-zone.is-dragover {
  border-color: var(--ps-accent); background: #e0f2fe; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.ps-upload-zone-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ps-upload-icon { color: var(--ps-accent); opacity: 0.85; }
.ps-upload-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ps-text); }
.ps-upload-hint { margin: 0; font-size: 12px; color: var(--ps-muted); line-height: 1.5; max-width: 360px; }
.ps-upload-pick { margin-top: 4px; }
.ps-upload-file {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--ps-border); border-radius: 12px; background: #fff;
}
.ps-upload-file-icon { flex-shrink: 0; color: var(--ps-accent); display: flex; align-items: center; }
.ps-upload-file-meta { flex: 1; min-width: 0; }
.ps-upload-file-name {
  font-size: 14px; font-weight: 600; color: var(--ps-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-upload-file-sub {
  font-size: 12px; color: var(--ps-muted); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-upload-file-sub.is-error { color: #b91c1c; }
.ps-upload-progress {
  margin-top: 8px; height: 4px; border-radius: 999px; background: #e2e8f0; overflow: hidden;
}
.ps-upload-progress span {
  display: block; height: 100%; width: 0; background: var(--ps-accent); border-radius: 999px;
  transition: width 0.2s ease;
}
.ps-upload-compact .ps-upload-zone { padding: 18px 14px; }
.ps-upload-compact .ps-upload-icon { width: 32px; height: 32px; }
.ps-upload-field { margin-bottom: 14px; }
.ps-smart-table-manage {
  display: flex; flex-direction: column; min-height: 0; height: 100%; width: 100%;
}
.ps-smart-table-manage #rows { flex: 1; min-height: 0; }
.ps-smart-table-manage #rows .ps-list-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ps-list-empty-row .ps-list-empty-cell { text-align: center; color: var(--ps-muted, #64748b); padding: 24px 12px; }

.ps-excel-import-upload { margin-bottom: 12px; }
.ps-excel-import-rules {
  margin: 0 0 16px; padding: 10px 12px; border-radius: 8px;
  background: #f8fafc; border: 1px solid var(--ps-border);
  font-size: 12px; color: var(--ps-muted); line-height: 1.55;
}
.ps-table-import-loading {
  margin: 16px 0; padding: 20px 16px; text-align: center;
  border: 1px dashed var(--ps-border); border-radius: var(--ps-radius-sm);
  color: var(--ps-muted); font-size: 14px;
}
.ps-lead-import-inner { position: relative; min-height: 120px; }
.ps-lead-import-busy {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.78);
  cursor: wait;
}
.ps-lead-import-form[aria-busy="true"] .ps-lead-import-inner { pointer-events: none; }
.ps-lead-import-form[aria-busy="true"] .ps-table-import-loading { pointer-events: none; }
.ps-table-import-preview-wrap { margin-top: 12px; min-height: 120px; }
.ps-table-import-preview-scroll {
  max-height: min(52vh, 480px); overflow: auto;
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
}
.ps-table-import-preview {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.ps-table-import-preview th,
.ps-table-import-preview td {
  padding: 8px 10px; border-bottom: 1px solid var(--ps-border);
  vertical-align: top; max-width: 220px; word-break: break-word;
}
.ps-table-import-preview thead th {
  position: sticky; top: 0; background: #f8fafc; z-index: 1;
  font-weight: 600; white-space: nowrap;
}
.ps-table-import-check { width: 72px; text-align: center; }
.ps-table-import-preview tr.ps-import-row-overlap td { background: rgba(180, 83, 9, 0.08); }
.ps-import-overlap-cell { color: #b45309; font-size: 12px; max-width: 220px; }
.ps-product-list-cover {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--ps-border, #e5e7eb);
  display: block;
}
.ps-hub-cover-preview {
  margin-top: 10px;
  max-width: 240px;
  max-height: 140px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--ps-border, #e5e7eb);
}
.ps-product-asset-row {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--ps-border, #e5e7eb);
}
.ps-product-asset-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ps-product-asset-row-head .ps-product-asset-name {
  flex: 1;
  min-width: 0;
}
.ps-hub-linked-table .ps-table-link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--ps-primary, #2563eb);
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ps-hub-linked-table .ps-table-link-btn:hover {
  opacity: 0.85;
}
.ps-hub-timeline-item--click {
  cursor: pointer;
}
.ps-hub-timeline-item--click:hover .ps-hub-timeline-event {
  background: var(--ps-hover, rgba(0, 0, 0, 0.03));
  border-radius: 6px;
}
.ps-hub-timeline-hint {
  display: block;
  font-size: 12px;
  color: var(--ps-primary, #2563eb);
  margin-top: 4px;
}

/* 产品 360 · 下钻详情弹窗（无行间分割线） */
.ps-hub-drill-detail {
  padding: 4px 0 8px;
  min-width: 0;
}
.ps-detail-view--plain .ps-detail-row {
  border-bottom: none;
  padding: 5px 0 12px;
  grid-template-columns: 5.5rem 10px minmax(0, 1fr);
}
.ps-detail-view--plain .ps-detail-label {
  text-align: left;
  color: var(--ps-muted);
  font-weight: 500;
}
.ps-detail-view--plain .ps-detail-value--multiline {
  margin-top: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  max-height: min(40vh, 320px);
  overflow: auto;
}
.ps-hub-drill-template-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ps-hub-drill-template-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ps-text);
  flex: 1;
  min-width: 0;
}
.ps-hub-drill-status-tag {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.2;
}
.ps-hub-drill-status-tag.is-on {
  color: #047857;
  background: #ecfdf5;
}
.ps-hub-drill-status-tag.is-off {
  color: #6b7280;
  background: #f3f4f6;
}
.ps-hub-drill-template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ps-text);
}
.ps-hub-drill-template-meta span {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ps-hub-drill-template-meta em {
  font-style: normal;
  font-size: 11px;
  color: var(--ps-muted);
  font-weight: 500;
}
.ps-hub-drill-block {
  margin-bottom: 14px;
}
.ps-hub-drill-block-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ps-text);
  margin-bottom: 8px;
}
.ps-hub-drill-block-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ps-text);
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.ps-hub-drill-block-empty {
  margin: 0;
  font-size: 13px;
  color: var(--ps-muted);
}
.ps-hub-drill-var-list,
.ps-hub-drill-req-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-hub-drill-var-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
}
.ps-hub-drill-var-name {
  font-weight: 500;
  color: var(--ps-text);
}
.ps-hub-drill-var-key {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef2ff;
  color: #4338ca;
}
.ps-hub-drill-var-remark {
  flex: 1 1 100%;
  font-size: 12px;
  color: var(--ps-muted);
  line-height: 1.45;
}
.ps-hub-drill-req-list li {
  font-size: 13px;
  padding: 6px 0 6px 12px;
  border-left: 3px solid var(--ps-border, #e5e7eb);
  color: var(--ps-text);
}
.ps-check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.ps-dialog-foot {
  flex-shrink: 0; display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--ps-border);
}
.ps-upload .ps-upload-zone[hidden],
.ps-upload .ps-upload-file[hidden] {
  display: none !important;
}
.ps-upload-slot {
  display: flex; flex-direction: column; gap: 0;
}

.ps-follow-attach-list {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.ps-follow-attach-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  background: var(--ps-bg-soft, #f8fafc);
}
.ps-follow-attach-name {
  flex: 1; min-width: 120px; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-follow-attach-size { font-size: 12px; color: var(--ps-muted); }

.ps-follow-att-thumb {
  flex-shrink: 0; padding: 0; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  background: #fff; cursor: pointer; line-height: 0; overflow: hidden;
  width: 56px; height: 56px; display: inline-flex; align-items: center; justify-content: center;
}
.ps-follow-att-thumb:hover { border-color: var(--ps-accent); box-shadow: 0 0 0 2px var(--ps-accent-soft); }
.ps-follow-att-thumb-img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block;
}
.ps-follow-att-hover-preview {
  position: fixed; z-index: 10050; pointer-events: auto;
  padding: 6px; background: #fff; border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm); box-shadow: var(--ps-shadow);
  max-width: min(520px, 92vw); max-height: min(520px, 85vh);
}
.ps-follow-att-hover-preview[hidden] { display: none !important; }
.ps-follow-att-hover-img {
  display: block; max-width: min(500px, 90vw); max-height: min(500px, 80vh);
  width: auto; height: auto; object-fit: contain;
}
.ps-follow-att-viewer-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.ps-follow-att-viewer-item {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
}
.ps-follow-att-viewer-meta {
  flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 4px;
}
.ps-follow-att-name { font-size: 14px; word-break: break-all; }
.ps-follow-att-file-icon { flex-shrink: 0; color: var(--ps-accent); display: flex; align-items: center; }

.ps-select { position: relative; width: 100%; }
.ps-select-trigger {
  width: 100%; text-align: left; box-sizing: border-box;
  height: var(--ps-control-h); min-height: var(--ps-control-h);
  padding: 0 36px 0 12px; line-height: calc(var(--ps-control-h) - 2px);
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  background-color: #fff;
  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 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  cursor: pointer; font-size: 14px;
  min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-select-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff;
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm); box-shadow: var(--ps-shadow);
  z-index: 50; max-height: 240px; overflow: hidden; display: flex; flex-direction: column;
}
.ps-select-panel.ps-select-panel-floating {
  position: fixed; left: auto; right: auto; top: auto; bottom: auto;
  z-index: 1101;
}
.ps-select-panel[hidden] { display: none !important; }
.ps-select-search { padding: 8px; border-bottom: 1px solid var(--ps-border); }
.ps-select-options { overflow: auto; max-height: 180px; }
.ps-select-option {
  padding: 8px 12px; cursor: pointer; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-select-option:hover, .ps-select-option.active { background: var(--ps-accent-soft); color: #4338ca; }
.ps-select-empty { padding: 12px; color: var(--ps-muted); font-size: 13px; text-align: center; }

.ps-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2px 6px;
  margin-bottom: 0;
  padding: 0 2px;
  border-bottom: 1px solid var(--ps-border);
  flex-shrink: 0;
}
.ps-embed-root:has(> .ps-tabs) { gap: 0; min-height: 0; }
.ps-embed-root:has(> .ps-tabs) > .ps-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ps-embed-root:has(> .ps-tabs) > .ps-tabs .ps-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}
/* 配置中心等：页签过多时折行，不强制横向滚动 */
.ps-embed-root:has(> .ps-tabs.ps-tabs--wrap) > .ps-tabs.ps-tabs--wrap {
  flex-wrap: wrap;
  overflow-x: visible;
  overflow-y: visible;
  align-items: flex-end;
  gap: 2px 4px;
  padding-bottom: 2px;
}
.ps-embed-root:has(> .ps-tabs.ps-tabs--wrap) > .ps-tabs.ps-tabs--wrap .ps-tab {
  white-space: normal;
  text-align: center;
  max-width: 100%;
}
.ps-embed-root > .ps-config-tab-panel {
  flex: 1 1 0; min-height: 0; overflow: auto; box-sizing: border-box;
  border: 1px solid var(--ps-border); border-top: none;
  border-radius: 0 0 var(--ps-radius) var(--ps-radius);
  background: var(--ps-card);
}
.ps-embed-root > .ps-config-tab-panel:not([hidden]) {
  min-height: 200px;
}
.ps-config-tab-panel {
  flex: 1; min-height: 0; overflow: auto; box-sizing: border-box;
}
.ps-config-tab-panel[hidden] { display: none !important; }
/* 配置中心：表单保存、复制行、工具按钮统一尺寸与间距 */
.ps-config-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px; margin-top: 16px;
}
.ps-config-actions:first-child { margin-top: 0; }
.ps-config-inline-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.ps-config-inline-row .ps-config-code {
  flex: 1; min-width: 200px; font-size: 13px; word-break: break-all;
  min-height: var(--ps-control-h); padding: 0 12px;
  display: flex; align-items: center;
  background: #fff; border-radius: var(--ps-radius-sm);
  border: 1px solid var(--ps-border); box-sizing: border-box; line-height: 1.45;
}
.ps-config-inline-row .ps-config-code.is-muted { background: #f8fafc; font-size: 12px; }
.ps-config-tab-panel .ps-btn,
.ps-config-actions .ps-btn,
.ps-dialog-foot .ps-btn {
  height: var(--ps-control-h); min-height: var(--ps-control-h);
  padding-top: 0; padding-bottom: 0; box-sizing: border-box;
}
.ps-tab {
  position: relative;
  margin: 0;
  padding: 10px 14px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ps-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.35;
  transition: color 0.12s ease, background 0.12s ease;
}
.ps-tab:hover:not(.active) {
  color: var(--ps-text);
  background: rgba(99, 102, 241, 0.06);
  border-radius: var(--ps-radius-sm) var(--ps-radius-sm) 0 0;
}
.ps-tab.active {
  color: var(--ps-accent);
  font-weight: 600;
  background: transparent;
  z-index: 1;
}
.ps-tabs--underline .ps-tab::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 0;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: height 0.12s ease, background 0.12s ease;
}
.ps-tabs--underline .ps-tab.active::after {
  height: 3px;
  background: var(--ps-accent);
}
.ps-tabs:not(.ps-tabs--underline) .ps-tab.active {
  background: var(--ps-card);
  border: 1px solid var(--ps-border);
  border-bottom-color: var(--ps-card);
  border-radius: var(--ps-radius-sm) var(--ps-radius-sm) 0 0;
  margin: 0 2px -1px 0;
  padding: 10px 18px;
}
.ps-tabs:not(.ps-tabs--underline) .ps-tab {
  margin: 0 2px -1px 0;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--ps-radius-sm) var(--ps-radius-sm) 0 0;
}
.ps-login-card .ps-tabs {
  margin-bottom: 16px;
  padding: 0;
  border-bottom: 1px solid var(--ps-border);
}
.ps-login-card .ps-tabs.ps-tabs--underline .ps-tab.active::after {
  background: var(--ps-accent);
}
.ps-login-card .ps-tabs:not(.ps-tabs--underline) .ps-tab.active {
  border-bottom-color: #fff;
}

.ps-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 24px;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(99, 102, 241, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 100%, rgba(139, 92, 246, 0.14) 0%, transparent 50%),
    linear-gradient(180deg, #fafbff 0%, #f3f4ff 100%);
}
.ps-login-card {
  width: min(440px, 100%); background: #fff; border-radius: 20px; padding: 32px 32px 28px;
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.1); border: 1px solid rgba(99, 102, 241, 0.12);
}
.ps-login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.ps-login-brand img { width: auto; height: 52px; max-width: 100%; border-radius: 0; box-shadow: none; }
.ps-login-brand h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.ps-login-card .ps-btn[type="submit"] {
  background: linear-gradient(135deg, var(--ps-accent) 0%, var(--ps-secondary) 100%);
  border: none; color: #fff; font-weight: 600;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}
.ps-login-card .ps-btn[type="submit"]:hover {
  filter: brightness(1.03);
  border: none;
}

.ps-col-config-list { display: flex; flex-direction: column; gap: 8px; }
.ps-enum-config-list {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1; min-height: 0; overflow: auto;
}
.ps-enum-type-item {
  flex-shrink: 0;
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius);
  padding: 12px 14px; background: #fff;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--ps-shadow-sm);
}
.ps-enum-type-item .ps-action-btns { margin-top: 0; }
.ps-local-col-config {
  display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 8px;
}
.ps-local-col-config .ps-field-hint { flex-shrink: 0; margin: 0; }
.ps-local-col-config .ps-col-config-list {
  flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
}
.ps-local-col-config-foot {
  flex-shrink: 0; padding-top: 12px; margin-top: 4px;
  border-top: 1px solid var(--ps-border);
  display: flex; justify-content: flex-end; gap: 8px;
}
.ps-ext-config-wrap {
  display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 12px;
}
.ps-ext-config-tabs { flex-shrink: 0; }
.ps-ext-config-panel {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.ps-ext-config-panel[hidden] { display: none !important; }
.ps-dialog-viewport-80 .ps-dialog-body > .ps-ext-config-wrap,
.ps-dialog-viewport-90 .ps-dialog-body > .ps-ext-config-wrap {
  flex: 1; min-height: 0;
}
.ps-col-config-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--ps-border);
  border-radius: 8px; background: #fafbfc; cursor: grab;
}
.ps-col-config-item.dragging { opacity: 0.6; }

.ps-style-config-root {
  flex: 1; min-height: 0; overflow: auto; padding-bottom: 24px;
}
.ps-style-section {
  margin-bottom: 20px; padding: 16px 18px;
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius);
  background: var(--ps-card);
}
.ps-style-section-title {
  margin: 0 0 14px; font-size: 15px; font-weight: 600;
}
.ps-style-section-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px 16px;
}
.ps-style-color-row {
  display: flex; align-items: center; gap: 10px;
}
.ps-style-color-picker {
  width: 40px; height: 36px; padding: 2px; border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm); cursor: pointer; flex-shrink: 0;
  background: #fff;
}
.ps-style-color-row .ps-input { flex: 1; min-width: 0; }
.ps-style-logo-row {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
}
.ps-style-logo-preview {
  width: 56px; height: 56px; border-radius: 12px; object-fit: cover;
  border: 1px solid var(--ps-border); background: #fff;
}
.ps-style-bg-type { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 6px; }
.ps-style-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

.ps-embed-root.ps-chat-assistant-root,
body.ps-chat-assistant-embed .ps-embed-root.ps-chat-assistant-root {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: stretch;
  overflow: hidden; height: 100%; width: 100%; padding: 0; gap: 0; box-sizing: border-box;
}
.ps-chat-assistant-root {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: stretch;
  overflow: hidden; height: 100%; width: 100%;
}
.ps-chat-assistant-root--bottom .ps-ca-panels {
  flex: 1 1 auto; min-height: 0; min-width: 0; width: 100%; max-width: 100%;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.ps-chat-assistant-root--bottom .ps-ca-pane-host {
  flex: 1 1 auto; min-height: 0; min-width: 0; width: 100%; position: relative; overflow: hidden;
}
.ps-chat-assistant-root--bottom .ps-ca-pane {
  display: none; flex-direction: column; position: absolute; inset: 0;
  height: 100%; min-height: 0; overflow: hidden; padding: 8px 10px 10px; box-sizing: border-box;
}
.ps-chat-assistant-root--bottom .ps-ca-pane.is-active { display: flex; }
.ps-ca-iframe { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }
.ps-ca-bnav {
  flex-shrink: 0; display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto;
  padding: 8px 10px; border-top: 1px solid var(--ps-border); background: #f6f7f9;
  -webkit-overflow-scrolling: touch;
}
.ps-chat-assistant-root--bottom .ps-ca-bnav {
  position: relative; z-index: 20; width: 100%; box-sizing: border-box;
  touch-action: manipulation;
}
.ps-ca-btab {
  flex: 0 0 auto; min-width: 72px; max-width: 120px; padding: 8px 10px;
  border: 1px solid var(--ps-border); border-radius: 8px; background: #fff;
  cursor: pointer; color: var(--ps-text); font-size: 12px; line-height: 1.3;
}
.ps-ca-btab:hover { border-color: var(--ps-accent); }
.ps-ca-btab.is-active {
  border-color: var(--ps-accent); color: var(--ps-accent); font-weight: 600; background: #fff;
}
.ps-ca-btab.is-locked { border-color: var(--ps-btn-primary-bg, #16a34a); }
.ps-ca-btab-label {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}
.ps-ca-suggest-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ps-ca-suggest-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px;
}
.ps-ca-config-added { list-style: none; margin: 0; padding: 0; }
.ps-ca-config-added li {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 6px;
  border: 1px solid var(--ps-border); border-radius: 8px; background: #fff; cursor: grab;
}
.ps-ca-config-added li.is-locked { cursor: default; opacity: 0.85; background: #f8fafc; }
.ps-ca-config-added li.dragging { opacity: 0.55; }
.ps-ca-config-added .ps-ca-drag { color: var(--ps-muted); font-size: 12px; flex-shrink: 0; }
.ps-ca-config-added .ps-ca-item-label { flex: 1; min-width: 0; font-size: 13px; }
.ps-ca-config-pick-wrap { display: flex; flex-direction: column; gap: 12px; min-height: 0; height: 100%; }
.ps-ca-config-pick-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ps-ca-config-pick-toolbar .ps-input { flex: 1; min-width: 200px; margin: 0; }
.ps-ca-config-pick-body { flex: 1; min-height: 0; overflow: auto; }
.ps-ca-config-pick-section {
  grid-column: 1 / -1; margin: 12px 0 6px; font-size: 12px; font-weight: 600; color: var(--ps-muted);
}
.ps-ca-config-pick-section:first-child { margin-top: 0; }
.ps-ca-config-pick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px;
}
.ps-ca-config-pick-tile {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px;
  min-height: 72px; padding: 10px 8px; border: 1px solid var(--ps-border); border-radius: 8px;
  background: #fff; cursor: pointer; color: var(--ps-text); font-size: 12px; line-height: 1.35;
  text-align: left;
}
.ps-ca-config-pick-tile:hover:not(:disabled) { border-color: var(--ps-accent); }
.ps-ca-config-pick-tile.is-selected {
  border-color: var(--ps-accent); background: #f0fdf4; box-shadow: 0 0 0 1px var(--ps-accent);
}
.ps-ca-config-pick-tile.is-disabled {
  cursor: not-allowed; opacity: 0.65; background: #f8fafc;
}
.ps-ca-config-pick-tile-label {
  flex: 1; word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ps-ca-config-pick-tile-tag { font-size: 11px; color: var(--ps-muted); }
.ps-ca-config-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-height: 420px; align-items: stretch;
}
@media (max-width: 900px) {
  .ps-ca-config-split { grid-template-columns: 1fr; }
}
.ps-ca-config-col-added,
.ps-ca-config-col-preview { min-height: 0; }
.ps-ca-config-preview-outer {
  flex: 1; min-height: 0; display: flex; justify-content: center; align-items: flex-start;
  padding: 4px 0; overflow: auto;
}
.ps-ca-config-preview-device {
  width: 100%; max-width: 100%; aspect-ratio: 9 / 16;
  max-height: min(78vh, 680px); height: auto;
  border: 2px solid var(--ps-border); border-radius: 18px; overflow: hidden;
  background: #fff; box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
  display: flex; flex-direction: column; box-sizing: border-box;
}
.ps-ca-config-preview-root {
  flex: 1; min-height: 0; height: 100%; width: 100%; display: flex; flex-direction: column;
  font-size: 11px; box-sizing: border-box;
}
.ps-ca-config-preview-root .ps-ca-panels {
  flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column;
}
.ps-ca-config-preview-root .ps-ca-pane-host { flex: 1; min-height: 0; position: relative; width: 100%; }
.ps-ca-config-preview-pane {
  position: absolute; inset: 0; padding: 10px 10px 8px; overflow: auto;
  display: flex; flex-direction: column; gap: 6px; box-sizing: border-box; background: #fff;
}
.ps-ca-config-preview-title { font-size: 12px; font-weight: 600; color: var(--ps-text); }
.ps-ca-config-preview-hint { margin: 0; font-size: 11px; line-height: 1.45; color: var(--ps-muted); }
.ps-ca-config-preview-root .ps-ca-bnav { padding: 6px 8px; gap: 4px; }
.ps-ca-config-preview-root .ps-ca-btab {
  min-width: 52px; max-width: 88px; padding: 6px 6px; font-size: 10px; border-radius: 6px;
}
.ps-ca-vtabs {
  flex-shrink: 0; width: 40px; display: flex; flex-direction: column; gap: 4px;
  padding: 6px 4px; border-right: 1px solid var(--ps-border); background: #f6f7f9;
}
.ps-ca-vtab {
  flex: 0 0 auto; min-height: 72px; padding: 8px 4px; border: 1px solid transparent;
  border-radius: 6px; background: transparent; cursor: pointer; color: var(--ps-text);
  display: flex; align-items: center; justify-content: center;
}
.ps-ca-vtab:hover { background: #fff; border-color: var(--ps-border); }
.ps-ca-vtab.is-active {
  background: #fff; border-color: var(--ps-accent); color: var(--ps-accent); font-weight: 600;
}
.ps-ca-vtab-text {
  writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 2px; font-size: 13px; line-height: 1.2;
}
.ps-ca-panels {
  flex: 1 1 auto; min-width: 0; min-height: 0; width: 0; position: relative;
  display: flex; flex-direction: column; overflow: hidden;
}
.ps-ca-pane {
  display: none; flex-direction: column; height: 100%; min-height: 0; overflow: hidden;
  padding: 8px 10px 10px;
}
.ps-ca-pane.is-active { display: flex; }
.ps-ca-pane-head { flex-shrink: 0; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.ps-ca-pane-foot { flex-shrink: 0; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ps-ca-pane-scroll { flex: 1; min-height: 0; overflow: auto; }
.ps-ca-status { font-size: 12px; color: var(--ps-muted); }
.ps-ca-error { color: #b91c1c; font-size: 13px; margin: 0 0 8px; }
.ps-ca-debug .ps-input-sm { flex: 1; min-width: 100px; font-size: 12px; }
.ps-chat-assistant-card {
  padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm); background: var(--ps-card); font-size: 13px; line-height: 1.5;
}
.ps-ca-mini-list { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }
.ps-ca-radar-item {
  padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--ps-border); border-radius: 8px;
  background: #fafbfc; font-size: 13px;
}
.ps-ca-radar-meta { font-size: 11px; color: var(--ps-muted); margin-bottom: 4px; }
.ps-ca-suggest-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ps-ca-suggest-text {
  width: 100%; margin: 0; padding: 10px; white-space: pre-wrap; word-break: break-word;
  border: 1px solid var(--ps-border); border-radius: 8px; background: #fff; font-size: 13px;
  font-family: inherit; line-height: 1.5;
}
.ps-ca-sop-head {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ps-ca-sop-head .ps-ca-sop-link {
  text-decoration: none;
}
.ps-ca-sop-toolbar {
  margin: 0 0 10px;
}
.ps-ca-sop-table {
  width: 100%;
  font-size: 12px;
}
.ps-ca-sop-table th,
.ps-ca-sop-table td {
  padding: 6px 8px;
  vertical-align: middle;
}
.ps-ca-sop-form .ps-field-label {
  display: block;
  margin: 8px 0 4px;
}
.ps-ca-agent-host {
  flex: 1; min-height: 0; overflow: hidden; border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm); background: var(--ps-card);
}
.ps-ca-agent-host .ps-agent-page { height: 100%; min-height: 0; }
.ps-ca-agent-host .ps-agent-sidebar { display: none; }
.ps-ca-agent-host .ps-agent-layout { display: flex; height: 100%; min-height: 0; }
.ps-ca-agent-host .ps-agent-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ps-ca-agent-host .ps-agent-messages { flex: 1; min-height: 0; overflow: auto; }
body.ps-chat-assistant-embed .ps-embed-root { padding: 0; }
body.ps-chat-assistant-embed .ps-main-content,
body.ps-chat-assistant-embed #ps-main-content { padding: 0; min-height: 0; }
body.ps-chat-assistant-embed .ps-sidenav,
body.ps-chat-assistant-embed .ps-app > .ps-sidenav,
.ps-chat-assistant-root .ps-ca-vtabs { display: none !important; }
html.ps-chat-assistant-page,
html.ps-chat-assistant-page body.ps-chat-assistant-embed {
  height: 100%; margin: 0;
}
body.ps-chat-assistant-embed.ps-embed-page {
  min-height: 100vh; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
}
body.ps-chat-assistant-embed.ps-embed-page .ps-embed-root {
  flex: 1; min-height: 0; min-width: 0; width: 100%;
  min-height: 100vh; min-height: 100dvh;
}

.sop-type-tabs {
  display: flex; gap: 0; flex-wrap: wrap; border: 1px solid var(--ps-border); border-radius: 10px; overflow: hidden;
  background: #f1f5f9; margin-top: 6px;
}
.sop-type-tab {
  flex: 1; min-width: 64px; padding: 10px 10px; border: none; border-right: 1px solid var(--ps-border);
  background: transparent; font-size: 13px; color: var(--ps-muted); cursor: pointer;
}
.sop-type-tab:last-child { border-right: none; }
.sop-type-tab:hover { background: #e2e8f0; color: var(--ps-text); }
.sop-type-tab.is-active {
  background: #fff; color: var(--ps-text); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--ps-btn-primary-bg, #16a34a);
}

.sop-ref-node-pick {
  display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto;
  margin-top: 8px; padding: 4px; border: 1px solid var(--ps-border); border-radius: 8px;
  background: #f8fafc;
}
.sop-ref-node-option {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 1px solid transparent; border-radius: 8px; background: #fff; cursor: pointer;
  text-align: left; font-size: 13px; color: var(--ps-text);
}
.sop-ref-node-option:hover { border-color: #cbd5e1; background: #f1f5f9; }
.sop-ref-node-option.is-selected {
  border-color: #2563eb; background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}
.sop-ref-node-kind {
  flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--ps-muted); min-width: 48px;
}
.sop-ref-node-name { flex: 1; min-width: 0; word-break: break-word; }

.sop-interval-field .sop-interval-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 6px;
}
.sop-interval-cell {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 0;
}
.sop-interval-cell .sop-interval-input {
  width: 56px; min-width: 48px; padding-left: 8px; padding-right: 8px; text-align: right;
}
.sop-interval-suffix {
  font-size: 13px; color: var(--ps-muted); flex-shrink: 0;
}
.sop-interval-field .ps-field-hint { display: block; margin-top: 6px; }

.ps-sop-plan-section {
  margin-top: 12px; padding: 14px 16px 12px;
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  background: var(--ps-bg, #fafbff);
}
.ps-sop-plan-section-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.ps-sop-plan-section-hint { margin: 0 0 10px; font-size: 12px; line-height: 1.45; color: var(--ps-muted); }
.ps-sop-plan-section-body { margin-top: 4px; }
.ps-sop-plan-section-body .ps-sop-node-actions-mount { margin-top: 0; }
.ps-sop-node-edit-form > .ps-field { margin-bottom: 14px; }
.ps-sop-node-edit-form .ps-sop-plan-section .ps-field { margin-bottom: 12px; }
.ps-sop-node-edit-form .ps-sop-plan-section .ps-field:last-child { margin-bottom: 0; }
.ps-sop-node-basic {
  padding: 14px 16px 12px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: var(--ps-card, #fff);
}
.ps-sop-node-basic-head { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.ps-sop-node-basic-hint { margin: 0 0 12px; font-size: 12px; line-height: 1.45; }
.ps-sop-node-basic-field { margin-bottom: 12px; }
.ps-sop-node-basic-field:last-child { margin-bottom: 0; }
.ps-sop-node-basic-field > label { margin-bottom: 6px; font-weight: 500; font-size: 13px; display: block; }
.ps-sop-node-basic-field .ps-input { font-size: 14px; width: 100%; }
.ps-sop-node-basic-field textarea.ps-input { min-height: 72px; line-height: 1.45; resize: vertical; }
.ps-sop-act-single-root .ps-sop-act-single-type { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ps-sop-act-single-root .ps-sop-act-single-type label { margin: 0; font-weight: 500; font-size: 13px; flex-shrink: 0; }
.ps-sop-act-single-root .ps-sop-act-single-type-mount {
  flex: 1 1 180px; max-width: 260px; min-width: 160px;
}
.ps-sop-act-dialog-type-mount { max-width: 280px; }
.ps-sop-manual-form { display: flex; flex-direction: column; gap: 10px; }
.ps-sop-manual-hint { margin: 0; font-size: 12px; line-height: 1.45; }
.ps-sop-manual-field > label { margin: 0 0 6px; font-weight: 500; font-size: 13px; display: block; }
.ps-sop-manual-field .ps-input { width: 100%; max-width: none; }
.ps-sop-manual-assign { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.ps-sop-manual-assign-mode-mount { flex: 0 0 156px; min-width: 140px; }
.ps-sop-manual-assign-pick { flex: 1 1 200px; min-width: 0; }
.ps-sop-act-params--tool,
.ps-sop-act-fields--stack { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ps-sop-act-params--tool .ps-sop-act-field,
.ps-sop-act-fields--stack .ps-sop-act-field {
  flex-direction: column; align-items: stretch; gap: 6px;
  padding: 10px 12px; margin: 0;
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  background: var(--ps-card, #fff);
}
.ps-sop-act-params--tool .ps-sop-act-field-lbl,
.ps-sop-act-fields--stack .ps-sop-act-field-lbl {
  max-width: none; font-size: 13px; font-weight: 500;
}
.ps-sop-act-params--tool .ps-sop-act-var,
.ps-sop-act-params--tool .ps-sop-act-lit,
.ps-sop-act-fields--stack .ps-sop-act-var,
.ps-sop-act-fields--stack .ps-sop-act-lit {
  width: 100%; max-width: none;
}
.ps-sop-act-params--tool .ps-sop-act-lit.is-visible,
.ps-sop-act-fields--stack .ps-sop-act-lit.is-visible { display: block; width: 100%; margin-top: 4px; }
.ps-sop-act-field--stacked { flex-direction: column; align-items: stretch; gap: 8px; }
.ps-sop-act-field--stacked .ps-sop-act-field-lbl {
  max-width: none; white-space: normal; overflow: visible; text-overflow: unset;
}
.ps-sop-act-field--stacked .ps-sop-act-var-mount,
.ps-sop-act-field--stacked .ps-sop-act-mode-mount,
.ps-sop-act-field--stacked .ps-select { width: 100%; max-width: none; flex: 0 0 auto; }
.ps-sop-act-field--stacked .ps-select-trigger {
  width: 100%; max-width: none; justify-content: space-between;
  min-height: 34px; height: 34px; padding: 0 10px; font-size: 13px;
}
.ps-sop-act-field--stacked .ps-sop-act-lit-wrap { width: 100%; margin-top: 4px; }
.ps-sop-act-field--stacked .ps-sop-act-lit-wrap[hidden] { display: none !important; }
.ps-sop-act-field--stacked .ps-sop-act-lit-wrap:not([hidden]) .ps-sop-act-lit {
  display: block; width: 100%;
}
.ps-sop-act-field--stacked input.ps-input.ps-sop-act-lit {
  height: 34px; min-height: 34px; line-height: 32px; padding: 0 10px;
}
.ps-sop-act-field--stacked textarea.ps-input.ps-sop-act-lit-multiline {
  min-height: 72px; height: auto; padding: 8px 10px; line-height: 1.45; resize: vertical;
}
.ps-sop-act-fields--stack .ps-sop-act-field select.ps-input.ps-sop-act-var,
.ps-sop-act-fields--stack .ps-sop-act-field select.ps-input.ps-sop-act-mode {
  height: 34px; min-height: 34px; max-height: 36px; flex: 0 0 auto;
}
.ps-sop-deadline-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
}
.ps-sop-deadline-cell {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
}
.ps-sop-deadline-row input.ps-input.ps-sop-deadline-part {
  flex: 0 0 80px;
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  text-align: center;
  font-size: 14px;
  min-height: 34px;
  height: 34px;
  line-height: 32px;
  padding: 0 6px;
  box-sizing: border-box;
}
.ps-sop-deadline-unit {
  font-size: 14px;
  color: var(--ps-muted);
  flex-shrink: 0;
}
.ps-sop-instance-viewer { min-height: 120px; max-height: 65vh; overflow: auto; }
.ps-sop-timeline-head { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.ps-sop-timeline-head-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.ps-sop-timeline-head-actions { flex-shrink: 0; }
.ps-sop-timeline {
  list-style: none; margin: 0; padding: 0 0 0 8px;
  border-left: 2px solid var(--ps-border);
}
.ps-sop-timeline-item {
  position: relative; margin: 0 0 16px 0; padding: 0 0 0 14px;
}
.ps-sop-timeline-item::before {
  content: ''; position: absolute; left: -7px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ps-border); border: 2px solid var(--ps-card-bg, #fff);
}
.ps-sop-timeline-item--history::before { background: var(--ps-muted, #8b929e); }
.ps-sop-timeline-item--trigger-done::before { background: var(--ps-muted, #8b929e); }
.ps-sop-timeline-item--trigger-done .ps-sop-timeline-title { color: var(--ps-text-2, #4e5661); font-weight: 500; }
.ps-sop-timeline-item--current::before { background: var(--ps-primary, #3b6ef6); }
.ps-sop-timeline-item--next::before,
.ps-sop-timeline-item--preview::before { background: transparent; border-style: dashed; }
.ps-sop-timeline-time { font-size: 12px; color: var(--ps-muted); margin-bottom: 4px; }
.ps-sop-timeline-title { font-weight: 600; line-height: 1.45; }
.ps-sop-timeline-detail { font-size: 13px; color: var(--ps-text-2, #4e5661); margin-top: 4px; line-height: 1.5; }
.ps-sop-timeline-deadline { font-size: 12px; color: var(--ps-muted); margin-top: 6px; }
.ps-sop-timeline-overdue { font-size: 13px; color: #c62828; font-weight: 600; margin-top: 6px; }
.ps-sop-list-overdue { color: #c62828; }
.ps-sop-timeline-kicker { font-size: 12px; color: var(--ps-muted); margin-bottom: 4px; }
.ps-sop-timeline-title--current { font-weight: 600; color: var(--ps-text, #1a1d21); }
.ps-sop-timeline-title--next,
.ps-sop-timeline-item--next .ps-sop-timeline-title,
.ps-sop-timeline-item--preview .ps-sop-timeline-title {
  font-weight: 600;
  color: var(--ps-primary, #3b6ef6);
}
.ps-sop-timeline-active-block { padding-bottom: 8px; }
.ps-sop-timeline-active-block::before { background: var(--ps-primary, #3b6ef6); }
.ps-sop-timeline-active-current {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: var(--ps-radius-sm);
  background: color-mix(in srgb, var(--ps-primary, #3b6ef6) 6%, transparent);
  border: 1px dashed color-mix(in srgb, var(--ps-primary, #3b6ef6) 35%, var(--ps-border));
}
.ps-sop-timeline-current-row {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; flex-wrap: wrap;
}
.ps-sop-timeline-active-current .ps-sop-timeline-kicker { margin-bottom: 6px; }
.ps-sop-timeline-active-current .ps-sop-timeline-complete { flex-shrink: 0; }
.ps-sop-timeline-head-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ps-sop-flow-editor--readonly .ps-sop-canvas-node-tools,
.ps-sop-flow-editor--readonly .ps-sop-canvas-arm-tools { display: none !important; }
.ps-sop-canvas-node--current .ps-sop-canvas-node-drag {
  box-shadow: 0 0 0 2px var(--ps-primary, #3b6ef6);
  border-radius: var(--ps-radius-sm);
}
.ps-hub-sop-flow-foot { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--ps-border); }
.ps-sop-act-single-root .ps-sop-act-type-panel { margin-top: 4px; }
.ps-sop-trigger-rule-block { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ps-border); }
.ps-sop-trigger-rule-title { font-weight: 600; margin-bottom: 4px; }
.ps-sop-trigger-rule-hint { margin: 0 0 8px; font-size: 12px; color: var(--ps-muted, #666); }
.ps-sop-trigger-rule-mount { margin-top: 4px; }
.ps-sop-node-actions-mount { margin-top: 8px; }
.ps-sop-act-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ps-sop-act-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  background: var(--ps-card-bg, #fff);
}
.ps-sop-act-row-title { font-size: 13px; flex: 1; min-width: 0; }
.ps-sop-act-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ps-sop-act-params,
.ps-sop-act-code-params,
.ps-sop-act-todo-fields { display: flex; flex-direction: column; gap: 4px; }
.ps-sop-act-form .ps-field > label { margin-bottom: 4px; }
.ps-sop-act-field {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 6px 8px;
  margin: 0; min-width: 0; width: 100%;
}
.ps-sop-act-field-lbl {
  flex: 0 0 auto; max-width: 6.5em; margin: 0;
  font-size: 12px; font-weight: 500; color: var(--ps-label);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ps-sop-act-field .ps-sop-act-var,
.ps-sop-act-field .ps-sop-act-mode {
  flex: 0 1 148px; width: auto; min-width: 108px; max-width: 168px;
  font-size: 13px; min-height: 30px; height: 30px; line-height: 28px; padding: 0 8px;
}
.ps-sop-act-lit {
  display: none; flex: 1 1 auto; width: auto; min-width: 64px;
  min-height: 30px; height: 30px; line-height: 28px; padding: 0 8px; font-size: 13px;
}
.ps-sop-act-lit.is-visible { display: block; }
.ps-sop-act-field textarea.ps-sop-act-lit.is-visible {
  height: 30px; min-height: 30px; line-height: 1.3; padding: 4px 8px; resize: none;
}
.ps-sop-rule-group {
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  padding: 6px 8px; margin: 4px 0; background: var(--ps-card-bg, #fff);
  font-size: 12px;
}
.ps-sop-rule-group.is-root { border-color: #93c5fd; background: #f8fafc; }
.ps-sop-rule-group-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 4px;
}
.ps-sop-rule-badge { font-size: 11px; font-weight: 600; color: var(--ps-muted); }
.ps-sop-rule-logic { max-width: 72px; min-height: 24px; padding: 1px 4px; font-size: 11px; }
.ps-sop-rule-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.ps-sop-rule-actions .ps-btn-sm { padding: 2px 6px; font-size: 11px; min-height: 24px; }
.ps-sop-rule-children { padding-left: 6px; border-left: 2px solid #e2e8f0; }
.ps-sop-rule-cond {
  border: 1px dashed var(--ps-border); border-radius: var(--ps-radius-sm);
  padding: 4px 6px; margin: 4px 0; background: #fff;
}
.ps-sop-rule-cond-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  line-height: 1.25;
}
.ps-sop-rule-inline-lbl {
  font-size: 11px; color: var(--ps-muted, #666); flex-shrink: 0;
}
.ps-sop-rule-cond-row .ps-input,
.ps-sop-rule-cond-row select.ps-input {
  font-size: 11px; min-height: 24px; padding: 2px 4px; max-width: 168px;
}
.ps-sop-rule-group-head .ps-sop-rule-logic.ps-select,
.ps-sop-rule-group-head .ps-sop-rule-sel-mount.ps-sop-rule-logic {
  flex: 0 0 auto; width: 88px; max-width: 96px;
}
.ps-sop-rule-cond-row .ps-sop-rule-left.ps-select,
.ps-sop-rule-cond-row .ps-sop-rule-sel-mount.ps-sop-rule-left {
  flex: 0 1 168px; width: auto; min-width: 108px; max-width: 180px;
}
.ps-sop-rule-cond-row .ps-sop-rule-op.ps-select,
.ps-sop-rule-cond-row .ps-sop-rule-sel-mount.ps-sop-rule-op {
  flex: 0 1 128px; width: auto; min-width: 96px; max-width: 148px;
}
.ps-sop-rule-cond-row .ps-sop-rule-right-var.ps-select,
.ps-sop-rule-cond-row .ps-sop-rule-sel-mount.ps-sop-rule-right-var,
.ps-sop-rule-right-wrap .ps-sop-rule-right-var.ps-select {
  flex: 0 1 148px; width: auto; min-width: 108px; max-width: 168px;
}
.ps-sop-rule-cond-row .ps-select,
.ps-sop-rule-group-head .ps-sop-rule-logic.ps-select {
  width: auto; min-width: 0; max-width: none;
}
.ps-sop-rule-cond-row .ps-select .ps-select-trigger,
.ps-sop-rule-group-head .ps-sop-rule-logic .ps-select-trigger {
  width: 100%; max-width: 100%;
  font-size: 11px; height: 28px; min-height: 28px; line-height: 26px;
  padding: 0 28px 0 6px; background-position: right 8px center;
}
.ps-sop-rule-right-wrap {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px;
  flex: 1 1 120px; min-width: 0;
}
.ps-sop-rule-right-lit { display: none; width: 11em; max-width: 100%; margin: 0; }
.ps-sop-rule-right-lit.is-visible { display: inline-block; }
.ps-sop-rule-duration-row {
  display: inline-flex; flex-wrap: wrap; gap: 2px 4px; align-items: center;
}
.ps-sop-rule-duration-cell { display: inline-flex; align-items: center; gap: 1px; }
.ps-sop-rule-duration-cell .ps-input { width: 2.35em; min-width: 0; text-align: center; padding: 1px 2px; font-size: 11px; min-height: 22px; }
.ps-sop-rule-duration-suffix { font-size: 10px; color: var(--ps-muted, #666); }
.ps-sop-rule-del-inline { flex-shrink: 0; margin-left: auto; padding: 2px 6px; font-size: 11px; min-height: 24px; }
.ps-sop-rule-empty { font-size: 11px; color: var(--ps-muted); padding: 4px 2px; }

.ps-dialog-head h3 { flex: 1; min-width: 0; }
.ps-dialog-head-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ps-sop-design-ai-busy .ps-dialog-close:disabled { opacity: 0.4; cursor: not-allowed; }
.ps-sop-ai-progress {
  flex-shrink: 0;
  border: 1px solid var(--ps-border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  margin-bottom: 8px;
  max-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.ps-sop-ai-progress-head { font-size: 13px; font-weight: 600; color: var(--ps-text); }
.ps-sop-ai-progress-log {
  margin: 0;
  flex: 1;
  min-height: 48px;
  max-height: 120px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.ps-sop-flow-editor { display: flex; flex-direction: column; min-height: 0; height: 100%; gap: 8px; }
.ps-sop-flow-template-bar {
  flex-shrink: 0;
  padding: 12px 14px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: #fff;
}
.ps-sop-flow-template-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
}
.ps-sop-flow-template-field { min-width: 200px; flex: 1 1 220px; margin: 0; }
.ps-sop-flow-template-rule { margin: 10px 0 0; }
.ps-sop-canvas-viewport {
  flex: 1; min-height: 280px; overflow: auto; cursor: grab;
  border: 1px solid var(--ps-border); border-radius: var(--ps-radius-sm);
  background-color: #f1f5f9;
  background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
}
.ps-sop-canvas-viewport:active { cursor: grabbing; }
.ps-sop-canvas-stage { position: relative; min-width: 100%; min-height: 100%; }
.ps-sop-canvas-svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; overflow: visible; }
.ps-sop-canvas-svg-handles {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 5; overflow: visible;
  touch-action: none;
}
.ps-sop-edge { stroke: #475569; stroke-width: 2; stroke-linejoin: round; }
.ps-sop-edge--straight { stroke-linejoin: miter; }
.ps-sop-edge--curve { stroke-linecap: round; }
.ps-sop-edge--ref-jump { stroke: #2563eb; stroke-dasharray: 6 5; opacity: 0.9; }
.ps-sop-edge-handle {
  pointer-events: all; cursor: grab; fill: #fff; stroke: #64748b; stroke-width: 2;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.12));
  touch-action: none;
}
.ps-sop-edge-handle:hover { stroke: #2563eb; fill: #eff6ff; }
.ps-sop-edge-handle:active { cursor: grabbing; stroke: #2563eb; }
.ps-sop-edge-handle--source { stroke: #2563eb; stroke-width: 2.5; fill: #fff; cursor: grab; }
.ps-sop-edge-handle--source:hover { fill: #dbeafe; }
.ps-sop-edge-handle--curve { r: 7; opacity: 0.85; }
.ps-sop-canvas-viewport.ps-sop-reparent-dragging { cursor: grabbing; }
.ps-sop-canvas-item.is-sop-reparent-target .ps-sop-canvas-node,
.ps-sop-canvas-item.is-sop-reparent-target .ps-sop-canvas-arm {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
  border-color: #2563eb;
}
.ps-sop-edge-label { font-size: 11px; fill: #b45309; text-anchor: middle; font-weight: 600; }
.ps-sop-edge-label--orth { paint-order: stroke fill; stroke: #f1f5f9; stroke-width: 3px; }
.ps-sop-canvas-nodes { position: absolute; left: 0; top: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
.ps-sop-canvas-item { position: absolute; pointer-events: auto; }
.ps-sop-canvas-node, .ps-sop-canvas-arm {
  background: #fff; border: 1px solid #cbd5e1; border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07); padding: 0; box-sizing: border-box; overflow: hidden;
}
.ps-sop-canvas-node-drag { padding: 10px 12px 8px; }
.ps-sop-canvas-node--start { border-color: #059669; box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15); }
.ps-sop-canvas-node-drag--fixed { cursor: default; }
.ps-sop-canvas-node--start .ps-sop-canvas-node-sub { display: none; }
.ps-sop-canvas-node--gate {
  border-color: #ea580c;
  background: #fff7ed;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.12);
}
.ps-sop-canvas-node--gate .ps-sop-canvas-node-type { color: #c2410c; font-weight: 600; }
.ps-sop-canvas-node--gate .ps-sop-canvas-node-title { color: #9a3412; font-weight: 700; }
.ps-sop-canvas-node--branch {
  border-color: #ea580c;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.14), 0 4px 14px rgba(15, 23, 42, 0.07);
}
.ps-sop-canvas-node--branch .ps-sop-canvas-node-tools {
  border-top-color: #fdba74; background: rgba(255, 237, 213, 0.65);
}
.ps-sop-canvas-node--branch .ps-sop-canvas-node-type { color: #c2410c; font-weight: 600; }
.ps-sop-canvas-node--branch .ps-sop-canvas-node-title { color: #9a3412; font-weight: 700; }
.ps-sop-canvas-node--end { border-color: #64748b; background: #f8fafc; }
.ps-sop-canvas-node--ref {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12), 0 4px 14px rgba(15, 23, 42, 0.06);
}
.ps-sop-canvas-node--ref .ps-sop-canvas-node-type { color: #1d4ed8; font-weight: 600; }
.ps-sop-canvas-node--ref .ps-sop-canvas-node-title { color: #1e3a8a; font-weight: 600; }
.ps-sop-canvas-node--ref .ps-sop-canvas-node-tools {
  border-top-color: #93c5fd; background: rgba(219, 234, 254, 0.55);
}
.ps-sop-canvas-node-drag { cursor: move; user-select: none; }
.ps-sop-canvas-node-type { font-size: 10px; color: var(--ps-muted); display: block; margin-bottom: 2px; }
.ps-sop-canvas-node-title { font-size: 13px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.ps-sop-canvas-node-sub { font-size: 11px; color: var(--ps-muted); margin-top: 4px; line-height: 1.35; }
.ps-sop-canvas-node-tools {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; justify-content: flex-end;
  border-top: 1px solid #e2e8f0; background: #f8fafc;
}
.ps-sop-icon-btn {
  box-sizing: border-box; min-width: 32px; width: 32px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; line-height: 0;
}
.ps-sop-icon-btn .ps-sop-ico { width: 18px; height: 18px; display: block; flex-shrink: 0; }
.ps-sop-icon-btn--primary {
  background: var(--ps-btn-primary-bg, #16a34a); color: var(--ps-btn-primary-color, #fff);
  border-color: transparent;
}
.ps-sop-icon-btn--primary:hover {
  background: var(--ps-btn-primary-hover-bg, #15803d); color: var(--ps-btn-primary-color, #fff);
}
.ps-sop-icon-btn--danger {
  background: var(--ps-btn-danger-bg, #dc2626); color: var(--ps-btn-danger-color, #fff);
  border-color: transparent;
}
.ps-sop-icon-btn--danger:hover {
  background: var(--ps-btn-danger-hover-bg, #b91c1c); color: var(--ps-btn-danger-color, #fff);
}
.ps-sop-canvas-arm--card {
  display: flex; flex-direction: column; align-items: stretch;
  padding: 0; min-height: 52px; overflow: hidden;
  border: 1px solid #94a3b8; border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.ps-sop-canvas-arm-body {
  padding: 8px 10px 6px; cursor: move; user-select: none;
  border-bottom: 1px solid #e2e8f0;
}
.ps-sop-canvas-arm-kicker {
  font-size: 10px; color: var(--ps-muted); text-transform: none; letter-spacing: 0;
  display: block; margin-bottom: 4px;
}
.ps-sop-canvas-arm-title {
  font-size: 12px; font-weight: 600; color: var(--ps-text); line-height: 1.35;
  word-break: break-word;
}
.ps-sop-canvas-arm-hint {
  font-size: 10px; color: var(--ps-muted); margin-top: 4px; line-height: 1.25;
}
.ps-sop-canvas-arm-tools {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; justify-content: center;
  background: #fff;
}

.ps-entry-qr-cell {
  display: inline-flex; align-items: center;
}
.ps-entry-qr-thumb {
  object-fit: contain; border: 1px solid var(--ps-border); border-radius: 4px;
  background: #fff; cursor: pointer; display: block;
}
.ps-entry-qr-preview {
  position: fixed; z-index: 12000; padding: 12px; background: #fff;
  border: 1px solid var(--ps-border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-width: 200px;
}
.ps-entry-qr-preview[hidden] {
  display: none !important;
}
.ps-entry-qr-preview img {
  display: block; width: 200px; height: 200px; object-fit: contain;
}
.ps-entry-qr-preview-actions {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
}
.ps-entry-hub-basic {
  display: flex; flex-direction: column; gap: 20px;
}
.ps-entry-hub-qr-block {
  padding: 12px 14px; border: 1px solid var(--ps-border); border-radius: 8px; background: #fafbfc;
  max-width: 360px;
}
.ps-entry-hub-qr-title {
  font-size: 13px; font-weight: 600; margin-bottom: 8px;
}
.ps-entry-hub-qr-inner {
  display: flex; justify-content: flex-start;
}
.ps-entry-qr-thumb--hub {
  width: 120px; height: 120px;
}
.ps-entry-qr-dialog {
  display: flex; flex-direction: column; align-items: center;
}
.ps-entry-qr-dialog-img-wrap {
  padding: 12px; border: 1px solid var(--ps-border); border-radius: 8px; background: #fff;
}
.ps-entry-qr-dialog-img {
  display: block; width: 240px; height: 240px; object-fit: contain;
}
.ps-entry-qr-dialog-foot {
  width: 100%;
}
.ps-list-table tbody td:has(.ps-entry-qr-cell),
.ps-block-kv-val:has(.ps-entry-qr-cell) {
  overflow: visible;
}
.ps-entry-link-actions {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap;
}
.ps-list-table tbody td:has(.ps-entry-link-actions) {
  overflow: visible;
}
.ps-list-table tbody td:has(.ps-entry-link-actions) .ps-cell-inner {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  max-height: none;
}

.ps-mat-layout {
  display: flex;
  gap: 12px;
  align-items: stretch;
  min-height: 0;
  flex: 1;
}
.ps-mat-tree-panel {
  flex: 0 0 220px;
  max-width: 280px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ps-border);
  border-radius: 10px;
  background: var(--ps-surface, #fff);
  overflow: hidden;
}
.ps-mat-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ps-border);
  font-size: 13px;
  font-weight: 600;
}
.ps-mat-tree-scroll {
  flex: 1;
  min-height: 120px;
  overflow: auto;
  padding: 8px 6px;
}
.ps-mat-tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.ps-mat-tree-node:hover {
  background: var(--ps-row-hover, rgba(15, 23, 42, 0.04));
}
.ps-mat-tree-node.active {
  background: var(--ps-primary-soft, rgba(37, 99, 235, 0.1));
  color: var(--ps-primary, #2563eb);
}
.ps-mat-tree-node.drag-over {
  outline: 1px dashed var(--ps-primary, #2563eb);
}
.ps-mat-tree-node .ps-mat-tree-toggle {
  width: 16px;
  flex: 0 0 16px;
  text-align: center;
  color: var(--ps-muted, #64748b);
  font-size: 11px;
}
.ps-mat-tree-node .ps-mat-tree-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-mat-tree-node .ps-mat-tree-actions {
  display: none;
  gap: 2px;
}
.ps-mat-tree-node:hover .ps-mat-tree-actions {
  display: inline-flex;
}
.ps-mat-main-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ps-mat-cover-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--ps-border);
  background: #f8fafc;
  vertical-align: middle;
}
.ps-mat-cover-empty {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px dashed var(--ps-border);
  font-size: 11px;
  color: var(--ps-muted, #64748b);
}
.ps-mat-list-row[draggable="true"] {
  cursor: grab;
}
.ps-mat-list-row.dragging {
  opacity: 0.45;
}

/* 台账 AI 工具栏按钮与右侧抽屉 */
.ps-ledger-ai-toolbar-slot {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}
.ps-th-inner-with-ledger-ai {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}
.ps-th-inner-with-ledger-ai .ps-col-resizer {
  margin-left: auto;
}
.ps-ledger-ai-head-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ps-ledger-ai-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border: 1px solid color-mix(in srgb, var(--ps-primary, #2563eb) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ps-primary, #2563eb) 12%, #fff);
  color: var(--ps-primary, #2563eb);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}
.ps-ledger-ai-fab:hover {
  background: color-mix(in srgb, var(--ps-primary, #2563eb) 18%, #fff);
}
.ps-ledger-ai-fab-ring {
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ps-primary, #2563eb) 40%, transparent);
  animation: ps-ledger-ai-breathe 2.4s ease-in-out infinite;
  pointer-events: none;
}
.ps-ledger-ai-fab-core {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@keyframes ps-ledger-ai-breathe {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 1; }
}
.ps-ledger-ai-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
}
.ps-ledger-ai-root.open {
  pointer-events: auto;
}
.ps-ledger-ai-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ps-ledger-ai-root.open .ps-ledger-ai-backdrop {
  opacity: 1;
}
.ps-ledger-ai-drawer {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  background: var(--ps-bg, #fff);
  border-left: 1px solid var(--ps-border, #e2e8f0);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.ps-ledger-ai-root.open .ps-ledger-ai-drawer {
  transform: translateX(0);
}
.ps-ledger-ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ps-border, #e2e8f0);
  flex-shrink: 0;
}
.ps-ledger-ai-head-title {
  font-weight: 600;
}
.ps-ledger-ai-head-sub {
  flex: 1;
  font-size: 12px;
  color: var(--ps-muted, #64748b);
}
/* 单轮推理：在用户气泡下方、助手正文上方 */
.ps-ledger-ai-turn-process {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ps-muted, #64748b);
  padding: 0 0 8px;
  margin: 0 0 8px;
  border-bottom: 1px dashed color-mix(in srgb, var(--ps-border, #e2e8f0) 90%, transparent);
  white-space: pre-wrap;
  max-height: 160px;
  overflow: auto;
}
.ps-ledger-ai-turn-process[hidden] {
  display: none !important;
}
.ps-ledger-ai-live-answer:empty {
  display: none;
}
.ps-ledger-ai-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ps-ledger-ai-msg {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 100%;
  word-break: break-word;
}
.ps-ledger-ai-msg-user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--ps-primary, #2563eb) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--ps-primary, #2563eb) 25%, transparent);
}
.ps-ledger-ai-msg-assistant {
  align-self: flex-start;
  background: #f1f5f9;
  border: 1px solid var(--ps-border, #e2e8f0);
}
.ps-ledger-ai-foot {
  flex-shrink: 0;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--ps-border, #e2e8f0);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-ledger-ai-foot-busy .ps-ledger-ai-send {
  opacity: 0.75;
  cursor: wait;
}
.ps-ledger-ai-input {
  width: 100%;
  resize: vertical;
  min-height: 56px;
}
.ps-ledger-ai-foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ps-ledger-ai-inline-wrap {
  display: inline-flex;
  margin-left: 8px;
}
