:root {
  color-scheme: light;
  --bg: #eef2f6;
  --ink: #17202a;
  --muted: #657386;
  --line: #d8e0ea;
  --me: #2f7df6;
  --bot: #ffffff;
  --accent: #18a058;
}

* {
  box-sizing: border-box;
}

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

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(280px, 520px);
  gap: 32px;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.phone {
  height: min(760px, calc(100vh - 64px));
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  box-shadow: 0 24px 70px rgba(28, 39, 58, 0.16);
}

.topbar {
  height: 64px;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar strong,
.topbar span {
  display: block;
}

.topbar span {
  margin-top: 2px;
  color: var(--accent);
  font-size: 12px;
}

.topbar button,
.composer button {
  border: 0;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}

.topbar button {
  background: #eef2f6;
  color: var(--muted);
  padding: 8px 12px;
}

.messages {
  padding: 18px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.55;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.me {
  align-self: flex-end;
  background: var(--me);
  color: white;
}

.bubble.bot {
  align-self: flex-start;
  background: var(--bot);
  border: 1px solid var(--line);
}

.emoji {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: #fff2cc;
  color: #7a4d00;
  font-size: 14px;
}

.composer {
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.composer input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
}

.composer button {
  min-width: 72px;
  background: var(--accent);
  color: white;
  padding: 0 14px;
}

.panel {
  max-width: 520px;
}

.panel h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.05;
  letter-spacing: 0;
}

.panel p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.8;
}

.panel dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.panel dl div {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.panel dt {
  font-weight: 700;
  margin-bottom: 6px;
}

.panel dd {
  margin: 0;
  color: var(--muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
}

@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .phone {
    height: 72vh;
    min-height: 500px;
  }

  .panel {
    order: -1;
  }
}
