/* 团团小助手 */
.agent-fab {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 10020;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(239, 138, 112, .35);
  border-radius: 999px;
  color: #fffaf1;
  background: var(--red);
  box-shadow: 0 10px 28px rgba(30, 38, 27, .22);
  font: 650 10px/1 var(--sans);
  letter-spacing: .04em;
  cursor: pointer;
}

.agent-fab:hover {
  background: #c53b28;
}

.agent-fab svg {
  width: 16px;
  height: 16px;
}

.agent-panel {
  position: fixed;
  right: 24px;
  bottom: 142px;
  z-index: 10021;
  display: none;
  width: min(370px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 170px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 22px 60px rgba(22, 42, 33, .25);
}

.agent-panel.is-open {
  display: flex;
}

.agent-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--paper-3);
  background: #172b22;
}

.agent-panel__head strong {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.agent-panel__head small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 250, 241, .5);
  font-size: 8px;
  letter-spacing: .06em;
}

.agent-panel__close {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 250, 241, .18);
  border-radius: 50%;
  color: rgba(255, 250, 241, .7);
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}

.agent-panel__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 15px;
  background: #faf7ef;
}

.agent-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink-2);
  background: #fffdf7;
  border: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-msg--user {
  align-self: flex-end;
  color: #fffaf1;
  background: #20372b;
  border-color: #20372b;
}

.agent-msg--assistant {
  align-self: flex-start;
}

.agent-msg--muted {
  color: var(--muted-2);
  font-size: 9px;
}

.agent-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 15px 12px;
  background: #faf7ef;
}

.agent-chip {
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-2);
  background: #fffdf7;
  font-size: 9px;
  cursor: pointer;
}

.agent-chip:hover {
  border-color: var(--red);
  color: var(--red);
}

.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-self: flex-start;
  max-width: 92%;
}

.agent-action {
  padding: 8px 11px;
  border: 1px solid var(--red);
  border-radius: 8px;
  color: #fffaf1;
  background: var(--red);
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
}

.agent-action:hover {
  background: #c53b28;
}

.agent-panel__form {
  display: flex;
  gap: 7px;
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  background: #fffdf7;
}

.agent-panel__form input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: 11px var(--sans);
}

.agent-panel__form button {
  min-width: 56px;
  border: 0;
  border-radius: 8px;
  color: #fffaf1;
  background: var(--red);
  font: 650 10px var(--sans);
  cursor: pointer;
}

.agent-panel__form button:disabled {
  opacity: .5;
  cursor: wait;
}

.agent-panel__foot {
  padding: 0 12px 10px;
  color: var(--muted-2);
  background: #fffdf7;
  font-size: 8px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .agent-fab {
    right: 16px;
    bottom: 78px;
  }

  .agent-panel {
    right: 12px;
    bottom: 130px;
    width: calc(100vw - 24px);
    height: min(560px, calc(100vh - 150px));
  }
}
