:root {
  --ink: #102219;
  --muted: #6d7871;
  --green: #176b45;
  --green-dark: #0d4a31;
  --lime: #d6f26f;
  --cream: #f5f7f1;
  --line: #dde5dc;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.topbar {
  height: 78px;
  padding: 0 max(24px, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(16, 34, 25, 0.08);
  position: relative;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  object-fit: cover;
}

.brand > span > span { color: var(--green); }

.nav-links {
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 36px;
}

.nav-links a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  border-bottom: 2px solid transparent;
}

.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--green);
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e4eedf;
  color: var(--green-dark);
  background-size: cover;
  background-position: center;
  font-weight: 800;
}

.logout-button {
  height: 38px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  color: #526159;
  font: 700 13px "DM Sans", sans-serif;
  cursor: pointer;
}

.logout-button svg { width: 16px; fill: currentColor; }

.market-header {
  min-height: 260px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: end;
  gap: 40px;
  padding: 48px max(24px, calc((100% - 1180px) / 2));
  background:
    radial-gradient(circle at 88% 22%, rgba(214, 242, 111, 0.72), transparent 18%),
    linear-gradient(135deg, #edf4e7 0%, #fafbf7 82%);
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-kicker {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.market-header h1 {
  margin: 12px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(44px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -3.5px;
}

.market-header h1 em {
  color: var(--green);
  font-style: normal;
}

.market-header > p {
  max-width: 390px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.catalog {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.catalog-toolbar {
  margin-bottom: 24px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.catalog-toolbar h2 {
  margin: 6px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 28px;
  letter-spacing: -1px;
}

.filters {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.filter {
  height: 36px;
  padding: 0 15px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 700 12px "DM Sans", sans-serif;
  cursor: pointer;
}

.filter.active {
  background: var(--green);
  color: white;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.product {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 10px 30px rgba(31, 53, 40, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 38px rgba(31, 53, 40, 0.09);
}

.product[hidden] { display: none; }

.product-art {
  height: 150px;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 85% 20%, rgba(214, 242, 111, 0.8), transparent 20%),
    linear-gradient(135deg, #edf4e7, #dde9d7);
  border-bottom: 1px solid var(--line);
}

.official-art {
  background:
    radial-gradient(circle at 85% 20%, rgba(214, 242, 111, 0.85), transparent 20%),
    linear-gradient(135deg, #e5eedf, #cfdcc9);
}

.status-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.86);
  color: #526159;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.status-badge.verified {
  background: var(--lime);
  color: var(--green-dark);
}

.wechat-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 7px solid rgba(255,255,255,0.7);
  border-radius: 23px;
  background: var(--green);
  color: white;
  box-shadow: 0 16px 28px rgba(23, 107, 69, 0.18);
  font-family: "Manrope", sans-serif;
  font-size: 31px;
  font-weight: 800;
  transform: rotate(-4deg);
}

.product-body { padding: 18px; }

.product-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a6b2aa;
}

.product h3 {
  min-height: 43px;
  margin: 10px 0 5px;
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.product p {
  min-height: 36px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.product-footer {
  margin-top: 16px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.product-footer strong {
  font-family: "Manrope", sans-serif;
  font-size: 21px;
  letter-spacing: -0.5px;
}

.buy-button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font: 800 12px "DM Sans", sans-serif;
  cursor: pointer;
  transition: 0.18s ease;
}

.buy-button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

footer {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px max(24px, calc((100% - 1180px) / 2));
  background: #102219;
  color: white;
}

footer p { color: #9cad9f; font-size: 12px; }
.footer-brand img { width: 34px; height: 34px; }
.footer-brand > span > span { color: var(--lime); }

.toast {
  max-width: calc(100% - 32px);
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translate(-50%, 30px);
  padding: 14px 18px;
  border-radius: 9px;
  background: #102219;
  color: white;
  box-shadow: 0 12px 35px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  font-size: 13px;
  font-weight: 700;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .market-header { grid-template-columns: 1fr 0.7fr; }
}

@media (max-width: 700px) {
  .topbar { height: 68px; }
  .brand { font-size: 17px; }
  .brand img { width: 34px; height: 34px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 12px; }
  .logout-button span { display: none; }
  .logout-button { width: 38px; padding: 0; justify-content: center; }
  .avatar { display: none; }

  .market-header {
    min-height: 230px;
    grid-template-columns: 1fr;
    gap: 16px;
    align-content: center;
  }
  .market-header h1 { font-size: 44px; letter-spacing: -2.5px; }
  .market-header > p { margin: 0; }

  .catalog-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .filters { width: 100%; }
  .filter { flex: 1; }
  footer { align-items: flex-start; flex-direction: column; gap: 16px; }
  footer p { margin: 0; }
}

@media (max-width: 520px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
  .nav-links { gap: 10px; }
  .nav-links a { font-size: 11px; }
  .brand { gap: 7px; }
  .brand img { width: 31px; height: 31px; }

  .market-header { padding: 38px 20px; }
  .market-header h1 { font-size: 38px; }
  .catalog { padding: 38px 16px 56px; }
  .catalog-toolbar h2 { font-size: 24px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-art { height: 140px; }
  .product h3 { min-height: 0; }
  .product p { min-height: 0; }
}
