:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dfe7f0;
  --text: #182235;
  --muted: #6b7c93;
  --blue: #2563eb;
  --green: #16a765;
  --orange: #e87912;
  --red: #e94747;
  --pink: #db2777;
  --teal: #0891b2;
  --violet: #7c3aed;
  --shadow: 0 8px 24px rgba(24, 34, 53, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.sidebar-section {
  padding: 0 12px;
}

.sidebar-group {
  margin-bottom: 8px;
}

.sidebar-label {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-item:hover {
  background: #f2f6fb;
}

.sidebar-item.is-active {
  color: var(--blue);
  background: #eef5ff;
}

.tree-menu {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
}

.tree-node {
  min-width: 0;
}

.tree-children {
  display: grid;
  gap: 2px;
}

.tree-children[hidden] {
  display: none;
}

.tree-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.tree-button:hover {
  background: #f2f6fb;
}

.tree-button.is-active {
  color: var(--blue);
  background: #eef5ff;
}

.tree-button.has-children {
  padding-right: 22px;
}

.tree-button.has-children::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid #95a1b2;
  border-bottom: 1.5px solid #95a1b2;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.tree-node.is-expanded > .tree-button.has-children::after {
  transform: rotate(45deg);
}

.tree-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tree-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #7b8da4;
}

.tree-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tree-button.is-active .tree-icon {
  color: var(--blue);
}

.tree-level-1 > .tree-button {
  padding: 8px 24px 8px 14px;
  font-size: 13px;
  font-weight: 800;
}

.tree-level-1 > .tree-button .tree-icon {
  width: 16px;
  height: 16px;
}

.tree-level-2 > .tree-button {
  padding: 7px 24px 7px 28px;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}

.tree-level-2 > .tree-button .tree-icon {
  width: 14px;
  height: 14px;
}

.tree-level-3 > .tree-button {
  min-height: 28px;
  padding: 6px 12px 6px 42px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.tree-level-3 > .tree-button .tree-icon {
  width: 12px;
  height: 12px;
  color: #a5b3c4;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-config-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: white;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.role-config-entry svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.role-config-entry:hover,
.role-config-entry.is-active {
  border-color: #bfd4ff;
  background: #eef5ff;
  color: var(--blue);
}

.role-switcher {
  display: grid;
  grid-template-columns: auto minmax(128px, 168px) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.role-switcher-label,
.role-switcher-user {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.role-switcher .select {
  width: 100%;
  border-color: transparent;
  background: white;
  box-shadow: inset 0 0 0 1px #edf1f6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 176px;
  font-size: 16px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-size: 13px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.nav-tab {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-tab.is-active {
  color: var(--blue);
  background: #eef5ff;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(380px, 28vw);
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #95a1b2;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #f2f6fb;
  color: var(--text);
  font-weight: 800;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 128px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  font-weight: 800;
  font-size: 12px;
}

.user-chip small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.page {
  flex: 1;
  width: min(1280px, calc(100vw - 268px));
  margin: 0 auto;
  padding: 28px 28px 52px;
}

.hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-row.is-hidden {
  display: none;
}

.top-right.is-hidden {
  display: none;
}

.hero-row h1 {
  margin: 4px 0 0;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.16;
  font-weight: 800;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.select,
.primary-button,
.ghost-button,
.link-button {
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: white;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

.primary-button {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ghost-button {
  background: #f7f9fc;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0 6px;
}

.view-stack {
  display: none;
}

.view-stack.is-visible {
  display: block;
}

.band,
.panel,
.module-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.band {
  padding: 22px;
  margin-bottom: 18px;
}

.band.is-hidden {
  display: none;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading.flush {
  margin: 8px 0 16px;
}

.section-heading h2,
.panel h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-item {
  min-height: 92px;
  padding: 8px 18px 8px 0;
  border-right: 1px solid var(--line);
}

.metric-item:last-child {
  border-right: 0;
}

.metric-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.account-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
}

.metric-value {
  margin: 6px 0;
  font-size: 20px;
  font-weight: 900;
}

.metric-foot {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.up {
  color: var(--green);
}

.down {
  color: var(--red);
}

.flat {
  color: var(--orange);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.module-grid.dense {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  margin-bottom: 0;
}

.module-card {
  position: relative;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  text-align: left;
  box-shadow: 0 2px 8px rgba(24, 34, 53, 0.03);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  overflow: hidden;
  cursor: pointer;
}

.module-card:hover,
.module-card.is-selected {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--tint);
}

.module-card .trend {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 11px;
  font-weight: 800;
  color: var(--trend);
}

.module-title {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
}

.module-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 900;
}

.module-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.module-sub span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(107, 124, 147, 0.12);
  line-height: 1.25;
}

.module-date-filter {
  min-width: 128px;
}

.module-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px -18px -18px;
  padding: 12px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
  background: var(--tint);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  border-radius: 0 0 7px 7px;
}

.module-link-text {
  display: flex;
  align-items: center;
  gap: 4px;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: white;
}

.module-icon svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  pointer-events: none;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 22px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pill {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: #f2f6fb;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.pill.is-active {
  color: var(--blue);
  background: #eaf2ff;
}

.list,
.timeline,
.schedule-list {
  display: grid;
  gap: 10px;
}

.list-row,
.timeline-row,
.schedule-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f6;
}

.list-row:last-child,
.timeline-row:last-child,
.schedule-row:last-child {
  border-bottom: 0;
}

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row-title {
  font-weight: 800;
  font-size: 13px;
}

.row-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  border: 0;
  border-radius: 6px;
  padding: 4px 8px;
  background: #eef2f7;
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
}

.small-button.process {
  background: var(--green);
  color: white;
}

.small-button.main {
  background: var(--blue);
  color: white;
}

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

.quick-grid.compact {
  grid-template-columns: repeat(4, minmax(80px, 1fr));
}

.quick-action {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 80px;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--text);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.quick-action:hover {
  border-color: var(--accent);
  background: var(--tint);
}

.quick-symbol {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 18px;
  font-weight: 900;
}

.quick-symbol svg {
  width: 16px;
  height: 16px;
  stroke: white;
  pointer-events: none;
}

.module-mosaic {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.summary-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.mini-kpi {
  min-height: 60px;
  border-radius: 8px;
  padding: 10px;
  background: var(--tint);
  font-size: 11px;
  font-weight: 700;
}

.mini-kpi strong {
  display: block;
  font-size: 16px;
  margin-top: 4px;
  color: var(--accent);
  font-weight: 900;
}

.progress-row {
  display: grid;
  grid-template-columns: 88px 1fr 42px;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value);
  border-radius: inherit;
  background: var(--accent);
}

.module-detail {
  padding: 22px;
}

.detail-top {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.detail-card {
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 18px;
  background: var(--tint);
}

.detail-card strong {
  display: block;
  margin: 6px 0;
  font-size: 28px;
  font-weight: 900;
}

.quick-actions-wrapper {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
  width: 100%;
  grid-column: 1 / -1;
}

.quick-actions-title {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  width: 100%;
}

.detail-action {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 80px;
  border: 0;
  border-radius: 8px;
  padding: 8px 6px;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
  font-size: 12px;
  line-height: 1.2;
}

.detail-action:hover {
  background: var(--tint);
}

.detail-action span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 18px;
}

.detail-action span svg {
  width: 20px;
  height: 20px;
  stroke: white;
  pointer-events: none;
}

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.overview-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--fill);
}

.overview-card strong {
  display: block;
  margin: 6px 0;
  font-size: 22px;
  font-weight: 900;
}

.chart-box h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 0.62fr);
  gap: 14px;
  margin-top: 14px;
}

.chart-box {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
}

.chart-box h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 14px;
  height: 142px;
  padding: 12px 0 0;
  border-bottom: 1px solid #edf1f6;
}

.bar {
  flex: 1;
  min-width: 14px;
  height: var(--height);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(37, 99, 235, 0.32));
}

.bar-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.data-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: white;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}

.data-table th {
  color: #52647b;
  background: #f5f8fb;
  font-size: 11px;
  font-weight: 800;
}

.data-table tr.warning {
  background: #fff7e7;
}

.data-table tr.danger {
  background: #ffecec;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  border-radius: 6px;
  padding: 3px 6px;
  background: var(--tint);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.placeholder-panel {
  max-width: 720px;
  margin-top: 16px;
}

.placeholder-panel p {
  color: var(--muted);
}

.settings-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  margin-top: 8px;
}

.settings-current-card {
  min-width: 320px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-current-card span,
.settings-current-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.settings-current-card strong {
  display: block;
  margin: 2px 0;
  font-size: 15px;
}

.settings-current-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
}

.role-list-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 92px;
}

.role-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.role-list-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.role-count {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  background: #eef2f7;
  padding: 2px 8px;
  border-radius: 999px;
}

.role-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.role-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  font-size: 13px;
  font-weight: 700;
}

.role-list-item:hover {
  background: #f2f6fb;
}

.role-list-item.is-active {
  background: #eef5ff;
  border-color: #bcd4ff;
  color: var(--blue);
}

.role-list-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.role-list-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid color-mix(in srgb, var(--avatar-accent, #2563eb) 34%, #dfe7f0);
  box-shadow: inset 0 0 0 2px #ffffff;
}

.business-avatar-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.role-list-info small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.45;
  white-space: normal;
}

.role-list-info span {
  display: block;
  line-height: 1.25;
}

.role-list-badge {
  flex-shrink: 0;
  background: #eef2f7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
}

.role-detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}

.role-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.role-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.role-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: white;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.role-switch-btn:hover {
  background: var(--blue);
  color: white;
}

.role-switch-btn.is-current {
  background: #ecfbf3;
  border-color: var(--green);
  color: var(--green);
  cursor: default;
}

.role-current-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

.role-current-indicator::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.role-current-indicator.is-visible {
  display: flex;
}

.role-list-item.is-current {
  background: #ecfbf3;
  border-color: #b8efcf;
}

.role-list-item.is-current .role-list-badge {
  background: #ecfbf3;
  color: var(--green);
}

.role-detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: white;
}

.role-detail-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.role-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.role-status-chip {
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.role-status-chip.is-current {
  background: #ecfbf3;
  color: var(--green);
}

.role-detail-info .role-desc {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.role-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.role-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.role-tabs {
  display: flex;
  gap: 4px;
  margin: 16px 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.role-tab {
  border: 0;
  border-radius: 6px;
  padding: 6px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
}

.role-tab:hover {
  background: #f2f6fb;
}

.role-tab.is-active {
  color: var(--blue);
  background: #eef5ff;
}

.role-tab-content {
  min-height: 320px;
  padding: 0 20px;
}

.role-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  background: #fbfdff;
}

.role-permission-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px 0;
}

.role-summary-tile {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.role-summary-tile.is-linked {
  border-color: #bcd4ff;
  background: #eef5ff;
}

.role-summary-tile span,
.role-summary-tile small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.role-summary-tile strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 16px;
  line-height: 1.25;
}

.role-summary-tile.is-linked strong {
  color: var(--blue);
}

.perm-group {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.perm-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f6;
  background: #f8fafc;
}

.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid #f2f6fb;
  font-size: 12px;
  background: white;
}

.perm-row:last-child {
  border-bottom: 0;
}

.module-sort-list {
  background: #ffffff;
}

.module-sort-row {
  position: relative;
  cursor: grab;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.module-sort-row:hover {
  background: #fbfdff;
}

.module-sort-row.is-dragging {
  opacity: 0.55;
}

.module-sort-row.is-drop-target {
  background: #eef5ff;
}

.module-sort-row.is-drop-before::before,
.module-sort-row.is-drop-after::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--blue);
}

.module-sort-row.is-drop-before::before {
  top: 0;
}

.module-sort-row.is-drop-after::after {
  bottom: 0;
}

.module-sort-row:active {
  cursor: grabbing;
}

.module-permission-row {
  display: block;
  padding: 0;
}

.module-permission-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
}

.module-actions-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 8px;
  padding-top: 8px;
}

.feature-permission-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px 68px;
}

.feature-permission-item {
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}

.feature-permission-item.is-expanded {
  border-color: #bcd4ff;
  background: #ffffff;
}

.feature-permission-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 34px 9px 10px;
  border: 0;
  background: transparent;
  color: #1f2937;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.feature-permission-head::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #95a1b2;
  border-bottom: 2px solid #95a1b2;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.feature-permission-item.is-expanded .feature-permission-head::after {
  transform: rotate(225deg);
}

.feature-permission-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.feature-permission-item .module-actions-row {
  padding: 0 10px 10px;
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #95a1b2;
  cursor: grab;
}

.drag-handle svg {
  width: 16px;
  height: 16px;
}

.sort-index {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f2f6fb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.empty-sort-row {
  padding: 14px 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.perm-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.perm-label svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.perm-label .perm-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--tint, #eef5ff);
}

.perm-label .perm-icon svg {
  width: 14px;
  height: 14px;
  color: var(--accent, #2563eb);
}

.perm-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d1d9e6;
  border: 0;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle.is-on {
  background: var(--blue);
}

.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
}

.toggle.is-on::after {
  transform: translateX(16px);
}

.perm-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.perm-tag.read {
  background: #eef5ff;
  color: #2563eb;
}

.perm-tag.write {
  background: #ecfbf3;
  color: #16a765;
}

.perm-tag.none {
  background: #f2f6fb;
  color: #95a1b2;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.action-perm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
  background: white;
}

.action-perm-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.action-perm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.action-perm-body {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.action-perm-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

.action-perm-check.compact {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #edf1f6;
  border-radius: 6px;
  background: #fbfdff;
}

.action-perm-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}

.data-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
  background: white;
}

.data-scope-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.data-scope-card:hover {
  border-color: var(--blue);
}

.data-scope-card.is-selected {
  border-color: var(--blue);
  background: #eef5ff;
}

.data-scope-card h4 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
}

.data-scope-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .settings-current-card {
    min-width: 0;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .role-list-panel {
    max-height: 200px;
    overflow-y: auto;
    position: static;
  }

  .action-perm-grid {
    grid-template-columns: 1fr;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  place-items: center;
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.modal-overlay.is-open {
  display: grid;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border-radius: 10px;
  width: min(520px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s;
}

.modal-close:hover {
  background: #f2f6fb;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--text);
  transition: border-color 0.15s;
}

.form-input:focus,
.form-textarea:focus {
  outline: 0;
  border-color: var(--blue);
  background: white;
}

.form-textarea {
  min-height: 72px;
  resize: vertical;
}

.modal-modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.modal-module-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.modal-module-chip:hover {
  border-color: var(--blue);
}

.modal-module-chip.is-selected {
  border-color: var(--blue);
  background: #eef5ff;
  color: var(--blue);
}

.modal-module-chip svg {
  width: 14px;
  height: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 14px 20px;
  }

  .role-permission-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-tabs {
    order: 3;
    width: 100%;
  }

  .top-actions {
    flex: 1;
    justify-content: flex-end;
  }

  .search-box {
    width: min(320px, 42vw);
  }

  .module-grid,
  .module-grid.dense {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-strip,
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column,
  .module-mosaic,
  .chart-row,
  .detail-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100vw - 24px, 640px);
    padding-top: 20px;
  }

  .top-right,
  .role-switcher {
    width: 100%;
  }

  .role-config-entry {
    justify-content: center;
  }

  .role-switcher {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .brand {
    min-width: auto;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .hero-row,
  .overview-head {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .module-grid,
  .module-grid.dense,
  .metric-strip,
  .overview-grid,
  .role-permission-summary,
  .data-scope-grid,
  .summary-kpis {
    grid-template-columns: 1fr;
  }

  .role-detail-header,
  .role-action-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .role-meta {
    gap: 8px;
  }

  .modal-modules,
  .action-perm-body {
    grid-template-columns: 1fr;
  }

  .module-permission-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-actions-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-permission-list {
    padding-left: 12px;
  }

  .module-card {
    min-height: 136px;
  }

  .quick-grid,
  .quick-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-table {
    display: block;
    overflow-x: auto;
  }
}

/* Decision Center Styles */
.decision-center-layout {
  padding: 0 20px;
}

.decision-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.decision-title {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.decision-category {
  margin-bottom: 32px;
}

.decision-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

.decision-category-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.decision-category-icon svg {
  width: 20px;
  height: 20px;
}

.decision-category-icon.salary {
  background: #ecfdf5;
  color: #10b981;
}

.decision-category-icon.performance {
  background: #eff6ff;
  color: #3b82f6;
}

.decision-category-icon.reward {
  background: #fef3c7;
  color: #f59e0b;
}

.decision-category-icon.punishment {
  background: #fef2f2;
  color: #ef4444;
}

.decision-category-icon.custom {
  background: #f5f3ff;
  color: #8b5cf6;
}

.decision-category-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  flex: 1;
}

.decision-category-count {
  font-size: 13px;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 12px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.decision-model-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.decision-model-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.decision-model-gear {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1;
}

.decision-model-gear:hover {
  color: #2563eb;
}

.decision-model-gear svg {
  width: 18px;
  height: 18px;
}

.decision-model-gear.is-active svg {
  animation: spin 3s linear infinite;
  color: #10b981;
}

.decision-model-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.decision-model-card:hover {
  border-color: #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.decision-model-card:hover::before {
  transform: scaleX(1);
}

.decision-model-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-right: 36px;
}

.decision-model-header h4 {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.decision-model-header .tag {
  flex-shrink: 0;
}

.decision-model-card p {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px;
}

.decision-model-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 16px;
}

.decision-model-publisher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-weight: 600;
}

.decision-model-publisher-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 16px;
  padding-top: 4px;
}

.decision-model-links {
  display: flex;
  justify-content: space-around;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.model-link-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #64748b;
  transition: color 0.2s;
}

.model-link-item:hover {
  color: #2563eb;
}

.model-link-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  transition: background 0.2s;
}

.model-link-item:hover .model-link-icon {
  background: #eef5ff;
}

.model-link-icon svg {
  width: 16px;
  height: 16px;
}

.model-link-label {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.decision-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-disabled-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #f7f9fc;
  color: #64748b;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.toggle-disabled-btn svg {
  flex-shrink: 0;
}

.toggle-disabled-btn:hover {
  background: #eef2f7;
  color: #334155;
}

.toggle-disabled-btn.is-active {
  background: #eef5ff;
  border-color: #bcd4ff;
  color: #2563eb;
}

.decision-model-card.is-disabled {
  background: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.75;
  cursor: default;
}

.decision-model-card.is-disabled:hover {
  border-color: #e2e8f0;
  box-shadow: none;
  transform: none;
}

.decision-model-card.is-disabled::before {
  display: none;
}

.decision-model-card.is-disabled .decision-model-header h4 {
  color: #94a3b8;
}

.decision-model-card.is-disabled p {
  color: #b0b8c4;
}

.decision-model-card.is-disabled .decision-model-meta span {
  color: #b0b8c4;
}

.decision-model-card.is-disabled .decision-model-publisher {
  color: #b0b8c4;
}

.decision-model-card.is-disabled .decision-model-publisher-row {
  color: #b0b8c4;
}

.decision-model-card.is-disabled .decision-model-gear {
  color: #cbd5e1;
}

.decision-model-card.is-disabled .decision-model-gear svg {
  animation: none;
  color: #cbd5e1;
}

.decision-model-card.is-disabled .tag {
  background: #f1f5f9;
  color: #94a3b8;
}

.decision-model-card.is-disabled .decision-model-links .model-link-item {
  color: #b0b8c4;
  pointer-events: none;
}

.decision-model-card.is-disabled .decision-model-links .model-link-icon {
  background: #f0f2f5;
}

/* 详情页面样式 */
.detail-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 24px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
}

.detail-header-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.detail-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-status {
  font-size: 12px;
  font-weight: 500;
  color: #f59e0b;
  background: #fef3c7;
  padding: 4px 10px;
  border-radius: 12px;
}

.detail-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.detail-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-progress-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.detail-progress-bar {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 12px 16px;
}

.detail-progress-steps {
  display: flex;
  align-items: center;
  gap: 24px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.progress-step::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 100%;
  width: 24px;
  height: 2px;
  background: #e5e7eb;
}

.progress-step:last-child::after {
  display: none;
}

.progress-step.completed::after {
  background: #10b981;
}

.step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  background: #e5e7eb;
  color: #64748b;
}

.progress-step.completed .step-icon {
  background: #10b981;
  color: white;
}

.progress-step.active .step-icon {
  background: #3b82f6;
  color: white;
}

.progress-step span {
  font-size: 10px;
  color: #64748b;
  white-space: nowrap;
}

.progress-step.completed span,
.progress-step.active span {
  color: #1a1a1a;
  font-weight: 500;
}

/* 漏斗层通用样式 */
.funnel-layer {
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: white;
}

.layer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
}

.layer-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.layer-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
}

.layer-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.layer-desc {
  font-size: 13px;
  color: #64748b;
}

.layer-count {
  font-size: 13px;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 12px;
}

.layer-content {
  padding: 20px;
  background: #f9fafb;
}

/* 第1层：应用层 */
.layer-app .layer-header {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.layer-app .layer-number {
  background: rgba(255,255,255,0.2);
}

.layer-app .layer-name,
.layer-app .layer-desc {
  color: white;
}

.layer-app .layer-count {
  background: rgba(255,255,255,0.2);
  color: white;
}

.app-preview-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.app-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #1e293b;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.app-preview-time {
  font-size: 12px;
  opacity: 0.7;
}

.app-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 16px;
}

.app-preview-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
}

.app-preview-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.app-preview-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.trend-up {
  font-size: 12px;
  color: #10b981;
  font-weight: 500;
}

.app-preview-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(#3b82f6 0% 48%, #10b981 48% 73%, #f59e0b 73% 93%, #ef4444 93% 98%, #e5e7eb 98% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 auto;
}

.chart-ring span {
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.bar-item span:first-child {
  width: 40px;
  color: #64748b;
}

.bar-item span:last-child {
  width: 30px;
  text-align: right;
  font-weight: 600;
}

.bar {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 3px;
}

.app-preview-rank {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.rank-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.rank-item:nth-child(1) .rank-num {
  background: #fef3c7;
  color: #f59e0b;
}

.rank-item:nth-child(2) .rank-num {
  background: #e5e7eb;
  color: #64748b;
}

.rank-item:nth-child(3) .rank-num {
  background: #fef2f2;
  color: #ef4444;
}

.rank-name {
  flex: 1;
  color: #1a1a1a;
}

.rank-score {
  font-weight: 600;
  color: #3b82f6;
}

.app-preview-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 120px;
  padding-top: 12px;
}

.dept-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 40px;
}

.dept-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #3b82f6, #60a5fa);
  border-radius: 4px 4px 0 0;
  min-height: 20px;
}

.dept-bar span {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

/* 第2层：算法层 */
.layer-algorithm .layer-header {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.layer-algorithm .layer-number {
  background: rgba(255,255,255,0.2);
}

.layer-algorithm .layer-name,
.layer-algorithm .layer-desc {
  color: white;
}

.layer-algorithm .layer-count {
  background: rgba(255,255,255,0.2);
  color: white;
}

.algorithm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.algorithm-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
}

.algorithm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.algorithm-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.algorithm-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.algorithm-status.enabled {
  background: #ecfdf5;
  color: #10b981;
}

.algorithm-formula,
.algorithm-desc {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.5;
}

.algorithm-config {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.config-tag {
  font-size: 11px;
  padding: 4px 8px;
  background: #f1f5f9;
  border-radius: 4px;
  color: #475569;
}

/* 第3层：模型层 */
.layer-model .layer-header {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}

.layer-model .layer-number {
  background: rgba(255,255,255,0.2);
}

.layer-model .layer-name,
.layer-model .layer-desc {
  color: white;
}

.layer-model .layer-count {
  background: rgba(255,255,255,0.2);
  color: white;
}

.model-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.model-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.model-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

.model-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.model-status.selected {
  background: #ecfdf5;
  color: #10b981;
}

.model-card-body {
  padding: 16px;
}

.model-desc {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.model-config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.model-config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
}

.config-label {
  font-size: 12px;
  color: #64748b;
}

.config-value {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}

.model-grade {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grade-label {
  font-size: 12px;
  color: #64748b;
}

.grade-item {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
}

.grade-s {
  background: #fef3c7;
  color: #f59e0b;
}

.grade-a {
  background: #ecfdf5;
  color: #10b981;
}

.grade-b {
  background: #eff6ff;
  color: #3b82f6;
}

.grade-c {
  background: #fef2f2;
  color: #ef4444;
}

.grade-d {
  background: #f1f5f9;
  color: #64748b;
}

/* 第4层：规则层 */
.layer-rules .layer-header {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.layer-rules .layer-number {
  background: rgba(255,255,255,0.2);
}

.layer-rules .layer-name,
.layer-rules .layer-desc {
  color: white;
}

.layer-rules .layer-count {
  background: rgba(255,255,255,0.2);
  color: white;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.rules-column {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.rules-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.rules-column-header.bonus {
  background: #ecfdf5;
}

.rules-column-header.penalty {
  background: #fef2f2;
}

.rules-column-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.rules-column-count {
  font-size: 11px;
  color: #64748b;
  background: white;
  padding: 2px 8px;
  border-radius: 10px;
}

.rules-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-item {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

.rule-item.bonus {
  border-left-color: #10b981;
}

.rule-item.penalty {
  border-left-color: #ef4444;
}

.rule-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.rule-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rule-bonus {
  font-size: 12px;
  color: #10b981;
}

.rule-penalty {
  font-size: 12px;
  color: #ef4444;
}

/* 第5层：指标层 */
.layer-indicators .layer-header {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.layer-indicators .layer-number {
  background: rgba(255,255,255,0.2);
}

.layer-indicators .layer-name,
.layer-indicators .layer-desc {
  color: white;
}

.layer-indicators .layer-count {
  background: rgba(255,255,255,0.2);
  color: white;
}

.indicators-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.indicator-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
}

.indicator-icon {
  width: 40px;
  height: 40px;
  background: #f1f5f9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.indicator-info {
  flex: 1;
}

.indicator-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.indicator-formula {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

/* 底部操作按钮 */
.detail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #e5e7eb;
}

.primary-button.main {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: #2563eb;
}

/* 编辑按钮样式 */
.layer-edit-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #3b82f6;
  background: white;
  border: 1px solid #3b82f6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.layer-edit-btn:hover {
  background: #3b82f6;
  color: white;
}

/* 大尺寸模态框 */
.modal-large {
  max-width: 700px;
  width: 90%;
}

/* 编辑表单样式 */
.edit-form-group {
  margin-bottom: 16px;
}

.edit-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.edit-form-group input,
.edit-form-group select,
.edit-form-group textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.edit-form-group input:focus,
.edit-form-group select:focus,
.edit-form-group textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edit-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* 模型选择卡片 */
.model-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.model-select-card {
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.model-select-card:hover {
  border-color: #93c5fd;
}

.model-select-card.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.model-select-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.model-select-card-desc {
  font-size: 12px;
  color: #64748b;
}

/* 规则编辑项 */
.rule-edit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 8px;
}

.rule-edit-item .rule-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
}

.rule-edit-item input {
  width: 80px;
  padding: 4px 8px;
  font-size: 12px;
  text-align: center;
}

.rule-edit-item select {
  padding: 4px 8px;
  font-size: 12px;
}

/* 指标选择项 */
.indicator-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.indicator-select-item:hover {
  background: #f8fafc;
}

.indicator-select-item.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.indicator-select-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
}

.indicator-select-info {
  flex: 1;
}

.indicator-select-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.indicator-select-formula {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.indicator-select-unit {
  font-size: 11px;
  color: #3b82f6;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* 指标分类标签 */
.indicator-category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.indicator-category-tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.indicator-category-tab:hover {
  color: #3b82f6;
  background: #eff6ff;
  border-color: #93c5fd;
}

.indicator-category-tab.is-active {
  color: white;
  background: #3b82f6;
  border-color: #3b82f6;
}
