/* ============================================================
   Temu clone – styles (mobile-first, evidence-based tokens)
   Colors: brand red #8d0909 (m-search) / #bd0c0c (service bar),
   price orange #fb7701, AD badge rgba(0,0,0,.75), footer #1e1e1e
   ============================================================ */

:root {
  --red: #bd0c0c;
  --red-dark: #8d0909;
  --orange: #fb7701;
  --ink: #222222;
  --ink2: #333333;
  --muted: #666666;
  --line: #eeeeee;
  --bg: #f5f5f5;
  --footer: #1e1e1e;
  --white: #ffffff;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --font: miui, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto,
          "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 12px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}
body.rtl { direction: rtl; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
ul { list-style: none; }
input { font-family: inherit; }
::-webkit-scrollbar { display: none; }

/* ---------- Desktop scaffolding: page centering like Temu (max 1080) ---------- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
  position: relative;
}

/* ---------- Access nav (Wayback snapshot shows skip links first) ---------- */
.a11y-nav {
  position: absolute; left: -9999px; top: 0;
  background: var(--white); z-index: 300; padding: 8px 12px;
}
.a11y-nav:focus-within { left: 0; }
.a11y-nav a { margin-inline-end: 14px; color: var(--red); font-size: 13px; }

/* =====================  SERVICE BAR  ===================== */
.service-bar {
  background: var(--red);
  color: var(--white);
  overflow: hidden;
}
.service-track {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  height: 36px;
  overflow-x: auto;
  scrollbar-width: none;
}
.svc-item {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.svc-item.hot { background: rgba(0,0,0,.25); font-weight: 600; }
.svc-arrow { font-size: 10px; opacity: .9; }

/* =====================  HEADER / SEARCH  ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--white);
  box-shadow: 0 1px 0 var(--line);
  padding-top: 4px;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 8px;
  max-width: 1080px;
  margin: 0 auto;
}
.logo {
  flex: 0 0 auto;
  display: flex; align-items: center;
  height: 34px;
}
.logo svg { height: 30px; width: auto; display: block; }
.search-wrap {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
}
.search-box {
  display: flex; align-items: center;
  background: #f2f3f5;
  border: 2px solid var(--red-dark);
  border-radius: 6px;
  height: 38px;
  padding: 0 6px 0 10px;
  gap: 6px;
}
body.rtl .search-box { padding: 0 10px 0 6px; }
.search-box .ico { font-size: 15px; color: var(--muted); flex: 0 0 auto; }
.search-box input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 14px; color: var(--ink);
}
.search-box input::placeholder { color: #999; }
.search-btn {
  flex: 0 0 auto;
  background: var(--red-dark);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  padding: 0 14px;
  height: 28px;
}
.hdr-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.hdr-btn {
  display: flex; flex-direction: column; align-items: center;
  min-width: 40px;
  padding: 2px 4px;
  color: var(--ink2);
  font-size: 10px;
  position: relative;
}
.hdr-btn .ico { font-size: 18px; line-height: 1.1; }
.cart-badge {
  position: absolute; top: -2px; inset-inline-end: 2px;
  min-width: 15px; height: 15px;
  background: var(--orange); color: #fff;
  border-radius: 8px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  transform: scale(0); transition: transform .18s;
}
.cart-badge.on { transform: scale(1); }

/* Desktop-only top row of the header */
.hdr-top {
  display: none;
  max-width: 1080px; margin: 0 auto;
  padding: 6px 12px 2px;
  align-items: center; gap: 18px;
  font-size: 12px; color: var(--muted);
}
.hdr-top .grow { flex: 1; }
.hdr-top button, .hdr-top a { color: var(--muted); font-size: 12px; }
.hdr-top .divider { width: 1px; height: 12px; background: var(--line); }

/* Desktop nav strip */
.desktop-nav {
  display: none;
  border-top: 1px solid var(--line);
}
.desktop-nav ul {
  max-width: 1080px; margin: 0 auto;
  display: flex; gap: 20px;
  padding: 8px 12px;
  overflow-x: auto;
}
.desktop-nav a {
  font-size: 13px; color: var(--ink2);
  white-space: nowrap; padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.desktop-nav a.active { color: var(--red-dark); border-color: var(--red-dark); font-weight: 600; }

/* real promo banner under header (observed 920x56 kwcdn strip) */
.promo-banner { max-width: 1080px; margin: 6px auto 0; padding: 0 20px; }
.promo-banner img { width: 100%; border-radius: 8px; display: block; }

/* =====================  HERO STRIP (mobile)  ===================== */
.hero-strip {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  background: var(--white);
  overflow-x: auto;
}
.hero-card {
  flex: 0 0 40%;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #ffe8d6, #ffd4b0);
  position: relative;
  min-height: 96px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 8px 10px;
}
.hero-card:nth-child(2) { background: linear-gradient(135deg, #ffe3e3, #ffc9c9); }
.hero-card:nth-child(3) { background: linear-gradient(135deg, #e3f0ff, #c9e0ff); }
.hero-card .hc-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.hero-card .hc-sub { font-size: 11px; color: var(--red); margin-top: 2px; font-weight: 600; }
.hero-card .hc-emoji { position: absolute; top: 6px; inset-inline-end: 8px; font-size: 30px; }

/* =====================  CATEGORY RAIL  ===================== */
.cat-rail {
  background: var(--white);
  display: flex;
  gap: 6px;
  padding: 4px 12px 12px;
  overflow-x: auto;
}
.cat-chip {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center;
  width: 62px; gap: 4px;
  font-size: 10px; color: var(--ink2);
  text-align: center;
}
.cat-chip .ci {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #f7f7f7;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

/* =====================  SECTION HEADS  ===================== */
.sec-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 14px 12px 8px;
  background: var(--white);
}
.sec-head h2 { font-size: 16px; font-weight: 700; color: var(--ink); }
.sec-head .sub { font-size: 11px; color: var(--muted); }
.sec-head .timer {
  margin-inline-start: auto;
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--ink2);
}
.timer .cell {
  background: var(--ink); color: #fff;
  border-radius: 3px; padding: 1px 4px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* =====================  WHY TEMU  ===================== */
.why {
  background: var(--white);
  padding: 0 12px 14px;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.why-item {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 2px;
  background: #fafafa;
  border-radius: var(--radius);
  padding: 10px 4px 8px;
}
.why-item .ico {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff0e6;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 3px;
}
.why-item .t { font-size: 12px; font-weight: 600; }
.why-item .s { font-size: 10px; color: var(--muted); line-height: 1.35; }

/* =====================  DEALS RAIL (lightning)  ===================== */
.deals-rail {
  display: flex; gap: 8px;
  background: var(--white);
  padding: 2px 12px 14px;
  overflow-x: auto;
}
.deal-card {
  flex: 0 0 128px;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.deal-card .di { position: relative; background: #f5f5f5; }
.deal-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.deal-off {
  position: absolute; bottom: 6px; inset-inline-start: 6px;
  background: var(--orange); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
}
.deal-card .db { padding: 6px; }
.deal-title {
  font-size: 11px; color: var(--ink2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3; height: 29px;
}

/* =====================  AFTERPAY STRIP  ===================== */
.pay-strip {
  background: var(--white);
  margin: 8px 0;
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  font-size: 12px; color: var(--ink2);
  flex-wrap: wrap;
}
.pay-strip .pp { display: flex; gap: 8px; align-items: center; }
.pay-pill {
  border: 1px solid var(--line); border-radius: 4px;
  padding: 2px 8px; font-size: 11px; font-weight: 700; color: var(--ink);
  background: #fafafa;
}

/* =====================  USPS WARNING  ===================== */
.usps-warn {
  background: #fffbe8;
  border-block: 1px solid #f5e6b8;
  padding: 8px 12px;
  font-size: 11px; color: #8a6d1a;
  display: flex; gap: 6px; align-items: flex-start;
}
.usps-warn .view { color: var(--red-dark); font-weight: 600; white-space: nowrap; }

/* =====================  WATERFALL GRID  ===================== */
.explore-head {
  padding: 14px 12px 4px;
  font-size: 15px; font-weight: 700; letter-spacing: .4px;
  background: var(--white);
}
.waterfall {
  column-count: 2;
  column-gap: 8px;
  padding: 8px 12px 16px;
  max-width: 1080px; margin: 0 auto;
}
@media (min-width: 700px) { .waterfall { column-count: 3; } }
@media (min-width: 920px) { .waterfall { column-count: 4; } }

.card {
  break-inside: avoid;
  margin-bottom: 8px;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 1px rgba(0,0,0,.03);
}
.card .ci { position: relative; background: #f5f5f5; cursor: pointer; }
.card .ci img { width: 100%; object-fit: cover; }
.ad-badge {
  position: absolute; top: 6px; inset-inline-start: 6px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  z-index: 2;
}
.quick-look {
  position: absolute; bottom: 8px; inset-inline-end: 8px;
  width: 30px; height: 30px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  opacity: 0; transform: translateY(4px);
  transition: opacity .15s, transform .15s;
  z-index: 2;
}
.card:hover .quick-look { opacity: 1; transform: none; }
.card .cb { padding: 6px 8px 8px; }
.card-title {
  font-size: 12px; color: var(--ink);
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
  min-height: 32px;
}
.price-row { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.price { color: var(--orange); display: inline-flex; align-items: baseline; }
.price .sym { font-size: 13px; font-weight: 600; }
.price .int { font-size: 18px; font-weight: 620; }
.price .dec { font-size: 13px; font-weight: 700; }
.orig {
  color: #999; font-size: 11px;
  text-decoration: line-through;
}
.off-tag {
  background: #fee9d8; color: var(--orange);
  font-size: 10px; font-weight: 700;
  border-radius: 3px; padding: 0 4px;
}
.sold-row {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px;
  font-size: 11px; color: var(--muted);
}
.sold-row .rev { color: #444; }
.sold-bar {
  flex: 1; height: 3px;
  background: #f0f0f0; border-radius: 2px;
  overflow: hidden;
  min-width: 30px;
}
.sold-bar i { display: block; height: 100%; background: var(--orange); border-radius: 2px; }
.card-cta {
  margin: 6px 8px 8px;
  background: var(--orange);
  color: #fff; font-size: 11px; font-weight: 600;
  border-radius: 4px; height: 26px;
  width: calc(100% - 16px);
  display: none;
}
.card-cta:active { filter: brightness(.95); }
@media (hover: none) { .card-cta { display: block; } }

/* Infinite-load spinner */
.load-more {
  text-align: center;
  color: var(--muted); font-size: 12px;
  padding: 14px 0 90px;
}
.spinner {
  width: 22px; height: 22px;
  border: 2px solid #eee; border-top-color: var(--orange);
  border-radius: 50%;
  margin: 0 auto 8px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================  FOOTER  ===================== */
.site-footer {
  background: var(--footer);
  color: #b5b5b5;
  margin-top: 8px;
}
.footer-cols {
  max-width: 1080px; margin: 0 auto;
  padding: 26px 16px 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 12px;
  font-size: 12px;
}
@media (min-width: 760px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.fcol h4 {
  color: #fff; font-size: 13px; font-weight: 600;
  margin-bottom: 10px;
}
.fcol li { margin-bottom: 8px; line-height: 1.4; }
.fcol a { color: #b5b5b5; }
.fcol a:hover { color: #fff; text-decoration: underline; }
.fapps { display: flex; gap: 8px; flex-wrap: wrap; }
.fapp {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid #3a3a3a; border-radius: 6px;
  padding: 6px 10px; color: #fff; font-size: 11px;
}
.fapp .ico { font-size: 16px; }
.fapp small { display: block; color: #999; font-size: 9px; }
.fapp b { font-size: 11px; }
.flegal {
  border-top: 1px solid #333;
  padding: 12px 16px 18px;
  text-align: center;
  font-size: 11px;
  color: #888;
  line-height: 1.8;
}
.flegal a { color: #aaa; text-decoration: underline; }

/* =====================  BACK TO TOP  ===================== */
.back-top {
  position: fixed;
  bottom: 84px;
  inset-inline-end: 12px;
  width: 40px; height: 40px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--ink2);
  z-index: 110;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.back-top.show { opacity: 1; pointer-events: auto; }

/* =====================  CART FAB (mobile)  ===================== */
.cart-fab {
  position: fixed;
  bottom: 26px;
  inset-inline-end: 12px;
  width: 48px; height: 48px;
  background: var(--orange);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(251,119,1,.45);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
  z-index: 115;
  border: 2px solid #fff;
}
.cart-fab .cnt {
  position: absolute; top: -4px; inset-inline-start: -4px;
  min-width: 18px; height: 18px;
  background: var(--red); color: #fff;
  border-radius: 9px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  transform: scale(0); transition: transform .18s;
  border: 1.5px solid #fff;
}
.cart-fab .cnt.on { transform: scale(1); }

/* =====================  BOTTOM TAB BAR (mobile)  ===================== */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: var(--white);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 130;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  font-size: 10px;
  color: var(--ink2);
  position: relative;
}
.tab .ico { font-size: 20px; line-height: 1; }
.tab.active { color: var(--red-dark); font-weight: 600; }
@media (min-width: 760px) { .tabbar, .cart-fab { display: none; } }

/* =====================  CART DRAWER  ===================== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.overlay.on { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; bottom: 0;
  inset-inline-end: 0;
  width: min(360px, 88vw);
  background: var(--white);
  z-index: 210;
  transform: translateX(110%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
}
body.rtl .drawer { transform: translateX(-110%); }
.drawer.on { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 700;
}
.drawer-head .x {
  margin-inline-start: auto;
  font-size: 16px; color: var(--muted);
  padding: 2px 8px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 14px; }
.cart-empty {
  text-align: center; color: var(--muted);
  padding: 60px 0; font-size: 13px;
}
.cart-empty .ico { font-size: 42px; margin-bottom: 10px; }
.cart-item {
  display: flex; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.cart-item .ci-t {
  font-size: 12px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-item .ci-p { color: var(--orange); font-weight: 700; margin-top: 4px; font-size: 13px; }
.cart-item .qty {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--line); border-radius: 4px;
  margin-top: 6px; overflow: hidden;
}
.cart-item .qty button { width: 24px; height: 22px; font-size: 13px; color: var(--ink2); }
.cart-item .qty span { min-width: 28px; text-align: center; font-size: 12px; }
.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  background: #fafafa;
}
.drawer-foot .sum { flex: 1; font-size: 13px; }
.drawer-foot .sum b { color: var(--orange); font-size: 17px; }
.btn-checkout {
  background: var(--orange); color: #fff;
  font-size: 13px; font-weight: 700;
  border-radius: 20px;
  padding: 0 22px; height: 38px;
}
.btn-checkout:active { filter: brightness(.95); }

/* =====================  LANGUAGE SHEET  ===================== */
.lang-sheet {
  position: fixed; inset: 0;
  z-index: 220;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.lang-sheet.on { opacity: 1; pointer-events: auto; }
.lang-panel {
  width: min(520px, 100%);
  max-height: 78vh;
  background: var(--white);
  border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(40px);
  transition: transform .22s;
}
@media (min-width: 760px) {
  .lang-sheet { align-items: center; }
  .lang-panel { border-radius: 14px; margin: 10vh 16px 0; }
}
.lang-sheet.on .lang-panel { transform: none; }
.lang-head {
  display: flex; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px; font-weight: 700;
}
.lang-head .x { margin-inline-start: auto; color: var(--muted); font-size: 16px; padding: 2px 8px; }
.lang-list { overflow-y: auto; padding: 6px 8px 16px; }
.lang-row {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 10px;
  border-radius: 8px;
  text-align: start;
  font-size: 13px;
}
.lang-row:hover { background: #fafafa; }
.lang-row.sel { background: #fff4ec; }
.lang-row .flag { font-size: 20px; }
.lang-row .nm { flex: 1; line-height: 1.3; }
.lang-row .nm small { display: block; color: var(--muted); font-size: 11px; }
.lang-row .cur { color: var(--muted); font-size: 12px; }
.lang-row .tick { color: var(--orange); font-weight: 700; visibility: hidden; }
.lang-row.sel .tick { visibility: visible; }

/* =====================  CATEGORY SHEET  ===================== */
.cat-sheet {
  position: fixed; inset: 0;
  z-index: 215;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.cat-sheet.on { opacity: 1; pointer-events: auto; }
.cat-panel {
  width: min(520px, 100%);
  max-height: 70vh;
  background: var(--white);
  border-radius: 14px 14px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(40px);
  transition: transform .22s;
}
.cat-sheet.on .cat-panel { transform: none; }
.cat-grid {
  overflow-y: auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 10px 12px 18px;
}
.cat-cell {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px;
  border-radius: 10px;
  font-size: 11px; color: var(--ink2);
  text-align: center;
}
.cat-cell:active { background: #fafafa; }
.cat-cell .ci {
  width: 48px; height: 48px; border-radius: 50%;
  background: #f7f7f7;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}

/* =====================  TOAST  ===================== */
.toast {
  position: fixed;
  left: 50%; bottom: 96px;
  transform: translate(-50%, 16px);
  background: rgba(0,0,0,.78);
  color: #fff;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 18px;
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: 80vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* =====================  SEARCH SUGGESTIONS  ===================== */
.suggest {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline: 0;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.15);
  z-index: 140;
  display: none;
  overflow: hidden;
}
.suggest.on { display: block; }
.suggest li {
  padding: 9px 12px;
  font-size: 13px; color: var(--ink2);
  display: flex; gap: 8px; align-items: center;
  cursor: pointer;
}
.suggest li:hover, .suggest li.act { background: #faf4ef; }
.suggest .ico { color: var(--muted); font-size: 12px; }

/* ============================================================
   Invite & Register popup (cp-*) – admin.html 可配
   ============================================================ */
.cp-mask {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(17, 24, 39, .55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.cp-mask.show { display: flex; }
.cp-mask[aria-hidden="false"] { animation: cpFade .25s ease; }
@keyframes cpFade { from { opacity: 0 } to { opacity: 1 } }
.cp-modal {
  position: relative; width: 100%; max-width: 400px;
  background: var(--white); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  animation: cpUp .3s cubic-bezier(.2,.9,.3,1.2);
  max-height: calc(100vh - 32px); overflow-y: auto;
}
@keyframes cpUp { from { transform: translateY(28px) scale(.96); opacity: 0 } to { transform: none; opacity: 1 } }
.cp-close {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 5;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.85); border: none; cursor: pointer;
  font-size: 14px; color: #333; line-height: 1;
}
.cp-close:hover { background: #fff; color: #000; }
.cp-step { display: none; }
.cp-step.on { display: block; }

/* 第一步 hero */
.cp-hero {
  background: linear-gradient(135deg, #fb7701 0%, #ff9a3d 55%, #ffb46b 100%);
  color: #fff; text-align: center; padding: 30px 20px 24px;
}
.cp-badge {
  display: inline-block; background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.55);
  padding: 3px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
}
.cp-hero-title { margin-top: 12px; font-size: 19px; font-weight: 800; line-height: 1.35; }
.cp-reward {
  font-size: 34px; font-weight: 900; margin-top: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,.18);
  animation: cpPulse 1.6s ease-in-out infinite;
}
@keyframes cpPulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.05) } }
.cp-hero-sub { margin-top: 8px; font-size: 12.5px; opacity: .92; }

.cp-body { padding: 18px 20px 20px; }
.cp-count {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff3e8; border: 1px dashed #fb7701;
  border-radius: 10px; padding: 8px 12px; margin-bottom: 14px;
  font-size: 12.5px; color: #b35b00; font-weight: 600;
}
.cp-count-num { font-variant-numeric: tabular-nums; font-weight: 800; color: #fb7701; }

/* 字段 */
.cp-field { margin-bottom: 14px; }
.cp-field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.cp-field .req { color: #e02e24; }
.cp-field input {
  width: 100%; box-sizing: border-box;
  padding: 11px 12px; border: 1.5px solid #e5e5e5; border-radius: 10px;
  font-size: 14px; background: #fafafa; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.cp-field input:focus { outline: none; border-color: var(--orange); background: #fff; }
.cp-field .msg {
  display: none; margin-top: 5px; font-size: 11.5px; color: #e02e24; font-weight: 600;
}
.cp-field.err input { border-color: #e02e24; background: #fef5f5; }
.cp-field.err .msg { display: block; }

/* 按钮 / 条款 */
.cp-btn {
  width: 100%; padding: 13px; border: none; border-radius: 999px;
  background: linear-gradient(90deg, #fb7701, #ff9a3d);
  color: #fff; font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 18px rgba(251,119,1,.35);
  transition: transform .12s, filter .15s;
}
.cp-btn:hover { filter: brightness(1.05); }
.cp-btn:active { transform: scale(.98); }
.cp-terms { margin: 12px 4px 0; font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.5; }

/* 第二步头 */
.cp-head { padding: 24px 20px 4px; text-align: center; }
.cp-form-title { font-size: 18px; font-weight: 800; color: var(--ink); }
.cp-form-sub { margin-top: 6px; font-size: 12px; color: var(--muted); }
#cpFormBox { margin-top: 12px; }

/* 第三步成功 */
.cp-done { padding: 36px 24px 28px; text-align: center; }
.cp-done-ico { font-size: 46px; animation: cpPop .5s cubic-bezier(.2,.9,.3,1.4); }
@keyframes cpPop { from { transform: scale(0) } to { transform: scale(1) } }
.cp-done-title { margin-top: 10px; font-size: 20px; font-weight: 900; color: var(--ink); }
.cp-done-sub { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.cp-code-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 16px 0; padding: 10px; border: 1.5px dashed #fb7701;
  border-radius: 10px; background: #fff8f2;
}
.cp-code-label { font-size: 10px; font-weight: 800; color: #b35b00; letter-spacing: .1em; }
.cp-code { font-size: 16px; font-weight: 900; color: #fb7701; letter-spacing: .04em; }

/* RTL 适配 */
body.rtl .cp-hero-title, body.rtl .cp-form-title, body.rtl .cp-done-title { direction: rtl; }
