: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; }
.sync-btn {
  border: none; border-radius: 16px;
  background: rgba(255,255,255,.22); color: #fff;
  font-size: 12px; padding: 6px 12px; cursor: pointer;
}
.sync-btn:disabled { opacity: .6; }

.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); }

.reco { max-width: 640px; margin: 8px auto 0; padding: 0 12px; }
.reco h2 { font-size: 15px; margin-bottom: 8px; }
.reco-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.reco-row::-webkit-scrollbar { display: none; }
.reco-card { flex: 0 0 108px; background: #fff; border-radius: 10px; padding: 6px; cursor: pointer; }
.reco-card img { width: 100%; height: 92px; object-fit: cover; border-radius: 8px; background: var(--chip-bg); }
.reco-card .t {
  font-size: 11px; line-height: 1.4; height: 2.8em; overflow: hidden; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.reco-card .p { color: var(--red); font-weight: 700; font-size: 13px; margin-top: 2px; }

.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);
}

.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; }

.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; }
.sort-chips { padding-top: 2px; padding-bottom: 8px; }
.sort-chips .chip { font-size: 12px; padding: 5px 12px; }

.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; }
.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; }

.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; }

.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; } /* 工具类必须压过组件自身的 display 设置 */

.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;} }
/* 商品详情弹层 */
.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-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 var(--line, #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; }

.feed-sentinel { height: 8px; }
.feed-end { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0 20px; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 14px; }
