:root {
  color-scheme: light;
  --paper: #f6f8f3;
  --sheet: #fff;
  --ink: #202e25;
  --muted: #52645a;
  --green: #24503c;
  --green-hover: #173d2c;
  --soft: #e7efe3;
  --line: #dfe7db;
  --rust: #8d442d;
  --alert: #a02d25;
  --width: 60rem;
  --sample: url("/assets/demo-listings.jpg");
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 100%;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.5; }
body.has-dock { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin: 0; }
h1 { color: var(--green); font-size: clamp(1.75rem, 6vw, 2.65rem); line-height: 1.15; letter-spacing: -.035em; }
h2, h3 { font-size: 1.125rem; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #70977b; outline-offset: 3px; }
.muted { color: var(--muted); font-size: .875rem; }

.masthead { background: var(--sheet); border-bottom: 1px solid var(--line); }
.masthead-inner {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  max-width: var(--width); min-height: 4.5rem; margin-inline: auto; padding: .65rem 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .65rem;
  text-decoration: none; line-height: 1.2;
}
.brand-mark {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border-radius: .8rem; background: var(--green); color: white; font-size: 1.12rem; font-weight: 700;
}
.brand strong, .brand small { display: block; }
.brand strong { color: var(--ink); font-size: 1.2rem; letter-spacing: .12em; }
.brand small { color: var(--muted); margin-top: .15rem; font-size: .75rem; }
.header-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: .5rem;
  max-width: 68%; min-width: 0;
}
.community-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--green); font-size: .875rem; font-weight: 650;
}
.header-actions .header-login { flex: 0 0 auto; }
.community-select { position: relative; min-width: 0; }
.community-select summary {
  display: flex; align-items: center; gap: .55rem; min-height: 2.75rem;
  padding: .5rem .75rem; background: var(--soft); color: var(--green); border-radius: .8rem;
  font-size: .875rem; font-weight: 650; overflow-wrap: anywhere; list-style: none;
}
.community-select summary::-webkit-details-marker { display: none; }
.community-select summary::after {
  content: ""; width: .42rem; height: .42rem; flex: 0 0 .42rem;
  border-right: 1.5px solid; border-bottom: 1.5px solid; transform: translateY(-.12rem) rotate(45deg);
}
.community-menu {
  position: absolute; z-index: 2; right: 0; display: grid; gap: .5rem; margin-top: .5rem;
  width: min(17rem, 80vw); padding: .8rem; background: var(--sheet); border: 1px solid var(--line);
  border-radius: .9rem; box-shadow: 0 .5rem 1.5rem #2538211c;
}
.community-menu p { color: var(--muted); font-size: .8125rem; }
.community-option {
  min-height: 2.75rem; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  text-align: left; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--sheet);
  overflow-wrap: anywhere;
}
.community-option[aria-current] { color: var(--green); background: var(--soft); }
.community-option span { flex: 0 0 auto; color: var(--muted); font-size: .75rem; }

.main { max-width: var(--width); margin-inline: auto; padding: 1.05rem 1rem 1.5rem; }
.demo-label { color: var(--muted); font-size: .75rem; margin-bottom: .5rem; }
.market-banner {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  border-radius: 1.15rem; padding: clamp(1rem, 3.5vw, 1.7rem); background: var(--soft);
}
.market-banner p { color: var(--green); font-size: .875rem; margin-bottom: .25rem; }
.market-banner .button { flex: 0 0 auto; }
.filters {
  display: flex; flex-wrap: wrap; gap: .2rem .4rem;
  margin: .7rem 0;
}
.filters a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding-inline: .75rem;
  color: var(--muted); border-radius: 99rem; text-decoration: none; font-size: .875rem;
}
.filters a[aria-current] { color: white; background: var(--green); }
.listings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.listing {
  background: var(--sheet); border: 1px solid var(--line);
  border-radius: 1rem; overflow: hidden;
}
.listing a { display: block; color: inherit; text-decoration: none; }
.listing a:focus-visible { outline-offset: -3px; }
.listing-copy { padding: .7rem .75rem .8rem; }
.listing-copy h2 { font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.listing-copy p, .row-preview p {
  display: flex; flex-wrap: wrap; gap: .1rem .45rem; align-items: baseline;
  margin-top: .35rem; color: var(--muted); font-size: .8125rem;
}
.photo {
  display: block; width: 100%; aspect-ratio: 1.35; object-fit: cover; background-color: var(--soft);
}
.sample-photo { background-image: var(--sample); background-size: 200% auto; }
.sample-0 { background-position: left 10%; }
.sample-1 { background-position: right 10%; }
.sample-2 { background-position: left 90%; }
.sample-3 { background-position: right 90%; }
.price { color: var(--rust); font-weight: 740; font-size: 1.2rem; line-height: 1.2; }
.price.free { color: var(--green); }

.dock {
  position: fixed; bottom: 0; z-index: 1; left: 0; right: 0; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); padding: .4rem max(1rem, calc((100% - 34rem) / 2)) calc(.45rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--sheet);
}
.dock.dock-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dock .dock-post {
  display: block; width: .94rem; height: .78rem; border: 1.4px solid currentColor;
  border-radius: .25rem; position: relative; margin: .15rem 0 .1rem;
}
.dock-post::after {
  content: ""; position: absolute; left: .14rem; bottom: -.21rem; width: .3rem; height: .3rem;
  border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor;
  transform: skewY(-40deg);
}
.dock a {
  display: grid; justify-items: center; align-content: center; gap: .12rem;
  min-height: 3.2rem; color: var(--muted); text-decoration: none; border-radius: .75rem; font-size: .875rem;
}
.dock a span { font-size: 1.25rem; line-height: 1; }
.dock a[aria-current] { color: var(--green); font-weight: 680; background: var(--soft); }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
  border: 1px solid var(--line); border-radius: .75rem; padding: .5rem .85rem;
  background: var(--sheet); color: var(--green); font-weight: 640; font-size: .9375rem; text-decoration: none;
  text-align: center;
}
.button:hover { border-color: var(--green); }
.button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.button.primary:hover { background: var(--green-hover); }
.button.quiet { background: transparent; border-color: transparent; }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.error, .notice, .empty {
  padding: .75rem .85rem; border-radius: .75rem; border: 1px solid var(--line);
  background: var(--sheet); overflow-wrap: anywhere;
}
.error { background: #fff3f2; color: var(--alert); }
.notice { color: var(--green); background: var(--soft); }
.empty { color: var(--muted); }
.main > .notice { margin-bottom: .75rem; }
.section-title { margin-bottom: .9rem; }
.section-title p { margin-top: .3rem; color: var(--muted); }

.welcome {
  display: grid; border: 1px solid var(--line); border-radius: 1.2rem;
  overflow: hidden; background: var(--sheet);
}
.welcome-photo { background: var(--soft) var(--sample) left 11% / 200% auto; aspect-ratio: 1.6; }
.welcome-content { display: grid; justify-items: start; gap: 1rem; padding: clamp(1rem, 5vw, 3rem); }
.welcome .muted { margin-top: .2rem; }
.form-card, .detail { margin-inline: auto; max-width: 38rem; }
.form-card {
  display: grid; justify-items: start; gap: .85rem; padding: clamp(1rem, 4vw, 1.65rem);
  background: var(--sheet); border: 1px solid var(--line); border-radius: 1rem;
}
.form-card.compact { max-width: 29rem; }
.form-card .section-title { margin-bottom: 0; }
.fields { display: grid; gap: .85rem; width: 100%; min-width: 0; }
.fields label { display: grid; gap: .3rem; color: var(--ink); font-weight: 640; font-size: .875rem; min-width: 0; }
.fields input:not([type="checkbox"]), .fields select, .fields textarea {
  display: block; width: 100%; min-width: 0; min-height: 2.75rem; padding: .55rem .65rem;
  border: 1px solid #bac9bc; border-radius: .65rem; background: var(--sheet); font-size: 1rem; font-weight: 400;
}
.fields textarea { min-height: 5.5rem; resize: vertical; }
.fields select {
  appearance: none; padding-right: 2rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%),
    linear-gradient(135deg, var(--green) 50%, transparent 50%);
  background-position: right 1.05rem center, right .75rem center;
  background-repeat: no-repeat; background-size: .32rem .32rem;
}
.fields input::placeholder, .fields textarea::placeholder { color: #657268; }
.fields input[type="file"] { padding: .35rem; font-size: .875rem; }
.fields input[type="file"]::file-selector-button {
  padding: .45rem .5rem; border: 0; border-radius: .45rem; background: var(--soft); color: var(--green);
  font: inherit; margin-right: .4rem;
}
.fields .upload { padding: .65rem; background: var(--paper); border-radius: .75rem; }
.upload small { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.upload-preview { width: 6rem; aspect-ratio: 1; object-fit: cover; border-radius: .6rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; }
.fields .check { display: flex; gap: .45rem; align-items: center; min-height: 2.75rem; font-weight: 400; }
.check input { width: 1.15rem; height: 1.15rem; margin: 0; flex: 0 0 auto; accent-color: var(--green); }

.detail { display: grid; gap: .75rem; }
.back-link { min-height: 2.75rem; display: inline-flex; align-items: center; width: fit-content; font-size: .875rem; }
.detail-photo { border-radius: 1rem; aspect-ratio: 1.55; }
.detail-content { display: grid; gap: .85rem; padding: clamp(1rem, 3vw, 1.5rem); background: var(--sheet); border: 1px solid var(--line); border-radius: 1rem; }
.detail-top { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.detail-top h1 { font-size: clamp(1.45rem, 5vw, 2.2rem); overflow-wrap: anywhere; }
.detail-top .price { font-size: 1.5rem; }
.item-meta, .place { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.place { display: flex; flex-wrap: wrap; gap: .1rem .45rem; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.contact { display: grid; gap: .3rem; padding: .75rem; border-radius: .75rem; background: var(--soft); overflow-wrap: anywhere; }
.contact p:last-child, .copy-status, .report summary { color: var(--muted); font-size: .875rem; }
.report summary { min-height: 2.75rem; padding-block: .65rem; }
.report form { max-width: 20rem; margin-top: .45rem; }

.management { display: grid; gap: .6rem; }
.management-row {
  display: grid; gap: .6rem; padding: .7rem; background: var(--sheet);
  border: 1px solid var(--line); border-radius: .85rem; min-width: 0; overflow-wrap: anywhere;
}
.row-preview { display: flex; gap: .7rem; align-items: center; color: var(--ink); text-decoration: none; }
.row-photo { width: 4.25rem; aspect-ratio: 1; border-radius: .55rem; flex: 0 0 auto; }
.status { color: var(--muted); }
.profile-links, .management-section { margin-top: 1.2rem; }
.management-section > h2 { margin-bottom: .45rem; }
.management-section > form { margin-top: .65rem; }
.entry-share { grid-template-columns: minmax(0, 7rem) minmax(0, 1fr); align-items: center; }
.entry-qr { display: block; width: 100%; aspect-ratio: 1; }
.entry-copy { display: grid; gap: .5rem; font-size: .875rem; }

.composer { gap: 1.05rem; }
.composer .section-title p { font-size: .875rem; }
.segmented {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .25rem; width: 100%; padding: .25rem; background: var(--paper); border: 1px solid var(--line); border-radius: .85rem;
}
.segmented a {
  display: grid; place-items: center; min-height: 2.75rem; padding-inline: .5rem; text-align: center;
  border-radius: .6rem; color: var(--muted); text-decoration: none; font-size: .9375rem; font-weight: 650;
}
.segmented a[aria-current] { background: var(--sheet); color: var(--green); box-shadow: 0 1px 4px #233d2520; }
.mine-tabs { max-width: 23rem; margin-bottom: .85rem; }
.fields .compose-text { gap: .42rem; }
.compose-text textarea { min-height: 9rem; }
.text-count { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.upload-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
.fields .media-button {
  position: relative; display: grid; align-content: center; justify-items: center; gap: .23rem;
  min-height: 5.7rem; padding: .55rem; background: var(--paper); border: 1px dashed #9eb3a2; border-radius: .8rem;
  color: var(--green); text-align: center; cursor: pointer;
}
.media-button:focus-within { outline: 2px solid #70977b; outline-offset: 2px; }
.media-button small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.fields .media-button input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.media-icon {
  color: var(--green); display: block; position: relative; width: 1.45rem; height: 1.15rem;
  border: 1.5px solid currentColor; border-radius: .32rem; margin: .2rem .2rem .1rem;
}
.camera-icon::after {
  content: ""; position: absolute; inset: .18rem .36rem; border: 1.4px solid currentColor; border-radius: 50%;
}
.video-icon::after {
  content: ""; position: absolute; top: .13rem; right: -.45rem; width: .44rem; height: .64rem;
  border: 1.5px solid currentColor; border-left: 0; border-radius: 0 .18rem .18rem 0;
}
.listing-upload { display: flex; align-items: center; gap: .65rem; }
.listing-upload .media-button { flex: 1; min-width: 0; }
.listing-upload .upload-preview { width: 5.7rem; }
.pending-media { display: grid; gap: .55rem; }
.pending-media > button { justify-self: end; }
.preview-images { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .4rem; }
.preview-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .6rem; }
.pending-media video { display: block; width: 100%; max-height: 12rem; border-radius: .65rem; background: #17231a; }
.compose-submit { min-height: 3rem; }
.community-feed { margin-inline: auto; max-width: 43rem; }
.post-banner {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: var(--soft);
  border-radius: 1rem; padding: clamp(.9rem, 3vw, 1.5rem); margin-bottom: .75rem;
}
.post-banner p { color: var(--green); font-size: .875rem; margin-bottom: .25rem; }
.post-banner .button { flex: 0 0 auto; }
.posts-list { display: grid; gap: .7rem; }
.post-card { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--sheet); }
.post-author, .comment-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; color: var(--muted); font-size: .875rem;
}
.post-author time, .comment-meta time { font-size: .8125rem; }
.post-open { display: grid; gap: .65rem; color: inherit; text-decoration: none; margin-top: .48rem; }
.post-snippet { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-link-label { color: var(--green); font-size: .875rem; font-weight: 650; }
.post-cover { display: block; width: min(100%, 20rem); max-height: 12rem; object-fit: cover; border-radius: .7rem; }
.media-label { padding: .2rem .5rem; width: fit-content; background: var(--soft); color: var(--green); border-radius: .4rem; font-size: .875rem; }
.post-body { font-size: 1.0625rem; }
.post-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.post-images:empty { display: none; }
.post-images a:only-child { grid-column: 1 / -1; }
.post-images img { display: block; width: 100%; aspect-ratio: 1.25; object-fit: cover; border-radius: .65rem; }
.post-images a:only-child img { aspect-ratio: auto; max-height: 28rem; object-fit: contain; background: var(--paper); }
.post-video { display: grid; gap: .35rem; }
.post-video video { display: block; width: 100%; max-height: 26rem; border-radius: .65rem; background: #17231a; }
.post-video a { font-size: .875rem; }
.comments { scroll-margin-block-start: .85rem; }
.comments h2 small { color: var(--muted); font-weight: 500; margin-left: .3rem; }
.comment-form button { justify-self: end; }
.comment-list { display: grid; gap: .7rem; padding: 0; margin: 0; list-style: none; }
.comment-list li { border-top: 1px solid var(--line); padding-top: .55rem; }
.comment-list li .description { margin-top: .3rem; }
.comment-meta form { margin-left: auto; }
.comment-delete { min-height: 2.75rem; color: var(--muted); background: transparent; border: 0; font-size: .875rem; }

@media (min-width: 42rem) {
  .listings { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .welcome { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .welcome-photo { aspect-ratio: auto; background-position: left top; }
  .welcome-content { align-content: center; }
}
