:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2f7;
  color: #172033;
}

/* 穿搭策略复用现有 Manage 表单与品牌色，以紧凑分组呈现配额及入参说明。 */
.outfit-policy { max-width: 1100px; }
.outfit-tabs, .outfit-presets, .outfit-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.outfit-quota-row { display: grid; grid-template-columns: 140px 230px 1fr; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid #e4e4e7; }
.outfit-policy input[type="number"] { width: 96px; min-height: 36px; margin: 0 4px; padding: 6px 8px; border: 1px solid #d6d3d1; border-radius: 6px; font-variant-numeric: tabular-nums; }
.outfit-total, .outfit-anchor-row { display: block; margin: 16px 0; }
.outfit-advanced { padding: 12px 0; border-top: 1px solid #e4e4e7; }
.outfit-advanced label { display: block; margin-top: 12px; }
.outfit-explanation { margin-top: 24px; padding-top: 16px; border-top: 1px solid #e4e4e7; line-height: 1.7; }
.outfit-common { margin-top: 16px; line-height: 1.7; }
.outfit-process { margin: 0; padding-left: 24px; font-size: 13px; }
.outfit-process li { padding: 4px 0 4px 4px; }
.outfit-common-details { padding: 12px 0; border-bottom: 1px solid var(--manage-border, #e4e4e7); font-size: 13px; }
.outfit-common-details summary, .outfit-advanced summary { cursor: pointer; font-weight: 600; }
.outfit-common-details h4 { margin: 16px 0 8px; }
.outfit-input-fields { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; }
.outfit-input-fields dt { font-weight: 600; }
.outfit-input-fields dd { margin: 0; }
.outfit-actions [data-outfit-status] { flex: 1 1 260px; }
.workspace .outfit-policy .outfit-status-error { color: #b91c1c; font-weight: 600; }
.workspace .outfit-policy .outfit-status-success { color: #15803d; }
.workspace .outfit-policy .outfit-status-info { color: #57534e; }
@media (max-width: 640px) {
  .outfit-quota-row { grid-template-columns: 1fr; gap: 8px; }
  .outfit-input-fields { grid-template-columns: 1fr; gap: 4px; }
  .outfit-input-fields dd { margin-bottom: 12px; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.6;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  border-radius: 8px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(140deg, rgba(19, 99, 119, 0.14), transparent 38%),
    linear-gradient(320deg, rgba(53, 95, 169, 0.12), transparent 42%),
    #eef2f7;
}

.login-panel {
  width: min(430px, 100%);
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 16px 48px rgba(23, 32, 51, 0.12);
}

.contract-actions,
.login-brand,
.brand,
.admin-chip,
.button,
.nav-item,
.alert,
.placeholder {
  display: flex;
  align-items: center;
}

.contract-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.login-brand {
  gap: 14px;
  margin-bottom: 24px;
}

.contract-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #eef2f7;
}

.contract-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #d9e1ec;
  background: #fff;
  padding: 12px 18px;
}

.contract-frame {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 64px);
  border: 0;
  background: #fff;
}

.login-brand p {
  max-width: 330px;
  margin-top: 4px;
  color: #65738a;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.login-form {
  display: grid;
  gap: 12px;
}

.field {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: #4c5b70;
  font-size: 13px;
}

.input {
  display: block;
  width: 100%;
  inline-size: 100%;
  max-width: 100%;
  max-inline-size: 100%;
  min-width: 0;
  min-inline-size: 0;
  min-height: 38px;
  border: 1px solid #cdd7e5;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 8px 10px;
  outline: none;
}

select.input {
  height: 38px;
  min-height: 38px;
  appearance: none;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #65738a 50%),
    linear-gradient(135deg, #65738a 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 16px,
    calc(100% - 10px) 16px;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
  line-height: 20px;
}

.input:focus {
  border-color: #13737f;
  box-shadow: 0 0 0 3px rgba(19, 115, 127, 0.12);
}

.password-input-wrap {
  position: relative;
  min-width: 0;
}

.password-input-wrap .input {
  padding-right: 46px;
}

.password-visibility-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 42px;
  border: 0;
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: #65738a;
  transition: color 160ms ease, background-color 160ms ease;
}

.password-visibility-toggle:hover {
  background: rgba(19, 115, 127, 0.06);
  color: #13737f;
}

.password-visibility-toggle:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px #13737f;
  color: #13737f;
}

.password-visibility-icon {
  width: 19px;
  height: 19px;
}

.password-visibility-slash {
  opacity: 0;
  transition: opacity 160ms ease;
}

.password-visibility-toggle.is-password-visible .password-visibility-slash {
  opacity: 1;
}

.button {
  min-height: 38px;
  justify-content: center;
  gap: 8px;
  border: 1px solid #cdd7e5;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  border-color: #13737f;
  background: #13737f;
  color: #fff;
}

.alert {
  min-height: 36px;
  border: 1px solid #f1b3a4;
  border-radius: 6px;
  background: #fff2ee;
  color: #9b341f;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #d9e1ec;
  background: #f8fafc;
  padding: 18px 12px;
}

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

.brand {
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 8px;
  color: #172033;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.brand span {
  white-space: nowrap;
}

nav {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.sidebar-footer {
  display: flex;
  margin-top: auto;
  padding: 18px 8px 0;
}

.nav-item {
  min-height: 38px;
  width: 100%;
  justify-content: flex-start;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4c5b70;
  padding: 8px 10px;
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover {
  background: #e7f1f3;
  color: #0f5962;
}

.workspace {
  min-width: 0;
  background: #eef2f7;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d9e1ec;
  background: #fff;
  padding: 14px 20px;
}

.title-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.admin-chip {
  gap: 8px;
  color: #4c5b70;
  font-size: 13px;
  white-space: nowrap;
}

.icon-button {
  min-height: 32px;
  border: 1px solid #cdd7e5;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 5px 10px;
}

.logout-button {
  justify-content: center;
  width: 100%;
}

.surface {
  margin: 20px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #fff;
}

.placeholder {
  min-height: 220px;
  justify-content: center;
  color: #65738a;
}

.membership-panel {
  min-width: 0;
  padding: 20px;
}

.membership-panel .surface {
  margin: 0;
}

.membership-filters {
  padding: 16px;
}

.membership-filter-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px 16px;
  align-items: end;
}

.membership-primary-filter {
  grid-column: span 2;
}

.membership-filter-toggle {
  align-self: end;
  gap: 6px;
}

.membership-filter-toggle-icon {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: #65738a;
  transform: rotate(45deg);
  transition: color 160ms ease, transform 160ms ease;
}

.membership-filter-toggle:hover .membership-filter-toggle-icon,
.membership-filter-toggle:focus-visible .membership-filter-toggle-icon {
  color: #13737f;
}

.membership-filter-toggle[aria-expanded="true"] .membership-filter-toggle-icon {
  transform: rotate(-135deg);
}

.membership-advanced-filters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px 16px;
  min-width: 0;
  max-width: 100%;
}

.membership-advanced-filters .field {
  min-width: 0;
}

.membership-filter-actions,
.membership-bulk-actions,
.membership-query-actions,
.membership-pagination,
.membership-page-actions,
.member-identity,
.member-tags {
  display: flex;
  align-items: center;
}

.membership-filter-actions {
  grid-column: 4 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.membership-filter-form.is-expanded .membership-filter-actions {
  grid-column: 1 / -1;
}

.membership-bulk-actions,
.membership-query-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.membership-result-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 40px;
  white-space: nowrap;
}

.membership-list-view {
  margin-top: 16px !important;
  overflow: hidden;
}

.membership-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
}

.membership-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  color: #172033;
  font-size: 13px;
}

.membership-table th,
.membership-table td {
  border-bottom: 1px solid #e5eaf3;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.membership-table th {
  background: #f8fafc;
  color: #4c5b70;
  font-weight: 700;
}

.membership-table tbody tr:hover {
  background: #f8fbfd;
}

.membership-user-table .membership-action-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 76px;
  text-align: center;
  background: #fff;
  box-shadow: -10px 0 14px -14px rgba(23, 32, 51, 0.55);
}

.membership-user-table th.membership-action-cell {
  z-index: 3;
  background: #f8fafc;
}

.membership-user-table tbody tr:hover .membership-action-cell {
  background: #f8fbfd;
}

.membership-empty {
  color: #65738a;
  text-align: center !important;
}

.mono-cell {
  color: #4c5b70;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.member-id-cell {
  width: 118px;
  max-width: 118px;
}

.copy-id-button {
  display: block;
  width: 118px;
  border: 0;
  padding: 0;
  overflow: hidden;
  color: #4c5b70;
  background: transparent;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.copy-id-button:hover,
.copy-id-button:focus-visible,
.copy-id-button.is-copied {
  color: #0f7c86;
}

.membership-toast {
  position: fixed;
  z-index: 1000;
  padding: 9px 14px;
  border: 1px solid #cce7df;
  border-radius: 6px;
  color: #0f5962;
  background: #eefaf6;
  box-shadow: 0 12px 28px rgba(23, 32, 51, 0.14);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.membership-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.member-identity {
  width: 145px;
  gap: 10px;
  font-weight: 700;
}

.member-name {
  min-width: 0;
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-identity-text {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.member-identity-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary, #65738a);
  font-size: 12px;
  font-weight: 400;
}

.member-avatar-wrap {
  display: inline-flex;
  flex: 0 0 auto;
}

.member-avatar-wrap [hidden] {
  display: none;
}

.qq-profile-heading {
  width: 100%;
  margin: 12px 0;
}

.qq-profile-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.qq-openid-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.qq-openid-value code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.member-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  background: #e7f1f3;
}

.member-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f5962;
  font-weight: 700;
}

.member-tags {
  flex-wrap: wrap;
  gap: 6px;
  min-width: 160px;
}

.tag-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.tag-pill {
  background: #edf4ff;
  color: #285c9f;
}

.button.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.button.danger:not(:disabled):hover {
  border-color: #fca5a5;
  background: #ffe4e6;
}

.status-pill.is-normal {
  background: #e9f8ef;
  color: #1e7a44;
}

.status-pill.is-disabled {
  background: #fff0ee;
  color: #9b341f;
}

.muted,
.two-line-cell small {
  color: #65738a;
}

.two-line-cell {
  display: grid;
  gap: 3px;
}

.link-button {
  border: 0;
  background: transparent;
  color: #2563eb;
  padding: 0;
  font-weight: 700;
}

.membership-pagination {
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: #4c5b70;
}

.membership-page-actions {
  gap: 8px;
}

.membership-detail-view {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(288px, 304px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.membership-profile-panel {
  align-self: start;
  padding: 14px;
}

.back-button {
  width: fit-content;
  margin-bottom: 14px;
}

.member-profile-card {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.member-profile-card .member-avatar {
  width: 68px;
  height: 68px;
  font-size: 24px;
}

.member-profile-card h3,
.membership-detail-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.member-profile-card dl,
.membership-detail-card dl {
  width: 100%;
  display: grid;
  gap: 10px;
  margin: 0;
}

.member-profile-card dl {
  gap: 8px;
}

.member-profile-card dl div,
.membership-detail-card dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

.member-profile-card dl div {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
}

.member-profile-card dt,
.membership-detail-card dt {
  color: #65738a;
}

.member-profile-card dt,
.member-profile-card dd {
  font-size: 14px;
  line-height: 1.28;
}

.member-profile-card dd,
.membership-detail-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.profile-tags {
  min-width: 0;
}

.membership-detail-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-self: start;
  align-content: start;
  gap: 16px;
}

.membership-tabs {
  min-height: 58px;
  height: 58px;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 14px;
}

.membership-tab {
  flex: 0 0 auto;
  height: 58px;
  min-height: 58px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4c5b70;
  padding: 0 14px;
  font-weight: 700;
}

.membership-tab.active,
.membership-tab:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.membership-detail-content {
  min-width: 0;
}

.membership-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}

.membership-detail-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
}

.membership-detail-card.wide-card {
  grid-column: span 2;
}

.runtime-config-panel {
  padding: 18px;
}

.runtime-config-form,
.runtime-config-list,
.runtime-config-group {
  display: grid;
  gap: 16px;
}

.runtime-config-group h3 {
  margin: 0;
  font-size: 16px;
}

.runtime-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px 16px;
}

.runtime-config-field {
  align-content: start;
  min-width: 0;
}

.runtime-config-field small {
  color: #65738a;
  font-size: 12px;
  font-weight: 500;
}

.runtime-config-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #e5eaf2;
  padding-top: 16px;
}

.platform-config-panel {
  padding: 18px;
}

.platform-config-form,
.platform-config-list,
.platform-config-group {
  display: grid;
  gap: 16px;
}

.platform-config-group-header {
  display: grid;
  gap: 4px;
}

.platform-config-group-header h3 {
  margin: 0;
  font-size: 16px;
}

.platform-config-group-header p,
.platform-config-item > p {
  margin: 0;
  color: #65738a;
  font-size: 13px;
  line-height: 1.5;
}

.platform-config-grid {
  display: grid;
  gap: 14px;
}

.platform-config-item {
  min-width: 0;
  display: grid;
  gap: 12px;
  margin: 0;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  padding: 16px;
}

.platform-config-item legend {
  color: #172033;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.platform-config-item legend small {
  color: #65738a;
  font-size: 12px;
  font-weight: 500;
}

.platform-config-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.platform-config-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.platform-config-option-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.platform-config-option-copy {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid #cdd7e5;
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
}

.platform-config-option-copy strong {
  color: #172033;
  font-size: 13px;
}

.platform-config-option-copy small {
  color: #65738a;
  font-size: 12px;
  line-height: 1.4;
}

.platform-config-option:hover .platform-config-option-copy {
  border-color: #91a5bd;
  background: #f8fafc;
}

.platform-config-option-input:focus-visible + .platform-config-option-copy {
  border-color: #13737f;
  box-shadow: 0 0 0 3px rgba(19, 115, 127, 0.12);
}

.platform-config-option-input:checked + .platform-config-option-copy {
  border-color: #13737f;
  background: #eff8f8;
}

.platform-config-meta,
.platform-config-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.platform-config-meta {
  min-width: 0;
  justify-content: space-between;
}

.platform-config-meta code {
  min-width: 0;
  color: #65738a;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.platform-config-actions {
  justify-content: flex-end;
  border-top: 1px solid #e5eaf2;
  padding-top: 16px;
}

.app-versions-panel {
  min-width: 0;
  padding: 20px;
}

.app-versions-panel .surface {
  margin: 0 0 16px;
}

.app-version-form-card,
.app-version-list-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.app-version-form-card h3,
.app-version-list-card h3 {
  margin: 0;
  font-size: 16px;
}

.app-version-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px 16px;
  align-items: end;
}

.app-version-wide {
  grid-column: span 2;
}

.app-version-textarea {
  min-height: 86px;
  resize: vertical;
}

.app-version-actions,
.app-version-list-header,
.app-version-header-actions,
.app-version-modal-header,
.app-version-policy-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.app-version-actions {
  grid-column: 1 / -1;
  border-top: 1px solid #e5eaf2;
  padding-top: 14px;
}

.app-version-list-header {
  justify-content: space-between;
}

.app-version-header-actions,
.app-version-policy-toolbar {
  flex-wrap: wrap;
}

.app-version-table {
  min-width: 920px;
}

.app-version-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.38);
  padding: 18px;
}

.app-version-modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0;
  overflow: hidden;
}

.app-version-policy-modal {
  width: min(1120px, 100%);
}

.admin-user-modal {
  width: min(600px, 100%);
}

.app-version-modal-header {
  justify-content: space-between;
  border-bottom: 1px solid #e5eaf2;
  padding: 16px 18px;
}

.app-version-modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.app-version-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}

.app-version-modal-body.app-version-grid {
  align-items: start;
}

.app-version-policy-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.app-version-policy-form {
  margin-top: 16px;
  border-top: 1px solid #e5eaf2;
  padding-top: 16px;
}

.membership-table-wrap.compact .membership-table {
  min-width: 640px;
}

.detail-table th,
.detail-table td {
  white-space: normal;
}

.diagnostics-panel {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.diagnostics-policy-card,
.diagnostics-list-card {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 18px;
}

.diagnostics-policy-main,
.diagnostics-actions,
.diagnostics-list-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.diagnostics-policy-main,
.diagnostics-list-header {
  justify-content: space-between;
}

.diagnostics-policy-main h3,
.diagnostics-list-header h3 {
  margin: 0;
  font-size: 16px;
}

.diagnostics-policy-main p {
  margin: 6px 0 0;
  color: #65738a;
  font-size: 13px;
  line-height: 1.5;
}

.diagnostics-switch {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cdd7e5;
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  color: #172033;
  font-weight: 700;
  white-space: nowrap;
}

.diagnostics-switch input {
  width: 18px;
  height: 18px;
  accent-color: #13737f;
}

.diagnostics-actions {
  justify-content: flex-end;
  border-top: 1px solid #e5eaf2;
  padding-top: 14px;
}

.diagnostics-table {
  min-width: 1040px;
}

.diagnostics-attrs {
  display: inline-block;
  max-width: 320px;
  color: #0f5962;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.task-center-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 20px;
}

.task-center-panel .surface {
  margin: 0;
}

.task-center-toolbar,
.task-center-view,
.task-center-garment-query,
.task-center-repair-card {
  min-width: 0;
  padding: 18px;
}

.task-center-heading,
.task-center-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-center-heading h3,
.task-center-repair-card h3 {
  margin: 0;
}

.task-center-heading p,
.task-center-repair-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.task-center-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.task-center-tab {
  border: 1px solid #d9e3ea;
  border-radius: 10px;
  background: #f7fafb;
  color: #31505a;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.task-center-tab:hover {
  border-color: #7bb4bb;
  background: #eff8f8;
}

.task-center-tab.active {
  border-color: #13737f;
  background: #e3f3f4;
  color: #0b5f69;
}

.task-center-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.task-center-filter label,
.task-center-repair-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #35515a;
  font-size: 13px;
  font-weight: 700;
}

.task-center-filter input,
.task-center-filter select,
.task-center-repair-form input,
.task-center-repair-form select {
  width: 100%;
}

.task-center-table {
  min-width: 1080px;
}

.task-center-id {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  color: #0f5962;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.task-center-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #eef3f5;
  color: #425b63;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 800;
}

.task-center-status.is-success {
  background: #e1f4ea;
  color: #17643a;
}

.task-center-status.is-warning {
  background: #fff1d6;
  color: #80520c;
}

.task-center-status.is-danger {
  background: #fde6e3;
  color: #9a2c22;
}

.task-center-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-center-row-actions button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.task-center-footer {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.task-center-filter.garment-filter {
  grid-template-columns: minmax(220px, 1fr) auto;
  margin-top: 0;
}

.task-center-garment-view {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.task-center-repair-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.task-center-repair-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.task-center-repair-reason {
  grid-column: 1 / -1;
}

.task-center-garment-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 14px;
}

.api-debug-panel {
  min-width: 0;
}

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

.debug-nav,
.debug-main,
.debug-identity {
  min-width: 0;
  margin: 0;
}

.debug-nav {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.debug-nav-header {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid #e5eaf3;
  padding: 12px;
}

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

.debug-tag {
  min-height: 28px;
  border: 1px solid #cdd7e5;
  border-radius: 999px;
  background: #fff;
  color: #4c5b70;
  padding: 4px 9px;
  font-size: 12px;
}

.debug-tag span {
  margin-left: 4px;
  color: #65738a;
  font-weight: 700;
}

.debug-tag.active,
.debug-tag:hover {
  border-color: #13737f;
  background: #e7f1f3;
  color: #0f5962;
}

.debug-operation-list {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 345px), 1fr));
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding: 6px;
}

.debug-operation {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid #e7edf0;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  padding: 4px;
}

.debug-operation.active,
.debug-operation:hover,
.debug-operation:focus-within {
  border-color: #bed2d7;
  background: #e7f1f3;
}

.debug-operation-launch {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.debug-operation-launch:hover,
.debug-operation-launch:focus-visible {
  background: rgba(255, 255, 255, 0.68);
  outline: none;
}

.debug-operation-detail {
  margin-inline-start: auto;
  min-height: 30px;
  border: 1px solid #c8d9de;
  border-radius: 6px;
  background: #f8fcfd;
  color: #0f5962;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.debug-operation-detail:hover,
.debug-operation-detail:focus-visible {
  border-color: #13737f;
  background: #fff;
  outline: none;
}

.debug-operation-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.debug-operation-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.debug-operation-title-button {
  min-width: 0;
  font: inherit;
  font-weight: 700;
}

.debug-operation-text strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-operation-text code {
  color: #0f5962;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.debug-operation-path-button {
  justify-self: start;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.method-get {
  background: #eaf6ee;
  color: #24663b;
}

.method-post {
  background: #e8f2ff;
  color: #215a9e;
}

.method-put,
.method-patch {
  background: #fff5df;
  color: #83600d;
}

.method-delete {
  background: #fff0ee;
  color: #9b341f;
}

.debug-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.debug-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 51, 0.48);
}

.debug-modal {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  margin: 0;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.28);
}

.debug-contract-modal {
  width: min(1080px, 100%);
}

.debug-contract-body {
  min-height: 0;
  overflow: auto;
  background: #fff;
  padding: 18px;
}

.debug-contract-section {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid #e5eaf3;
  padding: 0 0 18px;
}

.debug-contract-section + .debug-contract-section {
  padding-top: 18px;
}

.debug-contract-section > div {
  min-width: 0;
}

.debug-contract-section:last-child {
  border-bottom: 0;
}

.debug-contract-section h4,
.debug-contract-section h5 {
  margin: 0;
  color: #172033;
}

.debug-contract-section h4 {
  font-size: 15px;
}

.debug-contract-section h5 {
  font-size: 13px;
}

.debug-contract-copy,
.debug-contract-empty {
  margin: 0;
  color: #4c5b70;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
}

.debug-contract-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5eaf3;
  border-radius: 8px;
}

.debug-contract-example {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  min-width: 0;
}

.debug-contract-example pre {
  margin: 0;
  border: 1px solid var(--manage-border, #e5eaf3);
  border-radius: var(--manage-radius, 6px);
  padding: 12px;
  background: var(--manage-surface-subtle, #f8fafc);
  color: var(--manage-text, #172033);
  font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.debug-contract-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.debug-contract-table th,
.debug-contract-table td {
  min-width: 110px;
  border-bottom: 1px solid #e5eaf3;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.debug-contract-table th {
  background: #f8fafc;
  color: #4c5b70;
  font-weight: 700;
}

.debug-contract-table tr:last-child td {
  border-bottom: 0;
}

.debug-contract-table code {
  color: #0f5962;
  overflow-wrap: anywhere;
}

.debug-contract-required,
.debug-contract-optional {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.debug-contract-required {
  background: #fff0ee;
  color: #9b341f;
}

.debug-contract-optional {
  background: #eef3f8;
  color: #65738a;
}

.debug-main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e5eaf3;
  padding: 16px;
}

.debug-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.debug-title-block {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.debug-title-block h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.debug-title-block code {
  color: #0f5962;
  overflow-wrap: anywhere;
}

.debug-operation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #65738a;
  font-size: 12px;
}

.debug-identity {
  order: -1;
  display: grid;
  gap: 14px;
  background: #fff;
  padding: 16px;
}

.debug-identity-header,
.debug-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #4c5b70;
  font-size: 13px;
}

.debug-identity-header {
  justify-content: flex-start;
}

.debug-identity-grid {
  display: grid;
  justify-content: start;
  grid-template-columns: minmax(220px, 320px) minmax(150px, 260px) auto auto;
  gap: 12px;
  align-items: end;
}

.debug-token-state {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

button.debug-token-state {
  cursor: pointer;
}

button.debug-token-state:disabled {
  cursor: default;
}

.debug-token-state.is-valid {
  border-color: #86c79b;
  background: #eefaf2;
  color: #166534;
}

.debug-token-state.is-expired,
.debug-token-state.is-missing {
  border-color: #f1a7a2;
  background: #fff1f0;
  color: #b42318;
}

.debug-token-arrow {
  font-size: 10px;
  line-height: 1;
}

.debug-token-restore {
  justify-self: start;
}

.debug-identity-actions {
  display: contents;
}

.debug-identity-actions .button {
  min-width: 128px;
}

.debug-content-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: auto;
}

.debug-form,
.debug-result {
  min-width: 0;
  padding: 18px;
}

.debug-form {
  border-bottom: 1px solid #e5eaf3;
}

.debug-operation-description {
  display: grid;
  gap: 6px;
  border: 1px solid #cfe4e8;
  border-radius: 8px;
  background: #f2fbfc;
  margin: 0 0 14px;
  padding: 13px 16px;
}

.debug-operation-description h4 {
  margin: 0;
  color: #172033;
  font-size: 13px;
  line-height: 1.35;
}

.debug-operation-description p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
}

.debug-fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  margin: 0 0 14px;
  padding: 16px 18px 18px;
}

.debug-fieldset legend {
  color: #172033;
  font-weight: 700;
  padding: 0 4px;
}

.debug-field small {
  color: #65738a;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.debug-textarea {
  min-height: 108px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.debug-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #65738a;
  font-size: 12px;
}

.debug-upload-row input[type="file"] {
  max-width: 100%;
}

.debug-result {
  display: grid;
  align-content: start;
  gap: 12px;
}

.debug-json-card {
  min-width: 0;
  border: 1px solid #e5eaf3;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  overflow: auto;
}

.debug-response-empty,
.debug-empty {
  color: #65738a;
}

.debug-json-tree {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.debug-json-list {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.debug-json-row {
  display: grid;
  grid-template-columns: minmax(80px, 170px) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  border-left: 1px solid #d9e1ec;
  padding-left: 8px;
}

.debug-json-key {
  min-width: 0;
  color: #0f5962;
  overflow-wrap: anywhere;
}

.debug-json-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.debug-json-scalar {
  color: #172033;
}

.debug-json-null {
  color: #8a95a6;
}

.debug-image-preview {
  display: grid;
  gap: 6px;
  width: min(100%, 420px);
  margin: 4px 0;
}

.debug-image-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid #d9e1ec;
  border-radius: 6px;
  background: #fff;
}

.debug-image-preview figcaption {
  color: #65738a;
  font-family: inherit;
  font-size: 12px;
}

.module-console {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.module-console .surface {
  margin: 0;
}

.module-console-header,
.module-console-card {
  padding: 18px;
}

.module-console-header,
.module-card-title,
.module-scenario-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.module-console-header h3,
.module-card-title h3,
.module-scenario h4 {
  margin: 0;
  font-size: 16px;
}

.module-console-header p,
.module-card-title p,
.module-scenario p {
  margin: 5px 0 0;
  color: #65738a;
  font-size: 13px;
  line-height: 1.5;
}

.admin-users-list-card {
  overflow: hidden;
}

.admin-users-list-header {
  position: relative;
  padding: 17px 18px;
  border-bottom: 1px solid #e5eaf2;
  background: linear-gradient(90deg, #f4fafb 0%, #ffffff 62%);
}

.admin-users-list-header::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #13737f;
  content: "";
}

.admin-users-list-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-users-count,
.admin-users-protected-note {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.admin-users-count {
  min-height: 22px;
  padding: 0 8px;
  background: #e2f2f3;
  color: #0f5962;
}

.admin-users-protected-note {
  margin-right: 6px;
  padding: 3px 6px;
  background: #fff4df;
  color: #9a5b05;
  font-size: 11px;
  vertical-align: 1px;
}

.module-console-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
}

.module-console-tab {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #4c5b70;
  padding: 6px 10px;
  font-weight: 700;
}

.module-console-tab.active,
.module-console-tab:hover {
  background: #e7f1f3;
  color: #0f5962;
}

.module-console-view {
  min-width: 0;
}

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

.module-metric {
  display: grid;
  gap: 6px;
  min-height: 116px;
  border: 1px solid #d9e1ec;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.module-metric span,
.module-metric small {
  color: #65738a;
  font-size: 12px;
}

.module-metric strong {
  color: #172033;
  font-size: 28px;
  line-height: 1.1;
}

.module-console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-console-actions .button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.module-console-table {
  min-width: 980px;
}

.module-console-compact-table {
  min-width: 720px;
}

.ai-routes-table {
  table-layout: fixed;
}

.ai-routes-table th:nth-child(1) { width: 22%; }
.ai-routes-table th:nth-child(2) { width: 26%; }
.ai-routes-table th:nth-child(3) { width: 52%; }

.ai-routes-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.ai-route-business { font-weight: 600; }
.module-page-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.module-page-actions .button { white-space: nowrap; }
.disabled-scenario-list { display: grid; grid-column: 1 / -1; }
.disabled-scenario-item { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--manage-border); overflow-wrap: anywhere; }
.disabled-scenario-item:first-child { padding-top: 0; }
.disabled-scenario-item:last-child { border-bottom: 0; }
.disabled-scenario-item p { margin: 0; }
.disabled-scenario-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.disabled-scenario-actions .ai-scenario-enabled { margin: 0; max-width: none; }
@media (max-width: 760px) {
  .title-row:has(.module-page-actions:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .module-page-actions { width: 100%; }
  .module-page-actions .button { flex: 1; }
}
.ai-route-order-entry { margin-top: 8px; }
.ai-route-solution-type { margin-top: 4px; color: var(--manage-text-secondary); font-size: 12px; }

.ai-tryon-postprocess { margin-top: 12px; }
.ai-scenario-enabled { margin-top: 8px; max-width: 210px; }
.ai-scenario-enabled .ai-route-io { margin-top: 4px; font-weight: normal; }
.ai-tryon-postprocess-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.ai-tryon-upscale-switch {
  flex: 0 0 auto;
  position: relative;
  width: 34px;
  height: 20px;
  padding: 2px;
  border: 1px solid var(--manage-border, #e4e4e7);
  border-radius: 10px;
  background: var(--manage-muted, #71717a);
  cursor: pointer;
}
.ai-tryon-upscale-switch span { display: block; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.ai-tryon-upscale-switch[aria-checked="true"] { background: var(--manage-accent, #762444); border-color: var(--manage-accent, #762444); }
.ai-tryon-upscale-switch[aria-checked="true"] span { transform: translateX(14px); }
.ai-tryon-upscale-switch:focus-visible { outline: 2px solid var(--manage-accent, #762444); outline-offset: 3px; }
.ai-tryon-upscale-switch:disabled { opacity: 0.5; cursor: wait; }
.ai-tryon-postprocess-status { margin-top: 4px; font-size: 12px; color: var(--manage-muted, #71717a); overflow-wrap: anywhere; }
.ai-tryon-postprocess-status:empty { display: none; }
.ai-route-io {
  margin-top: 4px;
  color: var(--manage-text-secondary, #65738a);
}

.ai-route-model-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 30px;
}

.ai-route-model-route .button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.ai-route-model-remark {
  color: #1d5f9e;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .ai-routes-table,
  .ai-routes-table tbody,
  .ai-routes-table tr,
  .ai-routes-table td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .ai-routes-table thead { display: none; }
  .ai-routes-table tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--manage-border, #e5eaf3);
  }

  .workspace .ai-routes-table td {
    border-bottom: 0;
    padding: 4px 12px;
  }

  .ai-routes-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--manage-text-secondary, #65738a);
    font-size: 11px;
  }
}

/* 系统日志页保持与 Manage 工作台一致的密度，长错误详情在模态弹窗内按需查看。 */
.system-logs-panel {
  min-width: 0;
  padding: 20px;
}

.system-logs-page {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.system-logs-page .surface {
  margin: 0;
}

.system-logs-header,
.system-logs-filter,
.system-logs-list {
  min-width: 0;
  padding: 18px;
}

.system-logs-header,
.system-logs-header-actions,
.system-logs-filter-actions,
.system-logs-filter-buttons,
.system-logs-footer,
.system-logs-pagination,
.system-logs-detail-header {
  display: flex;
  align-items: center;
}

.system-logs-header,
.system-logs-footer,
.system-logs-detail-header {
  justify-content: space-between;
  gap: 16px;
}

.system-logs-header h3,
.system-logs-detail-header h3,
.system-logs-attributes-block h4 {
  margin: 0;
}

.system-logs-header p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--manage-text-muted, #918782);
  line-height: 1.5;
}

.system-logs-header-actions,
.system-logs-filter-buttons,
.system-logs-pagination {
  gap: 8px;
}

.system-logs-view-switch {
  display: inline-flex;
  width: fit-content;
  gap: 2px;
  border: 1px solid var(--manage-border, #e2dcd8);
  border-radius: var(--manage-radius, 6px);
  background: var(--manage-surface-subtle, #faf7f5);
  padding: 3px;
}

.system-logs-view-button {
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 7px 14px;
  color: var(--manage-text-secondary, #6f6661);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.system-logs-view-button:hover {
  background: var(--manage-surface, #fff);
}

.system-logs-view-button.is-active {
  background: var(--manage-accent, #762444);
  color: #fff;
}

.system-logs-view-button:focus-visible {
  outline: 2px solid var(--manage-accent, #762444);
  outline-offset: 2px;
}

.system-logs-total {
  color: var(--manage-text-secondary, #6f6661);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.system-logs-filter {
  display: grid;
  gap: 16px;
}

.system-logs-filter-fields {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(140px, 1.1fr) minmax(88px, 0.7fr) minmax(105px, 0.8fr) minmax(135px, 1.2fr) minmax(155px, 1.4fr) minmax(155px, 1.4fr);
  gap: 12px;
  overflow-x: auto;
}

.system-logs-date-input {
  cursor: pointer;
}

.system-logs-filter-actions {
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--manage-border, #e2dcd8);
  padding-top: 14px;
}

.system-logs-filter-actions .muted {
  margin-left: auto;
}

.system-logs-list {
  overflow: hidden;
}

.system-logs-view-note {
  margin: 0 0 12px;
  color: var(--manage-text-muted, #918782);
  font-size: 12px;
  line-height: 1.5;
}

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

.system-logs-table {
  min-width: 1080px;
}

.system-logs-table .system-logs-time {
  width: 158px;
  color: var(--manage-text-secondary, #6f6661);
  white-space: nowrap;
}

.system-logs-table .system-logs-message {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-logs-table .system-logs-request-id {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-logs-request-time {
  display: table-cell;
}

.system-logs-time-values {
  display: grid;
  gap: 2px;
}

.system-logs-time-values span {
  display: block;
  line-height: 1.5;
}

.system-logs-time-values span + span {
  color: var(--manage-text-muted, #918782);
}

.system-logs-count,
.system-logs-severity-count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.system-logs-severity-count {
  display: table-cell;
}

.system-logs-severity-values {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.system-logs-modules {
  max-width: 200px;
}

.system-logs-copy {
  display: block;
  max-width: 190px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--manage-accent, #762444);
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-logs-copy:hover,
.system-logs-copy:focus-visible {
  color: var(--manage-accent-hover, #621d39);
  text-decoration: underline;
}

.system-logs-level,
.system-logs-module {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--manage-surface-subtle, #faf7f5);
  color: var(--manage-text-secondary, #6f6661);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.system-logs-level.is-error {
  background: var(--manage-danger-bg, #fff0ef);
  color: var(--manage-danger-text, #9d3329);
}

.system-logs-level.is-warning {
  background: var(--manage-warning-bg, #fff4df);
  color: var(--manage-warning-text, #875709);
}

.system-logs-empty,
.system-logs-error {
  display: grid;
  min-height: 168px;
  place-items: center;
  color: var(--manage-text-muted, #918782);
  text-align: center;
}

.system-logs-error {
  color: var(--manage-danger-text, #9d3329);
}

.system-logs-footer {
  gap: 16px;
  margin-top: 16px;
  color: var(--manage-text-muted, #918782);
  font-size: 12px;
}

.system-logs-detail {
  width: min(860px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  margin: auto;
  border: 1px solid var(--manage-border, #e2dcd8);
  border-radius: var(--manage-radius, 6px);
  background: var(--manage-surface, #fff);
  color: var(--manage-text, #342d2b);
  padding: 0;
  box-shadow: 0 18px 48px rgba(52, 45, 43, 0.22);
}

.system-logs-detail::backdrop {
  background: rgba(34, 28, 27, 0.46);
}

.system-logs-detail-shell {
  display: grid;
  gap: 16px;
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  padding: 18px;
}

.system-logs-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  border-top: 1px solid var(--manage-border, #e2dcd8);
}

.system-logs-detail-grid > div {
  display: grid;
  grid-template-columns: minmax(92px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--manage-border, #e2dcd8);
}

.system-logs-detail-grid dt {
  color: var(--manage-text-muted, #918782);
  font-size: 12px;
  font-weight: 650;
}

.system-logs-detail-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--manage-text, #342d2b);
  font-family: var(--manage-font-sans, Inter, sans-serif);
  font-size: 13px;
}

.system-logs-attributes-block {
  display: grid;
  gap: 8px;
}

.system-logs-attributes-block pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--manage-border, #e2dcd8);
  border-radius: var(--manage-radius, 6px);
  background: var(--manage-surface-subtle, #faf7f5);
  padding: 12px;
  color: var(--manage-text-secondary, #6f6661);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.system-logs-timeline-summary-text,
.system-logs-timeline-reason {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.system-logs-timeline-summary-text {
  color: var(--manage-text, #342d2b);
  font-weight: 650;
}

.system-logs-timeline-reason,
.system-logs-timeline-note {
  color: var(--manage-text-muted, #918782);
}

.system-logs-timeline-note {
  margin: 0;
  font-size: 12px;
}

.system-logs-detail-error {
  color: var(--manage-danger-text, #9d3329);
}

@media (max-width: 760px) {
  .system-logs-panel {
    padding: 14px;
  }

  .system-logs-header,
  .system-logs-footer,
  .system-logs-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .system-logs-header-actions,
  .system-logs-filter-buttons,
  .system-logs-pagination {
    width: 100%;
  }

  .system-logs-view-switch {
    width: 100%;
  }

  .system-logs-view-button {
    flex: 1 1 0;
  }

  .system-logs-header-actions .button,
  .system-logs-filter-buttons .button,
  .system-logs-pagination .button {
    flex: 1 1 0;
  }

  .system-logs-filter-fields {
    overflow-x: visible;
  }

  .system-logs-filter-fields,
  .system-logs-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .system-logs-filter-actions .muted {
    margin-left: 0;
  }

  .system-logs-table {
    min-width: 0;
  }

  .system-logs-request-time,
  .system-logs-severity-count {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .system-logs-time-values,
  .system-logs-severity-values {
    min-width: 0;
  }

  .system-logs-severity-values {
    gap: 4px;
  }

  .system-logs-severity-values .system-logs-level {
    width: fit-content;
  }

  .system-logs-table thead {
    display: none;
  }

  .system-logs-table,
  .system-logs-table tbody,
  .system-logs-table tr,
  .system-logs-table td {
    display: block;
    width: 100%;
  }

  .system-logs-table tr {
    border-bottom: 1px solid var(--manage-border, #e2dcd8);
    padding: 10px 0;
  }

  .system-logs-table tr:last-child {
    border-bottom: 0;
  }

  .system-logs-table td {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    border: 0;
    padding: 5px 0;
    white-space: normal;
  }

  .system-logs-table td::before {
    content: attr(data-label);
    color: var(--manage-text-muted, #918782);
    font-size: 12px;
    font-weight: 650;
  }

  .system-logs-table td > * {
    min-width: 0;
  }

  .system-logs-table .system-logs-message,
  .system-logs-table .system-logs-request-id,
  .system-logs-copy {
    max-width: none;
  }

  .system-logs-table .system-logs-detail-button {
    width: 100%;
  }

  .system-logs-detail {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .system-logs-detail-shell {
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .system-logs-detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .system-logs-detail-header .button {
    width: 100%;
  }
}

.module-ellipsis {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-call-logs-table {
  table-layout: fixed;
  min-width: 0;
}

.ai-call-logs-table th:nth-child(1) { width: 13%; }
.ai-call-logs-table th:nth-child(2) { width: 21%; }
.ai-call-logs-table th:nth-child(3) { width: 10%; }
.ai-call-logs-table th:nth-child(4) { width: 20%; }
.ai-call-logs-table th:nth-child(5) { width: 7%; }
.ai-call-logs-table th:nth-child(6) { width: 7%; }
.ai-call-logs-table th:nth-child(7) { width: 22%; }

.ai-call-logs-table td {
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.ai-call-logs-table .ai-call-log-error {
  white-space: pre-wrap;
}

.ai-timing-link { margin-top: 4px; white-space: normal; }
.ai-timing-modal > .module-console-modal { margin: 0; min-width: 0; }
.module-console-form.ai-timing-detail { display: block; min-width: 0; }
.ai-timing-detail { font-variant-numeric: tabular-nums; }
.ai-derivation { padding-bottom: 16px; border-bottom: 1px solid var(--manage-border, #e5eaf3); font-size: 13px; line-height: 1.6; }
.ai-derivation-heading, .ai-derivation-step-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.ai-derivation-heading h3 { margin: 0; font-size: 16px; }
.ai-derivation-heading span, .ai-derivation-step-heading span { color: var(--manage-text-secondary, #65738a); font-size: 12px; }
.ai-derivation h4 { margin: 16px 0 8px; font-size: 13px; }
.ai-derivation-facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; margin: 8px 0; }
.ai-derivation-facts dt { color: var(--manage-text-secondary, #65738a); }
.ai-derivation-facts dd { margin: 0; overflow-wrap: anywhere; }
.ai-derivation-steps { list-style: none; padding: 0; margin: 0; }
.ai-derivation-steps > li { padding: 10px 0; border-top: 1px solid var(--manage-border, #e5eaf3); overflow-wrap: anywhere; }
.ai-derivation-steps p { margin: 4px 0; }
.ai-derivation-evidence summary { cursor: pointer; color: var(--manage-text-secondary, #65738a); }
.ai-derivation-explanations { padding-left: 20px; margin: 8px 0; }
.ai-derivation-explanations p { margin: 4px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .ai-derivation-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ai-derivation-facts dd { margin-bottom: 8px; }
}
.ai-timing-summary,
.ai-timing-call-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.ai-timing-summary { padding: 12px 0; border-bottom: 1px solid var(--manage-border, #e5eaf3); }
.ai-timing-summary strong { font-size: 20px; }
.ai-timing-note,
.ai-timing-provider { font-size: 12px; line-height: 1.6; color: var(--manage-text-secondary, #65738a); }
.ai-timing-notice { padding: 8px 12px; border-left: 3px solid var(--manage-border, #e5eaf3); font-size: 13px; line-height: 1.6; }
.ai-timing-call { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--manage-border, #e5eaf3); }
.ai-timing-call-heading { cursor: pointer; font-size: 15px; padding: 4px 0; }
.ai-timing-call-heading span { flex: 1; }
.ai-timing-call-heading::before { content: "▸"; }
.ai-timing-call[open] > .ai-timing-call-heading::before { transform: rotate(90deg); }
.ai-timing-request { font-size: 12px; overflow-wrap: anywhere; }
.ai-call-images { margin: 16px 0; padding: 12px 0; border-top: 1px solid var(--manage-border, #e5eaf3); border-bottom: 1px solid var(--manage-border, #e5eaf3); }
.ai-call-images h4 { margin: 0 0 8px; font-size: 13px; }
.ai-call-images > section + section { margin-top: 16px; }
.ai-call-images .ai-call-image-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 12px; }
.ai-call-images .ai-call-image-gallery figure { width: 100%; max-width: 320px; }
.ai-call-images .ai-call-image-gallery img { width: 100%; height: 240px; background: var(--manage-surface, #fafafa); }
.ai-call-images .ai-call-image-gallery figcaption { margin-top: 4px; }
.ai-timing-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin: 12px 0; font-size: 12px; }
.ai-timing-metrics dt { color: var(--manage-text-secondary, #65738a); }
.ai-timing-metrics dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.ai-timing-group { border-top: 1px solid var(--manage-border, #e5eaf3); }
.ai-timing-group summary { padding: 10px 0; cursor: pointer; font-size: 13px; font-weight: 600; }
.ai-timing-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; }
.ai-timing-table th,
.ai-timing-table td { padding: 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--manage-border, #e5eaf3); white-space: normal; overflow-wrap: anywhere; }
.ai-timing-table th:last-child { width: 112px; text-align: right; }
.ai-timing-table .ai-timing-number { text-align: right; font-variant-numeric: tabular-nums; }
.ai-timing-table small { display: block; margin-top: 4px; color: var(--manage-text-secondary, #65738a); line-height: 1.6; }
.ai-timing-table .ai-timing-level-1 { padding-left: 20px; }
.ai-timing-table .ai-timing-level-2 { padding-left: 32px; }

@media (max-width: 600px) {
  .ai-timing-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-timing-table th:last-child { width: 86px; }
  .ai-timing-table .ai-timing-level-1 { padding-left: 12px; }
  .ai-timing-table .ai-timing-level-2 { padding-left: 20px; }
}

@media (max-width: 820px) {
  .ai-call-logs-table,
  .ai-call-logs-table tbody,
  .ai-call-logs-table tr,
  .ai-call-logs-table td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .ai-call-logs-table thead { display: none; }
  .ai-call-logs-table tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--manage-border, #e5eaf3);
  }

  .workspace .ai-call-logs-table td {
    border-bottom: 0;
    padding: 4px 12px;
  }

  .ai-call-logs-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--manage-text-secondary, #65738a);
    font-size: 11px;
  }
}

.module-scenario-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.module-scenario {
  border: 1px solid #e1e7f0;
  border-radius: 7px;
  background: #fbfcfe;
  padding: 14px;
}

.module-scenario .membership-table-wrap {
  margin-top: 12px;
}

.module-json-preview {
  max-height: 360px;
  overflow: auto;
  border: 1px solid #e1e7f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #4c5b70;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.module-console-modal {
  width: min(760px, 100%);
}

.catalog-impact { grid-column: 1 / -1; min-width: 0; }
.catalog-action-modal > .module-console-modal { margin: 0; min-width: 0; }
.catalog-impact > p { margin: 0 0 12px; }
.workspace .catalog-impact p.catalog-impact-warning { color: var(--manage-warning-text, #875709); }
.catalog-impact-list { max-height: 50vh; overflow: auto; border-top: 1px solid var(--manage-border, #e5e0dc); }
.catalog-impact-model { padding: 12px 0; border-bottom: 1px solid var(--manage-border, #e5e0dc); overflow-wrap: anywhere; }
.catalog-impact-model > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.catalog-impact-model ul { margin: 8px 0 0; padding-left: 20px; }
.catalog-impact-model li { margin: 4px 0; }
.workspace .catalog-impact .catalog-impact-model small { display: block; color: var(--manage-text-secondary); }

.module-console-modal-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.module-console-modal-heading h3 {
  overflow-wrap: anywhere;
}

#module-console-modal > .module-console-modal,
.model-route-advanced-backdrop > .app-version-modal {
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.model-route-advanced-backdrop {
  z-index: 60;
}

.model-route-advanced-backdrop h3 {
  overflow-wrap: anywhere;
}

.workspace .model-route-advanced-json {
  min-height: 240px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.workspace .model-route-order-editor {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
}

.workspace .model-route-order-intro,
.workspace .model-route-order-empty,
.workspace .model-route-order-add-empty {
  margin: 0;
  color: var(--manage-text-secondary);
  font-size: 13px;
}

.workspace .model-route-order-add {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.workspace .model-route-order-add label {
  color: var(--manage-text);
  font-size: 13px;
  font-weight: 650;
}

.workspace .model-route-order-add .input {
  min-width: 0;
}

.workspace .model-route-order-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workspace .model-route-order-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--manage-border);
  border-radius: var(--manage-radius);
  background: var(--manage-surface-subtle);
}

.workspace .model-route-order-rank {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 4px;
  background: var(--manage-accent-subtle);
  color: var(--manage-accent);
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.workspace .model-route-order-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workspace .model-route-order-name {
  overflow-wrap: anywhere;
  color: var(--manage-text);
  font-size: 13px;
}

.workspace .model-route-order-meta {
  color: var(--manage-text-muted);
  font-size: 12px;
}

.workspace .model-route-order-remark {
  margin-top: 4px;
  color: var(--manage-text);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.workspace .model-route-order-remark[hidden] {
  display: none;
}

.workspace .model-route-remark-editor {
  grid-column: 2 / -1;
}

.workspace .model-route-remark-editor textarea {
  resize: vertical;
}

.workspace .model-route-order-error {
  color: var(--manage-danger-text);
  font-size: 13px;
}

.workspace .model-route-order-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace .model-route-order-controls .button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.module-console-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.module-console-wide,
.module-console-form-actions {
  grid-column: 1 / -1;
}

.module-console-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e5eaf2;
  padding-top: 14px;
}

.module-console-form-actions .muted {
  margin-right: auto;
}

.module-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: #4c5b70;
  font-size: 13px;
}

@media (max-width: 760px) {
  .workspace .model-route-order-add {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .workspace .model-route-order-add label {
    grid-column: 1 / -1;
  }

  .input,
  .debug-textarea,
  .debug-upload-row input[type="file"] {
    font-size: 16px !important;
  }

  .login-shell {
    align-items: start;
    padding: 14px;
  }

  .login-panel {
    margin-top: 18px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.1);
  }

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

  .sidebar {
    min-height: auto;
    height: auto;
    display: block;
    position: relative;
    border-right: 0;
    border-bottom: 1px solid #d9e1ec;
    padding: 14px 14px 12px;
  }

  .sidebar-header {
    gap: 10px;
    padding-right: 74px;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .sidebar-footer {
    position: absolute;
    top: 14px;
    right: 14px;
    margin: 0;
    padding: 0;
  }

  .logout-button {
    width: auto;
    min-width: 58px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    padding: 14px;
  }

  .surface {
    margin: 14px;
  }

  .placeholder {
    min-height: 160px;
  }

  .membership-panel {
    padding: 14px;
  }

  .membership-filter-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .membership-primary-filter,
  .membership-filter-actions,
  .membership-filter-form.is-expanded .membership-filter-actions {
    grid-column: 1 / -1;
  }

  .membership-advanced-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  input[type="date"].input {
    width: 100%;
    inline-size: 100%;
    max-width: 100%;
    max-inline-size: 100%;
    min-width: 0;
    min-inline-size: 0;
    -webkit-appearance: none;
    appearance: none;
  }

  .membership-filter-toggle {
    width: 100%;
  }

  .membership-filter-actions,
  .membership-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .membership-bulk-actions,
  .membership-query-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .membership-filter-actions .button {
    width: 100%;
  }

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

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

  .membership-detail-card.wide-card {
    grid-column: auto;
  }

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

  .runtime-config-actions,
  .platform-config-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .platform-config-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-versions-panel {
    padding: 14px;
  }

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

  .app-version-wide,
  .app-version-actions {
    grid-column: 1 / -1;
  }

  .app-version-actions,
  .app-version-list-header,
  .app-version-header-actions,
  .app-version-modal-header,
  .app-version-policy-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .diagnostics-panel {
    padding: 14px;
  }

  .module-console {
    gap: 14px;
    padding: 14px;
  }

  .module-console-header,
  .module-card-title,
  .module-scenario-head,
  .module-console-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .module-console-header .button,
  .module-card-title > .button,
  .module-console-form-actions .button {
    width: 100%;
  }

  .module-console-form-actions .muted {
    margin-right: 0;
  }

  .module-metric-grid,
  .module-console-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-console-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .module-console-tab {
    flex: 0 0 auto;
  }

  .workspace .model-route-order-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .workspace .model-route-order-controls {
    grid-column: 2;
  }

  .diagnostics-policy-main,
  .diagnostics-actions,
  .diagnostics-list-header {
    align-items: stretch;
    flex-direction: column;
  }

  .diagnostics-switch {
    justify-content: center;
  }

  .task-center-panel {
    padding: 14px;
  }

  .task-center-heading,
  .task-center-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .task-center-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-center-filter,
  .task-center-filter.garment-filter,
  .task-center-garment-view,
  .task-center-repair-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-center-repair-reason {
    grid-column: auto;
  }

  .task-center-table {
    min-width: 0;
  }

  .task-center-table thead {
    display: none;
  }

  .task-center-table,
  .task-center-table tbody,
  .task-center-table tr,
  .task-center-table td {
    display: block;
    width: 100%;
  }

  .task-center-table tr {
    border-bottom: 1px solid #dfe7ec;
    padding: 10px 0;
  }

  .task-center-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.35fr) minmax(0, 0.65fr);
    gap: 10px;
    border: 0;
    padding: 7px 0;
  }

  .task-center-table td::before {
    content: attr(data-label);
    color: #61767d;
    font-size: 12px;
    font-weight: 800;
  }

  .task-center-id {
    max-width: none;
  }

  .app-version-modal-backdrop {
    align-items: start;
    justify-items: stretch;
    padding: 8px;
  }

  .app-version-modal,
  .app-version-policy-modal {
    width: 100%;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .app-version-modal-body {
    padding: 14px;
  }

  .membership-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .membership-tab {
    flex: 0 0 auto;
  }

  .member-profile-card dl div,
  .membership-detail-card dl div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .debug-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .debug-nav {
    height: auto;
    margin-bottom: 14px;
  }

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

  .debug-main {
    display: block;
  }

  .debug-modal-backdrop {
    align-items: start;
    justify-items: stretch;
    overflow: hidden;
    padding: 8px;
  }

  .debug-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    margin: 0;
    max-height: none;
    overflow: hidden;
  }

  .debug-main-header,
  .debug-identity-header,
  .debug-result-header {
    align-items: stretch;
    flex-direction: column;
  }

  .debug-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .debug-header-actions .button,
  .debug-header-actions .icon-button {
    width: 100%;
  }

  .debug-identity-grid {
    display: block;
  }

  .debug-content-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .debug-identity-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .debug-identity-actions .button {
    min-width: 0;
  }

  .debug-identity-grid .field,
  .debug-identity-actions {
    margin-top: 10px;
  }

  .debug-form {
    border-bottom: 1px solid #e5eaf3;
  }

  .debug-form,
  .debug-result {
    padding: 12px;
  }

  .debug-fieldset {
    padding: 12px;
  }

  .debug-json-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .debug-json-key {
    font-weight: 700;
  }

  .contract-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .contract-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .contract-frame {
    min-height: calc(100vh - 124px);
  }
}

@media (max-width: 420px) {
  .contract-actions {
    grid-template-columns: 1fr;
  }

  nav {
    grid-template-columns: 1fr;
  }
}

/* Manage 后台：模块工作台壳层 */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  grid-template-rows: 76px minmax(0, 1fr);
  gap: 16px;
  background: #eeebe8;
  padding: 16px;
}

.app-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 254px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid #ded8d4;
  border-radius: 8px;
  background: #fffdfa;
  padding: 10px 14px;
}

.app-header .brand {
  padding: 0 6px;
  color: #25201e;
}

.primary-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  width: min(760px, 100%);
  justify-self: start;
  border: 1px solid #e1d9d6;
  border-radius: 8px;
  overflow: hidden;
}

.primary-nav-item {
  min-height: 42px;
  border: 0;
  border-right: 1px solid #e7e0dc;
  background: #fffdfa;
  color: #6f6661;
  padding: 8px 10px;
  font-weight: 650;
  white-space: nowrap;
}

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

.primary-nav-item:hover {
  background: #f8f2ef;
  color: #6f1f45;
}

.primary-nav-item.active {
  background: #762444;
  color: #fff;
}

.app-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.app-header .admin-chip {
  min-width: 0;
  overflow: hidden;
  color: #6f6661;
  text-overflow: ellipsis;
}

.app-header .logout-button {
  width: auto;
  min-width: 58px;
  border-color: #dcd3d0;
  background: #fffdfa;
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  top: 16px;
  align-self: start;
  height: calc(100dvh - 108px);
  min-height: 520px;
  border: 1px solid #ded8d4;
  border-radius: 8px;
  background: #fffdfa;
  padding: 18px 14px;
}

.sidebar-header {
  display: grid;
  align-content: start;
  justify-content: start;
  gap: 4px;
  padding: 3px 8px 14px;
}

.sidebar-kicker,
.page-breadcrumb {
  color: #918782;
  font-size: 12px;
  line-height: 1.3;
}

.sidebar-header strong {
  color: #332d2a;
  font-size: 16px;
}

.secondary-nav {
  display: block;
  margin: 0;
  overflow-y: auto;
}

.secondary-nav-group {
  display: grid;
  gap: 8px;
}

.secondary-nav .nav-item {
  min-height: 42px;
  border: 1px solid #e8e1dd;
  border-radius: 7px;
  background: #fffdfa;
  color: #675f5a;
  padding: 9px 12px;
  font-weight: 600;
}

.secondary-nav .nav-item:hover {
  border-color: #d7c0cb;
  background: #fbf4f6;
  color: #6f1f45;
}

.secondary-nav .nav-item.active {
  border-color: #d7afbf;
  border-left: 3px solid #762444;
  background: #f8eaef;
  color: #6f1f45;
  padding-left: 10px;
}

.workspace {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: calc(100dvh - 108px);
  border: 1px solid #ded8d4;
  border-radius: 8px;
  background: #fffdfa;
  overflow: hidden;
}

.topbar {
  min-height: 76px;
  border-bottom-color: #e6dfdb;
  background: #fffdfa;
  padding: 16px 22px;
}

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

.title-row h2 {
  margin-top: 3px;
  color: #2b2523;
  font-size: 20px;
}

.surface {
  border-color: #e2dcd8;
  background: #fff;
}

.placeholder {
  min-height: 260px;
  display: grid;
  place-items: center;
  margin: 20px;
  color: #7a706b;
  text-align: center;
}

.placeholder > div {
  display: grid;
  gap: 8px;
  max-width: 420px;
  padding: 24px;
}

.placeholder strong {
  color: #413835;
  font-size: 16px;
}

.module-console-tabs {
  display: none;
}

.input:focus {
  border-color: #762444;
  box-shadow: 0 0 0 3px rgba(118, 36, 68, 0.12);
}

.button.primary {
  border-color: #762444;
  background: #762444;
}

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

  .app-header {
    grid-template-columns: 218px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .app-header .admin-chip {
    display: none;
  }

  .sidebar {
    top: 12px;
    height: calc(100dvh - 100px);
  }

  .workspace {
    min-height: calc(100dvh - 100px);
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .app-header,
  .sidebar,
  .workspace {
    border-radius: 0;
  }

  .app-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }

  .app-header .brand {
    flex: 1 1 auto;
  }

  .primary-nav {
    order: 3;
    grid-auto-columns: minmax(112px, max-content);
    grid-auto-flow: column;
    grid-template-columns: none;
    width: 100%;
    overflow-x: auto;
  }

  .primary-nav-item {
    border-bottom: 0;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    border-top: 0;
    border-bottom: 0;
    padding: 16px 14px;
  }

  .sidebar-header {
    padding: 0 2px 12px;
  }

  .secondary-nav {
    overflow: visible;
  }

  .secondary-nav-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    min-height: 0;
    border-top: 1px solid #ded8d4;
  }

  .topbar {
    min-height: 70px;
    padding: 14px;
  }

  .placeholder {
    margin: 14px;
  }
}

@media (max-width: 480px) {
  .secondary-nav-group {
    grid-template-columns: 1fr;
  }

  .app-header .brand {
    padding-left: 0;
  }
}

/* Manage 子页面公共视觉系统：所有业务页继承同一组工作台 Token。 */
.app-shell {
  --manage-font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --manage-canvas: #eeebe8;
  --manage-surface: #fffdfa;
  --manage-surface-strong: #ffffff;
  --manage-surface-subtle: #faf7f5;
  --manage-surface-hover: #fbf4f6;
  --manage-border: #e2dcd8;
  --manage-border-strong: #d8ceca;
  --manage-text: #342d2b;
  --manage-text-secondary: #6f6661;
  --manage-text-muted: #918782;
  --manage-accent: #762444;
  --manage-accent-hover: #621d39;
  --manage-accent-subtle: #f8eaef;
  --manage-success-bg: #eaf7ef;
  --manage-success-text: #237144;
  --manage-warning-bg: #fff4df;
  --manage-warning-text: #875709;
  --manage-danger-bg: #fff0ef;
  --manage-danger-text: #9d3329;
  --manage-control-height: 36px;
  --manage-radius: 6px;
  --muted: var(--manage-text-muted);
}

.workspace {
  color: var(--manage-text);
  font-family: var(--manage-font-sans);
  font-size: 13px;
  line-height: 1.5;
}

.workspace :is(button, input, select, textarea) {
  font-family: inherit;
}

.workspace :is(h3, h4, h5) {
  color: var(--manage-text);
}

.workspace :is(p, small, .muted, .two-line-cell small) {
  color: var(--manage-text-muted);
}

.workspace .surface {
  border-color: var(--manage-border);
  border-radius: 8px;
  background: var(--manage-surface-strong);
}

.workspace .alert {
  border-color: #efc4bf;
  border-radius: var(--manage-radius);
  background: var(--manage-danger-bg);
  color: var(--manage-danger-text);
  font-size: 13px;
}

.workspace .field {
  gap: 5px;
  color: var(--manage-text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.workspace .input,
.workspace .debug-textarea,
.workspace .app-version-textarea {
  min-height: var(--manage-control-height);
  border-color: var(--manage-border-strong);
  border-radius: var(--manage-radius);
  background: var(--manage-surface-strong);
  color: var(--manage-text);
  padding: 7px 10px;
  font-size: 13px;
}

.workspace select.input {
  height: var(--manage-control-height);
  min-height: var(--manage-control-height);
  appearance: auto;
  background-image: none;
  padding-right: 10px;
}

/* 统一原生 select 的展示层，浮层配色与尺寸沿用 AITools Web，并继承 Manage Token。 */
.manage-select { position: relative; display: inline-flex; flex-direction: column; width: 100%; min-width: 0; max-width: 100%; vertical-align: middle; }
.manage-select > select.manage-select-native {
  position: absolute !important; width: 1px !important; min-width: 0 !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; border: 0 !important; clip-path: inset(50%); opacity: 0; pointer-events: none;
}
.workspace .manage-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 0;
  min-height: var(--manage-control-height); font-weight: 400; line-height: 20px; text-align: left; cursor: pointer;
  background: var(--manage-surface-strong); color: var(--manage-text);
}
.manage-select-value { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.manage-select-trigger::after {
  content: ""; flex-shrink: 0; width: 7px; height: 7px; margin: -3px 3px 0 0;
  border-right: 1.5px solid var(--manage-text-muted); border-bottom: 1.5px solid var(--manage-text-muted);
  transform: rotate(45deg); transition: transform .15s;
}
.workspace .manage-select-trigger:hover:not(:disabled) { border-color: var(--manage-text-muted); }
.workspace .manage-select-trigger[aria-expanded="true"] { border-color: var(--manage-accent); box-shadow: 0 0 0 3px var(--manage-accent-subtle); }
.manage-select-trigger[aria-expanded="true"]::after { transform: rotate(225deg); margin-top: 3px; }
.workspace .manage-select-trigger:focus-visible { outline: 2px solid var(--manage-accent); outline-offset: 2px; box-shadow: none; }
.workspace .manage-select-trigger:disabled { color: var(--manage-text-muted); background: var(--manage-surface-subtle); cursor: not-allowed; }
.workspace .manage-select-trigger[aria-invalid="true"] { border-color: var(--manage-danger-text); }
.manage-select-error { margin-top: 5px; color: var(--manage-danger-text); font-size: 12px; font-weight: 400; }
.manage-select-menu {
  position: fixed; inset: auto; z-index: 100; margin: 0; padding: 6px; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--manage-border); border-radius: 8px; background: var(--manage-surface-strong); color: var(--manage-text);
  box-shadow: 0 8px 24px rgba(52, 45, 43, .14); font: 13px/1.5 var(--manage-font-sans);
}
.manage-select-option { position: relative; padding: 9px 32px 9px 10px; border-radius: 6px; overflow-wrap: anywhere; cursor: pointer; }
.manage-select-option.is-active { background: var(--manage-surface-subtle); }
.manage-select-option.is-selected { background: var(--manage-accent-subtle); color: var(--manage-accent); }
.manage-select-option.is-selected::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 10px; margin-top: -6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.manage-select-option[aria-disabled="true"] { color: var(--manage-text-muted); cursor: not-allowed; opacity: .65; }
.manage-select-group { padding: 6px 10px; color: var(--manage-text-muted); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .manage-select-trigger::after { transition: none; } }

.workspace .input::placeholder {
  color: #aaa09b;
}

.workspace .input:focus,
.workspace .platform-config-option-input:focus-visible + .platform-config-option-copy {
  border-color: var(--manage-accent);
  box-shadow: 0 0 0 3px rgba(118, 36, 68, 0.11);
}

.workspace .button,
.workspace .icon-button {
  min-height: var(--manage-control-height);
  border-color: var(--manage-border-strong);
  border-radius: var(--manage-radius);
  background: var(--manage-surface-strong);
  color: var(--manage-text-secondary);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 650;
}

.workspace .button:hover:not(:disabled),
.workspace .icon-button:hover:not(:disabled) {
  border-color: #cbb9c1;
  background: var(--manage-surface-hover);
  color: var(--manage-accent);
}

.workspace .button.primary {
  border-color: var(--manage-accent);
  background: var(--manage-accent);
  color: #fff;
}

.workspace .button.primary:hover:not(:disabled) {
  border-color: var(--manage-accent-hover);
  background: var(--manage-accent-hover);
  color: #fff;
}

.workspace .button.danger {
  border-color: #efc4bf;
  background: var(--manage-danger-bg);
  color: var(--manage-danger-text);
}

.workspace .link-button,
.workspace .copy-id-button,
.workspace .diagnostics-attrs,
.workspace .task-center-id,
.workspace .debug-operation-text code,
.workspace .debug-contract-table code,
.workspace .debug-title-block code,
.workspace .debug-json-key {
  color: var(--manage-accent);
}

.workspace .link-button:hover,
.workspace .copy-id-button:hover,
.workspace .copy-id-button:focus-visible,
.workspace .copy-id-button.is-copied {
  color: var(--manage-accent-hover);
}

.workspace .membership-table,
.workspace .debug-contract-table {
  color: var(--manage-text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.workspace .membership-table th,
.workspace .membership-table td,
.workspace .debug-contract-table th,
.workspace .debug-contract-table td {
  border-color: var(--manage-border);
  padding: 9px 12px;
}

.workspace .membership-table th,
.workspace .debug-contract-table th {
  background: var(--manage-surface-subtle);
  color: var(--manage-text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.workspace .membership-table tbody tr:hover,
.workspace .membership-user-table tbody tr:hover .membership-action-cell {
  background: var(--manage-surface-hover);
}

.workspace .persona-table .persona-name-column,
.workspace .persona-table .persona-name-cell {
  width: 156px;
  max-width: 156px;
}

.workspace .persona-table .persona-role-column,
.workspace .persona-table .persona-role-cell {
  width: 144px;
  max-width: 144px;
}

.workspace .persona-table .persona-name-cell,
.workspace .persona-table .persona-role-cell {
  overflow: hidden;
}

.workspace .persona-table .persona-name-value,
.workspace .persona-table .persona-role-value {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.workspace .persona-table .persona-name-value {
  max-width: calc(100% - 42px);
}

.workspace .membership-user-table .membership-action-cell {
  background: var(--manage-surface-strong);
  box-shadow: -10px 0 14px -14px rgba(52, 45, 43, 0.46);
}

.workspace .membership-user-table th.membership-action-cell {
  background: var(--manage-surface-subtle);
}

.workspace .mono-cell,
.workspace .membership-pagination,
.workspace .membership-empty {
  color: var(--manage-text-secondary);
}

.workspace .tag-pill,
.workspace .debug-contract-optional {
  border-radius: 4px;
  background: #f4eef1;
  color: var(--manage-accent);
}

.workspace .member-avatar {
  background: #f3ebee;
}

.workspace .member-avatar-fallback {
  color: var(--manage-accent);
}

.workspace .status-pill,
.workspace .task-center-status,
.workspace .debug-contract-required,
.workspace .admin-users-count,
.workspace .admin-users-protected-note,
.workspace .method {
  border-radius: 4px;
}

.workspace .status-pill.is-normal,
.workspace .task-center-status.is-success {
  background: var(--manage-success-bg);
  color: var(--manage-success-text);
}

.workspace .status-pill.is-disabled,
.workspace .task-center-status.is-danger,
.workspace .debug-contract-required {
  background: var(--manage-danger-bg);
  color: var(--manage-danger-text);
}

.workspace .task-center-status.is-warning,
.workspace .admin-users-protected-note {
  background: var(--manage-warning-bg);
  color: var(--manage-warning-text);
}

.workspace .membership-tabs,
.workspace .task-center-tabs {
  background: var(--manage-surface-strong);
}

.workspace .membership-tab {
  color: var(--manage-text-secondary);
  font-size: 13px;
}

.workspace .membership-tab.active,
.workspace .membership-tab:hover {
  border-color: var(--manage-accent);
  color: var(--manage-accent);
}

.workspace .platform-config-item,
.workspace .platform-config-option-copy,
.workspace .diagnostics-switch,
.workspace .task-center-tab,
.workspace .debug-operation,
.workspace .debug-contract-table-wrap,
.workspace .debug-fieldset,
.workspace .debug-json-card,
.workspace .module-metric,
.workspace .module-scenario,
.workspace .module-json-preview {
  border-color: var(--manage-border);
  background: var(--manage-surface-strong);
}

.workspace .platform-config-item,
.workspace .platform-config-option-copy,
.workspace .diagnostics-switch,
.workspace .task-center-tab,
.workspace .debug-operation,
.workspace .debug-fieldset,
.workspace .debug-json-card,
.workspace .module-metric,
.workspace .module-scenario,
.workspace .module-json-preview {
  border-radius: var(--manage-radius);
}

.workspace .platform-config-item legend,
.workspace .platform-config-option-copy strong,
.workspace .diagnostics-switch,
.workspace .debug-operation,
.workspace .debug-contract-section h4,
.workspace .debug-contract-section h5,
.workspace .debug-operation-description h4,
.workspace .debug-fieldset legend,
.workspace .module-metric strong {
  color: var(--manage-text);
}

.workspace .platform-config-option-copy small,
.workspace .platform-config-meta code,
.workspace .module-metric span,
.workspace .module-metric small,
.workspace .module-json-preview,
.workspace .debug-contract-copy,
.workspace .debug-contract-empty,
.workspace .debug-operation-meta,
.workspace .debug-identity-header,
.workspace .debug-result-header,
.workspace .debug-field small,
.workspace .debug-upload-row,
.workspace .debug-response-empty,
.workspace .debug-empty,
.workspace .debug-json-null {
  color: var(--manage-text-muted);
}

.workspace .platform-config-option:hover .platform-config-option-copy,
.workspace .platform-config-option-input:checked + .platform-config-option-copy,
.workspace .task-center-tab:hover,
.workspace .debug-tag.active,
.workspace .debug-tag:hover,
.workspace .debug-operation.active,
.workspace .debug-operation:hover,
.workspace .debug-operation:focus-within {
  border-color: #d7afbf;
  background: var(--manage-accent-subtle);
  color: var(--manage-accent);
}

.workspace .task-center-tab.active {
  border-color: var(--manage-accent);
  background: var(--manage-accent);
  color: #fff;
}

.workspace .debug-tag,
.workspace .debug-operation-detail {
  border-color: var(--manage-border-strong);
  border-radius: 4px;
  background: var(--manage-surface-strong);
  color: var(--manage-text-secondary);
}

.workspace .debug-operation-detail:hover,
.workspace .debug-operation-detail:focus-visible {
  border-color: var(--manage-accent);
  background: var(--manage-surface-hover);
  color: var(--manage-accent);
}

.workspace .debug-nav-header,
.workspace .debug-main-header,
.workspace .debug-contract-section,
.workspace .debug-form,
.workspace .app-version-modal-header,
.workspace .admin-users-list-header,
.workspace .app-version-actions,
.workspace .app-version-policy-form,
.workspace .platform-config-actions,
.workspace .diagnostics-actions,
.workspace .runtime-config-actions {
  border-color: var(--manage-border);
}

.workspace .debug-operation-description {
  border-color: #ead7df;
  border-radius: var(--manage-radius);
  background: #fcf5f7;
}

.workspace .debug-operation-description p {
  color: var(--manage-text-secondary);
}

.workspace .debug-json-card,
.workspace .module-json-preview {
  background: var(--manage-surface-subtle);
}

.workspace .debug-json-row {
  border-left-color: #dcced3;
}

.workspace .debug-image-preview img {
  border-color: var(--manage-border);
  background: var(--manage-surface-strong);
}

.workspace .admin-users-list-header {
  background: var(--manage-surface-subtle);
}

.workspace .admin-users-list-header::before {
  background: var(--manage-accent);
}

.workspace .admin-users-count {
  background: var(--manage-accent-subtle);
  color: var(--manage-accent);
}

.workspace .module-scenario {
  background: var(--manage-surface-subtle);
}

.workspace .module-console-actions .button,
.workspace .task-center-row-actions button {
  min-height: 30px;
  font-size: 12px;
}

.workspace .app-version-modal-backdrop,
.workspace .debug-modal-backdrop {
  background: rgba(52, 45, 43, 0.46);
}

.workspace .app-version-modal,
.workspace .debug-modal {
  border: 1px solid var(--manage-border);
  border-radius: 8px;
  background: var(--manage-surface-strong);
  box-shadow: 0 18px 52px rgba(52, 45, 43, 0.18);
}

.workspace .debug-contract-body {
  background: var(--manage-surface-strong);
}

.membership-toast {
  border-color: #d8bdc9;
  background: #fbf1f5;
  color: #6f1f45;
  box-shadow: 0 12px 28px rgba(52, 45, 43, 0.14);
}

/* 缺失数据页共用容器：页面模块只能使用这些结构类，避免再次分叉视觉语言。 */
.workspace .manage-data-page-host {
  min-height: 0;
  display: block;
  place-items: normal;
  margin: 20px;
  color: var(--manage-text);
  text-align: left;
}

/* 数据页挂载在占位容器中时，清除占位内容的窄宽度和内边距。 */
.workspace .manage-data-page-host > div {
  width: 100%;
  max-width: none;
  padding: 0;
}

.workspace .manage-data-page {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 16px;
}

/* 每个数据页区块均可随工作区收缩；宽表仅在自身滚动容器中横向滚动。 */
.workspace .manage-data-page > * {
  min-width: 0;
}

.workspace .manage-data-page-header,
.workspace .manage-data-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace .manage-data-page-header {
  align-items: flex-start;
  margin: 8px 12px 0;
}

.workspace .manage-data-page-header h3 {
  margin: 0;
  font-size: 16px;
}

.workspace .manage-data-page-header p {
  margin: 4px 0 0;
  color: var(--manage-text-muted);
}

.workspace .manage-data-page-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--manage-border);
  border-radius: var(--manage-radius);
  background: var(--manage-surface-strong);
}

.workspace .manage-data-page-filter-group {
  display: flex;
  flex: 0 1 auto;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.workspace .manage-data-page-field {
  display: grid;
  flex: 0 1 200px;
  min-width: 0;
  gap: 5px;
  color: var(--manage-text-secondary);
  font-size: 12px;
  font-weight: 650;
}

.workspace .manage-data-page-field.is-wide {
  flex-basis: clamp(400px, 36vw, 560px);
}

.workspace .manage-data-page-field.is-select {
  flex-basis: 152px;
}

.workspace .manage-data-page-field .input {
  width: 100%;
}

.workspace .manage-data-page-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: var(--manage-control-height);
}

.workspace .manage-data-page-toolbar-meta {
  align-self: center;
  color: var(--manage-text-muted);
  font-size: 12px;
  font-weight: 650;
}

.workspace .manage-data-page-empty,
.workspace .manage-data-page-error {
  display: grid;
  place-items: center;
  min-height: 168px;
  color: var(--manage-text-muted);
  text-align: center;
}

.workspace .manage-data-page-error {
  color: var(--manage-danger-text);
}

@media (max-width: 760px) {
  .workspace .manage-data-page-host {
    margin: 14px;
  }

  .workspace .manage-data-page-header,
  .workspace .manage-data-page-toolbar,
  .workspace .manage-data-page-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace .manage-data-page-toolbar {
    margin: 0;
  }

  .workspace .manage-data-page-header {
    margin: 8px 0 0;
  }

  .workspace .manage-data-page-filter-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .workspace .manage-data-page-field,
  .workspace .manage-data-page-field.is-wide,
  .workspace .manage-data-page-field.is-select {
    width: 100%;
    flex-basis: auto;
  }

  .workspace .manage-data-page-toolbar-actions {
    width: 100%;
  }

  .workspace .manage-data-page-toolbar-actions .button {
    flex: 1 1 0;
  }

  .workspace .manage-data-page-toolbar-meta {
    align-self: flex-start;
  }
}

.outfit-fields { border: 0; margin: 0; padding: 0; min-width: 0; }

/* 模型正文只在展开时展示，长文本在窄屏内换行。 */
.ai-model-audit { border-top: 1px solid var(--border-color, #e5dfdc); padding: 12px 0; }
.ai-model-audit > summary { cursor: pointer; font-weight: 600; }
.ai-model-audit-body { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 480px; overflow-y: auto; padding: 12px; background: #faf8f6; font-size: 12px; }

.outfit-structures { margin: 16px 0; padding: 12px 0; border-top: 1px solid #e4e4e7; }
.outfit-structures label { display: inline-flex; align-items: center; gap: 6px; margin: 8px 20px 8px 0; }
.outfit-structures strong { display: block; }
.outfit-structures p { margin: 4px 0; }
.outfit-fallback { display: block; line-height: 1.6; margin: 12px 0; }

/* 模型回退仍保留业务成功，前序故障通过浅色提示和逐次明细定位。 */
.status-pill.is-warning { background: #fff3d6; color: #795000; }
.ai-attempt-section { margin: 16px 0; }
.ai-attempt-list { list-style: none; padding: 0; margin: 8px 0; }
.ai-attempt-item { border-top: 1px solid var(--line, #e4e4e7); padding: 12px 0; }
.ai-attempt-heading { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.ai-attempt-heading strong { overflow-wrap: anywhere; }
.ai-attempt-heading .status-pill { flex-shrink: 0; }
.ai-attempt-reason { overflow-wrap: anywhere; white-space: pre-wrap; }
.system-logs-diagnostic-context { display: block; color: var(--muted, #71717a); margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }

/* 场景真实测试沿用 Manage 弹窗；输入输出和图片在窄屏下纵向排列。 */
.scenario-test-modal { width: min(1100px, calc(100vw - 32px)); max-width: 1100px; }
.scenario-test-form { display: grid; gap: 12px; min-width: 0; }
.scenario-test-form textarea { width: 100%; font-family: monospace; }
.scenario-test-results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.scenario-test-results pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 400px; overflow: auto; padding: 12px; border: 1px solid var(--manage-border, #e4e4e7); font-size: 12px; }
.scenario-test-gallery, .scenario-test-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.scenario-test-gallery figure { margin: 0; min-width: 0; max-width: 100%; }
.scenario-test-gallery img { max-width: 100%; width: 280px; height: 240px; object-fit: contain; border: 1px solid var(--manage-border, #e4e4e7); }
.scenario-test-previews img { width: 120px; height: 120px; object-fit: contain; }
.scenario-test-gallery figcaption { overflow-wrap: anywhere; font-size: 12px; }
@media (max-width: 760px) { .scenario-test-results { grid-template-columns: minmax(0, 1fr); } }

/* 场景模型配置窗口复用现有中性色、间距和移动布局。 */
.model-config-modal { width: min(960px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.model-config-modal .app-version-modal-body { overflow-y: auto; }
.model-config-modal textarea { width: 100%; resize: vertical; }
.model-config-toolbar { display: flex; align-items: flex-end; gap: 12px; margin: 16px 0; }
.model-config-toolbar .field { flex: 1; margin: 0; }
.model-config-modal details { margin: 12px 0; }
.model-config-modal summary { cursor: pointer; }
.model-processing-section { border-top: 1px solid var(--manage-border, #e4e4e7); padding-top: 16px; }
.model-processing-section > summary { font-weight: 600; }
.model-processing-section .field { margin: 14px 0; }
.model-processing-toggle input { width: auto; vertical-align: middle; margin-right: 8px; }
.model-config-actions { flex-wrap: wrap; gap: 8px; }
.model-config-actions [role="status"] { flex: 1 1 100%; }
.model-config-history p { margin: 8px 0; overflow-wrap: anywhere; }
.model-config-modal pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
@media (max-width: 640px) { .model-config-toolbar { flex-direction: column; align-items: stretch; } .model-config-actions button { flex: 1 1 40%; } }

/* 人体模特管理使用现有后台控件，图像编辑与版本预览在同一工作区完成。 */
/* 固定模特工作台沿用 Manage 品牌色；步骤切换保留编辑状态，画布默认完整显示全身。 */
.body-template-nav-heading { padding: 16px 12px 4px; font-size: 12px; color: var(--manage-text-muted, #918782); }
.body-template-layout { display: grid; grid-template-columns: 228px minmax(0,1fr); gap: 16px; font-variant-numeric: tabular-nums; }
.body-template-layout .surface { border-radius: 6px; }
.body-template-list { padding: 16px 12px; align-self: start; min-width: 0; }
.body-template-detail { padding: 0 20px; min-width: 0; --bt-canvas-height: 560px; }
.body-template-bar { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.body-template-layout h3 { margin: 0; font-size: 15px; }
.body-template-layout h4 { margin: 0; font-size: 13px; }
.body-template-detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 0 16px; }
.body-template-state { padding: 4px 8px; background: var(--manage-surface-subtle, #faf7f5); color: var(--manage-text-secondary, #6f6661); border-radius: 4px; font-size: 12px; }
.body-template-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--manage-border, #e2dcd8); margin-bottom: 20px; }
.body-template-tabs button { display: flex; align-items: center; gap: 8px; padding: 0 0 12px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--manage-text-secondary, #6f6661); font-size: 13px; white-space: nowrap; }
.body-template-tabs button span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: var(--manage-surface-subtle, #faf7f5); font-size: 11px; }
.body-template-tabs button[aria-selected="true"] { border-bottom-color: var(--manage-accent, #762444); color: var(--manage-accent, #762444); font-weight: 600; }
.body-template-tabs button[aria-selected="true"] span { background: var(--manage-accent-subtle, #f8eaef); }
.body-template-layout button:focus-visible, .body-template-upload:focus-within { outline: 2px solid var(--manage-accent, #762444); outline-offset: 2px; }
.body-template-list-item { display: grid; gap: 4px; width: 100%; padding: 12px; border: 0; border-bottom: 1px solid var(--manage-border, #e2dcd8); background: transparent; text-align: left; cursor: pointer; color: inherit; }
.body-template-list-item strong { overflow-wrap: anywhere; }
.body-template-list-item span, .body-template-list-item small { color: var(--manage-text-muted, #918782); font-size: 12px; overflow-wrap: anywhere; }
.body-template-list-item:hover { background: var(--manage-surface-subtle, #faf7f5); }
.body-template-list-item.active { background: var(--manage-accent-subtle, #f8eaef); box-shadow: inset 3px 0 var(--manage-accent, #762444); }
.body-template-list-empty { padding: 20px 8px; font-size: 12px; color: var(--manage-text-muted, #918782); line-height: 1.7; }
.body-template-list-empty strong { color: var(--manage-text-secondary, #6f6661); font-weight: 500; }
.body-template-list-empty p { margin: 8px 0 0; }
.body-template-section-heading { margin-bottom: 16px; }
.body-template-section-heading p { margin: 4px 0 0; color: var(--manage-text-muted, #918782); font-size: 12px; }
.body-template-default-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; margin-bottom: 20px; border-bottom: 1px solid var(--manage-border, #e2dcd8); }
.body-template-default-bar > div { display: grid; gap: 4px; min-width: 0; }
.body-template-default-bar span, .body-template-default-bar p { margin: 0; font-size: 12px; color: var(--manage-text-muted, #918782); line-height: 1.7; }
.body-template-default-bar strong { font-size: 13px; overflow-wrap: anywhere; }
.body-template-default-bar .button { flex-shrink: 0; }
.body-template-list-item .body-template-default-badge { width: fit-content; padding: 2px 6px; border-radius: 4px; background: var(--manage-accent-subtle, #f8eaef); color: var(--manage-accent, #762444); font-size: 11px; }
.body-template-info { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 88px; gap: 16px; max-width: 840px; margin-bottom: 24px; }
.body-template-info-actions { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.body-template-check { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; }
.body-template-version-bar { display: flex; align-items: end; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.body-template-version { flex: 1 1 220px; min-width: 0; }
.body-template-version .input { width: 100%; }
.body-template-upload { position: relative; overflow: hidden; cursor: pointer; white-space: nowrap; }
.body-template-upload input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.body-template-upload:has(input:disabled) { opacity: .6; cursor: default; }
.body-template-image-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--manage-border, #e2dcd8); padding-top: 20px; }
.body-template-source { min-height: 280px; display: flex; align-items: center; justify-content: center; gap: 24px; background: var(--manage-surface-subtle, #faf7f5); border: 1px solid var(--manage-border, #e2dcd8); border-radius: 4px; padding: 20px; }
.body-template-source img { width: 160px; height: 280px; object-fit: contain; }
.body-template-source p { color: var(--manage-text-muted, #918782); font-size: 12px; }
.body-template-empty { display: grid; align-content: center; justify-items: center; min-height: 240px; padding: 24px; text-align: center; color: var(--manage-text-secondary, #6f6661); }
.body-template-empty strong { font-size: 14px; font-weight: 500; }
.body-template-empty p { max-width: 320px; margin: 8px 0 0; color: var(--manage-text-muted, #918782); font-size: 12px; line-height: 1.7; }
.body-template-help { font-size: 12px; color: var(--manage-text-muted, #918782); line-height: 1.7; margin: 8px 0 16px; }
.body-template-workspace { display: grid; grid-template-columns: minmax(0,1fr) 240px; gap: 20px; }
.body-template-drawing { min-width: 0; }
.body-template-region { flex: 1; min-width: 0; max-width: 240px; }
.body-template-region .input { width: 100%; }
.body-template-canvas-scroll { overflow: auto; height: var(--bt-canvas-height); border: 1px solid var(--manage-border, #e2dcd8); background: var(--manage-surface-subtle, #faf7f5); padding: 16px; }
.body-template-canvas-host { max-width: none; min-width: 100%; }
.body-template-canvas { display: block; width: 100%; height: calc((var(--bt-canvas-height) - 34px) * var(--bt-zoom, 1)); touch-action: none; }
.body-template-canvas circle { cursor: grab; }
.body-template-canvas-caption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 8px; color: var(--manage-text-muted, #918782); font-size: 11px; }
.body-template-settings { padding-left: 16px; border-left: 1px solid var(--manage-border, #e2dcd8); min-width: 0; }
.body-template-settings h4 { margin-bottom: 16px; }
.body-template-settings .field, .body-template-settings button { margin-bottom: 12px; }
.body-template-settings .input { width: 100%; }
.body-template-settings .field small { line-height: 1.7; font-size: 11px; color: var(--manage-text-muted, #918782); }
.body-template-settings details { border-top: 1px solid var(--manage-border, #e2dcd8); padding: 12px 0; }
.body-template-settings summary { cursor: pointer; font-size: 12px; }
.body-template-settings details[open] summary { margin-bottom: 12px; }
.body-template-settings pre { overflow: auto; max-height: 320px; font-size: 11px; }
.body-template-reference-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.body-template-reference-grid input { width: 100%; min-width: 0; font-size: 12px; }
.body-template-previews { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.body-template-previews article { border: 1px solid var(--manage-border, #e2dcd8); padding: 12px; border-radius: 4px; min-width: 0; }
.body-template-preview-image { min-height: 160px; background: var(--manage-surface-subtle, #faf7f5); display: grid; place-items: center; margin-bottom: 12px; color: var(--manage-text-muted, #918782); font-size: 12px; }
.body-template-preview-image img { display: block; width: 100%; max-height: 440px; object-fit: contain; }
.body-template-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--manage-border, #e2dcd8); padding-top: 16px; margin-top: 20px; }
.body-template-footer .body-template-help { margin: 0; }
.body-template-footer .button { flex-shrink: 0; }
.body-template-status { background: var(--manage-surface-strong, #fff); margin: 0; padding: 12px 0; font-size: 12px; overflow-wrap: anywhere; }
.body-template-status:empty { padding: 8px 0; }
.tryon-configuration { max-width: 960px; }
.tryon-configuration-current { margin: 16px 0; }
.tryon-policy-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.tryon-policy-options legend { margin-bottom: 8px; font-weight: 600; }
.tryon-policy-option { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--manage-border, #e2dcd8); cursor: pointer; }
.tryon-policy-option input { flex: 0 0 auto; margin: 4px 0 0; accent-color: var(--manage-accent, #7e334d); }
.tryon-policy-option strong, .tryon-policy-option small { display: block; }
.tryon-policy-option small { margin-top: 4px; color: var(--manage-muted, #736b66); line-height: 1.6; }
.tryon-configuration-status { min-height: 24px; margin-bottom: 0; overflow-wrap: anywhere; }
.tryon-configuration-status[data-state="error"] { color: var(--manage-danger-text, #9d3329); }
.tryon-configuration-status[data-state="success"] { color: var(--manage-success-text, #3c6857); }
.body-template-error { color: var(--manage-danger-text, #9d3329); }
.body-template-busy .body-template-canvas-host { pointer-events: none; }
@media (max-width: 1300px) { .body-template-layout { grid-template-columns: 190px minmax(0,1fr); } .body-template-workspace { grid-template-columns: minmax(0,1fr) 210px; gap: 16px; } }
@media (max-width: 1000px) { .body-template-workspace { grid-template-columns: 1fr; } .body-template-settings { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--manage-border, #e2dcd8); } }
@media (max-width: 700px) {
  .body-template-layout { grid-template-columns: 1fr; } .body-template-list { max-height: 200px; overflow: auto; }
  .body-template-default-bar { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .body-template-detail { padding: 0 16px; --bt-canvas-height: 480px; } .body-template-detail-heading { flex-wrap: wrap; }
  .body-template-tabs { gap: 16px; } .body-template-tabs button { gap: 4px; font-size: 12px; }
  .body-template-info { grid-template-columns: minmax(0,1fr) 88px; } .body-template-info .field:first-child { grid-column: 1/-1; }
  .body-template-reference-grid, .body-template-previews { grid-template-columns: 1fr; }
  .body-template-image-heading, .body-template-footer { align-items: flex-start; flex-wrap: wrap; }
  .body-template-source { flex-direction: column; gap: 12px; } .body-template-source img { width: 140px; }
  .body-template-version { flex-basis: 100%; } .body-template-bar .button { flex-shrink: 0; }
}

/* 虚拟形象摘要需要留足字节与 SHA-256 空间，避免沿用耗时数字列宽。 */
.ai-avatar-summary {table-layout:fixed;}
.ai-avatar-summary th:first-child,.ai-avatar-summary td:first-child {width:25%;}
.ai-avatar-summary th:last-child,.ai-avatar-summary td:last-child {width:auto;text-align:left;}
.ai-avatar-summary .mono-cell {overflow-wrap:anywhere;word-break:break-all;}

/* 模型上游使用现有表格样式；窄屏以带字段名的模型条目呈现。 */
.ai-models-table { table-layout: fixed; width: 100%; }
.ai-models-table th:nth-child(1) { width: 30%; }
.ai-models-table th:nth-child(2) { width: 45%; }
.ai-models-table th:nth-child(3) { width: 25%; }
.ai-models-table td { white-space: normal; overflow-wrap: anywhere; }
.ai-model-info { display: grid; gap: 4px; }
.two-line-cell.model-upstream-info { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; }
.model-native-status { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; white-space: normal; overflow-wrap: anywhere; }
.model-native-actions { margin-top: 8px; }
.model-catalog-controls { display: grid; gap: 8px; }
.model-native-actions .module-console-actions { flex-wrap: wrap; gap: 4px; }
@media (max-width: 760px) {
  .ai-models-card .module-card-title { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ai-models-table { min-width: 0; width: 100%; }
  .ai-models-table thead { display: none; }
  .ai-models-table tbody { display: grid; gap: 12px; }
  .ai-models-table tr { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid var(--manage-border, #e4e4e7); padding-bottom: 12px; }
  .ai-models-table td { display: block; min-width: 0; padding: 6px 8px; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .ai-models-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 11px; color: var(--manage-muted, #71717a); }
}
.wechat-profile-card .member-identity { margin: 12px 0; }
.wechat-profile-card dl { margin: 12px 0 0; }
.wechat-profile-identifier { overflow-wrap: anywhere; font-size: 12px; }

/* 注销归档复用 Manage 的色彩和表格；局部取消通用宽表的最小宽度，保证详情栏与手机可读。 */
.membership-archive-card { min-width: 0; max-width: 100%; }
.membership-archive-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.membership-archive-controls .button[aria-pressed="true"] { color: var(--manage-accent, #762444); border-color: var(--manage-accent, #762444); }
.membership-archive-card .membership-archive-table { width: 100%; min-width: 0; table-layout: fixed; }
.membership-archive-card .membership-archive-table th:first-child { width: 56px; }
.membership-archive-card .membership-archive-table th:last-child { width: 144px; }
.membership-archive-card .membership-archive-table td { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .workspace .debug-contract-table, .workspace .debug-contract-table tbody { display: block; min-width: 0; }
  .workspace .debug-contract-table thead { display: none; }
  .workspace .debug-contract-table tr { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid var(--manage-border, #e2dcd8); padding: 8px 12px; }
  .workspace .debug-contract-table tr:last-child { border-bottom: 0; }
  .workspace .debug-contract-table td { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; min-width: 0; padding: 4px 0; border: 0; overflow-wrap: anywhere; }
  .workspace .debug-contract-table td::before { content: attr(data-label); color: var(--manage-text-secondary, #6f6661); }
  .workspace .debug-contract-table td > * { min-width: 0; justify-self: start; }
  .membership-archive-card .membership-archive-table, .membership-archive-card .membership-archive-table tbody { display: block; }
  .membership-archive-card .membership-archive-table thead { display: none; }
  .membership-archive-card .membership-archive-table tr { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--manage-border, #e2dcd8); }
  .membership-archive-card .membership-archive-table td { border: 0; padding: 0; min-width: 0; }
  .membership-archive-card .membership-archive-table td:first-child { grid-row: 1 / span 3; }
  .membership-archive-card .membership-archive-table td:not(:first-child)::before { content: attr(data-label) "："; color: var(--manage-text-secondary, #6f6661); font-size: 12px; }
}
