:root {
  --bg: linear-gradient(160deg, #f6efe7 0%, #eef8f5 100%);
  --panel: rgba(255, 255, 255, 0.92);
  --line: rgba(15, 23, 42, 0.08);
  --text: #18212f;
  --muted: #667085;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --assistant: #ffffff;
  --user: #0f766e;
}

* {
  box-sizing: border-box;
}

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

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.chat-card {
  width: min(960px, 100%);
  height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.15), transparent 38%),
    radial-gradient(circle at top right, rgba(180, 83, 9, 0.10), transparent 28%);
}

.header-copy h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.header-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.header-status {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-dark);
  font-size: 13px;
  white-space: nowrap;
}

.message-list {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-row {
  display: flex;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message-bubble {
  max-width: min(72ch, 80%);
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
}

.message-row.assistant .message-bubble {
  background: var(--assistant);
}

.message-row.user .message-bubble {
  background: var(--user);
  color: #fff;
  border-color: transparent;
}

.composer {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.composer-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
}

.composer-input {
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font: inherit;
  color: inherit;
  background: #fff;
}

.composer-button {
  min-width: 88px;
  padding: 0 18px;
  border: none;
  border-radius: 16px;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.composer-button:hover {
  transform: translateY(-1px);
}

.composer-button.primary {
  background: var(--accent);
  color: #fff;
}

.composer-button.secondary {
  background: #e5e7eb;
  color: #111827;
}

.composer-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 0;
  }

  .chat-card {
    width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  .chat-header {
    padding: 22px 18px 16px;
    align-items: start;
    flex-direction: column;
  }

  .message-list {
    padding: 18px;
  }

  .composer {
    padding: 14px;
  }

  .composer-form {
    grid-template-columns: 1fr 76px 76px;
  }
}
