:root {
  --jd: #e1251b;
  --jd-dark: #c1170e;
  --ink: #1b1f24;
  --mid: #5a6472;
  --line: #e8ebf0;
  --bg: #f6f7fa;
  --card: #fff;
  --ok: #0a8f4e;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1180px, 100% - 32px); margin: 0 auto; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--jd); box-shadow: 0 0 0 4px rgba(225, 37, 27, .12); }
.tabs { display: flex; gap: 6px; margin-left: auto; }
.tab {
  padding: 7px 16px; border-radius: 999px; color: var(--mid);
  text-decoration: none; font-weight: 600; transition: .15s; white-space: nowrap;
}
.tab:hover { background: #f1f2f5; color: var(--ink); }
.tab.on { background: var(--jd); color: #fff; }

/* 头部信息 */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 26px 0 14px; }
.hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.3px; }
.hero h1 small { margin-left: 10px; font-size: 13px; font-weight: 500; color: var(--mid); }
.sub { margin: 0; color: var(--mid); font-size: 13px; }
.sub b { color: var(--ink); }
.badge {
  margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: #eef7f1; color: var(--ok); font-size: 12px; font-weight: 600;
}
.badge.warn { background: #fff5e8; color: #b26a00; }
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 10px;
  background: var(--jd); color: #fff; font-weight: 600; text-decoration: none;
  box-shadow: 0 6px 16px rgba(225, 37, 27, .22); white-space: nowrap;
}
.btn:hover { background: var(--jd-dark); }

/* 分类 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.chip {
  padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: var(--mid); text-decoration: none; font-weight: 500; transition: .15s;
}
.chip em { margin-left: 6px; font-style: normal; font-size: 11px; color: #a7aeb9; }
.chip:hover { border-color: #d7dbe3; color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on em { color: rgba(255, 255, 255, .6); }

/* 表格 */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { padding: 12px 14px; text-align: left; vertical-align: middle; }
.grid thead th {
  background: #fbfbfd; font-size: 12px; font-weight: 600; color: var(--mid);
  letter-spacing: .3px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid tbody tr { border-bottom: 1px solid #f2f4f7; }
.grid tbody tr:last-child { border-bottom: 0; }
.grid tbody tr:hover { background: #fcfcfe; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-rank { width: 58px; text-align: center; }
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: #f1f2f5; color: var(--mid); font-weight: 700; font-size: 12px;
}
.rank.r1 { background: linear-gradient(135deg, #ffb020, #ff7a00); color: #fff; }
.rank.r2 { background: linear-gradient(135deg, #b9c3cf, #8b98a8); color: #fff; }
.rank.r3 { background: linear-gradient(135deg, #d9a06a, #b9773f); color: #fff; }

.c-goods { min-width: 340px; }
.goods { display: flex; gap: 12px; align-items: center; }
.goods img {
  width: 54px; height: 54px; border-radius: 10px; object-fit: cover;
  background: #f1f2f5; border: 1px solid var(--line); flex: none;
}
.goods-txt { min-width: 0; }
.gname {
  font-weight: 600; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.gsub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; align-items: center; }
.tag {
  padding: 1px 7px; border-radius: 6px; background: #fff1f0; color: var(--jd);
  font-size: 11px; font-weight: 600;
}
.iid { font-size: 11px; color: #a7aeb9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.rate { color: var(--jd); }
.com { color: #d4380d; font-size: 15px; }
.coupon { color: var(--jd); font-weight: 600; }
.quota { margin-left: 4px; font-size: 11px; color: var(--mid); }
.good { display: block; font-size: 12px; color: var(--mid); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 18px 0 8px; }
.pg {
  min-width: 34px; padding: 7px 12px; border-radius: 9px; text-align: center;
  background: #fff; border: 1px solid var(--line); color: var(--mid);
  text-decoration: none; font-weight: 600; font-size: 13px;
}
.pg:hover { border-color: #d7dbe3; color: var(--ink); }
.pg.on { background: var(--jd); border-color: var(--jd); color: #fff; }
.pg.off { opacity: .4; pointer-events: none; }
.pg.gap { border: 0; background: none; }
.pginfo { margin-left: auto; color: var(--mid); font-size: 12px; }

.note { color: #8b939f; font-size: 12px; margin: 10px 0 40px; }
.sec-title { font-size: 15px; margin: 34px 0 12px; }
.empty { padding: 60px; text-align: center; color: var(--mid); background: #fff; border-radius: var(--radius); }

/* 首页卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  display: block; padding: 22px; border-radius: var(--radius); background: var(--card);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: .18s; position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(20, 30, 50, .08); border-color: #dfe3ea; }
.card-k { font-size: 11px; font-weight: 700; color: var(--jd); letter-spacing: .4px; }
.card h2 { margin: 6px 0 4px; font-size: 20px; }
.card p { margin: 0 0 14px; color: var(--mid); font-size: 13px; }
.card-go { font-weight: 600; color: var(--jd); font-size: 13px; }

/* 错误 */
.alert {
  background: #fff; border: 1px solid #ffd8d4; border-left: 4px solid var(--jd);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 30px;
}
.alert h2 { margin: 0 0 8px; font-size: 16px; color: var(--jd); }
.alert .code { font-family: ui-monospace, Menlo, monospace; color: var(--ink); margin: 0 0 8px; }
.hint { color: var(--mid); font-size: 13px; margin: 0; padding-left: 18px; }
.hint code { background: #f4f5f8; padding: 1px 5px; border-radius: 5px; font-size: 12px; }

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 20px 0 34px; color: #9aa2ae; font-size: 12px; border-top: 1px solid var(--line);
}

@media (max-width: 860px) {
  .topbar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
  .tabs { margin-left: 0; width: 100%; overflow-x: auto; }
  .hero { flex-direction: column; align-items: flex-start; }
  .c-goods { min-width: 240px; }
  .grid th:nth-child(7), .grid td:nth-child(7),
  .grid th:nth-child(8), .grid td:nth-child(8) { display: none; }
}

/* ================= 消费者版（deals.php） ================= */
.c-body { background: #f5f6f8; }
.c-top {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, #fff, #fff 70%, rgba(255, 255, 255, .92));
  border-bottom: 1px solid var(--line);
}
.c-top-inner { display: flex; align-items: center; gap: 14px; height: 58px; }
.c-brand {
  display: flex; align-items: center; gap: 9px;
  font-size: 17px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -.2px;
}
.c-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; background: var(--jd); color: #fff;
  font-size: 14px; font-weight: 800;
}
.c-slogan { color: var(--mid); font-size: 12px; }

.c-hero { padding: 22px 0 4px; }
.c-hero h1 { margin: 0; font-size: 24px; letter-spacing: -.4px; }
.c-hero h1 small {
  margin-left: 10px; padding: 2px 10px; border-radius: 8px;
  background: #fff1f0; color: var(--jd); font-size: 12px; font-weight: 600; vertical-align: 3px;
}
.c-sub { margin: 6px 0 14px; color: var(--mid); font-size: 13px; }

.c-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 16px; }
.c-tab {
  padding: 12px 16px; border-radius: var(--radius); background: #fff;
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: .16s;
}
.c-tab b { display: block; font-size: 15px; }
.c-tab small { display: block; margin-top: 2px; color: var(--mid); font-size: 12px; }
.c-tab:hover { border-color: #dfe3ea; box-shadow: 0 8px 18px rgba(20, 30, 50, .05); }
.c-tab.on { background: var(--jd); border-color: var(--jd); color: #fff; box-shadow: 0 10px 22px rgba(225, 37, 27, .22); }
.c-tab.on small { color: rgba(255, 255, 255, .82); }

.c-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 14px; margin-bottom: 6px; }
.pcard {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; transition: .18s;
}
.pcard:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(20, 30, 50, .1); border-color: #e2e6ec; }
.pcard-media { position: relative; aspect-ratio: 1 / 1; background: #fafbfc; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pno {
  position: absolute; top: 10px; left: 10px;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20, 24, 30, .55); color: #fff; font-size: 12px; font-weight: 700;
  backdrop-filter: blur(4px);
}
.pno.top1 { background: linear-gradient(135deg, #ffb020, #ff7a00); }
.pno.top2 { background: linear-gradient(135deg, #b9c3cf, #8b98a8); }
.pno.top3 { background: linear-gradient(135deg, #d9a06a, #b9773f); }
.pcoupon {
  position: absolute; right: 10px; bottom: 10px; padding: 3px 9px; border-radius: 8px;
  background: var(--jd); color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(225, 37, 27, .3);
}
.pcard-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pname {
  margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.45; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px;
}
.ptags { display: flex; flex-wrap: wrap; gap: 5px; }
.pfoot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pprice { color: var(--jd); display: flex; align-items: baseline; gap: 1px; }
.pprice .cur { font-size: 13px; font-weight: 700; }
.pprice .num { font-size: 23px; font-weight: 800; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.pprice .pnote { margin-left: 5px; font-size: 11px; color: var(--mid); font-weight: 500; }
.pmeta { font-size: 11.5px; color: #9aa2ae; white-space: nowrap; }
.pquota { font-size: 11.5px; color: #b26a00; background: #fff8ec; border-radius: 7px; padding: 3px 8px; align-self: flex-start; }

.c-alert {
  background: #fff; border: 1px solid #ffd8d4; border-left: 4px solid var(--jd);
  border-radius: var(--radius); padding: 18px 20px;
}
.c-alert b { color: var(--jd); }
.c-alert p { margin: 6px 0 0; color: var(--mid); font-size: 13px; }

@media (max-width: 720px) {
  .c-tabs { grid-template-columns: 1fr; }
  .c-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pcard-body { padding: 10px 10px 12px; }
  .pprice .num { font-size: 19px; }
  .c-slogan { display: none; }
}

/* 商品卡可点击（转链长链接） */
a.pcard { color: inherit; text-decoration: none; }
.pcard .pgo { font-size: 12px; font-weight: 700; color: var(--jd); }
a.pcard:hover .pgo { text-decoration: underline; }
a.pcard:focus-visible { outline: 2px solid var(--jd); outline-offset: 2px; }

/* 搜索 */
.c-search { display: flex; gap: 8px; margin: 6px 0 16px; max-width: 620px; }
.c-input {
  flex: 1; min-width: 0; padding: 11px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-size: 14px; color: var(--ink); outline: none; transition: .15s;
}
.c-input::placeholder { color: #a7aeb9; }
.c-input:focus { border-color: var(--jd); box-shadow: 0 0 0 3px rgba(225, 37, 27, .12); }
.c-btn {
  padding: 0 22px; border: 0; border-radius: 12px; background: var(--jd); color: #fff;
  font-weight: 700; font-size: 14px; cursor: pointer; transition: .15s;
}
.c-btn:hover { background: var(--jd-dark); }
.c-clear { align-self: center; color: var(--mid); font-size: 13px; text-decoration: none; white-space: nowrap; }
.c-clear:hover { color: var(--jd); }
.c-result {
  margin: 0 0 14px; padding: 10px 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; color: var(--mid); font-size: 13px;
}
.c-result b { color: var(--jd); }
mark { background: #fff3c4; color: inherit; padding: 0 1px; border-radius: 3px; }


/* 消费者版品牌点 */
.c-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--jd); flex: none;
  box-shadow: 0 0 0 4px rgba(225, 37, 27, .12);
}
