* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --brand: #3a56f0;
  --brand-dark: #2b3fd4;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1a2233;
  --text-light: #64748b;
  --border: #e2e8f0;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
}

/* ===== 左侧表单 ===== */
.sidebar {
  width: 360px;
  min-width: 360px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
}

.logo {
  font-size: 22px;
  color: var(--brand);
  margin-bottom: 6px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.form .field {
  margin-bottom: 14px;
}

.form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}

.form input,
.form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s;
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--brand);
}

.btn-save {
  width: 100%;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-save:hover {
  background: var(--brand-dark);
}

/* ===== 右侧聊天区 ===== */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.chat-header h2 {
  font-size: 17px;
}

.status {
  font-size: 12px;
  color: var(--text-light);
  padding: 3px 10px;
  border-radius: 12px;
  background: #e8f5e9;
  color: #2e7d32;
}

.status.loading {
  background: #fff3e0;
  color: #e65100;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  max-width: 80%;
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .bubble {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.assistant .bubble {
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.bubble h1, .bubble h2, .bubble h3 {
  margin: 10px 0 6px;
}

.bubble p {
  margin: 6px 0;
}

.bubble ul, .bubble ol {
  margin: 6px 0 6px 20px;
}

.bubble code {
  background: #f1f5f9;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 13px;
}

.chat-input {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.chat-input textarea {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  height: 50px;
}

.chat-input textarea:focus {
  outline: none;
  border-color: var(--brand);
}

.btn-send {
  padding: 0 22px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-send:hover {
  background: var(--brand-dark);
}

.btn-send:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}
