:root {
  --bg: #070b14;
  --panel: #0f1729;
  --panel-soft: #14203a;
  --text: #e8f0fb;
  --muted: #8ea3c0;
  --line: #1e2b45;
  --line-strong: #2c3d5e;
  --sidebar: #0a1120;
  --sidebar-soft: #16223c;
  --accent: #46dfff;
  --accent-dark: #22b8e0;
  --accent-soft: rgba(70, 223, 255, 0.14);
  --telegram: #38bdf8;
  --warning: #f5b53f;
  --warning-soft: rgba(245, 181, 63, 0.14);
  --danger: #ff7a7a;
  --danger-soft: rgba(255, 122, 122, 0.12);
  --success: #45e0a0;
  --success-soft: rgba(69, 224, 160, 0.13);
  --offline-dot: #5d7396;
  --shadow: 0 18px 44px rgba(2, 6, 14, 0.55);
  --glow: 0 0 22px rgba(70, 223, 255, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
  font: inherit;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

small {
  font-size: 11px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  color: var(--text);
  background: var(--panel);
}

input,
select {
  height: 36px;
  padding: 0 11px;
  font-size: 13px;
}

textarea {
  min-height: 82px;
  padding: 10px 11px;
  font-size: 13px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36,36,36,0.080);
}

label {
  display: grid;
  gap: 7px;
}

label > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.button {
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button.primary {
  color: #ffffff;
  background: var(--accent);
}

.button.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button.secondary {
  border-color: var(--line-strong);
  color: var(--muted);
  background: var(--panel);
}

.button.secondary:hover:not(:disabled),
.button.quiet:hover:not(:disabled) {
  background: var(--panel-soft);
}

.button.quiet {
  border-color: var(--line);
  color: var(--muted);
  background: var(--panel-soft);
}

.button.warning {
  border-color: rgba(180,83,9,0.225);
  color: var(--warning);
  background: var(--warning-soft);
}

.button.full {
  width: 100%;
}

.form-stack {
  display: grid;
  gap: 13px;
}

.form-message {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-message.error {
  color: var(--danger);
}

.inline-actions,
.filter-row,
.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.inline-actions > * {
  flex: 1;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--panel-soft);
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 18px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin-top: 5px;
  font-size: 26px;
}

.login-card .login-brand-name {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 3px;
  line-height: 1.12;
  background: linear-gradient(92deg, #ffffff 12%, #8fd8ff 88%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand-name span {
  display: block;
  margin-top: 7px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 5px;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  background: none;
}

.login-card input {
  height: 42px;
}

.login-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.login-mark,
.brand-mark {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--telegram);
  font-weight: 900;
}

.login-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
}

.app-shell {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  height: 100vh;
}

.app-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px 14px 14px;
  color: #dbe7f8;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 20px;
  border-bottom: 1px solid rgba(19,19,22,0.09);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  font-size: 13px;
}

.brand strong,
.brand span,
.user-panel strong,
.user-panel span {
  display: block;
}

.brand strong {
  color: #fff;
  font-size: 14px;
}

.brand strong.brand-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.15;
  background: linear-gradient(92deg, #ffffff 8%, #8fd8ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-mark {
  background: linear-gradient(135deg, #46dfff, #9e38ff);
  color: #04121c;
  box-shadow: 0 0 18px rgba(70, 223, 255, 0.35);
}

.brand span,
.user-panel span {
  margin-top: 3px;
  color: #898989;
  font-size: 11px;
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.nav-item {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 43px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: #6b7280;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: var(--sidebar-soft);
}

.nav-item.active {
  box-shadow: inset 3px 0 var(--accent);
}

.nav-icon {
  font-size: 16px;
}

.nav-badge {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  font-size: 11px;
  text-align: center;
}

.sidebar-spacer {
  flex: 1;
}

.user-panel {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  padding: 12px 8px 2px;
  border-top: 1px solid rgba(19,19,22,0.09);
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 800;
}

.user-panel strong {
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button,
.square-button,
.modal-close {
  display: grid;
  place-items: center;
  border: 0;
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #6b7280;
  background: rgba(19,19,22,0.07);
  font-size: 16px;
}

.workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.workspace-header {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.workspace-header h1 {
  margin-top: 3px;
  font-size: 20px;
}

.workspace-header p:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.live-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(36,36,36,0.070);
}

.page {
  min-height: 0;
  flex: 1;
}

.dashboard-page,
.accounts-page,
.settings-page {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 32px;
}

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

.metric-card {
  min-height: 124px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

.metric-card span {
  color: var(--muted);
  font-size: 12px;
}

.metric-card strong {
  margin-top: 8px;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.content-section {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.section-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}

.section-header h2 {
  font-size: 14px;
}

.section-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.filter-row select {
  width: 160px;
}

.filter-row input {
  width: 200px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 11px;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.agent-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.agent-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #04121c;
  background: linear-gradient(135deg, #46dfff, #9e38ff);
  font-weight: 800;
}

.agent-cell strong,
.agent-cell small {
  display: block;
}

.agent-cell small {
  margin-top: 2px;
  color: var(--muted);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 750;
}

.status-chip.offline,
.status-chip.disabled {
  color: var(--warning);
  background: var(--warning-soft);
}

.table-action {
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--accent);
  background: transparent;
  font-size: 11px;
}

.table-action:hover {
  background: var(--accent-soft);
}

/* 每个代理的 TG 账号上限 */
.quota-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.quota-cell input {
  width: 62px;
  padding: 4px 6px;
  font-size: 12px;
  text-align: center;
}

.quota-usage {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.quota-usage.over {
  color: var(--warning);
}

.quota-hint.ok {
  color: var(--muted);
}

.quota-hint.over {
  color: var(--warning);
  font-weight: 600;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 12px;
  padding: 15px;
}

.account-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.account-card-top {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.tg-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--telegram);
  font-size: 11px;
  font-weight: 850;
}

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

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

.account-card small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.account-card-stats span {
  color: var(--muted);
  font-size: 11px;
}

.account-card-stats b {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.account-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.account-card-footer button {
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--accent);
  background: var(--accent-soft);
}

.empty-block {
  grid-column: 1 / -1;
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

.inbox-page {
  overflow: hidden;
}

.inbox-layout {
  display: grid;
  grid-template-columns: 230px 310px minmax(390px, 1fr) 286px;
  height: 100%;
  min-height: 0;
}

.account-pane,
.conversation-pane,
.chat-pane,
.detail-pane {
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.account-pane,
.conversation-pane,
.detail-pane {
  display: flex;
  flex-direction: column;
}

.pane-header {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.pane-header strong,
.pane-header span {
  display: block;
}

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

.pane-header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.square-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  background: var(--panel);
  font-size: 20px;
}

.pane-filter {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.pane-filter select {
  height: 36px;
  font-size: 11px;
}

.account-list,
.conversation-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.inbox-account,
.conversation-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.inbox-account {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
}

.inbox-account:hover,
.inbox-account.active,
.conversation-item:hover,
.conversation-item.active {
  background: var(--panel-soft);
}

.inbox-account.active,
.conversation-item.active {
  box-shadow: inset 3px 0 var(--accent);
}

.inbox-account .tg-avatar {
  width: 35px;
  height: 35px;
}

.inbox-account strong,
.inbox-account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-account strong {
  font-size: 12px;
}

.inbox-account small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.account-unread,
.conversation-unread {
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  font-size: 11px;
}

.account-fans {
  display: flex;
  align-items: baseline;
  gap: 2px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.account-fans b {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.search-field {
  position: relative;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.search-field span {
  position: absolute;
  top: 17px;
  left: 21px;
  color: var(--muted);
}

.search-field input {
  height: 36px;
  padding-left: 31px;
  background: var(--panel-soft);
  font-size: 11px;
}

.new-conversation {
  padding: 0 10px 10px;
}

.new-conversation-row {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr) auto;
  gap: 6px;
}

.new-conversation select,
.new-conversation input {
  height: 32px;
  font-size: 11px;
  min-width: 0;
}

.new-conversation .form-message {
  margin: 5px 2px 0;
  font-size: 11px;
}

.conversation-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 11px;
}

.customer-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 800;
}

.conversation-copy {
  min-width: 0;
}

.conversation-copy strong,
.conversation-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.conversation-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.conversation-side {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.chat-pane {
  display: flex;
  flex-direction: column;
  background: var(--panel-soft);
}

.chat-header {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.chat-header h2 {
  font-size: 14px;
}

.customer-handle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.customer-profile {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.link-button {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent, #7aa2f7);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.segmented button {
  min-width: 68px;
  height: 29px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.segmented button.active {
  color: #ffffff;
  background: var(--accent);
}

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

.empty-state {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.message {
  display: flex;
  margin-bottom: 10px;
}

.message.ai,
.message.human {
  justify-content: flex-end;
}

.bubble {
  max-width: min(76%, 620px);
  padding: 10px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 2px 6px rgba(2, 6, 12, 0.4);
}

.message.ai .bubble {
  border-color: rgba(18,128,92,0.350);
  background: rgba(18,128,92,0.100);
}

.message.human .bubble {
  border-color: rgba(0,153,255,0.175);
  background: rgba(0,153,255,0.050);
}

.message.system {
  justify-content: center;
}

.message.system .bubble {
  max-width: 88%;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 11px;
}

.message-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
}

.message-image-link {
  display: block;
  margin-bottom: 7px;
  line-height: 0;
}

.message-image {
  display: block;
  width: auto;
  max-width: min(420px, 100%);
  max-height: 440px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--panel-soft);
}

.message-audio-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.message-audio {
  display: block;
  width: min(320px, 65vw);
  height: 38px;
}

.message-video {
  display: block;
  width: min(420px, 100%);
  max-height: 440px;
  margin-bottom: 7px;
  border-radius: 6px;
  background: #17181a;
}

.message-file {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.message-file-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  font-size: 16px;
  font-weight: 700;
}

.message-file strong,
.message-file small {
  display: block;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-file strong {
  font-size: 11px;
}

.message-file small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.media-unavailable {
  color: var(--danger);
  font-size: 11px;
}

/* 加载更早消息：贴在消息列表顶端的小胶囊按钮 */
.load-older-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0 10px;
}

.load-older {
  border: 1px solid rgba(120, 160, 200, 0.35);
  background: rgba(20, 32, 48, 0.6);
  color: #9fb6d0;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.load-older:hover {
  color: #d8e7f7;
  border-color: rgba(70, 223, 255, 0.55);
}

.load-older:disabled {
  opacity: 0.6;
  cursor: default;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.translate-button {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 11px;
}

/* 已读回执：一个勾 = 已发出，两个勾 = 客户已读 */
.msg-tick {
  font-size: 11px;
  letter-spacing: -2px;
  color: var(--muted);
  opacity: 0.85;
  cursor: help;
}

.msg-tick.read {
  color: #46dfff;
  opacity: 1;
  text-shadow: 0 0 6px rgba(70, 223, 255, 0.55);
}

.translation {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 9px;
  padding: 11px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.composer textarea {
  min-height: 54px;
  max-height: 130px;
  resize: none;
}

.detail-pane {
  border-right: 0;
  background: var(--panel-soft);
}

.detail-scroll {
  min-height: 0;
  overflow-y: auto;
}

.detail-section {
  display: grid;
  gap: 11px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

.detail-section h3 {
  font-size: 12px;
}

.detail-section input,
.detail-section select {
  height: 36px;
  font-size: 13px;
}

.detail-section textarea {
  min-height: 66px;
  font-size: 13px;
}

.profile-prompt {
  min-height: 280px !important;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.switch-row input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
}

.switch-row span,
.switch-row b,
.switch-row small {
  display: block;
}

.switch-row b {
  font-size: 11px;
}

.switch-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.text-danger {
  width: fit-content;
  padding: 4px 0;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-size: 11px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 520px));
  gap: 15px;
}

.settings-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.settings-title h2 {
  font-size: 14px;
}

.settings-title p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.settings-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.telegram-icon {
  background: var(--telegram);
}

.ai-icon {
  background: #5f6b7a;
}

.notify-icon {
  background: #12805c;
}

.voice-icon {
  background: #0099ff;
}

.growth-icon {
  background: #12805c;
}

.member-icon {
  background: #5f6b7a;
}

.settings-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.settings-nav-group {
  margin: 8px 8px 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings-nav-item {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.settings-nav-item:hover {
  background: var(--accent-soft);
}

.settings-nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.settings-panels {
  display: block;
  min-width: 0;
}

.settings-panels .settings-card {
  width: 100%;
  max-width: none;
}

.prompt-icon {
  background: #b45309;
}

.profile-insight {
  display: grid;
  gap: 10px;
}

.profile-insight .profile-summary {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

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

.profile-chip {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.profile-chip small {
  color: var(--text-muted, #898989);
  font-size: 11px;
}

.profile-chip b {
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.profile-scores {
  display: flex;
  gap: 10px;
}

.score-block {
  display: grid;
  gap: 2px;
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.score-block .stars {
  color: #b45309;
  font-size: 14px;
  letter-spacing: 2px;
}

.score-block .kill-score {
  font-size: 16px;
  font-weight: 850;
}

.score-block .kill-score i {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.65;
}

.kill-score.hot {
  color: #f04438;
}

.kill-score.warm {
  color: #b45309;
}

.kill-score.cool {
  color: #0099ff;
}

.kill-reasons,
.profile-timeline {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.7;
}

.profile-timeline li small {
  display: inline-block;
  margin-right: 6px;
  color: var(--text-muted, #898989);
}

.profile-timeline .timeline-title {
  list-style: none;
  margin-left: -18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #898989);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24,26,31,0.432);
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.compact-modal {
  width: min(440px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin-top: 4px;
  font-size: 20px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 20px;
}

.info-banner {
  margin-bottom: 16px;
  padding: 11px 12px;
  border-left: 3px solid var(--telegram);
  color: var(--muted);
  background: rgba(0,153,255,0.050);
  font-size: 11px;
  line-height: 1.6;
}

.qr-stage {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.qr-image-wrap {
  display: grid;
  width: 296px;
  height: 296px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.qr-image-wrap img {
  width: 280px;
  height: 280px;
}

.qr-loading {
  color: var(--muted);
  font-size: 12px;
}

.qr-copy {
  text-align: center;
}

.qr-copy h3 {
  font-size: 14px;
}

.qr-copy p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.qr-stage .form-stack {
  width: 100%;
}

@media (max-width: 1380px) {
  .inbox-layout {
    grid-template-columns: 180px 220px minmax(300px, 1fr) 220px;
  }

  .account-grid {
    grid-template-columns: repeat(2, minmax(230px, 1fr));
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .brand {
    justify-content: center;
    padding-inline: 0;
  }

  .brand > div:last-child,
  .nav-item > span:not(.nav-icon),
  .user-panel > div:nth-child(2) {
    display: none;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .nav-badge {
    position: absolute;
    margin: -23px 0 0 26px;
  }

  .user-panel {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .inbox-layout {
    grid-template-columns: 190px 260px minmax(360px, 1fr);
  }

  .detail-pane {
    display: none;
  }

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

  .settings-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
  }

  .settings-nav-group {
    flex-basis: 100%;
    margin: 4px 4px 0;
  }
}

@media (max-width: 800px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .app-sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 8px 10px;
  }

  .brand {
    padding: 0;
    border: 0;
  }

  .main-nav {
    display: flex;
    justify-content: center;
    margin: 0;
  }

  .nav-item {
    width: 45px;
  }

  .sidebar-spacer {
    display: none;
  }

  .user-panel {
    padding: 0;
    border: 0;
  }

  .user-avatar {
    display: none;
  }

  .workspace-header {
    min-height: 72px;
    padding: 10px 14px;
  }

  .workspace-header p:last-child,
  .live-status {
    display: none;
  }

  .workspace-header h1 {
    font-size: 16px;
  }

  .dashboard-page,
  .settings-page {
    padding: 12px;
  }

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

  .account-grid {
    grid-template-columns: 1fr;
  }

  .inbox-page {
    height: calc(100vh - 136px);
  }

  .inbox-layout {
    grid-template-columns: 72px 108px minmax(0, 1fr);
    overflow: hidden;
  }

  .account-pane .pane-header {
    justify-content: center;
    padding: 6px;
  }

  .account-pane .pane-header > div,
  .account-pane .pane-filter,
  .conversation-pane .pane-header span,
  .conversation-pane .search-field,
  .inbox-account > span:nth-child(2),
  .inbox-account .account-unread,
  .conversation-copy span,
  .conversation-side {
    display: none;
  }

  .inbox-account {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 8px 5px;
  }

  .conversation-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 6px;
    padding: 8px 6px;
  }

  .customer-avatar {
    width: 30px;
    height: 30px;
  }

  .conversation-copy strong {
    font-size: 11px;
  }

  .chat-header {
    min-height: 86px;
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .segmented button {
    min-width: 0;
    flex: 1;
  }

  .messages {
    padding: 9px;
  }

  .bubble {
    max-width: 92%;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr);
  }

  .composer .button {
    min-height: 36px;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .metric-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .header-actions .button {
    padding: 0 10px;
    font-size: 11px;
  }

  .filter-row {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .filter-row select,
  .filter-row input {
    width: 100%;
  }
}

/* ===== 批量操作 / 人设模板 / 审计日志（20261026-persona） ===== */

.settings-card.wide {
  grid-column: 1 / -1;
}

.batch-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 12px;
  color: var(--muted);
}

.batch-bar.compact {
  padding: 8px 10px;
}

.batch-bar select,
.batch-bar input {
  width: auto;
  min-width: 130px;
  height: 36px;
}

.batch-bar .button {
  min-height: 36px;
  padding: 0 14px;
}

.batch-bar .batch-label {
  font-weight: 750;
  color: var(--muted);
}

.batch-bar .batch-count {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.batch-bar .batch-count:empty {
  display: none;
}

.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}

.inline-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.card-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.card-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.conversation-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.conversation-row .row-check {
  display: flex;
  align-items: center;
  padding: 0 2px;
}

.conversation-row .row-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.conversation-row .conversation-item {
  flex: 1;
  min-width: 0;
}

.conversation-row.active .row-check {
  border-radius: 6px;
  background: rgba(36,36,36,0.050);
}

.field-group {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.field-group > strong {
  font-size: 12px;
  color: var(--muted);
}

.field-hint {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

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

.form-grid .span-2 {
  grid-column: 1 / -1;
}

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

.persona-grid .span-2 {
  grid-column: 1 / -1;
}

.persona-vars {
  display: grid;
  gap: 10px;
}

.template-list {
  display: grid;
  gap: 10px;
}

.template-card {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.template-card.default {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(36,36,36,0.080);
}

.template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-head strong {
  font-size: 13px;
}

.chip-row {
  display: inline-flex;
  gap: 6px;
}

.chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(36,36,36,0.080);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
}

.chip.custom {
  background: rgba(36,36,36,0.064);
  color: #5f6b7a;
}

.chip.default {
  background: var(--accent);
  color: #ffffff;
}

.template-card p {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}

.template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}

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

.template-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.audit-wrap {
  max-height: 420px;
  overflow-y: auto;
}

.audit-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(36,36,36,0.070);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.audit-payload {
  display: block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}

.wide-modal {
  width: min(680px, 100%);
}

@media (max-width: 720px) {
  .form-grid,
  .persona-grid {
    grid-template-columns: 1fr;
  }

  .batch-bar select,
  .batch-bar input {
    min-width: 0;
    flex: 1 1 120px;
  }
}

.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.check-label input {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--accent);
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.report-list-section { margin-top: 14px; }
.report-list-section h3 { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.report-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow: auto; }
.report-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.report-item-main { min-width: 0; flex: 1; }
.report-item-title { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-item-sub { font-size: 11px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-item-actions { display: flex; gap: 6px; flex: none; }
.report-item-actions button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 6px; padding: 4px 9px; font-size: 11.5px; cursor: pointer; }
.report-item-actions button:hover { color: var(--text); border-color: var(--line-strong); }
.report-item-actions button.danger-button { border-color: rgba(220,72,72,.35); color: #c94a4a; }
.report-item-actions button.danger-button:hover { background: rgba(220,72,72,.08); }

.tdata-result {
  max-height: 280px;
  overflow: auto;
  margin-top: 4px;
}

.tdata-result th,
.tdata-result td {
  font-size: 12px;
}

/* ============ 科技感暗色皮肤（neon-tech skin） ============ */

body {
  background:
    radial-gradient(1100px 500px at 12% -8%, rgba(36,36,36,0.045), transparent 60%),
    radial-gradient(900px 480px at 88% 4%, rgba(36,36,36,0.028), transparent 55%),
    var(--bg);
}

::selection {
  background: rgba(36,36,36,0.140);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d2d3d7;
  border-radius: 8px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #33507f;
}

::-webkit-scrollbar-track {
  background: transparent;
}

button,
select,
input,
textarea {
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    box-shadow 0.16s ease, transform 0.16s ease;
}

.button.primary {
  background: linear-gradient(135deg, #242424 0%, #111111 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(36,36,36,0.110);
}

.button.primary:hover:not(:disabled) {
  box-shadow: 0 6px 26px rgba(36,36,36,0.190);
  transform: translateY(-1px);
}

.button.primary:disabled {
  opacity: 0.45;
}

.nav-item.active {
  box-shadow: inset 3px 0 0 var(--accent);
  background: linear-gradient(90deg, rgba(36,36,36,0.070), rgba(36,36,36,0.010));
}

.metric-card {
  background: linear-gradient(180deg, rgba(36,36,36,0.025), rgba(19,19,22,0.000) 46%), var(--panel);
  border: 1px solid var(--line);
}

.metric-card strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.metric-card:hover {
  border-color: rgba(36,36,36,0.175);
  box-shadow: var(--glow);
}

.account-card {
  position: relative;
  overflow: hidden;
}

.account-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(36,36,36,0.275), transparent);
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.account-card:hover {
  border-color: rgba(36,36,36,0.200);
  box-shadow: 0 12px 34px rgba(19,19,22,0.100), var(--glow);
  transform: translateY(-2px);
}

.account-card:hover::before {
  opacity: 1;
}

.account-card-stats b,
.account-card-meta,
.overview-item b {
  font-variant-numeric: tabular-nums;
}

/* ---- 实时状态点 ---- */

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(18,128,92,0.550);
  animation: status-pulse 2.2s ease-out infinite;
}

.status-dot.offline {
  background: var(--offline-dot);
}

.status-dot.idle {
  background: var(--warning);
  animation: status-breathe 3s ease-in-out infinite;
}

@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(18,128,92,0.500);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(18,128,92,0.000);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(18,128,92,0.000);
  }
}

@keyframes status-breathe {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

/* ---- 仪表盘实时状态汇总条 ---- */

.status-overview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 11px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(36,36,36,0.030), rgba(19,19,22,0.160) 42%);
  font-size: 12px;
  color: var(--muted);
}

.overview-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.overview-item b {
  color: var(--text);
  font-weight: 700;
}

.overview-divider {
  width: 1px;
  height: 14px;
  background: var(--line-strong);
  padding: 0;
}

.overview-time {
  margin-left: auto;
  color: var(--muted);
}

/* ---- AI / 人工即时切换 ---- */

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

.footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-actions [data-open-account] {
  padding: 5px 11px;
}

.mode-toggle {
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}

.mode-toggle.auto {
  color: var(--accent);
  border-color: rgba(36,36,36,0.225);
  background: var(--accent-soft);
}

.mode-toggle.manual {
  color: var(--warning);
  border-color: rgba(180,83,9,0.225);
  background: var(--warning-soft);
}

.mode-toggle:hover:not(:disabled) {
  box-shadow: var(--glow);
}

.test-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
}

.test-button:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
}

.danger-button {
  border: 1px solid rgba(220, 72, 72, 0.35);
  background: transparent;
  color: #c94a4a;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
}

.danger-button:hover:not(:disabled) {
  background: rgba(220, 72, 72, 0.08);
  border-color: #c94a4a;
}

.account-card-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
}

.account-card-meta b {
  color: var(--text);
  font-weight: 600;
  font-size: 11px;
}

/* ---- 会话行 AI / 人工徽章 ---- */

.conversation-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mode-badge {
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.6;
}

.mode-badge.auto {
  color: var(--accent);
  background: var(--accent-soft);
}

.mode-badge.manual {
  color: var(--warning);
  background: var(--warning-soft);
}

/* ---- 模式分段开关增强 ---- */

.segmented button.active {
  box-shadow: 0 0 16px rgba(36,36,36,0.175);
  font-weight: 700;
}

/* ---- 语音条录音 ---- */

.composer {
  grid-template-columns: minmax(0, 1fr) 44px 72px;
}

.voice-record-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(36,36,36,0.175);
  border-radius: 12px;
  background: rgba(36,36,36,0.030);
  font-size: 12px;
}

.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  animation: rec-blink 1.1s ease-in-out infinite;
}

@keyframes rec-blink {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(217,45,32,0.300);
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 0 5px rgba(217,45,32,0.000);
  }
}

#voiceRecordTime {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}

.rec-hint {
  color: var(--muted);
}

.voice-record-bar .button.subtle {
  margin-left: auto;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}

.voice-record-bar .button.subtle:hover {
  color: var(--danger);
  border-color: rgba(217,45,32,0.300);
}

.voice-button {
  display: grid;
  place-items: center;
  font-size: 16px;
  padding: 0;
}

.voice-button.recording {
  color: #ffffff;
  background: var(--danger);
  box-shadow: 0 0 18px rgba(217,45,32,0.270);
  animation: rec-blink 1.1s ease-in-out infinite;
}

.message-audio {
  width: min(260px, 100%);
  height: 34px;
}

/* AI 语音（TTS）试听行 */
.tts-preview-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tts-preview-row input[type="text"] {
  flex: 1 1 220px;
  min-width: 180px;
}

.tts-preview-row audio {
  height: 34px;
  width: min(240px, 100%);
}

/* —— 大规模账号池：工具条 / 状态芯片 / 紧凑列表 / 分页 —— */
.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}
.status-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.status-chips .status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.status-chips .status-chip b {
  font-weight: 800;
  color: inherit;
  opacity: 0.85;
}
.status-chips .status-chip:hover {
  border-color: var(--accent);
}
.status-chips .status-chip.chip-all {
  color: var(--text);
}
.status-chips .status-chip.chip-all.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.status-chips .status-chip.chip-online,
.status-chips .status-chip.chip-online b {
  color: var(--success);
}
.status-chips .status-chip.chip-online.active {
  background: var(--success-soft);
  border-color: var(--success);
}
.status-chips .status-chip.chip-offline,
.status-chips .status-chip.chip-offline b {
  color: var(--offline-dot);
}
.status-chips .status-chip.chip-offline.active {
  background: rgba(143, 176, 221, 0.14);
  border-color: var(--offline-dot);
}
.status-chips .status-chip.chip-idle,
.status-chips .status-chip.chip-idle b {
  color: var(--warning);
}
.status-chips .status-chip.chip-idle.active {
  background: var(--warning-soft);
  border-color: var(--warning);
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}
.view-toggle button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.account-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.account-row {
  display: grid;
  grid-template-columns: 76px minmax(150px, 1.2fr) minmax(170px, 1fr) minmax(70px, 0.7fr) 92px auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 13px;
  transition: border-color 0.15s;
}
.account-row:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}
.account-row .row-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.account-row .row-status:has(.status-dot.online) {
  color: var(--success);
}
.account-row .row-status:has(.status-dot.offline) {
  color: var(--offline-dot);
}
.account-row .row-status:has(.status-dot.idle) {
  color: var(--warning);
}
.account-row .row-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.account-row .row-identity strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-row .row-identity small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-row .row-metrics {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.account-row .row-metrics .has-unread {
  color: var(--danger);
  font-weight: 700;
}
.account-row .row-owner {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-row .row-checktime {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.account-row .row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.account-row .row-actions button {
  padding: 3px 9px;
  font-size: 11px;
}
.row-check {
  display: inline-flex;
  align-items: center;
}
.pager-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.pager-bar button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.pager-bar button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text);
}
.pager-bar button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
}
.pager-bar button:disabled {
  opacity: 0.45;
  cursor: default;
}
.pager-info {
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
}
.pager-ellipsis {
  color: var(--muted);
  font-size: 12px;
}
.account-row .row-actions button {
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.account-row .row-actions button:hover:not(:disabled) {
  border-color: var(--accent);
}
.account-row .row-actions button[data-open-account] {
  background: var(--accent-soft);
  border-color: rgba(36,36,36,0.225);
  color: var(--accent);
}
.account-row .row-owner {
  font-size: 12px;
}
@media (max-width: 1100px) {
  .account-row {
    grid-template-columns: 76px 1fr auto;
  }
  .account-row .row-metrics,
  .account-row .row-owner,
  .account-row .row-checktime {
    display: none;
  }
}


/* ================= 极光暗夜皮肤 v3（Aurora · 深空 · 霓虹） ================= */
:root {
  --focus-ring: 0 0 0 3px rgba(70, 223, 255, 0.30);
  --ring: 0 0 0 1px rgba(70, 223, 255, 0.18);
  --ink: #e8f0fb;
  --text-muted: #8ea3c0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #070b14;
}
::selection { background: rgba(70, 223, 255, 0.30); color: #f2fbff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #24365a; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #33507f; background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* 按钮体系 */
.button { font-weight: 500; border-radius: 8px; background: #16223c; color: #dbe7f8; border: 1px solid #24365a; box-shadow: none; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.button:hover:not(:disabled) { background: #1c2c4c; border-color: #33507f; box-shadow: 0 0 14px rgba(70,223,255,0.12); }
.button.primary, .button.primary:hover:not(:disabled) { background: linear-gradient(135deg, #1e9dd8 0%, #46dfff 100%); color: #04121c; border-color: transparent; box-shadow: 0 4px 18px rgba(70,223,255,0.28); }
.button.primary:hover:not(:disabled) { box-shadow: 0 4px 26px rgba(70,223,255,0.42); transform: translateY(-1px); }
.button.primary:disabled { background: linear-gradient(135deg, #1e9dd8 0%, #46dfff 100%); color: #04121c; border-color: transparent; opacity: 0.45; box-shadow: none; }
.button.secondary { background: #16223c; color: #dbe7f8; border-color: #24365a; }
.button.quiet { background: transparent; border-color: transparent; color: #8ea3c0; }
.button.quiet:hover:not(:disabled) { background: rgba(70,223,255,0.08); color: #e8f0fb; }
.button.warning { background: rgba(245,181,63,0.14); color: #f5b53f; border-color: rgba(245,181,63,0.35); }
.button.subtle { background: rgba(255,255,255,0.10); color: #e8f0fb; border-color: transparent; }

/* 侧栏与导航 */
.app-sidebar { border-right: 1px solid #18243d; box-shadow: none; background: rgba(10,17,32,0.82); }
.brand-mark { background: linear-gradient(135deg, #46dfff, #9e38ff); color: #04121c; border-radius: 8px; box-shadow: 0 0 18px rgba(70,223,255,0.35); }
.nav-item { color: #8ea3c0; border-radius: 8px; box-shadow: none; position: relative; transition: color .18s ease, background .18s ease; }
.nav-item:hover { background: rgba(70,223,255,0.08); color: #e8f0fb; }
.nav-item.active { background: linear-gradient(90deg, rgba(70,223,255,0.16), rgba(158,56,255,0.08)); color: #bdf1ff; box-shadow: inset 0 0 0 1px rgba(70,223,255,0.22); }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: linear-gradient(180deg, #46dfff, #9e38ff); box-shadow: 0 0 10px rgba(70,223,255,0.7); }
.nav-badge { background: linear-gradient(135deg, #46dfff, #9e38ff); color: #04121c; }
.user-avatar { background: rgba(70,223,255,0.14); color: #bdf1ff; box-shadow: inset 0 0 0 1px rgba(70,223,255,0.3); }
.workspace-header h1 { letter-spacing: -0.02em; }

/* 指标卡与状态 */
.metric-card { background: linear-gradient(160deg, rgba(24,38,66,0.85), rgba(13,21,38,0.92)); border: 1px solid #1e2b45; border-radius: 12px; box-shadow: none; position: relative; overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.metric-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 120px at 12% 0%, rgba(70,223,255,0.10), transparent 65%); pointer-events: none; }
.metric-card strong { font-size: 26px; letter-spacing: -0.02em; color: #e8f0fb; }
.metric-card::before, .metric-card:hover::before { display: none; }
.metric-card:hover { border-color: rgba(70,223,255,0.38); box-shadow: 0 10px 30px rgba(2,6,14,0.5), 0 0 18px rgba(70,223,255,0.10); transform: translateY(-2px); }
.live-status { color: #45e0a0; background: rgba(69,224,160,0.10); border: 1px solid rgba(69,224,160,0.30); border-radius: 999px; }
.live-status i { background: #45e0a0; box-shadow: 0 0 8px rgba(69,224,160,0.8); }
.status-dot.online { background: #45e0a0; box-shadow: 0 0 6px rgba(69,224,160,0.7); }
.status-dot.idle { background: #f5b53f; box-shadow: 0 0 6px rgba(245,181,63,0.6); }
.status-dot.offline { background: #5d7396; }
.status-chip { background: rgba(20,32,58,0.8); border: 1px solid #24365a; border-radius: 999px; color: #8ea3c0; transition: all .18s ease; }
.status-chip b { color: #dbe7f8; }
.status-chip:hover { border-color: #33507f; color: #dbe7f8; }
.status-chip.active { background: linear-gradient(135deg, rgba(70,223,255,0.2), rgba(158,56,255,0.16)); border-color: rgba(70,223,255,0.45); color: #bdf1ff; box-shadow: 0 0 14px rgba(70,223,255,0.15); }
.status-chip.active b { color: #e8f0fb; }
.status-chip.chip-online.active { background: rgba(69,224,160,0.16); border-color: rgba(69,224,160,0.45); color: #9ff5cf; }
.status-chip.chip-idle.active { background: rgba(245,181,63,0.14); border-color: rgba(245,181,63,0.45); color: #ffd9a0; }
.status-chip.chip-offline.active { background: rgba(93,115,150,0.22); border-color: rgba(93,115,150,0.55); color: #b7c6dd; }
.view-toggle { background: rgba(13,21,38,0.9); border: 1px solid #1e2b45; border-radius: 8px; }
.view-toggle button.active { background: rgba(70,223,255,0.14); color: #bdf1ff; box-shadow: var(--ring); }
.pager-bar button.active { background: linear-gradient(135deg, #1e9dd8, #46dfff); color: #04121c; border-color: transparent; }

/* 会话工作台 */
.customer-avatar, .agent-avatar { background: rgba(70,223,255,0.12); color: #bdf1ff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(70,223,255,0.25); }
.conversation-item.active { background: linear-gradient(90deg, rgba(70,223,255,0.14), rgba(158,56,255,0.07)); box-shadow: inset 2px 0 0 #46dfff; }
.conversation-row:hover .conversation-item { background: rgba(28,44,76,0.6); }
.mode-badge { border-radius: 999px; font-size: 11px; font-weight: 600; padding: 2px 8px; }
.mode-badge.auto, .mode-toggle.auto { background: rgba(69,224,160,0.13); color: #45e0a0; }
.mode-badge.manual, .mode-toggle.manual { background: rgba(245,181,63,0.13); color: #f5b53f; }
.segmented { background: rgba(13,21,38,0.9); border: 1px solid #1e2b45; border-radius: 8px; padding: 2px; gap: 2px; }
.segmented button { border-radius: 6px; color: #8ea3c0; transition: all .18s ease; }
.segmented button.active { background: rgba(70,223,255,0.16); color: #bdf1ff; box-shadow: var(--ring); }

/* 聊天气泡：己方霓虹玻璃、客户暗色描边 */
.message.customer .bubble { background: rgba(24,38,66,0.85); color: #e8f0fb; border: 1px solid #24365a; border-radius: 14px 14px 14px 4px; box-shadow: none; }
.message.ai .bubble, .message.human .bubble { background: linear-gradient(135deg, rgba(30,157,216,0.22), rgba(158,56,255,0.20)); color: #f2fbff; border: 1px solid rgba(70,223,255,0.30); border-radius: 14px 14px 4px 14px; box-shadow: 0 4px 18px rgba(70,223,255,0.08); }
.message.system .bubble { background: rgba(13,21,38,0.7); color: #8ea3c0; border: 1px dashed #2c3d5e; }
.message.ai .message-meta, .message.human .message-meta { color: rgba(70,223,255,0.65); }
.message.customer .message-meta, .message.system .message-meta { color: #8ea3c0; }
.translate-button { color: #46dfff; }
.translation { border-left: 2px solid rgba(70,223,255,0.35); }
.message.ai .translation, .message.human .translation { color: rgba(242,251,255,0.82); border-left-color: rgba(70,223,255,0.5); }

/* 输入区 */
.composer textarea, .composer .button { box-shadow: none; }
.composer textarea { background: rgba(13,21,38,0.9); border: 1px solid #24365a; border-radius: 10px; color: #e8f0fb; }
.composer textarea:focus { border-color: rgba(70,223,255,0.55); box-shadow: var(--focus-ring); }
.voice-record-bar { background: linear-gradient(90deg, rgba(30,157,216,0.25), rgba(158,56,255,0.25)); color: #f2fbff; }
.rec-dot { background: #ff5d5d; box-shadow: 0 0 8px rgba(255,93,93,0.8); }

/* 登录页 */
.login-screen { background: #070b14; }
.login-card { background: rgba(15,23,41,0.88); border: 1px solid rgba(70,223,255,0.22); border-radius: 16px; box-shadow: 0 24px 70px rgba(2,6,14,0.6), 0 0 40px rgba(70,223,255,0.07); backdrop-filter: blur(14px); }
.login-mark { background: linear-gradient(135deg, #46dfff, #9e38ff); color: #04121c; border-radius: 10px; box-shadow: 0 0 24px rgba(70,223,255,0.4); }

/* 模态与浮层 */
.modal-backdrop { background: rgba(4, 8, 16, 0.62); backdrop-filter: blur(3px); }
.modal { background: linear-gradient(170deg, #10192c, #0b1322); border: 1px solid #24365a; border-radius: 14px; box-shadow: 0 30px 80px rgba(2,6,14,0.7), 0 0 0 1px rgba(70,223,255,0.10), 0 0 44px rgba(70,223,255,0.06); }
.modal-header { border-bottom: 1px solid #1e2b45; }

/* 输入控件 */
input, select, textarea { background: rgba(13,21,38,0.9); color: #e8f0fb; border: 1px solid #24365a; border-radius: 8px; transition: border-color .18s ease, box-shadow .18s ease; }
input:focus, select:focus, textarea:focus { border-color: rgba(70,223,255,0.55); box-shadow: var(--focus-ring); outline: none; }
input::placeholder, textarea::placeholder { color: #5a7096; }
.field-hint { color: #8ea3c0; }

/* 账号卡/行 */
.account-card { background: linear-gradient(160deg, rgba(24,38,66,0.7), rgba(13,21,38,0.9)); border: 1px solid #1e2b45; border-radius: 12px; box-shadow: none; transition: border-color .2s ease, box-shadow .2s ease; }
.account-card::before { display: none; }
.account-card:hover { border-color: rgba(70,223,255,0.35); box-shadow: 0 8px 26px rgba(2,6,14,0.5), 0 0 16px rgba(70,223,255,0.08); }
.account-card-meta b { color: #e8f0fb; }

/* 语音按钮 */
.voice-button.recording { background: #ff5d5d; color: #fff; border-color: #ff5d5d; box-shadow: 0 0 16px rgba(255,93,93,0.45); }

/* ============ 运营总览 · 账号区密集化重构 ============ */
.section-header { min-height: 56px; padding: 10px 16px; }
.section-header h2 { font-size: 15px; letter-spacing: -0.01em; }
.section-header p { font-size: 12.5px; }
.dashboard-toolbar { margin: 10px 16px 8px; gap: 8px; }
.status-chips { gap: 6px; }
.status-chip { padding: 4px 11px; font-size: 12px; gap: 6px; }
.status-chip i.status-dot { width: 7px; height: 7px; }
.toolbar-right, .dashboard-toolbar .view-toggle { gap: 4px; }
.view-toggle button { padding: 4px 10px; font-size: 12px; }

/* —— 列表视图：单行密表（只作用于账户页表格，别碰会话工作台左栏） —— */
#dashboardAccountGrid.account-list {
  display: block;
  padding: 0;
  margin: 0 16px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.account-row {
  grid-template-columns: minmax(96px, 0.9fr) minmax(200px, 1.7fr) minmax(230px, 1.5fr) minmax(150px, 1.1fr) 96px auto;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  transition: background 0.12s ease;
}
#dashboardAccountGrid .account-row:last-child { border-bottom: 0; }
#dashboardAccountGrid .account-row:hover { background: rgba(70,223,255,0.06); }
.account-row:has(.row-check) { grid-template-columns: 30px minmax(96px, 0.9fr) minmax(200px, 1.7fr) minmax(230px, 1.5fr) minmax(150px, 1.1fr) 96px auto; }
.row-check { padding: 0; }
.row-status { gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.row-status .status-dot { width: 8px; height: 8px; }
.row-identity { display: block; min-width: 0; }
.row-identity strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-identity small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-metrics { display: flex; gap: 12px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.row-metrics .has-unread { color: #b45309; font-weight: 600; }
.row-owner, .row-checktime { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .mode-toggle, .row-actions .test-button, .row-actions button { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.row-actions .mode-toggle.auto { background: #e6f4ee; color: #12805c; border-color: transparent; }
.row-actions .mode-toggle.manual { background: rgba(245,181,63,0.14); color: #f5b53f; border-color: transparent; }
.row-actions .test-button { background: transparent; color: var(--muted); border-color: transparent; }
.row-actions .test-button:hover { background: rgba(70,223,255,0.08); color: var(--text); }
.row-actions [data-open-account] { background: linear-gradient(135deg,#1e9dd8,#46dfff); color: #04121c; border-color: transparent; font-weight: 500; }
.row-actions [data-open-account]:hover { background: #111; }

/* —— 卡片视图：三层压扁 —— */
.account-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; padding: 12px 16px 16px; }
.account-card { padding: 12px 14px; border-radius: 10px; }
.account-card-top { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; }
.tg-avatar { width: 34px; height: 34px; font-size: 12px; border-radius: 8px; background: rgba(70,223,255,0.12); color: #bdf1ff; font-weight: 700; }
.account-card-top strong { font-size: 13.5px; }
.account-card-top small { font-size: 11.5px; color: var(--muted); }
.account-card-top .status-chip { padding: 3px 9px; font-size: 11.5px; gap: 5px; }
.account-card-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; padding-top: 10px; }
.account-card-stats div { display: flex; align-items: baseline; gap: 5px; }
.account-card-stats span { font-size: 11.5px; color: var(--muted); }
.account-card-stats b { display: inline; margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.account-card-stats .fans-total { font-style: normal; font-size: 11px; color: var(--muted); }
.account-card-footer { margin-top: 10px; gap: 8px; min-width: 0; }
.account-card-footer > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.footer-actions { gap: 5px; }
.footer-actions button { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.footer-actions .mode-toggle.auto { background: #e6f4ee; color: #12805c; border-color: transparent; }
.footer-actions .mode-toggle.manual { background: rgba(245,181,63,0.14); color: #f5b53f; border-color: transparent; }
.footer-actions .test-button { background: rgba(13,21,38,0.9); color: var(--muted); border-color: var(--line); }
.footer-actions [data-open-account] { background: linear-gradient(135deg,#1e9dd8,#46dfff); color: #04121c; border-color: transparent; font-weight: 500; }
.footer-actions [data-open-account]:hover { background: #111; }
.account-card-meta { display: flex; gap: 12px; margin-top: 9px; font-size: 11.5px; color: var(--muted); }
.account-card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card-meta b { color: var(--text); font-weight: 500; }

/* —— 密集化重构的小屏适配（须位于覆盖层之后） —— */
@media (max-width: 1100px) {
  .account-row,
  .account-row:has(.row-check) { grid-template-columns: minmax(96px, 0.9fr) minmax(0, 1.7fr) auto; }
  .account-row .row-metrics,
  .account-row .row-owner,
  .account-row .row-checktime { display: none; }
  .account-list { margin: 0 12px 12px; }
  .account-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}
@media (max-width: 560px) {
  .account-list { margin: 0 8px 8px; }
  .account-row { padding: 8px 10px; gap: 8px; }
  .row-actions .test-button { display: none; }
}

/* ===== Telegram 账户页 & 运行态势（最终覆盖层） ===== */

/* —— 账户行：新增人设模板列 —— */
.account-row {
  grid-template-columns:
    minmax(96px, 0.9fr) minmax(190px, 1.5fr) minmax(170px, 1.2fr)
    minmax(210px, 1.4fr) minmax(140px, 1fr) 96px auto;
}
.account-row:has(.row-check) {
  grid-template-columns:
    30px minmax(96px, 0.9fr) minmax(190px, 1.5fr) minmax(170px, 1.2fr)
    minmax(210px, 1.4fr) minmax(140px, 1fr) 96px auto;
}
.row-template {
  min-width: 0;
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— 账户页工具条与检测反馈 —— */
.toolbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.check-summary { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.sum-ok { color: var(--success); font-weight: 500; }
.sum-bad { color: var(--danger); font-weight: 500; }
.info-banner.banner-ok { border-left-color: var(--success); background: #e6f4ee; color: #0d5c44; }
.info-banner.banner-warn { border-left-color: var(--warning); background: rgba(245,181,63,0.10); color: #ffd9a0; }
.info-banner .banner-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.info-banner ul { margin: 6px 0 0; padding-left: 18px; }
.info-banner li + li { margin-top: 2px; }

/* —— 运行态势 —— */
.situation-overview { padding: 14px 16px 16px; display: grid; gap: 14px; }
.situation-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; }
.situation-panel { border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; background: rgba(15,23,41,0.85); display: grid; gap: 10px; align-content: start; }
.situation-panel header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.situation-panel header span { font-size: 12.5px; font-weight: 600; color: var(--text); }
.situation-panel header b { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.situation-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); gap: 2px; }
.situation-bar .seg-ok { background: var(--success); }
.situation-bar .seg-warn { background: var(--warning); }
.situation-bar .seg-idle { background: #c9ccd4; }
.situation-bar .seg-in { background: #46dfff; }
.situation-bar .seg-ai { background: var(--telegram); }
.situation-bar .seg-human { background: var(--warning); }
.situation-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.situation-legend b { color: var(--text); font-weight: 600; }
.situation-legend .legend-side { margin-left: auto; font-size: 11.5px; }
.situation-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.situation-kpis span { flex: 1 1 150px; display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 12px; color: var(--muted); background: rgba(13,21,38,0.85); }
.situation-kpis b { font-size: 15px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.situation-kpis .kp-warn { color: var(--danger); }

@media (max-width: 1100px) {
  .situation-grid { grid-template-columns: 1fr; }
  .account-row { grid-template-columns: minmax(96px, 0.9fr) minmax(0, 1.5fr) minmax(110px, 1fr) auto; }
  .account-row:has(.row-check) { grid-template-columns: 30px minmax(96px, 0.9fr) minmax(0, 1.5fr) minmax(110px, 1fr) auto; }
  .account-row .row-template { display: none; }
}
/* ===== 账户页数据表格 v2（固定轨道，行行严格对齐） ===== */
#dashboardAccountGrid.account-list { padding: 0; display: block; }
.acct-head,
.acct-row {
  --acct-cols: 34px 104px minmax(110px, 1.1fr) minmax(110px, 1.2fr) 52px 52px minmax(96px, 1fr) 118px minmax(140px, 1.3fr) 84px 150px;
  display: grid;
  grid-template-columns: var(--acct-cols);
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}
.acct-head:has(.ac-check),
.acct-row:has(.ac-check) {
  --acct-cols: 28px 34px 104px minmax(110px, 1.1fr) minmax(110px, 1.2fr) 52px 52px minmax(96px, 1fr) 118px minmax(140px, 1.3fr) 84px 150px;
}
.acct-head {
  border-bottom: 1px solid var(--line);
  background: rgba(13,21,38,0.95);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  border-radius: 10px 10px 0 0;
}
.acct-row {
  border-bottom: 1px solid var(--line);
  min-height: 46px;
  transition: background 0.12s ease;
}
.acct-row:nth-child(even) { background: rgba(255,255,255,0.018); }
.acct-row:last-child { border-bottom: 0; border-radius: 0 0 10px 10px; }
.acct-row:hover { background: rgba(70,223,255,0.055); }
.ac-c { min-width: 0; }
.ac-check { display: inline-flex; align-items: center; }
.ac-check input { accent-color: #46dfff; margin: 0; }
.ac-phone { font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-handle { display: grid; gap: 1px; }
.ac-handle code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-handle small { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-name strong { font-size: 12.5px; font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-conv, .ac-unread { text-align: center; }
.ac-conv b, .ac-unread b { font-size: 12.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ac-conv small { display: block; font-size: 9.5px; font-weight: 400; color: var(--muted); margin-top: 1px; letter-spacing: 0; }
.ac-unread.has-unread b { background: rgba(255,122,122,0.16); color: var(--danger); padding: 1px 7px; border-radius: 9px; }
.ac-owner { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-status { display: grid; gap: 1px; }
.ac-status .st-line { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); white-space: nowrap; }
.ac-status small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ac-persona { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.persona-name-btn { font: inherit; font-size: 12px; color: var(--text); background: none; border: 1px dashed transparent; border-radius: 6px; padding: 2px 6px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-policy-btn { font: inherit; font-size: 10px; letter-spacing: .5px; margin-left: 4px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--border, #2b3a52); background: transparent; color: var(--muted, #8ea3c0); cursor: pointer; vertical-align: middle; }
.lang-policy-btn.english_only { border-color: #4a90d9; color: #7fb6ee; }
.lang-policy-btn:hover { border-color: var(--accent, #5aa0ff); color: var(--accent, #5aa0ff); }.persona-name-btn:hover { border-color: var(--border); color: var(--accent); background: rgba(255,255,255,0.04); }
.ac-mode .mode-toggle { width: 100%; }
.ac-actions { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.acct-head .ac-actions { text-align: right; }
.ac-actions .test-button { height: 26px; padding: 0 9px; font-size: 11.5px; background: rgba(13,21,38,0.9); color: var(--muted); border-color: var(--line); border-radius: 6px; cursor: pointer; }
.ac-actions .test-button:disabled { opacity: 0.55; cursor: default; }
.ac-actions .enter-button { height: 26px; padding: 0 10px; font-size: 11.5px; font-weight: 500; background: linear-gradient(135deg,#1e9dd8,#46dfff); color: #04121c; border: 1px solid transparent; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ac-actions .enter-button:hover { background: linear-gradient(135deg,#22b8e0,#46dfff); }
.ac-actions .share-button { height: 26px; padding: 0 9px; font-size: 11.5px; background: rgba(13,21,38,0.9); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ac-actions .share-button:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.ac-actions .share-button:disabled { opacity: 0.55; cursor: default; }



/* ===== 账户形象弹窗 ===== */
.refphoto-body { padding: 4px 22px 20px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.refphoto-preview {
  width: 180px; height: 240px; border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 18, 32, 0.7); border: 1px dashed rgba(96, 170, 220, 0.4);
  color: var(--muted); font-size: 12px;
}
.refphoto-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.refphoto-hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; text-align: center; max-width: 420px; }
.refphoto-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ===== 账户形象底图(自拍人脸模板) ===== */
.ac-photo { position: relative; display: flex; align-items: center; justify-content: center; }
.ac-refphoto {
  width: 30px; height: 30px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed rgba(96, 170, 220, 0.5);
  background: rgba(12, 22, 40, 0.72); color: rgba(126, 180, 214, 0.9);
  cursor: pointer; overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.ac-refphoto:hover { border-color: #46dfff; transform: scale(1.06); }
.ac-refphoto.has { border-style: solid; border-color: rgba(94, 200, 255, 0.55); }
.ac-refphoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-refphoto-empty { font-size: 14px; line-height: 1; }
.ac-refphoto-clear {
  position: absolute; top: -5px; right: -5px; width: 15px; height: 15px;
  border: none; border-radius: 50%; background: rgba(255, 92, 74, 0.9); color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer; opacity: 0;
  transition: opacity 0.15s ease;
}
.acct-row:hover .ac-refphoto-clear { opacity: 1; }

@media (max-width: 1280px) {
  .acct-head, .acct-row { --acct-cols: 34px 104px minmax(100px, 1fr) minmax(100px, 1.1fr) 52px 52px 118px minmax(120px, 1.2fr) 84px 150px; }
  .acct-head:has(.ac-check), .acct-row:has(.ac-check) { --acct-cols: 28px 34px 104px minmax(100px, 1fr) minmax(100px, 1.1fr) 52px 52px 118px minmax(120px, 1.2fr) 84px 150px; }
  .ac-owner { display: none; }
}
@media (max-width: 1080px) {
  .acct-head, .acct-row { --acct-cols: 34px 104px minmax(90px, 1fr) minmax(90px, 1.1fr) 52px 118px 84px 150px; }
  .acct-head:has(.ac-check), .acct-row:has(.ac-check) { --acct-cols: 28px 34px 104px minmax(90px, 1fr) minmax(90px, 1.1fr) 52px 118px 84px 150px; }
  .ac-conv, .ac-persona { display: none; }
}
@media (max-width: 860px) {
  .acct-head { display: none; }
  .acct-row { --acct-cols: 34px minmax(0, 1.4fr) 52px 112px 78px 140px; gap: 8px; padding: 10px 12px; }
  .acct-row:has(.ac-check) { --acct-cols: 28px 34px minmax(0, 1.4fr) 52px 112px 78px 140px; }
  .ac-phone, .ac-handle { display: none; }
}
@media (max-width: 560px) {
  .ac-actions .test-button { display: none; }
  .acct-row { padding: 9px 10px; }
}

/* ===== AI 批量起名弹窗 ===== */
.auto-name-body { padding: 0 20px 4px; }
.auto-name-hint { font-size: 12px; color: var(--muted); margin: 0 0 10px; line-height: 1.55; }
.auto-name-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.auto-name-status { font-size: 12px; color: var(--muted); }
.auto-name-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 46vh;
  overflow: auto;
  background: rgba(13,21,38,0.9);
}
.auto-name-empty { padding: 22px 14px; text-align: center; font-size: 12.5px; color: var(--muted); }
.auto-name-targets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.auto-name-targets span { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; color: var(--text); background: rgba(70,223,255,0.08); }
.auto-name-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 10px; }
.auto-name-hint .em { color: var(--accent); font-weight: 600; }
.an-photo { display: grid; place-items: center; }
.an-photo input { accent-color: #46dfff; margin: 0; }
.auto-name-head,
.auto-name-row {
  display: grid;
  grid-template-columns: 24px minmax(64px, 0.85fr) minmax(86px, 1.05fr) 10px minmax(86px, 1fr) 40px minmax(86px, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
}
.auto-name-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(13,21,38,0.95);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.auto-name-row { border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 12.5px; }
.auto-name-row:last-child { border-bottom: 0; }
.auto-name-row input[type="checkbox"] { accent-color: #46dfff; margin: 0; }
.auto-name-row .an-name,
.auto-name-row .an-user {
  height: 28px;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12.5px;
  background: rgba(13,21,38,0.9);
  color: var(--text);
}
.auto-name-row .an-name:focus,
.auto-name-row .an-user:focus { outline: none; border-color: #46dfff; }
.auto-name-row .an-name:disabled,
.auto-name-row .an-user:disabled { background: rgba(20,32,58,0.9); color: var(--muted); }
.an-cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.an-at { color: var(--muted); }
.an-status { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-status.ok { color: var(--success); }
.an-status.error { color: var(--danger); }
.auto-name-footer { display: flex; align-items: center; gap: 12px; padding: 12px 20px 16px; }

/* ==================== 场景图库 ==================== */
.scene-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.scene-account-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scene-account-label span {
  font-size: 13px;
  color: var(--muted, #8ea3c0);
}
.scene-usage {
  font-size: 12px;
  color: var(--muted, #8ea3c0);
}
.scene-config-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.scene-config-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted, #8ea3c0);
}
.scene-config-row input[type="number"] {
  width: 90px;
}
.scene-switch {
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
}
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.scene-label-card {
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 10px;
  padding: 10px;
}
.scene-label-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.scene-label-head span {
  font-size: 11px;
  color: var(--muted, #8ea3c0);
}
.scene-label-images {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.scene-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 72px;
}
.scene-thumb img {
  width: 72px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.scene-thumb-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}
.scene-shared-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(90, 160, 255, 0.85);
  color: #fff;
  letter-spacing: 0.5px;
}
.scene-thumb { position: relative; }
.scene-thumb-actions button {
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
}
.scene-empty {
  color: var(--muted, #8ea3c0);
  font-size: 13px;
}
.scene-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted, #8ea3c0);
}
#scenePresetSelect {
  max-width: 380px;
}

/* —— 长期记忆面板 —— */
.memory-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.memory-group { display: flex; flex-direction: column; gap: 4px; }
.memory-group-title { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .75; margin-top: 4px; }
.memory-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2, rgba(127,127,127,.08)); font-size: 13px; }
.memory-row.done, .memory-row.expired { opacity: .55; }
.memory-chip { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(96,165,250,.18); color: #60a5fa; }
.memory-chip.promise { background: rgba(251,191,36,.18); color: #fbbf24; }
.memory-chip.preference { background: rgba(52,211,153,.18); color: #34d399; }
.memory-chip.moment { background: rgba(232,121,249,.18); color: #e879f9; }
.memory-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.memory-status { font-style: normal; margin-left: 6px; font-size: 11px; opacity: .8; }
.memory-age { flex: none; opacity: .6; }
.memory-del { flex: none; border: 0; background: transparent; color: #f87171; font-size: 16px; cursor: pointer; line-height: 1; padding: 2px 4px; }
.memory-inactive summary { cursor: pointer; font-size: 12px; opacity: .65; padding: 4px 0; }
.memory-inactive .memory-row { margin-top: 4px; }
.memory-add-row { display: flex; gap: 8px; margin: 10px 0 4px; }
.memory-add-row select { flex: none; width: 88px; }
.memory-add-row input { flex: 1; min-width: 0; }

/* 模型消耗与余额 */
.usage-overview { padding: 14px 16px 16px; display: grid; gap: 14px; }
.balance-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.balance-card { border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; background: rgba(15,23,41,0.85); display: grid; gap: 4px; }
.balance-card h4 { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.balance-card .balance-value { margin: 0; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.balance-card small { color: var(--muted); font-size: 11.5px; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.usage-table th, .usage-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.usage-table th { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.usage-table td { font-variant-numeric: tabular-nums; }
.usage-week { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.usage-week strong { color: var(--text); }

.notify-enable-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.notify-enable-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary, #4f7cff);
}

.notify-card-action { margin-top: 8px; }
.notify-button {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.notify-button:hover { color: var(--text); border-color: var(--muted); }

/* ============ 大脑态势页（Neural Core 态势图） ============ */
.brain-page {
  padding: 0;
  overflow: hidden;
}
.brain-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background:
    radial-gradient(1200px 620px at 50% 118%, rgba(70, 223, 255, 0.10), transparent 62%),
    radial-gradient(900px 480px at 50% -8%, rgba(158, 56, 255, 0.10), transparent 60%),
    radial-gradient(700px 420px at 12% 30%, rgba(255, 207, 131, 0.05), transparent 65%),
    #04070d;
}
#brainCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#brainCanvas:active { cursor: grabbing; }
.brain-hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  pointer-events: none;
  gap: 12px;
}
.brain-hud-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brain-id {
  pointer-events: auto;
  background: rgba(8, 12, 22, 0.58);
  border: 1px solid rgba(120, 180, 255, 0.14);
  border-radius: 14px;
  padding: 12px 16px 10px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  min-width: 264px;
}
.brain-eyebrow {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: rgba(70, 223, 255, 0.75);
  margin-bottom: 4px;
}
.brain-title {
  margin: 0 0 8px;
  font-size: 19px;
  letter-spacing: 0.06em;
  background: linear-gradient(92deg, #ffcf83 8%, #ffd9a0 34%, #dab5ff 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brain-statusline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(196, 216, 240, 0.86);
  margin-bottom: 8px;
}
.brain-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #46dfff;
  box-shadow: 0 0 10px rgba(70, 223, 255, 0.9);
  animation: brainPulseDot 2.4s ease-in-out infinite;
}
.brain-dot.warn { background: #ffb43c; box-shadow: 0 0 10px rgba(255, 180, 60, 0.9); animation: none; }
.brain-dot.err { background: #ff6b81; box-shadow: 0 0 10px rgba(255, 107, 129, 0.9); animation: none; }
.brain-dot.busy { background: #7dffd4; box-shadow: 0 0 10px rgba(125, 255, 212, 0.9); animation: brainBusyDot 1.1s ease-in-out infinite; }
@keyframes brainBusyDot {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.45); opacity: 1; }
}
@keyframes brainPulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.brain-clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: rgba(140, 170, 205, 0.7);
  font-size: 11px;
  letter-spacing: 0.08em;
}
#brainWave {
  display: block;
  width: 100%;
  height: 30px;
}
.brain-kpis {
  pointer-events: auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 8px;
  flex-wrap: wrap;
}
.brain-kpi {
  background: rgba(8, 12, 22, 0.58);
  border: 1px solid rgba(120, 180, 255, 0.14);
  border-radius: 12px;
  padding: 10px 12px 8px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-width: 96px;
}
.brain-kpi-num {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: #e8f2ff;
  transition: transform 0.18s ease;
}
.brain-kpi.bump .brain-kpi-num { transform: scale(1.16); }
.brain-kpi-label {
  margin-top: 3px;
  font-size: 11px;
  color: rgba(170, 196, 224, 0.78);
  white-space: nowrap;
}
.brain-kpi-bar {
  margin-top: 6px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.brain-kpi-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.brain-log-panel {
  pointer-events: auto;
  position: absolute;
  left: 18px;
  bottom: 16px;
  width: min(378px, 42vw);
  max-height: 44vh;
  display: flex;
  flex-direction: column;
  background: rgba(8, 12, 22, 0.58);
  border: 1px solid rgba(120, 180, 255, 0.14);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.brain-log-head, .brain-legend-head {
  padding: 9px 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(70, 223, 255, 0.8);
  border-bottom: 1px solid rgba(120, 180, 255, 0.1);
  flex-shrink: 0;
}
.brain-log {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
  overflow-y: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.5;
}
.brain-log li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2.5px 4px;
  border-radius: 6px;
  color: rgba(206, 224, 244, 0.88);
  animation: brainRowIn 0.32s ease both;
}
.brain-log li:hover { background: rgba(70, 223, 255, 0.07); }
@keyframes brainRowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}
.brain-log-time {
  color: rgba(130, 160, 195, 0.62);
  font-size: 10.5px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.brain-log-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
  box-shadow: 0 0 7px currentColor;
  background: currentColor;
}
.brain-log-what { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.brain-side-panel {
  pointer-events: auto;
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 218px;
  background: rgba(8, 12, 22, 0.58);
  border: 1px solid rgba(120, 180, 255, 0.14);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.brain-legend {
  list-style: none;
  margin: 0;
  padding: 8px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.brain-legend li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: rgba(206, 224, 244, 0.9);
}
.brain-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 9px currentColor;
  background: currentColor;
  flex-shrink: 0;
}
.brain-legend-n {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: rgba(150, 180, 210, 0.72);
}
.brain-controls {
  display: flex;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(120, 180, 255, 0.1);
  flex-wrap: wrap;
}
.brain-btn {
  flex: 1;
  min-width: 44px;
  background: rgba(70, 223, 255, 0.08);
  border: 1px solid rgba(70, 223, 255, 0.22);
  color: #9fe6ff;
  border-radius: 8px;
  font-size: 11.5px;
  padding: 5px 7px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.brain-btn:hover { background: rgba(70, 223, 255, 0.16); border-color: rgba(70, 223, 255, 0.45); }
.brain-btn.on { background: rgba(255, 207, 131, 0.14); border-color: rgba(255, 207, 131, 0.5); color: #ffd9a0; }
.brain-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(180, 205, 230, 0.85);
  font-size: 14px;
  text-align: center;
  padding: 24px;
}
.brain-fallback .brain-fallback-tag {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: rgba(70, 223, 255, 0.65);
}
@media (max-width: 960px) {
  .brain-kpis { grid-template-columns: repeat(3, 1fr); }
  .brain-log-panel { width: min(378px, 62vw); }
  .brain-side-panel { width: 188px; }
}
@media (prefers-reduced-motion: reduce) {
  .brain-dot { animation: none; }
  .brain-dot.busy { animation: none; }
  .brain-log li { animation: none; }
}

/* ---- 回放控制条 + 图例悬停高亮 ---- */
.brain-replay {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(10, 14, 26, 0.72);
  border: 1px solid rgba(70, 223, 255, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  z-index: 5;
}
.brain-replay-time {
  font-size: 11px;
  font-family: var(--mono, monospace);
  color: #a4edff;
  white-space: nowrap;
}
.brain-replay input[type="range"] {
  width: 220px;
  accent-color: #46dfff;
  cursor: pointer;
}
.brain-replay .brain-btn { padding: 4px 10px; font-size: 11px; }
.brain-legend li { cursor: pointer; transition: opacity 0.18s ease; }
.brain-legend li.dim { opacity: 0.35; }
@media (max-width: 960px) {
  .brain-replay { bottom: 10px; }
  .brain-replay input[type="range"] { width: 130px; }
}

/* ================= 极光氛围层(全局增强 · 不触碰 .brain-*) ================= */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 560px at 8% -10%, rgba(70, 223, 255, 0.10), transparent 60%),
    radial-gradient(900px 520px at 96% 6%, rgba(158, 56, 255, 0.09), transparent 58%),
    radial-gradient(820px 460px at 50% 112%, rgba(255, 207, 131, 0.05), transparent 62%);
  animation: aurora-drift 26s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(112, 160, 220, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 160, 220, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(1200px 800px at 50% 40%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(1200px 800px at 50% 40%, #000 30%, transparent 78%);
}
@keyframes aurora-drift {
  0% { background-position: 0% 0%, 100% 0%, 50% 100%; }
  50% { background-position: 6% 4%, 92% 2%, 44% 96%; }
  100% { background-position: -4% 2%, 104% -2%, 56% 104%; }
}

.app-sidebar { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.workspace-header {
  background: linear-gradient(90deg, rgba(13,21,38,0.72), rgba(13,21,38,0.30));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(70,223,255,0.14);
}
.eyebrow { color: #46dfff; letter-spacing: 0.22em; }
.page { animation: page-rise 0.38s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
@keyframes page-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.metric-card strong {
  background: linear-gradient(100deg, #e8f0fb 20%, #46dfff 75%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #46dfff;
}
.live-status i { animation: live-pulse 2.2s ease-in-out infinite; }
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(69,224,160,0.45); }
  50% { box-shadow: 0 0 0 5px rgba(69,224,160,0.12); }
}

.login-card { position: relative; overflow: hidden; }
.login-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--spin, 0deg), rgba(70,223,255,0.55), rgba(158,56,255,0.45), rgba(255,207,131,0.35), rgba(70,223,255,0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: border-spin 7s linear infinite;
}
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes border-spin { to { --spin: 360deg; } }
.login-screen { position: relative; }
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 18% 22%, rgba(70,223,255,0.12), transparent 62%),
    radial-gradient(640px 400px at 82% 74%, rgba(158,56,255,0.12), transparent 60%);
}
.login-mark { animation: mark-pulse 3.4s ease-in-out infinite; }
@keyframes mark-pulse {
  0%, 100% { box-shadow: 0 0 18px rgba(70,223,255,0.35); }
  50% { box-shadow: 0 0 34px rgba(158,56,255,0.45); }
}

.modal { animation: modal-pop 0.28s cubic-bezier(0.22, 0.9, 0.3, 1.2) both; }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.button.primary { position: relative; overflow: hidden; }
.button.primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-18deg);
  transition: left 0.45s ease;
}
.button.primary:hover:not(:disabled)::after { left: 120%; }
.nav-item, .status-chip, .metric-card, .account-card, .button { will-change: auto; }

.acct-row { transition: background 0.15s ease, box-shadow 0.15s ease; }
.acct-row:hover { box-shadow: inset 2px 0 0 rgba(70,223,255,0.55); }

@media (prefers-reduced-motion: reduce) {
  body::before, .live-status i, .login-mark, .login-card::before, .page { animation: none; }
}

/* ---------- 可读性修补:按钮文字继承 + 会话名单色 ---------- */
button { color: inherit; }
.conversation-copy strong { color: var(--text); font-weight: 650; }
.conversation-copy strong, .conversation-copy span { text-shadow: 0 1px 2px rgba(2, 6, 14, 0.4); }
.conversation-side time { color: var(--muted); }
.chat-header h2 { color: var(--text); }

/* ---------- 滚动修补 v20261115: 账户页可滚动 + 会话工作台左右栏恢复滚动 ---------- */
.accounts-page { overflow-y: auto !important; overflow-x: hidden; }
#accountList.account-list,
#conversationList.conversation-list {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#accountList.account-list { display: flex; flex-direction: column; gap: 6px; }
.inbox-layout { min-height: 0; }
.inbox-page { min-height: 0; }
