:root {
  --bg: #f3efe6;
  --ink: #1f1b16;
  --muted: #6f675e;
  --line: #e3dcd0;
  --card: #fffaf3;
  --accent: #0c6b4f;
  --accent-ink: #f4fff9;
  --price: #9a3412;
  --danger: #9f2d2d;
  --shadow: 0 10px 30px rgba(60, 42, 20, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 280px at 10% -10%, rgba(12, 107, 79, 0.08), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(243, 239, 230, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #0c6b4f;
}
.search { display: flex; flex: 1; max-width: 460px; }
.search input, .field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
.search input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
}
.search button, .btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
}
.search button { flex: 0 0 auto; white-space: nowrap; border-radius: 0 10px 10px 0; margin-left: -1px; }
.card { display: flex; flex-direction: column; }
.btn.ghost, .btn.danger {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.danger { color: var(--danger); }
.btn.small, nav button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}
.btn:disabled { opacity: 0.55; cursor: default; }
nav { display: flex; align-items: center; gap: 14px; margin-left: auto; }
nav a { position: relative; }
nav em {
  position: absolute;
  top: -8px;
  right: -12px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--price);
  color: white;
  font-style: normal;
  font-size: 11px;
  text-align: center;
}
.who { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; }
.who small { color: var(--accent); }

main { width: min(1080px, calc(100% - 36px)); margin: 22px auto 48px; }
footer {
  width: min(1080px, calc(100% - 36px));
  margin: 8px auto 0;
  padding: 18px 0 32px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
footer p { margin: 2px 0; }
footer a { color: inherit; }
footer a:hover { color: var(--accent); }

.hero {
  position: relative;
  margin-bottom: 18px;
  min-height: 220px;
  padding: 36px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(255, 252, 247, 0.9) 0%, rgba(255, 252, 247, 0.42) 40%, rgba(255, 252, 247, 0.08) 72%),
    url("/hero-bg.jpg") right center / cover no-repeat;
}
.hero h1 { margin: 0 0 12px; }
.brand { display: block; height: 78px; width: auto; }
.hero p, .muted { color: var(--muted); }
.hero p { max-width: 28em; color: #3c463f; }
.filters { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
}
.chip.on { background: var(--ink); color: #fffaf3; border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-2px); }
.card .pad { display: flex; flex-direction: column; flex: 1; padding: 12px 14px 14px; }
.card strong { font-size: 16px; line-height: 1.35; }
.summary {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag {
  max-width: 100%;
  font-size: 12px;
  line-height: 1.4;
  color: var(--accent);
  background: #e7f3ee;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tag.soft { color: var(--ink); background: #f3efe6; }
.foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: auto; }
.foot .price { font-size: 16px; }
.foot .meta { text-align: right; }
.cover {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  color: #fffaf3;
  background:
    radial-gradient(circle at 18% 18%, hsl(var(--h) 75% 68% / 0.95), transparent 46%),
    linear-gradient(155deg, hsl(var(--h) 42% 38%), hsl(var(--h) 32% 18%));
}
.cover b { font-size: 42px; font-family: Palatino, "Songti SC", serif; line-height: 1; }
.cover small { align-self: flex-start; background: rgba(255,255,255,0.16); border-radius: 999px; padding: 2px 8px; }
.price { color: var(--price); font-variant-numeric: tabular-nums; font-size: 18px; }
.meta { color: var(--muted); font-size: 13px; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.facts div { background: #f7f1e6; border-radius: 12px; padding: 10px 12px; }
.facts small { display: block; color: var(--muted); font-size: 12px; }
.facts b { display: block; font-weight: 650; line-height: 1.4; }
.brief h2 { margin: 0 0 4px; font-size: 13px; font-weight: 650; color: var(--muted); }
.brief p { margin: 0 0 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.detail { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.detail .cover { width: 100%; max-width: 100%; aspect-ratio: 1; min-height: 0; border-radius: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; background: #fff; }
.stepper span { min-width: 28px; text-align: center; }

.panel, .auth, .order {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.auth { width: min(420px, 100%); margin: 24px auto; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field textarea { min-height: 90px; resize: vertical; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { background: #f7f1e6; border-radius: 12px; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.trades { display: flex; gap: 8px; overflow: auto; padding-bottom: 4px; }
.trades span {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--muted);
}

.cart-line, .mine-line, .order { margin-bottom: 12px; }
.cart-line, .mine-line {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
}
.cart-line .cover, .mine-line .cover { aspect-ratio: 1; border-radius: 10px; padding: 8px; }
.cart-line .cover b, .mine-line .cover b { font-size: 24px; }
.order-head, .split { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.pill { border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #efe7da; }
.pill.PAID { background: #e7f5ee; color: var(--accent); }
.pill.SHIPPED { background: #e7eef8; color: #1d4e89; }
.pill.DONE { background: #eceae4; }
.pill.CANCELLED { background: #f8e8e8; color: var(--danger); }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.error { color: var(--danger); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fffaf3;
  padding: 10px 14px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .hero { min-height: 180px; padding: 22px 16px 18px; background-position: center; }
  .brand { height: 58px; }
  .top { flex-wrap: wrap; padding: 12px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .detail, .cart-line, .mine-line, .facts, .form-grid { grid-template-columns: 1fr; }
  nav { gap: 10px; }
}
