.xfants-community,
.xfants-community-empty,
main[data-xfants-route^="market"],
main[data-xfants-route^="messages"] {
  --xfants-community-ink: #173c34;
  --xfants-community-paper: #f7f8f2;
  --xfants-community-line: #cad5c9;
  --xfants-community-accent: #a54c35;
  --xfants-community-focus: #173c34;
  --xfants-community-muted: #52655f;
  width: min(940px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 72px;
  color: var(--xfants-community-ink);
  overflow-wrap: anywhere;
}

.xfants-community h1,
.xfants-community-empty h1,
main[data-xfants-route^="market"] h1,
main[data-xfants-route^="messages"] h1 {
  max-width: 24ch;
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: 0;
}

.xfants-community h2,
main[data-xfants-route^="market"] h2,
main[data-xfants-route^="messages"] h2 {
  margin: 0 0 12px;
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: 0;
}

.xfants-community :is(section, article),
main[data-xfants-route^="market"] :is(section, article),
main[data-xfants-route^="messages"] :is(section, article) {
  padding: 24px 0;
  border-top: 1px solid var(--xfants-community-line);
}

.xfants-community > :first-child:not(nav),
main[data-xfants-route^="market"] > :first-child:not(nav),
main[data-xfants-route^="messages"] > :first-child:not(nav) {
  margin-top: 0;
}

.xfants-community nav[aria-label="面包屑"] {
  margin-bottom: 18px;
  color: var(--xfants-community-muted);
  font-size: 14px;
}

.xfants-community > ul,
.xfants-community > section > ul,
main[data-xfants-route^="market"] > ul,
main[data-xfants-route^="messages"] > ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.xfants-community > ul > li,
.xfants-community > section > ul > li,
main[data-xfants-route^="market"] > ul > li,
main[data-xfants-route^="messages"] > ul > li {
  padding: 13px 0;
  border-top: 1px solid var(--xfants-community-line);
}

.xfants-community > ul > li:first-child,
.xfants-community > section > ul > li:first-child,
main[data-xfants-route^="market"] > ul > li:first-child,
main[data-xfants-route^="messages"] > ul > li:first-child {
  border-top: 0;
}

.xfants-community :is(a, button),
main[data-xfants-route^="market"] :is(a, button),
main[data-xfants-route^="messages"] :is(a, button) {
  color: inherit;
}

.xfants-community a,
main[data-xfants-route^="market"] a,
main[data-xfants-route^="messages"] a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.xfants-community a:hover,
main[data-xfants-route^="market"] a:hover,
main[data-xfants-route^="messages"] a:hover {
  color: var(--xfants-community-accent);
}

.xfants-community-author {
  color: var(--xfants-community-muted) !important;
  font-size: 14px;
}

.xfants-community :is(form, .xfants-community-topic, .xfants-community-reply, .xfants-diary-entry),
main[data-xfants-route^="market"] form,
main[data-xfants-route^="messages"] form {
  max-width: 680px;
}

.xfants-community form,
main[data-xfants-route^="market"] form,
main[data-xfants-route^="messages"] form {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.xfants-community label,
main[data-xfants-route^="market"] label,
main[data-xfants-route^="messages"] label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.xfants-community :is(input, select, textarea),
main[data-xfants-route^="market"] :is(input, select, textarea),
main[data-xfants-route^="messages"] :is(input, select, textarea) {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--xfants-community-line);
  border-radius: 0;
  color: inherit;
  background: #fff;
  font: inherit;
}

.xfants-community textarea,
main[data-xfants-route^="market"] textarea,
main[data-xfants-route^="messages"] textarea {
  min-height: 132px;
  resize: vertical;
}

.xfants-community button,
main[data-xfants-route^="market"] button,
main[data-xfants-route^="messages"] button {
  justify-self: start;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--xfants-community-ink);
  border-radius: 0;
  color: #fff;
  background: var(--xfants-community-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.xfants-community button:hover,
main[data-xfants-route^="market"] button:hover,
main[data-xfants-route^="messages"] button:hover {
  border-color: var(--xfants-community-accent);
  background: var(--xfants-community-accent);
}

.xfants-community :is(a, button, input, select, textarea):focus-visible,
main[data-xfants-route^="market"] :is(a, button, input, select, textarea):focus-visible,
main[data-xfants-route^="messages"] :is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--xfants-community-focus);
  outline-offset: 3px;
}

.xfants-diary-image {
  max-width: 760px;
  margin: 18px 0 0;
}

.xfants-diary-image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.xfants-notice {
  max-width: 680px;
  margin: 16px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--xfants-community-ink);
  background: #fff;
}

.xfants-notice-error {
  border-left-color: var(--xfants-community-accent);
}

@media (max-width: 760px) {
  .xfants-community,
  .xfants-community-empty,
  main[data-xfants-route^="market"],
  main[data-xfants-route^="messages"] {
    width: min(100% - 32px, 640px);
    padding: 32px 0 48px;
  }

  .xfants-community h1,
  .xfants-community-empty h1,
  main[data-xfants-route^="market"] h1,
  main[data-xfants-route^="messages"] h1 {
    font-size: 28px;
  }

  .xfants-community :is(section, article),
  main[data-xfants-route^="market"] :is(section, article),
  main[data-xfants-route^="messages"] :is(section, article) {
    padding: 20px 0;
  }

  .xfants-community button,
  main[data-xfants-route^="market"] button,
  main[data-xfants-route^="messages"] button {
    width: 100%;
    justify-content: center;
  }
}
