/* 会过日子 · 全站样式 */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a919f;
  --red: #ff3b30;
  --brand: #2f6bff;
  --chip-bg: #eceff3;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  padding-bottom: env(safe-area-inset-bottom);
}
.wrap, .feed, .chips { max-width: 640px; margin: 0 auto; }

/* ---- 顶栏 ---- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(135deg, #ff6a3d, #ff3b30);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.2);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700;
}
.brand-text h1 { font-size: 18px; line-height: 1.2; }
.sub { font-size: 11px; opacity: .85; margin-top: 2px; }

/* ---- 搜索 ---- */
.searchbar { max-width: 640px; margin: 10px auto 0; padding: 0 12px; display: flex; gap: 8px; }
.searchbar input {
  flex: 1; height: 38px;
  border: 1px solid #e3e6eb; border-radius: 19px;
  background: #fff; padding: 0 16px; font-size: 13px; outline: none;
}
.searchbar input:focus { border-color: var(--brand); }
.searchbar button {
  flex: 0 0 auto; border: none; border-radius: 19px;
  background: var(--brand); color: #fff;
  font-size: 13px; padding: 0 18px; cursor: pointer;
}
.search-hint { max-width: 640px; margin: 6px auto 0; padding: 0 16px; color: var(--muted); font-size: 12px; }
.search-hint b { color: var(--text); }

/* ---- 平台/分类/排序 chips ---- */
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 12px 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  background: var(--chip-bg); color: var(--text);
  border-radius: 16px; padding: 6px 14px;
  font-size: 13px; cursor: pointer; border: 1px solid transparent;
}
.chip.active { background: #fff0ec; color: var(--red); border-color: #ffd2cb; font-weight: 600; }
.plat-chips { padding-top: 12px; }
.plat-chips .chip { background: #fff; font-weight: 600; border: 1px solid #e3e6eb; }
.plat-chips .chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.plat-chips .chip.disabled { opacity: .55; }
.sort-chips { padding-top: 2px; padding-bottom: 8px; }
.sort-chips .chip { font-size: 12px; padding: 5px 12px; }

/* ---- 活动轮播 ---- */
.act-section { max-width: 640px; margin: 6px auto 0; padding: 0 12px; }
.act-section h2 { font-size: 15px; margin-bottom: 8px; }
.act-carousel {
  position: relative; width: 100%; height: 150px;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #ff6a3d, #ff3b30);
}
.act-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .5s; cursor: pointer; }
.act-slide.on { opacity: 1; }
.act-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.act-slide .s-title {
  position: absolute; left: 14px; bottom: 26px; right: 14px;
  color: #fff; font-size: 15px; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.act-slide .s-adv {
  position: absolute; left: 14px; top: 12px;
  background: rgba(255,255,255,.95); color: var(--red);
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px;
}
.act-slide.tao-slide {
  background: linear-gradient(135deg, #ff6a3d, #ff3b30);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.act-slide.tao-slide .t-emoji { font-size: 34px; line-height: 1; }
.act-slide.tao-slide .t-title { color: #fff; font-size: 17px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.act-slide.tao-slide .t-sub { color: rgba(255,255,255,.92); font-size: 12px; }
.act-slide.tao-slide .t-go {
  margin-top: 4px; background: rgba(255,255,255,.95); color: var(--red);
  font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 12px;
}
/* 右侧当期商品图网格：会场卡 + 活内容预告 */
.act-slide.tao-slide .t-imgs {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: grid; grid-template-columns: repeat(2, 52px); grid-auto-rows: 52px; gap: 5px;
}
.act-slide.tao-slide .t-imgs img {
  width: 52px; height: 52px; object-fit: cover; border-radius: 8px;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
/* 带图网格时文案靠左，避免重叠 */
.act-slide.tao-slide:has(.t-imgs) { align-items: flex-start; padding-left: 16px; }
.act-slide.tao-slide:has(.t-imgs) .t-emoji { font-size: 26px; }
.act-slide.tao-slide:has(.t-imgs) .t-title, .act-slide.tao-slide:has(.t-imgs) .t-sub {
  max-width: calc(100% - 132px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- 外卖活动卡：通栏官方banner + 文字 ---- */
.waimai-card { flex-direction: column; padding: 0; overflow: hidden; }
.waimai-card .card-body { padding: 10px 12px 12px; }
.wm-banner {
  width: 100%; height: 116px; object-fit: cover; display: block;
  background: linear-gradient(135deg, #ff9a62, #ff5252);
}
.wm-banner-hide { display: none; }
.wm-banner-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; color: #fff;
}
/* banner 包裹层 + 最大优惠角标 */
.wm-banner-wrap { position: relative; }
.wm-deal {
  position: absolute; right: 8px; top: 8px;
  background: linear-gradient(135deg, #ff3b30, #ff6a3d); color: #fff;
  font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 14px;
  box-shadow: 0 2px 6px rgba(255,59,48,.4);
}

/* ---- 小程序活动弹层 ---- */
.mini-sheet { max-width: 420px; max-height: 86vh; overflow-y: auto; }
.mini-sheet .mini-sub { font-size: 12px; color: #6b7280; margin: 4px 0 10px; }
.mini-imgs { display: flex; flex-direction: column; gap: 8px; }
.mini-img {
  width: 100%; border-radius: 10px; border: 1px solid var(--chip-bg);
  display: block; object-fit: cover; object-position: top;
}
.mini-sheet .detail-foot { margin-top: 12px; }
.mini-note { font-size: 11px; color: #8a919f; text-align: center; margin-top: 8px; line-height: 1.6; }
.act-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.act-dots .dot { width: 6px; height: 6px; border-radius: 3px; background: #d6dae1; cursor: pointer; transition: all .3s; }
.act-dots .dot.on { background: var(--red); width: 18px; }

/* ---- 商品流 ---- */
.feed { display: flex; flex-direction: column; gap: 10px; padding: 4px 12px 20px; }
.card {
  display: flex; gap: 10px;
  background: var(--card); border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.pic {
  width: 96px; height: 96px; flex: 0 0 auto;
  border-radius: 8px; background: var(--chip-bg);
  object-fit: cover;
}
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.title {
  font-size: 14px; line-height: 1.4; max-height: 2.8em;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag {
  font-size: 10px; color: #b26b00; background: #fff7e8;
  padding: 1px 6px; border-radius: 4px;
}
.tag.hot { color: var(--red); background: #fff0ec; }
.tag.drop { color: #0a7dbe; background: #e8f4fd; }
.price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; padding-top: 8px; }
.final { color: var(--red); font-weight: 700; font-size: 18px; }
.final .yen { font-size: 12px; }
.orig { color: var(--muted); font-size: 12px; text-decoration: line-through; }
.btn-row { display: flex; justify-content: flex-end; margin-top: 6px; }
.buy-btn {
  border: none; border-radius: 16px;
  background: linear-gradient(135deg, #ff6a3d, #ff3b30);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 7px 16px; cursor: pointer;
}
.buy-btn:disabled { background: var(--chip-bg); color: var(--muted); }
.comments { color: var(--muted); font-size: 11px; margin-left: auto; }
.feed-sentinel { height: 8px; }
.feed-end { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0 20px; }

/* ---- 骨架屏 ---- */
.skeleton .pic, .skeleton .line {
  background: linear-gradient(90deg, #eceff3 25%, #f7f8fa 37%, #eceff3 63%);
  background-size: 400% 100%; animation: shine 1.2s infinite;
}
.skeleton .line { height: 13px; border-radius: 6px; margin: 6px 0; }
@keyframes shine { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---- 空状态 / 接入中 ---- */
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 14px; }
.coming { text-align: center; padding: 80px 24px; color: var(--muted); }
.coming .emoji { font-size: 46px; }
.coming h3 { color: var(--text); font-size: 17px; margin: 14px 0 8px; }
.coming p { font-size: 13px; line-height: 1.8; }

/* ---- 详情弹层 ---- */
.detail-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.detail-sheet {
  position: relative; width: 100%; max-width: 640px;
  background: #fff; border-radius: 16px 16px 0 0;
  padding: 14px 14px 0; max-height: 88vh; overflow-y: auto;
}
.detail-close {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer;
}
.detail-pic { width: 100%; height: 280px; object-fit: cover; border-radius: 12px; background: var(--chip-bg); }
.detail-body { padding: 10px 0 0; }
.detail-title { font-size: 16px; line-height: 1.5; margin-top: 12px; }
.detail-coupon {
  margin-top: 10px; padding: 8px 10px; font-size: 13px;
  background: #fff0ec; color: var(--red);
  border: 1px dashed var(--red); border-radius: 8px;
}
.detail-meta { color: var(--muted); font-size: 12px; margin-top: 10px; }
.detail-foot { position: sticky; bottom: 0; background: #fff; padding: 10px 0 8px; display: flex; gap: 10px; }
.detail-back {
  flex: 0 0 96px; height: 44px; border-radius: 22px;
  border: 1px solid #e3e6eb; background: #fff; color: var(--text);
  font-size: 14px; cursor: pointer;
}
.detail-buy { flex: 1; width: auto; height: 44px; font-size: 15px; border-radius: 22px; }

/* ---- 分享面板 ---- */
.share-title { font-size: 16px; margin-bottom: 12px; }
.qr-box { text-align: center; padding: 6px 0 2px; }
.qr-box img {
  width: 200px; height: 200px; display: block;
  margin: 0 auto; border: 1px solid var(--chip-bg); border-radius: 10px; background: #fff;
}
.qr-box p { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 8px; }
.share-row { display: flex; gap: 8px; margin-top: 14px; }
.share-opt {
  flex: 1; height: 40px; border-radius: 10px;
  border: 1px solid #e3e6eb; background: #fff; color: var(--text);
  font-size: 13px; cursor: pointer;
}
.share-opt:active { background: var(--chip-bg); }
.share-tip { color: var(--muted); font-size: 11px; line-height: 1.7; margin-top: 12px; text-align: center; }

/* ---- 价格走势图 ---- */
.price-chart { margin-top: 14px; background: var(--chip-bg); border-radius: 10px; padding: 10px 12px; }
.pc-head { display: flex; align-items: baseline; justify-content: space-between; }
.pc-head h3 { font-size: 13px; }
.pc-stats { font-size: 11px; color: var(--muted); }
.pc-chart svg { width: 100%; height: auto; display: block; }
.pc-note { color: var(--muted); font-size: 10px; margin-top: 6px; }
.pc-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0 8px; line-height: 1.7; }
.pc-legend { display: flex; gap: 12px; margin-top: 4px; justify-content: center; }
.pc-legend .lg { font-size: 10px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.pc-legend .lg::before { content: ""; width: 14px; height: 2px; display: inline-block; }
.pc-legend .lg-price::before { background: #b7bdc9; }
.pc-legend .lg-final::before { background: #ff3b30; }

/* ---- 淘宝商品 ---- */
.tao-pic-ph { display: grid; place-items: center; font-size: 30px; background: linear-gradient(135deg, #fff0ec, #ffe3d9); }
.tao-note { text-align: center; color: var(--muted); font-size: 12px; padding: 14px 0 6px; line-height: 1.8; }

/* ---- 提示条（底部常规 + 顶部微信引导） ---- */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff;
  font-size: 13px; padding: 10px 18px; border-radius: 20px;
  max-width: 80vw; text-align: center; z-index: 99;
}

.hidden { display: none !important; }

/* ---- 微信内淘宝引导卡（手机浏览器唤起App） ---- */
#taoJumpMask { align-items: center; }
.guide-box {
  position: relative; overflow: hidden;
  background: #fff; border-radius: 16px; width: 88%;
  max-width: 560px; padding: 0 20px 20px; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  box-sizing: border-box;
}
.guide-box::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: linear-gradient(90deg, #ff6a3d, #ff3b30);
}
.guide-icon {
  display: block; width: 54px; height: 54px; line-height: 56px;
  margin: 22px auto 0; border-radius: 50%;
  background: linear-gradient(135deg, #fff0ec, #ffe3d9);
  font-size: 28px; text-align: center;
}
.guide-title { font-size: 18px; font-weight: 800; margin: 12px 0 14px; color: #1f2329; }
.guide-steps {
  list-style: none; counter-reset: step; margin: 0 0 14px;
  padding: 12px 12px 12px 17px;
  background: #f8f9fb; border-radius: 10px; text-align: left;
}
.guide-steps li {
  counter-increment: step; position: relative;
  padding-left: 32px; font-size: 13.5px; line-height: 22px; color: #1f2329; min-height: 22px;
}
.guide-steps li + li { margin-top: 10px; }
.guide-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #ff6a3d, #ff3b30);
  color: #fff; font-size: 12px; font-weight: 700;
  text-align: center; line-height: 22px;
}
.guide-tpwd {
  margin: 0 0 15px; padding: 11px 12px;
  background: linear-gradient(135deg, #fff7f2, #ffefe8);
  border: 1px solid #ffd2cb; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: #c0392b;
  word-break: break-all; text-align: left; line-height: 1.7;
  user-select: all; -webkit-user-select: all;
}
.guide-tpwd::before { content: "淘口令"; display: block; font-size: 10px; color: #d48806; margin-bottom: 3px; font-weight: 400; }
button.guide-app-btn, a.guide-app-btn {
  display: block; width: 100%; height: 46px; line-height: 46px;
  border-radius: 23px; text-decoration: none;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, #ff6a3d, #ff3b30);
  color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: 0 5px 12px rgba(255,59,48,.35);
  margin-bottom: 12px;
}
button.guide-app-btn:active, a.guide-app-btn:active { opacity: .85; }
a.guide-skip {
  display: inline-block; margin-top: 2px;
  color: var(--muted); font-size: 13px; text-decoration: underline;
}

/* ---- 页脚 ---- */
.foot { max-width: 640px; margin: 0 auto; padding: 8px 16px 28px; text-align: center; }
.foot p { color: var(--muted); font-size: 11px; line-height: 1.8; }
