:root {
  color-scheme: light;
  --ink: #15202b;
  --muted: #5f6f7c;
  --subtle: #8393a0;
  --line: #d8e2e8;
  --line-strong: #c3d1da;
  --canvas: #eef3f6;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --rail: #102832;
  --rail-2: #183843;
  --accent: #14756f;
  --accent-2: #189281;
  --accent-soft: #e3f3ef;
  --warning: #b65f18;
  --danger: #b94b34;
  --success: #24765a;
  --shadow: 0 18px 44px rgba(28, 52, 66, 0.12);
  --shadow-soft: 0 8px 22px rgba(28, 52, 66, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  font-family:
    "HarmonyOS Sans SC",
    "Alibaba PuHuiTi",
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    ui-sans-serif,
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(20, 117, 111, 0.12), transparent 31rem),
    linear-gradient(180deg, #f8fbfc 0%, var(--canvas) 44%, #e8eff3 100%);
  font-variant-numeric: tabular-nums;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(15, 37, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 37, 43, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}

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

button {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: white;
  background: var(--accent);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

button:hover {
  background: #096f6b;
  box-shadow: 0 8px 18px rgba(11, 127, 122, 0.2);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0) scale(0.99);
}

button:disabled {
  cursor: progress;
  opacity: 0.62;
  transform: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 159, 143, 0.24);
  outline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(11, 127, 122, 0.68);
  box-shadow: 0 0 0 4px rgba(11, 127, 122, 0.08);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

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

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

h1,
h2 {
  text-wrap: balance;
}

h1 {
  margin-bottom: 7px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  font-weight: 750;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
}

h3 {
  margin: 16px 0 8px;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: 8px 12px;
  color: var(--rail);
  background: white;
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow,
.panel-head span,
.pane-head span {
  margin: 0 0 8px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 25% 18%, rgba(15, 159, 143, 0.28), transparent 28rem),
    linear-gradient(135deg, #0f252b, #183039 62%, #eef3f2 62%);
}

.login-panel {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-mark,
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  color: white;
  background: var(--accent);
  font-weight: 800;
}

.login-copy {
  max-width: 34rem;
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.65;
}

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

.login-form button {
  margin-top: 4px;
}

.form-error {
  display: block;
  min-height: 22px;
  margin-top: 12px;
  color: #a23a24;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #0f2a24;
  background: #e5f5ef;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.toast.warning {
  color: #5f360f;
  background: #fff3db;
}

.toast.error {
  color: #7d2519;
  background: #ffe7e1;
}

.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.console-rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 18px;
  color: #e8f1f2;
  background:
    linear-gradient(180deg, rgba(15, 127, 122, 0.18), transparent 26rem),
    var(--rail);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #9fb5bb;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav {
  position: relative;
  width: 100%;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 12px 0 16px;
  text-align: left;
  color: #d6e4e6;
  background: transparent;
}

.nav:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.nav.active {
  color: white;
  background: var(--rail-2);
}

.nav.active::before {
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  content: "";
  background: var(--accent-2);
}

.content {
  min-width: 0;
  padding: 22px clamp(18px, 2.7vw, 34px) 34px;
}


.account-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.account-mode span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: var(--accent);
  background: rgba(11, 127, 122, 0.1);
  border: 1px solid rgba(11, 127, 122, 0.22);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.account-mode small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  max-width: 1440px;
  margin: 0 auto 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.header-copy {
  max-width: 56rem;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.content:has(.view[data-panel="inbox"].active) {
  padding-top: 14px;
}

.content:has(.view[data-panel="inbox"].active)
.account-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.account-mode span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: var(--accent-strong);
  background: rgba(11, 127, 122, 0.1);
  border: 1px solid rgba(11, 127, 122, 0.22);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.account-mode small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-header {
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.content:has(.view[data-panel="inbox"].active) .workspace-header h1 {
  font-size: 30px;
}

.content:has(.view[data-panel="inbox"].active) .header-copy {
  max-width: 46rem;
  font-size: 14px;
}

.actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.form-grid .wide-field,
.form-grid label:has(#productTitle) {
  grid-column: 1 / -1;
}

#productConfigEditor {
  border-color: rgba(15, 118, 110, 0.32);
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.62), rgba(255, 255, 255, 0.96)),
    white;
}

#productConfigEditor textarea {
  min-height: 94px;
  resize: vertical;
}

.field-action {
  display: grid;
  gap: 6px;
}

.field-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-action button {
  white-space: nowrap;
}

.secondary-button {
  color: var(--ink);
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.secondary-button:hover {
  color: var(--rail);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(11, 127, 122, 0.28);
}

.view {
  display: none;
  max-width: 1500px;
  margin: 0 auto;
}

.view.active {
  display: block;
  animation: view-in 220ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.support-shell {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(460px, 1fr) minmax(310px, 360px);
  gap: 12px;
  min-height: calc(100dvh - 136px);
}

.queue-pane,
.chat-pane,
.context-pane {
  min-width: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.queue-pane,
.context-pane {
  align-self: start;
  padding: 14px;
}

.chat-pane {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  overflow: hidden;
}

.pane-head,
.chat-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pane-head {
  margin-bottom: 12px;
}

.pane-head h2,
.chat-toolbar h2 {
  margin: 0;
}

.pane-head strong {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 14px;
}

.pane-head.compact {
  margin-bottom: 9px;
}

.queue-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.queue-tab {
  min-height: 32px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.queue-tab:hover,
.queue-tab.active {
  color: var(--rail);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(20, 117, 111, 0.24);
  transform: none;
}

.conversation-queue {
  display: grid;
  gap: 8px;
  max-height: calc(100dvh - 265px);
  overflow: auto;
  padding-right: 2px;
}

.queue-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 86px;
  padding: 11px 12px;
  text-align: left;
  color: var(--ink);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.queue-item:hover,
.queue-item.active {
  background: white;
  box-shadow:
    inset 3px 0 0 var(--accent),
    inset 0 0 0 1px rgba(20, 117, 111, 0.22),
    0 10px 22px rgba(28, 52, 66, 0.08);
}

.queue-item span,
.queue-item small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.chat-toolbar span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

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

.message-thread {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px 18px 24px;
  overflow: auto;
  background:
    linear-gradient(rgba(250, 253, 254, 0.88), rgba(250, 253, 254, 0.88)),
    radial-gradient(circle at 88% 10%, rgba(20, 117, 111, 0.06), transparent 24rem);
}

.message {
  display: grid;
  grid-template-columns: 30px minmax(0, auto);
  gap: 9px;
  align-items: start;
  max-width: min(78%, 650px);
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 800;
}

.message-card {
  padding: 11px 13px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 10px 24px rgba(28, 52, 66, 0.07);
}

.message-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}

.message-card p {
  margin: 0;
  line-height: 1.65;
}

.message.buyer {
  justify-self: start;
  border-top-left-radius: 3px;
}

.message.bot,
.message.agent {
  justify-self: end;
  grid-template-columns: minmax(0, auto) 30px;
}

.message.bot .message-avatar,
.message.agent .message-avatar {
  grid-column: 2;
  grid-row: 1;
}

.message.bot .message-card,
.message.agent .message-card {
  grid-column: 1;
  grid-row: 1;
}

.message.bot {
  color: #102832;
}

.message.bot .message-card {
  background: #eaf7f3;
}

.message.agent .message-card {
  background: #f5f7f9;
}

.composer {
  display: grid;
  gap: 10px;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), #ffffff 34%),
    var(--surface);
}

.composer-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.composer-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.composer-toolbar small {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.composer-toolbar .context-flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}


.tool-button {
  min-height: 28px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.tool-button:hover {
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(20, 117, 111, 0.22);
  transform: none;
}

.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 0;
  padding: 7px;
  border: 1px solid rgba(195, 209, 218, 0.9);
  border-radius: 12px;
  background: #fbfdfe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.composer label {
  display: block;
  min-width: 0;
}

.composer label:first-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.composer label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.composer input,
.composer textarea {
  border: 0;
  box-shadow: none;
}

.composer input {
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
  text-align: center;
}

.composer textarea {
  min-height: 82px;
  max-height: 168px;
  padding: 12px 13px;
  border-radius: 10px;
  background: white;
  resize: vertical;
  line-height: 1.65;
}

.composer input:focus,
.composer textarea:focus {
  box-shadow: 0 0 0 3px rgba(20, 117, 111, 0.1);
}

.role-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(176, 204, 213, 0.92);
  border-radius: 10px;
  background: rgba(246, 251, 250, 0.92);
}

.role-switch button,
.bot-toggle {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--subtle);
  font-weight: 800;
  box-shadow: none;
}

.role-switch button {
  min-width: 76px;
  padding: 7px 10px;
}

.role-switch button.active,
.bot-toggle.active {
  color: white;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.16);
}

.bot-toggle {
  min-width: 110px;
  border: 1px solid rgba(176, 204, 213, 0.92);
  background: rgba(246, 251, 250, 0.92);
}

.composer .button-row {
  justify-content: flex-end;
  margin-top: 0;
}

.composer .button-row button {
  min-width: 128px;
}

.context-pane {
  display: grid;
  gap: 10px;
  max-height: calc(100dvh - 166px);
  overflow: auto;
}

.context-block {
  padding: 13px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px rgba(216, 226, 232, 0.86);
}

.ai-card {
  display: grid;
  gap: 10px;
}

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

.ai-score span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-score strong {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
}

.ai-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}

.ai-card small {
  color: var(--muted);
}

.retrieval-trace {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: rgba(236, 248, 246, 0.72);
}

.retrieval-trace span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
}

.retrieval-trace strong {
  color: var(--ink);
  font-size: 13px;
}

.compact-row {
  justify-content: stretch;
}

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

.fact-list {
  display: grid;
  gap: 8px;
}

.fact-list div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

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

.fact-list strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-list span {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12px;
}

.insight-grid,
.product-grid,
.knowledge-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.admin-module-card {
  display: grid;
  min-height: 112px;
  align-content: start;
  gap: 10px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f6fbfa);
  box-shadow: var(--shadow-soft);
}

.admin-module-card:hover {
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #edf8f5);
}

.admin-module-card strong {
  font-size: 16px;
}

.admin-module-card span {
  color: var(--muted);
  line-height: 1.55;
}

.knowledge-board {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.product-card,
.flow-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 252, 0.92)),
    var(--surface);
  box-shadow: inset 0 0 0 1px rgba(216, 226, 232, 0.86);
}

.product-card-head {
  display: grid;
  gap: 4px;
}

.product-card-head span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
}

.product-card-head strong {
  font-size: 15px;
  line-height: 1.35;
}

.product-card small,
.flow-card small {
  color: var(--muted);
  line-height: 1.5;
}

.product-card p,
.flow-card p {
  margin: 0;
  color: #314350;
  line-height: 1.65;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
}

.tertiary-button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--accent);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(20, 117, 111, 0.22);
}

.tertiary-button:hover {
  color: white;
  background: var(--accent);
  box-shadow: none;
}

.compact-form,
.compare-grid,
.matrix-list,
.readiness-list,
.version-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.compact-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

.compare-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.compare-grid > div,
.matrix-list > div,
.readiness-list > div,
.version-list > div {
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.compare-grid span,
.matrix-list span,
.readiness-list span,
.version-list span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
}

.compare-grid strong,
.matrix-list strong,
.readiness-list strong,
.version-list strong {
  display: block;
  line-height: 1.35;
}

.version-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 2fr) auto;
  gap: 10px;
  align-items: center;
}

.compare-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.oauth-link {
  border-left: 3px solid var(--accent);
}

.timeline {
  position: relative;
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.timeline::before {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 5px;
  width: 1px;
  content: "";
  background: var(--line);
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.timeline-item::before {
  position: absolute;
  top: 17px;
  left: -17px;
  width: 9px;
  height: 9px;
  border: 2px solid white;
  border-radius: 50%;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(20, 117, 111, 0.22);
}

.timeline-item strong {
  font-size: 14px;
}

.timeline-item small {
  color: var(--muted);
}

.timeline-item p {
  margin: 0;
  color: #314350;
  line-height: 1.6;
}

.flow-board {
  display: grid;
  gap: 12px;
}

.flow-steps {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.flow-steps div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.flow-steps span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: white;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.flow-steps strong {
  font-size: 14px;
}

.customer-board {
  display: grid;
  gap: 18px;
}

.customer-board h3 {
  margin-top: 0;
}

.metric {
  min-height: 104px;
  padding: 15px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

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

.metric strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1;
  font-weight: 780;
}

.dashboard-grid,
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 14px;
}

.dashboard-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-wide {
  grid-row: span 2;
}

.panel-tall {
  min-height: 340px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  gap: 14px;
  align-items: start;
}

.panel,
article {
  min-width: 0;
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 16px;
}

.panel-head span {
  margin: 0;
  white-space: nowrap;
}

.editor-panel {
  order: 2;
  display: grid;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 250, 251, 0.94)),
    var(--surface-soft);
  box-shadow: inset 0 0 0 1px rgba(216, 226, 232, 0.9);
}

.list-panel {
  order: 1;
  min-height: 420px;
}

.editor-panel label {
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(216, 226, 232, 0.72);
}

.editor-panel input,
.editor-panel select,
.editor-panel textarea {
  border-color: transparent;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.editor-panel textarea {
  min-height: 88px;
}

.list {
  display: grid;
  gap: 9px;
}

.row {
  position: relative;
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px rgba(200, 212, 220, 0.78);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.row:hover {
  transform: translateY(-1px);
  background: white;
  box-shadow:
    inset 0 0 0 1px rgba(11, 127, 122, 0.24),
    0 8px 18px rgba(31, 54, 68, 0.08);
}

.row strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  line-height: 1.45;
}

.row small,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.row p {
  margin: 9px 0 0;
  color: #334150;
  line-height: 1.65;
  text-wrap: pretty;
}

#customers h3 {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

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

  .dashboard-grid,
  .dashboard-grid.two-col,
  .grid,
  .split,
  .support-shell {
    grid-template-columns: 1fr;
  }

  .context-pane,
  .conversation-queue {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .app {
    display: block;
  }

  .console-rail {
    position: sticky;
    z-index: 5;
    top: 0;
    height: auto;
    padding: 12px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 0 12px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.06);
  }

  .nav.active::before {
    inset: auto 12px 0;
    width: auto;
    height: 2px;
  }

  .content {
    padding: 18px 14px 34px;
  }


.account-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.account-mode span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: var(--accent-strong);
  background: rgba(11, 127, 122, 0.1);
  border: 1px solid rgba(11, 127, 122, 0.22);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.account-mode small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-header {
    display: grid;
  }

  .actions,
  .button-row {
    justify-content: stretch;
  }

  .actions button,
  .button-row button {
    flex: 1 1 150px;
  }

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

  .chat-toolbar,
  .composer-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chat-actions {
    flex-wrap: wrap;
  }

  .message {
    max-width: 92%;
  }

  .metric {
    min-height: 92px;
  }

  .panel,
  article {
    padding: 15px;
  }

  .panel-head {
    display: grid;
    gap: 4px;
  }
}

@media (max-width: 460px) {
  .login {
    padding: 14px;
    place-items: stretch;
  }

  .login-panel {
    align-self: center;
    padding: 24px;
  }

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

  h1 {
    font-size: 26px;
  }
}

/* V2 product-console redesign pass: keep data and behavior, upgrade visual hierarchy. */
:root {
  --canvas: #eef2f3;
  --surface: #fbfcfc;
  --surface-soft: #f4f7f7;
  --rail: #16252a;
  --rail-2: #20343a;
  --accent: #0f766e;
  --accent-2: #2a9d8f;
  --accent-soft: #e6f4f1;
  --amber-soft: #fff3df;
  --blue-soft: #eaf2fb;
  --shadow: 0 24px 54px rgba(22, 37, 42, 0.14);
  --shadow-soft: 0 12px 28px rgba(22, 37, 42, 0.09);
}

body {
  background:
    radial-gradient(circle at 14% 8%, rgba(42, 157, 143, 0.14), transparent 30rem),
    radial-gradient(circle at 92% 16%, rgba(231, 139, 68, 0.1), transparent 28rem),
    linear-gradient(180deg, #f8faf9 0%, #edf2f3 48%, #e7eef0 100%);
}

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

.console-rail {
  min-width: 0;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(42, 157, 143, 0.22), transparent 26rem),
    linear-gradient(180deg, #16252a 0%, #102027 100%);
}

.brand {
  margin-bottom: 16px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.brand-mark,
.login-mark {
  border-radius: 12px;
  background: linear-gradient(145deg, #0f766e, #32a996);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.28);
}

.nav-list {
  gap: 3px;
}

.nav {
  min-width: 0;
  min-height: 38px;
  border-radius: 10px;
  color: #cbd8da;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav.active {
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.12);
}


.account-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.account-mode span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: var(--accent-strong);
  background: rgba(11, 127, 122, 0.1);
  border: 1px solid rgba(11, 127, 122, 0.22);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.account-mode small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-header {
  align-items: center;
  padding: 16px 18px;
  border: 1px solid rgba(196, 210, 216, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(31, 54, 68, 0.07);
  backdrop-filter: blur(18px);
}

.workspace-header h1 {
  margin-bottom: 6px;
}

.header-copy {
  color: #647684;
}

.module-chrome {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(260px, 1.1fr) minmax(240px, 0.9fr);
  gap: 1px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid rgba(191, 205, 212, 0.8);
  border-radius: 14px;
  background: rgba(191, 205, 212, 0.8);
  box-shadow: var(--shadow-soft);
}

.module-chrome > div {
  min-width: 0;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.88);
}

.module-copy {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0.92)),
    white;
}

.module-chrome span {
  display: block;
  margin-bottom: 7px;
  color: #768893;
  font-size: 12px;
  font-weight: 700;
}

.module-chrome strong {
  display: block;
  font-size: 21px;
  line-height: 1.2;
}

.module-chrome p {
  margin: 0;
  color: #3d4d59;
  line-height: 1.65;
}

.metrics {
  gap: 12px;
}

.metric {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(211, 223, 228, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 250, 0.95)),
    white;
}

.metric::after {
  position: absolute;
  right: -32px;
  bottom: -42px;
  width: 100px;
  height: 100px;
  border-radius: 26px;
  content: "";
  background: rgba(15, 118, 110, 0.08);
  transform: rotate(18deg);
}

.dashboard-grid,
.split {
  gap: 16px;
}

.split {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
}

.panel,
article {
  border: 1px solid rgba(211, 223, 228, 0.82);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 36px rgba(31, 54, 68, 0.08);
}

.panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(216, 226, 232, 0.84);
}

.panel-head span,
.pane-head span,
.eyebrow {
  color: #7b8e9b;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.editor-panel {
  position: sticky;
  top: 18px;
  order: 2;
  border-color: rgba(15, 118, 110, 0.24);
  background:
    linear-gradient(180deg, rgba(230, 244, 241, 0.95), rgba(255, 255, 255, 0.9)),
    white;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 18px 44px rgba(15, 118, 110, 0.12);
}

.editor-panel .panel-head::after {
  content: "快速操作";
  padding: 5px 8px;
  border-radius: 8px;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.editor-panel label {
  padding: 11px 12px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.editor-panel input,
.editor-panel select,
.editor-panel textarea {
  border-radius: 10px;
}

.list-panel {
  min-height: 520px;
}

.product-grid,
.knowledge-board,
.insight-grid {
  gap: 12px;
}

.product-card,
.flow-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(211, 223, 228, 0.82);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 249, 0.96)),
    white;
  box-shadow: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.product-card::before,
.flow-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  content: "";
  background: linear-gradient(180deg, var(--accent), rgba(42, 157, 143, 0.25));
}

.product-card:hover,
.flow-card:hover {
  border-color: rgba(15, 118, 110, 0.36);
  box-shadow: 0 16px 34px rgba(31, 54, 68, 0.09);
  transform: translateY(-2px);
}

.product-card.highlighted-card {
  border-color: rgba(15, 118, 110, 0.58);
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.16);
}

.product-card-head {
  padding-left: 2px;
}

.product-card-head span {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 7px;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.09);
}

.product-card-head strong {
  font-size: 16px;
}

.card-actions {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(191, 205, 212, 0.9);
}

.diagnostic-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(191, 205, 212, 0.8);
  border-radius: 12px;
  background: rgba(247, 250, 250, 0.86);
}

.diagnostic-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.status-badge {
  border-radius: 8px;
}

.row {
  border: 1px solid rgba(211, 223, 228, 0.82);
  border-radius: 12px;
  background: rgba(250, 252, 252, 0.88);
  box-shadow: none;
}

.timeline {
  padding-left: 20px;
}

.timeline-item {
  border: 1px solid rgba(211, 223, 228, 0.82);
  border-radius: 12px;
  background: rgba(250, 252, 252, 0.92);
  box-shadow: none;
}

.support-shell {
  grid-template-columns: minmax(260px, 305px) minmax(480px, 1fr) minmax(318px, 370px);
  gap: 14px;
}

.queue-pane,
.chat-pane,
.context-pane {
  border: 1px solid rgba(211, 223, 228, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 40px rgba(31, 54, 68, 0.08);
}

.message-thread {
  background:
    linear-gradient(rgba(247, 250, 250, 0.86), rgba(247, 250, 250, 0.88)),
    radial-gradient(circle at 92% 8%, rgba(42, 157, 143, 0.09), transparent 22rem);
}

.message-card {
  border: 1px solid rgba(211, 223, 228, 0.76);
  box-shadow: 0 10px 24px rgba(31, 54, 68, 0.08);
}

.context-block {
  border: 1px solid rgba(211, 223, 228, 0.86);
  border-radius: 13px;
  background: rgba(247, 250, 250, 0.92);
  box-shadow: none;
}

.composer {
  background: rgba(255, 255, 255, 0.94);
}

.composer-grid {
  border-radius: 14px;
  background: rgba(246, 249, 249, 0.9);
}

.compact-form {
  padding: 12px;
  border: 1px solid rgba(211, 223, 228, 0.82);
  border-radius: 13px;
  background: rgba(247, 250, 250, 0.88);
}

.panel-subtle {
  min-width: 0;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(211, 223, 228, 0.82);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.78);
}

.panel-subtle h3 {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.35;
}

.product-manager {
  display: grid;
  gap: 12px;
}

.product-manager .product-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
  border-left: 4px solid rgba(16, 132, 121, 0.78);
  padding: 14px;
}

.product-manager .product-card p {
  margin: 10px 0 12px;
  white-space: pre-line;
}

.product-manager .card-actions {
  align-items: center;
  gap: 8px;
}

.product-image-link {
  display: block;
  width: 116px;
  height: 116px;
  overflow: hidden;
  border: 1px solid rgba(195, 209, 218, 0.9);
  border-radius: 6px;
  background: #f7fafb;
}

.product-image-link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.product-title-link {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.product-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 760px) {
  .product-manager .product-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .product-image-link {
    width: 88px;
    height: 88px;
  }
}

.compact-form label {
  min-width: 0;
}

.version-list > div,
.compare-grid > div,
.matrix-list > div,
.readiness-list > div {
  border: 1px solid rgba(211, 223, 228, 0.82);
  border-radius: 12px;
  background: rgba(250, 252, 252, 0.92);
  box-shadow: none;
}

@media (max-width: 1180px) {
  .module-chrome {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .workspace-header,
  .module-chrome,
  .panel,
  article,
  .queue-pane,
  .chat-pane,
  .context-pane {
    border-radius: 12px;
  }

  .module-chrome > div {
    padding: 13px 14px;
  }

  .module-chrome strong {
    font-size: 18px;
  }

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


.trainer-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(115deg, rgba(219, 234, 254, 0.92), rgba(240, 253, 250, 0.82)),
    white;
  box-shadow: var(--shadow-soft);
}

.trainer-hero h2 {
  margin-bottom: 8px;
  font-size: 25px;
}

.trainer-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.trainer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.trainer-workbench {
  display: grid;
  grid-template-columns: minmax(270px, 0.85fr) minmax(440px, 1.35fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.trainer-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.trainer-product {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(248, 252, 252, 0.8);
}

.trainer-product + .trainer-product {
  margin-top: 10px;
}

.trainer-product.active {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: inset 4px 0 0 var(--accent);
}

.trainer-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 3px 7px;
  color: white;
  background: var(--accent);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.trainer-product .product-image-link {
  width: 82px;
  height: 82px;
}

.question-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.question-chips span {
  padding: 5px 8px;
  color: var(--muted);
  background: rgba(241, 245, 249, 0.86);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

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

.training-chat {
  display: grid;
  gap: 12px;
}

.buyer-bubble,
.bot-bubble {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(248, 252, 252, 0.82);
}

.buyer-bubble span,
.bot-bubble span {
  display: block;
  margin-bottom: 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.buyer-bubble p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.bot-bubble textarea {
  width: 100%;
  min-height: 190px;
  color: var(--ink);
  background: white;
}

.trainer-context {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.trainer-context p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.trainer-context small {
  color: var(--danger);
  font-weight: 700;
}

.trainer-task-list {
  display: grid;
  gap: 8px;
}

.trainer-task {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: rgba(248, 252, 252, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.trainer-task.active {
  border-color: rgba(15, 118, 110, 0.52);
  background: rgba(236, 253, 245, 0.72);
}

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

@media (max-width: 1180px) {
  .trainer-workbench {
    grid-template-columns: 1fr;
  }

  .trainer-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}


.leyan-trainer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.trainer-main-list {
  min-width: 0;
  border: 1px solid rgba(195, 209, 218, 0.82);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 251, 0.94));
  box-shadow: 0 14px 34px rgba(28, 52, 66, 0.08);
}

.trainer-taskbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  background:
    linear-gradient(90deg, rgba(227, 243, 239, 0.84), rgba(247, 250, 251, 0.92));
  border-bottom: 1px solid rgba(195, 209, 218, 0.76);
}

.trainer-taskbar span {
  flex: 1;
  color: var(--muted);
}

.link-button {
  min-height: auto;
  padding: 4px 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-weight: 650;
}

.trainer-table-head,
.trainer-row {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr) 140px;
  gap: 20px;
  align-items: center;
}

.trainer-table-head {
  padding: 13px 18px;
  color: var(--muted);
  background: rgba(247, 250, 251, 0.92);
  border-bottom: 1px solid rgba(216, 226, 232, 0.78);
  font-size: 12px;
  font-weight: 750;
}

.trainer-row {
  position: relative;
  min-height: 178px;
  padding: 18px;
  border-top: 1px solid rgba(216, 226, 232, 0.72);
  background: rgba(255, 255, 255, 0.68);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.trainer-row.active {
  border-color: rgba(20, 117, 111, 0.32);
  background:
    linear-gradient(90deg, rgba(227, 243, 239, 0.78), rgba(255, 255, 255, 0.88));
  box-shadow: inset 3px 0 0 var(--accent);
}

.trainer-top {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  padding: 4px 8px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(20, 117, 111, 0.16);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
}

.trainer-thumb {
  display: inline-flex;
  width: 96px;
  height: 82px;
  margin: 36px 0 0 2px;
  vertical-align: middle;
  border: 1px solid rgba(195, 209, 218, 0.88);
  border-radius: 7px;
  background: white;
  box-shadow: 0 8px 18px rgba(28, 52, 66, 0.08);
  overflow: hidden;
}

.trainer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trainer-product-info {
  display: inline-grid;
  gap: 6px;
  width: calc(100% - 112px);
  margin-left: 12px;
  vertical-align: middle;
}

.trainer-product-info strong {
  line-height: 1.38;
  font-size: 15px;
  font-weight: 750;
  text-wrap: pretty;
}

.trainer-product-info small {
  color: var(--muted);
  line-height: 1.5;
}

.trainer-question-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.trainer-question-cloud span {
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(195, 209, 218, 0.78);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.trainer-row > button {
  justify-self: center;
}

.trainer-review-button {
  min-height: 38px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 750;
}

.trainer-review-drawer {
  position: sticky;
  top: 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 247, 247, 0.92));
}

.drawer-head,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(216, 226, 232, 0.82);
}

.drawer-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: white;
}

.drawer-head span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 750;
}

.trainer-dialog-preview {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 251, 0.88));
}

.bot-bubble.compact p {
  white-space: pre-wrap;
}

.trainer-adoption {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(227, 243, 239, 0.48);
}

.adoption-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  color: var(--muted);
  background: rgba(216, 226, 232, 0.72);
  border-radius: 8px;
}

.adoption-tabs strong,
.adoption-tabs span {
  padding: 11px 12px;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.adoption-tabs strong {
  color: white;
  background: var(--accent);
  box-shadow: 0 8px 16px rgba(20, 117, 111, 0.18);
}

.trainer-adoption input,
.trainer-adoption textarea {
  background: rgba(255, 255, 255, 0.94);
}

.trainer-adoption textarea {
  min-height: 150px;
}

.trainer-task-list {
  max-height: 220px;
  overflow: auto;
  padding: 12px 18px 16px;
}

.trainer-summary-panel {
  position: sticky;
  top: 16px;
}

.trainer-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 18px 28px;
  background: rgba(12, 31, 35, 0.42);
  backdrop-filter: blur(5px);
  overflow: auto;
}

.trainer-modal {
  width: min(1120px, calc(100vw - 56px));
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(195, 209, 218, 0.9);
  border-radius: 12px;
  background: rgba(248, 251, 251, 0.98);
  box-shadow: 0 28px 80px rgba(12, 31, 35, 0.28);
}

.trainer-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(216, 226, 232, 0.88);
  background: white;
}

.trainer-modal-head span,
.trainer-buyer-bar {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 750;
}

.trainer-modal-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.trainer-modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 0;
  overflow: hidden;
}

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

.sample-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(174, 202, 205, 0.82);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.sample-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sample-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  line-height: 1.45;
}

.sample-card p {
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.55;
}

.sample-card small {
  color: var(--muted);
}

@media (max-width: 820px) {
  .sample-card {
    grid-template-columns: 1fr;
  }
}

.trainer-chat-panel {
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 24px;
  background: white;
  border-right: 1px solid rgba(216, 226, 232, 0.88);
}

.trainer-buyer-bar {
  margin-bottom: 14px;
}

.trainer-chat-line {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}

.trainer-chat-line.agent {
  flex-direction: row-reverse;
}

.trainer-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 800;
}

.trainer-chat-bubble {
  max-width: min(520px, 78%);
  padding: 10px 12px;
  border: 1px solid rgba(195, 209, 218, 0.9);
  border-radius: 10px;
  background: rgba(247, 250, 251, 0.94);
}

.trainer-chat-line.agent .trainer-chat-bubble {
  background: rgba(227, 243, 239, 0.68);
  border-color: rgba(20, 117, 111, 0.22);
}

.trainer-chat-bubble small {
  display: block;
  margin-bottom: 4px;
  color: var(--subtle);
  font-weight: 750;
}

.trainer-chat-bubble p {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.qa-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.quick-reply-table {
  border-top: 1px solid rgba(202, 219, 226, 0.9);
}

.quick-reply-header,
.quick-reply-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.8fr) 96px;
  gap: 18px;
  align-items: center;
}

.quick-reply-header {
  padding: 14px 18px;
  color: var(--ink);
  font-weight: 800;
  background: rgba(246, 249, 250, 0.86);
}

.quick-reply-row {
  min-height: 132px;
  padding: 18px;
  border-bottom: 1px solid rgba(218, 228, 232, 0.9);
  background: rgba(248, 251, 251, 0.72);
}

.quick-reply-row:nth-child(even) {
  background: rgba(236, 247, 244, 0.48);
}

.quick-reply-question strong {
  display: block;
  margin-bottom: 12px;
  font-size: 17px;
}

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

.mini-chip,
.product-bind-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(232, 246, 242, 0.92);
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.quick-reply-answer p {
  margin: 10px 0 8px;
  padding: 11px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.quick-reply-answer small {
  color: var(--subtle);
}

.quick-reply-products {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quick-reply-thumbs {
  display: inline-flex;
  align-items: center;
}

.quick-reply-thumbs img {
  width: 36px;
  height: 36px;
  margin-right: -8px;
  border: 1px solid rgba(196, 214, 221, 0.95);
  border-radius: 6px;
  background: #fff;
  object-fit: cover;
}

.quick-reply-thumbs img.image-error {
  display: none;
}

.quick-reply-actions {
  display: flex;
  justify-content: flex-end;
}

.quick-reply-editor {
  width: min(1040px, 96vw);
}

.quick-reply-editor-body {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  padding: 18px;
  overflow: auto;
}

.quick-reply-editor-left,
.quick-reply-editor-right {
  display: grid;
  gap: 14px;
  align-content: start;
}

.quick-reply-editor textarea {
  min-height: 136px;
}

.quick-reply-product-picker {
  display: grid;
  gap: 8px;
  max-height: 268px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(180, 209, 216, 0.9);
  border-radius: 8px;
  background: rgba(249, 253, 252, 0.96);
}

.quick-reply-product-option {
  display: grid;
  grid-template-columns: 20px 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  padding: 8px 10px;
  border: 1px solid rgba(202, 219, 226, 0.85);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.quick-reply-product-option:hover {
  border-color: rgba(18, 132, 122, 0.42);
  background: rgba(235, 248, 245, 0.88);
}

.quick-reply-product-option.selected {
  border-color: rgba(18, 132, 122, 0.7);
  background: rgba(229, 247, 243, 0.96);
  box-shadow: inset 3px 0 0 var(--teal);
}

.quick-reply-product-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.quick-reply-product-option img {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(202, 219, 226, 0.9);
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.quick-reply-product-option img.image-error {
  display: none;
}

.quick-reply-product-option strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-reply-product-option small {
  display: block;
  margin-top: 4px;
  color: var(--subtle);
}

@media (max-width: 1260px) {
  .leyan-trainer {
    grid-template-columns: 1fr;
  }

  .trainer-review-drawer {
    position: static;
  }

  .trainer-modal-body {
    display: block;
    overflow: auto;
  }

  .trainer-chat-panel {
    max-height: 360px;
    border-right: 0;
    border-bottom: 1px solid rgba(216, 226, 232, 0.88);
  }
}

@media (max-width: 720px) {
  .trainer-modal-backdrop {
    padding: 8px;
  }

  .trainer-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .trainer-modal-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .trainer-modal-head h2 {
    font-size: 17px;
  }

  .trainer-chat-panel,
  .trainer-adoption {
    padding: 12px 14px;
  }

  .trainer-chat-bubble {
    max-width: 84%;
  }

  .qa-toolbar,
  .quick-reply-header,
  .quick-reply-row,
  .quick-reply-editor-body {
    grid-template-columns: 1fr;
  }

  .quick-reply-actions {
    justify-content: flex-start;
  }
}
