/* =========================================================
   鱼鱼客服 Demo · 全站样式
   ========================================================= */

:root {
  --bg: #eef2f5;
  --card: #ffffff;
  --ink: #132630;
  --ink-2: #334a58;
  --muted: #6b8190;
  --line: #e3e9ee;
  --line-strong: #d3dde4;
  --brand: #0f766e;
  --brand-dark: #0b5f59;
  --brand-soft: #e6f4f1;
  --accent: #f59e0b;
  --danger: #dc2626;
  --waiting: #b45309;
  --waiting-bg: #fef3c7;
  --serving: #0f766e;
  --serving-bg: #d9f2ee;
  --closed: #64748b;
  --closed-bg: #eef2f6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(15, 45, 60, 0.07);
  --shadow-sm: 0 2px 10px rgba(15, 45, 60, 0.05);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.page-landing {
  background:
    radial-gradient(1200px 520px at 12% -10%, #d8ece8 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #e4e9f7 0%, transparent 55%),
    var(--bg);
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

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

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: #b9c8d2;
  background: #f7fafb;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  border-color: var(--brand);
  background: linear-gradient(180deg, #12897f, var(--brand));
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #14998d, var(--brand-dark));
  border-color: var(--brand-dark);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: #f0f4f6;
  border-color: transparent;
}

.btn-soft {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand-dark);
}

.btn-soft:hover {
  background: #d7ece8;
}

.btn-danger {
  color: var(--danger);
  border-color: #f0d5d5;
  background: #fff7f7;
}

.btn-danger:hover {
  background: #ffecec;
  border-color: #e9bdbd;
}

.btn-block {
  width: 100%;
  height: 42px;
  font-size: 14px;
}

.link-btn {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}

.link-btn:hover {
  background: var(--brand-soft);
  text-decoration: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

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

.field input,
.field select {
  height: 38px;
  padding: 0 11px;
}

.field textarea {
  padding: 9px 11px;
  resize: vertical;
  min-height: 76px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--closed-bg);
  color: var(--closed);
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.waiting {
  background: var(--waiting-bg);
  color: var(--waiting);
}

.pill.serving {
  background: var(--serving-bg);
  color: var(--serving);
}

.pill.closed {
  background: var(--closed-bg);
  color: var(--closed);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--c, var(--brand));
  flex: 0 0 auto;
  user-select: none;
}

.avatar.sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #ef4444;
}

/* ---------------- Toast ---------------- */

#toast-root {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  padding: 9px 16px;
  border-radius: 10px;
  background: rgba(19, 38, 48, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: toast-in 0.18s ease;
  max-width: 80vw;
}

.toast.error {
  background: rgba(185, 28, 28, 0.95);
}

.toast.success {
  background: rgba(6, 95, 70, 0.95);
}

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

/* ---------------- 首页 ---------------- */

.landing {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
  margin-bottom: 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.landing h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.2;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}

.landing h1 em {
  font-style: normal;
  color: var(--brand);
}

.landing .lede {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 560px;
  margin: 0 0 26px;
}

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

.hero-card {
  background: #0e2f33;
  background-image:
    radial-gradient(500px 260px at 90% 0%, rgba(45, 212, 191, 0.25), transparent 60%),
    linear-gradient(160deg, #0d2a2e, #123c3d);
  border-radius: 22px;
  padding: 22px;
  color: #e7f4f2;
  box-shadow: 0 24px 60px rgba(9, 45, 48, 0.28);
  position: relative;
  overflow: hidden;
}

.hero-card h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #9fd8d0;
  letter-spacing: 0.04em;
}

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

.flow-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-node {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.flow-node b {
  display: block;
  font-size: 12px;
  color: #fff;
  font-weight: 600;
}

.flow-node span {
  color: #9fb8b8;
  font-size: 11px;
}

.flow-arrow {
  flex: 0 0 auto;
  color: #3dd6c4;
  font-size: 16px;
  font-family: var(--mono);
}

.flow-note {
  margin-top: 14px;
  font-size: 11px;
  color: #8fb0ae;
  line-height: 1.6;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  padding-top: 12px;
}

.landing-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 16px;
}

.landing-section-title h2 {
  font-size: 18px;
  margin: 0;
}

.landing-section-title span {
  font-size: 12px;
  color: var(--muted);
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.entry-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}

.entry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.entry-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--brand-soft);
  margin-bottom: 14px;
}

.entry-card:nth-child(2) .entry-icon {
  background: #eef0fd;
}

.entry-card:nth-child(3) .entry-icon {
  background: #fdf2e3;
}

.entry-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.entry-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  flex: 1;
}

.entry-card .btn {
  align-self: flex-start;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

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

.kv-table th,
.kv-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.kv-table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  background: #fafcfc;
}

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

.kv-table code {
  font-family: var(--mono);
  font-size: 12px;
  background: #f2f6f7;
  padding: 2px 6px;
  border-radius: 5px;
}

.api-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

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

.method {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: #e7f4f1;
  color: var(--brand-dark);
  min-width: 42px;
  text-align: center;
}

.method.post {
  background: #fdf0e3;
  color: #a3560b;
}

.api-row code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}

.api-row span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11.5px;
}

.landing-foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 44px;
}

/* ---------------- 客服工作台 ---------------- */

.agent-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 62px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, #109084, #0b5f59);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.28);
}

.logo span {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  border-left: 1px solid var(--line-strong);
  padding-left: 9px;
  margin-left: 1px;
}

.env-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--waiting);
  background: var(--waiting-bg);
  border-radius: 5px;
  padding: 2px 6px;
}

.topbar-stats {
  display: flex;
  gap: 8px;
  margin-left: 8px;
}

.stat-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 9px;
  background: #f6f9fa;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.stat-chip b {
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.conn i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5df;
}

.conn.on i {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.conn.off i {
  background: #ef4444;
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: #f6f9fa;
  border: 1px solid var(--line);
}

.agent-chip .agent-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.agent-chip .agent-role {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}

.agent-chip select {
  border: 0;
  background: transparent;
  font-size: 11px;
  color: var(--muted);
  padding: 2px;
  height: auto;
  cursor: pointer;
}

.console {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr) 300px;
  gap: 12px;
  padding: 12px;
}

.pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 会话列表 */

.pane-head {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.tabs {
  display: flex;
  gap: 4px;
  background: #f3f7f8;
  padding: 3px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 7px;
  height: 28px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  padding: 0 4px;
}

.tab b {
  font-size: 10px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(15, 45, 60, 0.08);
}

.search input {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  background: #f7fafb;
  border-color: transparent;
}

.session-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.session-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px 10px;
  border-radius: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s;
}

.session-item:hover {
  background: #f7fafb;
}

.session-item.active {
  background: var(--brand-soft);
  border-color: #c8e6e1;
}

.session-item .s-main {
  min-width: 0;
}

.session-item .s-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.session-item .s-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s-app {
  font-size: 10px;
  color: var(--muted);
  background: #f1f5f7;
  border-radius: 4px;
  padding: 0 5px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.s-preview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s-preview .you {
  color: #9aaab5;
}

.s-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.s-time {
  font-size: 10.5px;
  color: #9aaab5;
  white-space: nowrap;
}

.s-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--waiting);
}

.s-dot.serving {
  background: var(--brand);
}

.s-dot.closed {
  background: #cbd5df;
}

.pane-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}

.list-empty {
  padding: 46px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

/* 聊天区 */

.chat-pane {
  position: relative;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px;
}

.empty-state .big {
  font-size: 34px;
  opacity: 0.5;
}

#chat-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.chat-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.chat-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-notice {
  flex: 0 0 auto;
  margin: 10px 16px 0;
  padding: 8px 12px;
  border-radius: 9px;
  background: #f3f6f8;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-notice.warn {
  background: #fff8eb;
  color: var(--waiting);
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.msg {
  display: flex;
  gap: 9px;
  max-width: 100%;
}

.msg-body {
  min-width: 0;
  max-width: 72%;
}

.msg-meta {
  font-size: 11px;
  color: #9aaab5;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bubble {
  padding: 9px 13px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-guest .bubble {
  background: #f5f8f9;
  border: 1px solid #e8eef2;
  border-top-left-radius: 4px;
  color: var(--ink);
}

.msg-agent {
  flex-direction: row-reverse;
}

.msg-agent .msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.msg-agent .bubble {
  background: linear-gradient(160deg, #12897f, #0f766e);
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.22);
}

.msg-agent .msg-meta {
  flex-direction: row-reverse;
}

.msg-system {
  justify-content: center;
}

.msg-system .bubble {
  background: transparent;
  color: #93a3ae;
  font-size: 11.5px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px dashed #dbe3e9;
}

.day-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a5b3bd;
  font-size: 11px;
  margin: 4px 0;
}

.day-divider::before,
.day-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.typing-line {
  flex: 0 0 auto;
  height: 20px;
  padding: 0 22px;
  font-size: 11.5px;
  color: #93a3ae;
  font-style: italic;
}

.composer {
  flex: 0 0 auto;
  margin: 4px 14px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #fff;
  padding: 8px 10px 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer:focus-within {
  border-color: #9ed3cc;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

.composer.disabled {
  opacity: 0.6;
  pointer-events: none;
  background: #f8fafb;
}

.quick-replies {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 7px;
  scrollbar-width: none;
}

.quick-replies::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #f8fafb;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
  max-width: 230px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip:hover {
  background: var(--brand-soft);
  border-color: #c8e6e1;
  color: var(--brand-dark);
}

.composer textarea {
  width: 100%;
  border: 0;
  resize: none;
  min-height: 46px;
  max-height: 140px;
  padding: 4px 2px;
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: none !important;
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.composer-foot #char-count {
  font-size: 11px;
  color: #a5b3bd;
  margin-right: auto;
}

/* 右侧信息栏 */

.info-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
}

.info-block h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-person {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.info-person .avatar {
  width: 44px;
  height: 44px;
  font-size: 17px;
}

.info-person .name {
  font-size: 14px;
  font-weight: 600;
}

.info-person .sub {
  font-size: 11.5px;
  color: var(--muted);
}

.kv {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 12px;
}

.kv + .kv {
  border-top: 1px dashed #eef3f6;
}

.kv .k {
  color: var(--muted);
  flex: 0 0 auto;
}

.kv .v {
  text-align: right;
  word-break: break-all;
  color: var(--ink-2);
}

.kv .v.mono {
  font-family: var(--mono);
  font-size: 11px;
}

.info-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.info-actions .btn {
  justify-content: flex-start;
  height: 33px;
}

.agent-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.status-dot.busy {
  background: var(--accent);
}

.status-dot.away {
  background: #94a3b8;
}

/* 登录遮罩 */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(800px 420px at 80% 0%, rgba(45, 212, 191, 0.16), transparent 60%),
    linear-gradient(150deg, #0d2a2e, #123536 60%, #0e2f33);
}

.login-card {
  width: 400px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  padding: 30px 28px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  text-align: left;
}

.login-card .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(145deg, #109084, #0b5f59);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.login-card > p {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.login-agents {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.login-agent {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.login-agent:hover {
  border-color: #9ed3cc;
  background: var(--brand-soft);
}

.login-agent .name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.login-agent .role {
  font-size: 10.5px;
  color: var(--muted);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a5b3bd;
  font-size: 11px;
  margin: 18px 0 14px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-card .field input {
  font-family: var(--mono);
  font-size: 12px;
}

.login-foot {
  margin: 14px 0 0 !important;
  text-align: center;
  font-size: 11px !important;
  color: #a5b3bd !important;
}

.form-error {
  min-height: 18px;
  margin: 0 0 8px !important;
  font-size: 12px !important;
  color: var(--danger) !important;
}

/* ---------------- 访客端 ---------------- */

body.page-client {
  background:
    radial-gradient(900px 420px at 10% 0%, #d9ece8 0%, transparent 55%),
    radial-gradient(700px 380px at 95% 10%, #e6e9f8 0%, transparent 55%),
    var(--bg);
}

.client-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 16px;
  gap: 14px;
}

.client-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-2);
}

.client-brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.client-brand .demo {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
}

.chat-card {
  width: 460px;
  max-width: 100%;
  height: min(700px, calc(100vh - 130px));
  min-height: 460px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(15, 45, 60, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.client-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  background: linear-gradient(160deg, #0d2a2e, #12403f);
  color: #fff;
}

.client-head .avatar {
  background: rgba(255, 255, 255, 0.16);
  color: #d9f2ee;
  width: 40px;
  height: 40px;
}

.client-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.client-sub {
  font-size: 11px;
  color: #a8c6c4;
  line-height: 1.4;
}

.client-status {
  margin-left: auto;
  border: 0;
  background: rgba(255, 255, 255, 0.13);
  color: #d8f0ed;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.client-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5eead4;
}

.client-status.closed::before {
  background: #94a3b8;
}

.client-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f8fafb;
}

.client-body .messages {
  padding: 16px 14px 6px;
}

.client-body .msg-guest .bubble {
  background: #fff;
}

.client-composer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.client-composer textarea {
  flex: 1;
  border: 0;
  background: #f5f8f9;
  border-radius: 11px;
  padding: 9px 12px;
  min-height: 40px;
  max-height: 110px;
  resize: none;
  font-size: 13.5px;
  line-height: 1.5;
}

.client-composer textarea:focus {
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.20);
}

.client-composer .btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
}

.client-closed-bar {
  padding: 9px 14px;
  background: #fff8eb;
  color: #92400e;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #f7e6c4;
}

.client-foot {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: center;
}

.client-start {
  padding: 26px 26px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.client-start h2 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.client-start > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12.5px;
}

.client-start .field select,
.client-start .field input {
  height: 42px;
}

.client-fine {
  font-size: 11px;
  color: #a5b3bd;
  margin: 14px 0 0;
  line-height: 1.6;
}

/* ---------------- 接口联调 / 模拟器 ---------------- */

body.page-sim {
  background:
    radial-gradient(900px 420px at 90% 0%, #e3e9f8 0%, transparent 55%),
    var(--bg);
}

.sim-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 24px 70px;
}

.sim-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.sim-head h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.sim-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.sim-head .spacer {
  flex: 1;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.card > .hint {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.card code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: #f2f6f7;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink-2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.resp {
  margin: 16px 0 0;
  background: #0f2229;
  color: #c9e6e2;
  border-radius: 11px;
  padding: 13px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.callback-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 520px;
  overflow-y: auto;
}

.callback-item {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  font-size: 12px;
}

.callback-item .cb-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.cb-valid {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 4px;
  padding: 1px 6px;
}

.cb-invalid {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--danger);
  background: #fee2e2;
  border-radius: 4px;
  padding: 1px 6px;
}

.callback-item pre {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow: auto;
}

.empty-hint {
  padding: 30px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
}

/* ---------------- 文档 ---------------- */

body.page-docs {
  background: #fbfcfc;
}

.docs-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 24px 90px;
}

.docs-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  font-size: 13px;
}

.docs-topbar .spacer {
  flex: 1;
}

.markdown {
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-2);
}

.markdown h1 {
  font-size: 28px;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.markdown h2 {
  font-size: 20px;
  color: var(--ink);
  margin: 38px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.markdown h3 {
  font-size: 15.5px;
  color: var(--ink);
  margin: 26px 0 8px;
}

.markdown p {
  margin: 10px 0;
}

.markdown code {
  font-family: var(--mono);
  font-size: 12px;
  background: #eef4f5;
  color: #0b5f59;
  padding: 2px 5px;
  border-radius: 4px;
}

.markdown pre {
  background: #0f2229;
  color: #cfe9e5;
  padding: 15px 16px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.7;
}

.markdown pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 12px;
}

.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 12.5px;
}

.markdown th,
.markdown td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.markdown th {
  background: #f5f9f9;
  font-weight: 600;
}

.markdown ul,
.markdown ol {
  padding-left: 22px;
}

.markdown blockquote {
  margin: 14px 0;
  padding: 10px 14px;
  border-left: 3px solid #9ed3cc;
  background: #f4faf9;
  color: var(--ink-2);
  border-radius: 0 8px 8px 0;
}

/* ---------------- 滚动条 ---------------- */

* {
  scrollbar-width: thin;
  scrollbar-color: #cdd9df transparent;
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-thumb {
  background: #cdd9df;
  border-radius: 99px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
  .console {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .info-pane {
    display: none;
  }
}

@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .entry-grid {
    grid-template-columns: 1fr;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .sim-grid {
    grid-template-columns: 1fr;
  }
  .topbar-stats {
    display: none;
  }
}

@media (max-width: 720px) {
  .console {
    grid-template-columns: 1fr;
    grid-template-rows: 30vh minmax(0, 1fr);
    padding: 8px;
    gap: 8px;
  }
  .sessions-pane {
    max-height: none;
  }
  .chat-pane {
    min-height: 0;
  }
  .logo span,
  .env-badge {
    display: none;
  }
  .topbar-right a.conn {
    display: none;
  }
  .msg-body {
    max-width: 82%;
  }
  .chat-actions .btn {
    padding: 0 9px;
  }
  .chat-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .chat-actions {
    margin-left: 0;
  }
  .landing {
    padding: 30px 18px 60px;
  }
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .chat-card {
    height: calc(100vh - 110px);
  }
  .sim-wrap {
    padding: 22px 16px 60px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
