/* ===== PLUGHUB FINDZ — deep purple + violet, mobile first ===== */
:root {
  --bg:          #0F0420;   /* deep purple-black */
  --bg-card:     #1A0938;   /* card / panel */
  --bg-soft:     #25104F;   /* input / button surface */
  --bg-line:     #3D1A6B;   /* hairlines */
  --fg:          #ffffff;
  --fg-dim:      #C9A8FF;   /* light violet for secondary text */
  --fg-mute:     #9881C5;
  --purple:      #8B2FFF;   /* primary brand */
  --purple-deep: #4A1080;
  --purple-soft: #B57BFF;
  --yellow:      #F5C037;   /* LINK + fav */
  --pink:        #FF1FCB;   /* accent */
  --radius:      14px;
  --shadow:      0 8px 24px rgba(139, 47, 255, .25);
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bot:    env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; }
body { padding-bottom: 124px; min-height: 100vh; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, button { font-family: inherit; }

/* ----- top bar ----- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, #0F0420 0%, #0F0420 80%, rgba(15,4,32,.95) 100%);
  padding: calc(var(--safe-top) + 14px) 16px 12px;
  border-bottom: 1px solid var(--bg-line);
}
.brand-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; flex: 1; min-width: 0; }
.brand-tiktok {
  flex-shrink: 0;
  width: 38px; height: 38px;
  background: var(--bg-soft); border: 1px solid var(--bg-line);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--purple-soft);
  transition: transform .12s, background .15s, color .15s, border-color .15s;
}
.brand-tiktok svg { width: 20px; height: 20px; display: block; }
.brand-tiktok:hover, .brand-tiktok:focus-visible {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
  outline: none;
}
.brand-tiktok:active { transform: scale(.94); }
.brand-mark {
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900; letter-spacing: 2px;
  font-size: 28px; color: var(--purple-soft);
}
.brand-mark-findz { color: var(--yellow); }
.brand-sub {
  font-size: 10px; letter-spacing: 3px; color: var(--fg-mute); font-weight: 700;
}

.searchwrap { display: flex; gap: 8px; margin-top: 12px; }
#search {
  flex: 1; min-width: 0;
  background: var(--bg-soft); border: 1px solid var(--bg-line); color: var(--fg);
  padding: 12px 14px; border-radius: var(--radius); outline: none;
  font-size: 15px;
}
#search::placeholder { color: var(--fg-mute); }
#search:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139,47,255,.22); }
.favtoggle {
  width: 46px; height: 46px; flex-shrink: 0;
  background: var(--bg-soft); border: 1px solid var(--bg-line); color: var(--fg-mute);
  border-radius: var(--radius); font-size: 20px;
  transition: all .15s;
}
.favtoggle[aria-pressed="true"] { color: var(--yellow); border-color: var(--yellow); background: rgba(245,192,55,.1); }

/* ----- category chips ----- */
.chips {
  display: flex; gap: 8px; padding: 12px 16px;
  overflow-x: auto; scrollbar-width: none;
  background: var(--bg);
  position: sticky; top: var(--chips-top, 110px); z-index: 20;
  border-bottom: 1px solid var(--bg-line);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  background: var(--bg-soft); border: 1px solid var(--bg-line); color: var(--fg-dim);
  padding: 8px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: 1px;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.chip.is-active {
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff; border-color: var(--purple);
  box-shadow: var(--shadow);
}
.chip .badge {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: inherit;
  min-width: 18px; text-align: center;
}
.chip.is-active .badge { background: rgba(0,0,0,.22); }

/* ----- banner ----- */
.banner-warn {
  margin: 12px 16px; padding: 12px 14px;
  background: rgba(245,192,55,.08); border: 1px solid rgba(245,192,55,.3);
  border-radius: var(--radius); color: #FFE680; font-size: 13px;
  display: flex; gap: 6px; flex-direction: column;
}

/* ----- grid ----- */
main { padding: 14px 12px 24px; }
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 900px)  { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.card {
  background: var(--bg-card); border: 1px solid var(--bg-line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .12s, border-color .12s, box-shadow .12s;
  position: relative;
}
.card:active { transform: scale(.98); }
.card:hover { border-color: var(--purple); box-shadow: var(--shadow); }

.card-img {
  aspect-ratio: 1 / 1; background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img.no-img { color: #555; font-size: 11px; letter-spacing: 2px; }

.card-fav {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; border-radius: 999px;
  background: rgba(15,4,32,.65); border: 0; color: #fff;
  font-size: 18px; line-height: 1; padding: 0;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.card-fav[aria-pressed="true"] { color: var(--yellow); }

.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.card-cat {
  font-size: 9px; letter-spacing: 2px; color: var(--purple-soft); font-weight: 800;
}
.card-name {
  font-size: 13px; line-height: 1.25; font-weight: 700; color: var(--fg);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 32px;
}
.card-price {
  font-size: 15px; font-weight: 900; color: var(--yellow);
  margin-top: 2px;
}
.card-yuan {
  font-size: 11px; color: var(--fg-mute); margin-left: 4px; font-weight: 500;
}
.card-actions { display: flex; gap: 6px; margin-top: 6px; }
.card-buy {
  flex: 1; text-align: center;
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff; font-weight: 900;
  padding: 8px; border-radius: 8px; font-size: 11px; letter-spacing: 1px;
}
.card-share {
  width: 36px; flex-shrink: 0;
  background: var(--bg-soft); border: 1px solid var(--bg-line); color: var(--fg);
  border-radius: 8px; font-size: 14px; padding: 0;
}

/* ----- empty ----- */
.empty {
  text-align: center; padding: 60px 24px; color: var(--fg-mute);
}

/* ----- footer ----- */
.footbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(15,4,32,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--bg-line);
  padding: 10px 12px calc(10px + var(--safe-bot));
  display: flex; flex-direction: column; gap: 8px;
}
.cta-superbuy {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #F5C037 0%, #E8A82C 100%);
  color: #1A0938 !important;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(245,192,55,.25);
  transition: transform .12s, box-shadow .12s;
}
.cta-superbuy:active { transform: scale(.98); }
.cta-superbuy-icon {
  font-size: 22px; line-height: 1; flex-shrink: 0;
}
.cta-superbuy-text {
  display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2;
}
.cta-superbuy-title {
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 13px; font-weight: 900; letter-spacing: 1.5px;
}
.cta-superbuy-sub {
  font-size: 11px; font-weight: 600; opacity: .8; margin-top: 2px;
}
.cta-superbuy-arrow {
  font-size: 18px; font-weight: 900; flex-shrink: 0;
}
.footbar-meta {
  display: flex; gap: 6px; justify-content: center; align-items: center;
  font-size: 11px; color: var(--fg-mute); letter-spacing: 1px;
}
.footbar-meta .dot { opacity: .5; }

/* ----- modal ----- */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.85);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
@media (min-width: 600px) { .modal { align-items: center; } }
.modal-card {
  background: var(--bg-card); border: 1px solid var(--bg-line);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
}
@media (min-width: 600px) { .modal-card { border-radius: var(--radius); } }
.modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 999px;
  background: rgba(15,4,32,.65); border: 0; color: #fff;
  font-size: 22px; line-height: 1; padding: 0; z-index: 2;
}
.modal-img {
  aspect-ratio: 1 / 1; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.modal-img img { width: 100%; height: 100%; object-fit: contain; }
.modal-meta { padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 10px; }
.modal-cat { font-size: 10px; letter-spacing: 2px; color: var(--purple-soft); font-weight: 800; }
.modal-meta h2 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; }
.modal-price { font-size: 24px; font-weight: 900; color: var(--yellow); }
.modal-yuan { font-size: 14px; color: var(--fg-mute); font-weight: 500; margin-left: 6px; }
.modal-comment { color: var(--fg-dim); font-size: 13px; margin: 4px 0 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.btn-buy {
  flex: 1; min-width: 140px; text-align: center;
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff; font-weight: 900;
  padding: 14px; border-radius: 10px; letter-spacing: 1px;
  box-shadow: var(--shadow);
}
.btn-fav, .btn-share {
  background: var(--bg-soft); border: 1px solid var(--bg-line); color: var(--fg);
  padding: 14px 16px; border-radius: 10px; font-weight: 700;
}
.btn-fav[aria-pressed="true"] { color: var(--yellow); border-color: var(--yellow); }

/* ----- legal pages (privacy etc.) ----- */
body.legal { padding-bottom: 40px; }
.legal-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  color: var(--fg-dim);
  font-size: 15px; line-height: 1.65;
}
.legal-wrap h1 {
  color: var(--fg);
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 28px; letter-spacing: 1px;
  margin: 16px 0 6px;
}
.legal-wrap h2 {
  color: var(--purple-soft);
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 17px; letter-spacing: 1px;
  margin: 28px 0 8px;
}
.legal-wrap p { margin: 10px 0; }
.legal-wrap ul { margin: 10px 0; padding-left: 22px; }
.legal-wrap li { margin: 6px 0; }
.legal-wrap a { color: var(--purple-soft); text-decoration: underline; text-decoration-color: var(--bg-line); }
.legal-wrap a:hover { color: var(--yellow); text-decoration-color: var(--yellow); }
.legal-wrap code {
  background: var(--bg-card); border: 1px solid var(--bg-line);
  padding: 1px 6px; border-radius: 4px;
  font-size: 13px; color: var(--fg-dim);
}
.legal-wrap strong { color: var(--fg); font-weight: 700; }
.legal-date { color: var(--fg-mute); font-size: 13px; margin-top: 0 !important; }
.legal-back {
  display: inline-block;
  background: var(--bg-soft); border: 1px solid var(--bg-line);
  padding: 6px 12px; border-radius: 8px;
  font-size: 13px; color: var(--purple-soft) !important;
  text-decoration: none !important;
}
.legal-back:hover { background: var(--purple); color: #fff !important; border-color: var(--purple); }

/* ----- toast ----- */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff;
  padding: 12px 20px; border-radius: 999px;
  font-weight: 800; letter-spacing: 1px; font-size: 13px;
  z-index: 50; box-shadow: var(--shadow);
  animation: toastIn .15s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
