/* LOONG CYCLE gallery — Yupoo-like product catalog */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1a1d21;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #d2232a;
  --brand-dark: #a81b21;
  --sidebar-w: 240px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #16181c;
  color: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.25);
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #ff5a5f;
  object-fit: cover;
  flex: 0 0 46px;
  background: #fff;
}
.logo-text h1 {
  font-size: 20px;
  letter-spacing: .12em;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}
.logo-text h1::first-letter { color: #ff5a5f; }
.subtitle {
  display: block;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #9aa0a6;
  margin-top: 2px;
}
.search-wrap { flex: 1 1 260px; max-width: 520px; }
#search-input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid #33373d;
  border-radius: 999px;
  background: #23262b;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, background .15s;
}
#search-input::placeholder { color: #8b9096; }
#search-input:focus { border-color: var(--brand); background: #2a2d33; }
.stats {
  font-size: 12px;
  color: #b6bcc2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stats b { color: #fff; font-weight: 600; }

/* ---------- Layout ---------- */
.layout {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 12px 0 24px;
}
/* ---------- Shop intro ---------- */
.shop-intro {
  margin: 12px 12px 14px;
  padding: 14px 14px 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1d2025 0%, #2b2f36 100%);
  border: 1px solid #3a3f47;
  color: #e8eaed;
  font-size: 12.5px;
  line-height: 1.65;
}
.si-line { margin: 0 0 4px; }
.si-wa {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.14);
}
.si-wa a {
  color: #4ade80;
  font-weight: 600;
  text-decoration: none;
}
.si-wa a:hover { text-decoration: underline; }

.sidebar-head {
  padding: 6px 16px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
}
.brand-item:hover { background: #f1f2f4; }
.brand-item.active {
  background: #fdecec;
  border-left-color: var(--brand);
  font-weight: 600;
  color: var(--brand-dark);
}
.brand-count {
  font-size: 11px;
  color: var(--muted);
  background: #eef0f2;
  border-radius: 999px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.brand-item.active .brand-count { background: #f8d6d8; color: var(--brand-dark); }

/* ---------- Main ---------- */
.main {
  flex: 1;
  min-width: 0;
  padding: 16px 20px 48px;
}
.main-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb .bc-brand { font-size: 16px; font-weight: 700; color: var(--ink); }
.grid-info { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .14s, box-shadow .14s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eef0f2;
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s;
}
.card:hover .card-thumb img { transform: scale(1.03); }
.card-thumb .img-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.card-name {
  padding: 10px 12px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.card-brand {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 2px;
}

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

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 12, 14, .96);
  display: flex;
  flex-direction: column;
  animation: fadein .15s ease;
}
.lightbox[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.lb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.lb-titles { min-width: 0; }
.lb-brand {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #ff8a8e;
  font-weight: 700;
}
.lb-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}
.lb-counter { font-size: 13px; color: #c9cdd3; font-variant-numeric: tabular-nums; }
.lb-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: transparent;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex: 0 0 34px;
  transition: background .12s;
}
.lb-close:hover { background: rgba(255,255,255,.15); }

.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 0;
}
.lb-img-wrap {
  max-width: calc(100% - 140px);
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img-wrap img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  user-select: none;
}
.lb-nav {
  width: 52px; height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  margin: 0 14px;
  transition: background .12s;
  user-select: none;
}
.lb-nav:hover { background: rgba(255,255,255,.2); }
.lb-nav:disabled { opacity: .25; cursor: default; background: rgba(255,255,255,.06); }

.lb-thumbs {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 12px 18px 16px;
  overflow-x: auto;
}
.lb-thumbs img {
  width: 64px; height: 48px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: .5;
  border: 2px solid transparent;
  transition: opacity .12s, border-color .12s;
}
.lb-thumbs img:hover { opacity: .85; }
.lb-thumbs img.active { opacity: 1; border-color: #ff5a5f; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: 100%;
    flex: none;
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .shop-intro { display: none; }
  .brand-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 12px 12px;
  }
  .brand-item {
    width: auto;
    border-left: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
  }
  .brand-item.active { background: #fdecec; border-color: var(--brand); }
  .sidebar-head { padding: 10px 12px 8px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .lb-img-wrap { max-width: calc(100% - 90px); }
  .lb-nav { width: 40px; height: 40px; flex: 0 0 40px; font-size: 20px; margin: 0 6px; }
}
