* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #fff;
  color: #20262b;
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}

header {
  flex: none;
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: env(safe-area-inset-top);
}

.who {
  color: #6d7d83;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.ghost {
  background: none;
  border: none;
  color: #6d7d83;
  font-size: 13px;
  font-family: inherit;
  padding: 6px 8px;
  border-radius: 8px;
}

#log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.me {
  align-self: flex-end;
  background: #dde8ea;
  border-bottom-right-radius: 5px;
}

.her {
  align-self: flex-start;
  background: #e4f2ee;
  color: #1b3a34;
  border-bottom-left-radius: 5px;
}

.typing {
  align-self: flex-start;
  color: #9fb2b6;
  font-size: 13px;
  padding: 2px 8px;
}

#composer {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

#input {
  flex: 1;
  min-width: 0;
  background: #f1f4f5;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 22px;
  padding: 11px 16px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
#input:focus {
  border-color: #2f8f80;
}

#send {
  flex: none;
  background: #2f8f80;
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 0 18px;
  font-size: 15px;
  font-family: inherit;
}

#sheet {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
#sheet.hidden {
  display: none;
}

.sheet-head {
  flex: none;
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: #6d7d83;
  font-size: 13px;
}

#sheetBody {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
  font-size: 14px;
  line-height: 1.6;
}

.item {
  padding: 9px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.item .k {
  color: #2f8f80;
  font-size: 12.5px;
  margin-right: 8px;
}
.item .src {
  color: #8fa2a6;
  font-size: 12px;
  margin-top: 3px;
}

.story {
  background: #e4f2ee;
  border-left: 3px solid #2f8f80;
  border-radius: 6px;
  padding: 11px 13px;
  margin-bottom: 14px;
  white-space: pre-wrap;
}

.login {
  padding: 60px 24px;
  gap: 12px;
}
.login h1 {
  font-size: 20px;
  margin: 0;
}
.login p {
  color: #6d7d83;
  margin: 0;
}
.login input,
.login button {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 16px;
  font-family: inherit;
}
.login button {
  background: #2f8f80;
  color: #fff;
  border: none;
}
#err {
  color: #c2544c;
  font-size: 13px;
  min-height: 18px;
}
