:root {
  color-scheme: light;
  --page: #f4f6f1;
  --paper: #fff;
  --ink: #172920;
  --muted: #5b6b61;
  --line: #dbe3d9;
  --green: #224d3b;
  --deep-green: #143c2b;
  --mint: #ebf3eb;
  --gold: #e7c287;
  --shadow: 0 14px 30px rgba(24, 53, 36, .07);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #5b966d; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(1296px, calc(100% - 96px)); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip { position: fixed; z-index: 4; left: 16px; top: -60px; padding: 12px; background: #fff; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }

.topbar { background: var(--paper); border-bottom: 1px solid #e3e9e0; }
.topbar-inner { min-height: 74px; display: flex; align-items: stretch; gap: 54px; }
.brand { display: inline-flex; align-items: center; gap: 13px; flex: none; font-size: 1.25rem; letter-spacing: .035em; font-weight: 750; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--green); color: #f5ddad; position: relative;
  font: 700 1.05rem "Songti SC", SimSun, serif;
}
.brand-mark::before { content: ""; position: absolute; inset: 7px; border: 1px solid #c6a36a; transform: rotate(45deg); border-radius: 4px; }
.main-nav { display: flex; align-items: stretch; gap: 30px; }
.main-nav a { position: relative; display: flex; align-items: center; white-space: nowrap; font-size: .93rem; color: var(--muted); }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--green); }
.main-nav a[aria-current] { font-weight: 750; }
.main-nav a[aria-current]::after { content: ""; position: absolute; height: 3px; bottom: 0; inset-inline: 2px; border-radius: 3px 3px 0 0; background: var(--green); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 42px; padding: 9px 15px; border-radius: 9px; border: 1px solid transparent; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover:not(:disabled) { background: #31634a; }
.button.subtle { color: var(--green); border-color: #cddcce; background: #fff; }
.button.subtle:hover:not(:disabled) { background: var(--mint); border-color: #9fb7a6; }
.top-publish { margin: auto 0 auto auto; padding-inline: 18px; }

.hero {
  isolation: isolate; position: relative; min-height: 280px; margin-top: 30px; border-radius: 19px;
  overflow: hidden; background: #173c30; color: #f5f7ef; box-shadow: var(--shadow);
}
.hero::before {
  z-index: -2; content: ""; position: absolute; inset: 0;
  background-image: url('./hero.png'), radial-gradient(ellipse at 75% 15%, #a68d5d 0, #365448 37%, #173c30 66%);
  background-repeat: no-repeat; background-size: cover; background-position: center 48%;
}
.hero::after {
  z-index: -1; content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(13, 45, 33, .96), rgba(13, 45, 33, .74) 35%, rgba(13, 45, 33, .10) 68%);
}
.hero-copy { padding: 33px 45px 36px; position: relative; }
.hero-eyebrow { display: flex; gap: 8px; align-items: center; font-size: .84rem; font-weight: 700; letter-spacing: .15em; color: #f0d7a4; }
.hero h1 {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", SimSun, serif;
  font-size: clamp(2.55rem, 3.9vw, 3.7rem); font-weight: 800; letter-spacing: .09em; line-height: 1.16;
  margin-block: 10px;
}
.hero-description { color: #edf2e9; line-height: 1.55; }
.hero-search {
  display: flex; align-items: center; width: min(478px, 100%); min-height: 49px; margin-top: 23px;
  padding: 5px 5px 5px 17px; gap: 12px; border-radius: 10px; background: #fff; color: var(--ink);
  box-shadow: 0 8px 22px #0c241e50;
}
.hero-search:focus-within { outline: 2px solid #b8d3bb; outline-offset: 2px; }
.hero-search input { min-width: 0; flex: 1; border: 0; background: none; color: var(--ink); outline: none; }
.hero-search input:focus-visible { outline: none; }
.hero-search input::placeholder { color: #68786e; }
.hero-search button { min-width: 74px; min-height: 38px; border: 0; border-radius: 7px; color: white; background: var(--green); font-weight: 700; font-size: .9rem; }
.hero-search button:hover { background: #397052; }
.magnifier { position: relative; flex: none; width: 15px; height: 15px; border: 1.8px solid #567365; border-radius: 50%; margin-right: 2px; }
.magnifier::after { content: ""; position: absolute; width: 6px; height: 1.8px; right: -4px; bottom: -2px; border-radius: 3px; background: #567365; transform: rotate(47deg); }

.workspace { margin-top: 33px; scroll-margin-top: 16px; }
.workspace-header { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 20px; }
.heading-group h2 { font-size: clamp(1.55rem, 2.4vw, 1.93rem); letter-spacing: .015em; line-height: 1.25; }
.heading-group p { margin-top: 7px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.quiet-status { padding: 7px 11px; border-radius: 8px; color: #416451; background: #e7efe6; white-space: nowrap; font-size: .82rem; font-weight: 650; }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 22px; align-items: start; }
.catalog-main { min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.filter {
  padding: 8px 15px; min-height: 37px; border: 1px solid var(--line); color: var(--muted);
  background: #fff; border-radius: 8px; font-size: .86rem; white-space: nowrap;
}
.filter:hover { border-color: #99b4a0; color: var(--green); }
.filter[aria-pressed="true"] { color: #24533c; background: #e1eee0; border-color: #c6dac8; font-weight: 700; }
.catalog-filters { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 15px; }
.catalog-filters .filters { margin-bottom: 0; }
.trade-filter { margin-left: auto; }
.trade-filter-note { color: var(--muted); font-size: .84rem; margin: -4px 0 12px; }
.items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.item-card {
  text-align: left; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; min-width: 0; padding: 14px;
  display: grid; grid-template-columns: 49px minmax(0,1fr); column-gap: 11px; align-items: center;
  min-height: 107px; transition: box-shadow .16s, border-color .16s, background .16s;
}
.item-card:hover { border-color: #91ad98; box-shadow: 0 6px 14px #2548340d; }
.item-card[aria-pressed="true"] { border-color: #70a182; background: #f8fcf6; box-shadow: 0 0 0 1px #70a18245; }
.item-name { display: block; font-size: .98rem; font-weight: 750; overflow-wrap: anywhere; line-height: 1.4; }
.item-meta { display: block; color: var(--muted); font-size: .79rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.item-type { display: block; color: #446253; margin: 10px 0 0; font-size: .79rem; grid-column: 2; }
.stamp {
  --tone: #83633e; --tone-bg: #f4e9d9;
  position: relative; flex: none; display: grid; place-items: center; width: 49px; height: 49px;
  border-radius: 11px; color: var(--tone); background: var(--tone-bg);
  font: 750 1.30rem "Songti SC", "STSong", SimSun, serif;
}
.stamp::before { content: ""; position: absolute; inset: 6px; border-radius: 8px; border: 1px solid currentColor; opacity: .25; }
.stamp.weapon { --tone: #3d6980; --tone-bg: #e5eff4; }
.stamp.armor { --tone: #66538e; --tone-bg: #eee9f6; }
.stamp.potion { --tone: #985848; --tone-bg: #faeae2; }
.stamp.material { --tone: #537147; --tone-bg: #e9f1e3; }
.stamp.gift { --tone: #8b6732; --tone-bg: #faf0da; }
.stamp.other { --tone: #5a6f61; --tone-bg: #eaf0e9; }
.panel { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 5px 18px #2548340a; }
.detail { min-width: 0; scroll-margin-top: 16px; }
.section-label { font-size: .85rem; color: #4b6958; font-weight: 750; margin-bottom: 15px; }
.detail-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.detail-heading .stamp { width: 52px; height: 52px; }
.detail-heading h3 { font-size: 1.11rem; overflow-wrap: anywhere; line-height: 1.4; }
.detail-heading p { font-size: .81rem; color: var(--muted); margin-top: 4px; }
.detail-description { color: #51635a; font-size: .9rem; line-height: 1.6; overflow-wrap: anywhere; margin-top: 17px; white-space: pre-line; }
.description-source { display: inline-block; margin-top: 5px; color: var(--green); font-size: .81rem; text-decoration: underline; }
.attribute-list { margin: 17px 0; padding: 11px 0; border-block: 1px solid #e7ede5; display: grid; gap: 9px; }
.attribute-list div { display: flex; gap: 10px; justify-content: space-between; line-height: 1.4; }
.attribute-list dt { color: var(--muted); font-size: .84rem; }
.attribute-list dd { margin: 0; color: var(--ink); font-size: .86rem; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.equipment-requirements { margin: 0 0 17px; }
.equipment-requirements h4 { margin: 0 0 8px; font-size: .89rem; }
.requirement-values { display: flex; flex-wrap: wrap; gap: 6px; }
.requirement-values span { padding: 4px 8px; background: var(--mint); border-radius: 6px; color: var(--deep-green); font-size: .82rem; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.variant-note { margin: 14px 0 -5px; font-size: .81rem; color: #735d3c; line-height: 1.5; }
.empty-state { background: #ffffffaa; border: 1px dashed #ccd9ce; border-radius: 13px; padding: 33px 20px; text-align: center; color: var(--muted); }
.items .empty-state, .listing-grid .empty-state { grid-column: 1 / -1; }
.empty-state h3 { color: var(--ink); font-size: 1.04rem; margin-bottom: 8px; }
.empty-state p { line-height: 1.6; }
.empty-state button { margin-top: 17px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.pagination span { color: var(--muted); font-size: .89rem; font-variant-numeric: tabular-nums; }

.listing-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.legacy-listings { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; padding: 13px 15px; }
.legacy-listings p { font-size: .89rem; line-height: 1.5; color: var(--muted); }
.listing-card .detail-heading { margin-block: 13px; }
.listing-card { min-width: 0; }
.listing-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.listing-tag { border-radius: 7px; background: #e1eee0; color: #28563f; padding: 5px 10px; font-size: .84rem; font-weight: 750; }
.listing-tag.buy { background: #fbefd8; color: #7e5924; }
.posted { font-size: .79rem; color: var(--muted); }
.listing-price { font-size: 1.16rem; font-weight: 750; color: var(--green); margin-bottom: 8px; line-height: 1.4; overflow-wrap: anywhere; }
.listing-quantity, .listing-contact, .listing-note { font-size: .89rem; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.listing-note { margin-top: 10px; white-space: pre-line; }
.trade-metainfo { display: inline-block; color: var(--deep-green); border-radius: 6px; background: var(--mint); margin-top: 10px; padding: 4px 7px; font-size: .81rem; }
.listed-affixes { display: grid; gap: 4px; margin: 10px 0 0; padding-left: 18px; color: var(--green); font-size: .88rem; }
.listing-detail { margin-top: 14px; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 36px; padding-block: 20px 26px; border-top: 1px solid var(--line); color: #596d60; font-size: .81rem; }

.publish-dialog { width: min(545px, calc(100% - 30px)); max-height: calc(100dvh - 34px); border: 1px solid #dde7dd; border-radius: 15px; padding: 0; color: var(--ink); box-shadow: 0 22px 80px #102b2650; }
.publish-dialog::backdrop { background: #0d251eb0; }
.publish-dialog form { padding: 23px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.dialog-heading h2 { font-size: 1.4rem; margin-bottom: 6px; }
.dialog-heading p { font-size: .89rem; line-height: 1.55; }
.icon-button { display: grid; place-items: center; background: var(--mint); border: 0; border-radius: 8px; color: #2e5641; font-size: 1.45rem; line-height: 1; width: 34px; height: 34px; flex: none; }
.type-selector { display: flex; gap: 8px; padding: 0; margin: 17px 0 14px; border: 0; }
.type-selector legend, .field label { font-size: .9rem; font-weight: 750; margin-bottom: 6px; }
.type-selector label { flex: 1; position: relative; }
.type-selector input { position: absolute; opacity: 0; }
.type-selector span { display: block; text-align: center; border: 1px solid var(--line); padding: 8px; border-radius: 7px; cursor: pointer; font-size: .9rem; }
.type-selector input:focus-visible + span { outline: 3px solid #5b966d; outline-offset: 2px; }
.type-selector input:checked + span { background: #e5efe4; border-color: #9fbda6; color: var(--green); font-weight: 700; }
.field { display: flex; flex-direction: column; min-width: 0; margin-bottom: 12px; }
.field label span { font-size: .81rem; color: var(--muted); margin-left: 3px; font-weight: 400; }
.field input, .field textarea { width: 100%; padding: 9px 10px; color: var(--ink); background: #fff; border: 1px solid #cbd9cd; border-radius: 8px; min-height: 41px; }
.field textarea { resize: vertical; }
.trade-verification { margin: 0 0 13px; border-radius: 8px; background: var(--mint); padding: 9px 10px; }
.trade-verification label { display: flex; align-items: center; gap: 7px; font-size: .87rem; font-weight: 700; }
.trade-verification input { margin: 0; accent-color: var(--green); }
.affix-editor { margin: 0 0 14px; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 8px; min-inline-size: 0; }
.affix-editor legend { padding-inline: 5px; font-size: .9rem; font-weight: 750; }
.affix-editor legend span { color: var(--muted); font-size: .81rem; font-weight: 400; }
.affix-editor .field-help { margin: 0 0 8px; }
.affix-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(64px, .33fr) 32px; gap: 6px; margin: 8px 0; align-items: center; }
.affix-row select, .affix-row input { min-width: 0; width: 100%; background-color: #fff; color: var(--ink); border: 1px solid #cbd9cd; border-radius: 7px; padding: 8px; font: inherit; font-size: .83rem; }
.affix-row select { appearance: none; padding-right: 21px; background-image: linear-gradient(45deg,transparent 50%,#497859 50%),linear-gradient(135deg,#497859 50%,transparent 50%); background-position: right 12px center,right 8px center; background-size: 4px 4px; background-repeat: no-repeat; }
.affix-row input:disabled { background: #f1f4ef; }
.add-affix { min-height: 33px; padding: 4px 9px; font-size: .81rem; }
.remove-affix { width: 30px; height: 32px; font-size: 1.16rem; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.field-help { font-size: .81rem; line-height: 1.4; color: var(--muted); margin-top: 5px; }
.suggestions:empty { display: none; }
.suggestions { border: 1px solid var(--line); border-radius: 7px; max-height: 141px; overflow: auto; margin-top: 6px; }
.suggestions button { display: block; width: 100%; padding: 8px 10px; text-align: left; border: 0; background: white; color: var(--ink); font-size: .9rem; }
.suggestions button + button { border-top: 1px solid var(--line); }
.suggestions button:hover, .suggestions button:focus-visible { background: var(--mint); }
.form-error { color: #a33d31; font-size: .86rem; margin: 8px 0; }
.form-error:empty { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast { position: fixed; z-index: 2; inset-inline: 16px; bottom: 18px; margin-inline: auto; width: fit-content; max-width: calc(100% - 32px); color: #fff; border-radius: 8px; padding: 10px 15px; background: #2a563f; box-shadow: var(--shadow); }

@media (max-width: 1070px) {
  .shell { width: calc(100% - 56px); }
  .catalog-layout { grid-template-columns: minmax(0,1fr) 268px; gap: 16px; }
  .items { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .listing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 690px) {
  .shell { width: calc(100% - 30px); }
  .topbar-inner { min-height: 64px; gap: 12px; flex-wrap: wrap; }
  .brand { font-size: 1.03rem; gap: 8px; margin-top: 12px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: .9rem; }
  .brand-mark::before { inset: 6px; }
  .top-publish { margin-top: 12px; min-height: 34px; font-size: .8rem; padding: 4px 8px; }
  .main-nav { order: 3; width: 100%; gap: 23px; min-height: 39px; }
  .main-nav a { font-size: .88rem; }
  .hero { min-height: 234px; margin-top: 18px; border-radius: 13px; }
  .hero::after { background: linear-gradient(90deg,#0d2d21ec,#0d2d218c 78%,#0d2d2150); }
  .hero-copy { padding: 24px 17px 24px; }
  .hero h1 { font-size: 2.45rem; }
  .hero-search { padding-left: 12px; gap: 9px; }
  .hero-search input { font-size: .91rem; }
  .hero-search button { min-width: 60px; }
  .workspace { margin-top: 25px; }
  .workspace-header { align-items: flex-start; margin-bottom: 15px; }
  .quiet-status { font-size: .75rem; padding: 6px; }
  .catalog-layout { display: flex; flex-direction: column; }
  .catalog-main, .detail { width: 100%; }
  .detail { order: 2; }
  .items { gap: 9px; }
  .item-card { grid-template-columns: 36px minmax(0,1fr); padding: 9px; column-gap: 7px; min-height: 90px; }
  .item-card .stamp { width: 36px; height: 36px; font-size: 1.12rem; border-radius: 8px; }
  .item-card .stamp::before { inset: 4px; }
  .item-type { margin-top: 5px; }
  .item-meta, .item-type { font-size: .75rem; }
  .item-name { font-size: .88rem; }
  .listing-grid { grid-template-columns: 1fr; }
  .footer { margin-top: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
