:root {
  --green-900: #123429;
  --green-700: #1e4a37;
  --green-600: #2d6a4f;
  --green-100: #e8f5ee;
  --mint: #95d5b2;
  --coral: #e76f51;
  --gold: #f9a825;
  --ink: #1b1b1e;
  --muted: #6c757d;
  --line: #e7ece9;
  --paper: #ffffff;
  --wash: #f6f8f5;
  --shadow: 0 12px 30px rgba(18, 52, 41, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(232, 245, 238, 0.7), rgba(255, 255, 255, 0) 36%),
    var(--wash);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 24px 18px;
  background: rgba(255, 255, 255, 0.86);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 30px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  background: var(--green-600);
  border-radius: 10px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--green-700);
  font-size: 22px;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.nav-label {
  margin: 16px 8px 4px;
  color: #9aa5a0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.side-link {
  padding: 10px 12px;
  color: #53615b;
  border-radius: 8px;
  font-size: 14px;
}

.side-link:hover,
.side-link.active {
  color: var(--green-700);
  background: var(--green-100);
}

.shell {
  margin-left: 260px;
  padding: 0 32px 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  margin: 0 -32px 26px;
  padding: 0 32px;
  background: rgba(246, 248, 245, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.crumb {
  color: var(--green-700);
  font-weight: 700;
}

.crumb span {
  margin: 0 8px;
  color: #a5afaa;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.ghost-button,
.primary-button,
.search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.ghost-button {
  padding: 9px 16px;
  color: var(--green-700);
  background: white;
  border: 1px solid var(--line);
}

.primary-button {
  padding: 9px 18px;
  color: white;
  background: var(--green-600);
}

.top-link {
  align-self: center;
  color: var(--green-700);
  font-size: 14px;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: end;
  min-height: 350px;
  padding: 42px;
  color: white;
  background:
    linear-gradient(135deg, rgba(18, 52, 41, 0.96), rgba(45, 106, 79, 0.92)),
    radial-gradient(circle at top right, rgba(149, 213, 178, 0.45), transparent 38%);
  border-radius: 8px;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 620px;
  margin: 0;
  font-size: 44px;
  line-height: 1.16;
}

.hero p:not(.eyebrow) {
  max-width: 560px;
  margin: 16px 0 24px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 17px;
}

.search {
  display: flex;
  max-width: 560px;
  padding: 5px;
  background: white;
  border-radius: 999px;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 0 18px;
  border: 0;
  outline: 0;
}

.search button {
  padding: 12px 22px;
  color: white;
  background: var(--green-600);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tags a {
  padding: 5px 10px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 12px;
}

.hero-panel {
  display: grid;
  gap: 12px;
}

.hero-panel div {
  padding: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.hero-panel strong,
.hero-panel span {
  display: block;
}

.hero-panel strong {
  font-size: 30px;
}

.hero-panel span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.section {
  margin-top: 34px;
}

.section-head {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section h2 {
  margin: 0;
  font-size: 25px;
}

.section p {
  margin: 4px 0 0;
  color: var(--muted);
}

.section-head a {
  color: var(--green-600);
  font-size: 14px;
  font-weight: 700;
}

.category-grid,
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.category-card,
.product-card,
.barter-card,
.article-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(18, 52, 41, 0.03);
}

.category-card {
  padding: 20px;
}

.category-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 8px;
  font-size: 22px;
}

.category-card strong {
  display: block;
  font-size: 15px;
}

.category-card span {
  color: var(--muted);
  font-size: 12px;
}

.product-card {
  overflow: hidden;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-card:hover,
.product-card:focus-visible,
.article-card:hover,
.barter-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-card:focus-visible {
  outline: 3px solid rgba(45, 106, 79, 0.22);
  outline-offset: 3px;
}

.product-image,
.product-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.product-image {
  object-fit: cover;
  display: block;
}

.product-placeholder {
  display: grid;
  place-items: center;
  color: var(--green-700);
  background: linear-gradient(135deg, var(--green-100), #fff8e1);
  font-size: 36px;
}

.product-body {
  padding: 14px;
}

.badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 3px 8px;
  color: white;
  background: var(--green-600);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.product-title {
  min-height: 44px;
  margin: 0 0 8px;
  font-weight: 800;
  line-height: 1.45;
}

.price {
  color: var(--coral);
  font-size: 22px;
  font-weight: 900;
}

.original {
  margin-left: 6px;
  color: #a8b0ab;
  font-size: 12px;
  text-decoration: line-through;
}

.meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.barter-grid,
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.barter-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.barter-icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  background: var(--green-100);
  border-radius: 8px;
  font-size: 28px;
}

.barter-card h3,
.article-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.barter-card p,
.article-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.article-card {
  padding: 20px;
}

.article-meta {
  margin-top: 14px;
  color: #99a49f;
  font-size: 12px;
}

.site-footer {
  margin-left: 0;
  padding-bottom: 80px;
  color: #53615b;
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.home-page .site-footer {
  margin-left: 260px;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(140px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
}

.footer-operator,
.footer-links {
  display: grid;
  gap: 7px;
  align-content: start;
}

.footer-operator strong,
.footer-links strong {
  margin-bottom: 4px;
  color: var(--green-700);
  font-size: 15px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 32px;
  border-top: 1px solid var(--line);
}

.site-footer a {
  color: var(--green-600);
  font-weight: 700;
}

.site-footer a:hover {
  color: var(--green-700);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  display: flex;
  gap: 24px;
  align-items: center;
  max-width: 1200px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-logo {
  color: var(--green-700);
  font-size: 21px;
  font-weight: 900;
}

.site-nav,
.site-header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.site-nav {
  margin-right: auto;
}

.site-content {
  width: min(100% - 32px, 960px);
  min-height: 55vh;
  margin: 32px auto 64px;
}

.form-field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.price-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid #cbd5d0;
  border-radius: 6px;
}

.form-error {
  margin: 0;
  color: #b42318;
  font-size: 13px;
}

.chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
}

.chat-launcher {
  width: 56px;
  height: 56px;
  color: white;
  background: var(--green-600);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(18, 52, 41, 0.24);
  cursor: pointer;
  font-weight: 800;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(330px, calc(100vw - 32px));
  max-height: calc(100vh - 96px);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(18, 52, 41, 0.22);
}

.chat-panel[hidden] {
  display: none;
}

.chat-panel-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding: 16px;
  color: white;
  background: var(--green-700);
}

.chat-panel-head strong,
.chat-panel-head span {
  display: block;
}

.chat-panel-head span {
  margin-top: 2px;
  color: #d9f1e3;
  font-size: 12px;
}

.chat-panel-head i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  background: #68d391;
  border-radius: 50%;
}

.chat-close {
  width: 32px;
  height: 32px;
  color: white;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 24px;
}

.chat-panel-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.chat-panel-body > a:not(.chat-message-link) {
  padding: 8px 10px;
  background: var(--wash);
  border-radius: 6px;
}

.chat-panel-body dl {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 4px 8px;
  margin: 4px 0;
}

.chat-panel-body dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.chat-message-link {
  padding: 9px 12px;
  color: white;
  background: var(--green-600);
  border-radius: 6px;
  text-align: center;
  font-weight: 700;
}

.detail-view {
  max-width: 1040px;
  margin: 0 auto;
}

.back-button {
  margin-bottom: 18px;
  padding: 9px 14px;
  color: var(--green-700);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.detail-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-media {
  overflow: hidden;
  border-radius: 8px;
  background: var(--green-100);
}

.detail-media .product-image,
.detail-media .product-placeholder {
  height: 100%;
  min-height: 360px;
  aspect-ratio: auto;
}

.detail-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-content h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.25;
}

.detail-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 18px;
}

.detail-price {
  color: var(--coral);
  font-size: 36px;
  font-weight: 900;
}

.detail-content p {
  margin: 0 0 22px;
  color: var(--muted);
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.detail-info-item {
  padding: 14px;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-info-item span,
.detail-info-item strong {
  display: block;
}

.detail-info-item span {
  color: var(--muted);
  font-size: 12px;
}

.detail-info-item strong {
  margin-top: 3px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 1000px) {
  .category-grid,
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    margin-bottom: 14px;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .nav-label {
    display: none;
  }

  .side-link {
    white-space: nowrap;
  }

  .shell {
    margin-left: 0;
    padding: 0 16px 40px;
  }

  .home-page .site-footer {
    margin-left: 0;
    padding-bottom: 80px;
  }

  .topbar {
    margin: 0 -16px 18px;
    padding: 0 16px;
  }

  .hero {
    min-height: 0;
    padding: 28px 20px;
    border-radius: 8px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-panel,
  .barter-grid,
  .article-grid,
  .category-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .detail-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .detail-media .product-image,
  .detail-media .product-placeholder {
    min-height: 240px;
  }

  .detail-content h1 {
    font-size: 26px;
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 28px 16px;
  }

  .footer-bottom {
    padding: 14px 16px;
  }

  .site-header-inner {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 16px;
  }

  .site-nav {
    order: 3;
    width: 100%;
  }

  .chat-widget {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 480px) {
  .crumb,
  .top-link {
    display: none;
  }

  .topbar {
    justify-content: flex-end;
  }

  .top-actions {
    gap: 6px;
  }

  .ghost-button,
  .primary-button {
    padding: 8px 11px;
    font-size: 13px;
  }

  .site-nav {
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
  }
}
