:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --ink: #1c1b19;
  --muted: #78756e;
  --line: #e6e3dc;
  --accent: #3f6b3a;
  --accent-soft: #eaf1e8;
  --danger: #b4352b;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ---------- 顶部 ---------- */
header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
header.site .brand {
  font-size: 17px; font-weight: 700; letter-spacing: .5px;
  color: var(--ink); text-decoration: none;
}
header.site .brand span { color: var(--accent); }
header.site nav a {
  font-size: 13px; color: var(--muted); text-decoration: none; margin-left: 16px;
}
header.site nav a:hover { color: var(--accent); }

/* ---------- 标题区 ---------- */
.hero { padding: 34px 0 26px; }
.hero h1 { font-size: 25px; font-weight: 700; letter-spacing: .3px; }
.hero p { font-size: 13.5px; color: var(--muted); margin-top: 7px; }

/* ---------- 商品网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  padding-bottom: 60px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(28,27,25,.09);
}
.card .thumb {
  aspect-ratio: 4 / 3;
  background: #efece6;
  overflow: hidden;
  position: relative;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb .noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #c3bdb1; font-size: 12px;
}
.card .body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card .name { font-size: 15px; font-weight: 650; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; }

.score {
  display: inline-flex; align-items: baseline; gap: 3px;
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft); color: var(--accent);
  padding: 3px 9px; border-radius: 7px;
  font-size: 13px; font-weight: 700;
}
.score small { font-size: 10px; font-weight: 500; opacity: .75; }

.price { font-size: 13px; color: var(--muted); }

/* ---------- 详情 ---------- */
.detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 30px 0 70px;
}
@media (max-width: 780px) {
  .detail { grid-template-columns: 1fr; gap: 20px; }
}
.detail .pic {
  border-radius: var(--radius);
  overflow: hidden;
  background: #efece6;
  border: 1px solid var(--line);
}
.detail .pic img { width: 100%; display: block; }
.detail h2 { font-size: 22px; font-weight: 700; }
.detail .sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

.spec {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.spec .row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.spec .row .k { color: var(--muted); flex: 0 0 auto; }
.spec .row .v { text-align: right; }

.note {
  margin-top: 16px;
  font-size: 13.5px;
  color: #43403a;
  white-space: pre-wrap;
}

.metrics {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.metrics h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.metrics .m {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 6px 0;
}
.metrics .m .mv { font-variant-numeric: tabular-nums; font-weight: 600; }

.disclaimer {
  margin-top: 14px;
  font-size: 11.5px;
  color: #9a958b;
  line-height: 1.7;
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

/* ---------- 表单（后台） ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.field { margin-bottom: 13px; }
.field label {
  display: block; font-size: 12px; color: var(--muted);
  margin-bottom: 5px; font-weight: 500;
}
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  background: #fdfcfa;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
textarea { resize: vertical; min-height: 72px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  padding: 9px 18px;
  transition: .15s;
}
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #33562f; }
.btn-ghost { background: #efece6; color: #514d45; }
.btn-ghost:hover { background: #e4e0d8; }
.btn-danger { background: #fbeae8; color: var(--danger); }
.btn-danger:hover { background: #f7dbd7; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }

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

/* ---------- 后台列表 ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th {
  text-align: left; color: var(--muted); font-weight: 600;
  padding: 8px 8px; border-bottom: 1px solid var(--line);
  font-size: 12px;
}
table.list td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:hover td { background: #fbfaf7; }
table.list .thumb-sm {
  width: 46px; height: 46px; border-radius: 7px; object-fit: cover;
  background: #efece6; display: block;
}

.msg {
  font-size: 13px; padding: 9px 12px; border-radius: 9px; margin-top: 12px;
  display: none;
}
.msg.show { display: block; }
.msg.ok { background: var(--accent-soft); color: var(--accent); }
.msg.err { background: #fbeae8; color: var(--danger); }

.hint { font-size: 11.5px; color: #9a958b; margin-top: 4px; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted); font-size: 14px;
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  font-size: 12px;
  color: #9a958b;
  text-align: center;
}
