:root {
  --brand: #ff4d4f;
  --brand-dark: #e02e30;
  --ink: #1f2329;
  --ink-2: #4e5969;
  --ink-3: #86909c;
  --line: #eceef1;
  --bg: #f6f7f9;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 10px 24px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), #ff8a4c);
  color: #fff; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.28);
  overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 17px; letter-spacing: .3px; white-space: nowrap; }
.brand-text small { color: var(--ink-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-nav { display: flex; gap: 22px; font-size: 14px; color: var(--ink-2); }
.top-nav a:hover, .top-nav a.active { color: var(--brand); }
.top-nav a.active { font-weight: 600; }

/* ---------------- hero ---------------- */
.hero {
  background:
    radial-gradient(1200px 400px at 12% -10%, rgba(255, 138, 76, 0.18), transparent 60%),
    radial-gradient(900px 380px at 88% 0%, rgba(255, 77, 79, 0.16), transparent 60%),
    linear-gradient(180deg, #fff6f0 0%, var(--bg) 100%);
  padding: 42px 0 28px;
}
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.hero-copy { flex: 1; min-width: 0; }
.hero-copy h1 { font-size: 34px; line-height: 1.25; margin: 0 0 10px; letter-spacing: -0.5px; }
.hero-copy p { margin: 0 0 22px; color: var(--ink-2); font-size: 15px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 999px; padding: 6px 6px 6px 20px;
  box-shadow: 0 6px 22px rgba(255, 77, 79, 0.12);
  max-width: 560px; border: 1px solid #ffe3d6;
}
.search-box input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 15px; padding: 10px 0; color: var(--ink); min-width: 0;
}
.search-box button {
  border: 0; border-radius: 999px; padding: 11px 24px;
  background: linear-gradient(135deg, var(--brand), #ff7a45);
  color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.search-box button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 77, 79, .28); }
.hero-stats { margin-top: 16px; color: var(--ink-3); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.hero-stats b { color: var(--brand); font-size: 16px; }
.hero-stats .dot { width: 4px; height: 4px; border-radius: 50%; background: #d9dde3; }

.hero-card {
  width: 300px; flex: none; border-radius: 18px; padding: 20px 22px;
  background: linear-gradient(135deg, #fff 0%, #fff7f2 100%);
  border: 1px dashed rgba(255, 77, 79, 0.45);
  box-shadow: 0 12px 30px rgba(255, 77, 79, 0.12);
  transform: rotate(-2deg);
}
.hc-r1 { color: var(--ink-2); font-size: 13px; }
.hc-r1 s { color: var(--ink-3); }
.hc-r1 b { color: var(--brand); font-size: 26px; margin-left: 6px; }
.hc-r2 { margin: 12px 0 8px; color: var(--brand); font-weight: 700; display: flex; align-items: baseline; gap: 2px; }
.hc-r2 span:first-child { font-size: 16px; }
.hc-r2 span:nth-child(2) { font-size: 40px; letter-spacing: -1px; line-height: 1; }
.hc-r2 span:last-child { font-size: 14px; margin-left: 4px; }
.hc-r3 { font-size: 12px; color: var(--ink-3); border-top: 1px dashed #ffd9c7; padding-top: 10px; }

/* ---------------- notice ---------------- */
.notice-bar { background: #fff; border-bottom: 1px solid var(--line); }
.notice-bar .wrap { display: flex; align-items: center; gap: 10px; height: 42px; overflow: hidden; font-size: 13px; color: var(--ink-2); }
.notice-icon {
  flex: none; font-size: 11px; color: var(--brand); background: #fff1f0;
  border-radius: 4px; padding: 2px 7px; font-weight: 600;
}
#noticeText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- toolbar ---------------- */
main { padding-top: 22px; padding-bottom: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.platform-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.platform-tabs button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 7px 16px; border-radius: 999px; font-size: 13px; transition: all .15s ease;
}
.platform-tabs button:hover { border-color: #ffc9b5; color: var(--brand); }
.platform-tabs button.active {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 4px 12px rgba(255, 77, 79, .22);
}
.toolbar-right select {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--ink-2); outline: none;
}

/* ---------------- grid & cards ---------------- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  border: 1px solid rgba(0,0,0,0.03);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card-media {
  position: relative; aspect-ratio: 1 / 1; background: #f2f3f5;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .ph {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  color: rgba(255,255,255,.94); font-weight: 700; letter-spacing: 2px;
}
.card-media .ph span:first-child { font-size: 20px; }
.card-media .ph span:last-child { font-size: 11px; opacity: .82; letter-spacing: 1px; font-weight: 500; }
.ph-taobao { background: linear-gradient(135deg, #ff6a00, #ff9a3c); }
.ph-tmall { background: linear-gradient(135deg, #d0021b, #ff5a5f); }
.ph-jd { background: linear-gradient(135deg, #d71e2b, #ff6b6b); }
.ph-pdd { background: linear-gradient(135deg, #e02e24, #ff7a59); }
.ph-douyin { background: linear-gradient(135deg, #161823, #3d3f52); }
.badge-platform {
  position: absolute; left: 10px; top: 10px; font-size: 11px; color: #fff;
  background: rgba(0,0,0,.42); backdrop-filter: blur(6px); padding: 3px 9px; border-radius: 999px;
}
.card-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-title {
  font-size: 14px; line-height: 1.45; color: var(--ink); height: 40px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-shop { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-coupon {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: linear-gradient(90deg, #fff1f0, #fff8f4);
  border: 1px dashed #ffb8a6; border-radius: 8px; padding: 6px 9px;
}
.card-coupon .amount { color: var(--brand); font-weight: 700; font-size: 15px; }
.card-coupon .amount small { font-size: 11px; font-weight: 500; margin-right: 2px; }
.card-coupon .cond { font-size: 11px; color: #b5745e; }
.card-price { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.card-price .now { color: var(--brand); font-weight: 700; font-size: 20px; letter-spacing: -0.5px; }
.card-price .now i { font-size: 13px; font-style: normal; margin-right: 1px; }
.card-price .old { color: var(--ink-3); font-size: 12px; text-decoration: line-through; }
.card-price .sales { margin-left: auto; color: var(--ink-3); font-size: 11px; }
.buy-btn {
  display: block; text-align: center; border: 0; width: 100%;
  padding: 10px 0; border-radius: 999px; font-size: 14px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--brand), #ff7a45);
  transition: filter .15s ease, transform .15s ease;
}
.buy-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* skeleton */
.skeleton { pointer-events: none; }
.skeleton .card-media, .skeleton .sk-line { background: linear-gradient(90deg, #eff1f4 25%, #f7f8fa 37%, #eff1f4 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-line { height: 12px; border-radius: 6px; }
.sk-line.w70 { width: 70%; }
.sk-line.w40 { width: 40%; }
.sk-line.w90 { width: 90%; height: 20px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.empty { text-align: center; padding: 60px 0 40px; color: var(--ink-3); }
.empty-emoji { font-size: 40px; margin-bottom: 8px; }
.ghost-btn {
  margin-top: 14px; border: 1px solid var(--line); background: #fff;
  padding: 9px 20px; border-radius: 999px; color: var(--ink-2); font-size: 13px;
}
.ghost-btn:hover { border-color: var(--brand); color: var(--brand); }
.load-more-wrap { text-align: center; padding: 26px 0 10px; }
.load-more {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 11px 34px; border-radius: 999px; font-size: 14px;
}
.load-more:hover { border-color: var(--brand); color: var(--brand); }

/* ---------------- how ---------------- */
.how { padding: 40px 20px 8px; }
.how h2 { font-size: 20px; text-align: center; margin: 0 0 22px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-item { background: #fff; border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); }
.how-item .step {
  display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center;
  border-radius: 8px; background: #fff1f0; color: var(--brand); font-weight: 700; font-size: 13px; margin-bottom: 10px;
}
.how-item h3 { margin: 0 0 6px; font-size: 15px; }
.how-item p { margin: 0; font-size: 13px; color: var(--ink-3); }

/* ---------------- footer ---------------- */
.site-footer { margin-top: 36px; padding: 28px 0 40px; background: #fff; border-top: 1px solid var(--line); }
.site-footer p { margin: 0 0 8px; font-size: 12px; color: var(--ink-3); line-height: 1.8; }
.footer-disclaimer { max-width: 980px; }
.footer-copy a { color: var(--ink-3); margin-left: 8px; }
.footer-copy a:hover { color: var(--brand); }

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: rgba(31, 35, 41, .92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .22s ease; z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- responsive ---------------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-card { width: 250px; }
  .hero-copy h1 { font-size: 28px; }
}
@media (max-width: 760px) {
  .header-inner { height: 58px; }
  .top-nav { gap: 14px; font-size: 13px; }
  .top-nav a:nth-child(2) { display: none; }
  .hero { padding: 26px 0 20px; }
  .hero-inner { flex-direction: column; align-items: stretch; gap: 18px; }
  .hero-card { width: 100%; transform: none; }
  .hero-copy h1 { font-size: 24px; }
  .hero-copy p { font-size: 13px; }
  .search-box { max-width: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 10px 10px 12px; gap: 7px; }
  .card-title { font-size: 13px; height: 38px; }
  .card-price .now { font-size: 18px; }
  .how-grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 14px; }
  .toolbar-right select { padding: 7px 10px; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
}
