﻿:root {
  --page-bg: #efeded;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --panel-soft: rgba(248, 250, 252, 0.82);
  --panel-hover: rgba(47, 143, 255, 0.06);
  --line: rgba(49, 65, 85, 0.08);
  --line-strong: rgba(47, 143, 255, 0.2);
  --text: #344054;
  --text-soft: #596a80;
  --muted: #91a1b5;
  --blue: #2f8fff;
  --blue-hover: #227fe8;
  --blue-soft: #edf6ff;
  --green: #25a978;
  --green-soft: #e8f7f0;
  --red: #df5148;
  --red-soft: #fff2f1;
  --amber: #d88a18;
  --amber-soft: #fff7e8;
  --shadow: 0 16px 42px rgba(31, 41, 55, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --shadow-soft: 0 10px 24px rgba(31, 41, 55, 0.055), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --radius: 14px;
  --card-radius: 10px;
  --sidebar-width: 380px;
  --workspace-list-width: 320px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-width: 320px;
  color: var(--text);
  background: var(--page-bg);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  overflow: hidden;
}

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

::-webkit-scrollbar-track {
  background: rgba(26, 32, 44, 0.035);
}

::-webkit-scrollbar-thumb {
  background: rgba(74, 85, 104, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(47, 143, 255, 0.34);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  height: 100dvh;
  padding: 14px;
}

.sidebar,
.main,
.card,
.list-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
}

.sidebar,
.main {
  min-height: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 60px;
  padding: 6px 8px 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #ffffff;
  background: #2f8fff;
  border-radius: 10px;
  font-size: 19px;
}

.brand strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.25;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.brand-logout {
  flex: 0 0 auto;
  min-height: 32px;
  margin-left: auto;
  padding: 0 12px;
}

.nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  margin-inline: -12px;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 46px;
  padding: 0 26px 0 30px;
  color: #4c5c72;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  text-align: left;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

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

.nav-item.active,
.nav-item.active:hover {
  color: var(--blue);
  background: transparent;
  border-left-color: var(--blue);
}

.nav-item:focus-visible {
  color: var(--blue);
  background: var(--blue-soft);
  outline: none;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.top-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.top-actions {
  flex: 0 0 auto;
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 20px;
  background: #f8f8fa;
  overflow: auto;
}

.grid,
.workspace-layout {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.grid.two,
.workspace-layout {
  grid-template-columns: var(--workspace-list-width) minmax(0, 1fr);
  align-items: stretch;
  min-height: 100%;
  background: #f8f8fa;
}

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

.grid > *,
.workspace-layout > * {
  min-width: 0;
}

.list-panel,
.card {
  min-width: 0;
  padding: 18px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-soft);
}

.list-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 981px) {
  body[data-view="accounts"] .content,
  body[data-view="nodes"] .content,
  body[data-view="billing"] .content {
    overflow: hidden;
  }

  body[data-view="accounts"] .content > .grid.two,
  body[data-view="nodes"] .content > .grid.two,
  body[data-view="billing"] .content > .grid.two {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body[data-view="accounts"] .content > .grid.two > .list-panel,
  body[data-view="nodes"] .content > .grid.two > .list-panel,
  body[data-view="billing"] .content > .grid.two > .list-panel {
    height: 100%;
    min-height: 0;
  }

  body[data-view="accounts"] .content > .grid.two > :last-child,
  body[data-view="nodes"] .content > .grid.two > :last-child,
  body[data-view="billing"] .content > .grid.two > :last-child {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body[data-view="accounts"] .content > .grid.two > .grid,
  body[data-view="billing"] .content > .grid.two > .grid {
    align-content: start;
  }
}

.card.soft {
  background: var(--panel-strong);
  border-color: var(--line);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 16px;
}

.panel-title > div,
.model-config-title {
  min-width: 0;
}

.panel-title h2,
.card h2,
.subhead {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.35;
}

.panel-title small,
.hint {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.panel-title-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.panel-title.wechat-panel-title {
  align-items: flex-start;
  display: flex !important;
  flex-direction: column;
}

.wechat-panel-title > div:first-child {
  min-width: 0;
}

.panel-title.wechat-panel-title .panel-title-actions {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
}

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

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  margin-bottom: 14px;
}

.field label,
.model-name-field > span {
  color: #8394aa;
  font-size: 13px;
  font-weight: 400;
}

.required-mark {
  color: var(--red);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

textarea {
  min-height: 92px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #b0bccb;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7fbcff;
  box-shadow: 0 0 0 3px rgba(47, 143, 255, 0.1);
}

input[readonly] {
  color: var(--text-soft);
  background: var(--panel-soft);
}

.muted-box,
.info-strip {
  min-height: 44px;
  padding: 11px 14px;
  color: #71839a;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.item-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.list-panel:not(.provider-sidebar) > .item-list {
  width: auto;
  margin-inline: -18px;
}

.list-item {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-height: 60px;
  padding: 11px 12px 11px 18px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  text-align: left;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.list-item:hover {
  background: var(--panel-hover);
}

.list-item.active,
.list-item.active:hover,
.list-item:focus-visible {
  color: var(--blue);
  background: transparent;
  border-left-color: var(--blue);
  outline: none;
}

.list-item strong {
  display: block;
  margin: 0 0 3px;
  overflow: hidden;
  color: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge,
.count-pill,
.provider-state,
.guard-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  color: #1f825f;
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.badge.off,
.provider-state.disabled {
  color: #a84e4e;
  background: var(--red-soft);
}

.count-pill {
  color: var(--blue);
  background: var(--blue-soft);
}

.button-row {
  justify-content: flex-end;
  margin-top: 14px;
}

.billing-recharge-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(240px, 1.3fr) auto;
  align-items: end;
  gap: 14px;
}

.billing-recharge-row .field {
  margin-bottom: 0;
}

.billing-recharge-row .primary-button {
  min-height: 42px;
  white-space: nowrap;
}

.token-ledger-header {
  align-items: flex-end;
}

.record-header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.token-ledger-date {
  display: grid;
  grid-template-columns: auto 150px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.token-ledger-date input {
  min-height: 40px;
}

.token-ledger-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.token-ledger-table {
  margin-top: 0;
}

.token-change.positive {
  color: var(--green);
}

.token-change.negative {
  color: var(--red);
}

.token-ledger-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.primary-button,
.ghost-button,
.danger-button,
.soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

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

.primary-button {
  min-width: 88px;
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.primary-button:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}

.danger-button {
  color: var(--red);
  background: rgba(255, 255, 255, 0.92);
  border-color: #f4c8c5;
}

.danger-button:hover {
  background: var(--red-soft);
  border-color: #eca8a4;
}

.soft-button {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.92);
  border-color: #bfddff;
}

.soft-button:hover {
  background: var(--blue-soft);
  border-color: #9acaff;
}

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

.check-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 48px;
  padding: 9px 12px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.check-card:hover {
  border-color: var(--line-strong);
}

.check-card.checked {
  color: #27775d;
  background: #f7fcfa;
  border-color: #b9e5d5;
}

.check-card > span:first-child {
  min-width: 0;
}

.check-card strong,
.check-card small {
  display: block;
  font-weight: 400;
}

.check-card strong {
  color: var(--text);
  font-size: 13px;
}

.check-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.check-card input[type="checkbox"],
.switch-label input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 28px;
  background: var(--red);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(35, 48, 68, 0.14);
  transition: background 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(35, 48, 68, 0.22);
  transition: transform 0.18s ease;
}

.check-card input[type="checkbox"]:checked + .switch,
.switch-label input[type="checkbox"]:checked + .switch {
  background: var(--green);
}

.check-card input[type="checkbox"]:checked + .switch::after,
.switch-label input[type="checkbox"]:checked + .switch::after {
  transform: translateX(26px);
}

.check-card input[type="checkbox"]:disabled + .switch,
.switch-label input[type="checkbox"]:disabled + .switch {
  background: #cbd4df;
  opacity: 0.72;
}

.section-gap {
  margin-top: 20px;
}

.config-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-title {
  align-items: flex-end;
  margin-bottom: 12px;
}

.section-title h2 {
  font-size: 15px;
}

.section-title small {
  margin-top: 4px;
}

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

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

.stat,
.stat-card {
  min-width: 0;
  padding: 15px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.stat span,
.stat-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.stat strong,
.stat-card strong {
  display: block;
  color: var(--text);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.1;
}

.stat-card.danger {
  background: #fff8f7;
  border-color: #f5cfcc;
}

.stat-card.danger strong {
  color: var(--red);
}

.stat-card.warning {
  background: var(--amber-soft);
  border-color: #f2d69f;
}

.stat-card.warning strong {
  color: var(--amber);
}

.stat-card.success {
  background: #f5fbf8;
  border-color: #c5e8da;
}

.stat-card.success strong {
  color: var(--green);
}

.table {
  width: 100%;
  min-width: 680px;
  margin-top: 12px;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 11px 10px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
}

.table td strong {
  color: var(--text);
  font-weight: 400;
}

.table td small {
  color: var(--muted);
  font-size: 12px;
}

.audit-table {
  min-width: 840px;
  table-layout: fixed;
}

.audit-time-column {
  width: 150px;
}

.audit-actor-column {
  width: 90px;
}

.audit-action-column {
  width: 180px;
}

.audit-target-column {
  width: 210px;
}

.audit-table th:first-child,
.audit-table td:first-child,
.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
  white-space: nowrap;
}

.audit-table td:last-child {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-code-label {
  display: block;
  color: var(--text);
  line-height: 1.45;
}

.audit-code-raw,
.audit-target-id,
.audit-detail-raw-key {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.audit-detail-list {
  display: grid;
  gap: 0;
  min-width: 0;
  margin: 0;
}

.audit-detail-list.nested {
  margin-top: 2px;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
}

.audit-detail-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.72fr) minmax(0, 1.28fr);
  gap: 5px 10px;
  min-width: 0;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}

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

.audit-detail-row dt,
.audit-detail-row dd {
  min-width: 0;
  margin: 0;
}

.audit-detail-key-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.audit-detail-row dd {
  color: var(--text-soft);
}

.audit-value-list {
  display: inline;
}

.audit-value-list > span + span::before {
  content: "、";
  color: var(--muted);
}

.audit-object-list,
.audit-object-item {
  display: grid;
  gap: 6px;
}

.audit-object-item {
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}

.audit-object-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.audit-object-index,
.audit-empty-value {
  color: var(--muted);
  font-size: 12px;
}

.audit-redacted {
  color: var(--red);
}

@media (max-width: 1400px) {
  .audit-detail-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

.empty {
  min-height: 54px;
  padding: 16px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.rule-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.rule-list span {
  display: block;
  padding: 11px 2px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--line);
  line-height: 1.55;
}

.rule-list span:last-child {
  border-bottom: 0;
}

.guard-level.error {
  color: var(--red);
  background: var(--red-soft);
}

.guard-level.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.guard-level.ok {
  color: var(--green);
  background: var(--green-soft);
}

.guard-table td strong {
  display: block;
}

.guard-table td small {
  display: block;
  margin-top: 4px;
}

.guard-row.error td {
  background: #fffafa;
}

.guard-row.warn td {
  background: #fffdf8;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(22, 32, 48, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(940px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(22, 32, 48, 0.18);
}

.wide-modal {
  width: min(1180px, calc(100vw - 40px));
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 400;
}

.modal-head small {
  color: var(--muted);
}

.modal-body {
  padding: 20px;
  overflow-x: auto;
}

.confirm-modal-card {
  width: min(460px, calc(100vw - 40px));
  overflow: hidden;
}

.confirm-modal-body {
  padding: 22px 20px 18px;
}

.confirm-modal-message {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.confirm-modal-warning {
  margin: 14px 0 0;
  padding: 10px 12px;
  color: #a84e4e;
  background: var(--red-soft);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

.danger-button-filled {
  min-width: 96px;
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

.danger-button-filled:hover {
  color: #ffffff;
  background: #c9433b;
  border-color: #c9433b;
}

.confirm-modal-card .ghost-button:focus-visible,
.confirm-modal-card .icon-button:focus-visible {
  border-color: #7fbcff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 143, 255, 0.14);
}

.confirm-modal-card .danger-button-filled:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(223, 81, 72, 0.18);
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--text);
  background: var(--panel-hover);
}

.permission-modal .check-grid {
  margin-top: 10px;
}

.assign-list {
  display: grid;
  gap: 8px;
  max-height: 52dvh;
  overflow: auto;
}

.assign-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.assign-row:hover {
  background: var(--panel-hover);
  border-color: var(--line-strong);
}

.assign-row input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.assign-row span,
.assign-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assign-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.assign-summary {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: var(--blue-soft);
  border: 1px solid #c9e3ff;
  border-radius: 10px;
}

.assign-summary span {
  color: var(--text-soft);
  line-height: 1.45;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.path-text {
  overflow-wrap: anywhere;
}

/* WC_ADMIN_NODE_RECORD_TABLE_20260715 */
.node-record-modal {
  width: min(1280px, calc(100vw - 40px));
}

.node-record-modal-body {
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.node-record-table {
  min-width: 1000px;
  table-layout: fixed;
}

.node-upgrade-table {
  min-width: 960px;
}

.backup-main-column {
  width: 34%;
}

.backup-node-column {
  width: 12%;
}

.backup-status-column {
  width: 9%;
}

.backup-time-column {
  width: 14%;
}

.backup-path-column {
  width: 22%;
}

.backup-action-column {
  width: 9%;
}

.upgrade-main-column {
  width: 24%;
}

.upgrade-node-column {
  width: 12%;
}

.upgrade-version-column {
  width: 32%;
}

.upgrade-status-column {
  width: 9%;
}

.upgrade-backup-column {
  width: 11%;
}

.upgrade-time-column {
  width: 12%;
}

.node-record-table th,
.node-record-table td {
  padding: 12px 14px;
  line-height: 1.5;
  vertical-align: top;
}

.node-record-table th {
  white-space: nowrap;
}

.record-title-cell strong {
  display: block;
  overflow-wrap: anywhere;
}

.record-title-cell small,
.record-version-cell,
.record-path-cell .path-text,
.record-backup-cell {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.record-node-cell,
.record-status-cell,
.record-time-cell,
.record-actions-cell {
  word-break: keep-all;
  overflow-wrap: normal;
}

.record-status-cell,
.record-time-cell {
  white-space: nowrap;
}

.record-path-cell .path-text {
  display: block;
  max-width: 100%;
  line-height: 1.45;
}

.record-version-arrow {
  padding: 0 2px;
  color: var(--muted);
  white-space: nowrap;
}

.record-actions-cell {
  white-space: normal;
}

.record-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.record-actions-cell .mini-button {
  flex: 0 0 auto;
  min-width: 68px;
  height: 30px;
  padding: 0 9px;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(22, 32, 48, 0.16);
  transform: translateX(-50%);
}

/* AI model settings: one provider owns one shared node scope. */
body[data-view="models"] .content {
  overflow: hidden;
}

.model-workspace {
  height: 100%;
  min-height: 0;
}

.provider-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  padding: 16px 0 14px;
  background: var(--panel-strong);
  overflow: hidden;
}

.workspace-sidebar-title {
  padding: 0 16px;
}

.provider-list {
  min-height: 0;
  margin-bottom: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.provider-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding-right: 16px;
  padding-left: 22px;
}

.provider-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 3px;
  background: transparent;
}

.provider-item.active,
.provider-item.active:hover,
.provider-item:focus-visible {
  border-left-color: transparent;
}

.provider-item.active::before,
.provider-item:focus-visible::before {
  background: var(--blue);
}

.list-item-copy {
  min-width: 0;
}

.provider-state {
  min-width: 42px;
  padding: 0 8px;
}

.provider-add-button {
  width: calc(100% - 28px);
  margin: 0 14px;
}

.model-config-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
  padding: 20px;
  background: var(--panel-strong);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.model-config-header {
  flex: 0 0 auto;
  min-height: 54px;
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.model-config-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.model-config-title h2 {
  flex: 0 0 auto;
}

.model-config-title .hint {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-config-actions {
  flex-wrap: nowrap;
}

.model-provider-fields {
  flex: 0 0 auto;
}

.model-secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: end;
}

.provider-enabled-card {
  min-height: 64px;
  margin-bottom: 14px;
}

.info-strip {
  flex: 0 0 auto;
}

.provider-scope-section,
.model-list-section {
  flex: 0 0 auto;
  margin-inline: -20px;
  padding: 18px 20px 20px;
  background: rgba(247, 249, 252, 0.78);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.provider-node-card.disabled {
  color: var(--muted);
  background: var(--panel-soft);
}

.model-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 96px 106px minmax(236px, auto);
  gap: 12px;
  align-items: end;
  min-width: 0;
  padding: 12px;
  margin: 0 0 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.model-row:last-child {
  margin-bottom: 0;
}

.model-name-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.model-priority-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: var(--text-soft);
}

.model-capability-controls {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-top: 2px;
}

.model-capability-title {
  color: var(--text-soft);
  font-size: 13px;
  white-space: nowrap;
}

.model-capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-capability-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  font-size: 13px;
  white-space: nowrap;
}

.model-row .switch-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  color: var(--text-soft);
}

.model-remove-button {
  min-height: 42px;
}

.model-row-actions {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.model-row-actions button {
  flex: 1 1 auto;
  min-height: 42px;
  white-space: nowrap;
}

.model-test-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.model-test-status:empty {
  display: none;
}

.model-test-status.testing {
  color: var(--blue);
}

.model-test-status.success {
  color: var(--green);
}

.model-test-status.error {
  color: var(--red);
}

@media (min-width: 1480px) {
  .provider-node-grid,
  .check-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1480px) {
  :root {
    --sidebar-width: 320px;
    --workspace-list-width: 280px;
  }
}

@media (max-width: 1260px) {
  :root {
    --sidebar-width: 290px;
    --workspace-list-width: 270px;
  }

  .row.three,
  .model-provider-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .provider-node-grid,
  .check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 100dvh;
  }

  .sidebar {
    min-height: auto;
    padding-bottom: 10px;
  }

  .brand {
    min-height: 52px;
    margin-bottom: 8px;
    padding-bottom: 12px;
  }

  .nav {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 4px;
    margin-inline: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 40px;
    padding: 0 14px;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .nav-item.active,
  .nav-item.active:hover {
    border-left-color: transparent;
    border-bottom-color: var(--blue);
  }

  .main {
    min-height: 720px;
  }

  .content {
    overflow: visible;
  }

  body[data-view="models"] .content {
    overflow: visible;
  }

  .grid.two,
  .workspace-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .list-panel {
    min-height: 280px;
    max-height: 390px;
  }

  .model-workspace {
    height: auto;
    min-height: 0;
  }

  .provider-sidebar {
    height: auto;
  }

  .model-config-panel {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .admin-shell {
    gap: 8px;
    padding: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions button {
    min-height: 36px;
    padding: 0 11px;
  }

  .content {
    padding: 10px;
  }

  .card,
  .list-panel,
  .model-config-panel {
    padding: 14px;
  }

  .list-panel:not(.provider-sidebar) > .item-list {
    margin-inline: -14px;
  }

  .provider-sidebar {
    padding-right: 0;
    padding-left: 0;
  }

  .provider-scope-section,
  .model-list-section {
    margin-inline: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .row,
  .row.three,
  .billing-recharge-row,
  .model-provider-fields,
  .model-secret-row,
  .check-grid,
  .provider-node-grid,
  .stat-grid,
  .guard-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .billing-recharge-row .primary-button {
    width: 100%;
  }

  .token-ledger-header {
    align-items: stretch;
    flex-direction: column;
  }

  .record-header-controls {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .token-ledger-date {
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
  }

  .token-ledger-pagination {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
  }

  .token-ledger-pagination span {
    grid-column: auto;
    align-self: center;
  }

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

  .model-config-title {
    width: 100%;
  }

  .model-config-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(88px, 0.55fr);
    width: 100%;
  }

  .model-config-actions button {
    width: 100%;
  }

  .model-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
  }

  .model-name-field,
  .model-priority-field,
  .model-enabled-switch,
  .model-row-actions,
  .model-capability-controls,
  .model-test-status {
    grid-column: 1 / -1;
  }

  .model-capability-controls {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .model-enabled-switch {
    justify-self: stretch;
  }

  .model-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .button-row {
    flex-wrap: wrap;
  }

  .button-row > button {
    flex: 1 1 auto;
  }

  .wechat-panel-title {
    align-items: stretch;
    flex-direction: column;
  }

  .wechat-panel-title .panel-title-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card,
  .wide-modal {
    width: 100%;
    max-height: 90dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 10px 10px 0 0;
  }

  .modal-head,
  .modal-body {
    padding: 14px;
  }

  .confirm-modal-body {
    padding: 18px 14px 14px;
  }

  .confirm-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 14px 16px;
  }

  .table {
    min-width: 640px;
  }

  .node-backup-table {
    min-width: 1000px;
  }

  .node-upgrade-table {
    min-width: 960px;
  }
}

/* WC_ADMIN_LOGIN_STYLE_20260714 */
html,
body {
  background: #efeded;
}

body.wc-login-page {
  min-height: 100vh;
  margin: 0;
  padding: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #efeded;
  color: #1f2937;
  overflow: auto;
}

.wc-admin-login-page {
  width: 100%;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wc-admin-login-card {
  width: min(1180px, calc(100vw - 80px));
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(460px, 1.1fr);
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

.wc-admin-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px;
  background: #142235;
  color: #fff;
}

.wc-admin-login-brand-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.wc-admin-login-logo {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #2f8df6;
  color: #fff;
  font-size: 46px;
  font-weight: 600;
  line-height: 1;
}

.wc-admin-login-brand-name {
  font-size: 42px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0;
}

.wc-admin-login-brand-subtitle {
  margin-top: 14px;
  color: #d5e5ff;
  font-size: 18px;
}

.wc-admin-login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
  background: #fff;
}

.wc-admin-login-form {
  width: min(100%, 480px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.wc-admin-login-heading h1 {
  margin: 0;
  color: #1f2a44;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
}

.wc-admin-login-heading p {
  margin: 14px 0 0;
  color: #8aa0be;
  font-size: 18px;
}

.wc-admin-login-fields {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.wc-admin-login-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #334155;
  font-size: 16px;
}

.wc-admin-login-field input {
  width: 100%;
  height: 58px;
  box-sizing: border-box;
  border: 1px solid #cfe0f7;
  border-radius: 8px;
  background: #fff;
  padding: 0 18px;
  color: #1f2937;
  font-size: 18px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.wc-admin-login-field input:focus {
  border-color: #2f8df6;
  box-shadow: 0 0 0 3px rgba(47, 141, 246, 0.14);
}

.wc-admin-login-actions {
  margin-top: 22px;
}

.wc-admin-login-submit {
  width: 100%;
  height: 64px;
  border: 0;
  border-radius: 10px;
  background: #2f8df6;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

.wc-admin-login-submit:hover {
  background: #1f7ee8;
}

.wc-admin-login-submit:active {
  transform: translateY(1px);
}

@media (max-width: 900px) {
  body.wc-login-page {
    padding: 20px;
  }

  .wc-admin-login-page {
    min-height: calc(100vh - 40px);
  }

  .wc-admin-login-card {
    width: 100%;
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .wc-admin-login-brand {
    padding: 32px 24px;
  }

  .wc-admin-login-panel {
    padding: 34px 24px 40px;
  }

  .wc-admin-login-logo {
    width: 68px;
    height: 68px;
    font-size: 34px;
  }

  .wc-admin-login-brand-name {
    font-size: 32px;
  }

  .wc-admin-login-heading h1 {
    font-size: 32px;
  }
}

/* codex-admin-login-shell-20260714 */
:root {
  --wc-admin-page-bg: #efeded;
  --wc-admin-work-bg: #f8f8fa;
  --wc-admin-panel-bg: #ffffff;
  --wc-admin-line: #e5ebf3;
  --wc-admin-text: #1f2a3d;
  --wc-admin-muted: #8ea0bb;
  --wc-admin-blue: #2f8ff4;
}

html,
body {
  background: var(--wc-admin-page-bg);
}

body.weclaw-login-page {
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  background: var(--wc-admin-page-bg);
  color: var(--wc-admin-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body.weclaw-login-page .weclaw-login-shell {
  width: min(1216px, calc(100vw - 40px));
  min-height: min(690px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: minmax(360px, 45%) minmax(420px, 55%);
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(31, 42, 61, .13);
}

body.weclaw-login-page .weclaw-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
  background: #142437;
  color: #fff;
}

body.weclaw-login-page .weclaw-login-brand-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

body.weclaw-login-page .weclaw-login-logo {
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #45a2ff, #1677ff);
  color: #fff;
  font-size: 48px;
  line-height: 1;
  font-weight: 500;
}

body.weclaw-login-page .weclaw-login-brand-name {
  font-size: 42px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: 0;
}

body.weclaw-login-page .weclaw-login-brand-sub {
  margin-top: 12px;
  font-size: 18px;
  color: rgba(255, 255, 255, .78);
}

body.weclaw-login-page .weclaw-login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 98px;
  background: #fff;
}

body.weclaw-login-page .weclaw-login-heading {
  margin-bottom: 56px;
}

body.weclaw-login-page .weclaw-login-heading h1 {
  margin: 0 0 14px;
  font-size: 38px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0;
  color: #1f2a3d;
}

body.weclaw-login-page .weclaw-login-heading p {
  margin: 0;
  font-size: 18px;
  color: #8798b4;
}

body.weclaw-login-page .weclaw-login-formbox,
body.weclaw-login-page .weclaw-login-formbox form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

body.weclaw-login-page .weclaw-login-formbox > * {
  max-width: 468px;
}

body.weclaw-login-page label,
body.weclaw-login-page .weclaw-login-formbox label {
  display: block;
  margin: 0 0 10px;
  font-size: 18px;
  color: #40516a;
}

body.weclaw-login-page input[type="text"],
body.weclaw-login-page input[type="password"],
body.weclaw-login-page input:not([type]),
body.weclaw-login-page .weclaw-login-formbox input {
  width: 100%;
  height: 66px;
  box-sizing: border-box;
  border: 1px solid #cfdef3;
  border-radius: 8px;
  background: #fff;
  padding: 0 20px;
  font-size: 20px;
  color: #1f2a3d;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

body.weclaw-login-page input:focus {
  border-color: #8fc3ff;
  box-shadow: 0 0 0 3px rgba(47, 143, 244, .12);
}

body.weclaw-login-page button,
body.weclaw-login-page input[type="submit"] {
  width: 100%;
  height: 66px;
  border: 0;
  border-radius: 8px;
  background: var(--wc-admin-blue);
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

body.weclaw-login-page button:hover,
body.weclaw-login-page input[type="submit"]:hover {
  background: #2586ec;
  box-shadow: 0 12px 24px rgba(47, 143, 244, .22);
}

body.weclaw-login-page button:active,
body.weclaw-login-page input[type="submit"]:active {
  transform: translateY(1px);
}

@media (max-width: 900px) {
  body.weclaw-login-page .weclaw-login-shell {
    grid-template-columns: 1fr;
    width: min(560px, calc(100vw - 40px));
    min-height: auto;
  }

  body.weclaw-login-page .weclaw-login-brand {
    min-height: 180px;
    padding: 36px 28px;
  }

  body.weclaw-login-page .weclaw-login-panel {
    padding: 40px 28px;
  }

  body.weclaw-login-page .weclaw-login-heading {
    margin-bottom: 32px;
  }
}
/* codex-admin-login-static-fallback-20260714
   Keep /login presentable even when the JS login-shell enhancer is not loaded. */
@supports selector(body:has(input[type="password"])) {
  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) {
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr) !important;
    align-content: center !important;
    justify-content: center !important;
    background: #efeded !important;
    color: #17233c !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif !important;
    overflow: auto !important;
  }

  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"])::before {
    content: "W\A WeClaw\A 微信客户管理后台" !important;
    white-space: pre-line !important;
    grid-column: 1 !important;
    grid-row: 1 / 20 !important;
    min-height: min(680px, calc(100vh - 40px)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 64px !important;
    box-sizing: border-box !important;
    border-radius: 16px 0 0 16px !important;
    background: #14253a !important;
    color: #fff !important;
    font-size: 34px !important;
    line-height: 1.45 !important;
    letter-spacing: 0 !important;
    box-shadow: 0 24px 60px rgba(23, 35, 60, 0.14) !important;
  }

  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"])::after {
    content: "账号登录\A 使用平台账号登陆" !important;
    white-space: pre-line !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    justify-self: stretch !important;
    height: min(680px, calc(100vh - 40px)) !important;
    padding: 92px 100px 0 !important;
    box-sizing: border-box !important;
    border-radius: 0 16px 16px 0 !important;
    background: #fff !important;
    color: #17233c !important;
    font-size: 32px !important;
    line-height: 1.8 !important;
    letter-spacing: 0 !important;
    box-shadow: 0 24px 60px rgba(23, 35, 60, 0.14) !important;
  }

  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) > * {
    grid-column: 2 !important;
    position: relative !important;
    z-index: 1 !important;
    width: min(468px, calc(100vw - 80px)) !important;
    justify-self: center !important;
  }

  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) > :first-child {
    display: none !important;
  }

  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) label,
  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) > div {
    font-size: 16px !important;
    color: #50607a !important;
    line-height: 1.4 !important;
  }

  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) input {
    width: 100% !important;
    height: 58px !important;
    margin: 10px 0 22px !important;
    padding: 0 18px !important;
    box-sizing: border-box !important;
    border: 1px solid #d7e2f2 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #17233c !important;
    font-size: 16px !important;
    outline: none !important;
    transition: border-color 0.16s ease, box-shadow 0.16s ease !important;
  }

  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) input:focus {
    border-color: #2f91ff !important;
    box-shadow: 0 0 0 3px rgba(47, 145, 255, 0.12) !important;
  }

  body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) button {
    width: 100% !important;
    height: 58px !important;
    margin-top: 24px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: #2f91ff !important;
    color: #fff !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    box-shadow: 0 12px 24px rgba(47, 145, 255, 0.22) !important;
  }

  @media (max-width: 900px) {
    body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) {
      display: block !important;
      padding: 20px !important;
    }

    body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"])::before {
      display: none !important;
    }

    body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"])::after {
      display: block !important;
      height: auto !important;
      min-height: 0 !important;
      padding: 32px 24px 18px !important;
      border-radius: 16px 16px 0 0 !important;
      font-size: 28px !important;
      box-shadow: 0 18px 40px rgba(23, 35, 60, 0.12) !important;
    }

    body:not(.platform-login-body):not(.weclaw-login-page):not(:has(.admin-shell)):not(:has(.admin-layout)):not(:has(.admin-app)):has(input[type="password"]) > * {
      width: 100% !important;
      max-width: none !important;
    }
  }
}

/* codex-admin-login-polish-20260714 */
body.admin-login-enhanced {
  margin: 0;
  min-height: 100vh;
  background: #efeded;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
body.admin-login-enhanced * {
  box-sizing: border-box;
}
body.admin-login-enhanced .admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
body.admin-login-enhanced .admin-login-shell {
  width: min(1180px, calc(100vw - 40px));
  min-height: 690px;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}
body.admin-login-enhanced .admin-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #152437;
  color: #fff;
  padding: 56px;
}
body.admin-login-enhanced .admin-login-brand-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}
body.admin-login-enhanced .admin-login-logo {
  width: 94px;
  height: 94px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #2f8df4;
  color: #fff;
  font-size: 44px;
  line-height: 1;
  font-weight: 600;
}
body.admin-login-enhanced .admin-login-brand-name {
  margin: 0;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0;
}
body.admin-login-enhanced .admin-login-brand-subtitle {
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.86);
}
body.admin-login-enhanced .admin-login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 64px 72px;
}
body.admin-login-enhanced .admin-login-panel-inner {
  width: min(468px, 100%);
}
body.admin-login-enhanced .admin-login-title {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.2;
  color: #1f2937;
  font-weight: 500;
}
body.admin-login-enhanced .admin-login-hint {
  margin: 0 0 56px;
  font-size: 16px;
  line-height: 1.5;
  color: #8fa1bd;
}
body.admin-login-enhanced .admin-login-form {
  display: grid;
  gap: 26px;
}
body.admin-login-enhanced .admin-login-field {
  display: grid;
  gap: 10px;
}
body.admin-login-enhanced .admin-login-label {
  color: #52627a;
  font-size: 16px;
  line-height: 1.3;
}
body.admin-login-enhanced .admin-login-input {
  width: 100%;
  height: 66px;
  border: 1px solid #d5e3f5;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 18px;
  padding: 0 18px;
  outline: none;
  box-shadow: none;
}
body.admin-login-enhanced .admin-login-input:focus {
  border-color: #2f8df4;
  box-shadow: 0 0 0 3px rgba(47, 141, 244, 0.12);
}
body.admin-login-enhanced .admin-login-submit {
  width: 100%;
  height: 66px;
  margin-top: 40px;
  border: 0;
  border-radius: 8px;
  background: #2f8df4;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: none;
}
body.admin-login-enhanced .admin-login-submit:hover {
  background: #2683ec;
}
body.admin-login-enhanced .admin-login-error {
  min-height: 22px;
  color: #ef4444;
  font-size: 14px;
}

/* Platform login uses the same visual language as the customer-facing login. */
.platform-login-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background:
    linear-gradient(115deg, rgba(36, 169, 121, 0.09), transparent 35%),
    linear-gradient(295deg, rgba(47, 143, 247, 0.11), transparent 42%),
    #efeded;
}

.platform-login-layout {
  width: min(880px, 100%);
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(31, 41, 55, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.platform-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 48px;
  color: #fff;
  background: #152537;
}

.platform-login-brand-mark {
  width: 68px;
  height: 68px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #2f8fff;
  font-size: 34px;
}

.platform-login-brand h1 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 30px;
  font-weight: 500;
}

.platform-login-brand p {
  margin: 0;
  color: #b9c7d6;
}

.platform-login-panel {
  align-self: center;
  padding: 56px clamp(34px, 7vw, 72px);
}

.platform-login-panel header {
  margin-bottom: 34px;
}

.platform-login-panel h2 {
  margin: 0 0 10px;
  color: #344054;
  font-size: 26px;
  font-weight: 500;
}

.platform-login-panel header p {
  margin: 0;
  color: #91a1b5;
}

.platform-login-panel form {
  display: grid;
  gap: 10px;
}

.platform-login-panel label {
  margin-top: 9px;
  color: #56657b;
}

.platform-login-panel input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(47, 143, 255, 0.22);
  border-radius: 6px;
  padding: 0 14px;
  color: #344054;
  background: #fff;
  outline: none;
}

.platform-login-panel input:focus {
  border-color: #2f8fff;
  box-shadow: 0 0 0 3px rgba(47, 143, 255, 0.12);
}

.platform-password-field {
  position: relative;
}

.platform-password-field input {
  padding-right: 52px;
}

.platform-password-toggle {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #46556c;
  background: transparent;
  font-size: 15px;
}

.platform-password-toggle:hover {
  color: #2f8fff;
}

.platform-login-error {
  min-height: 22px;
  margin: 3px 0 0;
  color: #d94b45;
}

.platform-login-submit {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #2f8fff;
}

.platform-login-submit:hover {
  background: #227fe8;
}

.platform-login-submit:disabled {
  opacity: 0.48;
}

.ai-monitor-card {
  min-width: 0;
}

.ai-monitor-header {
  align-items: center;
  gap: 18px;
}

.ai-monitor-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin: 18px 0;
  border-top: 1px solid #e8edf3;
  border-bottom: 1px solid #e8edf3;
}

.ai-monitor-summary > div {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid #e8edf3;
}

.ai-monitor-summary > div:last-child {
  border-right: 0;
}

.ai-monitor-summary span,
.ai-monitor-summary strong {
  display: block;
}

.ai-monitor-summary span {
  color: #7c8ca3;
  font-size: 13px;
}

.ai-monitor-summary strong {
  margin-top: 6px;
  color: #334155;
  font-size: 23px;
  font-weight: 600;
}

.ai-monitor-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ai-monitor-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #718198;
  font-size: 13px;
}

.ai-monitor-filters input,
.ai-monitor-filters select {
  width: 100%;
  min-width: 0;
  height: 40px;
}

.ai-monitor-node-errors {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-left: 3px solid #d99a36;
  color: #805e24;
  background: #fff8e8;
  font-size: 13px;
}

.ai-monitor-table {
  min-width: 980px;
  table-layout: fixed;
}

.ai-monitor-table th:nth-child(1) { width: 160px; }
.ai-monitor-table th:nth-child(2) { width: 190px; }
.ai-monitor-table th:nth-child(3) { width: 160px; }
.ai-monitor-table th:nth-child(4) { width: 185px; }
.ai-monitor-table th:nth-child(5) { width: 230px; }
.ai-monitor-table th:nth-child(6) { width: 130px; }

.ai-monitor-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.ai-monitor-table tbody tr {
  cursor: pointer;
}

.ai-monitor-table tbody tr:hover,
.ai-monitor-row-selected {
  background: #f7fbff;
}

.ai-monitor-table td strong,
.ai-monitor-table td small {
  display: block;
}

.ai-monitor-table td small {
  margin-top: 5px;
  color: #8a99ad;
  line-height: 1.45;
}

.ai-monitor-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  color: #53647a;
  background: #edf2f7;
  font-size: 12px;
}

.ai-monitor-status.status-sent,
.ai-monitor-status.status-completed,
.ai-monitor-status.status-enabled {
  color: #14785b;
  background: #e4f7ef;
}

.ai-monitor-status.status-handoff,
.ai-monitor-status.status-prepared,
.ai-monitor-status.status-running,
.ai-monitor-status.status-sending {
  color: #875c17;
  background: #fff3d6;
}

.ai-monitor-status.status-failed,
.ai-monitor-status.status-canceled,
.ai-monitor-status.status-disabled {
  color: #b43f3b;
  background: #fdeceb;
}

.ai-monitor-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(20, 31, 48, 0.35);
}

.ai-monitor-detail {
  margin-top: 18px;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  background: #fff;
}

.ai-monitor-detail.ai-monitor-modal {
  width: min(1080px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  margin-top: 0;
  overflow: auto;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
}

.ai-monitor-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid #e8edf3;
}

.ai-monitor-detail-header h3 {
  margin: 0;
  color: #263244;
  font-size: 16px;
}

.ai-monitor-detail-header small,
.ai-monitor-public-safe p,
.ai-monitor-timeline small {
  color: #7c8ca3;
}

.ai-monitor-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 1px;
  background: #e8edf3;
  border-bottom: 1px solid #e8edf3;
}

.ai-monitor-detail-grid > div {
  min-width: 0;
  padding: 14px 16px;
  background: #fff;
}

.ai-monitor-detail-grid span,
.ai-monitor-detail-grid strong {
  display: block;
}

.ai-monitor-detail-grid span {
  color: #7c8ca3;
  font-size: 12px;
}

.ai-monitor-detail-grid strong {
  margin-top: 6px;
  color: #334155;
  font-size: 14px;
}

.ai-monitor-public-safe {
  padding: 14px 16px;
  border-bottom: 1px solid #e8edf3;
}

.ai-monitor-public-safe strong {
  color: #334155;
}

.ai-monitor-public-safe p {
  margin: 6px 0 0;
  line-height: 1.6;
}

.ai-monitor-debug-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8edf3;
  background: #f8fafc;
}

.ai-monitor-debug-section {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e3e9f2;
  border-radius: 8px;
  background: #fff;
}

.ai-monitor-debug-section h4 {
  margin: 0;
  color: #263244;
  font-size: 14px;
}

.ai-monitor-debug-section small {
  display: block;
  margin-top: 4px;
  color: #7c8ca3;
}

.ai-monitor-debug-section p {
  margin: 10px 0 0;
  color: #7c8ca3;
}

.ai-monitor-debug-section dl {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.ai-monitor-debug-section dl > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.ai-monitor-debug-section dt {
  color: #7c8ca3;
  font-size: 12px;
}

.ai-monitor-debug-section dd {
  min-width: 0;
  margin: 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.ai-monitor-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-monitor-timeline li {
  padding: 14px 16px;
  border-bottom: 1px solid #eef3f8;
}

.ai-monitor-timeline li:last-child {
  border-bottom: 0;
}

.ai-monitor-timeline-main,
.ai-monitor-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.ai-monitor-timeline-main strong {
  color: #334155;
}

.ai-monitor-timeline-main span,
.ai-monitor-timeline-meta span {
  color: #53647a;
}

.ai-monitor-timeline-meta {
  margin-top: 8px;
}

@media (max-width: 1200px) {
  .ai-monitor-filters {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 820px) {
  .ai-monitor-header {
    align-items: stretch;
  }

  .ai-monitor-summary {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .ai-monitor-summary > div {
    border-bottom: 1px solid #e8edf3;
  }

  .ai-monitor-filters {
    grid-template-columns: 1fr;
  }

  .ai-monitor-detail-grid {
    grid-template-columns: 1fr;
  }

  .ai-monitor-debug-grid {
    grid-template-columns: 1fr;
  }

  .ai-monitor-debug-section dl > div {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .ai-monitor-modal-mask {
    padding: 12px;
  }

  .ai-monitor-detail.ai-monitor-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

.hnsw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.hnsw-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.hnsw-card-head span {
  border-radius: 999px;
  padding: 2px 8px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  white-space: nowrap;
}

.hnsw-card.status-ready .hnsw-card-head span {
  background: #dcfce7;
  color: #166534;
}

.hnsw-card.status-waiting .hnsw-card-head span,
.hnsw-card.status-building .hnsw-card-head span {
  background: #fef3c7;
  color: #92400e;
}

.hnsw-card.status-failed .hnsw-card-head span {
  background: #fee2e2;
  color: #991b1b;
}

.hnsw-card small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .platform-login-body {
    place-items: stretch;
    padding: 0;
  }

  .platform-login-layout {
    width: 100%;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  .platform-login-brand {
    min-height: 150px;
    padding: 28px 24px;
  }

  .platform-login-brand-mark {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }

  .platform-login-brand h1 {
    font-size: 26px;
  }

  .platform-login-panel {
    width: min(100%, 520px);
    align-self: start;
    justify-self: center;
    padding: 42px 24px;
  }
}
@media (max-width: 820px) {
  body.admin-login-enhanced .admin-login-page {
    padding: 20px;
    align-items: stretch;
  }
  body.admin-login-enhanced .admin-login-shell {
    width: 100%;
    min-height: calc(100vh - 40px);
    grid-template-columns: 1fr;
  }
  body.admin-login-enhanced .admin-login-brand {
    min-height: 220px;
    padding: 28px;
  }
  body.admin-login-enhanced .admin-login-panel {
    padding: 38px 28px 44px;
  }
  body.admin-login-enhanced .admin-login-brand-name {
    font-size: 32px;
  }
}
