:root {
  font:
    15px/1.6 'Instrument Sans',
    -apple-system,
    BlinkMacSystemFont,
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  color: #28352c;
  background: #f8f7f2;
  --green: #174d40;
  --line: #d9ddd3;
  --paper: #fffefa;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
h1,
h2,
h3,
p {
  margin: 0 0 1rem;
}
h1,
h2,
.wordmark {
  font-family: Georgia, 'Songti SC', serif;
}
h1 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.22;
  font-weight: 500;
}
h2 {
  font-size: 22px;
  font-weight: 500;
}
h3 {
  font-size: 15px;
}
header {
  background: #192d26;
  color: #f8f5df;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 4rem);
}
.wordmark {
  font-size: 24px;
  letter-spacing: -1px;
}
button,
.link {
  font: inherit;
  border: 1px solid #bdc8bc;
  border-radius: 5px;
  color: inherit;
  background: transparent;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover,
.link:hover {
  background: #e5eae0;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid #aa722e;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
header button {
  color: #e5e9dc;
  border: 0;
}
header button:hover,
header button[aria-current='true'] {
  background: #354c42;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #266958;
}
#notice {
  padding: 0.7rem 4vw;
  background: #fff0cc;
  color: #654721;
}
.entry,
.page {
  max-width: 760px;
  padding: clamp(2rem, 10vh, 8rem) 2rem;
  margin: auto;
}
.entry h1 {
  font-size: clamp(34px, 6vw, 64px);
}
.entry p {
  margin: 1.3rem 0 2rem;
  color: #546453;
}
.line {
  height: 4px;
  width: 48px;
  background: #ac8044;
  margin-bottom: 2rem;
}
.link {
  display: inline-block;
}
main {
  display: grid;
  grid-template-columns: minmax(200px, 23%) 1fr;
  max-width: 1550px;
  margin: 0 auto;
  min-height: calc(100dvh - 64px);
}
aside {
  padding: 2rem 1.1rem;
  border-right: 1px solid var(--line);
  background: #eff1e9;
}
.group,
.room-top,
.dialog-top,
.actions,
.compose-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.group {
  padding: 0 0.5rem 0.45rem;
}
.group h2 {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: #536558;
}
.group button,
.dialog-top button {
  border: 0;
  font-size: 20px;
  padding: 0 0.5rem;
}
.items {
  margin-bottom: 1.8rem;
}
.items button {
  width: 100%;
  text-align: left;
  border: 0;
  display: block;
  margin: 0.2rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.items button[aria-current='true'] {
  background: #dbe5d7;
  color: #134a38;
  font-weight: 600;
}
#room {
  padding: clamp(1rem, 3vw, 3.2rem);
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: calc(100dvh - 64px);
}
.room-top {
  align-items: start;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}
.room-top h1 {
  margin: 0.25rem 0;
  font-size: 28px;
}
small {
  color: #596c60;
}
.actions {
  justify-content: start;
  flex-wrap: wrap;
}
.actions button {
  font-size: 13px;
}
.dialog-top h2 {
  margin: 0;
}
#blank {
  margin: auto;
  text-align: center;
  padding: 1rem;
}
#blank p {
  color: #536558;
}
#history {
  overflow: auto;
  scrollbar-gutter: stable;
}
.message {
  padding: 1rem 0;
  max-width: 72ch;
}
.message small {
  font-weight: 600;
}
.message p,
#preview-history p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0.25rem 0;
}
.message.user p {
  background: #e5ede2;
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
}
.message.user small {
  display: block;
}
.pending {
  font-size: 13px;
  color: #556458;
  margin: 0.5rem 0;
}
textarea,
input[type='text'] {
  display: block;
  width: 100%;
  resize: vertical;
  background: var(--paper);
  color: inherit;
  font: inherit;
  border: 1px solid #bcc7ba;
  border-radius: 4px;
  padding: 0.6rem;
}
#composer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}
#composer textarea {
  resize: none;
}
.compose-bottom {
  margin-top: 0.5rem;
}
dialog {
  width: min(620px, 94vw);
  max-height: 90dvh;
  background: var(--paper);
  color: inherit;
  padding: 1.4rem 1.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
dialog::backdrop {
  background: #15292070;
}
.dialog-top {
  margin-bottom: 1rem;
}
dialog h3 {
  margin: 1.4rem 0 0.5rem;
}
label {
  display: block;
  font-size: 14px;
}
dialog textarea {
  margin: 0.35rem 0 0.7rem;
}
.templates {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.check {
  margin: 0.5rem 0;
}
.publish {
  justify-content: end;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  margin-top: 1rem;
}
#editor-status {
  color: #805015;
  font-size: 14px;
  margin: 0.6rem 0;
}
#draft-notes,
#preview-history {
  background: #eef2e9;
}
#draft-notes p,
#preview-history p {
  padding: 0.5rem 0.75rem;
}
.page dl {
  display: grid;
  grid-template-columns: 7rem 1fr;
  overflow-wrap: anywhere;
  gap: 0.4rem;
}
.page dd {
  margin: 0;
}
.page dl,
.page #usage {
  margin-bottom: 2rem;
}
.sr {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.channel-intro {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.65rem clamp(1rem, 4vw, 4rem);
  background: #e5ede2;
}
.channel-settings {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}
.channel-settings form,
.channel-binding,
#feishu-code {
  margin: 0.8rem 0;
}
.channel-settings select,
.channel-settings input {
  display: block;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.4rem;
  margin: 0.25rem 0 0.6rem;
  font: inherit;
}
.channel-settings button,
#feishu-code a,
#feishu-code code {
  margin-right: 0.5rem;
}
.channel-binding {
  padding: 0.7rem 0 0.3rem;
  border-top: 1px solid var(--line);
}
.memory-entry,
#new-memory-form {
  border-top: 1px solid var(--line);
  padding: 0.7rem 0;
}
#memory select {
  display: block;
  max-width: 100%;
  font: inherit;
  margin: 0.25rem 0 0.6rem;
}
#memory details {
  margin: 0.5rem 0;
  overflow-wrap: anywhere;
}
.memory-entry .actions {
  margin: 0.5rem 0;
}
@media (max-width: 680px) {
  main {
    display: block;
  }
  aside {
    border-right: 0;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--line);
  }
  .group {
    display: inline-flex;
    gap: 0.5rem;
  }
  .items {
    display: flex;
    overflow: auto;
    margin-bottom: 0.2rem;
  }
  .items button {
    width: auto;
    flex: none;
    max-width: 16rem;
  }
  #room {
    height: auto;
    min-height: 60dvh;
  }
  #history {
    max-height: 50dvh;
  }
  #blank {
    padding: 2rem 0.5rem;
  }
  .wordmark {
    font-size: 21px;
  }
  header {
    min-height: 56px;
  }
  dialog {
    padding: 1rem;
  }
  .room-top h1 {
    font-size: 22px;
  }
}

.attachment-item, .workspace-file {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  margin: .25rem 0;
}
.message a, .attachment-item a, .workspace-file a {
  overflow-wrap: anywhere;
}
#file-dialog form label {
  display: inline-grid;
  gap: .25rem;
  margin: .25rem .5rem .5rem 0;
}
#file-candidates li {
  margin: .35rem 0;
}
#file-candidates li button {
  margin-inline-start: .5rem;
}

.background-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}
