:root {
  --bg: #f7f4ec;
  --card: #fffdf8;
  --text: #1f2937;
  --muted: #5b6475;
  --accent: #005f73;
  --accent-2: #0a9396;
  --border: #e7dec9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, #faedcd 0%, transparent 45%),
    radial-gradient(circle at 90% 0%, #e9edc9 0%, transparent 35%),
    var(--bg);
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  letter-spacing: 0.02em;
}

.hero p {
  margin-top: 8px;
  color: var(--muted);
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-top: 16px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

label {
  display: block;
  font-size: 0.92rem;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #d2d8e5;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

.btn {
  margin-top: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.05);
}

.history {
  min-height: 160px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #d7deeb;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.msg {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg.user {
  background: #edf7ff;
}

.msg.assistant {
  background: #f4f9f3;
}

.composer {
  margin-top: 12px;
}

.result {
  margin-top: 12px;
}

pre {
  background: #fff;
  border: 1px solid #d7deeb;
  border-radius: 10px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 64px;
}

small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}
