:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #667085;
  --line: #d9e2ec;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #1d4ed8;
  --nav-purple: #7c3aed;
  --nav-purple-soft: #f1e7ff;
  --warn: #b45309;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.auth-pending #app {
  visibility: hidden;
}

.auth-loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  color: #667085;
  background: var(--bg);
  font-size: 15px;
}

body.auth-pending .auth-loading {
  display: flex;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.96);
}

button.ghost {
  background: #eef4f6;
  color: var(--ink);
}

.app {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-columns: 244px 1fr;
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

.app.auth-guest {
  grid-template-columns: 1fr;
}

.app.auth-guest .sidebar {
  display: none;
}

.app.sidebar-collapsed {
  grid-template-columns: 78px 1fr;
}

.sidebar {
  position: relative;
  background: var(--panel);
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar > nav {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.sidebar > .brand,
.sidebar > .user-box {
  flex: 0 0 auto;
}

.brand {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px 0 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.brand strong {
  color: var(--nav-purple);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-short {
  display: none;
}

.collapse-btn {
  margin-left: auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f3f4f6;
  color: #111827;
  font-size: 14px;
  line-height: 1;
  z-index: 5;
  box-shadow: none;
}

.collapse-btn:hover {
  background: #eef2ff;
  color: var(--nav-purple);
  filter: none;
}

.collapse-btn::after {
  content: attr(title);
  position: absolute;
  top: 42px;
  right: 0;
  display: none;
  background: #111827;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgb(16 32 39 / 22%);
}

.collapse-btn:hover::after {
  display: block;
}

nav {
  display: grid;
  gap: 0;
  padding: 14px 8px 6px;
}

.nav-group {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
  padding: 10px 0 18px;
  border-bottom: 0;
}

.nav-section-title {
  padding: 0 14px 8px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.nav {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: #4b5563;
  border: 1px solid transparent;
  border-radius: 8px;
  height: 40px;
  min-height: 40px;
  padding: 7px 14px;
  font-weight: 700;
}

.nav.active,
.nav:hover {
  background: var(--nav-purple-soft);
  border-color: var(--nav-purple-soft);
  color: var(--nav-purple);
  filter: none;
}

.nav-emoji {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.nav-label {
  white-space: nowrap;
}

.lock {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.55;
}

.nav.nav-disabled {
  color: #6b7280;
  cursor: not-allowed;
}

.nav.nav-disabled:hover {
  background: transparent;
  border-color: transparent;
}

.user-box {
  margin-top: auto;
  padding: 16px 20px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  font-size: 14px;
  border-top: 1px solid var(--line);
}

.user-box span {
  color: #111827;
  font-weight: 700;
}

.user-box .ghost {
  justify-self: stretch;
}

.app.sidebar-collapsed .sidebar {
  align-items: stretch;
}

.app.sidebar-collapsed .brand-full,
.app.sidebar-collapsed .nav-label,
.app.sidebar-collapsed .lock,
.app.sidebar-collapsed .nav-section-title,
.app.sidebar-collapsed .user-box span {
  display: none;
}

.app.sidebar-collapsed .brand-short {
  display: inline;
}

.app.sidebar-collapsed .nav-group {
  padding: 10px 3px;
}

.app.sidebar-collapsed .nav {
  justify-content: center;
  padding: 9px 0;
}

.app.sidebar-collapsed .brand {
  justify-content: center;
  padding: 0 8px;
}

.app.sidebar-collapsed .brand strong {
  color: var(--nav-purple);
  font-size: 14px;
}

.app.sidebar-collapsed .collapse-btn {
  position: static;
  margin-left: 0;
  background: #f3f4f6;
  color: #111827;
  border-color: var(--line);
}

.app.sidebar-collapsed .user-box {
  padding: 12px 10px 20px;
}

.app.sidebar-collapsed .user-box .ghost {
  font-size: 0;
  min-height: 38px;
  padding: 0;
}

.app.sidebar-collapsed .user-box .ghost::before {
  content: "⎋";
  font-size: 18px;
}

.main {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: #f3f6fa;
}

.auth-card {
  width: min(520px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 18px 48px rgb(16 32 39 / 10%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e7edf4;
}

.auth-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--nav-purple);
  color: #fff;
  font-size: 23px;
  font-weight: 900;
}

.auth-brand h1,
.auth-form-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.auth-brand h1 {
  font-size: 25px;
}

.auth-brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  padding-top: 24px;
  display: grid;
  gap: 16px;
}

.auth-form-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-form-heading h2 {
  font-size: 20px;
}

.auth-form-heading span {
  color: var(--muted);
  font-size: 13px;
}

.auth-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-submit {
  min-height: 42px;
  margin-top: 2px;
  background: var(--accent);
  font-weight: 700;
}

.auth-wecom-entry {
  display: grid;
  gap: 9px;
}

.auth-wecom-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  gap: 12px;
  padding: 9px 13px;
  border: 1px solid #07a957;
  border-radius: 7px;
  background: #07c160;
  color: #fff;
  text-align: left;
}

.auth-wecom-button:hover,
.auth-wecom-button:focus-visible {
  background: #06ad56;
  border-color: #069d4f;
  outline: none;
  box-shadow: 0 0 0 3px rgb(7 193 96 / 16%);
  filter: none;
}

.auth-wecom-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 7px;
  background: rgb(255 255 255 / 20%);
  font-size: 17px;
  font-weight: 800;
}

.auth-wecom-button-text {
  display: grid;
  flex: 1;
  gap: 2px;
}

.auth-wecom-button-text strong {
  font-size: 15px;
}

.auth-wecom-button-text small {
  color: rgb(255 255 255 / 82%);
  font-size: 12px;
}

.auth-wecom-arrow {
  font-size: 25px;
  line-height: 1;
}

.auth-wecom-guide {
  padding: 10px 12px;
  border: 1px solid #ccebdc;
  border-radius: 6px;
  background: #f2fbf6;
  color: #3c6651;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.auth-wecom-guide p,
.auth-wecom-guide small {
  margin: 0;
  line-height: 1.55;
}

.auth-wecom-guide p {
  font-size: 13px;
}

.auth-wecom-guide small {
  display: block;
  margin-top: 2px;
  color: #648271;
  font-size: 12px;
}

.auth-wecom-guide.attention {
  border-color: #07c160;
  background: #eaf9f1;
  box-shadow: 0 0 0 3px rgb(7 193 96 / 13%);
  outline: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #98a2b3;
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: #e4e9f0;
  content: "";
}

.auth-register-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid #d6deea;
  border-radius: 8px;
  background: #f5f7fa;
}

.auth-register-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #667085;
  font-weight: 600;
}

.auth-register-tabs button.active {
  background: #fff;
  color: var(--nav-purple);
  box-shadow: 0 1px 4px rgb(16 24 40 / 12%);
}

.auth-registration-fields {
  display: grid;
  gap: 12px;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px 40px;
  align-items: center;
  gap: 8px;
}

.auth-email-row,
.auth-email-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 8px;
}

.auth-email-row input,
.auth-email-row select,
.auth-email-code-row input {
  min-width: 0;
}

.auth-email-domain {
  cursor: pointer;
}

.auth-email-send {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #d6deea;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-weight: 600;
}

.auth-email-send:hover,
.auth-email-send:focus-visible {
  border-color: var(--nav-purple);
  color: var(--nav-purple);
  outline: none;
  filter: none;
}

.auth-email-send:disabled {
  cursor: wait;
  color: #98a2b3;
  opacity: .75;
}

.auth-code-row input {
  min-width: 0;
  text-transform: uppercase;
}

.auth-code-canvas {
  width: 118px;
  height: 40px;
  border: 1px solid #cfd8e5;
  border-radius: 6px;
  background: #f5f7fa;
}

.auth-code-refresh {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid #d8e0ea;
  border-radius: 6px;
  background: #eef2f6;
  color: #475467;
  font-size: 21px;
}

.auth-code-refresh:hover,
.auth-code-refresh:focus-visible {
  border-color: var(--nav-purple);
  color: var(--nav-purple);
  outline: none;
}

.auth-code-refresh:disabled {
  cursor: wait;
  opacity: .55;
}

.auth-switch {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.auth-text-button {
  padding: 2px 4px;
  background: transparent;
  color: var(--nav-purple);
  font-weight: 700;
}

.auth-text-button:hover {
  text-decoration: underline;
  filter: none;
}

@media (max-width: 560px) {
  .auth-card {
    padding: 24px 20px;
  }

  .auth-field-grid {
    grid-template-columns: 1fr;
  }

  .auth-code-row {
    grid-template-columns: minmax(0, 1fr) 104px 40px;
  }

  .auth-email-row,
  .auth-email-code-row {
    grid-template-columns: minmax(0, 1fr) 116px;
  }

  .auth-code-canvas {
    width: 104px;
  }
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.hidden {
  display: none !important;
}

.workbench {
  min-height: 100vh;
  padding: 24px;
}

.module-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  margin: -24px -24px 24px;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.module-tab {
  position: relative;
  min-height: 64px;
  padding: 0 18px;
  border-radius: 0;
  background: transparent;
  color: #475569;
  font-size: 16px;
  font-weight: 800;
}

.module-tab:hover,
.module-tab.active {
  background: transparent;
  color: var(--nav-purple);
  filter: none;
}

.module-tab.active::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--nav-purple);
}

.nav-group.module-hidden {
  display: none;
}

.nav.permission-hidden {
  display: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.workbench.invest-mode .topbar {
  display: none;
}

.workbench.system-mode .topbar {
  display: none;
}

.workbench.invest-mode .invest-board {
  min-height: calc(100vh - 64px);
  margin: -24px -24px -24px;
  border-top: 0;
}

.workbench.system-mode #systemView {
  min-height: calc(100vh - 64px);
  margin: -24px -24px -24px;
  background: #f3f5f9;
  display: block;
}

.workbench.system-mode #systemView > .tab-panel {
  display: block;
}

.workbench.system-mode #systemView .toolbar {
  min-height: 88px;
  padding: 0 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.workbench.system-mode #systemView .table-wrap {
  margin: 26px 28px;
}

.workbench.system-mode #permissionPanel {
  padding: 28px 30px 40px;
  background: #f4f7fb;
}

.module-placeholder {
  display: grid;
  gap: 18px;
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.external-page-frame {
  width: 100%;
  min-height: calc(100vh - 180px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.workbench.pipeline-mode .topbar { display: none; }
.app.pipeline-mode {
  grid-template-columns: minmax(0, 1fr);
  position: relative;
}
.app.pipeline-mode > .sidebar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 60;
  display: flex;
  width: 244px;
  height: 64px;
  min-height: 64px;
}
.app.pipeline-mode > .sidebar > nav,
.app.pipeline-mode > .sidebar > .user-box {
  display: none;
}
.app.pipeline-mode .module-nav {
  padding-left: 268px;
}
.app.pipeline-mode.sidebar-collapsed > .sidebar {
  width: 78px;
}
.app.pipeline-mode.sidebar-collapsed .module-nav {
  padding-left: 102px;
}
.workbench.pipeline-mode #difyView {
  display: block;
  min-height: calc(100vh - 64px);
  margin: -24px;
  overflow: hidden;
  background: #f3f5f9;
}
.dify-platform-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 64px);
  min-height: 640px;
  border: 0;
  background: #f3f5f9;
}

.module-placeholder h2,
.module-placeholder p {
  margin: 0;
}

.module-placeholder p {
  color: var(--muted);
}

.permission-list {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
}

.permission-toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 38px;
}

.permission-toolbar button {
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid #0f766e;
  background: #0f766e;
  box-shadow: 0 3px 10px rgb(15 118 110 / 16%);
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.permission-toolbar button:hover {
  background: #0b665f;
  box-shadow: 0 6px 16px rgb(15 118 110 / 22%);
  filter: none;
  transform: translateY(-1px);
}

.menu-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.menu-group + .menu-group {
  margin-top: 16px;
}

.menu-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.menu-group-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-group-header small {
  color: var(--muted);
}

.menu-group-collapse,
.menu-move {
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  background: transparent;
  color: #64748b;
}

.menu-group-collapse:hover,
.menu-move:hover {
  background: #ede9fe;
  color: var(--nav-purple);
  filter: none;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

@media (max-width: 1400px) {
  .permission-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.permission-card {
  --role-accent: #3155a6;
  position: relative;
  min-width: 0;
  min-height: 300px;
  padding: 20px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid #dce4ee;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.permission-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--role-accent);
}

.permission-card:nth-child(3n) {
  --role-accent: #7c3aed;
}

.permission-card:nth-child(4n) {
  --role-accent: #b7791f;
}

.permission-card[data-role-code="admin"] {
  --role-accent: #0f766e;
  border-color: #b9d9d4;
  box-shadow: 0 4px 14px rgb(15 118 110 / 9%);
}

.permission-card:hover {
  border-color: color-mix(in srgb, var(--role-accent) 36%, #dce4ee);
  box-shadow: 0 10px 28px rgb(15 23 42 / 9%);
  transform: translateY(-2px);
}

.permission-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
}

.permission-card-head .row-actions {
  display: flex;
  width: 100%;
  gap: 6px;
  margin: 0;
  flex-wrap: nowrap;
}

.permission-card .permission-card-head button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.permission-card .permission-card-head .bind-role-button {
  background: #f0f5ff;
  border-color: #d8e3fa;
  color: #3155a6;
}

.permission-card .permission-card-head .edit-role-button {
  background: #3155a6;
  color: #fff;
}

.permission-card .permission-card-head .delete-role-button {
  margin-left: auto;
  background: #fff;
  border-color: #eadde0;
  color: #a23b4a;
}

.permission-card .permission-card-head .bind-role-button:hover {
  background: #e3ecff;
  border-color: #b9cdf5;
  filter: none;
}

.permission-card .permission-card-head .edit-role-button:hover {
  background: #274789;
  filter: none;
}

.permission-card .permission-card-head .delete-role-button:hover {
  background: #fff3f4;
  border-color: #e2bfc5;
  filter: none;
}

.permission-card h3,
.permission-card p {
  margin: 0;
}

.permission-card h3 {
  min-width: 0;
  color: #172033;
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.permission-card .role-code {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #e6ebf1;
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.role-menu-summary {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #e4eaf1;
  color: #526074;
  font-size: 13px;
  line-height: 1.65;
}

.role-menu-group {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0 0 10px;
  border-bottom: 1px dashed #e4e9ef;
}

.role-menu-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.role-menu-primary,
.role-menu-secondary {
  min-width: 0;
  overflow-wrap: anywhere;
}

.role-menu-summary strong {
  color: #25324a;
  font-weight: 700;
}

.role-menu-summary.admin-fixed-permissions {
  min-height: 92px;
  padding: 18px;
  border: 1px solid #cfe4e0;
  border-radius: 6px;
  background: #f2faf8;
  color: #38655f;
  place-content: center;
  text-align: center;
}

.role-menu-summary.empty {
  min-height: 92px;
  place-items: center;
  padding: 22px 12px;
  border: 1px dashed #d7dee8;
  border-radius: 6px;
  background: #fafbfd;
  color: #8490a2;
}

.permission-card p {
  color: var(--muted);
  font-size: 13px;
}

.permission-card :is(button, a):focus-visible,
.permission-toolbar button:focus-visible {
  outline: 3px solid rgb(49 85 166 / 24%);
  outline-offset: 2px;
}

.graph-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 190px;
  color: var(--nav-purple);
}

.graph-preview span {
  padding: 12px 18px;
  border: 1px solid #d8c7ff;
  border-radius: 999px;
  background: #faf7ff;
  font-weight: 800;
}

.graph-preview i {
  width: 36px;
  height: 1px;
  background: #b9a0f5;
}

/* 知识图谱：企业节点、关系可视化与采集任务。 */
.workbench.graph-mode .topbar { display: none; }
.workbench.graph-mode #graphView { display: block; min-height: calc(100vh - 64px); margin: -24px; background: #f3f5f8; }
.workbench.graph-mode #graphContent { display: block; min-height: calc(100vh - 64px); padding: 0; border: 0; border-radius: 0; background: transparent; }
.graph-board { padding: 0 24px 36px; }
.graph-board-head { display: flex; align-items: center; min-height: 76px; margin: 0 -24px; padding: 0 28px; border-bottom: 1px solid #e1e5eb; background: #fff; }
.graph-board-head h2, .graph-board-head p { margin: 0; }
.graph-board-head h2 { color: #172033; font-size: 20px; }
.graph-board-head p { margin-top: 5px; color: #7b8494; font-size: 13px; }
.graph-tabs { display: flex; gap: 12px; margin-top: 20px; border-bottom: 1px solid #dfe4eb; }
.graph-tabs button { min-height: 44px; padding: 8px 4px 12px; border-radius: 0; background: transparent; color: #344054; }
.graph-tabs button.active { border-bottom: 2px solid #7c3aed; color: #7c3aed; }
.graph-visual-panel, .graph-data-panel { margin-top: 16px; }
.graph-controls { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 14px; border-radius: 7px 7px 0 0; background: #fff; border: 1px solid #dfe5ed; }
.graph-controls > button:first-child { background: #7c3aed; }
.graph-controls { background: #1d293d; border-color: #1d293d; color: #dbe4f3; }
.graph-controls select, .graph-depth select, .graph-search input { border-color: #cbd5e1; background: #fff; color: #24324a; }
.graph-depth { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: #b8c5d8; font-size: 12px; }
.graph-depth select { width: 52px; padding: 7px 5px; }
.graph-relations { display: inline-flex; flex-wrap: nowrap; gap: 0; }
.graph-relations button { min-height: 30px; padding: 5px 10px; border: 1px solid #cbd5e1; border-left-width: 0; border-radius: 0; background: #fff; color: #344054; font-size: 12px; white-space: nowrap; }
.graph-relations button:first-child { border-left-width: 1px; border-radius: 4px 0 0 4px; }
.graph-relations button:last-child { border-radius: 0 4px 4px 0; }
.graph-relations button.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.graph-controls select { width: 150px; }
.graph-search { display: flex; flex: 1; max-width: 420px; }
.graph-search input { border-radius: 6px 0 0 6px; }
.graph-search button { border-radius: 0 6px 6px 0; }
.graph-canvas { position: relative; min-height: 620px; overflow: hidden; border: 1px solid #0f172a; border-top: 0; border-radius: 0 0 7px 7px; background: #0d1629; }
.graph-canvas svg { display: block; width: 100%; height: min(620px, calc(100vh - 260px)); min-height: 520px; }
.graph-edge line { stroke: #63789b; stroke-width: 1.3; }
.graph-edge text { fill: #b7c4d9; font-size: 10px; paint-order: stroke; stroke: #0d1629; stroke-width: 3px; }
#graphArrow path { fill: #8392aa; }
.graph-node { cursor: pointer; }
.graph-node circle { fill: #7c3aed; stroke: #fff; stroke-width: 3px; filter: drop-shadow(0 3px 4px rgb(41 50 65 / 18%)); transition: transform 150ms ease; }
.graph-node:hover circle { transform: scale(1.15); }
.graph-node text { fill: #e5edf8; font-size: 11px; font-weight: 700; paint-order: stroke; stroke: #0d1629; stroke-width: 4px; }
.graph-node-park circle { fill: #f59e0b; }
.graph-node-enterprise circle { fill: #7c3aed; }
.graph-node-related_enterprise circle { fill: #ef5b63; }
.graph-node-industry circle { fill: #22a67a; }
.graph-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #98a2b3; pointer-events: none; }
.graph-actionbar { display: flex; gap: 10px; min-height: 62px; align-items: center; }
.graph-actionbar > button:first-child { background: #7c3aed; }
.graph-table-wrap { overflow: auto; border: 1px solid #dfe5ed; border-radius: 7px; background: #fff; }
.graph-table-wrap table { width: 100%; min-width: 940px; border: 0; }
.graph-table-wrap th { background: #f8fafc; }
.graph-table-wrap th, .graph-table-wrap td { padding: 12px 14px; white-space: nowrap; }
.graph-status { display: inline-block; padding: 3px 8px; border: 1px solid #a7df91; border-radius: 4px; background: #f2ffed; color: #3b9d27; font-size: 11px; }
.graph-empty-cell { height: 150px; color: #98a2b3; text-align: center; }
.graph-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)) minmax(300px, 2fr); gap: 14px; margin-bottom: 16px; }
.graph-stat-grid article { min-height: 88px; padding: 16px; border: 1px solid #e0e5ed; border-radius: 7px; background: #fff; }
.graph-stat-grid span, .graph-stat-grid strong { display: block; }
.graph-stat-grid span { color: #8490a2; font-size: 12px; }
.graph-stat-grid strong { margin-top: 8px; color: #172033; font-size: 26px; font-weight: 500; }
.graph-rel-stats div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.graph-rel-stats i { padding: 3px 7px; border: 1px solid #dce2ea; border-radius: 4px; color: #475467; font-style: normal; font-size: 11px; }
.graph-seed-form { width: min(620px, calc(100vw - 32px)); grid-template-columns: 1fr; }

@media (max-width: 900px) {
  .graph-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .graph-rel-stats { grid-column: 1 / -1; }
  .graph-controls { align-items: stretch; flex-direction: column; }
  .graph-controls select, .graph-search { width: 100%; max-width: none; }
}

/* 运营看板：基于企业和园区动态生成活动与宣传推荐。 */
.workbench.operations-mode .topbar {
  display: none;
}

.workbench.operations-mode #operationsView {
  display: block;
  min-height: calc(100vh - 64px);
  margin: -24px -24px -24px;
  background: #f3f4f7;
}

.workbench.operations-mode #operationsContent {
  display: block;
  max-width: none;
  min-height: calc(100vh - 64px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.operations-board {
  padding: 0 24px 36px;
}

.operations-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  margin: 0 -24px;
  padding: 0 28px;
  border-bottom: 1px solid #e1e5eb;
  background: #fff;
}

.operations-board-head h2,
.operations-board-head p {
  margin: 0;
}

.operations-board-head h2 {
  color: #172033;
  font-size: 20px;
}

.operations-board-head p {
  margin-top: 5px;
  color: #7b8494;
  font-size: 13px;
}

.operations-board-head button {
  min-height: 36px;
  border: 1px solid #dbe1e9;
  background: #fff;
  color: #475467;
}

.operations-tabs {
  display: flex;
  gap: 8px;
  margin: 24px 0 18px;
  border-bottom: 1px solid #dfe4eb;
}

.operations-tabs button {
  position: relative;
  min-height: 44px;
  padding: 7px 16px 11px;
  border-radius: 0;
  background: transparent;
  color: #667085;
  font-weight: 700;
}

.operations-tabs button:hover,
.operations-tabs button.active {
  color: #7c3aed;
  background: transparent;
  filter: none;
}

.operations-tabs button.active::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: #7c3aed;
}

.operations-tabs strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 10px;
  background: #eef0f5;
  color: #667085;
  font-size: 11px;
}

.operation-dynamics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.operation-dynamics > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #e0e5ed;
  border-radius: 6px;
  background: #fff;
  color: #667085;
  font-size: 12px;
}

.operation-dynamics i {
  color: #7c3aed;
  font-style: normal;
  font-weight: 800;
}

.operations-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.operation-column {
  min-width: 0;
  padding: 20px;
  border: 1px solid #e0e5ed;
  border-radius: 8px;
  background: #fff;
}

.operation-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e8ebf0;
}

.operation-column h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #2c3443;
  font-size: 17px;
}

.operation-column h3 span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: #f1e9ff;
  color: #7c3aed;
  font-size: 12px;
}

.operation-column > header small {
  padding: 4px 9px;
  border-radius: 12px;
  background: #f1f3f6;
  color: #7b8494;
}

.operation-card-list {
  display: grid;
  gap: 13px;
  margin-top: 16px;
}

.operation-card {
  padding: 16px;
  border: 1px solid #e2e6ec;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 7px rgb(15 23 42 / 4%);
}

.operation-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.operation-card h4,
.operation-card p {
  margin: 0;
}

.operation-card h4 {
  color: #273142;
  font-size: 15px;
  line-height: 1.45;
}

.operation-card-title > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 5px;
  background: #f0e9ff;
  color: #7c3aed;
  font-size: 11px;
}

.operation-column:nth-child(2) .operation-card-title > span {
  background: #edf5ea;
  color: #568449;
}

.operation-card p {
  margin-top: 9px;
  color: #697386;
  font-size: 12px;
  line-height: 1.65;
}

.operation-launched-time {
  display: block;
  margin-top: 8px;
  color: #98a1af;
}

.operation-ended-time {
  margin-left: 18px;
  color: #667085;
}

.operation-card-actions {
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 8px;
  margin-top: 13px;
}

.operation-card-actions button {
  min-height: 34px;
  padding: 6px 12px;
  background: #7c3aed;
  font-size: 12px;
  font-weight: 700;
}

.operation-card-actions button:disabled {
  background: #e8eaf0;
  color: #8992a2;
  cursor: not-allowed;
}

.operation-card-actions .operation-favorite {
  border: 1px solid #ded5f4;
  background: #fff;
  color: #d39b13;
  font-size: 19px;
}

.operation-card-actions .operation-favorite.active {
  background: #fff9e8;
  border-color: #f0d388;
}

.operation-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: #9099a8;
  border: 1px dashed #d9dee6;
  border-radius: 7px;
  background: #fafbfc;
}

@media (max-width: 1050px) {
  .operations-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .operations-board {
    padding: 0 14px 28px;
  }

  .operations-board-head {
    align-items: flex-start;
    flex-direction: column;
    margin: 0 -14px;
    padding: 16px;
  }

  .operation-card-actions {
    grid-template-columns: 1fr 58px;
  }
}

/* 房源管理：房源、客户、合同、报表和收缴提醒。 */
.workbench.property-mode .topbar {
  display: none;
}

.workbench.property-mode #propertyView {
  display: block;
  min-height: calc(100vh - 64px);
  margin: -24px -24px -24px;
  background: #f3f4f7;
}

.workbench.property-mode #propertyContent {
  display: block;
  max-width: none;
  min-height: calc(100vh - 64px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.property-board {
  padding: 0 24px 36px;
}

.property-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  margin: 0 -24px;
  padding: 0 28px;
  border-bottom: 1px solid #e1e5eb;
  background: #fff;
}

.property-board-head h2,
.property-board-head p {
  margin: 0;
}

.property-board-head h2 {
  color: #172033;
  font-size: 20px;
}

.property-board-head p {
  margin-top: 5px;
  color: #7b8494;
  font-size: 13px;
}

.property-board-head > button {
  min-height: 36px;
  background: #7c3aed;
  font-weight: 700;
}

.property-tabs {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  border-bottom: 1px solid #dfe4eb;
}

.property-tabs button {
  position: relative;
  min-height: 46px;
  padding: 8px 16px 12px;
  border-radius: 0;
  background: transparent;
  color: #667085;
  font-weight: 700;
}

.property-tabs button:hover,
.property-tabs button.active {
  color: #7c3aed;
  background: transparent;
  filter: none;
}

.property-tabs button.active::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: #7c3aed;
}

.property-tabs strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 10px;
  background: #eef0f5;
  color: #697386;
  font-size: 11px;
}

.property-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 68px;
}

.property-toolbar input {
  width: 300px;
  max-width: 55vw;
  background: #fff;
}

.property-toolbar button {
  border: 1px solid #dbe1e9;
  background: #fff;
}

.property-toolbar span {
  margin-left: auto;
  color: #667085;
  font-size: 13px;
}

.property-fee-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -24px;
  padding: 14px 24px;
  border-bottom: 1px solid #e7e9ee;
  background: #f5f6f8;
}

.property-fee-filters,
.property-fee-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.property-fee-filters button {
  min-width: 64px;
  padding: 7px 15px;
  border: 1px solid #d9dde5;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  box-shadow: 0 1px 2px rgb(16 24 40 / 5%);
}

.property-fee-filters button:hover,
.property-fee-filters button.active {
  border-color: #7c3aed;
  color: #7c3aed;
}

.property-fee-filters button.active,
.property-fee-filters .property-add-fee {
  background: #7c3aed;
  color: #fff;
}

.property-fee-filters .property-add-fee {
  min-width: 112px;
  border-color: #7c3aed;
}

.property-fee-filters .property-add-fee:hover {
  background: #6d28d9;
  color: #fff;
}

.property-fee-search input {
  width: 230px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #d9dde5;
  border-radius: 6px;
  background: #fff;
}

.property-fee-search-box {
  position: relative;
  width: fit-content;
}

.property-fee-search .property-fee-search-box {
  flex: 1 1 auto;
}

.property-fee-search-box input {
  padding-right: 38px;
}

.property-fee-search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  transform: translateY(-50%);
  background: #e7eaf0;
  color: #667085;
  font-size: 16px;
  line-height: 1;
}

.property-fee-search-clear:hover {
  background: #d8dde6;
  color: #344054;
}

.property-fee-search-clear.hidden {
  display: none;
}

.property-table-wrap.property-fee-table {
  margin-top: 0;
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

.property-status.pending {
  background: #f3e8ff;
  color: #7c3aed;
}

.property-fee-empty {
  display: grid;
  min-height: 145px;
  place-content: center;
  color: #98a2b3;
  text-align: center;
}

.property-fee-empty span {
  color: #d5dae3;
  font-size: 46px;
  line-height: 1;
}

.property-fee-empty p {
  margin: 12px 0 0;
}

.property-table-wrap {
  overflow-x: auto;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
}

.property-table-wrap table {
  min-width: 1060px;
  border: 0;
}

.property-table-wrap th {
  padding: 13px 14px;
  background: #f8f9fb;
  color: #697386;
  font-size: 12px;
  white-space: nowrap;
}

.property-table-wrap td {
  padding: 12px 14px;
  color: #526074;
  font-size: 13px;
  white-space: nowrap;
}

.property-table-wrap td strong {
  color: #273142;
}

.contract-file-mark {
  margin-left: 7px;
  padding: 2px 5px;
  border: 0;
  border-radius: 4px;
  background: #edf4ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.contract-file-mark:hover,
.contract-file-mark:focus-visible {
  background: #dbeafe;
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

.property-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
}

.property-status.normal {
  background: #f0eaff;
  color: #7c3aed;
}

.property-status.idle {
  background: #eaf8f1;
  color: #178a57;
}

.property-status.warning {
  background: #fff4e8;
  color: #b76818;
}

.property-row-actions {
  display: flex;
  gap: 6px;
}

.property-row-actions button {
  min-height: 28px;
  padding: 4px 9px;
  background: #315ac7;
  font-size: 12px;
}

.property-row-actions .danger {
  background: #fff1f2;
  color: #c02636;
}

.property-empty-cell {
  height: 150px;
  color: #8f98a7 !important;
  text-align: center;
}

.property-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 1060px;
  min-height: 52px;
  padding: 8px 14px;
  border-top: 1px solid #e4e8ee;
  color: #667085;
  font-size: 12px;
}

.property-pagination button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #dbe1e9;
  background: #fff;
}

.property-pagination button:disabled {
  color: #a4acb8;
  background: #f1f3f6;
}

.property-page-size {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #667085;
  font-size: 12px;
}

.property-page-size select {
  width: 78px;
  min-height: 32px;
  padding: 4px 24px 4px 9px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  background-color: #fff;
  color: #475467;
}

.property-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.property-report-kpi,
.property-report-card {
  padding: 20px;
  border: 1px solid #e0e5ed;
  border-radius: 8px;
  background: #fff;
}

.property-report-kpi span,
.property-report-kpi strong,
.property-report-kpi small {
  display: block;
}

.property-report-kpi span {
  color: #7b8494;
  font-size: 13px;
}

.property-report-kpi strong {
  margin-top: 10px;
  color: #7c3aed;
  font-size: 25px;
}

.property-report-kpi small {
  margin-top: 8px;
  color: #98a1af;
}

.property-report-wide {
  grid-column: span 2;
  min-height: 230px;
}

.property-report-card h3 {
  margin: 0 0 25px;
  text-align: center;
}

.property-report-progress {
  display: grid;
  grid-template-columns: 80px 1fr 75px;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #667085;
  font-size: 13px;
}

.property-report-progress > div {
  height: 22px;
  overflow: hidden;
  border-radius: 3px;
  background: #eef1f5;
}

.property-report-progress i {
  display: block;
  height: 100%;
}

.property-report-progress strong {
  text-align: right;
}

.property-report-card > p {
  margin-top: 28px;
  color: #667085;
  text-align: center;
}

.property-alert-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.property-alert-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 19px;
  border: 1px solid #e0e5ed;
  border-radius: 8px;
  background: #fff;
}

.property-alert-list h3,
.property-alert-list p {
  margin: 0;
}

.property-alert-list h3 {
  display: inline;
  margin-left: 9px;
  font-size: 15px;
}

.property-alert-list p {
  margin-top: 8px;
  color: #667085;
  font-size: 13px;
}

.property-alert-list small {
  display: block;
  margin-top: 7px;
  color: #98a1af;
}

.property-alert-list div > span {
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
}

.property-alert-list .fee {
  background: #fff1f2;
  color: #c02636;
}

.property-alert-list .contract {
  background: #fff5e9;
  color: #b76818;
}

.property-dialog-form {
  width: min(720px, calc(100vw - 32px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 18px;
}

.property-dialog-form h2,
.property-dialog-form .property-field-wide,
.property-dialog-form .dialog-actions {
  grid-column: 1 / -1;
}

.property-dialog-form small {
  color: #929baa;
  font-size: 11px;
}

.property-contract-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  background: #f7f9fc;
}

.property-contract-current > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.property-contract-current small {
  overflow: hidden;
  max-width: 520px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-contract-current > div {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.property-contract-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  overflow: hidden;
}

.property-contract-shell {
  display: grid;
  grid-template-rows: auto minmax(360px, 70vh) auto;
  width: 100%;
  max-height: calc(100vh - 32px);
}

.property-contract-shell > header,
.property-contract-shell > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.property-contract-shell > header h2,
.property-contract-shell > header p {
  margin: 0;
}

.property-contract-shell > header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.property-contract-shell > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.property-contract-preview {
  display: grid;
  overflow: auto;
  background: #eef2f6;
  place-items: center;
}

.property-contract-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.property-contract-preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.property-contract-preview pre {
  align-self: stretch;
  justify-self: stretch;
  margin: 0;
  padding: 22px;
  overflow: auto;
  background: #fff;
  color: #273142;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.property-contract-loading,
.property-contract-unavailable {
  display: grid;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.property-contract-unavailable strong {
  color: var(--ink);
  font-size: 16px;
}

@media (max-width: 1050px) {
  .property-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .property-board {
    padding: 0 14px 28px;
  }

  .property-board-head {
    align-items: flex-start;
    flex-direction: column;
    margin: 0 -14px;
    padding: 16px;
  }

  .property-tabs {
    overflow-x: auto;
  }

  .property-fee-toolbar {
    align-items: stretch;
    flex-direction: column;
    margin: 0 -14px;
    padding: 12px 14px;
  }

  .property-fee-filters {
    overflow-x: auto;
  }

  .property-fee-search input {
    min-width: 0;
    width: 100%;
  }

  .property-report-grid,
  .property-dialog-form {
    grid-template-columns: 1fr;
  }

  .property-report-wide,
  .property-dialog-form h2,
  .property-dialog-form .property-field-wide,
  .property-dialog-form .dialog-actions {
    grid-column: auto;
  }
}

.tabs {
  display: inline-flex;
  gap: 6px;
  margin-top: 12px;
  padding: 4px;
  background: #e9f0f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab {
  min-width: 88px;
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 6px;
}

.tab.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 1px 3px rgb(16 32 39 / 10%);
}

.view {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.toolbar,
.inline-form,
.chat-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar input {
  max-width: 340px;
}

.panel-toolbar {
  justify-content: flex-start;
}

#systemView .toolbar {
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
}

#systemView .toolbar input,
#systemView .toolbar select {
  width: 180px;
  max-width: 180px;
  flex: 0 0 180px;
}

#systemView .toolbar button {
  flex: 0 0 auto;
}

.tab-panel {
  display: grid;
  gap: 16px;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

/* 园区看板：全部数据来自招商企业信息聚合。 */
.workbench.dashboard-mode .topbar {
  min-height: 62px;
  margin: -24px -24px 0;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid #e5e9ef;
}

.workbench.dashboard-mode .topbar h1 {
  font-size: 20px;
}

.workbench.dashboard-mode #viewSubtitle,
.workbench.dashboard-mode #refreshBtn {
  display: none;
}

.workbench.dashboard-mode #dashboardView {
  display: block;
  min-height: calc(100vh - 126px);
  margin: 0 -24px -24px;
  background: #f1f3f6;
}

.park-dashboard {
  padding: 26px 24px 36px;
}

.park-dashboard-title {
  margin: 0 0 22px;
  color: #172033;
  font-size: 22px;
}

.dashboard-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 240px;
  padding: 10px 13px;
  border: 1px solid #d6def0;
  border-radius: 4px;
  background: #fff;
  color: #667085;
  box-shadow: 0 4px 14px rgb(16 24 40 / 16%);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.dashboard-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.park-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.park-kpi {
  min-height: 114px;
  padding: 24px;
  border: 1px solid #e5e9ef;
  border-radius: 8px;
  background: #fff;
}

.park-kpi > span {
  color: #7b8494;
  font-size: 14px;
}

.park-kpi > div {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}

.park-kpi i {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-style: normal;
  font-size: 13px;
}

.park-kpi strong {
  font-size: 27px;
  font-weight: 500;
}

.park-kpi-purple div { color: #7c3aed; }
.park-kpi-blue div { color: #1677ff; }
.park-kpi-green div { color: #38b000; }
.park-kpi-orange div { color: #f97316; }

.park-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
  margin-top: 24px;
}

.park-chart-card {
  min-width: 0;
  min-height: 390px;
  padding: 24px 28px;
  border: 1px solid #e5e9ef;
  border-radius: 8px;
  background: #fff;
}

.park-chart-card h3 {
  margin: 0 0 22px;
  color: #303846;
  text-align: center;
  font-size: 17px;
}

.donut-chart-wrap {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr);
  align-items: center;
  gap: 26px;
  min-height: 292px;
}

.donut-chart {
  position: relative;
  width: min(280px, 100%);
  aspect-ratio: 1;
  justify-self: center;
}

.donut-chart svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-track {
  stroke: #edf0f4;
}

.donut-hit {
  fill: none;
  stroke: transparent;
  pointer-events: stroke;
}

.trend-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

.donut-chart > div {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-chart strong,
.donut-chart span {
  display: block;
}

.donut-chart strong {
  color: #25324a;
  font-size: 30px;
}

.donut-chart span {
  margin-top: 4px;
  color: #8a94a4;
  font-size: 12px;
}

.chart-legend {
  display: grid;
  gap: 12px;
  align-content: center;
}

.chart-legend span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  color: #5d6878;
  font-size: 13px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.chart-legend em,
.chart-empty {
  color: #9aa3b1;
  font-style: normal;
  text-align: center;
}

.trend-chart svg {
  display: block;
  width: 100%;
  min-height: 270px;
}
.trend-title { position: relative; margin-bottom: 8px; }
.trend-title h3 { display: inline; margin: 0; text-align: left; }
.trend-title span { margin-left: 7px; color: #7c8798; font-size: 12px; }
.trend-title em { display: block; margin-top: 8px; color: #8d97a6; font-size: 11px; font-style: normal; }
.trend-growth-area { fill: rgb(124 58 237 / 8%); }
.trend-growth-line { fill: none; stroke: #7c3aed; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.trend-growth-dot { fill: #7c3aed; stroke: #fff; stroke-width: 2; filter: drop-shadow(0 2px 3px rgb(124 58 237 / 28%)); }
.finance-stage-chart { position: relative; min-height: 292px; }
.finance-stage-chart svg { display: block; width: 100%; min-height: 270px; overflow: visible; }
.finance-stage-unit { position: absolute; top: 0; left: 0; color: #778294; font-size: 12px; }
.finance-stage-grid line { stroke: #dfe6ef; stroke-width: 1; }
.finance-stage-grid text, .finance-stage-label { fill: #687486; font-size: 11px; }
.finance-stage-bar { fill: #2478ee; cursor: pointer; transition: fill 150ms ease, filter 150ms ease; }
.finance-stage-bar:hover { fill: #1769d7; filter: drop-shadow(0 4px 7px rgb(36 120 238 / 25%)); }
.finance-stage-value { fill: #2f3743; font-size: 12px; font-weight: 600; pointer-events: none; }
.finance-stage-empty { display: grid; min-height: 290px; place-items: center; }
.user-role-field { margin: 0; padding: 10px 12px 12px; border: 1px solid #d9e1ec; border-radius: 6px; }
.user-role-field legend { padding: 0 5px; color: #475467; font-size: 13px; font-weight: 600; }
.user-field-label { display: inline-flex; align-items: center; gap: 5px; min-height: 20px; }
.user-field-help { position: relative; display: inline-flex; align-items: center; }
.user-field-help-trigger {
  display: inline-grid;
  width: 17px;
  height: 17px;
  min-width: 17px;
  padding: 0;
  border: 1px solid #98a2b3;
  border-radius: 50%;
  background: #fff;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  place-items: center;
}
.user-field-help-trigger:hover,
.user-field-help-trigger:focus-visible { border-color: #6941c6; color: #6941c6; outline: none; box-shadow: 0 0 0 3px rgb(105 65 198 / 14%); }
.user-field-help-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: -8px;
  z-index: 20;
  width: min(300px, calc(100vw - 48px));
  padding: 9px 11px;
  border-radius: 5px;
  background: #253044;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.user-field-help-content::after {
  position: absolute;
  top: 100%;
  left: 11px;
  border: 5px solid transparent;
  border-top-color: #253044;
  content: "";
}
.user-field-help:hover .user-field-help-content,
.user-field-help:focus-within .user-field-help-content { opacity: 1; transform: translateY(0); }
.user-role-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.user-role-options label { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 9px; border: 1px solid #e3e8ef; border-radius: 5px; background: #f8fafc; color: #344054; }
.user-role-options input { width: 15px; height: 15px; margin: 0; }
.user-role-options label:has(input:checked) { border-color: #b9a1f7; background: #f4f0ff; color: #5b21b6; }
.user-role-options label:has(input:disabled) { opacity: .62; }

.chart-grid-lines line {
  stroke: #e4e9f0;
  stroke-width: 1;
}

.chart-grid-lines text,
.trend-x-label {
  fill: #7f8998;
  font-size: 11px;
}

.trend-created,
.trend-cumulative {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-created { stroke: #7c3aed; }
.trend-cumulative { stroke: #1677ff; }
.trend-dot-created { fill: #fff; stroke: #7c3aed; stroke-width: 2; }
.trend-dot-total { fill: #fff; stroke: #1677ff; stroke-width: 2; }

.trend-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: #667085;
  font-size: 13px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trend-legend i {
  width: 18px;
  height: 2px;
}

.trend-legend .created { background: #7c3aed; }
.trend-legend .cumulative { background: #1677ff; }

.horizontal-chart {
  display: grid;
  gap: 20px;
  padding: 10px 4px;
}

.horizontal-chart-row {
  display: grid;
  grid-template-columns: 78px 1fr 30px;
  align-items: center;
  gap: 12px;
  color: #647084;
  font-size: 13px;
}

.horizontal-chart-row > div {
  height: 22px;
  overflow: hidden;
  border-radius: 3px;
  background: #f0f2f6;
}

.horizontal-chart-row i {
  display: block;
  height: 100%;
  min-width: 0;
}

.horizontal-chart-row strong {
  color: #344054;
  text-align: right;
}

.vertical-chart {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 14px;
  min-height: 292px;
  padding: 8px 8px 0;
  border-bottom: 1px solid #dfe5ed;
}

.vertical-chart-column {
  display: grid;
  grid-template-rows: 1fr 42px;
  min-width: 42px;
  max-width: 94px;
  flex: 1;
  text-align: center;
}

.vertical-chart-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 190px;
  border-bottom: 1px solid #dfe5ed;
}

.vertical-chart-bar {
  display: flex;
  width: 72%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.vertical-chart-bar strong {
  color: #344054;
  font-size: 12px;
  line-height: 22px;
}

.vertical-chart-bar i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}

.vertical-chart-column > span {
  padding-top: 9px;
  overflow: hidden;
  color: #6f7989;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.occupancy-chart {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 292px;
  padding-top: 8px;
  overflow-x: auto;
  overflow-y: hidden;
}

.occupancy-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 226px;
  padding-top: 22px;
  padding-right: 10px;
  color: #8993a3;
  text-align: right;
  font-size: 11px;
  line-height: 1;
}

.occupancy-plot {
  position: relative;
  min-width: max(100%, 420px);
  height: 276px;
}

.occupancy-grid-lines {
  position: absolute;
  z-index: 0;
  inset: 22px 0 50px;
  height: 204px;
}

.occupancy-grid-line {
  position: absolute;
  right: 0;
  left: 0;
  display: block;
  height: 1px;
  background: #e7eaf0;
  pointer-events: none;
}

.occupancy-columns {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 18px;
  min-width: 100%;
  height: 276px;
  padding: 0 14px;
}

.occupancy-column {
  display: grid;
  grid-template-rows: 226px 50px;
  min-width: 54px;
  flex: 1 0 54px;
  text-align: center;
}

.occupancy-column-track {
  display: flex;
  height: 226px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.occupancy-column-track > strong {
  color: #6941c6;
  font-size: 11px;
  font-weight: 600;
}

.occupancy-column-track > i {
  display: block;
  width: min(38px, 72%);
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #8b5cf6 0%, #6d28d9 100%);
  box-shadow: 0 6px 14px rgb(109 40 217 / 16%);
}

.occupancy-column > span {
  padding-top: 10px;
  overflow: hidden;
  color: #667085;
  font-size: 12px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.occupancy-empty {
  display: grid;
  min-height: 292px;
  place-items: center;
}

@media (max-width: 1100px) {
  .park-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .park-chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .park-dashboard {
    padding: 18px 16px 28px;
  }

  .park-kpi-grid {
    grid-template-columns: 1fr;
  }

  .park-chart-card {
    min-height: 0;
    padding: 20px 16px;
  }

  .donut-chart-wrap {
    grid-template-columns: 1fr;
  }

  .occupancy-chart {
    grid-template-columns: 40px minmax(0, 1fr);
  }
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 52px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}

.pagination button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  font-size: 16px;
}

.page-size-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-size-label select {
  width: 86px;
  min-height: 30px;
  padding: 4px 8px;
}

.compact {
  max-height: 320px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 13px;
  color: var(--muted);
  background: #f8fafc;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 2px 10px;
  background: #e8f4f2;
  color: #115e59;
  font-size: 13px;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.row-actions button {
  padding: 6px 9px;
  font-size: 13px;
  background: var(--accent-2);
}

.row-actions .ghost {
  background: #eef2ff;
  color: #1d4ed8;
}

.invest-board {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: 88px 1fr;
  min-height: calc(100vh - 128px);
  margin: -4px -24px -24px;
  background: #f3f5f9;
  border-top: 1px solid var(--line);
}

.invest-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(560px, auto) 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.invest-title-search {
  display: flex;
  align-items: center;
  gap: 26px;
  min-width: 0;
}

.invest-rail {
  grid-column: 1;
  grid-row: 2;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px 22px 24px 28px;
}

.invest-board-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: #0f172a;
  font-size: 19px;
  font-weight: 900;
}

.invest-board-title span {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: var(--nav-purple);
  font-size: 12px;
}

.invest-rail-title {
  margin-bottom: 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.industry-nav {
  display: grid;
  gap: 2px;
}

.industry-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 7px 0;
  background: transparent;
  color: #334155;
  text-align: left;
  border-radius: 0;
}

.industry-item:hover,
.industry-item.active {
  color: var(--nav-purple);
  filter: none;
}

.industry-caret {
  color: #94a3b8;
  font-size: 11px;
}

.industry-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.industry-item small {
  color: #94a3b8;
}

.industry-children {
  display: grid;
  gap: 2px;
  padding: 0 0 4px 34px;
}

.industry-children button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 30px;
  padding: 4px 0;
  background: transparent;
  color: #64748b;
  text-align: left;
}

.industry-children button:hover,
.industry-children button.active {
  color: var(--nav-purple);
  filter: none;
}

.industry-children span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #54bd8b;
}

.industry-children small {
  color: #94a3b8;
}

.invest-workspace {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: 26px 28px 34px;
}

.invest-search {
  height: 38px;
  max-width: 386px;
  background: #fff;
}

.invest-summary {
  justify-self: end;
  display: flex;
  gap: 18px;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
}

.invest-summary strong {
  color: #0f172a;
}

.invest-summary span:nth-child(2) strong {
  color: #047857;
}

.invest-summary span:nth-child(3) strong {
  color: #1d4ed8;
}

.invest-summary span:nth-child(4) strong {
  color: var(--nav-purple);
}

.invest-tabs {
  display: flex;
  gap: 28px;
  padding-top: 0;
  border-bottom: 1px solid var(--line);
}

.invest-tab {
  position: relative;
  padding: 10px 0 12px;
  background: transparent;
  color: #64748b;
  font-weight: 800;
}

.invest-tab.active {
  color: var(--nav-purple);
}

.invest-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--nav-purple);
}

.invest-filterbar,
.invest-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.status-filters,
.invest-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.invest-actions #newEnterpriseBtn {
  display: none;
}

.status-filters > span {
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 11px;
  background: #fff;
  color: #475569;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.status-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #54bd8b;
}

.status-chip strong {
  color: #94a3b8;
  font-weight: 700;
}

.status-chip.active,
.active-sort {
  color: var(--nav-purple);
  border: 1px solid var(--nav-purple);
  background: #fff;
}

.invest-actions .ghost,
.invest-count-row .ghost {
  min-height: 34px;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #334155;
}

.invest-actions .active-sort {
  color: var(--nav-purple);
  border-color: var(--nav-purple);
}

.invest-count-row {
  margin-bottom: 18px;
  color: #64748b;
}

.invest-count-row strong {
  color: #0f172a;
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 12px;
}

.company-card {
  display: grid;
  gap: 11px;
  min-height: 178px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.company-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.company-card h3 {
  margin: 0;
  font-size: 17px;
}

.company-card p,
.company-meta {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.company-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.company-tags span {
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
}

.company-channel {
  padding: 10px 12px;
  border-left: 3px solid var(--nav-purple);
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.company-actions {
  margin-top: auto;
}

.company-actions button {
  background: #eef2ff;
  color: #1d4ed8;
}

.ai-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  min-height: 680px;
}

.session-list,
.chat,
.agent-card,
.inline-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.session-list {
  padding: 10px;
  overflow: auto;
}

.session-item {
  display: grid;
  width: 100%;
  gap: 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
}

.session-item:hover {
  background: #eef4f6;
}

.session-item small {
  color: var(--muted);
}

.session-more-button {
  width: 100%;
  min-height: 36px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--accent);
  cursor: pointer;
}

.session-more-button:hover:not(:disabled) {
  background: #eef4f6;
}

.session-more-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.chat-head,
.chat-form,
.inline-form {
  padding: 12px;
}

.messages {
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.message {
  max-width: 78%;
  white-space: pre-wrap;
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef4f6;
}

.message.user {
  margin-left: auto;
  background: #dcfce7;
}

.ai-brain {
  position: relative;
  display: grid;
  gap: 28px;
}

.workbench.ai-mode {
  padding-top: 12px;
}

.workbench.ai-mode .topbar {
  margin-bottom: 8px;
}

.workbench.ai-mode .ai-brain {
  gap: 16px;
}

.workbench.ai-mode .ai-hero-panel {
  gap: 8px;
  padding: 8px 0 0;
}

.workbench.ai-mode .ai-hero-panel p {
  margin-bottom: 8px;
}

.ai-engine-label {
  position: absolute;
  top: -58px;
  right: 0;
  color: #475569;
  font-size: 14px;
}

.ai-hero-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 34px 0 16px;
}

.ai-hero-panel h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
}

.ai-hero-panel p {
  margin: 0 0 18px;
  color: #4b5563;
}

.ai-query-form {
  width: min(960px, 100%);
  min-height: 66px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 10px 10px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(16 32 39 / 8%);
}

.ai-query-icon {
  color: #111827;
  font-size: 32px;
  line-height: 1;
}

.ai-query-form input {
  border: 0;
  padding: 10px 0;
  color: var(--ink);
  font-size: 16px;
}

.ai-query-form input:focus {
  outline: 0;
}

.ai-query-form button,
.model-option.active {
  background: var(--nav-purple);
}

.ai-control-grid,
.ai-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

.ai-work-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
}

.ai-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
}

.ai-panel h3 {
  margin: 0;
  font-size: 20px;
}

.model-options {
  display: grid;
  gap: 10px;
}

.model-option {
  min-height: 50px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
}

.model-option:hover {
  border-color: var(--nav-purple);
  filter: none;
}

.model-option.active {
  color: #111827;
  background: #faf7ff;
  border-color: var(--nav-purple);
}

.model-radio {
  width: 14px;
  height: 14px;
  border: 2px solid #9ca3af;
  border-radius: 50%;
}

.model-option.active .model-radio {
  border-color: var(--nav-purple);
  box-shadow: inset 0 0 0 3px #fff;
  background: var(--nav-purple);
}

.model-option small {
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef2f7;
  color: #64748b;
  text-align: center;
}

.model-add-controls {
  display: block;
  margin-top: 12px;
}

.model-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  position: relative;
}

.model-picker {
  position: relative;
  min-width: 0;
}

.model-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.model-picker-trigger:hover {
  filter: none;
  border-color: var(--nav-purple);
}

.model-picker-arrow {
  margin-left: 8px;
  color: var(--muted);
}

.model-picker-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  left: 0;
  z-index: 20;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.model-picker-menu > input {
  width: 100%;
  min-height: 36px;
  margin-bottom: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}

.model-picker-options {
  max-height: 250px;
  overflow-y: auto;
}

.model-picker-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.model-picker-option:hover,
.model-picker-option.active {
  background: var(--nav-purple-soft);
  color: var(--nav-purple);
}

.model-picker-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-picker-option small {
  color: var(--muted);
  white-space: nowrap;
}

.model-picker-empty {
  padding: 12px 8px;
  color: var(--muted);
  font-size: 13px;
}

.model-add-controls button {
  min-width: 72px;
  padding: 8px 16px;
}

.model-add-controls button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.model-display-summary {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.dify-config-panel {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dify-config-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dify-config-title h3 {
  margin: 0;
}

.dify-config-permission-hint {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #dbe4ef;
  border-radius: 6px;
  background: #f7f9fc;
  color: #526072;
  font-size: 12px;
  line-height: 1.5;
}

.dify-config-panel.read-only input:disabled {
  background: #f3f6f9;
  color: #7b8797;
  cursor: not-allowed;
  opacity: 1;
}

.dify-config-panel h4 {
  margin: 0;
  font-size: 15px;
}

.dify-config-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.dify-config-panel input {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.dify-config-actions {
  display: flex;
  gap: 8px;
}

.dify-config-actions button {
  flex: 1;
}

.secondary-button {
  background: #eef2f7;
  color: var(--ink);
}

.config-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.config-hint.config-ready {
  color: #047857;
}

.config-hint.config-missing {
  color: #b45309;
}

.ai-result-panel {
  min-height: 360px;
}

.ai-messages {
  min-height: 280px;
  padding: 0;
}

.ai-empty-result,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.session-list .empty-state {
  min-height: 120px;
}

.session-item.active {
  background: var(--nav-purple-soft);
  color: var(--nav-purple);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.agent-card {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.agent-card h3 {
  margin: 0;
}

.agent-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.inline-form {
  align-items: end;
}

.inline-form input,
.inline-form select {
  max-width: 220px;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(720px, calc(100vw - 32px));
  box-shadow: 0 24px 70px rgb(16 32 39 / 28%);
}

dialog::backdrop {
  background: rgb(16 32 39 / 38%);
}

.dialog-form {
  padding: 22px;
  display: grid;
  gap: 12px;
}

.dialog-form h2 {
  margin: 0 0 4px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.permission-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.role-permission-editor {
  display: grid;
  gap: 14px;
}

.role-menu-add {
  display: flex;
  gap: 10px;
  align-items: center;
}

.role-menu-add select,
.role-secondary-select {
  width: auto;
  min-width: 160px;
}

.role-secondary-select {
  padding: 6px 8px;
  font-size: 13px;
}

.role-secondary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-secondary-actions .ghost {
  padding: 6px 10px;
  font-size: 13px;
}

.role-secondary-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.role-secondary-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.role-secondary-picker input {
  width: auto;
  padding: 0;
}

.role-secondary-picker button {
  padding: 6px 10px;
  font-size: 13px;
}

.remove-bound-menu {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 4px;
  background: #fff1f2;
  color: #dc2626;
  font-size: 18px;
  line-height: 1;
}

.remove-bound-menu:hover {
  background: #fee2e2;
  filter: none;
}

.role-menu-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.permission-module {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.permission-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.permission-module-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.permission-module-title input,
.permission-menu-row input {
  width: auto;
  padding: 0;
}

.permission-menu-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.permission-module.collapsed .permission-menu-list {
  display: none;
}

.permission-collapse-btn {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  background: #f1f5f9;
  color: #475569;
  font-size: 18px;
  line-height: 1;
}

.permission-collapse-btn:hover {
  background: #ede9fe;
  color: var(--nav-purple);
  filter: none;
}

.permission-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 6px;
}

.permission-menu-row > label,
.permission-actions label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}

.permission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.permission-fields legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 14px;
}

.permission-fields label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.permission-fields input {
  width: auto;
  padding: 0;
}

.role-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  text-align: center;
  background: #102027;
  color: #fff;
  padding: 13px 18px;
  border-radius: 6px;
  box-shadow: 0 16px 42px rgb(16 32 39 / 28%);
  z-index: 1000;
}

.toast.success {
  border: 1px solid #b7e5aa;
  background: #f2fff0;
  color: #50b52f;
  box-shadow: 0 12px 32px rgb(63 135 42 / 18%);
}

.toast.success::before {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  margin-right: 7px;
  border-radius: 50%;
  background: #58bd36;
  color: #fff;
  content: "✓";
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 78px 1fr;
  }

  .sidebar {
    position: relative;
    z-index: 2;
  }

  nav {
    grid-template-columns: 1fr;
  }

  .brand-full,
  .nav-label,
  .lock,
  .user-box span {
    display: none;
  }

  .brand-short {
    display: inline;
  }

  .nav {
    justify-content: center;
    padding: 9px 0;
  }

  .user-box {
    margin-top: 0;
    padding: 12px 10px 20px;
  }

  .workbench {
    padding: 16px;
  }

  .module-nav {
    margin: -16px -16px 16px;
    padding: 0 12px;
  }

  .invest-board {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    margin: 0;
  }

  .workbench.invest-mode .invest-board {
    margin: -16px;
  }

  .workbench.system-mode #systemView {
    margin: -16px -16px -16px;
  }

  .workbench.system-mode #systemView .toolbar {
    min-height: auto;
    padding: 16px;
    flex-wrap: wrap;
  }

  .workbench.system-mode #systemView .table-wrap,
  .workbench.system-mode #permissionPanel {
    margin: 16px;
    padding: 0;
  }

  .invest-header {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .invest-title-search {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .invest-rail {
    grid-column: 1;
    grid-row: 2;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }

  .invest-board-title {
    min-height: auto;
    padding: 0;
    border-right: 0;
  }

  .invest-workspace {
    grid-column: 1;
    grid-row: 3;
    padding: 16px;
  }

  .invest-summary {
    justify-self: stretch;
    flex-wrap: wrap;
  }

  .invest-filterbar,
  .invest-count-row {
    align-items: stretch;
    flex-direction: column;
  }

  .company-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .agent-grid,
  .ai-layout,
  .ai-control-grid,
  .ai-work-grid {
    grid-template-columns: 1fr;
  }

  .permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-engine-label {
    position: static;
    justify-self: end;
  }

  .ai-hero-panel h2 {
    font-size: 28px;
  }

  .ai-query-form {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .ai-query-icon {
    display: none;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .permission-card {
    min-height: 0;
  }
}

/* Native knowledge workspace backed by the Dify Dataset API. */
.workbench.knowledge-mode .topbar {
  display: none;
}

.workbench.knowledge-mode #knowledgeView {
  min-width: 0;
  min-height: calc(100vh - 64px);
  margin: -24px;
}

.knowledge-board {
  min-width: 0;
  min-height: calc(100vh - 64px);
  padding: 22px 26px 32px;
  background: #f3f5f8;
}

.knowledge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  margin: -22px -26px 20px;
  padding: 12px 26px;
  border-bottom: 1px solid #dfe5ec;
  background: #fff;
}

.knowledge-header h2,
.knowledge-header p,
.knowledge-retrieval-query h3,
.knowledge-retrieval-query p,
.knowledge-section-title h3 {
  margin: 0;
}

.knowledge-header h2 {
  color: #172033;
  font-size: 19px;
}

.knowledge-header p {
  margin-top: 4px;
  color: #788497;
  font-size: 13px;
}

.knowledge-header-actions,
.knowledge-card-actions,
.knowledge-row-actions,
.knowledge-detail-title,
.knowledge-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.knowledge-header-actions button,
.knowledge-toolbar button,
.knowledge-card-actions button,
.knowledge-row-actions button,
.knowledge-pagination button,
.knowledge-back {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 13px;
  white-space: nowrap;
}

.knowledge-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid #dfe5ec;
  border-radius: 7px;
  background: #fff;
}

.knowledge-toolbar > span {
  margin-left: auto;
  color: #758195;
  font-size: 13px;
}

.knowledge-toolbar > span strong {
  color: #27364a;
}

.knowledge-search {
  display: flex;
  align-items: center;
  min-width: 0;
  width: min(430px, 100%);
}

.knowledge-search input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 36px;
  padding: 7px 11px;
  border: 1px solid #d8e0e9;
  border-right: 0;
  border-radius: 5px 0 0 5px;
  outline: none;
}

.knowledge-search input:focus {
  border-color: #7c3aed;
  box-shadow: inset 0 0 0 1px #7c3aed;
}

.knowledge-search button {
  flex: 0 0 auto;
  height: 36px;
  min-width: 58px;
  border-radius: 0 5px 5px 0;
  background: #6d42d8;
  white-space: nowrap;
}

.knowledge-search-with-clear {
  position: relative;
}

.knowledge-search-with-clear input {
  padding-right: 38px;
}

.knowledge-search-with-clear .knowledge-search-clear {
  position: absolute;
  top: 50%;
  right: 62px;
  z-index: 1;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8a95a5;
  font-size: 20px;
  line-height: 28px;
  transform: translateY(-50%);
}

.knowledge-search-with-clear .knowledge-search-clear:hover {
  background: #eef1f5;
  color: #344054;
  filter: none;
}

.knowledge-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.knowledge-card {
  display: grid;
  grid-template-rows: auto minmax(48px, 1fr) auto auto;
  gap: 13px;
  min-height: 218px;
  padding: 17px 17px 0;
  overflow: hidden;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 10px rgb(16 24 40 / 4%);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.knowledge-card:hover {
  border-color: #bfcbe0;
  box-shadow: 0 10px 24px rgb(16 24 40 / 9%);
  transform: translateY(-2px);
}

.knowledge-card-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.knowledge-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #c9d9ff;
  border-radius: 7px;
  background: #edf3ff;
  color: #315bb5;
  font-weight: 800;
}

.knowledge-card h3 {
  margin: 0 0 5px;
  overflow: hidden;
  color: #172033;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-index-type {
  color: #69778a;
  font-size: 12px;
}

.knowledge-health,
.knowledge-doc-status,
.knowledge-enabled {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-style: normal;
}

.knowledge-health.ready,
.knowledge-doc-status.success,
.knowledge-enabled.on {
  background: #eaf8ee;
  color: #237a3c;
}

.knowledge-health.unavailable,
.knowledge-doc-status.danger,
.knowledge-enabled.off {
  background: #fff0f0;
  color: #b42318;
}

.knowledge-doc-status.pending {
  background: #fff6dd;
  color: #9a6700;
}

.knowledge-doc-status.neutral {
  background: #eef2f6;
  color: #59677a;
}

.knowledge-card > p {
  margin: 0;
  overflow: hidden;
  color: #69778a;
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.knowledge-card-meta {
  display: flex;
  gap: 14px;
  color: #8792a3;
  font-size: 12px;
}

.knowledge-card-actions {
  min-height: 48px;
  margin: 0 -17px;
  padding: 8px 17px;
  border-top: 1px solid #edf0f4;
  cursor: default;
}

.knowledge-card-actions button:first-child {
  color: #315bb5;
}

.danger-text {
  border: 1px solid #f0c8cc;
  background: #fff;
  color: #b42318;
}

.danger-text:hover {
  background: #fff2f3;
  filter: none;
}

.knowledge-detail-title {
  min-width: 0;
}

.knowledge-back {
  flex: 0 0 auto;
  border: 1px solid #d8e0e9;
  background: #fff;
  color: #42526a;
}

.knowledge-tabs {
  display: flex;
  gap: 3px;
  margin: -4px 0 16px;
  border-bottom: 1px solid #dce3ec;
}

.knowledge-tabs button {
  position: relative;
  min-width: 92px;
  padding: 12px 16px;
  border-radius: 0;
  background: transparent;
  color: #657287;
}

.knowledge-tabs button.active {
  color: #6d42d8;
  font-weight: 700;
}

.knowledge-tabs button.active::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: #6d42d8;
  content: "";
}

.knowledge-document-toolbar > button {
  margin-left: 0;
}

.knowledge-table-wrap {
  overflow: auto;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
}

.knowledge-table-wrap table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

.knowledge-table-wrap th,
.knowledge-table-wrap td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f4;
  color: #3b485a;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}

.knowledge-table-wrap th {
  background: #f7f9fb;
  color: #687588;
  font-size: 12px;
  white-space: nowrap;
}

.knowledge-table-wrap td:first-child {
  min-width: 250px;
}

.knowledge-table-wrap th:last-child,
.knowledge-table-wrap td:last-child {
  width: 132px;
  min-width: 132px;
}

.knowledge-table-wrap td strong,
.knowledge-table-wrap td small {
  display: block;
}

.knowledge-table-wrap td small {
  margin-top: 5px;
  color: #8a95a5;
  font-size: 11px;
}

.knowledge-document-link {
  display: block;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #315bb5;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-document-link:hover {
  color: #6d42d8;
  text-decoration: underline;
  filter: none;
}

.knowledge-error-text {
  max-width: 180px;
  overflow: hidden;
  color: #b42318 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-row-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 6px;
}

.knowledge-document-delete {
  min-height: 32px;
  padding: 5px 10px;
}

.knowledge-more-button {
  width: 34px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #59677a;
  font-size: 16px;
  line-height: 1;
}

.knowledge-more-button:hover {
  border-color: #d8e0e9;
  background: #f5f7fa;
  filter: none;
}

.knowledge-document-menu {
  position: fixed;
  z-index: 1200;
  width: 160px;
  padding: 5px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(16 24 40 / 16%);
}

.knowledge-document-menu button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: #344054;
  text-align: left;
}

.knowledge-document-menu button:hover {
  background: #f3f5f8;
  filter: none;
}

.knowledge-document-menu hr { margin: 4px 2px; border: 0; border-top: 1px solid #edf0f4; }

.knowledge-document-settings-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-width: 1120px;
  padding: 0;
  overflow: hidden;
}

.knowledge-document-settings-form {
  display: grid;
  max-height: min(760px, calc(100vh - 32px));
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.knowledge-document-settings-form > .knowledge-state { min-height: 260px; }

.knowledge-document-settings-content {
  display: block;
  overflow: auto;
}

.knowledge-document-settings-editor { padding: 20px 24px; }

.knowledge-document-settings-content.preview-mode {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 44%);
  overflow: hidden;
}

.knowledge-document-settings-content.preview-mode .knowledge-document-settings-editor { overflow-y: auto; }

.knowledge-document-qa-settings {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #edf0f4;
}

.knowledge-qa-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #f5d8a8;
  border-radius: 7px;
  background: linear-gradient(90deg, #fff5e6, #fff);
  color: #7a4a06;
  font-size: 12px;
}

.knowledge-qa-warning strong {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: #e89221;
  color: #fff;
  font-size: 11px;
}

.knowledge-document-segment-actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #edf0f4;
}

.knowledge-document-preview-panel {
  min-width: 0;
  border-left: 1px solid #dce3ec;
  background: #f8fafc;
  overflow: hidden;
}

.knowledge-document-preview-panel > header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #dce3ec;
  background: #fff;
}

.knowledge-document-preview-panel > header strong,
.knowledge-document-preview-panel > header small { display: block; }
.knowledge-document-preview-panel > header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-document-preview-panel > header small { margin-top: 4px; color: #7b8798; }
.knowledge-document-preview-panel > header button { width: 32px; min-width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: #667085; font-size: 22px; }
.knowledge-document-preview-panel .knowledge-preview-content { height: calc(100% - 64px); overflow-y: auto; }

.knowledge-document-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #f8fafc;
}

.knowledge-document-mode-row strong,
.knowledge-document-mode-row small { display: block; }
.knowledge-document-mode-row small { margin-top: 4px; color: #7b8798; font-size: 12px; }
.knowledge-document-mode-row > span { padding: 5px 9px; border-radius: 4px; background: #ece8fb; color: #6041b0; font-size: 12px; font-weight: 700; }
.knowledge-document-settings-content h4 { margin: 18px 0 10px; color: #344054; font-size: 13px; }
.knowledge-document-parent-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.knowledge-document-parent-options label { display: flex; gap: 9px; padding: 12px; border: 1px solid #dce3ec; border-radius: 7px; cursor: pointer; }
.knowledge-document-parent-options label:has(input:checked) { border-color: #7c62c8; background: #f7f5fd; }
.knowledge-document-parent-options span,
.knowledge-document-parent-options strong,
.knowledge-document-parent-options small { display: block; }
.knowledge-document-parent-options small { margin-top: 4px; color: #7b8798; font-size: 11px; }
.knowledge-document-preprocessing { margin-top: 18px; padding-top: 1px; border-top: 1px solid #edf0f4; }
.knowledge-document-settings-note { margin-top: 18px; padding: 10px 12px; border-radius: 6px; background: #f5f7fa; color: #687588; font-size: 12px; line-height: 1.6; }

.knowledge-document-readonly-config {
  display: grid;
  gap: 18px;
  margin: 22px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid #e3e8ef;
}

.knowledge-document-readonly-config legend {
  padding: 0 10px 0 0;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.knowledge-document-readonly-config legend span {
  margin-left: 8px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 500;
}

.knowledge-document-readonly-config section > h4 { margin-top: 0; }

.knowledge-readonly-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.knowledge-readonly-choice-grid.knowledge-readonly-retrieval {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.knowledge-readonly-choice-grid label {
  display: flex;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e3e8ef;
  border-radius: 7px;
  background: #f6f7f9;
  color: #98a2b3;
}

.knowledge-readonly-choice-grid label:has(input:checked) {
  border-color: #c5b9e8;
  background: #f1eef9;
  color: #75639f;
}

.knowledge-readonly-choice-grid input[type="radio"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: #8065ca;
}
.knowledge-readonly-choice-grid span,
.knowledge-readonly-choice-grid strong,
.knowledge-readonly-choice-grid small { display: block; min-width: 0; }
.knowledge-readonly-choice-grid small { margin-top: 4px; font-size: 11px; line-height: 1.5; }

.knowledge-readonly-input input,
.knowledge-readonly-model input,
.knowledge-readonly-weights input,
.knowledge-readonly-metrics input {
  border-color: #e1e6ed;
  background: #eef1f5;
  color: #7c8797;
  opacity: 1;
  -webkit-text-fill-color: #7c8797;
}

.knowledge-readonly-input small,
.knowledge-readonly-model small {
  display: block;
  margin-top: 5px;
  color: #98a2b3;
  font-size: 11px;
}

.knowledge-readonly-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.knowledge-readonly-metrics label { color: #7c8797; font-size: 12px; }
.knowledge-readonly-metrics label > input { margin-top: 6px; }
.knowledge-readonly-score > span { display: flex; align-items: center; gap: 6px; }
.knowledge-readonly-score > span input { width: auto; margin: 0; }

.knowledge-readonly-model,
.knowledge-readonly-weights {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e3e8ef;
  border-radius: 7px;
  background: #f7f8fa;
}

.knowledge-readonly-model > strong,
.knowledge-readonly-weights > strong {
  display: block;
  margin-bottom: 8px;
  color: #7c8797;
  font-size: 12px;
}

.knowledge-readonly-weights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.knowledge-readonly-weights > strong { grid-column: 1 / -1; margin-bottom: 0; }
.knowledge-readonly-weights label { color: #98a2b3; font-size: 11px; }
.knowledge-readonly-weights input { margin-top: 5px; }

.knowledge-document-readonly-config > p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f5f7fa;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .knowledge-document-settings-editor { padding: 16px; }
  .knowledge-document-settings-content.preview-mode { display: block; overflow-y: auto; }
  .knowledge-document-settings-content.preview-mode .knowledge-document-settings-editor { overflow: visible; }
  .knowledge-document-preview-panel { min-height: 360px; border-top: 1px solid #dce3ec; border-left: 0; }
  .knowledge-document-parent-options { grid-template-columns: 1fr; }
  .knowledge-readonly-choice-grid,
  .knowledge-readonly-choice-grid.knowledge-readonly-retrieval,
  .knowledge-readonly-metrics { grid-template-columns: 1fr; }
}

.knowledge-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 58px;
  color: #687588;
  font-size: 13px;
}

.knowledge-pagination button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.knowledge-segment-page {
  min-width: 0;
}

.knowledge-segment-header {
  margin-bottom: 14px;
}

.knowledge-segment-header > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.knowledge-segment-header > div > div {
  min-width: 0;
}

.knowledge-segment-header h3,
.knowledge-segment-header p {
  margin: 0;
}

.knowledge-segment-header h3 {
  overflow: hidden;
  color: #172033;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-segment-header p {
  margin-top: 4px;
  color: #788497;
  font-size: 12px;
}

.knowledge-segment-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #dfe5ec;
  border-radius: 7px;
  background: #fff;
}

.knowledge-segment-toolbar > label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #687588;
  font-size: 13px;
  white-space: nowrap;
}

.knowledge-segment-toolbar select {
  width: 82px;
  height: 36px;
  padding: 6px 8px;
  border: 1px solid #d8e0e9;
  border-radius: 5px;
  background: #fff;
}

.knowledge-segment-list {
  overflow: hidden;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
}

.knowledge-segment-item {
  padding: 17px 18px;
  border-bottom: 1px solid #e8edf3;
}

.knowledge-segment-item:last-child {
  border-bottom: 0;
}

.knowledge-segment-item > header,
.knowledge-segment-item > header > div,
.knowledge-segment-item > footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.knowledge-segment-item > header {
  justify-content: space-between;
  margin-bottom: 13px;
}

.knowledge-segment-item > header > strong {
  color: #344054;
  font-size: 13px;
}

.knowledge-segment-content,
.knowledge-segment-qa p,
.knowledge-segment-parent p,
.knowledge-child-chunks p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #344054;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.knowledge-segment-qa {
  display: grid;
  gap: 12px;
}

.knowledge-segment-qa > div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
}

.knowledge-segment-qa b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 4px;
  background: #edf3ff;
  color: #315bb5;
  font-size: 12px;
}

.knowledge-segment-qa > div + div b {
  background: #edf8f2;
  color: #237a3c;
}

.knowledge-segment-parent > span {
  display: inline-block;
  margin-bottom: 7px;
  color: #6d42d8;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-child-chunks {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid #d7cdf5;
  background: #faf9fd;
}

.knowledge-child-chunks > strong {
  display: block;
  margin-bottom: 9px;
  color: #5f6d81;
  font-size: 12px;
}

.knowledge-child-chunks > div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #e9e4f6;
}

.knowledge-child-chunks > div > span {
  color: #8a76c7;
  font-size: 12px;
}

.knowledge-segment-item > footer {
  flex-wrap: wrap;
  margin-top: 14px;
  color: #8490a1;
  font-size: 12px;
}

.knowledge-segment-item > footer span + span::before {
  margin-right: 8px;
  color: #c4cbd5;
  content: "·";
}

.knowledge-segment-error {
  margin: 10px 0 0;
  color: #b42318;
  font-size: 12px;
}

.knowledge-segment-pagination button.active {
  border-color: #6d42d8;
  background: #6d42d8;
  color: #fff;
}

.knowledge-retrieval-layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 18px;
}

.knowledge-retrieval-query,
.knowledge-retrieval-results {
  padding: 18px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
}

.knowledge-retrieval-query p {
  margin-top: 7px;
  color: #758195;
  font-size: 13px;
  line-height: 1.6;
}

.knowledge-retrieve-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.knowledge-retrieve-form textarea {
  min-height: 150px;
  resize: vertical;
}

.knowledge-section-title {
  justify-content: space-between;
  margin-bottom: 14px;
}

.knowledge-section-title span {
  color: #758195;
  font-size: 12px;
}

.knowledge-retrieval-record {
  padding: 14px 0;
  border-top: 1px solid #edf0f4;
}

.knowledge-retrieval-record:first-child {
  border-top: 0;
}

.knowledge-retrieval-record > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.knowledge-retrieval-record span {
  color: #237a3c;
  font-size: 12px;
  white-space: nowrap;
}

.knowledge-retrieval-record p {
  margin: 8px 0 0;
  color: #536174;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.knowledge-empty,
.knowledge-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  color: #7b8798;
  text-align: center;
}

.knowledge-empty {
  grid-column: 1 / -1;
}

.knowledge-empty strong,
.knowledge-state strong {
  color: #344054;
}

.knowledge-empty span,
.knowledge-state p {
  margin: 0;
  font-size: 13px;
}

.knowledge-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dfe5ec;
  border-top-color: #6d42d8;
  border-radius: 50%;
  animation: knowledge-spin 800ms linear infinite;
}

@keyframes knowledge-spin { to { transform: rotate(360deg); } }

.knowledge-dialog-form {
  width: min(580px, calc(100vw - 32px));
}

.knowledge-dialog-form textarea {
  resize: vertical;
}

.knowledge-dataset-dialog-form {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.knowledge-dataset-index-note,
.knowledge-dataset-upgrade-warning {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #d99a24;
  border-radius: 5px;
  background: #fff8e8;
  color: #805c16;
  font-size: 12px;
  line-height: 1.6;
}

.knowledge-dataset-index-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #f8fafc;
}

.knowledge-dataset-index-panel > strong,
.knowledge-dataset-index-panel legend {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.knowledge-dataset-fixed-retrieval {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #cfd8e5;
  border-radius: 6px;
  background: #fff;
}

.knowledge-dataset-fixed-retrieval b {
  color: #344054;
  font-size: 13px;
}

.knowledge-dataset-fixed-retrieval span {
  color: #7b8798;
  font-size: 12px;
}

.knowledge-dataset-index-panel fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
}

.knowledge-dataset-index-panel fieldset label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.knowledge-dataset-index-panel fieldset label:has(input:checked) {
  border-color: #7c62c8;
  background: #f7f5fd;
}

.knowledge-dataset-index-panel fieldset input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin-top: 2px;
}

.knowledge-dataset-index-panel fieldset span,
.knowledge-dataset-index-panel fieldset strong,
.knowledge-dataset-index-panel fieldset small {
  display: block;
}

.knowledge-dataset-index-panel fieldset strong {
  color: #344054;
  font-size: 12px;
}

.knowledge-dataset-index-panel fieldset small {
  margin-top: 4px;
  color: #7b8798;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .knowledge-dataset-index-panel fieldset { grid-template-columns: 1fr; }
}

.knowledge-process-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe5ec;
  border-radius: 6px;
  background: #f8fafc;
}

.knowledge-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: 400 !important;
}

.knowledge-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
}

.knowledge-dialog-hint {
  margin: 0;
  color: #7b8798;
  font-size: 12px;
  line-height: 1.6;
}

.knowledge-upload-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
}

.knowledge-upload-form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: calc(100vh - 32px);
  background: #f5f7fa;
}

.knowledge-upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 12px 22px;
  border-bottom: 1px solid #e2e7ee;
  background: #fff;
}

.knowledge-upload-header h2,
.knowledge-upload-header p,
.knowledge-setting-heading h3,
.knowledge-setting-heading p,
.knowledge-upload-summary h3,
.knowledge-upload-summary > p {
  margin: 0;
}

.knowledge-upload-summary-panel > p,
#knowledgeUploadSummaryPanel > p {
  margin: 5px 0 0;
  color: #8792a3;
  font-size: 12px;
  line-height: 1.5;
}

.knowledge-upload-settings-step.preview-mode {
  grid-template-columns: minmax(0, 1fr) minmax(420px, .95fr);
}

.knowledge-upload-settings-step.preview-mode .knowledge-upload-summary {
  padding: 0;
}

.knowledge-dify-preview {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: #fff;
}

.knowledge-dify-preview > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 78px;
  padding: 12px 16px;
  border-bottom: 1px solid #e6ebf1;
}

.knowledge-dify-preview > header > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.knowledge-dify-preview > header > div:last-child {
  justify-items: end;
}

.knowledge-dify-preview > header span {
  color: #315cff;
  font-size: 11px;
  font-weight: 700;
}

.knowledge-dify-preview > header strong {
  max-width: 260px;
  overflow: hidden;
  color: #172033;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.knowledge-dify-preview > header small {
  color: #667085;
  font-size: 11px;
}

.knowledge-dify-preview > header button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.knowledge-preview-content {
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #8c98aa #edf1f5;
  scrollbar-width: thin;
}

.knowledge-preview-chunk {
  padding: 0 0 18px;
  color: #27364a;
}

.knowledge-preview-chunk + .knowledge-preview-chunk {
  padding-top: 18px;
  border-top: 1px solid #edf0f4;
}

.knowledge-preview-chunk header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  color: #667085;
}

.knowledge-preview-chunk header span,
.knowledge-preview-chunk header small,
.knowledge-preview-chunk header i {
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.knowledge-preview-chunk > p {
  margin: 7px 0 0;
  color: #27364a;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.knowledge-preview-qa {
  position: relative;
  padding-left: 22px;
}

.knowledge-preview-qa b {
  position: absolute;
  left: 0;
  color: #315cff;
}

.knowledge-preview-parent span {
  display: inline;
}

.knowledge-preview-parent i {
  margin-right: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #edf3ff;
  color: #315cff;
  font-size: 10px;
  font-style: normal;
}

.knowledge-preview-loading,
.knowledge-preview-error {
  display: grid;
  min-height: 220px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #7b8798;
  text-align: center;
}

.knowledge-preview-loading p,
.knowledge-preview-error p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.knowledge-preview-error strong {
  color: #b42318;
}

.knowledge-upload-header h2 {
  color: #172033;
  font-size: 19px;
}

.knowledge-upload-header p {
  margin-top: 4px;
  color: #7b8798;
  font-size: 12px;
}

.knowledge-upload-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 20px;
  border-bottom: 1px solid #e2e7ee;
  background: #fff;
}

.knowledge-upload-steps span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8a95a5;
  font-size: 13px;
  font-weight: 600;
}

.knowledge-upload-steps span i {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #d5dce6;
  border-radius: 50%;
  background: #fff;
  color: #7b8798;
  font-size: 12px;
  font-style: normal;
}

.knowledge-upload-steps span.active {
  color: #315bb5;
}

.knowledge-upload-steps span.active i {
  border-color: #315bb5;
  background: #315bb5;
  color: #fff;
}

.knowledge-upload-steps b {
  width: 76px;
  height: 1px;
  background: #d9e0e9;
}

.knowledge-upload-file-step {
  display: grid;
  grid-template-rows: minmax(240px, 1fr) auto auto;
  gap: 16px;
  min-height: 500px;
  padding: 28px;
}

.knowledge-file-drop {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  min-height: 260px;
  border: 1px dashed #aebbd0;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  cursor: pointer;
}

.knowledge-file-drop:hover {
  border-color: #315bb5;
  background: #f8faff;
}

.knowledge-file-drop input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.knowledge-file-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #eaf0ff;
  color: #315bb5;
  font-size: 26px;
}

.knowledge-file-drop small {
  max-width: calc(100% - 24px);
  color: #8a95a5;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}

.knowledge-selected-files-section {
  min-height: 86px;
  border: 1px solid #e0e6ee;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.knowledge-selected-files-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 13px;
  border-bottom: 1px solid #edf0f4;
}

.knowledge-selected-files-section > header span {
  color: #7b8798;
}

.knowledge-selected-files-section > header strong { color: #344054; }

.knowledge-selected-files {
  display: grid;
  max-height: 190px;
  overflow-y: auto;
}

.knowledge-selected-file-item,
.knowledge-batch-file {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px;
}

.knowledge-selected-file-item + .knowledge-selected-file-item,
.knowledge-batch-file + .knowledge-batch-file { border-top: 1px solid #edf0f4; }

.knowledge-selected-file-item strong,
.knowledge-selected-file-item small,
.knowledge-batch-file strong,
.knowledge-batch-file small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-selected-file-item strong,
.knowledge-batch-file strong { color: #344054; font-size: 12px; }
.knowledge-selected-file-item small,
.knowledge-batch-file small { margin-top: 3px; color: #8a95a5; font-size: 11px; }

.knowledge-file-type {
  display: grid;
  width: 38px;
  height: 34px;
  place-items: center;
  border-radius: 5px;
  background: #edf3ff;
  color: #315bb5;
  font-size: 9px;
  font-weight: 800;
}

.knowledge-selected-file-item > button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8490a2;
  font-size: 20px;
}

.knowledge-selected-file-item > button:hover { background: #fff1f2; color: #b42318; filter: none; }
.knowledge-selected-file-empty { display: grid; min-height: 54px; place-items: center; color: #98a2b3; font-size: 12px; }

.knowledge-upload-processing-step {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 500px;
  padding: 28px;
  overflow: hidden;
}

.knowledge-batch-progress-head { display: flex; align-items: center; gap: 13px; }
.knowledge-batch-progress-head h3,
.knowledge-batch-progress-head p { margin: 0; }
.knowledge-batch-progress-head h3 { color: #243044; font-size: 16px; }
.knowledge-batch-progress-head p { margin-top: 4px; color: #7b8798; font-size: 12px; }
.knowledge-batch-progress { height: 7px; margin: 18px 0; overflow: hidden; border-radius: 5px; background: #e8edf4; }
.knowledge-batch-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: #315bb5; transition: width 180ms ease; }
.knowledge-batch-progress i.complete { background: #16835f; transition: none; }
.knowledge-batch-complete-icon { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; background: #e8f7f1; color: #16835f; font-size: 16px; font-weight: 800; }
.knowledge-batch-files { overflow-y: auto; border: 1px solid #e0e6ee; border-radius: 7px; background: #fff; }
.knowledge-batch-file em { max-width: 180px; color: #7b8798; font-size: 11px; font-style: normal; text-align: right; overflow-wrap: anywhere; }
.knowledge-batch-file em.uploading { color: #315bb5; }
.knowledge-batch-file em.success { color: #16835f; }
.knowledge-batch-file em.error { color: #b42318; }
.knowledge-upload-processing-step > .knowledge-upload-footer { margin: 18px -28px -28px; }

.knowledge-upload-settings-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.knowledge-upload-settings-main {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 18px 10px 18px 18px;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-color: #758195 #e2e7ed;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.knowledge-upload-settings-main::-webkit-scrollbar {
  width: 12px;
}

.knowledge-upload-settings-main::-webkit-scrollbar-track {
  border-radius: 8px;
  background: #e2e7ed;
}

.knowledge-upload-settings-main::-webkit-scrollbar-thumb {
  border: 2px solid #e2e7ed;
  border-radius: 8px;
  background: #758195;
}

.knowledge-upload-settings-main::-webkit-scrollbar-thumb:hover {
  background: #7d899a;
}

.knowledge-setting-section {
  overflow: hidden;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
}

.knowledge-setting-section.knowledge-setting-locked {
  border-color: #e2e6ec;
  background: #f5f6f8;
}

.knowledge-setting-section.knowledge-setting-locked .knowledge-setting-heading,
.knowledge-setting-section.knowledge-setting-locked .knowledge-setting-body {
  background: #f5f6f8;
}

.knowledge-setting-section.knowledge-setting-locked :is(input, select) {
  border-color: #dfe3e8;
  background: #eceff3;
  color: #7c8797;
  opacity: 1;
  -webkit-text-fill-color: #7c8797;
}

.knowledge-setting-section.knowledge-setting-locked label,
.knowledge-setting-section.knowledge-setting-locked small { color: #8b95a4; }

.knowledge-setting-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf0f4;
}

.knowledge-setting-heading > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 6px;
  background: #edf3ff;
  color: #315bb5;
  font-size: 12px;
  font-weight: 800;
}

.knowledge-setting-heading h3 {
  color: #243044;
  font-size: 14px;
}

.knowledge-setting-heading p {
  margin-top: 3px;
  color: #8792a3;
  font-size: 11px;
}

.knowledge-setting-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.knowledge-setting-body > label,
.knowledge-retrieval-controls > label,
.knowledge-model-field {
  display: grid;
  gap: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.knowledge-setting-body :is(input[type="text"], input[type="number"], select),
.knowledge-retrieval-controls input,
.knowledge-rerank-row select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #d8e0e9;
  border-radius: 5px;
  background: #fff;
  color: #27364a;
}

.knowledge-choice-grid {
  display: grid;
  gap: 9px;
}

.knowledge-index-choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.knowledge-retrieval-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.knowledge-segment-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.knowledge-segment-stack {
  gap: 8px;
  background: #fbfcfe;
}

.knowledge-segment-mode {
  overflow: hidden;
  border: 1px solid #dfe4eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 4%);
}

.knowledge-segment-mode:has(.knowledge-segment-mode-head > input:checked) {
  border-color: #3165ff;
  box-shadow: 0 0 0 1px #3165ff;
}

.knowledge-segment-mode-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  background: #f8f9fb;
  cursor: pointer;
}

.knowledge-segment-mode-head > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.knowledge-segment-mode-head > i {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 10px rgb(15 23 42 / 12%);
  color: #315cff;
  font-style: normal;
  font-size: 17px;
}

.knowledge-segment-mode:nth-of-type(2) .knowledge-segment-mode-head > i {
  color: #00a6d9;
}

.knowledge-segment-mode-head > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.knowledge-segment-mode-head strong {
  color: #172033;
  font-size: 14px;
}

.knowledge-segment-mode-head small {
  color: #667085;
  font-size: 11px;
  line-height: 1.45;
}

.knowledge-segment-mode-body {
  display: grid;
  gap: 14px;
  padding: 12px 16px 14px;
}

.knowledge-segment-mode-body h4 {
  margin: 3px 0 -5px;
  color: #1f2a44;
  font-size: 12px;
}

.knowledge-segment-mode-body .knowledge-process-grid {
  padding: 0;
  border: 0;
  background: transparent;
}

.knowledge-general-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.knowledge-parent-grid,
.knowledge-child-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0 52px 8px !important;
}

.knowledge-number-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid #d8e0e9;
  border-radius: 5px;
  background: #fff;
}

.knowledge-setting-body .knowledge-number-unit input[type="number"] {
  min-width: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
}

.knowledge-number-unit span {
  padding: 0 10px;
  color: #667085;
  font-size: 11px;
  font-weight: 400;
}

.knowledge-help {
  display: inline-grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid #b9c0cc;
  border-radius: 50%;
  color: #8a94a4;
  font-size: 9px;
  font-weight: 700;
  cursor: help;
}

.knowledge-rule-list-compact .knowledge-check {
  padding: 4px 0;
  border: 0;
  color: #27364a;
}

.knowledge-rule-list-compact .knowledge-check span {
  display: inline;
}

.knowledge-qa-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid #edf0f4;
}

.knowledge-qa-row select {
  width: 180px;
  min-height: 34px;
}

.knowledge-parent-option {
  position: relative;
  display: block;
  padding: 11px 42px 11px 52px;
  border: 1px solid #e0e5ec;
  border-radius: 8px;
  cursor: pointer;
}

.knowledge-parent-paragraph-card {
  overflow: hidden;
  border: 1px solid #e0e5ec;
  border-radius: 8px;
}

.knowledge-parent-paragraph-card .knowledge-parent-option {
  border: 0;
  border-radius: 0;
}

.knowledge-parent-option > input {
  position: absolute;
  opacity: 0;
}

.knowledge-parent-option > span {
  display: grid;
  gap: 3px;
}

.knowledge-parent-option > span > i {
  position: absolute;
  top: 12px;
  left: 14px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: #eef2ff;
  color: #315cff;
  font-style: normal;
}

.knowledge-parent-option b {
  color: #27364a;
  font-size: 12px;
}

.knowledge-parent-option small {
  color: #667085;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
}

.knowledge-parent-option > em {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 15px;
  height: 15px;
  border: 1px solid #c9d0dc;
  border-radius: 50%;
}

.knowledge-parent-option:has(input:checked) > em {
  border: 4px solid #3165f5;
}

.knowledge-segment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.knowledge-segment-actions button {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.knowledge-text-button {
  background: transparent;
  color: #344054;
}

.knowledge-text-button:hover {
  background: #f2f4f7;
  filter: none;
}

.knowledge-chunk-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d9e1ec;
  border-radius: 7px;
  background: #fff;
  color: #667085;
  font-size: 12px;
}

.knowledge-chunk-preview article {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid #edf0f4;
  border-radius: 5px;
}

.knowledge-chunk-preview article b {
  color: #315cff;
}

.knowledge-chunk-preview article p {
  max-height: 76px;
  margin: 0;
  overflow: hidden;
  white-space: pre-wrap;
}

.knowledge-choice-grid label {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 12px 12px 12px 38px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.knowledge-choice-grid label:has(input:checked) {
  border-color: #315bb5;
  box-shadow: inset 0 0 0 1px #315bb5;
  background: #f7f9ff;
}

.knowledge-choice-grid label:has(input:disabled) {
  opacity: .5;
  cursor: not-allowed;
}

.knowledge-choice-grid input {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 16px;
  height: 16px;
  accent-color: #315bb5;
}

.knowledge-choice-grid strong {
  color: #27364a;
  font-size: 13px;
}

.knowledge-choice-grid small,
.knowledge-model-field small {
  color: #8490a2;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
}

.knowledge-model-field.disabled {
  opacity: .52;
}

.knowledge-process-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e0e6ee;
  border-radius: 7px;
  background: #f8fafc;
}

.knowledge-process-panel h4 {
  margin: 0;
  color: #344054;
  font-size: 13px;
}

.knowledge-process-panel .knowledge-process-grid {
  padding: 0;
  border: 0;
  background: transparent;
}

.knowledge-process-grid label,
.knowledge-inline-fields label {
  display: grid;
  gap: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.knowledge-inline-fields {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.knowledge-inline-fields p,
.knowledge-field-help {
  margin: 0;
  color: #7b8798;
  font-size: 11px;
  line-height: 1.55;
}

.knowledge-segment-toggle {
  display: inline-flex;
  width: fit-content;
  padding: 3px;
  border: 1px solid #d8e0e9;
  border-radius: 6px;
  background: #fff;
}

.knowledge-segment-toggle label {
  position: relative;
  padding: 7px 16px;
  border-radius: 4px;
  color: #667085;
  cursor: pointer;
  font-size: 12px;
}

.knowledge-segment-toggle label:has(input:checked) {
  background: #edf3ff;
  color: #315bb5;
  font-weight: 700;
}

.knowledge-segment-toggle input {
  position: absolute;
  opacity: 0;
}

.knowledge-rule-list {
  display: grid;
  gap: 0;
}

.knowledge-rule-list .knowledge-check {
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid #e5e9ef;
}

.knowledge-rule-list .knowledge-check:first-child {
  border-top: 0;
}

.knowledge-rule-list span,
.knowledge-rerank-row span {
  display: grid;
  gap: 3px;
}

.knowledge-rule-list strong,
.knowledge-rerank-row strong {
  color: #344054;
  font-size: 12px;
}

.knowledge-rule-list small,
.knowledge-rerank-row small {
  color: #8490a2;
  font-size: 11px;
  line-height: 1.45;
}

.knowledge-retrieval-panel {
  overflow: hidden;
  border: 1px solid #e0e6ee;
  border-radius: 7px;
  background: #f8fafc;
}

.knowledge-slider-setting {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1.5fr) 76px;
  gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 12px 14px;
  border-top: 1px solid #e5e9ef;
}

.knowledge-slider-setting:first-child {
  border-top: 0;
}

.knowledge-slider-setting > div {
  display: grid;
  gap: 4px;
}

.knowledge-slider-setting label {
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-slider-setting small {
  color: #8490a2;
  font-size: 11px;
}

.knowledge-slider-setting input[type="number"] {
  width: 76px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #d8e0e9;
  border-radius: 5px;
  background: #fff;
}

.knowledge-slider-setting input[type="range"],
.knowledge-process-panel input[type="range"] {
  width: 100%;
  accent-color: #315bb5;
}

.knowledge-slider-setting input:disabled {
  opacity: .45;
}

.knowledge-weight-labels {
  display: flex;
  justify-content: space-between;
  color: #667085;
  font-size: 12px;
}

.knowledge-weight-labels b {
  color: #315bb5;
}

.knowledge-retrieval-controls {
  display: grid;
  grid-template-columns: 110px minmax(150px, 1fr) 130px;
  gap: 12px;
  align-items: end;
}

.knowledge-retrieval-controls .knowledge-check {
  min-height: 38px;
}

.knowledge-rerank-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #edf0f4;
}

.knowledge-upload-summary {
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  border-left: 1px solid #dce3ec;
  background: #fff;
}

.knowledge-upload-summary h3 {
  color: #27364a;
  font-size: 15px;
}

.knowledge-upload-summary > p {
  margin-top: 5px;
  color: #8792a3;
  font-size: 12px;
  line-height: 1.5;
}

.knowledge-upload-summary dl {
  display: grid;
  gap: 0;
  margin: 16px 0;
}

.knowledge-upload-summary dl > div {
  display: grid;
  gap: 5px;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f4;
}

.knowledge-upload-summary dt {
  color: #8a95a5;
  font-size: 11px;
}

.knowledge-upload-summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #344054;
  font-size: 12px;
  line-height: 1.5;
}

.knowledge-upload-note {
  padding: 10px;
  border-left: 3px solid #d99a24;
  border-radius: 4px;
  background: #fff8e8;
  color: #805c16;
  font-size: 11px;
  line-height: 1.55;
}

.knowledge-upload-footer {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-height: 62px;
  padding: 11px 18px;
  border-top: 1px solid #dce3ec;
  background: #fff;
}

.knowledge-upload-footer button {
  min-width: 92px;
  min-height: 38px;
}

@media (max-width: 900px) {
  .knowledge-upload-settings-step { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow-y: auto; }
  .knowledge-upload-settings-main { min-height: auto; overflow: visible; }
  .knowledge-upload-summary { border-top: 1px solid #dce3ec; border-left: 0; }
  .knowledge-upload-settings-step.preview-mode { grid-template-columns: 1fr; }
  .knowledge-dify-preview { min-height: 520px; }
  .knowledge-retrieval-choices { grid-template-columns: 1fr; }
  .knowledge-segment-choices { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .knowledge-upload-dialog { width: calc(100vw - 16px); }
  .knowledge-upload-steps b { width: 20px; }
  .knowledge-upload-steps span { font-size: 11px; }
  .knowledge-index-choices, .knowledge-retrieval-controls, .knowledge-rerank-row { grid-template-columns: 1fr; }
  .knowledge-process-grid, .knowledge-inline-fields, .knowledge-slider-setting { grid-template-columns: 1fr; }
  .knowledge-general-grid, .knowledge-parent-grid, .knowledge-child-grid { grid-template-columns: 1fr; padding-right: 0 !important; padding-left: 0 !important; }
  .knowledge-qa-row { align-items: flex-start; flex-wrap: wrap; }
  .knowledge-slider-setting input[type="number"] { width: 100%; }
  .knowledge-upload-file-step { padding: 16px; }
}

@media (max-width: 1280px) {
  .knowledge-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .workbench.knowledge-mode #knowledgeView { margin: -16px; }
  .knowledge-board { padding: 16px; }
  .knowledge-header { margin: -16px -16px 16px; padding: 12px 16px; }
  .knowledge-toolbar { align-items: stretch; flex-direction: column; }
  .knowledge-toolbar > span { margin-left: 0; }
  .knowledge-card-grid, .knowledge-retrieval-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .knowledge-header { align-items: flex-start; flex-direction: column; }
  .knowledge-header-actions { width: 100%; }
  .knowledge-header-actions button { flex: 1; }
  .knowledge-card-grid { grid-template-columns: 1fr; }
  .knowledge-card-head { grid-template-columns: 42px minmax(0, 1fr); }
  .knowledge-health { grid-column: 2; }
  .knowledge-card-meta { flex-wrap: wrap; }
  .knowledge-detail-title { align-items: flex-start; flex-direction: column; }
  .knowledge-process-grid { grid-template-columns: 1fr; }
  .knowledge-segment-header > div,
  .knowledge-segment-toolbar { align-items: stretch; flex-direction: column; }
  .knowledge-segment-toolbar .knowledge-search { width: 100%; }
  .knowledge-segment-toolbar > label { justify-content: space-between; }
  .knowledge-segment-item { padding: 14px 12px; }
  .knowledge-segment-item > header { align-items: flex-start; }
  .knowledge-segment-pagination { flex-wrap: wrap; justify-content: center; padding: 10px 0; }
}

/* The primary module navigation is fixed; only the page content below it scrolls. */
.main {
  overflow: hidden;
  scrollbar-gutter: auto;
}

.workbench {
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.workbench > .module-nav {
  position: relative;
  top: auto;
  min-width: 0;
  margin: 0;
}

.workbench-scroll {
  min-width: 0;
  min-height: 0;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #aeb8c6 transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.workbench-scroll::-webkit-scrollbar {
  width: 10px;
}

.workbench-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.workbench-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: #aeb8c6;
  background-clip: padding-box;
}

.workbench-scroll::-webkit-scrollbar-thumb:hover {
  background: #8d99aa;
  background-clip: padding-box;
}

.workbench.ai-mode {
  padding-top: 0;
}

.workbench.ai-mode .workbench-scroll {
  padding-top: 12px;
}

.workbench.pipeline-mode .workbench-scroll {
  overflow: hidden;
}

@media (max-width: 900px) {
  .workbench-scroll {
    padding: 16px;
  }

  .workbench.ai-mode .workbench-scroll {
    padding-top: 12px;
  }

}

/* Knowledge graph workspace */
.workbench.graph-mode #graphView { background: #f4f7fb; }
.graph-board { max-width: 1660px; margin: 0 auto; padding: 20px 24px 32px; }
.graph-tabs {
  align-items: center; gap: 4px; min-height: 54px; margin: 0; padding: 0 10px;
  border: 1px solid #dce3ed; border-bottom-color: #ccd6e4; border-radius: 8px 8px 0 0;
  background: #fff; box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
}
.graph-tabs button {
  position: relative; min-height: 52px; padding: 0 15px; border: 0; color: #526071;
  font-size: 14px; font-weight: 600; transition: color 150ms ease, background 150ms ease;
}
.graph-tabs button:hover { background: #f6f8fb; color: #1e293b; }
.graph-tabs button.active { border: 0; background: transparent; color: #6d28d9; }
.graph-tabs button.active::after {
  position: absolute; right: 14px; bottom: -1px; left: 14px; height: 3px;
  border-radius: 3px 3px 0 0; background: #7c3aed; content: "";
}
.graph-visual-panel, .graph-data-panel {
  margin: 0; padding: 18px; border: 1px solid #dce3ed; border-top: 0;
  border-radius: 0 0 8px 8px; background: #fff; box-shadow: 0 12px 30px rgb(20 34 52 / 6%);
}
.graph-controls {
  gap: 8px; min-height: 60px; padding: 10px 12px; border: 1px solid #26354b;
  border-radius: 7px 7px 0 0; background: #1b2739; box-shadow: inset 0 1px rgb(255 255 255 / 5%);
}
.graph-controls > button, .graph-controls select, .graph-search input, .graph-search button { min-height: 36px; }
.graph-controls > button:first-child {
  padding: 7px 13px; border: 1px solid #8b5cf6; background: #7c3aed;
  box-shadow: 0 4px 12px rgb(124 58 237 / 24%); font-weight: 600;
}
.graph-controls > button:first-child:hover { background: #6d28d9; }
.graph-controls select {
  width: 172px; border-color: #d6deea; border-radius: 5px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 8%); font-size: 13px;
}
.graph-depth { gap: 7px; color: #c7d2e2; font-weight: 600; }
.graph-depth select { width: 58px; }
.graph-relations { overflow: hidden; border: 1px solid #d6deea; border-radius: 5px; background: #fff; }
.graph-relations button, .graph-relations button:first-child, .graph-relations button:last-child {
  min-height: 34px; padding: 5px 10px; border: 0; border-right: 1px solid #e2e8f0;
  border-radius: 0; color: #475569; font-weight: 500;
}
.graph-relations button:last-child { border-right: 0; }
.graph-relations button:hover { background: #f1f5f9; color: #111827; }
.graph-relations button.active { background: #ede9fe; color: #6d28d9; box-shadow: inset 0 -2px #7c3aed; }
.graph-search { min-width: 200px; max-width: none; }
.graph-search input { border-color: #d6deea; font-size: 13px; }
.graph-search button { width: 40px; padding: 0; background: #0f8a83; }
.graph-search button:hover { background: #0b716c; }
#graphRefreshBtn { padding: 7px 12px; border: 1px solid #52627a; background: #27364b; color: #e6edf7; }
#graphRefreshBtn:hover { background: #34445c; }
.graph-canvas {
  min-height: 610px; border-color: #142137;
  background: linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px), radial-gradient(circle at 50% 42%, #17243b 0, #0d1729 52%, #091221 100%);
  background-size: 32px 32px, 32px 32px, auto; box-shadow: inset 0 12px 38px rgb(0 0 0 / 18%);
}
.graph-canvas svg { height: min(650px, calc(100vh - 250px)); min-height: 560px; }
.graph-edge line { stroke: #6f86aa; stroke-width: 1.4; opacity: .8; }
.graph-edge text { fill: #b8c7dc; font-size: 10px; stroke: #101a2d; stroke-width: 4px; }
.graph-node circle { stroke-width: 3px; filter: drop-shadow(0 0 7px rgb(139 92 246 / 42%)); }
.graph-node:hover circle { transform: scale(1.18); filter: drop-shadow(0 0 12px rgb(255 255 255 / 48%)); }
.graph-node text { fill: #f2f6fc; font-size: 11px; stroke: #0d1729; stroke-width: 4px; }
.graph-canvas svg { touch-action: none; user-select: none; }
.graph-node { cursor: grab; }
.graph-node.dragging { cursor: grabbing; }
.graph-node.dragging circle { transform: scale(1.16); filter: drop-shadow(0 0 15px rgb(255 255 255 / 55%)); }
.graph-canvas svg.is-dragging .graph-node:not(.dragging) { opacity: .86; }
.graph-layout-animate .graph-node,
.graph-layout-animate .graph-edge line,
.graph-layout-animate .graph-edge text { transition: transform 240ms ease, x 240ms ease, y 240ms ease, x1 240ms ease, y1 240ms ease, x2 240ms ease, y2 240ms ease; }
.graph-node-park circle { fill: #f59e0b; filter: drop-shadow(0 0 10px rgb(245 158 11 / 52%)); }
.graph-node-related_enterprise circle { fill: #f25562; filter: drop-shadow(0 0 8px rgb(242 85 98 / 45%)); }
.graph-node-industry circle { fill: #13a986; filter: drop-shadow(0 0 8px rgb(19 169 134 / 45%)); }
.graph-actionbar { min-height: 58px; padding: 0 0 14px; border-bottom: 1px solid #e6ebf2; }
.graph-actionbar button { min-height: 38px; border-radius: 5px; font-weight: 600; }
.graph-actionbar > button:first-child { background: #7c3aed; box-shadow: 0 5px 14px rgb(124 58 237 / 18%); }
.graph-stat-grid { grid-template-columns: repeat(4, minmax(130px, .8fr)) minmax(310px, 1.6fr); gap: 12px; margin: 16px 0; }
.graph-stat-grid article {
  position: relative; min-height: 96px; overflow: hidden; padding: 17px 18px;
  border-color: #dde5ef; border-radius: 7px; background: linear-gradient(145deg, #fff, #f8fafc);
  box-shadow: 0 5px 16px rgb(30 48 73 / 5%);
}
.graph-stat-grid article::before { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: #7c3aed; content: ""; }
.graph-stat-grid article:nth-child(2)::before { background: #0f8a83; }
.graph-stat-grid article:nth-child(3)::before { background: #2563eb; }
.graph-stat-grid article:nth-child(4)::before { background: #f59e0b; }
.graph-stat-grid span { color: #69778a; font-weight: 600; }
.graph-stat-grid strong { color: #101828; font-size: 28px; font-weight: 650; }
.graph-rel-stats i { border-color: #d8e1ed; background: #fff; color: #42526a; }
.graph-table-wrap { border-color: #dbe3ed; border-radius: 7px; box-shadow: 0 5px 18px rgb(30 48 73 / 4%); }
.graph-table-wrap th { height: 44px; background: #f3f6fa; color: #59677a; font-size: 12px; font-weight: 700; }
.graph-table-wrap td { height: 48px; color: #263447; }
.graph-table-wrap tbody tr:hover { background: #f8fafc; }
.graph-status { border-color: #9bd58a; background: #effbea; color: #318326; font-weight: 600; }

@media (max-width: 1280px) {
  .graph-controls { flex-wrap: wrap; }
  .graph-search { flex: 1 1 260px; }
  .graph-stat-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .graph-rel-stats { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .graph-board { padding: 12px; }
  .graph-tabs { overflow-x: auto; }
  .graph-tabs button { flex: 0 0 auto; }
  .graph-visual-panel, .graph-data-panel { padding: 10px; }
  .graph-controls { align-items: stretch; }
  .graph-relations { overflow-x: auto; }
  .graph-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Knowledge graph full-width layout */
#graphView {
  width: 100%;
  min-width: 0;
}
#graphView > #graphContent.module-placeholder {
  display: block;
  width: 100%;
  min-height: calc(100vh - 190px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#graphView .graph-board {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
#graphView .graph-tabs,
#graphView .graph-visual-panel,
#graphView .graph-data-panel {
  width: 100%;
  max-width: none;
}
#graphView .graph-visual-panel,
#graphView .graph-data-panel {
  min-height: calc(100vh - 245px);
}
#graphView .graph-canvas {
  min-height: calc(100vh - 315px);
}
#graphView .graph-canvas svg {
  height: calc(100vh - 315px);
  min-height: 610px;
}
#graphView #graphRootFilter {
  width: 260px;
  min-width: 260px;
}
#graphView .graph-search {
  flex: 0 1 300px;
  width: 300px;
  min-width: 220px;
  max-width: 300px;
}

@media (max-width: 800px) {
  #graphView > #graphContent.module-placeholder { min-height: calc(100vh - 150px); }
  #graphView .graph-visual-panel, #graphView .graph-data-panel { min-height: calc(100vh - 205px); }
  #graphView #graphRootFilter, #graphView .graph-search {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

/* 招商看板工作台视觉层：保留原有字段和交互，只重排展示层。 */
.workbench.invest-mode #investView {
  min-height: calc(100vh - 64px);
}

.workbench.invest-mode .invest-board {
  display: block;
  min-height: calc(100vh - 64px);
  margin: -24px -24px -24px;
  padding: 0 24px 34px;
  background: #f1f3f6;
  border-top: 0;
}

.workbench.invest-mode .invest-header {
  display: grid;
  grid-template-columns: minmax(150px, 180px) 1fr;
  gap: 24px;
  align-items: center;
  min-height: 66px;
  margin: 0 -24px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid #e1e6ed;
}

.workbench.invest-mode .invest-board-title {
  font-size: 19px;
  color: #172033;
}

.workbench.invest-mode .invest-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
  justify-self: stretch;
  white-space: normal;
}

.workbench.invest-mode .invest-summary span {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 10px;
  color: #8792a3;
  font-size: 12px;
  line-height: 1.2;
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 6px;
}

.workbench.invest-mode .invest-summary strong {
  color: #3155a6;
  font-size: 22px;
  line-height: 1;
}

.workbench.invest-mode .invest-summary span:nth-child(2) strong { color: #2563eb; }
.workbench.invest-mode .invest-summary span:nth-child(3) strong { color: #4d9b1f; }
.workbench.invest-mode .invest-summary span:nth-child(4) strong { color: #d97706; }

.workbench.invest-mode .invest-workspace {
  display: block;
  min-width: 0;
  padding: 26px 0 0;
}

.workbench.invest-mode .invest-tabs {
  display: none;
}

.workbench.invest-mode .invest-filterbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e0e5eb;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(15 23 42 / 3%);
}

.workbench.invest-mode .status-filters {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.workbench.invest-mode .status-chip {
  min-height: 32px;
  padding: 5px 14px;
  border-color: #d9dee7;
  border-radius: 5px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  white-space: nowrap;
}

.workbench.invest-mode .status-chip.active {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
}

.workbench.invest-mode .invest-actions {
  flex: 0 0 auto;
  gap: 7px;
  flex-wrap: nowrap;
}

.workbench.invest-mode .invest-actions #newEnterpriseBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 15px;
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
  font-weight: 700;
}

.workbench.invest-mode .invest-actions #newEnterpriseBtn::before {
  content: "+";
  margin-right: 6px;
  font-size: 18px;
  font-weight: 400;
  line-height: 0;
}

.workbench.invest-mode .invest-actions #newEnterpriseBtn:hover {
  background: #6d28d9;
  filter: none;
}

.workbench.invest-mode .invest-actions > button:not(#newEnterpriseBtn) {
  min-height: 32px;
  padding: 5px 10px;
  white-space: nowrap;
}

.workbench.invest-mode .industry-filter-box {
  position: relative;
  width: 142px;
  flex: 0 0 142px;
}

.workbench.invest-mode .industry-filter-select {
  width: 100%;
  min-height: 34px;
  padding: 6px 44px 6px 9px;
  color: #64748b;
  border-color: #d9dee7;
  background: #fff;
}

.workbench.invest-mode .industry-filter-clear {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 25px;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 50%;
  background: #eef1f5;
  color: #7b8494;
  font-size: 14px;
  line-height: 16px;
  transform: translateY(-50%);
}

.workbench.invest-mode .industry-filter-clear:hover {
  background: #e2e6ec;
  color: #344054;
  filter: none;
}

.workbench.invest-mode .invest-search-box {
  position: relative;
  width: 200px;
  flex: 0 0 200px;
}

.workbench.invest-mode .invest-search {
  width: 100%;
  height: 34px;
  padding: 7px 34px 7px 11px;
  border-color: #d9dee7;
}

.workbench.invest-mode .invest-search-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 50%;
  background: #eef1f5;
  color: #7b8494;
  font-size: 17px;
  line-height: 20px;
  transform: translateY(-50%);
}

.workbench.invest-mode .invest-search-clear:hover {
  background: #e2e6ec;
  color: #344054;
  filter: none;
}

.workbench.invest-mode :is(.industry-filter-select, .invest-search):focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgb(124 58 237 / 10%);
  outline: none;
}

.workbench.invest-mode .invest-count-row {
  justify-content: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  color: #8993a3;
  font-size: 13px;
}

.workbench.invest-mode .invest-count-row strong {
  color: #172033;
  font-size: 16px;
}

.workbench.invest-mode .invest-count-row .ghost {
  margin-left: auto;
  min-height: 32px;
  padding: 5px 11px;
  border-color: #d9dee7;
  background: #fff;
}

.workbench.invest-mode .company-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.workbench.invest-mode .invest-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 52px;
  margin-top: 14px;
  color: #667085;
  font-size: 13px;
}

.workbench.invest-mode .invest-pagination button {
  min-width: 70px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #d9dee7;
  background: #fff;
}

.workbench.invest-mode .invest-pagination button:disabled {
  background: #f1f3f6;
  color: #a4acb8;
  cursor: not-allowed;
}

.workbench.invest-mode .invest-pagination strong {
  color: #172033;
}

.workbench.invest-mode .company-card {
  display: grid;
  gap: 10px;
  min-height: 258px;
  padding: 17px 18px 0;
  border-color: #e0e5eb;
  border-radius: 8px;
  box-shadow: 0 2px 7px rgb(15 23 42 / 3%);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.workbench.invest-mode .company-card:hover {
  border-color: #c8d2e3;
  box-shadow: 0 10px 24px rgb(15 23 42 / 9%);
  transform: translateY(-2px);
}

.workbench.invest-mode .company-card-head {
  align-items: center;
}

.workbench.invest-mode .company-card-head h3 {
  order: 2;
  font-size: 17px;
}

.workbench.invest-mode .company-card-head .status {
  order: 1;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid #9ec5ff;
  border-radius: 4px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
}

.workbench.invest-mode .company-card p,
.workbench.invest-mode .company-meta {
  font-size: 13px;
}

.workbench.invest-mode .company-tags span {
  padding: 3px 8px;
  border: 1px solid #d2e1ff;
  border-radius: 4px;
  background: #f5f8ff;
  color: #2563eb;
}

.workbench.invest-mode .company-channel {
  padding: 8px 10px;
  border-left: 2px solid #7c3aed;
  border-radius: 4px;
  background: #faf9ff;
  font-size: 12px;
}

.workbench.invest-mode .company-actions {
  align-items: center;
  min-height: 48px;
  margin: 5px -18px 0;
  padding: 9px 18px;
  border-top: 1px solid #edf0f4;
}

.workbench.invest-mode .company-actions button {
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 12px;
}

.workbench.invest-mode .company-actions .delete-enterprise-button {
  margin-left: auto;
  border: 1px solid #f1c5ca;
  background: #fff;
  color: #b42318;
}

.workbench.invest-mode .company-actions .delete-enterprise-button:hover {
  border-color: #e7a8b0;
  background: #fff2f3;
  filter: none;
}

.enterprise-dialog-form {
  width: min(720px, calc(100vw - 32px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  padding: 0 28px 26px;
}

.enterprise-dialog-head {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  margin: 0 -28px;
  padding: 0 28px;
  border-bottom: 1px solid #e8ecf2;
}

.enterprise-dialog-head h2 {
  margin: 0;
  color: #172033;
  font-size: 20px;
  font-weight: 700;
}

.dialog-close-button {
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  color: #8a94a4;
  font-size: 22px;
  line-height: 1;
}

.dialog-close-button:hover {
  background: #f1f3f6;
  color: #172033;
  filter: none;
}

.enterprise-dialog-form label {
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.enterprise-dialog-form :is(input, select, textarea) {
  min-height: 42px;
  border-color: #d8dee8;
  border-radius: 6px;
  padding: 10px 12px;
  color: #1f2937;
  font-weight: 400;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.enterprise-dialog-form :is(input, select, textarea):focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgb(124 58 237 / 12%);
  outline: none;
}

.enterprise-dialog-form select {
  cursor: pointer;
}

.enterprise-dialog-form textarea {
  min-height: 96px;
}

.enterprise-dialog-form .enterprise-field-wide,
.enterprise-dialog-form .dialog-actions {
  grid-column: 1 / -1;
}

.enterprise-dialog-form .dialog-actions {
  margin: 4px -28px -26px;
  padding: 16px 28px;
  border-top: 1px solid #e8ecf2;
  background: #fafbfc;
}

.enterprise-dialog-form .dialog-actions button {
  min-width: 86px;
  min-height: 38px;
}

.enterprise-dialog-form .dialog-actions button[type="submit"] {
  background: #7c3aed;
}

@media (max-width: 1250px) {
  .workbench.invest-mode .invest-filterbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workbench.invest-mode .invest-actions {
    flex-wrap: wrap;
  }

  .workbench.invest-mode .company-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .workbench.invest-mode .invest-board {
    margin: -16px -16px -16px;
    padding: 0 16px 24px;
  }

  .workbench.invest-mode .invest-header {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
    margin: 0 -16px;
    padding: 14px 16px;
  }

  .workbench.invest-mode .invest-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workbench.invest-mode .company-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .workbench.invest-mode .invest-summary,
  .workbench.invest-mode .company-grid,
  .enterprise-dialog-form {
    grid-template-columns: 1fr;
  }

  .enterprise-dialog-form .enterprise-field-wide,
  .enterprise-dialog-form .dialog-actions {
    grid-column: auto;
  }

  .enterprise-dialog-form {
    padding-right: 18px;
    padding-left: 18px;
  }

  .enterprise-dialog-head,
  .enterprise-dialog-form .dialog-actions {
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }
}

/* Keep the application workspace usable on narrow screens. */
@media (max-width: 900px) {
  .app,
  .app.sidebar-collapsed {
    grid-template-columns: 78px minmax(0, 1fr) !important;
  }

  .property-contract-current {
    align-items: stretch;
    flex-direction: column;
  }

  .property-contract-current > div button {
    flex: 1;
  }

  .property-contract-shell {
    grid-template-rows: auto minmax(320px, 68vh) auto;
  }

  .app.auth-guest,
  .app.auth-guest.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .sidebar {
    width: 78px;
    min-width: 78px;
  }

  .sidebar :is(.brand-full, .nav-label, .lock, .nav-section-title, .user-box span) {
    display: none;
  }

  .sidebar .brand-short {
    display: inline;
  }

  .sidebar .nav {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  .sidebar .user-box {
    padding-right: 10px;
    padding-left: 10px;
  }
}
/* 财务管理 */
.finance-page { display: grid; gap: 12px; min-width: 0; }
.finance-loading { padding: 48px; color: #64748b; text-align: center; }
.finance-panel { min-width: 0; background: #fff; border: 1px solid #dfe5eb; border-radius: 6px; padding: 14px; }
.finance-action-panel { padding: 12px 14px; }
.finance-toolbar, .finance-filterbar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.finance-meter-toolbar { position: relative; z-index: 20; flex-wrap: nowrap; margin-bottom: 12px; overflow: visible; padding-bottom: 2px; }
.finance-meter-toolbar > button, .finance-meter-toolbar > select { flex: 0 0 auto; }
.finance-meter-level { position: relative; flex: 0 0 140px; width: 140px; }
.finance-meter-level > #financeMeterLevelTrigger {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  border: 1px solid #d8dbe5;
  border-radius: 4px;
  padding: 6px 30px 6px 11px;
  background: #fff;
  color: #8c93a1;
  text-align: left;
}
.finance-meter-level > #financeMeterLevelTrigger::after {
  position: absolute;
  right: 11px;
  content: "⌄";
  color: #a3a9b5;
  font-size: 15px;
  transform: translateY(-2px);
}
.finance-meter-level.open > #financeMeterLevelTrigger::after { content: "⌃"; transform: translateY(2px); }
.finance-meter-level.selected > #financeMeterLevelTrigger { border-color: #7c3aed; color: #4f586a; }
.finance-meter-level.selected > #financeMeterLevelTrigger::after { display: none; }
.finance-meter-level > #financeMeterLevelClear {
  position: absolute;
  top: 8px;
  right: 9px;
  z-index: 2;
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: #a2a8b3;
  font-size: 15px;
  line-height: 18px;
}
.finance-meter-level > #financeMeterLevelClear:hover { background: #f0ecfa; color: #7c3aed; filter: none; }
.finance-meter-level-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  display: grid;
  width: 140px;
  padding: 5px 0;
  border: 1px solid #e2e3e9;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 5px 14px rgb(44 38 61 / 14%);
}
.finance-meter-level-menu::before {
  position: absolute;
  top: -5px;
  left: 28px;
  width: 9px;
  height: 9px;
  border-top: 1px solid #e2e3e9;
  border-left: 1px solid #e2e3e9;
  background: #fff;
  content: "";
  transform: rotate(45deg);
}
.finance-meter-level > .finance-meter-level-menu > button {
  position: relative;
  z-index: 1;
  justify-content: flex-start;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 7px 20px;
  background: #fff;
  color: #596273;
  text-align: left;
}
.finance-meter-level-menu > button:hover,
.finance-meter-level-menu > button[aria-selected="true"] { background: #f5f6f8; color: #4d5667; filter: none; }
.finance-meter-search { flex: 0 1 300px; min-width: 220px; }
.finance-meter-task-meta { flex: 0 0 auto; color: #475569; font-size: 13px; white-space: nowrap; }
.workbench.finance-meter-mode .workbench-scroll { overflow-y: hidden; background: #f6f4ff; }
.finance-meter-panel {
  border-color: #e1ddec;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgb(76 54 126 / 6%);
}
.finance-meter-panel .finance-meter-toolbar { gap: 10px; margin-bottom: 14px; }
.finance-meter-panel .finance-meter-toolbar > button {
  min-height: 34px;
  border: 1px solid #d9dce6;
  border-radius: 4px;
  background: #fff;
  color: #596273;
  box-shadow: none;
}
.finance-meter-panel #financeMeterUploadBtn {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
}
.finance-meter-panel #financeMeterUploadBtn:hover:not(:disabled) { border-color: #6d28d9; background: #6d28d9; filter: none; }
.finance-meter-panel .finance-meter-toolbar > button:hover:not(:disabled):not(#financeMeterUploadBtn) { border-color: #b9a8e8; color: #6d28d9; filter: none; }
.finance-meter-panel .finance-meter-toolbar > button:disabled {
  border-color: #e1e3ea;
  background: #fafbfc;
  color: #a9afbb;
  cursor: not-allowed;
  opacity: 1;
}
.finance-meter-panel .finance-meter-toolbar input,
.finance-meter-panel .finance-meter-toolbar select {
  border-color: #d8dbe5;
  background: #fff;
  color: #596273;
  box-shadow: none;
}
.finance-meter-panel .finance-meter-toolbar input::placeholder { color: #a0a6b2; }
.finance-meter-panel .finance-meter-toolbar input:focus,
.finance-meter-panel .finance-meter-toolbar select:focus { border-color: #9b7be7; outline: 2px solid #ede7ff; outline-offset: 0; }
.finance-meter-panel .finance-meter-task-meta { color: #687084; }
.finance-wrap { flex-wrap: wrap; }
.finance-toolbar label { display: grid; gap: 4px; color: #64748b; font-size: 12px; }
.finance-toolbar input, .finance-toolbar select, .finance-filterbar input, .finance-filterbar select, .finance-dialog input, .finance-pager select { min-height: 34px; border: 1px solid #cfd8e3; border-radius: 4px; padding: 6px 9px; background: #fff; color: #172033; }
.finance-toolbar button, .finance-filterbar button, .finance-pager button, .finance-row-actions button, .finance-tabs button, .finance-table-wrap td > button, .finance-dialog button, .finance-park-list button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.finance-toolbar > input:not([type="file"]):not([type="hidden"]),
.finance-toolbar > select,
.finance-filterbar > input,
.finance-filterbar > select,
.finance-charge-filter-field > input,
.finance-dialog input { height: 34px; }
.finance-toolbar > button,
.finance-filterbar > button,
.finance-charge-filterbar > #financeRuleClear,
.finance-dialog footer > button,
.finance-park-form > button {
  height: 34px;
  min-height: 34px;
  padding: 5px 12px;
}
.finance-meter-level > #financeMeterLevelTrigger,
.finance-fee-park > #financeFeeParkTrigger,
.finance-charge-park > #financeChargeParkTrigger,
.finance-history-type > #financeHistoryTypeTrigger { height: 34px; min-height: 34px; }
.finance-button-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.finance-help { margin: 8px 0 0; color: #64748b; font-size: 12px; }
.finance-task-meta { margin-left: auto; color: #475569; font-size: 13px; }
.finance-filterbar { flex-wrap: wrap; margin-bottom: 12px; }
.finance-filterbar > span { margin-left: auto; color: #64748b; font-size: 13px; }
.finance-search { position: relative; display: inline-flex; min-width: 240px; }
.finance-search input { width: 100%; padding-right: 32px; }
.finance-search button { position: absolute; right: 2px; top: 2px; min-width: 30px; min-height: 30px; padding: 0; border: 0; background: transparent; color: #64748b; font-size: 20px; }
.finance-consent, .finance-inline-check { display: flex !important; grid-auto-flow: column; align-items: center; gap: 6px !important; color: #334155 !important; font-size: 13px !important; }
.finance-consent input, .finance-inline-check input { width: 16px; min-height: 16px; margin: 0; }
.finance-table-wrap { width: 100%; min-width: 0; overflow: auto; border: 1px solid #e2e8f0; }
.finance-table-wrap table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.finance-table-wrap th { position: sticky; top: 0; z-index: 1; padding: 9px 10px; background: #f5f7fa; border-right: 1px solid #e2e8f0; border-bottom: 1px solid #d9e0e8; color: #334155; font-weight: 600; text-align: left; white-space: nowrap; }
.finance-meter-panel .finance-table-wrap { height: calc(100dvh - 380px); min-height: 300px; overflow-y: auto; }
.finance-meter-panel .finance-table-wrap thead { position: relative; z-index: 2; }
.finance-meter-panel .finance-table-empty table { height: 100%; }
.finance-meter-panel .finance-table-wrap { border-color: #e4e2eb; background: #fff; scrollbar-color: #c8c5d2 #f5f3f9; scrollbar-width: thin; }
.finance-meter-panel .finance-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.finance-meter-panel .finance-table-wrap::-webkit-scrollbar-track { background: #f5f3f9; }
.finance-meter-panel .finance-table-wrap::-webkit-scrollbar-thumb { border: 2px solid #f5f3f9; border-radius: 8px; background: #c8c5d2; }
.finance-meter-panel .finance-table-wrap th { border-color: #e6e3ed; background: #fff; color: #7b8190; }
.finance-meter-panel .finance-table-wrap td { border-color: #eeecf2; background: #fff; color: #4f586a; }
.finance-meter-panel .finance-table-wrap tbody tr:hover td { background: #faf9fd; }
.finance-meter-panel .finance-empty { color: #8e929d !important; }
.finance-table-wrap td { max-width: 260px; padding: 9px 10px; border-right: 1px solid #edf1f5; border-bottom: 1px solid #edf1f5; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finance-table-wrap tbody tr:hover td { background: #f8fafc; }
.finance-table-wrap .finance-risk-high td { background: #fff1f2; }
.finance-table-wrap .finance-risk-medium td { background: #fffbea; }
.finance-empty { height: 120px; color: #94a3b8 !important; text-align: center !important; }
.finance-meter-panel .finance-empty { height: auto; vertical-align: middle; }
.finance-status { display: inline-flex; align-items: center; min-height: 24px; border-radius: 4px; padding: 2px 8px; font-size: 12px; }
.finance-status.success { background: #ecfdf3; color: #16794b; }
.finance-status.warning { background: #fff7dc; color: #98610c; }
.finance-status.danger { background: #fff0f1; color: #c33a46; }
.finance-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 12px; color: #64748b; font-size: 13px; }
.finance-pager label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.finance-meter-panel .finance-pager { color: #686f80; }
.finance-meter-panel .finance-pager select { border-color: #d8dbe5; background: #fff; color: #596273; }
.finance-meter-panel .finance-pager button { border: 1px solid transparent; background: transparent; color: #6d28d9; }
.finance-meter-panel .finance-pager button:hover:not(:disabled) { border-color: #e2d8fb; background: #f6f1ff; filter: none; }
.finance-meter-panel .finance-pager button:disabled { color: #c4c7cf; cursor: not-allowed; opacity: 1; }
.workbench.finance-fee-mode .workbench-scroll { overflow-y: hidden; background: #f6f4ff; }
.finance-fee-panel {
  border-color: #e1ddec;
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(76 54 126 / 6%);
}
.finance-fee-toolbar {
  position: relative;
  z-index: 20;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 14px;
  overflow: visible;
  padding-bottom: 2px;
}
.finance-fee-date-picker { position: relative; flex: 1 1 420px; min-width: 330px; }
.finance-fee-date-picker > #financeFeeDateTrigger {
  display: grid; grid-template-columns: 16px minmax(110px, 1fr) 14px minmax(110px, 1fr); width: 100%; height: 34px;
  min-height: 34px; align-items: center; gap: 6px; border: 1px solid #d8dbe5; border-radius: 4px;
  padding: 5px 30px 5px 10px; background: #fff; color: #596273; box-shadow: none;
}
.finance-fee-date-picker > #financeFeeDateTrigger:hover { border-color: #9b7be7; filter: none; }
.finance-fee-date-picker.selected > #financeFeeDateTrigger,
.finance-fee-date-picker.open > #financeFeeDateTrigger { border-color: #7c3aed; outline: 1px solid #ede7ff; }
.finance-fee-date-picker .finance-button-icon { color: #a4aab5; }
.finance-fee-date-value { min-width: 0; overflow: hidden; color: #4f586a; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.finance-fee-date-value.placeholder { color: #9ba2ae; }
.finance-fee-date-separator { color: #596273; text-align: center; }
.finance-fee-date-picker > #financeFeeDateClear {
  position: absolute; top: 8px; right: 8px; z-index: 3; width: 18px; min-width: 18px; min-height: 18px;
  border: 0; border-radius: 50%; padding: 0; background: transparent; color: #a2a8b3; font-size: 14px; line-height: 18px;
}
.finance-fee-date-picker > #financeFeeDateClear:hover { background: #f0ecfa; color: #7c3aed; filter: none; }
.finance-fee-date-menu {
  position: absolute; top: calc(100% + 12px); left: 50%; z-index: 70; width: min(648px, calc(100vw - 40px));
  border: 1px solid #e1e3e9; border-radius: 4px; background: #fff; box-shadow: 0 8px 22px rgb(44 38 61 / 18%);
  transform: translateX(-50%);
}
.finance-fee-date-menu::before {
  position: absolute; top: -6px; left: 50%; width: 10px; height: 10px; border-top: 1px solid #e1e3e9;
  border-left: 1px solid #e1e3e9; background: #fff; content: ""; transform: translateX(-50%) rotate(45deg);
}
#financeFeeCalendars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.finance-calendar-month { min-width: 0; padding: 16px; }
.finance-calendar-month + .finance-calendar-month { border-left: 1px solid #e6e8ed; }
.finance-calendar-month > header { position: relative; display: flex; min-height: 30px; align-items: center; justify-content: center; margin-bottom: 8px; color: #505968; }
.finance-calendar-month > header strong { font-size: 15px; font-weight: 600; }
.finance-calendar-nav { position: absolute; left: 0; display: flex; gap: 2px; }
.finance-calendar-nav.right { right: 0; left: auto; }
.finance-calendar-nav > button {
  width: 26px; min-width: 26px; height: 28px; min-height: 28px; border: 0; padding: 0; background: transparent;
  color: #7e8693; font-size: 18px; font-weight: 400;
}
.finance-calendar-nav > button:hover { background: #f4efff; color: #7c3aed; filter: none; }
.finance-calendar-week,
.finance-calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.finance-calendar-week { margin-bottom: 4px; border-bottom: 1px solid #edf0f4; }
.finance-calendar-week > span { display: flex; height: 30px; align-items: center; justify-content: center; color: #596273; font-size: 12px; }
.finance-calendar-days > button {
  position: relative; width: 100%; height: 36px; min-height: 36px; border: 0; border-radius: 0; padding: 0;
  background: transparent; color: #4f586a; font-size: 12px; font-weight: 400;
}
.finance-calendar-days > button:hover { background: #f3effd; color: #6d28d9; filter: none; }
.finance-calendar-days > button.outside { color: #b5bac3; }
.finance-calendar-days > button.today { color: #7c3aed; font-weight: 700; }
.finance-calendar-days > button.in-range { background: #f1eaff; color: #6d28d9; }
.finance-calendar-days > button.range-start,
.finance-calendar-days > button.range-end { border-radius: 4px; background: #7c3aed; color: #fff; font-weight: 700; }
.finance-fee-toolbar > select { flex: 0 0 180px; width: 180px; }
.finance-fee-park { position: relative; flex: 0 0 180px; width: 180px; }
.finance-fee-park > #financeFeeParkTrigger {
  width: 100%; min-height: 34px; justify-content: flex-start; border: 1px solid #d8dbe5; border-radius: 4px;
  padding: 6px 30px 6px 11px; background: #fff; color: #7b8190; text-align: left;
}
.finance-fee-park > #financeFeeParkTrigger > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-fee-park > #financeFeeParkTrigger::after { position: absolute; right: 11px; content: "⌄"; color: #a3a9b5; font-size: 15px; transform: translateY(-2px); }
.finance-fee-park.open > #financeFeeParkTrigger::after { content: "⌃"; transform: translateY(2px); }
.finance-fee-park.selected > #financeFeeParkTrigger { border-color: #7c3aed; color: #4f586a; }
.finance-fee-park.selected > #financeFeeParkTrigger::after { display: none; }
.finance-fee-park > #financeFeeParkClear {
  position: absolute; top: 8px; right: 9px; z-index: 2; width: 18px; min-width: 18px; min-height: 18px;
  border: 0; border-radius: 50%; padding: 0; background: transparent; color: #a2a8b3; font-size: 15px; line-height: 18px;
}
.finance-fee-park > #financeFeeParkClear:hover { background: #f0ecfa; color: #7c3aed; filter: none; }
.finance-fee-park-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; display: grid; width: max-content; min-width: 220px;
  max-width: 320px; padding: 5px 0; border: 1px solid #e2e3e9; border-radius: 4px; background: #fff;
  box-shadow: 0 5px 14px rgb(44 38 61 / 14%);
}
.finance-fee-park-menu::before {
  position: absolute; top: -5px; left: 28px; width: 9px; height: 9px; border-top: 1px solid #e2e3e9;
  border-left: 1px solid #e2e3e9; background: #fff; content: ""; transform: rotate(45deg);
}
.finance-fee-park-menu > button {
  position: relative; z-index: 1; justify-content: flex-start; min-height: 34px; border: 0; border-radius: 0;
  padding: 7px 20px; overflow: hidden; background: #fff; color: #596273; text-align: left; text-overflow: ellipsis; white-space: nowrap;
}
.finance-fee-park-menu > button:hover,
.finance-fee-park-menu > button[aria-selected="true"] { background: #f5f6f8; color: #4d5667; filter: none; }
.finance-fee-toolbar > button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #d9dce6;
  border-radius: 4px;
  background: #fff;
  color: #596273;
  box-shadow: none;
}
.finance-fee-toolbar > .finance-fee-primary {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
}
.finance-fee-toolbar > .finance-fee-primary:hover:not(:disabled) { border-color: #6d28d9; background: #6d28d9; filter: none; }
.finance-fee-toolbar > button:hover:not(:disabled):not(.finance-fee-primary) { border-color: #b9a8e8; color: #6d28d9; filter: none; }
.finance-fee-toolbar > button:disabled { border-color: #e1e3ea; background: #fafbfc; color: #a9afbb; cursor: not-allowed; opacity: 1; }
.finance-fee-toolbar > select,
.finance-fee-search > input { border-color: #d8dbe5; background: #fff; color: #596273; box-shadow: none; }
.finance-fee-toolbar > select:focus,
.finance-fee-search > input:focus { border-color: #9b7be7; outline: 2px solid #ede7ff; outline-offset: 0; }
.finance-fee-search { flex: 0 0 220px; min-width: 220px; }
.finance-fee-search input::placeholder { color: #a0a6b2; }
.finance-fee-toolbar .finance-inline-check { flex: 0 0 auto; white-space: nowrap; }
.finance-fee-toolbar .finance-inline-check input { accent-color: #7c3aed; }
.finance-fee-toolbar .finance-task-meta { flex: 0 0 auto; margin-left: 0; color: #687084; white-space: nowrap; }
.finance-fee-panel .finance-table-wrap {
  height: calc(100dvh - 380px);
  min-height: 300px;
  border-color: #e4e2eb;
  background: #fff;
  overflow-y: auto;
  scrollbar-color: #c8c5d2 #f5f3f9;
  scrollbar-width: thin;
}
.finance-fee-panel .finance-table-wrap thead { position: relative; z-index: 2; }
.finance-fee-panel .finance-table-empty table { height: 100%; }
.finance-fee-panel .finance-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.finance-fee-panel .finance-table-wrap::-webkit-scrollbar-track { background: #f5f3f9; }
.finance-fee-panel .finance-table-wrap::-webkit-scrollbar-thumb { border: 2px solid #f5f3f9; border-radius: 8px; background: #c8c5d2; }
.finance-fee-panel .finance-table-wrap th { border-color: #e6e3ed; background: #fff; color: #7b8190; }
.finance-fee-panel .finance-table-wrap td { border-color: #eeecf2; background: #fff; color: #4f586a; }
.finance-fee-panel .finance-table-wrap tbody tr:hover td { background: #faf9fd; }
.finance-fee-panel .finance-table-wrap .finance-risk-medium td { background: #fff9e8; }
.finance-fee-panel .finance-empty { height: auto; color: #8e929d !important; vertical-align: middle; }
.finance-fee-panel .finance-pager { color: #686f80; }
.finance-fee-panel .finance-pager select { border-color: #d8dbe5; background: #fff; color: #596273; }
.finance-fee-panel .finance-pager button { border: 1px solid transparent; background: transparent; color: #6d28d9; }
.finance-fee-panel .finance-pager button:hover:not(:disabled) { border-color: #e2d8fb; background: #f6f1ff; filter: none; }
.finance-fee-panel .finance-pager button:disabled { color: #c4c7cf; cursor: not-allowed; opacity: 1; }
.workbench.finance-charge-mode .workbench-scroll { background: #f6f4ff; }
.finance-charge-panel {
  border-color: #e1ddec;
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(76 54 126 / 6%);
}
.finance-charge-toolbar { position: relative; z-index: 20; flex-wrap: nowrap; gap: 10px; overflow: visible; padding-bottom: 10px; }
.finance-charge-toolbar > select { flex: 0 0 180px; width: 180px; }
.finance-charge-park { position: relative; flex: 0 0 180px; width: 180px; }
.finance-charge-park > #financeChargeParkTrigger {
  width: 100%; min-height: 34px; justify-content: flex-start; border: 1px solid #d8dbe5; border-radius: 4px;
  padding: 6px 30px 6px 11px; overflow: hidden; background: #fff; color: #7b8190; text-align: left;
}
.finance-charge-park > #financeChargeParkTrigger > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-charge-park > #financeChargeParkTrigger::after { position: absolute; right: 11px; content: "⌄"; color: #a3a9b5; font-size: 15px; transform: translateY(-2px); }
.finance-charge-park.open > #financeChargeParkTrigger::after { content: "⌃"; transform: translateY(2px); }
.finance-charge-park.selected > #financeChargeParkTrigger { border-color: #7c3aed; color: #4f586a; }
.finance-charge-park-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; display: grid; width: max-content; min-width: 208px;
  max-width: 320px; padding: 5px 0; border: 1px solid #e2e3e9; border-radius: 4px; background: #fff;
  box-shadow: 0 5px 14px rgb(44 38 61 / 14%);
}
.finance-charge-park-menu::before {
  position: absolute; top: -5px; left: 28px; width: 9px; height: 9px; border-top: 1px solid #e2e3e9;
  border-left: 1px solid #e2e3e9; background: #fff; content: ""; transform: rotate(45deg);
}
.finance-charge-park-menu > button {
  position: relative; z-index: 1; justify-content: flex-start; min-height: 34px; border: 0; border-radius: 0;
  padding: 7px 20px; overflow: hidden; background: #fff; color: #596273; text-align: left; text-overflow: ellipsis; white-space: nowrap;
}
.finance-charge-park-menu > button:hover { background: #f5f6f8; color: #4d5667; filter: none; }
.finance-charge-park-menu > button[aria-selected="true"] { background: #fff; color: #7c3aed; font-weight: 600; }
.finance-charge-toolbar > button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #d9dce6;
  border-radius: 4px;
  background: #fff;
  color: #596273;
  box-shadow: none;
}
.finance-charge-toolbar > button:hover:not(:disabled):not(.finance-charge-primary):not(.finance-charge-check) { border-color: #b9a8e8; color: #6d28d9; filter: none; }
.finance-charge-toolbar > .finance-charge-primary { border-color: #7c3aed; background: #7c3aed; color: #fff; }
.finance-charge-toolbar > .finance-charge-primary:hover:not(:disabled) { border-color: #6d28d9; background: #6d28d9; filter: none; }
.finance-charge-toolbar > .finance-charge-check { border-color: #67ba39; background: #67ba39; color: #fff; }
.finance-charge-toolbar > .finance-charge-check:hover:not(:disabled) { border-color: #55a72c; background: #55a72c; filter: none; }
.finance-charge-toolbar > button:disabled { border-color: #e1e3ea; background: #fafbfc; color: #a9afbb; cursor: not-allowed; opacity: 1; }
.finance-charge-toolbar > select { border-color: #d8dbe5; background: #fff; color: #596273; box-shadow: none; }
.finance-charge-toolbar > select:focus { border-color: #9b7be7; outline: 2px solid #ede7ff; outline-offset: 0; }
.finance-charge-toolbar .finance-task-meta { flex: 0 0 auto; margin-left: 0; color: #687084; white-space: nowrap; }
.finance-charge-rule-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 10px; color: #6d28d9; font-size: 13px; }
.finance-charge-rule-head > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.finance-charge-rule-head strong { font-size: 14px; }
.finance-charge-rule-head > button { flex: 0 0 auto; min-height: 28px; border: 0; padding: 3px 4px; background: transparent; color: #7c3aed; font-size: 13px; }
.finance-charge-rule-head > button:hover { background: #f5f0ff; filter: none; }
.finance-charge-filterbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr)) minmax(160px, 1.25fr) auto;
  gap: 9px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #eadfff;
  border-radius: 9px;
  background: #f1e7ff;
}
.finance-charge-filterbar input {
  min-width: 0;
  min-height: 34px;
  border: 1px solid #dcd9e5;
  border-radius: 4px;
  padding: 6px 10px;
  background: #fff;
  color: #596273;
}
.finance-charge-filter-field { position: relative; min-width: 0; }
.finance-charge-filter-field > input { width: 100%; padding-right: 30px; }
.finance-charge-filter-field > .finance-charge-filter-clear {
  position: absolute; top: 50%; right: 7px; width: 18px; min-width: 18px; min-height: 18px; transform: translateY(-50%);
  border: 0; border-radius: 50%; padding: 0; background: transparent; color: #a2a8b3; font-size: 14px; line-height: 18px;
}
.finance-charge-filter-field > .finance-charge-filter-clear:hover { border: 0; background: #f0ecfa; color: #7c3aed; filter: none; }
.finance-charge-filterbar input::placeholder { color: #a0a6b2; }
.finance-charge-filterbar input:focus { border-color: #9b7be7; outline: 2px solid #ede7ff; }
.finance-charge-filterbar button { min-height: 34px; border: 1px solid #d9dce6; background: #fff; color: #596273; }
.finance-charge-rule-table .finance-table-wrap { height: clamp(220px, 31vh, 340px); overflow-y: auto; }
.finance-charge-result-table .finance-table-wrap { height: clamp(250px, 38vh, 430px); overflow-y: auto; }
.finance-charge-rule-table .finance-table-wrap,
.finance-charge-result-table .finance-table-wrap {
  border-color: #e4e2eb;
  background: #fff;
  scrollbar-color: #c8c5d2 #f5f3f9;
  scrollbar-width: thin;
}
.finance-charge-rule-table .finance-table-wrap thead,
.finance-charge-result-table .finance-table-wrap thead { position: relative; z-index: 2; }
.finance-charge-rule-table .finance-table-empty table,
.finance-charge-result-table .finance-table-empty table { height: 100%; }
.finance-charge-rule-table .finance-table-wrap::-webkit-scrollbar,
.finance-charge-result-table .finance-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.finance-charge-rule-table .finance-table-wrap::-webkit-scrollbar-track,
.finance-charge-result-table .finance-table-wrap::-webkit-scrollbar-track { background: #f5f3f9; }
.finance-charge-rule-table .finance-table-wrap::-webkit-scrollbar-thumb,
.finance-charge-result-table .finance-table-wrap::-webkit-scrollbar-thumb { border: 2px solid #f5f3f9; border-radius: 8px; background: #c8c5d2; }
.finance-charge-panel .finance-table-wrap th { border-color: #e6e3ed; background: #fff; color: #7b8190; }
.finance-charge-panel .finance-table-wrap td { border-color: #eeecf2; background: #fff; color: #4f586a; }
.finance-charge-panel .finance-table-wrap tbody tr:hover td { background: #faf9fd; }
.finance-charge-panel .finance-empty { height: auto; color: #8e929d !important; vertical-align: middle; }
.finance-charge-panel .finance-row-actions button { min-height: 26px; border: 0; padding: 3px 6px; background: transparent; color: #6d28d9; }
.finance-charge-panel .finance-row-actions .danger { color: #ff5a67; }
.finance-charge-panel > .finance-pager { color: #686f80; }
.finance-charge-panel .finance-pager select { border-color: #d8dbe5; background: #fff; color: #596273; }
.finance-charge-panel .finance-pager button { border: 1px solid transparent; background: transparent; color: #6d28d9; }
.finance-charge-panel .finance-pager button:disabled { color: #c4c7cf; cursor: not-allowed; opacity: 1; }
.finance-charge-tabs { margin-top: 20px; border-bottom-color: #ded9e9; }
.finance-charge-tabs button.active { border-bottom-color: #7c3aed; color: #6d28d9; }
@media (max-width: 1100px) {
  .finance-charge-filterbar { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
}
.workbench.finance-history-mode .workbench-scroll { overflow-y: hidden; background: #f6f4ff; }
.finance-history-panel {
  border-color: #e1ddec;
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(76 54 126 / 6%);
}
.finance-history-toolbar { flex-wrap: nowrap; gap: 10px; margin-bottom: 14px; }
.finance-history-type { position: relative; flex: 0 0 200px; width: 200px; }
.finance-history-type > #financeHistoryTypeTrigger {
  width: 100%; min-height: 34px; justify-content: flex-start; border: 1px solid #d8dbe5; border-radius: 4px;
  padding: 6px 30px 6px 11px; background: #fff; color: #7b8190; text-align: left;
}
.finance-history-type > #financeHistoryTypeTrigger::after { position: absolute; right: 11px; content: "⌄"; color: #a3a9b5; font-size: 15px; transform: translateY(-2px); }
.finance-history-type.open > #financeHistoryTypeTrigger::after { content: "⌃"; transform: translateY(2px); }
.finance-history-type.selected > #financeHistoryTypeTrigger { border-color: #7c3aed; color: #4f586a; }
.finance-history-type.selected > #financeHistoryTypeTrigger::after { display: none; }
.finance-history-type > #financeHistoryTypeClear {
  position: absolute; top: 8px; right: 9px; z-index: 2; width: 18px; min-width: 18px; min-height: 18px;
  border: 0; border-radius: 50%; padding: 0; background: transparent; color: #a2a8b3; font-size: 15px; line-height: 18px;
}
.finance-history-type > #financeHistoryTypeClear:hover { background: #f0ecfa; color: #7c3aed; filter: none; }
.finance-history-type-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; display: grid; width: 200px; padding: 5px 0;
  border: 1px solid #e2e3e9; border-radius: 4px; background: #fff; box-shadow: 0 5px 14px rgb(44 38 61 / 14%);
}
.finance-history-type-menu::before {
  position: absolute; top: -5px; left: 28px; width: 9px; height: 9px; border-top: 1px solid #e2e3e9;
  border-left: 1px solid #e2e3e9; background: #fff; content: ""; transform: rotate(45deg);
}
.finance-history-type-menu > button {
  position: relative; z-index: 1; justify-content: flex-start; min-height: 34px; border: 0; border-radius: 0;
  padding: 7px 20px; background: #fff; color: #596273; text-align: left;
}
.finance-history-type-menu > button:hover,
.finance-history-type-menu > button[aria-selected="true"] { background: #f5f6f8; color: #4d5667; filter: none; }
.finance-history-toolbar > button {
  min-height: 34px;
  border: 1px solid #d9dce6;
  border-radius: 4px;
  background: #fff;
  color: #596273;
}
.finance-history-toolbar > button:hover { border-color: #b9a8e8; color: #6d28d9; filter: none; }
.finance-history-table .finance-table-wrap {
  height: calc(100dvh - 380px);
  min-height: 300px;
  border-color: #e4e2eb;
  background: #fff;
  overflow-y: auto;
  scrollbar-color: #c8c5d2 #f5f3f9;
  scrollbar-width: thin;
}
.finance-history-table .finance-table-wrap thead { position: relative; z-index: 2; }
.finance-history-table .finance-table-empty table { height: 100%; }
.finance-history-table .finance-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.finance-history-table .finance-table-wrap::-webkit-scrollbar-track { background: #f5f3f9; }
.finance-history-table .finance-table-wrap::-webkit-scrollbar-thumb { border: 2px solid #f5f3f9; border-radius: 8px; background: #c8c5d2; }
.finance-history-panel .finance-table-wrap th { border-color: #e6e3ed; background: #fff; color: #7b8190; }
.finance-history-panel .finance-table-wrap td { border-color: #e9e7ef; color: #4f586a; }
.finance-history-panel .finance-table-wrap tbody tr:nth-child(even) td { background: #fafafa; }
.finance-history-panel .finance-table-wrap tbody tr:hover td { background: #f7f4fc; }
.finance-history-panel .finance-table-wrap td > button { border: 0; padding: 3px 6px; background: transparent; color: #6d28d9; }
.finance-history-panel .finance-empty { height: auto; color: #8e929d !important; vertical-align: middle; }
.finance-history-panel .finance-pager { color: #686f80; }
.finance-history-panel .finance-pager select { border-color: #d8dbe5; background: #fff; color: #596273; }
.finance-history-panel .finance-pager button { border: 1px solid transparent; background: transparent; color: #6d28d9; }
.finance-history-panel .finance-pager button:hover:not(:disabled) { border-color: #e2d8fb; background: #f6f1ff; filter: none; }
.finance-history-panel .finance-pager button:disabled { color: #c4c7cf; cursor: not-allowed; opacity: 1; }
.finance-number-pager { gap: 5px; }
.finance-number-pager > span:first-child { margin-right: 8px; color: #4f586a; }
.finance-number-pager label { margin-right: 10px; }
.finance-number-pager select { min-width: 128px; padding-right: 30px; }
.finance-number-pager button {
  min-width: 30px;
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  padding: 4px 8px;
  background: transparent;
  color: #263044;
}
.finance-number-pager button:hover:not(:disabled) { background: #f4efff; color: #7c3aed; filter: none; }
.finance-number-pager button.active { color: #7c3aed; font-weight: 700; }
.finance-number-pager button:disabled { background: transparent; color: #c7cad2; }
.finance-page-ellipsis { display: inline-flex; min-width: 26px; align-items: center; justify-content: center; color: #687084; }
.finance-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.finance-section-head h3 { margin: 0; color: #172033; font-size: 15px; }
.finance-section-head p { margin: 4px 0 0; color: #64748b; font-size: 12px; }
.finance-row-actions { display: flex; gap: 6px; }
.finance-tabs { display: flex; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid #dfe5eb; }
.finance-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #64748b; }
.finance-tabs button.active { border-bottom-color: #247a5a; color: #176044; font-weight: 600; }
.finance-dialog { width: min(720px, calc(100vw - 32px)); border: 0; border-radius: 6px; padding: 0; box-shadow: 0 20px 55px #0f172a33; }
.finance-dialog::backdrop { background: #0f172a66; }
.finance-dialog form, .finance-dialog > div { padding: 18px; }
.finance-dialog header, .finance-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.finance-dialog header { margin-bottom: 16px; }
.finance-dialog header h3 { margin: 0; font-size: 17px; }
.finance-dialog footer { justify-content: flex-end; margin-top: 18px; }
.finance-dialog .icon-button { min-width: 34px; padding: 0; border: 0; background: transparent; color: #64748b; font-size: 22px; }
.finance-confirm-dialog { width: min(420px, calc(100vw - 32px)); border-radius: 5px; }
.finance-confirm-dialog > div { padding: 14px 12px 12px; }
.finance-confirm-dialog header { margin-bottom: 12px; }
.finance-confirm-dialog header h3 { color: #343b4a; font-size: 17px; font-weight: 500; }
.finance-confirm-dialog .icon-button { width: 28px; min-width: 28px; min-height: 28px; color: #9aa1ad; font-size: 18px; }
.finance-confirm-message { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 10px; padding: 2px 2px 0; }
.finance-confirm-message p { margin: 0; color: #596273; font-size: 14px; line-height: 1.7; }
.finance-confirm-warning { display: inline-flex; width: 21px; height: 21px; align-items: center; justify-content: center; margin-top: 2px; border-radius: 50%; background: #e9a12a; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.finance-confirm-dialog footer { margin-top: 14px; }
.finance-confirm-dialog footer > button { min-width: 60px; }
.finance-confirm-dialog #financeFeeConfirmSubmit { border-color: #7c3aed; background: #7c3aed; color: #fff; }
.finance-confirm-dialog #financeFeeConfirmSubmit:hover:not(:disabled) { background: #6d28d9; filter: none; }
.finance-dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.finance-dialog-grid label { display: grid; gap: 5px; color: #475569; font-size: 13px; }
.finance-dialog-grid label:first-child { grid-column: 1 / -1; }
.finance-park-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; padding: 0 0 14px !important; }
.finance-park-list { max-height: 340px; overflow: auto; border-top: 1px solid #e2e8f0; }
.finance-park-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf1f5; }
.finance-park-list > div > span { display: flex; align-items: center; gap: 8px; }
.finance-park-list small { display: block; color: #94a3b8; }
@media (max-width: 760px) {
  .module-nav { gap: 0; padding: 0 4px; overflow-x: auto; overflow-y: hidden; }
  .module-tab { flex: 0 0 auto; min-height: 64px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
  .module-tab.active::after { right: 10px; left: 10px; }
  .finance-panel { padding: 10px; }
  .finance-toolbar, .finance-filterbar { align-items: stretch; }
  .finance-toolbar:not(.finance-meter-toolbar) > *, .finance-search:not(.finance-meter-search) { min-width: 0; width: 100%; }
  .finance-meter-toolbar { align-items: center; }
  .finance-meter-search { flex: 0 0 230px; min-width: 230px; }
  .finance-fee-date-picker { min-width: 300px; }
  .finance-fee-date-menu { left: 0; max-height: 70vh; overflow-y: auto; transform: none; }
  .finance-fee-date-menu::before { left: 50%; }
  #financeFeeCalendars { grid-template-columns: 1fr; }
  .finance-calendar-month + .finance-calendar-month { border-top: 1px solid #e6e8ed; border-left: 0; }
  .finance-task-meta, .finance-filterbar > span { margin-left: 0; }
  .finance-dialog-grid { grid-template-columns: 1fr; }
  .finance-dialog-grid label:first-child { grid-column: auto; }
  .finance-park-form { grid-template-columns: 1fr; }
  .finance-section-head { align-items: stretch; flex-direction: column; }
  .finance-section-head .finance-search { width: 100%; }
}
