/* 真好社区团购 - 轻快电商风（移动端优先） */
:root{
  --bg:#f5f5f5;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --pri:#ff5000;
  --pri2:#ff7a18;
  --ok:#16a34a;
  --warn:#f59e0b;
  --danger:#ef4444;
  --line:rgba(0,0,0,.08);
  --shadow:0 8px 24px rgba(0,0,0,.06);
  --radius:16px;
}
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "PingFang SC","Microsoft YaHei", sans-serif;
  background: var(--bg);
  color:var(--text);
  min-height:100vh;
  padding-bottom: 76px; /* bottom tab */
}
a{ color:var(--pri); text-decoration:none; }
.container{ max-width: 1080px; margin:0 auto; padding: 12px; }

.topbar{
  position:sticky; top:0; z-index:20;
  background: #fff;
  border-bottom:1px solid var(--line);
}
.topbar .inner{
  max-width:1080px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 12px; gap:10px;
}
.brand{ display:flex; flex-direction:column; gap:2px; }
.brand b{ font-size:16px; letter-spacing:.2px; }
.brand span{ color:var(--muted); font-size:12px; }

.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card .hd{ padding: 12px 12px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.card .bd{ padding: 0 12px 12px; }

.muted{ color: var(--muted); font-size: 13px; }
.small{ font-size:12px; }
.hr{ border:0; border-top:1px solid var(--line); margin: 12px 0; }

.btn{
  border:0; outline:0; cursor:pointer;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 800;
  background: rgba(255,80,0,.10);
  color: #b42318;
  border:1px solid rgba(255,80,0,.22);
}
.btn:hover{ filter: brightness(1.02); }
.btn.pri{ background: linear-gradient(135deg, var(--pri), var(--pri2)); color:#fff; border-color: rgba(255,80,0,0); }
.btn.ghost{ background: #fff; border-color: var(--line); color: var(--text); }

.input, select, textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline:none;
}
label{ display:block; margin:10px 0 6px; color: var(--muted); font-size:13px; }

.searchbar{ display:flex; gap:10px; align-items:center; }
.searchbar .input{ height: 42px; }

.notice{
  padding: 12px 12px;
  background: rgba(255,80,0,.06);
  border:1px solid rgba(255,80,0,.14);
  border-radius: 12px;
  color: #7a2e00;
  font-size: 13px;
}
.success{
  padding: 12px 12px;
  background: rgba(22,163,74,.08);
  border:1px solid rgba(22,163,74,.16);
  border-radius: 12px;
  color: #14532d;
  font-size: 13px;
}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 900px){
  .grid{ grid-template-columns: repeat(4, 1fr); }
}
.product-card{
  position: relative;
  display:flex; flex-direction:column;
  border-radius: 14px;
  overflow:hidden;
  border:1px solid var(--line);
  background:#fff;
}


/* 秒杀专区：一行一个品 */
.seckill-list{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.seckill-item{
  display:flex;
  gap:10px;
  padding:10px;
  border-radius: 14px;
  border:1px solid var(--line);
  background:#fff;
}
.seckill-item .sk-media{
  width:86px;
  height:86px;
  border-radius: 12px;
  overflow:hidden;
  background:#f3f4f6;
  flex: 0 0 86px;
  border:1px solid rgba(0,0,0,.06);
}
.seckill-item .sk-media .img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.seckill-item .sk-main{ flex:1; min-width:0; }
.seckill-item .sk-title{
  font-weight: 950;
  line-height:1.25;
  margin-top:2px;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}
.seckill-item .sk-meta{
  margin-top:6px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

/* 首页商品标签（爆品/限量/热卖/店主推荐）
   - 徽章：叠在商品图片右下角（简洁突出）
   - 爆品：火苗光晕边框 + “爆” 徽章跳动
*/

/* 图片容器：用于叠加徽章 */
.product-card{ position:relative; }
.pc-media{
  position:relative;
  width:100%;
  height:140px;
  overflow:hidden;
  background:#f3f4f6;
}
.pc-media .img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* 通用徽章 */
.promo-badge{
  position:absolute;
  right:10px;
  bottom:10px;
  z-index:3;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius: 999px;
  font-weight: 950;
  font-size: 12px;
  letter-spacing:.2px;
  line-height:1;
  color:#fff;
  background: rgba(17,24,39,.72); /* 半透明 */
  border:1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  user-select:none;
  animation: badgePop .28s ease-out both;
}
@keyframes badgePop{
  from{ transform: translateY(6px) scale(.96); opacity:0; }
  to{ transform: translateY(0) scale(1); opacity:1; }
}

/* 限量 */
.promo-badge.promo-limited{
  background: rgba(99,102,241,.80);
  border-color: rgba(255,255,255,.26);
}

/* 热卖 */
.promo-badge.promo-sell{
  background: rgba(16,185,129,.78);
  border-color: rgba(255,255,255,.26);
}

/* 店主推荐 */
.promo-badge.promo-recommend{
  background: rgba(245,158,11,.78);
  border-color: rgba(255,255,255,.26);
}

/* 爆品：火苗边框 + “爆” 徽章 */
.pc-media.promo-fire{
  box-shadow:
    inset 0 0 0 2px rgba(255,80,0,.55),
    0 0 0 1px rgba(255,80,0,.12),
    0 14px 34px rgba(255,80,0,.18);
  animation: fireGlow 1.4s ease-in-out infinite;
}
@keyframes fireGlow{
  0%,100%{ box-shadow: inset 0 0 0 2px rgba(255,80,0,.48), 0 0 0 1px rgba(255,80,0,.10), 0 14px 34px rgba(255,80,0,.14); }
  50%{ box-shadow: inset 0 0 0 2px rgba(255,80,0,.66), 0 0 0 1px rgba(255,80,0,.16), 0 18px 44px rgba(255,80,0,.22); }
}

.promo-badge.promo-hot{
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 14px;
  background: rgba(255,80,0,.88);
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 14px 30px rgba(255,80,0,.26);
  animation: boom 1.05s ease-in-out infinite;
}
@keyframes boom{
  0%,100%{ transform: translateY(0) scale(1); }
  50%{ transform: translateY(-1px) scale(1.08); }
}

/* 旧的 .product-card .img（如果存在）由 .pc-media .img 接管 */
.product-card .bd{ padding:10px; }
.product-card .title{ font-weight: 900; font-size: 14px; line-height:1.3; min-height: 36px; }
.product-card .meta{ display:flex; align-items:center; justify-content:space-between; margin-top:8px; }
.price{ font-weight: 900; color: var(--pri); }
.pill{
  display:inline-flex; align-items:center;
  padding: 5px 9px; border-radius: 999px;
  font-size:12px; border:1px solid var(--line);
  color: var(--muted); background: #fff;
}
.pill.off{ border-color: rgba(0,0,0,.10); color: var(--muted); background: rgba(0,0,0,.03); }
.pill.ok{ border-color: rgba(22,163,74,.18); color:#14532d; background: rgba(22,163,74,.06); }
.pill.cut{ border-color: rgba(245,158,11,.25); color:#7c2d12; background: rgba(245,158,11,.08); }

.table{ width:100%; border-collapse: collapse; }
.table th,.table td{
  padding:10px 8px;
  border-bottom:1px solid var(--line);
  vertical-align: top;
  font-size: 13px;
}
.table th{ color: var(--muted); font-weight: 800; text-align:left; }



/* 商品汇总表：让“数量”更靠近商品名（表格不强制撑满整行），并支持横向滚动 */
.sum-table-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
.table.sum-table.sum-tight{ width:auto; display:inline-table; max-width:100%; }

/* 商品汇总表（后台 今日/历史订单）：表格更舒适，数量不易看串 */
.sum-table{ table-layout: fixed; }
.sum-table .sum-no{ width:46px; text-align:center; color: var(--muted); }
.sum-table .sum-qty{ width:96px; text-align:right; font-weight:900; white-space:nowrap; }
.sum-table .sum-name{ width:auto; }
.sum-table tbody tr:nth-child(2n){ background: rgba(0,0,0,.02); }
.sum-table td, .sum-table th{ padding:12px 10px; }
.footer{ padding: 18px 0 24px; color: var(--muted); font-size: 12px; text-align:center; }

/* Bottom Tab Bar */
.tabbar{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 50;
}
.tabbar .inner{
  max-width: 1080px;
  margin: 0 auto;
  display:flex;
  justify-content: space-around;
  padding: 8px 10px;
}
.tab{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  color: var(--muted);
  font-size: 12px;
}
.tab .ico{
  width: 26px; height: 26px;
  border-radius: 10px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.04);
}
.tab.active{ color: var(--pri); font-weight: 800; }
.tab.active .ico{ background: rgba(255,80,0,.12); }

/* 份数步进器 */
.stepper{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px;
  border:1px solid var(--line);
  border-radius: 14px;
  background:#fff;
}
.stepper .btns{ display:flex; align-items:center; gap:10px; }
.stepper button{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border:1px solid rgba(255,80,0,.22);
  background: rgba(255,80,0,.08);
  color:#b42318;
  font-size: 22px;
  font-weight: 900;
  cursor:pointer;
}
.stepper button:active{ transform: scale(.98); }
.stepper input{
  width: 96px;
  height: 46px;
  text-align:center;
  font-size: 22px;
  font-weight: 900;
  border-radius: 14px;
  border:1px solid var(--line);
}
.stepper .hint{ color: var(--muted); font-size: 12px; }

/* 详情页：截单倒计时（醒目） */
.cutoff-panel{
  border-radius: 16px;
  padding: 14px 14px;
  border: 1px solid rgba(255,80,0,.18);
  background: linear-gradient(135deg, rgba(255,80,0,.12), rgba(255,122,24,.08));
}
.cutoff-title{ font-weight: 900; color: #7a2e00; }
.cutoff-time{
  margin-top: 8px;
  font-size: 28px;
  font-weight: 1000;
  letter-spacing: .5px;
  color: #ff5000;
}
.cutoff-time.cutoff-ended{ color: #6b7280; }
.cutoff-sub{ margin-top: 6px; font-size: 12px; color: rgba(0,0,0,.55); }

/* 首页：刚刚有人下单… 弹幕 toast */
.danmu-toast{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 86px; /* above tabbar */
  max-width: 680px;
  margin: 0 auto;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 12px 12px;
  border-radius: 16px;

  /* ✅ 兜底：JS会每次随机覆盖成半透明彩色 */
  background: rgba(0,0,0,.60);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  color: #fff;
  box-shadow: 0 18px 36px rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.08);
}
.danmu-ico{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,80,0,.18);
  font-size: 16px;
  flex: 0 0 auto;
}
.danmu-text{
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.danmu-in{ animation: danmuIn .35s ease-out both; }
.danmu-out{ animation: danmuOut .35s ease-in both; }
@keyframes danmuIn{ from{ transform: translateY(12px); opacity:0; } to{ transform: translateY(0); opacity:1; } }
@keyframes danmuOut{ from{ transform: translateY(0); opacity:1; } to{ transform: translateY(12px); opacity:0; } }

/* ✅ 后台顶部导航：按钮更大更明显（手机友好） */
.admin-topbar .inner{ align-items:flex-start; }
.admin-topbar-inner{ gap:12px; }
.admin-nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  justify-content:flex-end;
  align-items:center;
}
.admin-navbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(255,80,0,.14), rgba(255,122,24,.10));
  color: #b42318;
  border: 1px solid rgba(255,80,0,.25);
  min-width: 92px;
  user-select:none;
}
.admin-navbtn:active{ transform: scale(.98); }
.admin-navbtn-ghost{
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

/* 手机上按钮更大，更易点 */
@media (max-width: 720px){
  .topbar .inner{ flex-direction:column; align-items:flex-start; }
  .admin-nav{ width:100%; justify-content:flex-start; }
  .admin-navbtn{ flex: 1 1 calc(50% - 10px); padding: 14px 12px; border-radius: 16px; }
}

/* =========================================================
   ✅ 关键修改：后台顶栏不要固定（跟着页面滑动）
   ========================================================= */

/* 后台顶栏 class 是 topbar admin-topbar：用更高优先级覆盖 sticky */
.admin-topbar{
  position: static !important;   /* 取消 sticky */
  top: auto !important;
  z-index: auto !important;
}

/* 取消之前为了 sticky 顶栏做的滚动预留（否则不固定了还会“让位置”） */
html{ scroll-padding-top: 0 !important; }
input, select, textarea, .card{ scroll-margin-top: 0 !important; }
@media (max-width: 720px){
  html{ scroll-padding-top: 0 !important; }
  input, select, textarea, .card{ scroll-margin-top: 0 !important; }
}
/* ===== 手机端表格可横向滚动：修复后台订单页右侧列被挤掉看不到 ===== */
.card .bd{
  overflow-x: auto;              /* 关键：允许横向滚动 */
  -webkit-overflow-scrolling: touch;
}
.table{
  min-width: 860px;              /* 保证在手机上不被挤成看不到右侧列 */
}
@media (max-width: 720px){
  .table{
    min-width: 920px;            /* 手机更宽一点，确保“金额/状态/操作”列不会消失 */
  }
}



/* 商品汇总：名称和数量贴近显示，避免看串行 */
.sum-list{ display:flex; flex-direction:column; gap:8px; }
.sum-item{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.sum-name{
  font-weight:900;
  line-height:1.25;
  word-break:break-word;
}
.sum-qty{
  font-weight:900;
  padding:4px 10px;
  border-radius:999px;
  white-space:nowrap;
  border:1px solid rgba(22,163,74,.18);
  background: rgba(22,163,74,.08);
  color:#14532d;
}
