.settings-page {
  height: 100%;
  min-height: 0;
  animation: fadeUp 220ms var(--ease) both;
}

.settings-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 4px 16px rgba(0, 0, 0, 0.03);
}

.settings-nav {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 24px 16px 20px;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
}

.settings-nav-head {
  display: grid;
  gap: 6px;
  padding: 0 8px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.nav-kicker {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-nav-head h2 {
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.settings-nav-head p {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.settings-nav-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.settings-nav-item {
  width: 100%;
  min-height: 60px;
  display: block;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #334155;
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: #cbd5e1;
}

.settings-nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-active);
  border-color: rgba(var(--theme-primary-rgb, 58, 124, 165), 0.22);
}

.nav-item-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.nav-item-copy strong {
  color: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
}

.nav-item-copy small {
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.4;
}

.settings-nav-item.active .nav-item-copy small {
  color: var(--primary-active);
  opacity: 0.8;
}

.settings-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #f8fafc;
}

.settings-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.settings-toolbar-copy {
  min-width: 0;
}

.settings-breadcrumb {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary-active);
  font-size: 12px;
  font-weight: 700;
}

.settings-toolbar-copy h3 {
  margin-top: 4px;
  color: #0f172a;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.settings-toolbar-copy p {
  margin-top: 3px;
  max-width: 760px;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.5;
}

.settings-toolbar-actions {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.save-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 4px;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.16);
  transition: all 0.2s ease;
  cursor: pointer;
}

.save-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.22);
  background: var(--primary-hover);
}

.settings-content {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 20px 24px;
}

.settings-content-fill {
  overflow: hidden;
  align-content: stretch;
}

.settings-content-fill .settings-logs-view,
.settings-content-fill .settings-log-detail-view {
  min-height: 0;
}

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

.test-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.22);
  border-radius: 4px;
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
}

.test-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--theme-primary);
  background: var(--theme-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(58, 124, 165, 0.15);
}

.test-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.model-config-surface {
  min-width: 0;
}

.model-table-card > .model-table-wrap {
  margin-top: 0;
  padding: 0;
  overflow: auto;
}

.add-model-button,
.secondary-button,
.icon-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
}

.add-model-button {
  min-height: 36px;
  gap: 6px;
  padding: 0 14px;
  border-color: var(--theme-primary);
  background: var(--theme-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(var(--theme-primary-rgb, 58, 124, 165), 0.14);
}

.add-model-button:hover,
.secondary-button:hover,
.icon-action-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.secondary-button {
  min-height: 36px;
  padding: 0 16px;
}

.icon-action-button {
  min-width: 52px;
  width: auto;
  height: 32px;
  padding: 0 10px;
  white-space: nowrap;
}

.icon-action-button:hover:not(:disabled) {
  border-color: var(--theme-primary);
  color: var(--theme-primary-active);
  background: var(--theme-primary-soft);
}

.icon-action-button.danger:hover:not(:disabled) {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.icon-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.model-config-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
}

.model-config-table th,
.model-config-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
  vertical-align: middle;
}

.model-config-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
}

.model-config-table tbody tr:hover {
  background: #f8fafc;
}

.model-config-table th:nth-child(1),
.model-config-table td:nth-child(1) {
  width: 132px;
}

.model-config-table th:nth-child(2),
.model-config-table td:nth-child(2) {
  width: 120px;
}

.model-config-table th:nth-child(3),
.model-config-table td:nth-child(3) {
  width: 180px;
}

.model-config-table th:nth-child(5),
.model-config-table td:nth-child(5) {
  width: 100px;
}

.model-config-table th:nth-child(6),
.model-config-table td:nth-child(6) {
  width: 180px;
}

.model-action-col,
.model-config-table td:last-child {
  width: 184px;
}

.model-icon-text {
  color: var(--theme-primary-active);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.model-type-pill,
.secret-state,
.test-feedback-inline {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.model-type-pill {
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.secret-state {
  background: #f1f5f9;
  color: #64748b;
}

.secret-state.configured {
  background: #ecfdf5;
  color: #047857;
}

.test-feedback-inline {
  overflow: hidden;
  text-overflow: ellipsis;
}

.test-feedback-inline.is-idle {
  background: #f1f5f9;
  color: #64748b;
}

.test-feedback-inline.is-testing {
  background: #eff6ff;
  color: #2563eb;
}

.test-feedback-inline.is-success {
  background: #ecfdf5;
  color: #047857;
}

.test-feedback-inline.is-error {
  background: #fef2f2;
  color: #dc2626;
}

.model-provider-name,
.model-id-text,
.model-url-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-provider-name {
  color: #0f172a;
  font-weight: 700;
}

.model-id-text {
  padding: 2px 0;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: transparent;
}

.model-url-text {
  color: #64748b;
}

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

.model-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
}

.model-dialog {
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.model-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.model-dialog-head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  font-weight: 800;
}

.model-dialog-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12.5px;
}

.model-dialog-form {
  min-height: 0;
  overflow: auto;
  padding: 22px;
}

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

.model-type-segment button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #475569;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.model-type-segment button.active {
  border-color: var(--theme-primary);
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.model-type-segment button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.model-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.save-button.compact {
  min-height: 36px;
  padding: 0 16px;
}

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

.session-picker-filter {
  position: relative;
}

.session-picker-trigger {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 40px 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
}

.session-picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-picker-trigger .mdi {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 18px;
  pointer-events: none;
}

.session-picker-trigger:hover,
.session-picker-filter.open .session-picker-trigger {
  border-color: var(--theme-primary);
  background: #ffffff;
  color: var(--theme-primary-active);
}

.session-picker-filter.open .session-picker-trigger {
  box-shadow: 0 0 0 3px var(--theme-focus-ring);
}

.session-picker-filter.open .session-picker-trigger .mdi,
.session-picker-trigger:hover .mdi {
  color: var(--theme-primary-active);
}

.session-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  z-index: 40;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

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

.session-picker-popover header strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.session-picker-popover header button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.session-picker-popover header button:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.session-picker-option-list {
  display: grid;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.session-picker-option {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
}

.session-picker-option:hover,
.session-picker-option.active {
  border-color: var(--theme-primary);
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.theme-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.theme-option {
  min-height: 148px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 16px;
  border: 1px solid #d8dee8;
  border-radius: 4px;
  background: #ffffff;
  color: #334155;
  text-align: left;
  transition:
    border-color 160ms var(--ease),
    background 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.theme-option:hover,
.theme-option.active {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--theme-focus-ring);
}

.theme-style-preview {
  grid-column: 1 / -1;
  width: 100%;
  height: 42px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  grid-template-rows: 1fr;
  border: 1px solid #d8dee8;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.theme-style-preview i + i {
  border-left: 1px solid rgba(255, 255, 255, 0.72);
}

.theme-copy {
  display: grid;
  gap: 8px;
}

.theme-copy strong {
  color: #111827;
  font-size: 15px;
  font-weight: 700;
}

.theme-copy small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.theme-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-keywords em {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.theme-current {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(var(--theme-primary-rgb, 58, 124, 165), 0.26);
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary-active);
  font-size: 12px;
  font-weight: 700;
}

.theme-preview-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid #d8dee8;
  border-radius: 4px;
  background: #ffffff;
}

.theme-preview-panel div {
  display: grid;
  gap: 4px;
}

.theme-preview-panel strong {
  color: #111827;
  font-size: 14px;
}

.theme-preview-panel span {
  color: #64748b;
  font-size: 12px;
}

.theme-preview-surface {
  width: min(220px, 36%);
  min-width: 160px;
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  background: #f8fafc;
}

.theme-preview-surface span,
.theme-preview-surface i,
.theme-preview-surface b {
  display: block;
  min-height: 10px;
  border-radius: 3px;
}

.theme-preview-surface span {
  grid-column: 1 / -1;
  background: var(--theme-primary-soft);
}

.theme-preview-surface i {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.theme-preview-surface b {
  background: var(--theme-gradient-primary);
}

.secret-bound-state {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--theme-primary-active);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.secret-bound-state i {
  font-size: 14px;
}

.test-feedback {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.test-feedback i {
  margin-top: 2px;
  font-size: 14px;
}

.test-feedback.is-success {
  background: var(--success-soft);
  color: var(--success-hover);
}

.test-feedback.is-error {
  background: var(--danger-soft);
  color: var(--danger-active);
}

.test-feedback.is-testing {
  background: #eff6ff;
  color: #1d4ed8;
}

.logo-field {
  align-self: stretch;
}

.logo-tile {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%, transparent 75%, #f8fafc 75%, #f8fafc),
    linear-gradient(45deg, #f8fafc 25%, transparent 25%, transparent 75%, #f8fafc 75%, #f8fafc);
  background-position: 0 0, 9px 9px;
  background-size: 18px 18px;
  color: var(--theme-primary);
  font-size: 32px;
}

.preview-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(58, 124, 165, 0.15);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb, 58, 124, 165), 0.06) 0%, rgba(var(--theme-secondary-rgb, 37, 99, 235), 0.03) 100%);
}

.preview-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--theme-gradient-primary);
  color: #ffffff;
  font-size: 28px;
  box-shadow: 0 8px 20px var(--theme-primary-shadow);
}

.preview-copy strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
}

.preview-copy p {
  margin-top: 4px;
  color: #334155;
  font-size: 13.5px;
  font-weight: 600;
}

.preview-copy small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.preview-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.level-chip {
  min-width: 80px;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
}

.level-chip:hover {
  border-color: var(--theme-primary);
  color: var(--theme-primary);
  background: var(--theme-primary-soft);
}

.level-chip.active {
  border-color: var(--theme-primary);
  background: var(--theme-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--theme-primary-shadow);
}

.range-shell {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
}

.range-shell input[type='range'] {
  flex: 1 1 auto;
  accent-color: var(--theme-primary);
  cursor: pointer;
}

.range-shell strong {
  min-width: 28px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.rendering-settings-card .switch-group {
  margin-bottom: 24px;
}

.cache-management-card {
  display: grid;
  gap: 16px;
}



.cache-management-hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 8px;
}

.cache-management-hero-metrics span {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.cache-management-hero-metrics strong {
  color: #0f172a;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.1;
}

.cache-management-hero-metrics small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.cache-safety-strip {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.cache-safety-strip i {
  flex: 0 0 auto;
  font-size: 18px;
}

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

.cache-scope-item {
  min-width: 0;
  min-height: 148px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.cache-scope-item i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 17px;
}

.cache-scope-item strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.cache-scope-item span {
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55;
}

.cache-management-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
}

.cache-management-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cache-management-copy strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.cache-management-copy span {
  color: #64748b;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
}

.cache-clear-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
}

.cache-clear-button:hover:not(:disabled) {
  border-color: var(--theme-primary);
  background: var(--theme-primary-soft);
  color: var(--theme-primary-active);
}

.cache-clear-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.cache-clear-result,
.cache-clear-empty {
  padding: 14px 16px;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #ffffff;
}

.cache-clear-result.is-error {
  border-color: #fecaca;
  background: #fff7f7;
}

.cache-clear-result-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cache-clear-result-head i {
  color: #16a34a;
  font-size: 18px;
}

.cache-clear-result.is-error .cache-clear-result-head i {
  color: #dc2626;
}

.cache-clear-result-head strong {
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.4;
}

.cache-clear-result ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.cache-clear-result li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
  color: #475569;
  font-size: 12.5px;
  font-weight: 650;
}

.cache-clear-result li strong {
  color: #0f172a;
  font-weight: 800;
  white-space: nowrap;
}

.cache-clear-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 650;
}

.cache-clear-empty i {
  color: var(--theme-primary);
  font-size: 15px;
}

.log-policy-card .card-head {
  padding-top: 12px;
  padding-bottom: 12px;
}

.log-policy-card > *:not(.card-head) {
  margin-top: 18px;
}

.log-policy-card > *:not(.card-head):last-child {
  margin-bottom: 20px;
}

/* 大语言模型配置卡片图标与标题排版 */
.card-title-with-icon {
  display: flex;
  align-items: center;
  gap: 12px;
}

.model-icon-box {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 18px;
  flex: 0 0 auto;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.model-icon-box.purple,
.model-icon-box.orange,
.model-icon-box.cyan,
.model-icon-box.teal {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

@media (max-width: 1260px) {
  .settings-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .settings-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .settings-toolbar-actions {
    justify-items: stretch;
  }

  .save-button {
    justify-content: center;
  }

  .cache-management-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

@media (max-width: 960px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    grid-template-rows: auto auto auto;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .settings-nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-right: 0;
    padding-bottom: 4px;
  }

  .settings-nav-item {
    min-width: 170px;
  }

  .settings-toolbar,
  .settings-content {
    padding: 20px;
  }

  .model-grid,
  .form-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .field-wide,
  .field-full {
    grid-column: span 1;
  }

  .logo-field {
    width: fit-content;
  }

  .preview-card {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 20px;
  }



  .cache-management-hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cache-management-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .cache-clear-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .settings-shell {
    overflow: hidden;
  }

  .settings-toolbar {
    padding: 16px;
  }

  .settings-toolbar-copy h3 {
    font-size: 20px;
  }

  .settings-content {
    padding: 16px;
  }

  .settings-card {
    padding: 20px 16px;
    border-radius: 6px;
  }

  .settings-nav {
    padding: 16px 12px 12px;
  }

  .settings-nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 188px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 0;
    scrollbar-width: thin;
  }

  .settings-nav-item {
    min-width: 0;
    min-height: 54px;
    padding: 9px 10px;
  }

  .nav-item-copy strong,
  .nav-item-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cache-scope-item,
  .cache-management-panel,
  .cache-clear-result,
  .cache-clear-empty {
    border-radius: 6px;
  }

  .cache-scope-grid,
  .cache-management-hero-metrics {
    grid-template-columns: 1fr;
  }
}
