﻿:root {
  --bg: #eef3f9;
  --bg-soft: #f7f9fc;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-alt: #f8fbff;
  --text: #152033;
  --muted: #617086;
  --muted-strong: #425168;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.28);
  --primary: #1f6feb;
  --primary-strong: #1559c9;
  --primary-soft: rgba(31, 111, 235, 0.12);
  --success: #12805c;
  --warn: #9a6a0d;
  --danger: #bf3f39;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.05);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", sans-serif;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(960px 420px at 8% -8%, rgba(83, 146, 255, 0.18) 0%, rgba(83, 146, 255, 0) 62%),
    radial-gradient(860px 360px at 100% 0%, rgba(15, 118, 110, 0.08) 0%, rgba(15, 118, 110, 0) 58%),
    linear-gradient(180deg, #f9fbfe 0%, var(--bg) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  opacity: 0.9;
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  background: rgba(248, 251, 255, 0.76);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  padding: 0 22px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
}

.brand {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-right: 24px;
}

.top-nav {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.top-nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 14px;
  cursor: pointer;
  transition:
    color 0.2s var(--ease-standard),
    background 0.2s var(--ease-standard),
    border-color 0.2s var(--ease-standard),
    transform 0.18s var(--ease-standard),
    box-shadow 0.2s var(--ease-standard);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.top-nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(148, 163, 184, 0.14);
}

.top-nav-item.active {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 253, 0.94));
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.top-right {
  margin-left: auto;
  color: var(--muted-strong);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.top-right.busy::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #c8dafb;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

.app-shell {
  max-width: 1660px;
  margin: 22px auto 28px;
  padding: 0 12px;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform-origin: top center;
}

.page-enter {
  opacity: 0;
  transform: translateY(10px) scale(0.995);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.22s var(--ease-standard), transform 0.22s var(--ease-standard);
}

.page-leave {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.page-leave-active {
  opacity: 0;
  transform: translateY(-8px) scale(0.992);
  transition: opacity 0.14s ease-out, transform 0.14s ease-out;
}

.hidden {
  display: none !important;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 250, 255, 0.9) 100%);
  box-shadow: var(--shadow-soft);
}

.page-head h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.title-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--primary-strong);
  background: linear-gradient(135deg, rgba(215, 232, 255, 0.95), rgba(244, 248, 255, 0.95));
  border: 1px solid rgba(185, 216, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-pill);
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.18s var(--ease-standard);
}

.tab:hover {
  color: var(--text);
  border-color: rgba(31, 111, 235, 0.2);
  background: #fff;
}

.tab.active {
  background: linear-gradient(180deg, #243146, #1d2738);
  border-color: #243146;
  color: #fff;
  box-shadow: 0 10px 20px rgba(17, 24, 39, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--primary);
  background: linear-gradient(180deg, #2f7bf1, var(--primary));
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 9px 15px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 24px rgba(31, 111, 235, 0.2);
  transition:
    transform 0.12s ease,
    box-shadow 0.22s var(--ease-standard),
    background 0.2s ease,
    border-color 0.2s ease,
    filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(31, 111, 235, 0.24);
  filter: saturate(1.05);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-pressed {
  transform: translateY(1px) scale(0.985);
}

.btn-busy-temp {
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

.btn.is-on {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.78;
}

.btn.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  position: absolute;
  right: 10px;
  top: 50%;
  margin-top: -7px;
  animation: spin 0.8s linear infinite;
}

.icon-only-btn.is-loading::after {
  right: auto;
}

.action-toast {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 5000;
  min-width: 180px;
  max-width: min(82vw, 420px);
  padding: 9px 12px;
  border-radius: 14px;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
  text-align: left;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(203, 213, 225, 0.72);
  white-space: normal;
  word-break: break-word;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.18s var(--ease-standard), transform 0.18s var(--ease-standard);
}

.action-toast.ok {
  color: #0f5132;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.action-toast.err {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.action-toast.toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.action-toast.toast-leave {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.88);
  color: #314155;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: none;
}

.btn-ghost:hover {
  border-color: rgba(31, 111, 235, 0.28);
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b42318;
  border-color: #ffc9c5;
  background: #fff6f5;
  padding: 7px 12px;
}

.btn-delete svg {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 auto;
}

.btn-delete:hover {
  border-color: #ffb4ae;
  background: #ffefed;
}

.flow-append-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flow-append-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.flow-append-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  gap: 12px;
}

.flow-append-item textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
}

.action-group,
.intent-parent-actions,
.scheme-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-only-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-width: 1px;
  border-style: solid;
  background: #fff;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease,
    color 0.18s ease;
  flex: 0 0 auto;
}

.icon-only-btn svg {
  pointer-events: none;
  width: 16px;
  height: 16px;
  display: block;
}

.icon-only-btn svg * {
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-only-btn:active {
  transform: translateY(1px) scale(0.98);
}

.icon-only-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(92, 138, 255, 0.14);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.icon-only-btn.icon-neutral {
  background: #ffffff;
  border-color: #d8e0ea;
  color: #5b6b7f;
}

.icon-only-btn.icon-neutral:hover {
  background: #f7fafc;
  border-color: #c7d3e0;
  color: #425366;
  box-shadow: 0 4px 12px rgba(27, 39, 51, 0.06);
}

.icon-only-btn.icon-danger {
  background: #fffdfd;
  border-color: #f0d7d7;
  color: #d96b6b;
}

.icon-only-btn.icon-danger:hover {
  background: #fff1f1;
  border-color: #e8b4b4;
  color: #c93b3b;
  box-shadow: 0 4px 12px rgba(201, 59, 59, 0.08);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.status-line {
  color: var(--muted-strong);
  font-size: 13px;
  padding: 8px 2px;
  line-height: 1.6;
}

#ingestSettingsBar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#maxIgnoreCharsInput {
  width: 86px;
}

#ignoreServerBar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#ignoreChatBar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#ignoredServerList {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#ignoredChatList {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.chip-del {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #ef4444;
  font-size: 14px;
  line-height: 1;
}

.table-card {
  overflow: hidden;
}

.table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  font-size: 13px;
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

th {
  color: var(--muted);
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.96), rgba(244, 247, 251, 0.96));
  font-weight: 600;
  letter-spacing: 0.01em;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr {
  transition: background 0.18s var(--ease-standard), box-shadow 0.18s var(--ease-standard);
}

tbody tr:hover {
  background: rgba(248, 251, 255, 0.96);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 0;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8eef6, #f6f9fc);
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.name {
  font-weight: 600;
}

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

.badge {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.badge.ok {
  color: var(--success);
  background: rgba(20, 184, 116, 0.12);
  border-color: rgba(16, 185, 129, 0.18);
}

.badge.warn {
  color: var(--warn);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.18);
}

.badge.off {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
}

.groups-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  min-height: 680px;
  height: clamp(680px, 92vh, 980px);
  max-height: 980px;
}

.category-panel {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  height: 100%;
}

.category-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.category-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.category-head-actions {
  display: flex;
  gap: 8px;
}

.category-panel h4 {
  font-size: 14px;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.88);
  transition:
    border-color 0.18s var(--ease-standard),
    box-shadow 0.18s var(--ease-standard),
    background 0.18s var(--ease-standard);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(31, 111, 235, 0.2);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(31, 111, 235, 0.48);
  box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.12);
  background: #fff;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.category-item {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 10px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  transition:
    background 0.18s var(--ease-standard),
    border-color 0.18s var(--ease-standard),
    box-shadow 0.18s var(--ease-standard),
    transform 0.18s var(--ease-standard);
}

.category-item:hover {
  border-color: rgba(31, 111, 235, 0.18);
  background: rgba(248, 251, 255, 0.9);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.category-item.active {
  border-color: rgba(126, 174, 255, 0.72);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(247, 251, 255, 0.96));
  color: var(--primary-strong);
  box-shadow: 0 14px 26px rgba(31, 111, 235, 0.1);
}

.category-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.category-right em {
  font-style: normal;
}

.category-state {
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  background: #f5f5f7;
  color: #6b7280;
}

.category-state.running {
  color: #0c5132;
  background: #e8f8ef;
  border-color: #c7ebd5;
}

.category-state.paused {
  color: #8a5a00;
  background: #fff7e6;
  border-color: #ffe3ad;
}

.list-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
}

.quick-test-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.quick-test-head h3 {
  font-size: 18px;
}

.quick-test-form {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr auto;
  gap: 10px;
  align-items: end;
}

.quick-test-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.quick-test-form label.grow {
  min-width: 320px;
}

.quick-test-result {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.98), rgba(246, 249, 253, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.quick-test-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  font-size: 13px;
}

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

.intent-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 360px;
  max-height: calc(100vh - 180px);
}

.intent-parent-list {
  border-right: 1px solid #eef0f4;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.intent-parent-item {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: 0.2s ease;
}

.intent-parent-label {
  min-width: 0;
  flex: 1 1 auto;
}

.intent-type-badge {
  flex: 0 0 auto;
  pointer-events: none;
}

.intent-type-badge.text {
  color: #2563eb;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.intent-type-badge.image {
  color: #7c3aed;
  border-color: #d8b4fe;
  background: #f5f3ff;
}

.intent-parent-item:hover {
  border-color: rgba(31, 111, 235, 0.18);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.intent-parent-item.active {
  border-color: #b9d8ff;
  background: linear-gradient(135deg, #eff6ff, #f7fbff);
  box-shadow: 0 10px 24px rgba(24, 92, 214, 0.09);
}

.intent-editor {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.intent-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 2px 2px;
}

.intent-editor-foot {
  display: flex;
  justify-content: flex-start;
  padding: 2px 0 4px;
}

.template-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 360px;
  max-height: calc(100vh - 180px);
}

.single-offer-keyword-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.placeholder-card {
  padding: 16px;
}

.single-offer-layout {
  display: grid;
  grid-template-columns: 192px 224px minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.single-offer-side,
.single-offer-main {
  padding: 14px;
  min-height: 0;
  height: 100%;
}

.single-offer-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.single-offer-side-head,
.single-offer-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}

.single-offer-side-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.single-offer-side-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--saas-gray-4);
  border-radius: var(--saas-radius-sm);
  background: var(--saas-gray-1);
  color: var(--saas-gray-9);
  cursor: pointer;
  transition: all 0.16s ease;
}

.single-offer-side-item:hover,
.single-offer-side-item.active {
  border-color: rgba(24, 144, 255, 0.36);
  background: rgba(24, 144, 255, 0.06);
  color: var(--saas-primary);
}

.single-offer-side-item .sub,
.single-offer-main .sub {
  font-size: 12px;
  color: var(--saas-gray-7);
}

.single-offer-field input,
.single-offer-field textarea {
  width: 100%;
}

.single-offer-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.single-offer-main-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.single-offer-edit-grid {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.single-offer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.single-offer-field span {
  font-size: 12px;
  color: var(--saas-gray-7);
}

.single-offer-inline-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: auto;
}

.single-offer-inline-field span {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--saas-gray-7);
}

.single-offer-inline-field input {
  width: 10ch;
  min-width: 10ch;
}

.single-offer-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  white-space: nowrap;
  flex-shrink: 0;
}

.single-offer-dialog-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--saas-gray-5);
  border-radius: var(--saas-radius-sm);
  background: var(--saas-gray-2);
}

.single-offer-main table input,
.single-offer-main table textarea,
.single-offer-main .plan-preview-trigger {
  width: 100%;
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
}

.single-offer-main table {
  table-layout: fixed;
}

.single-offer-sku-input {
  width: 60% !important;
  min-width: 120px;
}

.single-offer-col-sku {
  width: 12%;
}

.single-offer-col-name {
  width: 18%;
}

.single-offer-col-keyword {
  width: 22%;
}

.single-offer-col-plan {
  width: 18%;
}

.single-offer-col-append {
  width: 24%;
}

.single-offer-col-action {
  width: 6%;
}

.single-offer-append-inline {
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  line-height: 1.4;
  padding-top: 4px;
  padding-bottom: 4px;
}

.single-offer-append-inline:focus {
  min-height: 72px;
  height: 72px;
  overflow: auto;
}

.single-offer-action-cell {
  text-align: center;
}

.single-offer-action-btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 12px;
}

body[data-page="single-offer-keywords"] .page-head .head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.single-offer-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: auto;
  padding: 0 14px;
  white-space: nowrap;
}

.single-offer-text-btn.primary {
  border-color: var(--saas-primary);
  background: var(--saas-primary);
  color: #fff;
}

.single-offer-text-btn svg {
  flex-shrink: 0;
}

.single-offer-side-head .single-offer-text-btn {
  padding: 0 10px;
}

.single-offer-th-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  white-space: nowrap;
}

.single-offer-th-with-action .single-offer-text-btn {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  flex-shrink: 0;
}

.single-offer-th-with-action > span {
  white-space: nowrap;
}

.plan-preview-wrap,
.plan-preview-trigger,
.single-offer-main td input:not(.single-offer-sku-input) {
  width: 100%;
}

body[data-page="single-offer-keywords"] .app-shell {
  height: calc(100vh - 56px);
  min-height: calc(100vh - 56px);
  overflow: hidden;
}

body[data-page="flow-keywords"] .app-shell {
  height: calc(100vh - 56px);
  min-height: calc(100vh - 56px);
  overflow: hidden;
}

body[data-page="flow-keywords"] #pageFlowKeywords {
  height: 100%;
  min-height: 0;
}

body[data-page="single-offer-keywords"] #pageSingleOfferKeywords {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.plan-preview-wrap {
  position: relative;
}

.plan-preview-trigger {
  max-width: 220px;
  padding: 0 10px;
  border: 1px solid var(--saas-gray-4);
  border-radius: var(--saas-radius-sm);
  background: var(--saas-gray-2);
  color: var(--saas-gray-9);
  text-align: left;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.plan-preview-trigger.empty {
  color: var(--saas-gray-6);
}

.plan-preview-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: none;
  min-width: 320px;
  max-width: 520px;
  max-height: 320px;
  padding: 12px 14px;
  border: 1px solid rgba(24, 144, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  white-space: pre-wrap;
  overflow: auto;
  line-height: 1.6;
  color: var(--saas-gray-10);
}

.plan-preview-pop.open {
  display: block;
}

.flow-apply-wrap {
  width: 100%;
  display: flex;
  align-items: center;
}

.flow-apply-trigger {
  width: auto;
  max-width: 100%;
  min-height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.flow-apply-trigger.empty {
  color: var(--saas-gray-6);
}

.flow-apply-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  min-width: 0;
}

.flow-apply-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--saas-gray-8);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s var(--ease-standard), border-color 0.18s var(--ease-standard), color 0.18s var(--ease-standard);
}

.flow-apply-chip:hover {
  border-color: rgba(24, 144, 255, 0.26);
  color: var(--saas-primary);
}

.flow-apply-chip.active {
  background: rgba(24, 144, 255, 0.1);
  border-color: rgba(24, 144, 255, 0.3);
  color: var(--saas-primary);
}

.flow-apply-more {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--saas-gray-7);
}

.flow-apply-placeholder {
  color: var(--saas-gray-6);
}

.flow-apply-caret {
  flex-shrink: 0;
  color: var(--saas-gray-7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.flow-apply-pop {
  display: none;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.flow-apply-pop.open {
  display: block;
}

.flow-apply-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-apply-dialog-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
}

.template-parent-list {
  border-right: 1px solid #eef0f4;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.template-parent-item {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.template-parent-item:hover {
  border-color: rgba(31, 111, 235, 0.18);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.template-parent-item.active {
  border-color: #b9d8ff;
  background: linear-gradient(135deg, #eff6ff, #f7fbff);
  box-shadow: 0 10px 24px rgba(24, 92, 214, 0.09);
}

.template-editor {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}

.template-editor-head {
  padding: 8px 2px 2px;
}

#templateEditorTitle {
  font-size: 20px;
  font-weight: 650;
}

.template-editor-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.template-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

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

.template-card-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.template-schemes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scheme-item {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.96), rgba(247, 250, 254, 0.94));
}

.scheme-head {
  display: grid;
  grid-template-columns: minmax(140px, 220px) auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.scheme-name-input {
  height: 34px;
}

.scheme-all-btn {
  min-width: 72px;
}

.scheme-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scheme-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 8px;
  background: #f3f6fb;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.6;
}

.scheme-tag.empty {
  background: #f8fafc;
  color: #9ca3af;
}

.scheme-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scheme-body.collapsed {
  display: none;
}

.scheme-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.rot-180 {
  transform: rotate(180deg);
}

.template-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.template-card label span {
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
}

.template-card textarea {
  min-height: 96px;
  border-radius: 12px;
  border-color: #dbe5f4;
  background: #fbfdff;
}

#intentEditorTitle {
  font-size: 20px;
  font-weight: 650;
}

#intentChildTableBody input {
  border-radius: 12px;
  border-color: #dfe6f3;
  background: #fcfdff;
}

#intentChildTableBody .intent-edit-words-btn {
  border-color: #d4e5ff;
  color: #0f4fb8;
  background: #f4f9ff;
}

#intentChildTableBody .intent-edit-words-btn:hover {
  border-color: #bdd8ff;
  background: #edf6ff;
}

.words-dialog-body {
  gap: 12px;
}

#intentWordsDialog {
  width: min(980px, 94vw);
}

.words-meta {
  color: var(--muted);
  font-size: 13px;
}

.words-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.words-field span {
  color: #42526b;
  font-weight: 600;
}

.words-field textarea {
  min-height: 110px;
  border-radius: 12px;
  border-color: #dbe5f4;
  background: #fbfdff;
}

.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.batch-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.group-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-title {
  font-weight: 600;
}

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

.pagination-bar {
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  gap: 8px;
}

.pager-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.jump-input {
  width: 66px;
}

.dialog {
  border: none;
  border-radius: 22px;
  width: min(760px, 94vw);
  max-height: 88vh;
  padding: 0;
  overflow: hidden;
  position: fixed;
  inset: 0;
  margin: auto;
  background: transparent;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.18s var(--ease-standard), transform 0.18s var(--ease-standard);
}

.dialog.dialog-opening,
.dialog.dialog-opened {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dialog.dialog-closing {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(6px) saturate(1.05);
}

.dialog-body {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 253, 0.96));
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.18);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog-actions.left {
  justify-content: flex-start;
}

.dialog-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sync-dialog {
  width: min(900px, 95vw);
}

.sync-body {
  background: linear-gradient(140deg, #e9f7ff, #f3f1ff 28%, #fff 60%);
}

.sync-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sync-title-row h3 {
  font-size: 30px;
  font-weight: 620;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 12px;
  font-size: 22px;
  color: #8a8a8f;
  cursor: pointer;
  transition: all 0.18s var(--ease-standard);
}

.icon-btn:hover {
  color: var(--text);
  border-color: rgba(31, 111, 235, 0.22);
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.icon-btn.mini {
  width: 30px;
  height: 30px;
  font-size: 16px;
  margin-left: auto;
}

.sync-step {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  opacity: 0.72;
  transition: opacity 0.18s var(--ease-standard), transform 0.18s var(--ease-standard), box-shadow 0.18s var(--ease-standard);
}

.sync-step.active {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
}

.sync-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f2;
}

.sync-step-head span {
  padding: 3px 9px;
  border-radius: 8px;
  background: #f2f2f4;
  color: #7a7a81;
  font-size: 12px;
}

.sync-step-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sync-step-body.collapsed {
  display: none;
}

.sync-line {
  color: #3f3f46;
}

.sync-progress-top {
  text-align: center;
}

.sync-big {
  font-size: 34px;
  font-weight: 620;
}

.sync-sub {
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #ebebef;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6ea8ff, var(--primary));
  transition: width 0.24s var(--ease-standard);
}

.sync-result {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.sync-result-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#syncResultTitle {
  font-size: 24px;
}

#syncResultMeta,
#syncResultElapsed {
  color: var(--muted);
  font-size: 13px;
}

.sync-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.sync-tab {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}

.sync-tab.active {
  color: #0b5cab;
  border-color: #cfe8ff;
  background: #f1f8ff;
}

#syncResultList {
  list-style: none;
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#syncResultList li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #f1f1f3;
  padding-bottom: 6px;
}

.manage-list {
  list-style: none;
  max-height: 360px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.76);
  transition: box-shadow 0.18s var(--ease-standard), border-color 0.18s var(--ease-standard);
}

.manage-item:hover {
  border-color: rgba(31, 111, 235, 0.18);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.manage-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

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

.manage-name {
  font-weight: 600;
}

.manage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.manage-count {
  color: #42526b;
  font-weight: 500;
}

.manage-keywords-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.manage-keywords-input {
  min-width: 0;
  height: 34px;
}

.manage-keywords-save-btn {
  min-width: 72px;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  color: #506176;
  background: #f8fafc;
}

.manage-keywords-save-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.manage-dialog-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.manage-del-btn {
  flex: 0 0 auto;
}

.manage-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.success-mark {
  color: #10b981;
  font-weight: 700;
}

.fail-mark {
  color: #ef4444;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Reference-style enterprise console overrides */
body {
  background: #eff2f5;
}

body::before {
  display: none;
}

.top-strip {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #e6ebf2;
  z-index: 60;
}

.top-header {
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  width: 184px;
  height: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  background: #ffffff;
  border-right: 1px solid #e6ebf2;
  box-shadow: none;
  backdrop-filter: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border-bottom: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

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

.brand {
  margin-right: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  color: #2c3542;
}

.top-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.top-nav-item {
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  color: #5d6a79;
  background: transparent;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}

.top-nav-item svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.top-nav-item:hover {
  color: #3d8cff;
  background: #f5f9ff;
  border-color: #e2edff;
}

.top-nav-item.active {
  color: #3d8cff;
  background: #edf4ff;
  border-color: #cfe0ff;
  box-shadow: none;
}

.sidebar-footer {
  padding-top: 10px;
  border-top: 1px solid #edf1f5;
}

.top-right {
  width: 100%;
  justify-content: center;
  margin-left: 0;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid #dbe6f8;
  background: #f6f9fe;
  color: #5b6d84;
  box-shadow: none;
}

.app-shell {
  max-width: none;
  margin: 64px 0 0 184px;
  padding: 24px 24px 36px;
  min-height: 100vh;
}

.page {
  gap: 18px;
}

.page-head {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.page-head h1 {
  font-size: 18px;
  font-weight: 700;
  color: #2f3540;
  letter-spacing: 0;
}

.title-with-icon {
  gap: 10px;
}

.title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f0f5ff;
  border: 1px solid #dbe6fb;
  color: #4a8ff8;
  box-shadow: none;
}

.title-icon svg,
.icon-only-btn svg,
.btn-delete svg {
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.head-actions {
  gap: 12px;
}

.card,
.list-panel,
.quick-test-card,
.table-card,
.page > .status-line,
.page > #ingestSettingsBar,
.page > #ignoreServerBar,
.page > #ignoredServerList,
.page > #ignoreChatBar,
.page > #ignoredChatList {
  background: #ffffff;
  border: 1px solid #e5eaf1;
  border-radius: 16px;
  box-shadow: none;
  backdrop-filter: none;
}

.page > .status-line,
.page > #ingestSettingsBar,
.page > #ignoreServerBar,
.page > #ignoredServerList,
.page > #ignoreChatBar,
.page > #ignoredChatList {
  padding: 12px 16px;
}

.status-line {
  color: #6f7f91;
  font-size: 13px;
}

.tabs {
  gap: 6px;
  padding: 4px;
  border: 1px solid #e3e9f2;
  border-radius: 12px;
  background: #fff;
}

.tab {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #708093;
  box-shadow: none;
}

.tab.active {
  background: #edf4ff;
  border-color: #d3e1ff;
  color: #3d8cff;
  box-shadow: none;
}

.btn,
.btn-ghost,
.sync-tab {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
  filter: none;
}

.btn {
  border-color: #4c95ff;
  background: #4c95ff;
}

.btn:hover {
  transform: none;
  background: #418af3;
  box-shadow: none;
}

.btn-ghost,
.sync-tab {
  background: #fff;
  border-color: #d7e0eb;
  color: #5d6d7e;
}

.btn-ghost:hover,
.sync-tab:hover {
  background: #f8fbff;
  border-color: #c7d6ea;
  box-shadow: none;
}

.btn.is-on {
  background: #3d8cff;
  border-color: #3d8cff;
}

input,
select,
textarea {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border-color: #d9e1ea;
  background: #fff;
  box-shadow: none;
}

textarea {
  padding-top: 10px;
  padding-bottom: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #86b4ff;
  box-shadow: 0 0 0 3px rgba(76, 149, 255, 0.12);
}

.quick-test-card,
.category-panel,
.list-panel,
.intent-editor,
.template-editor {
  padding: 18px;
}

.list-toolbar,
.pagination-bar {
  padding: 14px 18px;
  border-color: #edf1f5;
}

table {
  background: #fff;
}

th,
td {
  padding: 16px 14px;
  border-bottom: 1px solid #edf1f5;
}

th {
  position: static;
  background: #f7f9fc;
  color: #7b8796;
  font-size: 13px;
  font-weight: 600;
}

tbody tr:hover {
  background: #fbfcfe;
}

.groups-layout {
  gap: 16px;
  min-height: 700px;
  height: calc(100vh - 96px);
  max-height: none;
}

.category-panel {
  padding: 14px;
}

.category-item,
.intent-parent-item,
.template-parent-item,
.manage-item {
  border-radius: 12px;
  border-color: #e7edf5;
  background: #fff;
  box-shadow: none;
  transform: none;
}

.list-row,
.category-item.active,
.intent-parent-item.active,
.template-parent-item.active {
  border: 1px solid #cfe0ff;
  background: #f3f7ff;
  box-shadow: none;
}

.category-item.active,
.intent-parent-item.active,
.template-parent-item.active {
  color: #3d8cff;
}

.quick-test-result,
.template-card,
.scheme-item {
  border-color: #e8edf4;
  background: #fbfcfe;
  box-shadow: none;
}

.formula-card {
  padding: 0;
  overflow: hidden;
  min-height: calc(100vh - 180px);
  height: calc(100vh - 180px);
}

.formula-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

body[data-page="formula"] .app-shell {
  padding: 10px 12px 12px;
}

body[data-page="formula"] #pageFormula {
  gap: 8px;
}

body[data-page="formula"] .formula-card {
  min-height: calc(100vh - 126px);
  height: calc(100vh - 126px);
}

.badge,
.category-state,
.chip {
  border-radius: 999px;
}

.badge.ok,
.category-state.running {
  color: #277c49;
  background: #eff8f2;
  border-color: #cfe9d8;
}

.badge.warn,
.category-state.paused {
  color: #9a6b14;
  background: #fff7e9;
  border-color: #f3ddb0;
}

.badge.off {
  background: #f2f4f7;
  border-color: #e2e7ee;
}

.dialog::backdrop {
  background: rgba(34, 45, 62, 0.16);
  backdrop-filter: blur(2px);
}

.dialog-body {
  border-color: #e4eaf2;
  background: #fff;
  box-shadow: 0 16px 36px rgba(33, 46, 66, 0.12);
}

.sync-body {
  background: #fff;
}

.action-toast {
  top: 24px;
  right: 28px;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(33, 46, 66, 0.12);
}

.btn.icon-only-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 14px;
  box-shadow: none;
  background-image: none;
}

.btn.icon-only-btn.icon-neutral {
  background: #ffffff;
  border-color: #d8e0ea;
  color: #5b6b7f;
}

.btn.icon-only-btn.icon-neutral:hover {
  background: #f7fafc;
  border-color: #c7d3e0;
  color: #425366;
}

.btn.icon-only-btn.icon-danger {
  background: #fffdfd;
  border-color: #f0d7d7;
  color: #d96b6b;
}

.btn.icon-only-btn.icon-danger:hover {
  background: #fff1f1;
  border-color: #e8b4b4;
  color: #c93b3b;
}

.btn.icon-only-btn svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 1200px) {
  .top-strip {
    height: 58px;
    padding: 0 14px;
  }

  .top-header {
    width: 168px;
    top: 58px;
  }

  .app-shell {
    margin: 58px 0 0 168px;
    padding: 22px 18px 30px;
  }
}

@media (max-width: 1080px) {
  .top-strip {
    position: static;
    height: auto;
    padding: 14px;
  }

  .top-header {
    position: static;
    width: auto;
    height: auto;
    min-height: 0;
  }

  .app-shell {
    margin-left: 0;
    padding: 18px 14px 28px;
  }

  .top-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .top-nav-item {
    width: auto;
    min-height: 42px;
    padding: 0 14px;
  }

  .groups-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
    max-height: none;
  }

  .list-toolbar,
  .pagination-bar,
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .batch-actions,
  .pager-right {
    flex-wrap: wrap;
  }

  .intent-panel {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .template-panel {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .single-offer-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .single-offer-edit-grid {
    grid-template-columns: 1fr;
  }

  .single-offer-main-toolbar {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .single-offer-main-head {
    min-width: 0;
    width: 100%;
  }

  .single-offer-edit-grid {
    width: 100%;
    flex-wrap: wrap;
  }

  .single-offer-inline-field {
    width: 100%;
  }

  body[data-page="single-offer-keywords"] .app-shell {
    height: auto;
    min-height: calc(100vh - 56px);
    overflow: visible;
  }

  body[data-page="single-offer-keywords"] #pageSingleOfferKeywords {
    height: auto;
  }

}

/* ===== Enterprise SaaS Admin UI (skill override) ===== */
:root {
  --saas-primary: #1890ff;
  --saas-success: #52c41a;
  --saas-warning: #fa8c16;
  --saas-error: #f5222d;
  --saas-info: #1677ff;
  --saas-gray-1: #ffffff;
  --saas-gray-2: #fafafa;
  --saas-gray-3: #f5f5f5;
  --saas-gray-4: #e8e8e8;
  --saas-gray-5: #d9d9d9;
  --saas-gray-6: #bfbfbf;
  --saas-gray-7: #8c8c8c;
  --saas-gray-8: #595959;
  --saas-gray-9: #434343;
  --saas-gray-10: #262626;
  --saas-page-bg: #f3f6fb;
  --saas-radius-sm: 6px;
  --saas-radius-md: 8px;
  --saas-shadow-1: 0 2px 8px rgba(31, 35, 41, 0.06);
}

* {
  font-family: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Helvetica Neue", sans-serif;
}

body {
  background: var(--saas-page-bg);
  color: var(--saas-gray-10);
}

.top-strip {
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--saas-gray-4);
  box-shadow: var(--saas-shadow-1);
  z-index: 100;
}

.sidebar-brand {
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #2b3340;
}

.top-header {
  top: 56px;
  width: 176px;
  padding: 8px;
  border-right: 1px solid var(--saas-gray-4);
  background: var(--saas-gray-1);
}

.top-nav {
  gap: 4px;
  padding: 0;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-separated {
  margin-top: 12px;
}

.top-nav-item {
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--saas-radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--saas-gray-8);
}

.top-nav-item svg {
  width: 14px;
  height: 14px;
}

.top-nav-item.active {
  color: var(--saas-primary);
  background: rgba(24, 144, 255, 0.1);
  border-color: rgba(24, 144, 255, 0.28);
}

.sub-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px solid #e8e8e8;
}

.sub-nav-item {
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--saas-radius-sm);
  background: transparent;
  color: var(--saas-gray-7);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.sub-nav-item:hover {
  color: var(--saas-primary);
  background: rgba(24, 144, 255, 0.06);
}

.sub-nav-item.active {
  color: var(--saas-primary);
  background: rgba(24, 144, 255, 0.08);
  border-color: rgba(24, 144, 255, 0.22);
}

.top-right {
  font-size: 12px;
  border-radius: var(--saas-radius-sm);
  border-color: var(--saas-gray-5);
  background: var(--saas-gray-2);
}

.app-shell {
  margin: 56px 0 0 176px;
  padding: 16px 20px 24px;
}

.page {
  gap: 12px;
}

.page-head {
  padding: 0;
  border: none;
  background: transparent;
}

.page-head h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--saas-gray-10);
}

.title-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--saas-radius-sm);
  background: rgba(24, 144, 255, 0.08);
  border-color: rgba(24, 144, 255, 0.2);
}

.card,
.list-panel,
.table-card,
.quick-test-card,
.page > .status-line,
.page > #ingestSettingsBar,
.page > #ignoreServerBar,
.page > #ignoredServerList,
.page > #ignoreChatBar,
.page > #ignoredChatList {
  background: var(--saas-gray-1);
  border: 1px solid var(--saas-gray-4);
  border-radius: var(--saas-radius-md);
  box-shadow: none;
}

.page > .status-line,
.page > #ingestSettingsBar,
.page > #ignoreServerBar,
.page > #ignoredServerList,
.page > #ignoreChatBar,
.page > #ignoredChatList {
  padding: 10px 12px;
}

.status-line {
  font-size: 12px;
  color: var(--saas-gray-7);
}

.btn,
.btn-ghost,
.sync-tab {
  min-height: 32px;
  height: 32px;
  border-radius: var(--saas-radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.16s ease;
}

.btn {
  border-color: var(--saas-primary);
  background: var(--saas-primary);
}

.btn:hover {
  background: #3ca0ff;
  border-color: #3ca0ff;
}

.btn-ghost,
.sync-tab {
  border-color: var(--saas-gray-5);
  background: var(--saas-gray-1);
  color: var(--saas-gray-8);
}

.btn-ghost:hover,
.sync-tab:hover {
  border-color: rgba(24, 144, 255, 0.42);
  color: var(--saas-primary);
}

input,
select,
textarea {
  border: 1px solid var(--saas-gray-5);
  border-radius: var(--saas-radius-sm);
  background: var(--saas-gray-1);
  height: 32px;
  min-height: 32px;
  font-size: 13px;
}

textarea {
  height: auto;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(24, 144, 255, 0.38);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--saas-primary);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.12);
}

.btn.icon-only-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: var(--saas-radius-sm);
  padding: 0;
}

.btn.icon-only-btn svg {
  width: 14px;
  height: 14px;
}

.btn.icon-only-btn.icon-neutral {
  border-color: #d8e0ea;
  color: #5b6b7f;
  background: #fff;
}

.btn.icon-only-btn.icon-neutral:hover {
  border-color: #c7d3e0;
  color: #425366;
  background: #f7fafc;
}

.btn.icon-only-btn.icon-danger {
  border-color: #f0d7d7;
  color: #d96b6b;
  background: #fffdfd;
}

.btn.icon-only-btn.icon-danger:hover {
  border-color: #e8b4b4;
  color: #c93b3b;
  background: #fff1f1;
}

th,
td {
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}

th {
  background: var(--saas-gray-3);
  color: var(--saas-gray-8);
  font-weight: 600;
  letter-spacing: 0.01em;
}

tbody tr:hover {
  background: #fafcff;
}

.empty {
  color: var(--saas-gray-7);
}

.badge.ok {
  color: #389e0d;
  background: #f6ffed;
  border-color: #b7eb8f;
}

.badge.warn {
  color: #d46b08;
  background: #fff7e6;
  border-color: #ffd591;
}

.badge.off {
  color: var(--saas-gray-7);
  background: #fafafa;
  border-color: #d9d9d9;
}

.action-toast {
  border-radius: var(--saas-radius-md);
  border-color: var(--saas-gray-4);
}

.action-toast.ok {
  color: #237804;
}

.action-toast.err {
  color: #cf1322;
}

@media (max-width: 1200px) {
  .top-header {
    width: 160px;
  }

  .app-shell {
    margin-left: 160px;
    padding: 14px 14px 20px;
  }

  .sub-nav {
    margin-left: 10px;
    padding-left: 8px;
  }

  .formula-card,
  .formula-frame {
    min-height: calc(100vh - 160px);
    height: calc(100vh - 160px);
  }
}
