:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #68777d;
  --line: #dfe6e3;
  --paper: #f4f7f5;
  --white: #fff;
  --green: #0d7b63;
  --green-dark: #075c4a;
  --lime: #d8f257;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, textarea { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 42%) 1fr; }
.intro { position: relative; min-height: 100vh; padding: 42px 56px; display: flex; flex-direction: column; background: var(--green); color: #fff; overflow: hidden; }
.intro::after { content: ""; position: absolute; right: -150px; bottom: -210px; width: 470px; height: 470px; border: 90px solid rgba(216,242,87,.92); border-radius: 50%; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 750; letter-spacing: .08em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--lime); color: var(--green-dark); letter-spacing: 0; }
.intro-copy { margin: auto 0; max-width: 520px; position: relative; z-index: 1; }
.eyebrow { color: var(--lime); font-weight: 700; letter-spacing: .12em; }
.intro h1 { margin: 18px 0 24px; font-size: clamp(48px, 6vw, 84px); line-height: .98; letter-spacing: -.06em; }
.intro-copy > p:last-child { max-width: 430px; line-height: 1.75; color: rgba(255,255,255,.78); }
.trust { position: relative; z-index: 1; display: flex; gap: 10px; align-items: center; font-size: 13px; color: rgba(255,255,255,.7); }
.trust span, .online { width: 8px; height: 8px; background: var(--lime); border-radius: 50%; display: inline-block; }

.chat-panel { min-width: 0; height: 100vh; display: grid; grid-template-rows: auto 1fr auto auto; background: var(--white); }
.chat-panel header { padding: 30px 40px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.chat-panel h2 { margin: 0 0 5px; font-size: 22px; }
.chat-panel header p { margin: 0; color: var(--muted); font-size: 13px; }
.online { margin-right: 7px; background: #30b67a; }
#clear { border: 0; background: transparent; color: var(--muted); padding: 8px; }
#clear:hover { color: var(--ink); }
.messages { overflow-y: auto; padding: 36px 40px; scroll-behavior: smooth; }
.message { display: flex; gap: 12px; margin: 0 0 24px; align-items: flex-start; }
.message.user { justify-content: flex-end; }
.avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--green); font-size: 12px; font-weight: 800; }
.bubble { max-width: min(620px, 80%); padding: 15px 17px; border-radius: 7px 18px 18px 18px; background: #f1f5f3; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble p { margin: 0; }
.user .bubble { border-radius: 18px 7px 18px 18px; background: var(--green); color: #fff; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.suggestions button { border: 1px solid #c8d8d2; background: #fff; color: var(--green-dark); border-radius: 999px; padding: 8px 12px; font-size: 12px; }
.suggestions button:hover { border-color: var(--green); }
.thinking::after { content: ""; display: inline-block; width: 18px; height: 6px; margin-left: 5px; background: radial-gradient(circle, var(--green) 2px, transparent 3px) 0 0/6px 6px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.composer { margin: 0 40px; padding: 8px; display: flex; gap: 8px; border: 1px solid #ccd7d3; border-radius: 18px; background: #fff; box-shadow: 0 12px 30px rgba(17,52,42,.08); }
.composer:focus-within { border-color: var(--green); box-shadow: 0 12px 32px rgba(13,123,99,.13); }
textarea { flex: 1; max-height: 140px; resize: none; border: 0; outline: 0; padding: 12px; color: var(--ink); background: transparent; line-height: 1.5; }
#send { align-self: flex-end; border: 0; border-radius: 12px; background: var(--green); color: #fff; font-weight: 700; padding: 12px 18px; }
#send:disabled { opacity: .45; cursor: wait; }
.privacy { margin: 12px 40px 20px; text-align: center; color: #8b9893; font-size: 11px; }

@media (max-width: 800px) {
  .shell { display: block; }
  .intro { min-height: auto; padding: 20px 22px; }
  .intro-copy, .trust { display: none; }
  .chat-panel { height: calc(100vh - 76px); }
  .chat-panel header { padding: 18px 20px; }
  .messages { padding: 24px 18px; }
  .composer { margin: 0 16px; }
  .privacy { margin: 10px 16px 14px; }
  .bubble { max-width: 88%; }
}
