:root {
  --bg: #fbf8f3;
  --card: #ffffff;
  --ink: #241f1c;
  --dim: #8a817a;
  --accent: #e0475f;
  --accent-2: #b06ab3;
  --amber: #e8912a;
  --line: #ece5dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(36,31,28,.05), 0 6px 20px rgba(36,31,28,.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(251,248,243,.92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 800; font-size: 20px; letter-spacing: .5px; }
.logo span { color: var(--accent); }
.nav a { color: var(--dim); font-size: 14px; }
.nav a:hover { color: var(--accent); }

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

.hero { padding: 30px 4px 10px; }
.hero-tag {
  display: inline-block; margin: 0 0 10px;
  font-size: 12px; color: var(--accent); font-weight: 700;
  background: #fdeef0; border-radius: 999px; padding: 4px 12px;
}
.hero h1 { margin: 0; font-size: 30px; line-height: 1.25; letter-spacing: .5px; }
.hero-sub { margin: 10px 0 6px; color: #554c46; }
.hero-meta { margin: 0; color: var(--dim); font-size: 13px; }

.sec { margin-top: 34px; }
.sec-head { margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.sec-count {
  font-size: 12px; font-weight: 600; color: var(--dim);
  background: #f1ebe3; border-radius: 999px; padding: 1px 9px;
}
.sec-desc { margin: 4px 0 0; color: var(--dim); font-size: 13px; }

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  border: 1px solid #f4eee6;
}
.card-media { position: relative; display: block; aspect-ratio: 1 / 1; background: #f6f2ec; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.badge-official {
  position: absolute; left: 8px; top: 8px;
  font-size: 11px; font-weight: 700; color: #fff;
  border-radius: 6px; padding: 2px 7px;
}
.badge-official.is-official { background: var(--accent); }
.badge-official.is-other { background: rgba(60,52,46,.62); }
.badge-discount {
  position: absolute; right: 8px; top: 8px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--amber); border-radius: 6px; padding: 2px 7px;
}

.card-body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-title {
  margin: 0; font-size: 13.5px; line-height: 1.45; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.9em;
}
.card-shop { margin: 0; font-size: 12px; color: var(--dim); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ip { color: var(--accent-2); font-weight: 600; }
.shop { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.price-row { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.price { color: var(--accent); font-weight: 800; font-size: 19px; }
.price i { font-style: normal; font-size: 13px; margin-right: 1px; }
.orig { color: var(--dim); font-size: 12px; text-decoration: line-through; }
.coupon { color: var(--accent); font-size: 11px; border: 1px solid #f3c4cc; background: #fdeef0; border-radius: 5px; padding: 1px 6px; }

.card-actions { display: flex; gap: 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 8px 12px; font-family: inherit;
  transition: filter .15s, background .15s;
}
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn-primary { background: var(--accent); color: #fff; flex: 1; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: #f6f1ea; color: #5a5049; border-color: #ece2d6; }
.btn-ghost:hover { background: #efe7dc; }
.btn-block { width: 100%; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 720px) { .modal { align-items: center; } }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(30,24,20,.5); }
.modal-panel {
  position: relative; z-index: 1; background: #fff; width: 100%; max-width: 420px;
  border-radius: 18px 18px 0 0; padding: 22px 20px 24px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.18);
}
@media (min-width: 720px) { .modal-panel { border-radius: 18px; } }
.modal-x { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 18px; color: var(--dim); cursor: pointer; }
.modal-shop { margin: 0; font-size: 12px; color: var(--dim); }
.modal-title { margin: 2px 0 14px; font-size: 15px; font-weight: 700; line-height: 1.45; }
.pw-label { margin: 0 0 6px; font-size: 12px; color: var(--dim); }
.pw {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 19px; font-weight: 700; letter-spacing: 1px; text-align: center;
  background: #fdf3f5; color: var(--accent); border: 1px dashed #f0bfc8;
  border-radius: 10px; padding: 14px 8px; user-select: all; word-break: break-all;
}
.hint { font-size: 12px; color: var(--dim); margin: 10px 0 0; }
#bm-wx { color: var(--amber); }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }

.qr-panel { text-align: center; }
.qr-box { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 6px 0; }
.qr-box svg { width: 240px; height: 240px; display: block; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: rgba(36,31,28,.92); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.site-footer { border-top: 1px solid var(--line); padding: 24px 18px 40px; text-align: center; }
.disclaimer { margin: 0 auto 10px; max-width: 640px; color: var(--dim); font-size: 12px; line-height: 1.7; }
.copy { margin: 0; color: #b3aaa2; font-size: 12px; }

/* 扫码按钮仅桌面端（触屏设备隐藏，直接点链接/口令） */
@media (hover: none), (pointer: coarse) { .btn-qr { display: none; } }
