/* bot 1.0.14: each menu item shows only its own page. */
[data-testid="bot-management-page"] {
  max-width: 96rem;
  gap: 0.75rem;
}

[data-testid="bot-management-page"] > section:first-child > div:first-child {
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

[data-testid="bot-management-page"] > section:first-child > div:first-child > div:first-child > div:first-child {
  display: none;
}

[data-testid="bot-management-page"] > section:first-child h2 {
  margin-top: 0;
  font-size: 1.05rem;
  line-height: 1.5rem;
}

[data-testid="bot-management-page"] > section:first-child h2 + p {
  margin-top: 0.2rem;
}

[data-testid="bot-workflow-steps"] {
  display: none;
}

[data-testid="bot-management-layout"] {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0.75rem;
}

[data-testid="bot-list-panel"] {
  display: none !important;
}

[data-testid="bot-management-layout"] > main {
  gap: 0.75rem;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child {
  position: sticky;
  z-index: 20;
  top: 4.65rem;
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) 2.75rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--sp-bg-card) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child > label:first-child {
  display: block !important;
  width: auto;
  min-width: 0;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child > label:first-child > span {
  display: none;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child > label:first-child select {
  height: 2.45rem;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child > div:nth-child(2) {
  width: 2.75rem;
  height: 2.75rem;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child h2 {
  font-size: 0.95rem;
}


/* Compact left menu with distinct group labels and indented items. */
[data-testid="bot-workspace-shell"].bot-side-layout {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.bot-side-stage {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  border: 1px solid var(--sp-border);
  border-radius: 0.9rem;
  background: var(--sp-bg-card, #fff);
  overflow: hidden;
}

.bot-side-layout.is-official-view .bot-side-stage > .min-w-0 {
  display: none !important;
}

.bot-side-layout.is-official-view .bot-side-stage > .bot-official-panel {
  display: block;
}

[data-testid="bot-workspace-shell"]:has(.bot-hierarchical-menu) > [data-testid="bot-workspace-nav"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none !important;
}

[data-testid="bot-workspace-shell"] > .min-w-0 {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.bot-box-layout.is-official-view .min-w-0 {
  display: none !important;
}

.bot-hierarchical-menu {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 5.4rem;
  max-height: calc(100vh - 6.4rem);
  overflow: auto;
  padding: 0.15rem 0.15rem 1rem 0;
  border: 0;
  background: transparent;
}

button.bot-menu-label {
  width: 100%;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

button.bot-menu-label.is-active {
  background: #f4f4f5;
}

.bot-side-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.bot-menu-group {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.bot-menu-label {
  padding: 0.25rem 0.625rem;
  color: #18181b;
  font-size: 0.875rem;
  line-height: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bot-submenu-item {
  width: 100%;
  padding: 0.3125rem 0.625rem 0.3125rem 1.375rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #52525b;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.125rem;
  text-align: left;
}

.bot-submenu-item:hover {
  background: #f4f4f5;
  color: #18181b;
}

.bot-submenu-item.is-active {
  background: #f4f4f5;
  color: #18181b;
  font-weight: 600;
}

.bot-menu-official {
  margin-top: 0;
  padding-top: 0.25rem;
}

.bot-menu-official > .bot-submenu-item {
  padding-left: 0.625rem;
}

.bot-menu-foot {
  padding: 0.5rem 0.625rem 0;
  color: #71717a;
  font-size: 0.6875rem;
  line-height: 1.45;
}

.bot-menu-foot p + p,
.bot-meter {
  margin-top: 0.3rem;
}

.bot-official-panel {
  display: none;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 1.25rem 1.35rem 1.5rem;
}

.bot-hierarchical-menu.is-official ~ .bot-official-panel {
  display: block;
}

.bot-official-head h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #18181b;
}

.bot-official-head p,
.bot-official-note {
  margin-top: 0.4rem;
  color: #71717a;
  font-size: 0.84rem;
  line-height: 1.5;
}

.bot-official-panel section {
  margin-top: 1.1rem;
}

.bot-official-panel h4 {
  margin-bottom: 0.5rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: #3f3f46;
}

.bot-official-table {
  display: grid;
  gap: 0.45rem;
}

.bot-official-table div {
  display: grid;
  grid-template-columns: 8rem minmax(9rem, 0.7fr) minmax(0, 1.4fr);
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--sp-border);
  border-radius: 0.6rem;
  background: #fff;
}

.bot-official-table strong {
  font-size: 0.84rem;
  font-weight: 600;
  color: #18181b;
}

.bot-official-table span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: #52525b;
}

.bot-official-table em {
  font-style: normal;
  font-size: 0.8rem;
  color: #3f3f46;
}

.bot-official-panel ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bot-official-panel li {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--sp-border);
  border-radius: 999px;
  color: #3f3f46;
  font-size: 0.8rem;
  background: #fff;
}

.dark .bot-hierarchical-menu {
  background: transparent;
}

.dark .bot-menu-label {
  color: #fafafa;
}

.dark .bot-menu-foot,
.dark .bot-official-head p,
.dark .bot-official-note,
.dark .bot-official-table span {
  color: #a1a1aa;
}

.dark .bot-submenu-item {
  color: #d4d4d8;
}

.dark .bot-submenu-item:hover {
  background: #27272a;
  color: #fafafa;
}

.dark .bot-submenu-item.is-active {
  background: #3f3f46;
  color: #fafafa;
}

.dark .bot-official-head h3,
.dark .bot-official-table strong,
.dark .bot-official-panel h4 {
  color: #fafafa;
}

.dark .bot-official-table div,
.dark .bot-official-panel li {
  background: #18181b;
  color: #e4e4e7;
}

.dark .bot-official-table em {
  color: #d4d4d8;
}

@media (max-width: 960px) {
  [data-testid="bot-workspace-shell"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .bot-hierarchical-menu {
    grid-column: 1;
    grid-row: auto;
    gap: 0.5rem;
  }

  .bot-menu-official {
    margin-top: 0;
  }

  [data-testid="bot-workspace-shell"] > .min-w-0,
  .bot-official-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .bot-official-table div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

[data-testid="bot-workspace-shell"] .min-w-0 > div.bot-subnav-row,
[data-testid="bot-workspace-shell"] .min-w-0 > div:first-child {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem 0.55rem;
}

[data-testid="bot-workspace-shell"] .min-w-0 > div:first-child > div:first-child {
  margin-right: 0 !important;
  width: 100%;
}

[data-testid="bot-workspace-shell"] .min-w-0 > div:first-child > div.shrink-0,
[data-testid="bot-workspace-shell"] .min-w-0 > div:first-child > [data-bot-subnav] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

[data-testid="bot-workspace-content"] {
  padding: 0.35rem 1.1rem 1.2rem;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child > div.min-w-0 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem 0.75rem;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child > div.min-w-0 > div:first-child {
  margin-right: auto;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child > div.min-w-0 > div:nth-child(2) {
  flex: 1 1 100%;
  width: auto;
  height: auto;
}

[data-bot-token] {
  display: flex;
  flex: 1 1 16rem;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: min(100%, 16rem);
  max-width: 100%;
}

[data-bot-token] code {
  flex: 1 1 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.38rem 0.6rem;
  border: 1px solid var(--sp-border);
  border-radius: 0.45rem;
  background: #fafafa;
  color: #18181b;
  font-size: 0.72rem;
}

.dark [data-bot-token] code {
  background: #18181b;
  color: #fafafa;
}

@media (max-width: 767px) {
  [data-testid="bot-workspace-content"] {
    padding: 0.8rem;
  }

  [data-bot-token] {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  [data-bot-token] code {
    flex: 1;
    max-width: none;
  }
}

@media (max-width: 767px) {
  [data-testid="bot-management-page"] > section:first-child > div:first-child {
    align-items: stretch;
    padding: 0.9rem;
  }

  [data-testid="bot-management-page"] > section:first-child h2 + p {
    display: none;
  }

  [data-testid="bot-management-layout"] > main > .ui-card:first-child {
    position: static;
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.8rem;
  }

  [data-testid="bot-management-layout"] > main > .ui-card:first-child > label:first-child {
    grid-column: 1 / -1;
  }

  [data-testid="bot-management-layout"] > main > .ui-card:first-child > div:nth-child(2) {
    width: 2.5rem;
    height: 2.5rem;
  }

  [data-testid="bot-management-layout"] > main > .ui-card:first-child > div:last-child {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  [data-testid="bot-workspace-content"] {
    padding: 0.8rem;
  }
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child span.inline-flex.items-center.gap-1:has(> svg) {
  display: none !important;
}

[data-testid="bot-profile-workspace"] .space-y-4 > section:first-child > select,
[data-testid="bot-profile-workspace"] .space-y-4 > section:first-child > button,
[data-testid="bot-profile-workspace"] .space-y-4 > section:first-child > p {
  display: none !important;
}

[data-testid="bot-profile-workspace"] .space-y-4 > section:first-child > div:first-child > span {
  font-size: 0 !important;
}

[data-testid="bot-profile-workspace"] .space-y-4 > section:first-child > div:first-child > span::after {
  content: "创建人";
  font-size: 0.75rem;
  line-height: 1rem;
}

html[lang^="en"] [data-testid="bot-profile-workspace"] .space-y-4 > section:first-child > div:first-child > span::after {
  content: "Creator";
}

[data-bot-creator] {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 2.4rem;
  color: #18181b;
  font-size: 0.875rem;
  line-height: 1.35;
}

[data-bot-creator][data-state="loading"],
[data-bot-creator][data-state="empty"] {
  color: #71717a;
  font-size: 0.75rem;
}

[data-bot-creator] strong {
  font-weight: 600;
}

[data-bot-creator] span,
[data-bot-creator] small {
  color: #71717a;
  font-size: 0.72rem;
}

.dark [data-bot-creator] {
  color: #fafafa;
}

.dark [data-bot-creator][data-state="loading"],
.dark [data-bot-creator][data-state="empty"],
.dark [data-bot-creator] span,
.dark [data-bot-creator] small {
  color: #a1a1aa;
}

[data-testid="bot-profile-workspace"] .space-y-4 > section:nth-child(2) > input,
[data-testid="bot-profile-workspace"] .space-y-4 > section:nth-child(2) > button,
[data-testid="bot-profile-workspace"] .space-y-4 > section:nth-child(2) > p {
  display: none !important;
}

[data-testid="bot-profile-workspace"] .space-y-4 > section:nth-child(2) > div:first-child > span:first-child {
  font-size: 0 !important;
}

[data-testid="bot-profile-workspace"] .space-y-4 > section:nth-child(2) > div:first-child > span:first-child::after {
  content: "连接";
  font-size: 0.75rem;
  line-height: 1rem;
}

html[lang^="en"] [data-testid="bot-profile-workspace"] .space-y-4 > section:nth-child(2) > div:first-child > span:first-child::after {
  content: "Connection";
}

[data-testid="bot-profile-workspace"] .space-y-4 > section:nth-child(2) > div:first-child > span:last-child {
  display: none !important;
}

[data-bot-proxy-note] p {
  margin: 0.15rem 0 0.55rem;
  color: #52525b;
  font-size: 0.75rem;
  line-height: 1.45;
}

[data-bot-delete] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #fecdd3;
}

[data-bot-delete] p {
  margin: 0;
  color: #9f1239;
  font-size: 0.72rem;
  line-height: 1.45;
}

[data-bot-delete-form] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
}

[data-bot-delete-form][hidden] {
  display: none !important;
}

[data-bot-delete-input] {
  width: 100%;
}

.dark [data-bot-proxy-note] p {
  color: #a1a1aa;
}

.dark [data-bot-delete] {
  border-top-color: rgba(190, 18, 60, 0.45);
}

.dark [data-bot-delete] p {
  color: #fecdd3;
}

/* 2026-09-28e: plain command sheet. Menu text and reply sit on one row. */
[data-bot-page-lead] {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e4e4e7;
  background: #fafafa;
  color: #3f3f46;
  font-size: 0.8125rem;
  line-height: 1.55;
}

[data-bot-command-hint],
[data-bot-command-enhanced] > textarea {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bot-command-sheet {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.bot-command-lead h3 {
  margin: 0;
  color: #18181b;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.bot-command-lead p,
[data-command-status] {
  margin: 0.35rem 0 0;
  color: #52525b;
  font-size: 0.8125rem;
  line-height: 1.55;
}

[data-command-list] {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bot-command-row {
  display: grid;
  grid-template-columns: minmax(8.5rem, 10.5rem) minmax(0, 0.9fr) minmax(0, 1.25fr) auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.8rem;
  border: 1px solid #e4e4e7;
  background: #fff;
}

.bot-command-row label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.bot-command-row label > span {
  color: #71717a;
  font-size: 0.72rem;
  line-height: 1rem;
}

.bot-command-code {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}

.bot-command-code b {
  color: #18181b;
  font-weight: 600;
}

.bot-command-code input,
.bot-command-row textarea {
  width: 100%;
  min-width: 0;
}

.bot-command-row textarea {
  min-height: 2.6rem;
  resize: vertical;
}

.bot-command-row [data-command-remove] {
  margin-top: 1.2rem;
}

.bot-command-sheet > [data-command-add] {
  align-self: flex-start;
}

@media (max-width: 760px) {
  .bot-command-row {
    grid-template-columns: 1fr;
  }

  .bot-command-row [data-command-remove] {
    margin-top: 0;
    justify-self: start;
  }
}

.dark [data-bot-page-lead],
.dark .bot-command-row {
  border-color: #3f3f46;
  background: #18181b;
}

.dark [data-bot-page-lead],
.dark .bot-command-lead p,
.dark [data-command-status],
.dark .bot-command-row label > span {
  color: #d4d4d8;
}

.dark .bot-command-lead h3,
.dark .bot-command-code b {
  color: #fafafa;
}

/* 20260928f: private and group replies are separate pages. */
.bot-menu-foot:empty {
  display: none;
}

[data-reply-editor] > :not([data-bot-page-lead]):not([data-reply-sheet]):not([data-bot-batch-groups="welcome"]):not([data-bot-batch-groups="rules-group"]) {
  display: none !important;
}

[data-reply-place="private"] [data-bot-ai-groups],
[data-reply-place="private"] [data-bot-ai-groups] + p,
[data-reply-place="group"] [data-bot-ai-private],
[data-reply-place="group"] [data-bot-ai-private-toggle] {
  display: none !important;
}

.bot-reply-sheet {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.bot-reply-sheet h3 {
  margin: 0;
  color: #18181b;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

[data-reply-aside],
[data-reply-status],
.bot-reply-note {
  margin: 0;
  color: #52525b;
  font-size: 0.8125rem;
  line-height: 1.55;
}

/* 20260929b: explain how keyword matching works. */
.bot-reply-hint {
  margin: 0;
  color: #52525b;
  font-size: 0.75rem;
  line-height: 1.55;
}

.dark .bot-reply-hint {
  color: #a1a1aa;
}

[data-reply-aside][hidden] {
  display: none !important;
}

.bot-reply-note {
  color: #92400e;
}

/* 20260929a: regex syntax and built-in words, one entry per line. */
.bot-reply-hint {
  margin: 0;
  color: #52525b;
  font-size: 0.75rem;
  line-height: 1.65;
  white-space: pre-line;
}

.bot-reply-hint[hidden] {
  display: none !important;
}

[data-reply-list] {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bot-reply-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.85rem;
  border: 1px solid #e4e4e7;
  background: #fff;
}

.bot-reply-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.bot-reply-card label > span,
.bot-reply-head label span {
  color: #71717a;
  font-size: 0.72rem;
  line-height: 1rem;
}

.bot-reply-card textarea,
.bot-reply-card select {
  width: 100%;
  min-width: 0;
}

.bot-reply-card textarea {
  min-height: 4.2rem;
  resize: vertical;
}

.bot-reply-head,
.bot-reply-modes,
.bot-reply-sheet > [data-reply-add],
.bot-reply-sheet > [data-reply-save] {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bot-reply-head {
  justify-content: space-between;
  padding-bottom: .55rem;
  border-bottom: 1px solid #e4e4e7;
}

.bot-reply-head label,
.bot-reply-case {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.bot-reply-modes {
  align-items: end;
}

.bot-reply-modes label:first-child {
  flex: 1;
  min-width: 0;
}

/* 20260929a: keep "Ignore case" on one line and level with the match select. */
.bot-reply-case {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 2.35rem;
}

.bot-reply-sheet > [data-reply-add],
.bot-reply-sheet > [data-reply-save] {
  align-self: flex-start;
}

@media (max-width: 760px) {
  .bot-reply-modes {
    flex-direction: column;
    align-items: stretch;
  }
}

.dark .bot-reply-card {
  border-color: #3f3f46;
  background: #18181b;
}

.dark .bot-reply-sheet h3 {
  color: #fafafa;
}

.dark [data-reply-aside],
.dark [data-reply-status],
.dark .bot-reply-card label > span,
.dark .bot-reply-head label span {
  color: #d4d4d8;
}

.dark .bot-reply-head {
  border-color: #3f3f46;
}

.dark .bot-reply-note {
  color: #fcd34d;
}

.dark .bot-reply-hint {
  color: #d4d4d8;
}

/* 20260928h: username note only. The field itself is unchanged. */
[data-bot-username-note] {
  display: block;
  margin-top: 0.35rem;
  color: #71717a;
  font-size: 0.75rem;
  line-height: 1.45;
}

.dark [data-bot-username-note] {
  color: #a1a1aa;
}

/* 20260928i: choose a group before group settings. */
.bot-reply-groups {
  margin: 0 0 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--sp-border, #e4e4e7);
  background: #fafafa;
}

.bot-reply-groups h3 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.bot-reply-groups p {
  margin: 0.2rem 0 0.55rem;
  color: #71717a;
  font-size: 0.75rem;
  line-height: 1.45;
}

.bot-reply-group-tools,
.bot-reply-groups label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bot-reply-group-tools {
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

[data-reply-groups-list] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.35rem 0.75rem;
  max-height: 220px;
  overflow: auto;
}

[data-reply-groups-note][hidden] {
  display: none;
}

.bot-reply-sheet[data-locked="1"] [data-reply-list],
.bot-reply-sheet[data-locked="1"] [data-reply-add] {
  opacity: 0.45;
}

[data-engagement-focus] [data-bot-engagement-hint] {
  display: none;
}

[data-engagement-focus] [data-testid="bot-engagement-workspace"] > .ui-note:has([data-bot-engagement-hint]) {
  display: none;
}

.bot-raffle-detail-button {
  align-self: center;
  white-space: nowrap;
}

[data-testid="raffle-list"] .ui-badge {
  width: fit-content;
  flex: 0 0 auto;
}

.bot-raffle-detail-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(32rem, calc(100vw - 2rem));
  max-height: min(80vh, 48rem);
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid var(--sp-border);
  border-radius: 0.75rem;
  color: var(--sp-text, #18181b);
  background: var(--sp-bg-card, #fff);
}

.bot-raffle-detail-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.bot-raffle-detail-dialog h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.bot-raffle-detail-dialog h4 { font-size: .875rem; font-weight: 700; margin: 1rem 0 .5rem; }
.bot-raffle-detail-dialog p { font-size: .8rem; line-height: 1.5; margin: .35rem 0; overflow-wrap: anywhere; }
.bot-raffle-detail-dialog > button { margin-top: 1rem; }

[data-engagement-focus="raffle"] [data-bot-engagement="schedule"],
[data-engagement-focus="schedule"] [data-bot-engagement="raffle"] {
  display: none;
}

[data-bot-retention] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0 0 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--sp-border, #e4e4e7);
  background: #fafafa;
}

[data-bot-retention] label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

[data-bot-retention] input {
  width: 5.5rem;
}

[data-bot-retention] p {
  flex-basis: 100%;
  margin: 0;
  color: #71717a;
  font-size: 0.75rem;
  line-height: 1.45;
}

.dark .bot-reply-groups,
.dark [data-bot-retention] {
  background: #18181b;
}

.dark .bot-reply-groups p,
.dark [data-bot-retention] p {
  color: #a1a1aa;
}

[data-bot-access] {
  margin: 0 0 0.9rem;
  padding: 0.8rem;
  border: 1px solid var(--sp-border, #e4e4e7);
  background: #fafafa;
}

[data-bot-access] h3,
[data-bot-access] p {
  margin: 0;
}

[data-bot-access] h3 {
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}

[data-bot-access] label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0;
  font-size: 0.8rem;
}

[data-bot-access] p {
  margin: 0.1rem 0 0.45rem;
  color: #71717a;
  font-size: 0.75rem;
  line-height: 1.45;
}

[data-access-rights] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin-bottom: 0.45rem;
}

.dark [data-bot-access] {
  background: #18181b;
}

.dark [data-bot-access] p {
  color: #a1a1aa;
}

[data-bot-entry] {
  margin: 0 0 0.9rem;
  padding: 0.8rem;
  border: 1px solid var(--sp-border, #e4e4e7);
  background: #fafafa;
}

[data-bot-entry] h3,
[data-bot-entry] p {
  margin: 0;
}

[data-bot-entry] h3 {
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}

[data-bot-entry] label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0;
  font-size: 0.8rem;
}

[data-bot-entry] p {
  margin: 0.1rem 0 0.45rem;
  color: #71717a;
  font-size: 0.75rem;
  line-height: 1.45;
}

[data-bot-entry] input[type="text"] {
  flex: 1;
  min-width: 0;
}

[data-entry-web][hidden] {
  display: none;
}

.dark [data-bot-entry] {
  background: #18181b;
}

.dark [data-bot-entry] p {
  color: #a1a1aa;
}

.bot-box {
  border: 1px solid var(--sp-border);
  border-radius: 0.9rem;
  background: var(--sp-bg-card, #fff);
  overflow: hidden;
}

.bot-box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem 0.35rem;
}

.bot-box-head-main {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.75rem;
  min-width: 0;
}

.bot-box-fold {
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid var(--sp-border);
  border-radius: 0.45rem;
  background: #fff;
  color: #18181b;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.38rem 0.62rem;
  cursor: pointer;
}

.bot-box.is-collapsed .bot-box-tabs,
.bot-box.is-collapsed .bot-group-pick,
.bot-box.is-collapsed .bot-group-pick-note,
.bot-box.is-collapsed .bot-menu-foot,
.bot-box.is-collapsed .bot-box-body {
  display: none !important;
}

.bot-box-title {
  border: 0;
  background: transparent;
  padding: 0;
  color: #18181b;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}

.bot-box-head p,
.bot-group-pick-note {
  margin: 0;
  color: #71717a;
  font-size: 0.78rem;
  line-height: 1.45;
}

.bot-box-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem 0.95rem 0.85rem;
}

.bot-box-tabs .bot-submenu-item {
  width: auto;
  padding: 0.38rem 0.72rem;
  border: 1px solid transparent;
  background: #f4f4f5;
}

.bot-box-tabs .bot-submenu-item.is-active {
  background: #18181b;
  color: #fff;
}

.bot-box-tabs .bot-submenu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bot-box:not(.is-active) .bot-box-body {
  display: none;
}

.bot-box-body > .min-w-0,
.bot-box-body > .bot-official-panel {
  min-width: 0;
}

.bot-group-pick {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0.95rem 0.35rem;
}

.bot-group-pick span {
  color: #18181b;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.bot-group-pick select {
  min-width: min(18rem, 100%);
  height: 2.2rem;
}

.bot-box[data-box="group"]:not(.is-ready) .bot-group-pick select {
  border-color: #f59e0b;
}

.bot-group-pick-note {
  padding: 0 0.95rem 0.45rem;
}

.bot-menu-foot {
  padding: 0 0.95rem 0.75rem;
}

[data-bot-group-gate] {
  margin: 0.2rem 1.1rem 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px dashed var(--sp-border);
  border-radius: 0.7rem;
  background: #fafafa;
  color: #3f3f46;
  font-size: 0.86rem;
  line-height: 1.5;
}

[data-group-locked] > :not([data-bot-batch-groups="welcome"]):not([data-bot-batch-groups="rules-group"]):not([data-bot-page-lead]):not([data-bot-ai-history]) {
  opacity: 0.48;
  pointer-events: none;
}

.bot-box-layout.is-official-view .bot-box[data-box="official"] .bot-official-panel {
  display: block;
}

.dark .bot-box-title,
.dark .bot-group-pick span {
  color: #fafafa;
}

.dark .bot-box-fold {
  background: #18181b;
  color: #fafafa;
}

.dark .bot-box-tabs .bot-submenu-item {
  background: #27272a;
  color: #e4e4e7;
}

.dark .bot-box-tabs .bot-submenu-item.is-active {
  background: #fafafa;
  color: #18181b;
}

.dark [data-bot-group-gate] {
  background: #18181b;
  color: #e4e4e7;
}

.bot-group-multi {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.15rem 0 0.35rem;
  padding: 0.35rem 0.35rem 0.45rem 0.7rem;
}

.bot-group-multi-title {
  margin: 0;
  color: #18181b;
  font-size: 0.75rem;
  font-weight: 700;
}

.bot-group-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  color: #3f3f46;
  font-size: 0.75rem;
  line-height: 1.2;
}

.bot-group-option:has(input:checked) {
  border-color: #60a5fa;
  background: #f8fbff;
  color: #1e3a8a;
}

.bot-group-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dark button.bot-menu-label.is-active {
  background: #27272a;
}

.dark .bot-group-multi-title {
  color: #fafafa;
}

.dark .bot-group-option {
  color: #e4e4e7;
}

.dark .bot-group-option:has(input:checked) {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, .16);
  color: #dbeafe;
}

.bot-stage-note {
  padding: 0.75rem 1.1rem 0;
  color: #71717a;
  font-size: 0.75rem;
  line-height: 1.45;
}

.dark .bot-stage-note {
  color: #a1a1aa;
}

@media (max-width: 960px) {
  [data-testid="bot-workspace-shell"].bot-side-layout {
    grid-template-columns: 8.75rem minmax(0, 1fr);
    gap: 0.45rem;
  }

  .bot-hierarchical-menu {
    position: static;
    max-height: none;
    padding-right: 0;
  }

  .bot-menu-label {
    padding: 0.2rem 0.3rem;
    font-size: 0.78rem;
    line-height: 1.15rem;
  }

  .bot-submenu-item {
    padding: 0.26rem 0.25rem 0.26rem 0.7rem;
    font-size: 0.7rem;
  }

  .bot-group-multi {
    padding-left: 0.35rem;
  }

  .bot-group-option {
    gap: 0.25rem;
    padding: 0.24rem 0.2rem;
    font-size: 0.68rem;
  }
}

.bot-side-tabs .bot-submenu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 1.0.14: the left menu names the page. The right side keeps only that page. */
[data-testid="bot-workspace-shell"].bot-side-layout > .bot-side-stage > .min-w-0 > div:first-child {
  display: none !important;
}

.bot-side-stage {
  border: 0;
  background: transparent;
  box-shadow: none;
}

[data-testid="bot-workspace-content"] {
  padding: 0 0.15rem 1rem;
}

[data-bot-page-lead] {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #71717a;
  font-size: 0.8rem;
  line-height: 1.45;
}

.bot-stage-note {
  padding: 0 0.15rem 0.55rem;
}

button.bot-menu-label.is-active {
  background: transparent;
}

.bot-submenu-item.is-active {
  background: #eff6ff;
  color: #1d4ed8;
}

[data-reply-sheet] [data-reply-groups],
[data-bot-focus="profile"] [data-bot-aside] {
  display: none !important;
}

.bot-hierarchical-menu.is-official ~ .bot-side-stage > .min-w-0 {
  display: none !important;
}

.bot-hierarchical-menu.is-official ~ .bot-side-stage > .bot-official-panel {
  display: block;
}

.bot-hierarchical-menu.is-official:not(.is-official-compare) ~ .bot-side-stage .bot-official-head,
.bot-hierarchical-menu.is-official:not(.is-official-compare) ~ .bot-side-stage .bot-official-panel > section,
.bot-hierarchical-menu.is-official:not(.is-official-compare) ~ .bot-side-stage .bot-official-note {
  display: none !important;
}

.bot-hierarchical-menu.is-official-compare ~ .bot-side-stage .bot-official-panel {
  color: #3f3f46;
}

.bot-official-panel {
  padding: 0.15rem 0.15rem 1rem;
}

[data-bot-focus="profile"] [data-bot-part="profile"] {
  border: 0;
  padding: 1rem;
  background: transparent;
  box-shadow: none;
}

[data-bot-focus="profile"] [data-bot-part="danger"] {
  margin-top: 0;
}

@media (max-width: 960px) {
  .bot-menu-label,
  .bot-submenu-item,
  .bot-group-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* 1.0.15: group picker sits at the top of group pages. */
.bot-group-scope {
  position: relative;
  margin: 0 0 0.85rem;
}

.bot-group-scope-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  background: #fff;
  color: #18181b;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: left;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
}

.bot-group-scope-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-group-scope-button svg {
  width: 1rem;
  height: 1rem;
  flex: none;
  color: #71717a;
}

.bot-group-scope-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.bot-group-scope-button.is-empty {
  color: #71717a;
}

.bot-group-scope-menu {
  position: absolute;
  z-index: 30;
  top: calc(2.75rem + 0.35rem);
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 12px 32px rgba(24, 24, 27, 0.12);
}

.bot-group-scope-menu[hidden] {
  display: none;
}

.bot-group-scope-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #18181b;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: left;
}

.bot-group-scope-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-group-scope-item [data-mark] {
  width: 1rem;
  flex: none;
  color: transparent;
  font-style: normal;
}

.bot-group-scope-item.is-on {
  background: #f4f4f5;
}

.bot-group-scope-item.is-on [data-mark]::before {
  content: "✓";
  color: #18181b;
}

.bot-group-scope-item:hover {
  background: #f4f4f5;
}

.bot-group-scope-empty {
  margin: 0;
  padding: 0.55rem 0.7rem 0.4rem;
  color: #71717a;
  font-size: 0.8rem;
}

.bot-group-scope-note {
  margin: 0.4rem 0 0;
  color: #71717a;
  font-size: 0.75rem;
  line-height: 1.4;
}

.bot-group-scope-note:empty {
  display: none;
}

.dark .bot-group-scope-button,
.dark .bot-group-scope-menu {
  border-color: #3f3f46;
  background: #18181b;
  color: #fafafa;
}

.dark .bot-group-scope-item {
  color: #fafafa;
}

.dark .bot-group-scope-item.is-on,
.dark .bot-group-scope-item:hover {
  background: #27272a;
}

.dark .bot-group-scope-item.is-on [data-mark]::before,
.dark .bot-group-scope-button svg {
  color: #e4e4e7;
}

/* ========================================================================
   1.0.16-ui: 布局与排版优化。只调整视觉，不改结构和数据。
   ======================================================================== */

/* —— 顶部概览卡：指标卡与按钮排列 —— */
[data-testid="bot-management-page"] > section:first-child {
  border-radius: 0.9rem;
}

[data-testid="bot-management-page"] > section:first-child h2 {
  font-size: 1.15rem;
  line-height: 1.6rem;
  letter-spacing: -0.01em;
}

[data-testid="bot-management-page"] > section:first-child h2 + p {
  max-width: 34rem;
  font-size: 0.78rem;
  line-height: 1.5;
}

[data-testid="bot-management-page"] > section:first-child div.grid.grid-cols-2 {
  border-radius: 0.7rem;
  background: #fafafa;
  overflow: hidden;
}

[data-testid="bot-management-page"] > section:first-child div.grid.grid-cols-2 > div {
  min-width: 5.6rem;
  padding: 0.6rem 1rem;
}

[data-testid="bot-management-page"] > section:first-child div.grid.grid-cols-2 > div > div:first-child {
  font-size: 0.7rem;
  line-height: 1.05rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

[data-testid="bot-management-page"] > section:first-child div.grid.grid-cols-2 > div > div:last-child {
  margin-top: 0.3rem;
  font-size: 1.4rem;
  line-height: 1.7rem;
  font-weight: 600;
}

[data-testid="bot-management-page"] > section:first-child button.ui-btn-primary,
[data-testid="bot-management-page"] > section:first-child button.ui-btn-secondary {
  height: 2.2rem;
  padding: 0 0.85rem;
  font-size: 0.75rem;
}

@media (min-width: 1024px) {
  [data-testid="bot-management-page"] > section:first-child .flex.flex-wrap.gap-2 {
    flex-wrap: nowrap;
  }
}

/* —— 机器人信息卡：名字、账号、令牌三行对齐 —— */
[data-testid="bot-management-layout"] > main > .ui-card:first-child {
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child h2 {
  font-size: 1.05rem;
  line-height: 1.5rem;
}

[data-testid="bot-management-layout"] > main > .ui-card:first-child > div.min-w-0 > div:nth-child(2) {
  margin-top: 0.35rem;
  row-gap: 0.15rem;
  font-size: 0.72rem;
  color: #71717a;
}

[data-bot-token] {
  justify-content: flex-start;
  margin-top: 0.6rem;
  min-width: 0;
}

[data-bot-token] code {
  flex: 0 1 24rem;
  min-width: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  font-size: 0.74rem;
}

[data-bot-token] button {
  height: 2.1rem;
  padding: 0 0.7rem;
}

/* —— 左侧功能菜单：选中态加左侧强调条，间距更匀 —— */
.bot-hierarchical-menu {
  gap: 1.1rem;
  padding-right: 0.65rem;
}

.bot-menu-group {
  gap: 0.2rem;
}

.bot-menu-label {
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.15rem;
  letter-spacing: 0.02em;
}

.bot-submenu-item {
  position: relative;
  padding: 0.4rem 0.65rem 0.4rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.2rem;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.bot-submenu-item.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.bot-submenu-item.is-active::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  width: 2px;
  height: 0.85rem;
  border-radius: 2px;
  background: #2563eb;
  transform: translateY(-50%);
}

/* —— 右侧内容：分区卡片、字段与排版统一 —— */
[data-testid="bot-workspace-content"] {
  padding: 0.15rem 0.75rem 1.1rem;
}

[data-bot-page-lead] {
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #71717a;
}

[data-testid="bot-workspace-content"] section {
  border-radius: 0.75rem;
}

[data-testid="bot-workspace-content"] label > span {
  font-size: 0.78rem;
  font-weight: 500;
  color: #3f3f46;
}

[data-testid="bot-workspace-content"] input.ui-input,
[data-testid="bot-workspace-content"] select.ui-input {
  min-height: 2.35rem;
  border-radius: 0.55rem;
  font-size: 0.82rem;
}

[data-testid="bot-workspace-content"] textarea {
  border-radius: 0.55rem;
  font-size: 0.82rem;
  line-height: 1.55;
}

[data-testid="bot-workspace-content"] input.ui-input:focus-visible,
[data-testid="bot-workspace-content"] select.ui-input:focus-visible,
[data-testid="bot-workspace-content"] textarea:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: 1px;
}

[data-testid="bot-workspace-content"] h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #18181b;
}

[data-testid="bot-workspace-content"] h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: #3f3f46;
}

[data-testid="bot-workspace-content"] p {
  font-size: 0.78rem;
  line-height: 1.55;
}

/* —— 群选择：更像一个明确的入口 —— */
.bot-group-scope-button {
  min-height: 2.6rem;
  border-radius: 0.7rem;
  font-size: 0.82rem;
}

.bot-group-scope-note {
  font-size: 0.74rem;
}

/* —— 官方能力对照表：阅读更顺 —— */
.bot-official-table div {
  border-radius: 0.6rem;
  padding: 0.7rem 0.85rem;
}

.bot-official-table strong {
  font-size: 0.82rem;
}

.bot-official-table em {
  font-size: 0.78rem;
  line-height: 1.5;
}

/* —— 暗色模式跟随 —— */
.dark [data-testid="bot-management-page"] > section:first-child div.grid.grid-cols-2 {
  background: #18181b;
}

.dark .bot-submenu-item.is-active {
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}

.dark .bot-submenu-item.is-active::before {
  background: #60a5fa;
}

.dark [data-testid="bot-workspace-content"] label > span,
.dark [data-testid="bot-workspace-content"] h4 {
  color: #d4d4d8;
}

.dark [data-testid="bot-workspace-content"] h3 {
  color: #fafafa;
}

/* —— 窄屏：保持左右两列，只收紧间距与字号 —— */
@media (max-width: 960px) {
  .bot-hierarchical-menu {
    position: static;
    max-height: none;
    gap: 0.75rem;
    padding-right: 0;
  }

  .bot-menu-label {
    padding: 0.28rem 0.4rem;
    font-size: 0.8rem;
  }

  .bot-submenu-item {
    padding: 0.38rem 0.35rem 0.38rem 1rem;
    font-size: 0.74rem;
  }

  .bot-submenu-item.is-active::before {
    left: 0.26rem;
    height: 0.78rem;
  }

  [data-testid="bot-workspace-content"] {
    padding: 0.55rem 0.65rem 1rem;
  }

  [data-bot-token] {
    justify-content: flex-start;
  }

  [data-bot-token] code {
    flex: 1 1 auto;
  }

  [data-testid="bot-management-page"] > section:first-child button.ui-btn-primary,
  [data-testid="bot-management-page"] > section:first-child button.ui-btn-secondary {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  [data-testid="bot-management-page"] > section:first-child div.grid.grid-cols-2 > div {
    min-width: 4.6rem;
    padding: 0.5rem 0.7rem;
  }

  [data-testid="bot-management-page"] > section:first-child div.grid.grid-cols-2 > div > div:last-child {
    font-size: 1.25rem;
  }

  [data-testid="bot-workspace-content"] section {
    padding: 0.8rem;
  }
}

/* —— 暗色模式：页面说明条不带底色，与正文一致 —— */
.dark [data-bot-page-lead] {
  background: transparent;
  color: #a1a1aa;
}

/* ========================================================================
   1.0.17-ui: 资料介绍拆成左右两栏，说明跟着每个设置项；危险操作收进右栏。
   ======================================================================== */

/* —— 宽屏恢复左右两栏：左边资料表单，右边危险操作 —— */
[data-bot-focus="profile"] [data-testid="bot-profile-workspace"] .grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr) !important;
  align-items: start;
  gap: 1.5rem;
}

/* —— 说明文字改成随字段走，这里收紧原来的按钮行 —— */
[data-bot-focus="profile"] [data-bot-part="profile"] div.flex.flex-wrap {
  align-items: center;
}

[data-bot-focus="profile"] [data-bot-part="profile"] div.flex.flex-wrap > [data-bot-aside] {
  flex: 1 1 100%;
  order: 3;
  display: flex;
  justify-content: flex-start;
  margin: 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid #e4e4e7;
}

[data-bot-focus="profile"] [data-bot-part="profile"] div.flex.flex-wrap > [data-bot-aside] > * {
  max-width: 100%;
}

[data-bot-sync-note] {
  flex: 1 1 100%;
  order: 4;
  margin: 0;
  color: #71717a;
  font-size: 0.72rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.dark [data-bot-sync-note] {
  color: #a1a1aa;
}

/* —— 每个设置项自己的说明与字数 —— */
[data-bot-hint] {
  margin: 0;
  color: #71717a;
  font-size: 0.72rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

[data-bot-focus="profile"] [data-bot-part="profile"] .ui-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

[data-bot-focus="profile"] [data-bot-part="profile"] .ui-label[data-count]::after {
  content: attr(data-count);
  color: #a1a1aa;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0;
}

.dark [data-bot-hint] {
  color: #a1a1aa;
}

.dark [data-bot-focus="profile"] [data-bot-part="profile"] .ui-label[data-count]::after {
  color: #71717a;
}

.dark [data-bot-focus="profile"] [data-bot-part="profile"] div.flex.flex-wrap > [data-bot-aside] {
  border-top-color: #3f3f46;
}

/* —— 危险操作：收成右栏一张卡，不再横铺整页 —— */
[data-bot-focus="profile"] [data-bot-part="danger"] > div:first-child {
  gap: 0.7rem;
}

[data-bot-focus="profile"] [data-bot-part="danger"] > div:first-child > div:first-child {
  flex: 1 1 auto;
}

[data-bot-focus="profile"] [data-bot-part="danger"] > div:nth-child(2) {
  gap: 0.5rem;
}

@media (max-width: 1100px) {
  [data-bot-focus="profile"] [data-testid="bot-profile-workspace"] .grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

[data-bot-avatar-help] { margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid var(--sp-border); color: var(--sp-muted); font-size: .75rem; line-height: 1.6; }

.bot-official-panel:empty, .bot-stage-note:empty { display: none !important; }
[data-bot-page-lead]:empty { display: none !important; }

[data-bot-focus="profile"] [data-bot-part="profile"] input.ui-input,
[data-bot-focus="profile"] [data-bot-part="profile"] textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
[data-bot-focus="profile"] [data-bot-part="profile"] input.ui-input:focus-visible,
[data-bot-focus="profile"] [data-bot-part="profile"] textarea:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(59,130,246,.18);
}
[data-bot-focus="profile"] [data-bot-avatar-help] {
  overflow-wrap: anywhere;
}

[data-bot-avatar-panel] {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  border: 1px solid var(--sp-border);
}
[data-avatar-preview] {
  width: 4.5rem;
  height: 4.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--sp-border);
  overflow: hidden;
}
[data-avatar-preview] img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
[data-avatar-preview] img[hidden] { display: none; }
[data-avatar-status] { margin: 0 0 .5rem; color: var(--sp-muted); font-size: .75rem; }
[data-avatar-pick] { font-size: .75rem; }
[data-avatar-remove] { margin-left: .5rem; font-size: .75rem; }
[data-avatar-remove][hidden] { display: none; }

[data-bot-original-group][hidden] { display: none !important; }
.bot-batch-groups { min-width: 0; }
.bot-batch-groups > .ui-label { display: block; margin-bottom: .4rem; }
.bot-batch-groups details { position: relative; }
.bot-batch-groups summary {
  min-height: 2.4rem;
  padding: .55rem .75rem;
  border: 1px solid var(--sp-border);
  border-radius: .65rem;
  background: var(--sp-surface, #fff);
  cursor: pointer;
  font-size: .8rem;
  line-height: 1.3rem;
}
.bot-batch-groups details[open] [data-batch-list] {
  position: absolute;
  z-index: 25;
  top: calc(100% + .25rem);
  left: 0;
  right: 0;
  max-height: 15rem;
  overflow: auto;
  padding: .3rem;
  border: 1px solid var(--sp-border);
  border-radius: .65rem;
  background: var(--sp-surface, #fff);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}
.bot-batch-groups legend {
  padding: 0;
  color: var(--sp-muted);
  font-size: .75rem;
  line-height: 1.45;
}
[data-bot-ai-panel] [data-bot-ai-sessions] { display: none !important; }
.bot-group-panel-legend { margin: 0 0 .45rem; padding: 0; color: var(--sp-muted); font-size: .75rem; line-height: 1.5; }
.bot-batch-all { display: flex; align-items: center; gap: .55rem; padding: .45rem .55rem; cursor: pointer; font-size: .8rem; border-bottom: 1px solid var(--sp-border); font-weight: 500; }
.bot-batch-all:hover { background: rgba(128, 128, 128, .1); }
[data-batch-list] { transform-origin: top; transition: opacity .15s ease, transform .15s ease; }
.bot-batch-groups details.is-closing [data-batch-list] { opacity: 0; transform: translateY(-.3rem); pointer-events: none; }
[data-batch-list] label { display: flex; align-items: center; gap: .55rem; padding: .45rem .55rem; cursor: pointer; font-size: .8rem; }
[data-batch-list] label:hover { background: rgba(128, 128, 128, .1); }
[data-batch-list] p { margin: .4rem; color: var(--sp-muted); }
[data-batch-limit] { margin: .35rem 0 0; color: var(--sp-muted); font-size: .72rem; }
[data-batch-status] { margin: .45rem 0 0; color: var(--sp-muted); font-size: .75rem; overflow-wrap: anywhere; }
[data-batch-status]:empty { display: none; }
[data-bot-batch-schedule] { display: grid; gap: .75rem; padding: .8rem; border: 1px solid var(--sp-border); border-radius: .65rem; }
[data-bot-batch-schedule] label { display: grid; gap: .35rem; font-size: .75rem; font-weight: 600; }
[data-bot-batch-schedule] input { max-width: 10rem; }
[data-bot-batch-schedule] button { justify-self: start; }
[data-bot-batch-schedule] [data-batch-schedule-hint] { margin: 0; color: var(--sp-muted); font-size: .75rem; }
[data-engagement-focus="schedule"] [data-testid="announcement-form"] > .flex:first-child > button { display: none; }
.dark .bot-batch-groups summary, .dark .bot-batch-groups [data-batch-list] { background: #18181b; color: #fafafa; }

.bot-ai-private-tools { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; border-bottom: 1px solid var(--sp-border); }
.bot-ai-private-tools [data-bot-ai-private-status] { color: var(--sp-muted); font-size: .72rem; }
.bot-ai-private-empty { margin: 0; padding: .6rem .75rem; color: var(--sp-muted); font-size: .75rem; }
.bot-ai-private-empty[hidden] { display: none; }

[data-bot-ai-history] {
  max-width: 56rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--sp-border);
  box-sizing: border-box;
}
[data-bot-ai-history] h3 { margin: 0 0 .8rem; font-size: .9rem; font-weight: 600; }
.bot-ai-history-toggle, .bot-ai-history-count, .bot-ai-history-actions { display: flex; align-items: center; gap: .6rem; }
.bot-ai-history-toggle { margin-bottom: .8rem; }
.bot-ai-history-count input { width: 5rem; padding: .4rem .5rem; border: 1px solid var(--sp-border); border-radius: .4rem; background: transparent; }
[data-ai-history-hint] { margin: .7rem 0; color: var(--sp-muted); font-size: .75rem; line-height: 1.5; }
.bot-ai-history-actions { flex-wrap: wrap; }
[data-ai-history-status] { font-size: .75rem; color: var(--sp-muted); }

[data-bot-ai-form] {
  gap: 1rem;
}
[data-bot-ai-form] > [data-bot-ai-enabled],
[data-bot-ai-form] > [data-bot-ai-prompt],
[data-bot-ai-form] > [data-bot-ai-history],
[data-bot-ai-form] > [data-bot-ai-sessions],
[data-bot-ai-form] > [data-bot-ai-connection] {
  margin: 0;
}
[data-bot-ai-form] > [data-bot-ai-enabled] {
  order: 1;
}
[data-bot-ai-form] > [data-bot-ai-connection] {
  order: 2;
}
[data-bot-ai-form] > [data-bot-ai-sessions] {
  order: 3;
}
[data-bot-ai-form] > [data-bot-ai-prompt] {
  order: 4;
}
[data-bot-ai-form] > [data-bot-ai-history] {
  order: 5;
}
[data-bot-ai-form] > div.flex.flex-wrap:not([data-bot-ai-info]) {
  order: 6;
}
[data-bot-ai-form] > p.text-\[11px\] {
  order: 7;
}
[data-bot-ai-form] > [data-bot-ai-info] {
  display: none;
}
[data-bot-ai-info-top] {
  max-width: 56rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}
[data-bot-ai-form] > [data-bot-ai-history] h3 {
  margin-bottom: .65rem;
}
[data-bot-ai-form] > [data-bot-ai-sessions] > .ui-label {
  display: block;
  margin-bottom: .35rem;
}
[data-time-step="5m"],
[data-time-step="15m"] {
  min-height: 2.45rem;
}

/* Keep chat messages readable when the bot workspace itself is narrow. */
[data-bot-focus="chats"] {
  container-type: inline-size;
}
@container (max-width: 700px) {
  [data-bot-focus="chats"] > .grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  [data-bot-focus="chats"] > .grid > div:first-child {
    max-height: 12rem;
    border-right: 0;
    border-bottom: 1px solid var(--sp-border);
  }
}

[data-bot-focus="integration"] {
  container-type: inline-size;
}
@container (max-width: 700px) {
  [data-bot-focus="integration"] .grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
