/* ==========================================================================
   bbjp.cn 母婴好物精选 - 全站样式（响应式，移动优先）
   ========================================================================== */

:root {
  --primary: #E0557A;
  --primary-dark: #C13E60;
  --primary-soft: #FDEEF2;
  --accent: #F2822D;
  --accent-soft: #FFF3E6;
  --text: #2B2A28;
  --text-2: #6B6862;
  --text-3: #9C9890;
  --bg: #FAF8F6;
  --card: #FFFFFF;
  --line: #EDE9E4;
  --ok: #1D9E75;
  --warn: #D98A0B;
  --err: #D3453F;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(43, 42, 40, .06);
  --shadow-hover: 0 6px 18px rgba(43, 42, 40, .10);
  --max: 1200px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 10px; }
ul { margin: 0; padding-left: 20px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 14px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- 头部 ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; gap: 12px;
  height: 56px;
}
.logo { display: flex; align-items: center; gap: 8px; flex: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.logo-text { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.logo-text small { display: block; font-size: 10px; color: var(--text-3); font-weight: 400; letter-spacing: 0; margin-top: -3px; }

.header-search { flex: 1; max-width: 420px; margin-left: auto; }
.header-search form { display: flex; position: relative; }
.header-search input {
  width: 100%; height: 36px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--bg);
  padding: 0 40px 0 15px; font-size: 14px; color: var(--text);
  outline: none; transition: .2s;
}
.header-search input:focus { border-color: var(--primary); background: #fff; }
.header-search button {
  position: absolute; right: 2px; top: 2px;
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: transparent; color: var(--text-3); cursor: pointer; font-size: 15px;
}
.header-search button:hover { color: var(--primary); }

/* ---------- 分类导航条 ---------- */
.cat-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-bar-inner {
  display: flex; gap: 4px; max-width: var(--max);
  margin: 0 auto; padding: 0 14px; height: 44px; align-items: center;
  white-space: nowrap;
}
.cat-bar a {
  flex: none; padding: 6px 13px; border-radius: 16px;
  font-size: 14px; color: var(--text-2); transition: .15s;
}
.cat-bar a:hover { background: var(--primary-soft); color: var(--primary); }
.cat-bar a.on { background: var(--primary); color: #fff; }

/* ---------- 主体 ---------- */
main { padding: 18px 0 40px; min-height: 60vh; }

.section-title {
  display: flex; align-items: baseline; gap: 10px;
  margin: 26px 0 14px;
}
.section-title h2 { font-size: 18px; }
.section-title .more { margin-left: auto; font-size: 13px; color: var(--text-3); }
.section-title .more:hover { color: var(--primary); }
.section-title:first-child { margin-top: 4px; }

/* ---------- 商品网格 ---------- */
.goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.goods-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.goods-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.goods-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #F4F2EF;
  overflow: hidden;
}
.goods-thumb img { width: 100%; height: 100%; object-fit: cover; }
.goods-thumb .tag {
  position: absolute; left: 0; top: 0;
  background: var(--primary); color: #fff;
  font-size: 11px; padding: 2px 7px; border-radius: 0 0 8px 0;
}
.goods-thumb .tag-hot { background: var(--accent); }

.goods-body { padding: 9px 10px 11px; display: flex; flex-direction: column; flex: 1; }

.goods-title {
  font-size: 13.5px; line-height: 1.45; font-weight: 400;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 38px;
  margin-bottom: 6px;
}

.goods-price-row { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.price {
  color: var(--primary); font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.price .rmb { font-size: 12px; font-weight: 500; margin-right: 1px; }
.price-old { color: var(--text-3); font-size: 12px; text-decoration: line-through; }

.goods-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 6px; font-size: 11.5px; color: var(--text-3);
  flex-wrap: wrap;
}
.pf {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 11px; line-height: 1.5; white-space: nowrap;
}
.pf-jd    { background: #FDECEC; color: #C6312C; }
.pf-tb    { background: #FFF0E6; color: #D2660F; }
.pf-pdd   { background: #FDEAEA; color: #C93A3A; }
.pf-vip   { background: #FBEAF0; color: #B93B6E; }
.pf-dy    { background: #E9E9EC; color: #33333A; }
.pf-other { background: #F1EFEC; color: var(--text-2); }

.coupon {
  display: inline-block; margin-top: 6px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px dashed #F5C08A; border-radius: 4px;
  font-size: 11.5px; padding: 1px 6px;
}

.goods-btn {
  display: block; text-align: center;
  margin-top: 9px; height: 32px; line-height: 32px;
  background: var(--primary); color: #fff;
  border-radius: 16px; font-size: 13px;
  transition: background .2s;
}
.goods-btn:hover { background: var(--primary-dark); }

/* ---------- 首页横幅 ---------- */
.hero {
  background: linear-gradient(135deg, #FDEEF2 0%, #FFF3E6 100%);
  border-radius: var(--radius);
  padding: 26px 22px;
  margin-bottom: 8px;
}
.hero h1 { font-size: 20px; margin-bottom: 8px; }
.hero p { color: var(--text-2); font-size: 14px; margin: 0; }
.hero-stats { display: flex; gap: 22px; margin-top: 16px; flex-wrap: wrap; }
.hero-stats div { font-size: 12px; color: var(--text-2); }
.hero-stats strong { display: block; font-size: 19px; color: var(--primary); font-weight: 700; }

/* ---------- 类目块 ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: 10px;
}
.cat-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 6px; text-align: center; font-size: 13px;
  transition: .18s;
}
.cat-item:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.cat-item .ico { font-size: 22px; display: block; margin-bottom: 5px; }

/* ---------- 页面标题 ---------- */
.page-head { margin: 6px 0 16px; }
.page-head h1 { font-size: 20px; margin-bottom: 6px; }
.page-head .desc { color: var(--text-2); font-size: 13.5px; margin: 0; }
.crumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.crumb a:hover { color: var(--primary); }

/* ---------- 排序条 ---------- */
.sort-bar {
  display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
  align-items: center;
}
.sort-bar a {
  padding: 5px 12px; border-radius: 14px; font-size: 13px;
  background: #fff; border: 1px solid var(--line); color: var(--text-2);
}
.sort-bar a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.sort-bar .count { margin-left: auto; font-size: 12.5px; color: var(--text-3); }

/* ---------- 商品详情 ---------- */
.detail { display: grid; grid-template-columns: 1fr; gap: 20px; }
.detail-media { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.detail-media img { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #F4F2EF; }
.detail-info h1 { font-size: 18px; line-height: 1.5; margin-bottom: 10px; }
.detail-price-box {
  background: linear-gradient(135deg, #FDEEF2, #FFF3E6);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
}
.detail-price-box .price { font-size: 30px; }
.detail-price-box .sub { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.detail-attrs { display: grid; gap: 8px; margin-bottom: 16px; font-size: 13.5px; }
.detail-attrs div { display: flex; gap: 12px; }
.detail-attrs .k { color: var(--text-3); width: 72px; flex: none; }
.detail-attrs .v { color: var(--text); }
.buy-btn {
  display: block; text-align: center; height: 46px; line-height: 46px;
  background: var(--primary); color: #fff; border-radius: 23px;
  font-size: 16px; font-weight: 600; border: none; width: 100%; cursor: pointer;
  transition: .2s;
}
.buy-btn:hover { background: var(--primary-dark); }
.disclosure {
  margin-top: 12px; font-size: 12px; color: var(--text-3);
  background: #F6F4F1; border-radius: var(--radius-sm); padding: 9px 12px;
}
.detail-summary { font-size: 14px; color: var(--text-2); margin-bottom: 14px; }

@media (min-width: 760px) {
  .detail { grid-template-columns: 400px 1fr; gap: 28px; }
  .detail-media { position: sticky; top: 76px; }
}

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin: 26px 0 8px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 34px; height: 34px; line-height: 32px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 13.5px; padding: 0 7px; color: var(--text-2);
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .gap { border: none; background: transparent; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-3);
  background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
}
.empty .ico { font-size: 40px; margin-bottom: 10px; }

/* ---------- 按钮 / 表单 ---------- */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 14px; cursor: pointer; transition: .18s; text-align: center;
}
.btn:hover { border-color: var(--text-3); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { background: #fff; border-color: #F0BFBD; color: var(--err); }
.btn-danger:hover { background: #FDF2F1; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 14px; font-size: 14px; }
.alert p:last-child { margin-bottom: 0; }
.alert-ok  { background: #E9F7F1; color: #116249; border: 1px solid #B7E4D3; }
.alert-warn{ background: #FFF6E7; color: #8A5A06; border: 1px solid #F5DCA9; }
.alert-err { background: #FDEFEE; color: #9C2A25; border: 1px solid #F3C9C6; }
.alert-info{ background: #EFF3FB; color: #2C4E8A; border: 1px solid #CCD9F0; }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.form-card label { display: block; margin-bottom: 16px; }
.form-card label > span { display: block; font-size: 13.5px; color: var(--text-2); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=url],
input[type=email], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  background: #fff; font-family: inherit; outline: none; transition: .18s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 620px) { .form-row-2 { grid-template-columns: 1fr 1fr; } .form-row-3 { grid-template-columns: 1fr 1fr 1fr; } }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; display: block; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: #fff;
  padding: 24px 0 30px; margin-top: 30px;
  font-size: 12.5px; color: var(--text-3); text-align: center;
}
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--primary); }
.site-footer .fb-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.site-footer .fb-disc { max-width: 620px; margin: 0 auto 10px; line-height: 1.7; }

/* ---------- 安装页 ---------- */
.page-install { background: #F3F1EE; }
.install-wrap { max-width: 460px; margin: 0 auto; padding: 60px 18px; }
.install-wrap h1 { font-size: 20px; margin-bottom: 18px; text-align: center; }

/* ==========================================================================
   后台
   ========================================================================== */
.admin-body { background: #F4F2EF; }
.admin-top {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 60;
}
.admin-top-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 16px;
  height: 54px; display: flex; align-items: center; gap: 16px;
}
.admin-top .brand { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.admin-top .brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.admin-top nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.admin-top nav::-webkit-scrollbar { display: none; }
.admin-top nav a {
  padding: 6px 12px; border-radius: 7px; font-size: 13.5px;
  color: var(--text-2); white-space: nowrap;
}
.admin-top nav a:hover { background: var(--primary-soft); color: var(--primary); }
.admin-top nav a.on { background: var(--primary); color: #fff; }
.admin-top .user { margin-left: auto; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 10px; }

.admin-main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 60px; }
.admin-h1 { font-size: 19px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-h1 .btn { margin-left: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; }
.stat-card .lb { font-size: 12.5px; color: var(--text-3); margin-bottom: 5px; }
.stat-card .nb { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .nb.money { color: var(--primary); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.panel-head {
  padding: 13px 17px; border-bottom: 1px solid var(--line);
  font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 12px;
}
.panel-head .btn { margin-left: auto; }
.panel-body { padding: 17px; }

.tbl-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { background: #FAF9F7; font-weight: 600; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
table.data tr:hover td { background: #FCFBFA; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .thumb { width: 46px; height: 46px; border-radius: 7px; object-fit: cover; background: #F4F2EF; }
table.data .t-title { max-width: 300px; }
table.data .t-title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ops { display: flex; gap: 6px; white-space: nowrap; }
.ops a { font-size: 13px; color: #2C5FA8; }
.ops a:hover { text-decoration: underline; }
.ops a.del { color: var(--err); }

.badge { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 4px; }
.badge-on  { background: #E9F7F1; color: #116249; }
.badge-off { background: #F1EFEC; color: var(--text-3); }
.badge-rec { background: var(--primary-soft); color: var(--primary); }

.admin-login { max-width: 360px; margin: 0 auto; padding: 80px 18px; }
.admin-login h1 { font-size: 19px; text-align: center; margin-bottom: 6px; }
.admin-login .sub { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 22px; }

@media (max-width: 600px) {
  .header-search { max-width: none; }
  .logo-text small { display: none; }
  .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .goods-title { font-size: 13px; }
  .price { font-size: 16px; }
  .hero { padding: 20px 16px; }
  .hero h1 { font-size: 17px; }
  .wrap { padding: 0 10px; }
}

/* ==========================================================================
   后台 · 选品采集
   ========================================================================== */
.lbl { display: block; font-size: 13.5px; color: var(--text-2); margin-bottom: 6px; }

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.pick-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pick-card.exists { border-color: #E7D9B8; background: #FFFCF5; }

.pick-check { position: absolute; top: 8px; left: 8px; z-index: 2; }
.pick-check input { width: 17px; height: 17px; cursor: pointer; }

.pick-score {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 12px; font-weight: 500; line-height: 1;
  padding: 4px 7px; border-radius: 20px;
}
.pick-score-hi  { background: #E9F7F1; color: #116249; }
.pick-score-mid { background: var(--accent-soft); color: #95590C; }
.pick-score-lo  { background: #F1EFEC; color: var(--text-3); }

.pick-thumb {
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 6px; overflow: hidden; background: #F6F4F1;
}
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pick-title {
  font-size: 13px; line-height: 1.5; min-height: 39px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.pick-price { display: flex; align-items: baseline; gap: 7px; }
.pick-price strong { color: var(--primary); font-size: 16px; }
.pick-price s { color: var(--text-3); font-size: 12.5px; }

.pick-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-block; font-size: 11.5px; line-height: 1.6; padding: 1px 6px; border-radius: 4px; }
.tag-coupon { background: var(--primary-soft); color: var(--primary-dark); }
.tag-pf     { background: #EEF2F7; color: #44586E; }
.tag-exists { background: #F5EBD9; color: #8A6412; }

.pick-meta { font-size: 12px; line-height: 1.75; color: var(--text-2); border-top: 1px dashed var(--line); padding-top: 7px; }
.pick-meta .c-comm { color: var(--ok); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 600px) {
  .pick-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pick-title { font-size: 12.5px; }
}
