:root {
  --green: #07c160;
  --bubble-me: #95ec69;
  --ink: #1a1510;
  --paper: #ededed;
  --bar: #2e2e2e;
  --cinnabar: #c45c26;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #3b2a22;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

body {
  display: flex;
  justify-content: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.phone {
  width: min(480px, 100%);
  height: 100%;
  max-height: 100dvh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 0 8px #2a1c16, 0 18px 50px rgba(0, 0, 0, 0.35);
}

.topbar {
  height: 52px;
  background: var(--bar);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 10px 0 12px;
  flex-shrink: 0;
}

.topbar-left {
  width: 48px;
  opacity: 0.8;
  font-size: 15px;
}

.topbar-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.topbar-title small {
  font-weight: 400;
  opacity: 0.7;
}

.seal {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  font-size: 12px;
  background: var(--cinnabar);
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: text-bottom;
}

.topbar-more {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 13px;
}

.switcher {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: #e7e7e7;
  flex-shrink: 0;
  overflow-x: auto;
}

.switcher button {
  border: 0;
  background: #fff;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.switcher button.on {
  background: #111;
  color: #fff;
}

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 16px;
  background: #ededed url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><circle cx='2' cy='2' r='1' fill='%23000000' fill-opacity='0.03'/></svg>");
}

.row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.row.me {
  flex-direction: row-reverse;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.bubble {
  max-width: 78%;
  background: #fff;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1.45;
  position: relative;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

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

.bubble.menu {
  font-size: 13px;
  line-height: 1.42;
  letter-spacing: 0;
  white-space: pre;
  overflow-x: auto;
  max-width: 92%;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", monospace;
}

.name {
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: #f7f7f7;
  border-top: 1px solid #ddd;
  flex-shrink: 0;
}

.composer input {
  flex: 1;
  border: 0;
  background: #fff;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 16px;
}

.send,
.plus {
  border: 0;
  border-radius: 6px;
  font-size: 15px;
}

.send {
  background: var(--green);
  color: #fff;
  padding: 0 14px;
}

.plus {
  width: 36px;
  background: #fff;
}

.quick {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 58px;
  background: #fff;
  border-top: 1px solid #eee;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
}

.quick button {
  border: 1px solid #eee;
  background: #fafafa;
  border-radius: 8px;
  padding: 10px 0;
}

@media (max-width: 420px) {
  .bubble.menu {
    font-size: 12px;
    max-width: 96%;
  }
}
