:root {
  --brand: #af121d;
  --brand-hover: #921019;
  --brand-soft: #fff1f1;
  --purple: #5b6472;
  --purple-soft: #f1f3f5;
  --blue: #315f91;
  --blue-soft: #eef3f7;
  --green: #2f7659;
  --green-soft: #edf5f1;
  --orange: #9a651f;
  --orange-soft: #f8f3e9;
  --red: #b83a42;
  --red-soft: #f9eeee;
  --page: #f4f5f6;
  --card: #fff;
  --control: #fff;
  --head: #f7f8fa;
  --hover: #f7f8fa;
  --text-1: #1d2129;
  --text-2: #4e5969;
  --text-3: #86909c;
  --border: #e5e6eb;
  --border-strong: #c9cdd4;
  --shadow: 0 3px 12px rgb(29 33 41 / 7%);
  --header-h: 60px;
  --tabs-h: 34px;
  --sider-w: 220px;
  --radius: 4px;
  --font: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

[data-theme="dark"] {
  --page: #17171a;
  --card: #232324;
  --control: #2d2d2f;
  --head: #2d2d2f;
  --hover: #303033;
  --text-1: #f2f3f5;
  --text-2: #c9cdd4;
  --text-3: #86909c;
  --border: #414146;
  --border-strong: #55555a;
  --brand-soft: rgb(175 18 29 / 16%);
  --blue-soft: rgb(22 93 255 / 16%);
  --green-soft: rgb(0 168 112 / 16%);
  --orange-soft: rgb(255 125 0 / 16%);
  --red-soft: rgb(245 63 63 / 16%);
  --purple-soft: rgb(114 46 209 / 18%);
  --shadow: 0 4px 18px rgb(0 0 0 / 25%);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-width: 1180px;
  margin: 0;
  overflow: hidden;
  color: var(--text-1);
  background: var(--page);
  font-family: var(--font);
  font-size: 14px;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template:
    "header header" var(--header-h)
    "sider main" calc(100vh - var(--header-h)) / var(--sider-w) minmax(0, 1fr);
  width: 100%;
  height: 100%;
}

.app-shell.collapsed {
  --sider-w: 48px;
}

.app-header {
  grid-area: header;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 18px 0 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgb(29 33 41 / 4%);
}

.brand,
.header-actions,
.brand-text,
.user-chip,
.ai-health {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
}

.brand-symbol {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--brand);
  box-shadow: none;
}

.brand-symbol i {
  position: absolute;
  display: block;
  width: 5px;
  border-radius: 6px;
  background: #fff;
  transform: rotate(30deg);
}

.brand-symbol i:nth-child(1) { left: 8px; top: 13px; height: 11px; }
.brand-symbol i:nth-child(2) { left: 14px; top: 8px; height: 16px; }
.brand-symbol i:nth-child(3) { left: 20px; top: 5px; height: 19px; }

.brand-text {
  align-items: flex-start;
  flex-direction: column;
  gap: 1px;
}

.brand-text strong {
  color: var(--text-1);
  font-size: 15px;
  font-weight: 650;
}

.brand-text small,
.user-chip small,
.ai-health small {
  color: var(--text-3);
  font-size: 11px;
  font-style: normal;
}

.env-tag {
  margin-left: 5px;
  padding: 3px 7px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid rgb(175 18 29 / 18%);
  border-radius: 3px;
  font-size: 11px;
}

.header-actions {
  gap: 8px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 18px;
}

.icon-btn:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.global-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 268px;
  height: 32px;
  padding: 0 10px;
  color: var(--text-3);
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.global-search em {
  flex: 1;
  font-style: normal;
  font-size: 13px;
}

kbd {
  padding: 1px 5px;
  color: var(--text-3);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 10px;
}

.notify-btn {
  position: relative;
}

.notify-btn b {
  position: absolute;
  top: -2px;
  right: -1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  color: #fff;
  background: var(--red);
  border: 2px solid var(--card);
  border-radius: 9px;
  font-size: 9px;
  line-height: 12px;
}

.user-chip {
  gap: 8px;
  height: 42px;
  padding: 4px 8px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
}

.user-chip:hover {
  background: var(--hover);
}

.user-chip > span:nth-child(2) {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  min-width: 118px;
  text-align: left;
}

.user-chip strong {
  font-size: 13px;
}

.user-chip i {
  color: var(--text-3);
  font-style: normal;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #dc3d48);
  border-radius: 50%;
  font-weight: 600;
}

.app-sider {
  grid-area: sider;
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  transition: width .18s ease;
}

.app-sider nav {
  flex: 1;
  min-height: 0;
  padding: 10px 8px;
  overflow-x: hidden;
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 3px;
}

.nav-group-title,
.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  text-align: left;
  white-space: nowrap;
}

.nav-group-title {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}

.nav-group-title .nav-icon {
  color: var(--text-2);
}

.nav-group-title .arrow {
  margin-left: auto;
  transition: transform .15s ease;
}

.nav-group.open .nav-group-title .arrow {
  transform: rotate(180deg);
}

.nav-icon {
  display: inline-grid;
  flex: 0 0 18px;
  place-items: center;
  width: 18px;
  margin-right: 9px;
  font-size: 15px;
  font-style: normal;
}

.nav-items {
  display: none;
}

.nav-group.open .nav-items {
  display: block;
}

.nav-item {
  position: relative;
  height: 36px;
  margin: 2px 0;
  padding-left: 17px;
  font-size: 13px;
}

.nav-item:hover {
  color: var(--text-1);
  background: var(--hover);
}

.nav-item.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.nav-item.active::before {
  position: absolute;
  top: 8px;
  left: 0;
  width: 3px;
  height: 20px;
  background: var(--brand);
  border-radius: 0 2px 2px 0;
  content: "";
}

.nav-item b {
  min-width: 19px;
  margin-left: auto;
  padding: 1px 5px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 9px;
  font-size: 10px;
  text-align: center;
}

.app-shell.collapsed .brand-text,
.app-shell.collapsed .env-tag,
.app-shell.collapsed .nav-group-title span,
.app-shell.collapsed .nav-group-title .arrow,
.app-shell.collapsed .nav-item span,
.app-shell.collapsed .nav-item b,
.app-shell.collapsed .ai-health span {
  display: none;
}

.app-shell.collapsed .app-sider nav {
  padding: 10px 5px;
}

.app-shell.collapsed .nav-group-title,
.app-shell.collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

.app-shell.collapsed .nav-icon {
  margin: 0;
}

.app-shell.collapsed .nav-items {
  display: block;
}

.sider-footer {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 8px;
  border-top: 1px solid var(--border);
}

.ai-health {
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.ai-health > i {
  width: 8px;
  height: 8px;
  background: var(--green);
  border: 2px solid var(--green-soft);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--green-soft);
}

.ai-health span {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
}

.ai-health strong {
  font-size: 11px;
  font-weight: 600;
}

.sider-footer > button {
  width: 28px;
  height: 28px;
  color: var(--text-3);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
}

.sider-footer > button:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.app-shell.collapsed .sider-footer {
  flex-direction: column;
  gap: 6px;
}

.app-shell.collapsed .ai-health {
  flex: 0;
}

.app-workspace {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.app-tabs {
  z-index: 10;
  display: flex;
  flex: 0 0 var(--tabs-h);
  height: var(--tabs-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.app-tabs > button,
.app-tabs #tabs button {
  height: 100%;
  color: var(--text-3);
  background: transparent;
  border: 0;
}

.app-tabs > button {
  flex: 0 0 34px;
  border-right: 1px solid var(--border);
}

#tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

#tabs::-webkit-scrollbar {
  display: none;
}

#tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 100px;
  max-width: 180px;
  padding: 0 12px;
  border-right: 1px solid var(--border);
  font-size: 12px;
}

#tabs button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tabs button i {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-style: normal;
}

#tabs button i:hover {
  background: var(--hover);
}

#tabs button.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

#tabs button.active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--brand);
  content: "";
}

.route-progress {
  position: relative;
  z-index: 50;
  height: 0;
}

.route-progress i {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #5aa7ff;
  box-shadow: 0 0 7px rgb(90 167 255 / 55%);
}

.route-progress.loading i {
  animation: route-loading .55s ease both;
}

@keyframes route-loading {
  0% { width: 5%; }
  70% { width: 78%; }
  100% { width: 100%; opacity: 0; }
}

.app-content {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 18px 20px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--page);
}

.watermark {
  position: fixed;
  right: 36px;
  bottom: 18px;
  z-index: 0;
  color: var(--text-3);
  font-size: 12px;
  opacity: .22;
  pointer-events: none;
  transform: rotate(-12deg);
}

#pageRoot {
  position: relative;
  z-index: 1;
}

.page {
  min-width: 0;
  animation: page-in .16s ease;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.page-heading h1 {
  margin: 3px 0 5px;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.35;
}

.page-heading p {
  max-width: 850px;
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

.breadcrumb {
  color: var(--text-3);
  font-size: 11px;
}

.page-actions,
.toolbar,
.toolbar > div,
.query-actions,
.row-actions,
.modal-footer,
.drawer-footer,
.tabs,
.legend,
.filter-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel {
  margin-bottom: 16px;
  padding: 18px 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(29 33 41 / 3%);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 24px;
  margin-bottom: 14px;
}

.section-title > div:first-child {
  position: relative;
  padding-left: 10px;
}

.section-title > div:first-child::before {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 3px;
  background: var(--brand);
  border-radius: 2px;
  content: "";
}

.section-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.section-title p {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 11px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 66px;
  height: 32px;
  padding: 0 13px;
  color: var(--text-2);
  background: var(--control);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  white-space: nowrap;
}

.btn:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.btn.primary,
.btn.danger,
.btn.ai {
  color: #fff;
  border-color: transparent;
}

.btn.primary {
  background: var(--brand);
}

.btn.primary:hover {
  background: var(--brand-hover);
}

.btn.danger {
  background: var(--red);
}

.btn.ai {
  color: var(--text-2);
  background: var(--control);
  border-color: var(--border-strong);
  box-shadow: none;
}

.btn.ai:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand);
}

.btn.text {
  min-width: 0;
  padding: 0 4px;
  color: var(--brand);
  background: transparent;
  border-color: transparent;
}

.btn:disabled {
  color: var(--text-3);
  background: var(--head);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: .62;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metrics.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  min-height: 108px;
  padding: 16px;
  color: var(--text-1);
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(29 33 41 / 3%);
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
}

.metric-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.metric-icon {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 12px;
  font-size: 20px;
}

.metric-card.success .metric-icon { color: var(--green); background: var(--green-soft); }
.metric-card.warning .metric-icon { color: var(--orange); background: var(--orange-soft); }
.metric-card.danger .metric-icon { color: var(--red); background: var(--red-soft); }
.metric-card.purple .metric-icon { color: var(--purple); background: var(--purple-soft); }

.metric-copy {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
}

.metric-copy small {
  color: var(--text-3);
  font-size: 11px;
}

.metric-copy strong {
  margin: 5px 0 3px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -.5px;
}

.metric-copy em {
  color: var(--text-3);
  font-size: 10px;
  font-style: normal;
}

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

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.query-panel {
  padding-bottom: 14px;
}

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

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

.field {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field.wide {
  grid-column: 1 / -1;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 12px;
}

.field-label b {
  color: var(--red);
}

.field-label i {
  color: var(--text-3);
  font-size: 11px;
  font-style: normal;
  cursor: help;
}

.field-error {
  color: var(--red);
  font-size: 11px;
}

.control,
.field input,
.field select,
.field textarea,
.search-box,
.date-range {
  width: 100%;
  min-width: 0;
  color: var(--text-1);
  background: var(--control);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
}

.field input,
.field select,
.control {
  height: 32px;
  padding: 0 9px;
}

.field textarea {
  min-height: 88px;
  padding: 8px 9px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgb(175 18 29 / 9%);
}

.field input:disabled,
.field select:disabled {
  color: var(--text-3);
  background: var(--head);
}

.query-actions {
  align-self: end;
  justify-content: flex-end;
  grid-column: 1 / -1;
  padding-top: 2px;
  border-top: 1px dashed var(--border);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 9px;
}

.search-box span {
  color: var(--text-3);
}

.search-box input {
  flex: 1;
  width: auto;
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.date-range {
  display: flex;
  align-items: center;
}

.date-range input {
  flex: 1;
  border: 0;
}

.date-range span {
  color: var(--text-3);
  font-size: 11px;
}

.toolbar {
  justify-content: space-between;
  min-height: 34px;
  margin-bottom: 12px;
}

.table-title {
  font-weight: 600;
}

.table-summary {
  color: var(--text-3);
  font-size: 12px;
}

.table-summary b {
  color: var(--brand);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}

th {
  height: 42px;
  padding: 0 11px;
  color: var(--text-2);
  background: var(--head);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  text-align: left;
}

td {
  height: 46px;
  max-width: 280px;
  padding: 7px 11px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  text-overflow: ellipsis;
}

tbody tr:hover td {
  background: var(--hover);
}

td.wrap {
  min-width: 240px;
  white-space: normal;
  line-height: 1.45;
}

.link,
.case-link,
.title-link,
.row-actions button {
  padding: 0;
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: 12px;
  text-align: left;
}

.case-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.title-link {
  display: block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  white-space: nowrap;
}

.row-actions button:hover,
.link:hover,
.case-link:hover,
.title-link:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

.status,
.tag,
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 8px;
  color: var(--text-2);
  background: var(--head);
  border-radius: 12px;
  font-size: 11px;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  background: var(--text-3);
  border-radius: 50%;
  content: "";
}

.status.primary { color: var(--blue); background: var(--blue-soft); }
.status.primary::before { background: var(--blue); }
.status.success { color: var(--green); background: var(--green-soft); }
.status.success::before { background: var(--green); }
.status.warning { color: var(--orange); background: var(--orange-soft); }
.status.warning::before { background: var(--orange); }
.status.danger { color: var(--red); background: var(--red-soft); }
.status.danger::before { background: var(--red); }
.status.purple { color: var(--purple); background: var(--purple-soft); }
.status.purple::before { background: var(--purple); }

.score-badge {
  min-width: 34px;
  justify-content: center;
  color: #fff;
  background: var(--blue);
  border: 0;
  font-weight: 650;
}

.score-badge.good { background: var(--green); }
.score-badge.warn { background: var(--orange); }
.score-badge.bad { background: var(--red); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 54px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  font-size: 11px;
}

.pagination button,
.pagination select,
.pagination input {
  min-width: 28px;
  height: 28px;
  color: var(--text-2);
  background: var(--control);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.pagination button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.list-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  font-size: 11px;
}

.list-pager > span {
  white-space: nowrap;
}

.list-pager > .pagination {
  flex: 1;
  min-height: 52px;
  border-top: 0;
}

.progress {
  display: inline-block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  background: var(--head);
  border-radius: 4px;
}

.progress i {
  display: block;
  width: var(--value, 50%);
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.progress.success i { background: var(--green); }
.progress.warning i { background: var(--orange); }
.progress.danger i { background: var(--red); }
.progress.purple i { background: var(--purple); }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 10px 0;
  padding: 10px 12px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid rgb(22 93 255 / 16%);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.5;
}

.alert > b {
  font-size: 15px;
}

.alert > span {
  display: flex;
  flex-direction: column;
}

.alert strong {
  color: inherit;
}

.alert.warning { color: #d46b08; background: var(--orange-soft); border-color: rgb(255 125 0 / 18%); }
.alert.danger { color: var(--red); background: var(--red-soft); border-color: rgb(245 63 63 / 18%); }
.alert.success { color: var(--green); background: var(--green-soft); border-color: rgb(0 168 112 / 18%); }
.alert.ai { color: var(--purple); background: var(--purple-soft); border-color: rgb(114 46 209 / 18%); }

.tabs {
  min-height: 38px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.tabs button {
  position: relative;
  height: 38px;
  padding: 0 13px;
  color: var(--text-3);
  background: transparent;
  border: 0;
}

.tabs button.active {
  color: var(--brand);
  font-weight: 600;
}

.tabs button.active::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  background: var(--brand);
  content: "";
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 190px;
  padding: 12px 4px 0;
  border-bottom: 1px solid var(--border);
}

.mini-bars > div {
  display: flex;
  align-items: center;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.mini-bars i {
  width: min(30px, 62%);
  height: var(--bar, 50%);
  min-height: 4px;
  background: linear-gradient(to top, var(--brand), #d84b55);
  border-radius: 3px 3px 0 0;
  transition: height .25s ease;
}

.mini-bars.purple i { background: linear-gradient(to top, var(--purple), #a67bed); }
.mini-bars.green i { background: linear-gradient(to top, var(--green), #4fc79d); }
.mini-bars.orange i { background: linear-gradient(to top, var(--orange), #ffb65c); }

.mini-bars small {
  margin-top: 7px;
  color: var(--text-3);
  font-size: 10px;
  white-space: nowrap;
}

.donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 39%, var(--blue) 39% 90%, var(--red) 90% 100%);
}

.donut::before {
  position: absolute;
  width: 102px;
  height: 102px;
  background: var(--card);
  border-radius: 50%;
  content: "";
}

.donut > span {
  z-index: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.donut strong {
  font-size: 27px;
}

.donut small {
  color: var(--text-3);
  font-size: 11px;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.chart-legend button {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: var(--text-2);
  background: transparent;
  border: 0;
  text-align: left;
}

.chart-legend i {
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 2px;
}

.chart-legend button:nth-child(1) i { background: var(--green); }
.chart-legend button:nth-child(3) i { background: var(--red); }

.chart-legend strong {
  color: var(--text-1);
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  min-height: 210px;
}

.risk-list,
.ranking,
.activity-list,
.notice-list {
  display: flex;
  flex-direction: column;
}

.risk-item,
.rank-item,
.activity-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.risk-item:last-child,
.rank-item:last-child,
.activity-item:last-child {
  border-bottom: 0;
}

.risk-item > i,
.rank-item > i,
.activity-item > i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
  font-style: normal;
}

.risk-item > span,
.rank-item > span,
.activity-item > span {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
}

.risk-item strong,
.rank-item strong,
.activity-item strong {
  font-size: 12px;
}

.risk-item small,
.rank-item small,
.activity-item small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 10px;
}

.risk-item > button,
.activity-item > button {
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: 11px;
}

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

.value-card {
  min-height: 92px;
  padding: 13px;
  color: var(--text-1);
  background: var(--head);
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: left;
}

.value-card:hover {
  border-color: var(--brand);
}

.value-card i {
  color: var(--purple);
  font-style: normal;
}

.value-card strong,
.value-card span,
.value-card small {
  display: block;
}

.value-card strong {
  margin: 5px 0 2px;
  font-size: 20px;
}

.value-card span {
  color: var(--text-2);
  font-size: 11px;
}

.value-card small {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 9px;
}

.workbench-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(440px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.welcome-card,
.workbench-stats {
  padding: 18px 20px;
  background: var(--card);
  border-radius: var(--radius);
}

.welcome-card {
  display: flex;
  align-items: center;
  gap: 15px;
}

.welcome-avatar {
  display: grid;
  flex: 0 0 54px;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), #dc3d48);
  border-radius: 50%;
  font-size: 20px;
}

.welcome-card h2 {
  margin: 3px 0 5px;
  font-size: 17px;
}

.welcome-card p,
.welcome-card small {
  margin: 0;
  color: var(--text-3);
  font-size: 11px;
}

.workbench-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
}

.workbench-stats button {
  display: flex;
  align-items: center;
  flex-direction: column;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--border);
}

.workbench-stats button:last-child {
  border-right: 0;
}

.workbench-stats strong {
  margin-bottom: 5px;
  color: var(--text-1);
  font-size: 22px;
}

.workbench-stats span {
  color: var(--text-3);
  font-size: 10px;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: grid;
  grid-template-columns: 90px 150px 1fr 80px 110px 95px;
  align-items: center;
  min-height: 48px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.task-item.done {
  opacity: .55;
}

.case-create-layout,
.detail-layout,
.search-result-layout,
.review-layout,
.role-layout,
.flow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  gap: 16px;
  align-items: start;
}

.case-create-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.sticky-actions {
  position: sticky;
  bottom: -1px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 14px;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -5px 14px rgb(29 33 41 / 5%);
}

.sticky-actions > span {
  color: var(--text-3);
  font-size: 11px;
}

.sticky-actions > div {
  display: flex;
  gap: 8px;
}

.ai-panel {
  position: sticky;
  top: 0;
  overflow: hidden;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ai-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 14px;
  color: #fff;
  background: linear-gradient(105deg, #4d2499, var(--purple));
}

.ai-panel-head > i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: rgb(255 255 255 / 15%);
  border-radius: 9px;
  font-style: normal;
}

.ai-panel-head span {
  display: flex;
  align-items: flex-start;
  flex: 1;
  flex-direction: column;
}

.ai-panel-head small {
  color: rgb(255 255 255 / 70%);
  font-size: 9px;
}

.ai-panel-body {
  padding: 14px;
}

.ai-start {
  padding: 25px 8px 14px;
  text-align: center;
}

.ai-orb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  color: var(--purple);
  background: radial-gradient(circle at 35% 30%, #fff, #e8dafb);
  border: 1px solid rgb(114 46 209 / 18%);
  border-radius: 50%;
  box-shadow: 0 8px 22px rgb(114 46 209 / 18%);
  font-size: 28px;
}

.ai-start h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

.ai-start p {
  margin: 0 0 15px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.6;
}

.privacy-note {
  margin-top: 15px;
  padding-top: 12px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  font-size: 9px;
  line-height: 1.5;
}

.ai-result {
  margin-bottom: 9px;
  padding: 11px;
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ai-result.best {
  background: var(--purple-soft);
  border-color: rgb(114 46 209 / 22%);
}

.ai-result h4 {
  margin: 7px 0 5px;
  font-size: 12px;
}

.ai-result p {
  margin: 0 0 7px;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.55;
}

.ai-result small {
  color: var(--text-3);
  font-size: 9px;
}

.upload-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 72px;
  color: var(--text-3);
  background: var(--head);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.upload-zone strong,
.upload-zone small {
  display: block;
}

.upload-zone strong {
  color: var(--text-2);
  font-size: 12px;
}

.upload-zone small {
  margin-top: 2px;
  font-size: 9px;
}

.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 18px;
  background: var(--card);
  border-radius: var(--radius);
}

.stepper > div {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  color: var(--text-3);
  font-size: 11px;
}

.stepper > div::after {
  flex: 1;
  height: 1px;
  margin-right: 8px;
  background: var(--border);
  content: "";
}

.stepper > div:last-child {
  flex: 0;
}

.stepper > div:last-child::after {
  display: none;
}

.stepper i {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--text-3);
  background: var(--head);
  border-radius: 50%;
  font-style: normal;
}

.stepper .active {
  color: var(--brand);
  font-weight: 600;
}

.stepper .active i,
.stepper .done i {
  color: #fff;
  background: var(--brand);
}

.case-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding: 17px 20px;
  background: var(--card);
  border-radius: var(--radius);
}

.case-hero h1 {
  margin: 8px 0 6px;
  font-size: 18px;
}

.case-meta,
.case-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 11px;
}

.descriptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.descriptions > div {
  display: grid;
  grid-template-columns: 108px 1fr;
  min-height: 42px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.descriptions span,
.descriptions strong {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 11px;
}

.descriptions span {
  color: var(--text-3);
  background: var(--head);
}

.descriptions strong {
  font-weight: 500;
}

.timeline {
  padding-left: 8px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  min-height: 68px;
  padding: 0 0 15px 22px;
  border-left: 1px solid var(--border);
}

.timeline-item::before {
  position: absolute;
  top: 3px;
  left: -5px;
  width: 9px;
  height: 9px;
  background: var(--card);
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  content: "";
}

.timeline-item.active::before {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.timeline-item time {
  color: var(--text-3);
  font-size: 10px;
}

.timeline-item strong {
  font-size: 11px;
}

.timeline-item p {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.55;
}

.vertical-steps {
  display: flex;
  flex-direction: column;
}

.vertical-step {
  position: relative;
  display: flex;
  gap: 10px;
  min-height: 50px;
}

.vertical-step::before {
  position: absolute;
  top: 23px;
  bottom: 0;
  left: 11px;
  width: 1px;
  background: var(--border);
  content: "";
}

.vertical-step:last-child::before {
  display: none;
}

.vertical-step > i {
  z-index: 1;
  display: grid;
  flex: 0 0 23px;
  place-items: center;
  width: 23px;
  height: 23px;
  color: var(--text-3);
  background: var(--head);
  border-radius: 50%;
  font-size: 9px;
  font-style: normal;
}

.vertical-step.done > i,
.vertical-step.active > i {
  color: #fff;
  background: var(--brand);
}

.vertical-step > span {
  display: flex;
  flex-direction: column;
}

.vertical-step strong {
  font-size: 11px;
}

.vertical-step small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 9px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  padding: 10px;
  border-radius: 50%;
  background: conic-gradient(var(--red) 0 var(--score, 52%), var(--head) var(--score, 52%) 100%);
}

.score-ring::before {
  grid-area: 1 / 1;
  width: 98px;
  height: 98px;
  background: var(--card);
  border-radius: 50%;
  content: "";
}

.score-ring > span {
  z-index: 1;
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.score-ring strong {
  font-size: 28px;
}

.score-ring small {
  color: var(--text-3);
  font-size: 9px;
}

.score-ring.good {
  background: conic-gradient(var(--green) 0 var(--score, 90%), var(--head) var(--score, 90%) 100%);
}

.dimension-list {
  display: grid;
  gap: 11px;
}

.dimension-row {
  display: grid;
  grid-template-columns: 130px 1fr 44px;
  align-items: center;
  gap: 9px;
}

.dimension-row > span,
.dimension-row > strong {
  font-size: 11px;
}

.dimension-row > strong {
  text-align: right;
}

.dimension-row small {
  grid-column: 2 / -1;
  margin-top: -6px;
  color: var(--text-3);
  font-size: 9px;
}

.search-hero {
  max-width: 980px;
  margin: 20px auto 16px;
  padding: 28px 34px;
  text-align: center;
}

.search-hero h2 {
  margin: 6px 0;
  font-size: 18px;
}

.search-hero p {
  margin: 0 0 18px;
  color: var(--text-3);
  font-size: 11px;
}

.large-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 12px;
  background: var(--control);
  border: 1px solid var(--brand);
  border-radius: 5px;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.large-search > span {
  color: var(--brand);
  font-size: 19px;
}

.large-search input {
  flex: 1;
  height: 34px;
  background: transparent;
  border: 0;
  outline: none;
}

.search-chips {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 15px;
}

.search-chips button {
  padding: 4px 9px;
  color: var(--text-3);
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 10px;
}

.search-result-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.search-result {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.search-result > i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-style: normal;
  font-weight: 600;
}

.search-result h3 {
  margin: 6px 0 4px;
  color: var(--brand);
  font-size: 13px;
}

.search-result p {
  margin: 0;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.55;
}

.search-result footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--text-3);
  font-size: 9px;
}

.review-layout {
  grid-template-columns: 245px minmax(400px, 1fr) 320px;
  min-height: 620px;
}

.review-queue,
.review-document,
.review-form,
.role-list,
.node-config {
  min-width: 0;
  padding: 14px;
  background: var(--card);
  border-radius: var(--radius);
}

.queue-item {
  width: 100%;
  margin-top: 7px;
  padding: 10px;
  color: var(--text-1);
  background: var(--head);
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: left;
}

.queue-item.active {
  background: var(--brand-soft);
  border-color: rgb(175 18 29 / 22%);
}

.queue-item > span {
  display: flex;
  justify-content: space-between;
}

.queue-item p {
  display: -webkit-box;
  margin: 5px 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 10px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.queue-item small {
  color: var(--text-3);
  font-size: 9px;
}

.document-head {
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

.document-head h2 {
  margin: 7px 0 0;
  font-size: 15px;
}

.document-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.document-section h3 {
  margin: 0 0 6px;
  font-size: 12px;
}

.document-section p {
  margin: 0;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.7;
}

.review-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--red-soft);
  border-radius: var(--radius);
}

.review-score strong {
  color: var(--red);
  font-size: 24px;
}

.review-fields {
  display: grid;
  gap: 8px;
}

.review-dimension {
  display: grid;
  grid-template-columns: 1fr 60px;
  align-items: center;
  gap: 8px;
}

.review-dimension span {
  display: flex;
  flex-direction: column;
  font-size: 10px;
}

.review-dimension small {
  color: var(--text-3);
  font-size: 9px;
}

.review-dimension input {
  width: 60px;
  height: 30px;
  background: var(--control);
  border: 1px solid var(--border);
  border-radius: 3px;
  text-align: center;
}

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

.sample-card,
.agent-card {
  padding: 17px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(29 33 41 / 3%);
}

.sample-card:hover,
.agent-card:hover {
  border-color: rgb(175 18 29 / 25%);
  box-shadow: var(--shadow);
}

.sample-card h3,
.agent-card h3 {
  margin: 8px 0 6px;
  font-size: 14px;
}

.sample-card > p,
.agent-card > p {
  min-height: 44px;
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.55;
}

.card-head,
.sample-card footer,
.agent-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  min-height: 20px;
  padding: 2px 7px;
  font-size: 9px;
}

.sample-card footer,
.agent-card footer {
  margin-top: 12px;
  padding-top: 11px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  font-size: 9px;
}

.agent-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-title > i {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--purple);
  background: var(--purple-soft);
  border-radius: 11px;
  font-size: 20px;
  font-style: normal;
}

.agent-title h3 {
  margin: 0;
}

.agent-title code {
  color: var(--text-3);
  font-size: 9px;
}

.agent-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.agent-meta span {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--head);
  border-radius: 3px;
}

.agent-meta small {
  color: var(--text-3);
  font-size: 8px;
}

.agent-meta strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}

.rule-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rule-summary > span:first-child {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 12px;
  font-size: 20px;
}

.rule-summary > div {
  flex: 1;
}

.rule-summary h2 {
  margin: 3px 0;
  font-size: 16px;
}

.rule-summary p,
.rule-summary small {
  margin: 0;
  color: var(--text-3);
  font-size: 10px;
}

.rule-list {
  display: grid;
  gap: 8px;
}

.rule-item {
  display: grid;
  grid-template-columns: 26px 1fr 180px 50px 28px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 8px;
  background: var(--head);
  border-radius: var(--radius);
}

.rule-item > i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
}

.rule-item p {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 9px;
}

.thresholds {
  display: grid;
  gap: 8px;
}

.threshold {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 10px;
  background: var(--head);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
}

.threshold.warning { border-color: var(--orange); }
.threshold.danger { border-color: var(--red); }

.threshold strong {
  grid-row: span 2;
  font-size: 17px;
}

.threshold small {
  color: var(--text-3);
  font-size: 9px;
}

.gate-modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.gate-mode {
  position: relative;
  min-height: 124px;
  padding: 14px;
  color: var(--text-1);
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.gate-mode.active {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.gate-mode > i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 9px;
  color: var(--brand);
  background: var(--card);
  border-radius: 8px;
  font-style: normal;
}

.gate-mode strong {
  display: block;
  margin-bottom: 5px;
}

.gate-mode p {
  margin: 0;
  color: var(--text-3);
  font-size: 9px;
  line-height: 1.5;
}

.gate-mode b {
  position: absolute;
  top: 9px;
  right: 9px;
  color: var(--brand);
}

.switch-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: var(--head);
  border-radius: var(--radius);
}

.switch-row span {
  display: flex;
  flex-direction: column;
}

.switch-row small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 9px;
}

.switch {
  position: relative;
  width: 34px;
  height: 18px;
  background: var(--border-strong);
  border: 0;
  border-radius: 10px;
}

.switch::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  content: "";
  transition: left .16s ease;
}

.switch.on {
  background: var(--brand);
}

.switch.on::after {
  left: 18px;
}

.role-layout {
  grid-template-columns: 260px minmax(0, 1fr);
}

.role-button {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  color: var(--text-1);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: left;
}

.role-button.active {
  background: var(--brand-soft);
  border-color: rgb(175 18 29 / 22%);
}

.role-button > i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
  font-style: normal;
}

.role-button span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.role-button small,
.role-button em {
  color: var(--text-3);
  font-size: 9px;
  font-style: normal;
}

.role-detail-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.role-detail-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.role-detail-head p {
  margin: 0;
  color: var(--text-3);
  font-size: 10px;
}

.permission-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.permission-group {
  padding: 11px;
  background: var(--head);
  border-radius: var(--radius);
}

.permission-group strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.permission-group span {
  display: inline-flex;
  margin: 3px 5px 3px 0;
  padding: 3px 6px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 3px;
  font-family: ui-monospace, monospace;
  font-size: 8px;
}

.flow-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.flow-canvas {
  position: relative;
  height: 590px;
  overflow: auto;
  background-color: var(--card);
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 22px 22px;
  border-radius: var(--radius);
}

.flow-stage {
  position: relative;
  width: 1250px;
  height: 520px;
}

.flow-line {
  position: absolute;
  z-index: 0;
  height: 2px;
  background: var(--border-strong);
  transform-origin: left center;
}

.flow-line::after {
  position: absolute;
  top: -4px;
  right: -2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--border-strong);
  content: "";
}

.flow-node {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 145px;
  min-height: 58px;
  padding: 8px;
  color: var(--text-1);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  box-shadow: 0 3px 8px rgb(29 33 41 / 8%);
  text-align: left;
}

.flow-node.active {
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.flow-node > i {
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
}

.flow-node span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.flow-node strong {
  font-size: 11px;
}

.flow-node small {
  overflow: hidden;
  color: var(--text-3);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-config {
  position: sticky;
  top: 0;
}

.node-config > h3 {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.check-list {
  display: grid;
  gap: 7px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-size: 10px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(0 0 0 / 38%);
  backdrop-filter: blur(1px);
}

.modal {
  width: min(640px, calc(100vw - 48px));
  max-height: 86vh;
  overflow: hidden;
  background: var(--card);
  border-radius: 6px;
  box-shadow: 0 18px 52px rgb(0 0 0 / 28%);
  animation: modal-in .15s ease;
}

.modal.large {
  width: min(860px, calc(100vw - 48px));
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(.98) translateY(5px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header,
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2,
.drawer-header h2 {
  margin: 0;
  font-size: 16px;
}

.modal-header p,
.drawer-header p {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 10px;
}

.modal-body {
  max-height: calc(86vh - 118px);
  padding: 17px 18px;
  overflow-y: auto;
}

.modal-footer,
.drawer-footer {
  justify-content: flex-end;
  min-height: 58px;
  padding: 12px 18px;
  background: var(--head);
  border-top: 1px solid var(--border);
}

.drawer-overlay {
  justify-content: flex-end;
  padding: 0;
}

.drawer {
  display: flex;
  flex-direction: column;
  width: 420px;
  height: 100%;
  background: var(--card);
  box-shadow: -8px 0 28px rgb(0 0 0 / 16%);
  animation: drawer-in .18s ease;
}

.drawer.wide {
  width: min(720px, 72vw);
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-body {
  flex: 1;
  min-height: 0;
  padding: 16px 18px;
  overflow-y: auto;
}

.drawer-footer {
  margin-top: auto;
}

.sdk-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgb(29 33 41 / 14%);
  pointer-events: none;
}

.sdk-chat {
  position: absolute;
  top: 76px;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 40px));
  min-height: 480px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid rgb(175 18 29 / 16%);
  border-radius: 10px;
  box-shadow: 0 20px 58px rgb(29 33 41 / 28%);
  pointer-events: auto;
  animation: sdk-in .2s ease;
}

@keyframes sdk-in {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sdk-chat.maximized {
  top: 72px;
  right: 24px;
  bottom: 24px;
  left: 244px;
  width: auto;
}

.sdk-chat.minimized {
  top: auto;
  width: 360px;
  min-height: 0;
  height: 60px;
}

.sdk-chat.minimized .sdk-case-context,
.sdk-chat.minimized .sdk-messages,
.sdk-chat.minimized .sdk-composer,
.sdk-chat.minimized .sdk-source-panel {
  display: none;
}

.sdk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 60px;
  gap: 12px;
  padding: 0 12px 0 14px;
  color: #fff;
  background: linear-gradient(112deg, #7f0c16 0%, var(--brand) 60%, #cf2735 100%);
}

.sdk-agent {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.sdk-agent-avatar,
.sdk-bubble-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: #fff;
  background: linear-gradient(145deg, #7a36d8, #a66df2);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgb(77 32 142 / 25%);
}

.sdk-agent > span:last-child {
  display: grid;
  min-width: 0;
}

.sdk-agent strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sdk-agent small {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: rgb(255 255 255 / 74%);
  font-size: 9px;
}

.sdk-agent small i {
  width: 6px;
  height: 6px;
  background: #62d89a;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(98 216 154 / 18%);
}

.sdk-window-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
}

.sdk-window-actions button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: rgb(255 255 255 / 86%);
  background: transparent;
  border: 0;
  border-radius: 4px;
}

.sdk-window-actions button:hover {
  color: #fff;
  background: rgb(255 255 255 / 14%);
}

.sdk-case-context {
  display: flex;
  align-items: center;
  flex: 0 0 48px;
  gap: 9px;
  padding: 0 14px;
  background: var(--brand-soft);
  border-bottom: 1px solid rgb(175 18 29 / 10%);
}

.sdk-case-context > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.sdk-case-context strong {
  font-size: 11px;
}

.sdk-case-context small {
  overflow: hidden;
  color: var(--text-3);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sdk-case-context button {
  margin-left: auto;
  padding: 0;
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: 10px;
}

.sdk-messages {
  flex: 1;
  min-height: 0;
  padding: 16px 14px 22px;
  overflow-y: auto;
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at 100% 0%, rgb(119 71 204 / 6%), transparent 32%),
    var(--page);
}

.sdk-session-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 15px;
  color: var(--text-3);
  font-size: 9px;
}

.sdk-session-divider::before,
.sdk-session-divider::after {
  flex: 1;
  height: 1px;
  background: var(--border);
  content: "";
}

.sdk-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
}

.sdk-message.user {
  justify-content: flex-end;
}

.sdk-bubble-avatar,
.sdk-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 11px;
}

.sdk-user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--brand);
}

.sdk-message .sdk-bubble {
  max-width: calc(100% - 38px);
  padding: 11px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px 10px 10px;
  box-shadow: 0 1px 3px rgb(29 33 41 / 4%);
}

.sdk-message.user .sdk-bubble {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  border-radius: 10px 4px 10px 10px;
}

.sdk-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.sdk-message-meta strong {
  font-size: 10px;
}

.sdk-message-meta > span:not(.status) {
  color: var(--text-3);
  font-size: 9px;
}

.sdk-message.user .sdk-message-meta > span,
.sdk-message.user .sdk-message-meta strong {
  color: rgb(255 255 255 / 78%);
}

.sdk-message p {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
}

.sdk-context-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.sdk-context-tags span {
  padding: 4px 7px;
  color: var(--text-2);
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 9px;
}

.sdk-start-card {
  margin: 8px 36px 18px;
  padding: 14px;
  background: linear-gradient(145deg, rgb(119 71 204 / 7%), rgb(175 18 29 / 4%));
  border: 1px solid rgb(119 71 204 / 18%);
  border-radius: 8px;
}

.sdk-start-card > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sdk-start-card > div:first-child > strong {
  font-size: 12px;
}

.sdk-rag-mark {
  padding: 3px 6px;
  color: #fff;
  background: var(--purple);
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .5px;
}

.sdk-start-card > p {
  margin: 8px 0 10px;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.65;
}

.sdk-start-card dl {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
}

.sdk-start-card dl div {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
  font-size: 9px;
}

.sdk-start-card dt {
  color: var(--text-3);
}

.sdk-start-card dd {
  margin: 0;
  color: var(--text-2);
}

.sdk-start-btn {
  width: 100%;
}

.sdk-start-card.running {
  margin-right: 0;
  margin-left: 36px;
  background: var(--card);
  border-color: var(--border);
}

.sdk-elapsed {
  margin-left: auto;
  color: var(--purple);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.sdk-rag-trace {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.sdk-rag-trace > div {
  position: relative;
  display: grid;
  align-items: center;
  grid-template-columns: 18px 1fr auto;
  gap: 7px;
  min-height: 39px;
}

.sdk-rag-trace > div:not(:last-child)::after {
  position: absolute;
  top: 26px;
  bottom: -7px;
  left: 6px;
  width: 1px;
  background: var(--border);
  content: "";
}

.sdk-rag-trace i {
  z-index: 1;
  width: 13px;
  height: 13px;
  background: var(--head);
  border: 2px solid var(--border);
  border-radius: 50%;
}

.sdk-rag-trace .active i {
  border-color: var(--purple);
  border-top-color: transparent;
  animation: spin .7s linear infinite;
}

.sdk-rag-trace .done i {
  position: relative;
  background: var(--green);
  border-color: var(--green);
}

.sdk-rag-trace .done i::after {
  position: absolute;
  top: -3px;
  left: 1px;
  color: #fff;
  font-size: 9px;
  content: "✓";
}

.sdk-rag-trace span {
  display: grid;
}

.sdk-rag-trace strong {
  color: var(--text-2);
  font-size: 10px;
}

.sdk-rag-trace small,
.sdk-rag-trace b {
  color: var(--text-3);
  font-size: 8px;
  font-weight: 400;
}

.sdk-rag-trace .active b {
  color: var(--purple);
}

.rag-answer .sdk-bubble {
  width: calc(100% - 36px);
  max-width: none;
}

.sdk-answer-head {
  display: grid;
  align-items: center;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  margin: 4px 0 12px;
  padding: 11px;
  background: var(--purple-soft);
  border: 1px solid rgb(119 71 204 / 14%);
  border-radius: 6px;
}

.sdk-answer-head > span {
  display: grid;
  place-items: center;
  align-self: stretch;
  border-right: 1px solid rgb(119 71 204 / 16%);
}

.sdk-answer-head > span b {
  color: var(--purple);
  font-size: 20px;
}

.sdk-answer-head > span small {
  color: var(--text-3);
  font-size: 8px;
}

.sdk-answer-head > div strong {
  font-size: 11px;
}

.sdk-answer-head > div p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 9px;
}

.sdk-answer-section {
  margin-top: 12px;
}

.sdk-answer-section h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  font-size: 11px;
}

.sdk-answer-section h4 span {
  color: var(--brand);
  font-size: 9px;
}

.sdk-answer-section ul,
.sdk-answer-section ol {
  margin: 0;
  padding-left: 22px;
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.75;
}

.sdk-answer-section code,
.sdk-message pre {
  color: var(--brand);
  font-size: 9px;
}

.sdk-message pre {
  padding: 8px 10px;
  overflow-x: auto;
  color: var(--text-1);
  background: #111827;
  border-radius: 5px;
  line-height: 1.6;
}

.sdk-risk {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 9px;
  color: #8a4b00;
  background: var(--orange-soft);
  border-radius: 5px;
  font-size: 9px;
  line-height: 1.55;
}

.sdk-risk > b {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #fff;
  background: var(--orange);
  border-radius: 50%;
}

.sdk-risk span {
  display: grid;
}

.sdk-citations {
  display: grid;
  gap: 6px;
  margin-top: 13px;
}

.sdk-citations > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.sdk-citations > div:first-child strong {
  font-size: 10px;
}

.sdk-citations > div:first-child small {
  color: var(--text-3);
  font-size: 8px;
}

.sdk-citations > button {
  display: grid;
  align-items: center;
  grid-template-columns: 22px 1fr 10px;
  gap: 8px;
  width: 100%;
  min-height: 39px;
  padding: 6px 8px;
  text-align: left;
  background: var(--head);
  border: 1px solid transparent;
  border-radius: 4px;
}

.sdk-citations > button:hover {
  background: var(--brand-soft);
  border-color: rgb(175 18 29 / 14%);
}

.sdk-citations > button > i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 4px;
  font-size: 9px;
  font-style: normal;
}

.sdk-citations > button > span {
  display: grid;
  font-size: 9px;
  font-weight: 600;
}

.sdk-citations > button small {
  color: var(--text-3);
  font-size: 8px;
  font-weight: 400;
}

.sdk-answer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.sdk-answer-actions button {
  min-height: 26px;
  padding: 0 8px;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 9px;
}

.sdk-answer-actions button:hover,
.sdk-answer-actions button.active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: rgb(175 18 29 / 20%);
}

.sdk-answer-actions span {
  margin-left: auto;
  color: var(--text-3);
  font-size: 8px;
}

.sdk-answer-foot {
  margin-top: 9px !important;
  color: var(--text-3);
  font-size: 8px !important;
}

.sdk-inline-cite {
  margin-top: 8px;
  padding-top: 7px;
  color: var(--purple);
  border-top: 1px solid var(--border);
  font-size: 8px;
}

.sdk-typing .sdk-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 170px;
}

.sdk-typing .sdk-bubble > i {
  width: 5px;
  height: 5px;
  background: var(--purple);
  border-radius: 50%;
  animation: sdk-dot 1s ease infinite;
}

.sdk-typing .sdk-bubble > i:nth-child(2) { animation-delay: .14s; }
.sdk-typing .sdk-bubble > i:nth-child(3) { animation-delay: .28s; }

.sdk-typing .sdk-bubble > span {
  margin-left: 4px;
  color: var(--text-3);
  font-size: 9px;
}

@keyframes sdk-dot {
  0%, 65%, 100% { opacity: .3; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

.sdk-composer {
  flex: 0 0 auto;
  padding: 9px 12px 10px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.sdk-suggestions {
  display: flex;
  gap: 6px;
  margin-bottom: 7px;
  overflow-x: auto;
}

.sdk-suggestions button {
  flex: 0 0 auto;
  height: 24px;
  padding: 0 8px;
  color: var(--purple);
  background: var(--purple-soft);
  border: 1px solid rgb(119 71 204 / 14%);
  border-radius: 12px;
  font-size: 8px;
}

.sdk-suggestions button:disabled {
  opacity: .45;
}

.sdk-input-row {
  display: grid;
  align-items: end;
  grid-template-columns: 1fr 32px;
  gap: 7px;
}

.sdk-input-row textarea {
  min-height: 36px;
  max-height: 90px;
  padding: 8px 10px;
  resize: none;
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 10px;
}

.sdk-input-row textarea:focus {
  background: var(--card);
  border-color: var(--brand);
  outline: 0;
  box-shadow: 0 0 0 2px rgb(175 18 29 / 8%);
}

.sdk-send {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 5px;
}

.sdk-send:disabled {
  cursor: not-allowed;
  background: var(--border-strong);
}

.sdk-composer > small {
  display: block;
  margin-top: 6px;
  color: var(--text-3);
  font-size: 8px;
  text-align: center;
}

.sdk-source-panel {
  position: absolute;
  top: 60px;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: min(380px, 82%);
  overflow: hidden;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgb(29 33 41 / 14%);
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: opacity .18s ease, transform .18s ease;
}

.sdk-source-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.sdk-source-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 98px;
  padding: 14px;
  background: var(--head);
  border-bottom: 1px solid var(--border);
}

.sdk-source-panel header h3 {
  margin: 7px 0 3px;
  font-size: 14px;
}

.sdk-source-panel header p {
  margin: 0;
  color: var(--text-3);
  font-size: 9px;
}

.sdk-source-panel header button {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 18px;
}

.sdk-source-panel header button:hover {
  background: var(--hover);
}

.sdk-source-body {
  padding: 15px;
}

.sdk-source-score {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  color: var(--purple);
  background: var(--purple-soft);
  border-radius: 5px;
  font-size: 9px;
}

.sdk-source-body h4 {
  margin: 17px 0 7px;
  font-size: 11px;
}

.sdk-source-body blockquote {
  margin: 0;
  padding: 10px 11px;
  color: var(--text-2);
  background: var(--head);
  border-left: 3px solid var(--brand);
  font-size: 10px;
  line-height: 1.7;
}

.sdk-source-body > p {
  color: var(--text-2);
  font-size: 10px;
  line-height: 1.7;
}

.sdk-source-links {
  display: flex;
  gap: 7px;
  margin-top: 18px;
}

.sdk-source-links button {
  flex: 1;
  height: 30px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid rgb(175 18 29 / 16%);
  border-radius: 4px;
  font-size: 9px;
}

.command {
  align-self: flex-start;
  width: min(620px, calc(100vw - 48px));
  margin-top: 10vh;
  overflow: hidden;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgb(0 0 0 / 30%);
}

.command-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}

.command-search input {
  flex: 1;
  height: 40px;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 14px;
}

.command-content {
  padding: 10px;
}

.command-content > label {
  display: block;
  padding: 5px 8px;
  color: var(--text-3);
  font-size: 10px;
}

.command-item,
.notice-item,
.user-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  color: var(--text-1);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  text-align: left;
}

.command-item:hover,
.notice-item:hover,
.user-option:hover {
  background: var(--hover);
}

.command-item > i,
.notice-item > i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--purple);
  background: var(--purple-soft);
  border-radius: 8px;
  font-style: normal;
}

.command-item > span,
.notice-item > span {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.command-item small,
.notice-item small {
  color: var(--text-3);
  font-size: 9px;
}

.user-menu {
  position: fixed;
  top: 54px;
  right: 18px;
  z-index: 500;
  width: 230px;
  padding: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.user-card {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.user-card strong,
.user-card small {
  display: block;
}

.user-card small {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 9px;
}

.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  color: var(--text-1);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: var(--shadow);
  font-size: 12px;
  transform: translateX(-50%);
  animation: toast-in .18s ease;
}

.toast i {
  color: var(--green);
  font-style: normal;
}

.toast.warning i {
  color: var(--orange);
}

.toast.info i {
  color: var(--blue);
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.empty {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
  color: var(--text-3);
  text-align: center;
}

.empty > i {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 9px;
  color: var(--text-3);
  background: var(--head);
  border-radius: 50%;
  font-size: 24px;
  font-style: normal;
}

.empty strong {
  color: var(--text-2);
}

.empty p {
  margin: 4px 0 12px;
  font-size: 10px;
}

.loading-state {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  min-height: 290px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--purple-soft);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.danger-text { color: var(--red) !important; }
.warning-text { color: var(--orange) !important; }
.success-text { color: var(--green) !important; }
.primary-text { color: var(--brand) !important; }
.muted { color: var(--text-3) !important; }
.hidden { display: none !important; }

@media (max-width: 1399px) {
  .app-content { padding-right: 16px; padding-left: 16px; }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metrics .metric-card:last-child { grid-column: span 2; }
  .sample-grid, .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-search { width: 210px; }
  .review-layout { grid-template-columns: 220px minmax(360px, 1fr) 290px; }
}

.reference-result {
  transition: border-color .18s ease, box-shadow .18s ease;
}

.reference-result.selected {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px var(--purple-soft);
}

.reference-result-head,
.reference-result-head label {
  display: flex;
  align-items: center;
}

.reference-result-head {
  justify-content: space-between;
  gap: 8px;
}

.reference-result-head label {
  gap: 5px;
  color: var(--text-2);
  font-size: 10px;
}

.reference-selection {
  padding: 9px 10px;
  color: var(--purple);
  background: var(--purple-soft);
  border-radius: var(--radius);
  font-size: 10px;
}

.reference-list {
  display: grid;
  gap: 8px;
}

.reference-list-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  color: var(--text-1);
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.reference-list-item:hover {
  border-color: var(--purple);
}

.reference-list-item > i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--purple);
  background: var(--purple-soft);
  border-radius: 8px;
  font-style: normal;
}

.reference-list-item span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.reference-list-item small,
.reference-list-item b {
  color: var(--text-3);
  font-size: 9px;
}

.draft-review-list {
  display: grid;
  gap: 8px;
}

.draft-review-item {
  display: grid;
  grid-template-columns: 20px minmax(130px, .65fr) 24px minmax(260px, 1.35fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.draft-review-item > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.draft-review-item > i {
  color: var(--purple);
  font-style: normal;
  text-align: center;
}

.draft-review-item strong,
.draft-review-item b {
  font-size: 11px;
}

.draft-review-item small {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 9px;
  line-height: 1.45;
}

.sdk-context-tags button {
  padding: 4px 7px;
  color: inherit;
  background: transparent;
  border: 1px solid currentcolor;
  border-radius: 12px;
  font-size: inherit;
}

.file-preview {
  min-height: 380px;
  overflow: hidden;
  background: #111827;
  border: 1px solid #27344a;
  border-radius: var(--radius);
}

.file-preview header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  color: #dbeafe;
  background: #1f2937;
}

.file-preview pre,
.schema-preview {
  overflow: auto;
  margin: 0;
  padding: 16px;
  color: #c7f9cc;
  background: #111827;
  font: 11px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.file-preview small {
  display: block;
  padding: 10px 12px;
  color: #94a3b8;
}

.descriptions.single {
  grid-template-columns: 1fr;
}

/* V1.0 角色工作台：执行角色以 CASE 内容和处理回复为中心。 */
.role-execution .env-tag {
  color: var(--text-2);
  background: var(--head);
  border-color: var(--border);
}

.role-execution .app-sider nav {
  padding-top: 16px;
}

.role-execution .nav-group {
  margin-bottom: 12px;
}

.role-execution .nav-group-title {
  height: 28px;
  padding-left: 12px;
  color: var(--text-3);
  font-size: 11px;
}

.role-execution .nav-group-title .arrow {
  display: none;
}

.role-execution .nav-item {
  height: 42px;
  margin: 1px 0;
  padding-left: 15px;
  font-size: 14px;
}

.role-execution .sider-footer .ai-health small {
  display: none;
}

.focus-summary {
  display: grid;
  grid-template-columns: minmax(280px, 1.6fr) repeat(4, minmax(120px, .7fr));
  min-height: 88px;
  margin-bottom: 16px;
  padding: 0 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.focus-summary > div,
.focus-summary > button {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
}

.focus-summary > div {
  padding-right: 22px;
}

.focus-summary > div strong {
  margin: 3px 0;
  font-size: 17px;
}

.focus-summary small,
.focus-summary span {
  color: var(--text-3);
  font-size: 11px;
}

.focus-summary > button {
  align-items: center;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border);
}

.focus-summary > button:hover {
  background: var(--hover);
}

.focus-summary > button strong {
  margin-bottom: 4px;
  color: var(--text-1);
  font-size: 21px;
  font-weight: 650;
}

.focus-panel {
  padding-bottom: 0;
  border: 1px solid var(--border);
  box-shadow: none;
}

.focus-tabs .tab-spacer {
  flex: 1;
}

.focus-task-list {
  display: grid;
}

.focus-task-item {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 92px 110px 92px;
  align-items: center;
  gap: 18px;
  min-height: 66px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
}

.focus-task-item:hover {
  background: var(--hover);
}

.focus-task-main {
  min-width: 0;
}

.focus-task-main .title-link {
  max-width: none;
  margin-bottom: 5px;
  color: var(--text-1);
  font-size: 13px;
  font-weight: 600;
}

.focus-task-main > span {
  display: block;
  overflow: hidden;
  color: var(--text-3);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-deadline,
.sla-text {
  color: var(--text-3);
  font-size: 11px;
}

.sla-text.urgent {
  color: var(--red);
  font-weight: 600;
}

.cell-main,
.cell-sub {
  display: block;
}

.cell-main {
  font-size: 11px;
  font-weight: 500;
}

.cell-sub {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 10px;
}

.case-scope-tabs {
  margin-bottom: 16px;
  padding: 0 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.page-heading.compact {
  align-items: center;
  margin-bottom: 10px;
}

.focus-case-hero {
  align-items: center;
  padding: 18px 22px;
  border: 1px solid var(--border);
  box-shadow: none;
}

.focus-case-hero h1 {
  margin: 9px 0 8px;
  font-size: 21px;
  font-weight: 650;
}

.focus-case-hero .case-meta {
  flex-wrap: wrap;
  gap: 6px 18px;
}

.case-problem-panel,
.conversation-panel,
.reply-composer {
  border: 1px solid var(--border);
  box-shadow: none;
}

.case-problem-head,
.reply-head,
.reply-actions,
.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.case-problem-head small,
.reply-head span {
  color: var(--text-3);
  font-size: 11px;
}

.case-problem-head h2 {
  margin: 4px 0 0;
  font-size: 16px;
}

.fault-description {
  max-width: 1180px;
  margin: 18px 0;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.85;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0;
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.fact-strip > span {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  min-height: 58px;
  padding: 11px 14px;
  border-right: 1px solid var(--border);
}

.fact-strip > span:last-child {
  border-right: 0;
}

.fact-strip small {
  color: var(--text-3);
  font-size: 10px;
}

.fact-strip strong {
  font-size: 12px;
  font-weight: 600;
}

.attachment-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--text-2);
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.attachment-chip:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.attachment-chip small {
  color: var(--text-3);
  font-size: 10px;
}

.case-conversation {
  max-width: 1080px;
}

.conversation-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.conversation-item:last-child {
  border-bottom: 0;
}

.conversation-item.latest {
  margin: 0 -10px;
  padding: 16px 10px;
  background: #fafafa;
  border-radius: var(--radius);
}

.conversation-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text-2);
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 12px;
}

.conversation-item header,
.conversation-item footer {
  display: flex;
  align-items: center;
  gap: 9px;
}

.conversation-item header strong {
  font-size: 12px;
}

.conversation-item header span,
.conversation-item header time {
  color: var(--text-3);
  font-size: 10px;
}

.conversation-item header time {
  margin-left: auto;
}

.conversation-item p {
  margin: 7px 0 8px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.75;
}

.conversation-item footer button {
  padding: 0;
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: 10px;
}

.conversation-item.system {
  opacity: .78;
}

.reply-composer {
  position: sticky;
  bottom: 0;
  z-index: 6;
  box-shadow: 0 -5px 16px rgb(29 33 41 / 5%);
}

.reply-head {
  justify-content: flex-start;
  margin-bottom: 9px;
}

.reply-composer textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 12px;
  line-height: 1.65;
  resize: vertical;
}

.reply-actions {
  margin-top: 10px;
}

.reply-actions > div {
  display: flex;
  gap: 8px;
}

.case-secondary {
  margin: 4px 0 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.case-secondary details {
  border-bottom: 1px solid var(--border);
}

.case-secondary details:last-child {
  border-bottom: 0;
}

.case-secondary summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
}

.case-secondary summary::after {
  margin-left: auto;
  color: var(--text-3);
  content: "⌄";
}

.case-secondary details[open] summary::after {
  transform: rotate(180deg);
}

.case-secondary summary span {
  font-size: 12px;
  font-weight: 600;
}

.case-secondary summary small {
  color: var(--text-3);
  font-size: 10px;
}

.details-body {
  padding: 0 18px 18px;
}

.compact-flow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 0;
}

.compact-flow span {
  padding: 6px 10px;
  color: var(--text-3);
  background: var(--head);
  border-radius: var(--radius);
  font-size: 11px;
}

.compact-flow span.done {
  color: var(--green);
}

.compact-flow span.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.compact-flow i {
  color: var(--border-strong);
  font-style: normal;
}

.management-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.management-summary > div {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--head);
  border-radius: var(--radius);
}

.management-summary small,
.management-summary span {
  color: var(--text-3);
  font-size: 10px;
}

.management-summary strong {
  font-size: 18px;
}

.confirm-reply small,
.confirm-reply strong {
  display: block;
}

.confirm-reply small {
  color: var(--text-3);
  font-size: 10px;
}

.confirm-reply strong {
  margin: 4px 0 12px;
}

.confirm-reply p {
  margin: 0;
  padding: 12px;
  background: var(--head);
  line-height: 1.7;
}

.role-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.role-switch-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 14px;
  color: var(--text-1);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.role-switch-card:hover,
.role-switch-card.active {
  border-color: var(--brand);
}

.role-switch-card.active {
  background: var(--brand-soft);
}

.role-switch-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--text-2);
  background: var(--head);
  border-radius: 50%;
  font-weight: 600;
}

.role-switch-card > span:nth-child(2) {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.role-switch-card small,
.role-switch-card em {
  color: var(--text-3);
  font-size: 10px;
  font-style: normal;
}

.role-switch-card > b {
  color: var(--brand);
  font-size: 10px;
}

@media (max-width: 1320px) {
  .focus-summary {
    grid-template-columns: minmax(240px, 1.3fr) repeat(4, minmax(100px, .7fr));
  }

  .focus-task-item {
    grid-template-columns: minmax(360px, 1fr) 86px 100px 86px;
    gap: 10px;
  }
}

.role-view-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  margin-bottom: 12px;
  padding: 0 12px;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.role-view-banner > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.role-view-dot {
  width: 7px;
  height: 7px;
  background: var(--brand);
  border-radius: 50%;
}

.role-view-banner strong {
  font-size: 12px;
  white-space: nowrap;
}

.role-view-banner small {
  overflow: hidden;
  color: var(--text-3);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-view-banner button {
  padding: 3px 6px;
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: 11px;
  white-space: nowrap;
}

.compact-search-hero {
  padding: 18px 22px;
}

.quick-keywords {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--text-3);
  font-size: 10px;
}

.quick-keywords button {
  padding: 3px 8px;
  color: var(--text-2);
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 10px;
}

.knowledge-focus-list {
  display: grid;
}

.knowledge-focus-list article {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 68px;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}

.knowledge-focus-list article:hover {
  background: var(--hover);
}

.knowledge-type {
  display: inline-flex;
  justify-content: center;
  padding: 5px 8px;
  color: var(--text-2);
  background: var(--head);
  border-radius: var(--radius);
  font-size: 10px;
}

.knowledge-focus-list h3 {
  margin: 0 0 5px;
}

.knowledge-focus-list h3 button {
  padding: 0;
  color: var(--text-1);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 600;
}

.knowledge-focus-list h3 button:hover {
  color: var(--brand);
}

.knowledge-focus-list p,
.knowledge-focus-list small {
  margin: 0;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.6;
}

.file-scope-list label {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
}

.file-scope-list small {
  grid-column: 2;
  color: var(--text-3);
}

.file-scope-list .disabled {
  opacity: .55;
}

.close-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
}

.close-workspace > aside {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

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

.close-check-grid > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.close-check-grid > div > i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 50%;
  font-style: normal;
}

.close-check-grid > div.error {
  border-color: rgb(224 82 82 / 45%);
}

.close-check-grid > div.error > i {
  color: var(--red);
  background: var(--red-soft);
}

.close-check-grid span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.close-check-grid small {
  color: var(--text-3);
  font-size: 9px;
}

.close-check-grid strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.close-form textarea {
  min-height: 96px;
}

.close-score-panel .score-ring {
  margin: 8px auto 14px;
}

.empty-score {
  display: grid;
  justify-items: center;
  min-height: 260px;
  align-content: center;
  text-align: center;
}

.empty-score p {
  max-width: 240px;
  color: var(--text-3);
  font-size: 10px;
  line-height: 1.6;
}

.page-actions.vertical {
  display: grid;
  margin-top: 12px;
}

.page-actions.vertical .btn {
  width: 100%;
}

.sample-card.compact {
  min-height: 0;
}

.sample-card.compact footer {
  justify-content: flex-end;
  gap: 6px;
}

.connection-steps {
  display: grid;
  gap: 8px;
}

.connection-steps > div {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.connection-steps > div > i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 50%;
  font-style: normal;
}

.connection-steps span {
  display: flex;
  flex-direction: column;
}

.connection-steps small {
  color: var(--text-3);
  font-size: 9px;
}

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

.rank-formula > div {
  display: flex;
  min-height: 110px;
  padding: 12px;
  flex-direction: column;
  justify-content: center;
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rank-formula strong {
  color: var(--purple);
  font-size: 24px;
}

.rank-formula span {
  margin-top: 4px;
  font-weight: 600;
}

.rank-formula small {
  margin-top: 5px;
  color: var(--text-3);
  font-size: 9px;
  line-height: 1.5;
}

.selected-case-list {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.selected-case-list label {
  display: grid;
  grid-template-columns: 20px 150px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 10px;
}

.selected-case-list label > span {
  color: var(--text-3);
}

.selected-case-list button {
  color: var(--purple);
  background: transparent;
  border: 0;
}

.mail-preview {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #1d2129;
}

.mail-preview header {
  padding: 12px 16px;
  background: #f7f8fa;
  border-bottom: 1px solid #e5e6eb;
}

.mail-preview header > div {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  margin: 4px 0;
  font-size: 10px;
}

.mail-preview header span {
  color: #86909c;
}

.mail-preview article {
  padding: 20px 28px;
  font-size: 11px;
  line-height: 1.8;
}

.mail-preview a {
  color: #165dff;
}

.candidate-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px;
  background: var(--head);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.candidate-head .score-ring {
  flex: 0 0 auto;
}

.candidate-head h2 {
  margin: 4px 0;
  font-size: 16px;
}

.candidate-head p {
  margin: 0;
  color: var(--text-3);
  font-size: 10px;
}

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

.role-scene-tabs {
  overflow-x: auto;
  margin-bottom: 12px;
}

.role-scene-tabs button {
  white-space: nowrap;
}

.field-assist-panel {
  padding: 12px;
  background: var(--purple-soft);
  border: 1px solid rgb(114 46 209 / 22%);
  border-radius: var(--radius);
}

.field-assist-panel article {
  margin-bottom: 8px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.field-assist-panel article p {
  margin: 5px 0;
  font-size: 10px;
  line-height: 1.6;
}

.field-assist-panel article small {
  color: var(--text-3);
  font-size: 9px;
}

@media (max-width: 1180px) {
  .close-workspace {
    grid-template-columns: 1fr;
  }

  .close-workspace > aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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