{% extends "base.html" %} {% block title %}agentbridge chat{% endblock %} {% block page_styles %} :root { --danger-bg: #fff1f0; --shadow: 0 18px 50px rgba(18, 27, 27, 0.08); } button { border: 0; cursor: pointer; } .app { grid-template-rows: var(--header-height) 1fr; } .header-actions { min-width: 0; justify-content: flex-end; } .field { height: 36px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; } .field span { color: var(--muted); font-size: 12px; white-space: nowrap; } .field input, .field select { height: 30px; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; } .field-model { flex: 0 1 310px; } .field-model select { width: 100%; font-size: 12px; } .status { min-width: 82px; display: inline-flex; justify-content: center; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 7px 10px; color: var(--muted); background: var(--surface); font-size: 12px; white-space: nowrap; } .status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); } .status.ok { color: var(--ok); border-color: rgba(27, 128, 106, 0.28); background: rgba(27, 128, 106, 0.06); } .status.ok::before { background: var(--ok); } .status.error { color: var(--danger); border-color: var(--danger-border); background: var(--danger-bg); } .status.error::before { background: var(--danger); } .main { min-height: 0; display: grid; grid-template-rows: 1fr auto; width: min(980px, 100%); margin: 0 auto; padding: 22px 18px; gap: 16px; } .messages { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; } .empty { margin: auto; color: var(--muted); text-align: center; line-height: 1.5; } .empty strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 16px; } .message { max-width: 760px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 12px 14px; box-shadow: 0 1px 0 rgba(18, 27, 27, 0.03); } .message.user { align-self: flex-end; background: #eef8f6; border-color: rgba(22, 133, 117, 0.22); } .message.assistant { align-self: flex-start; } .message.error { align-self: stretch; max-width: none; border-color: var(--danger-border); background: var(--danger-bg); } .message-header { display: flex; align-items: center; gap: 12px; margin-bottom: 7px; color: var(--muted); font-size: 12px; } .message-role { font-weight: 650; } .message-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; } .message-info { width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 6px; display: none; align-items: center; justify-content: center; color: var(--muted); background: var(--surface); text-decoration: none; } .message-info:hover { color: var(--accent-strong); border-color: rgba(22, 133, 117, 0.3); background: rgba(22, 133, 117, 0.06); } .message-info.available { display: inline-flex; } .model-badge { min-width: 0; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-muted); color: var(--muted); padding: 3px 7px; font-family: var(--mono); font-size: 11px; } .message-body { white-space: pre-wrap; line-height: 1.5; } .message-body.typing { min-width: 52px; white-space: normal; } .typing-indicator { height: 20px; display: inline-flex; align-items: center; gap: 5px; } .typing-indicator span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typingPulse 1s ease-in-out infinite; } .typing-indicator span:nth-child(2) { animation-delay: 0.14s; } .typing-indicator span:nth-child(3) { animation-delay: 0.28s; } .message-body.markdown { white-space: normal; } .message-body.markdown > :first-child { margin-top: 0; } .message-body.markdown > :last-child { margin-bottom: 0; } .message-body.markdown p, .message-body.markdown ul, .message-body.markdown ol, .message-body.markdown blockquote, .message-body.markdown pre { margin: 0 0 10px; } .message-body.markdown ul, .message-body.markdown ol { padding-left: 22px; } .message-body.markdown li + li { margin-top: 4px; } .message-body.markdown h1, .message-body.markdown h2, .message-body.markdown h3 { margin: 14px 0 8px; color: var(--text); line-height: 1.25; } .message-body.markdown h1 { font-size: 18px; } .message-body.markdown h2 { font-size: 16px; } .message-body.markdown h3 { font-size: 14px; } .message-body.markdown blockquote { border-left: 3px solid var(--border-strong); padding-left: 12px; color: var(--muted); } .message-body.markdown a { color: var(--accent); text-decoration: none; } .message-body.markdown a:hover { text-decoration: underline; } .message-body.markdown code { border: 1px solid var(--border); border-radius: 5px; background: var(--surface-muted); padding: 1px 4px; font-family: var(--mono); font-size: 12px; } .message-body.markdown pre code { display: block; border: 0; background: transparent; padding: 0; white-space: pre; } .message-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .file-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 7px; background: var(--surface); color: var(--muted); font-size: 12px; } .file-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .error-title { display: flex; align-items: center; gap: 8px; color: var(--danger); font-weight: 700; } .error-summary { margin: 2px 0 10px; color: var(--text); } .error-actions { display: flex; gap: 8px; margin-top: 10px; } .error-details { margin-top: 10px; border-top: 1px solid var(--danger-border); padding-top: 10px; } .error-details summary { width: fit-content; cursor: pointer; color: var(--danger); font-size: 12px; } pre { margin: 10px 0 0; max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 7px; background: #fbfbfb; padding: 10px; color: #263030; font-family: var(--mono); font-size: 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; } .composer { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; } .drop-hint { display: none; margin: 10px 10px 0; border: 1px dashed rgba(22, 133, 117, 0.5); border-radius: 7px; padding: 10px; color: var(--accent-strong); background: rgba(22, 133, 117, 0.06); text-align: center; font-size: 13px; } .composer.dragging .drop-hint { display: block; } .attached-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 10px 0; } .remove-file { width: 18px; height: 18px; border-radius: 50%; background: transparent; color: var(--muted); line-height: 18px; padding: 0; } .remove-file:hover { background: var(--surface-muted); color: var(--text); } .input-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 10px 10px; } textarea { width: 100%; min-height: 24px; max-height: 180px; resize: none; overflow-y: hidden; border: 0; outline: 0; color: var(--text); line-height: 1.5; padding: 1px 0; box-sizing: border-box; } textarea::placeholder { color: #9aa2a2; } .icon-button, .secondary, .primary { height: 36px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; } .icon-button { width: 36px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); } .icon-button:hover { color: var(--text); background: var(--surface-muted); } .primary { width: 40px; min-width: 40px; background: var(--accent); color: #ffffff; padding: 0; font-weight: 650; } .primary svg { flex: none; } .primary:hover { background: var(--accent-strong); } .primary:disabled { cursor: not-allowed; opacity: 0.62; } .secondary { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 0 10px; font-size: 12px; } .secondary:hover { color: var(--text); background: var(--surface-muted); } .hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; } @keyframes typingPulse { 0%, 70%, 100% { opacity: 0.35; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } } @media (max-width: 1180px) { body { overflow: auto; } .app { min-height: 100vh; height: auto; grid-template-rows: auto 1fr; } .topbar { grid-template-columns: 1fr; grid-template-rows: auto auto auto; height: auto; min-height: var(--header-height); padding: 12px 14px; } .main-nav, .header-actions { justify-self: stretch; } .header-actions { flex-wrap: wrap; justify-content: space-between; align-items: stretch; } .field-model { min-width: 260px; max-width: none; flex: 1 1 260px; } .status { flex: 0 0 auto; } .main { min-height: calc(100vh - 178px); } } @media (max-width: 820px) { .brand, .status { min-width: 0; } .field-model, .status { width: 100%; flex: 1 1 100%; } .main { min-height: calc(100vh - 160px); padding: 14px; } .nav-item { min-width: 0; flex: 1; } .input-row { grid-template-columns: auto minmax(0, 1fr) auto; } .secondary { width: 100%; } } {% endblock %} {% block header_actions %}