*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* 页面左右与屏幕边缘的留白（大屏更宽、小屏至少约 1.5rem） */
  --layout-pad-x: clamp(1.5rem, 6vw, 5rem);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow-x: hidden;
  font-family:
    Inter,
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  background: #fff;
  color: #111;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  overflow: visible;
}

@supports (padding: max(0px)) {
  .site-header {
    padding-top: env(safe-area-inset-top);
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem max(var(--layout-pad-x), env(safe-area-inset-right)) 0.65rem
    max(var(--layout-pad-x), env(safe-area-inset-left));
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.topbar-cats {
  padding: 0.45rem max(var(--layout-pad-x), env(safe-area-inset-right)) 0.45rem
    max(var(--layout-pad-x), env(safe-area-inset-left));
  background: #2c7a94;
  border-bottom: 1px solid #256b82;
  overflow: visible;
}

/* One visible row; extra categories live under “More” */
.topbar-cats__line {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.35rem 0.2rem;
  width: 100%;
  min-width: 0;
  position: relative;
}

.topbar-cats__more {
  position: relative;
  flex: 0 0 auto;
}

.topbar-cats__more > .topbar-cats__more-summary {
  list-style: none;
  cursor: pointer;
}

.topbar-cats__more > .topbar-cats__more-summary::-webkit-details-marker {
  display: none;
}

.topbar-cats__more > .topbar-cats__more-summary::after {
  content: "";
  display: inline-block;
  width: 0.35em;
  height: 0.35em;
  margin-left: 0.35em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  vertical-align: 0.12em;
  opacity: 0.9;
}

.topbar-cats__more[open] > .topbar-cats__more-summary::after {
  transform: rotate(225deg);
  vertical-align: -0.04em;
}

.topbar-cats__more-panel {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + 0.35rem);
  z-index: 200;
  width: min(18rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  padding: 0.45rem 0.5rem;
  background: #256b82;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.15rem;
  max-height: min(55vh, 24rem);
  overflow-y: auto;
  overflow-x: hidden;
}

.topbar-cats__more-panel .topbar-cats__link {
  justify-content: flex-start;
  width: 100%;
  min-height: 2.25rem;
  padding: 0.45rem 0.6rem;
  box-sizing: border-box;
  text-align: left;
}

.topbar-cats__link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.topbar-cats__link:hover {
  background: rgba(255, 255, 255, 0.15);
}

.topbar-cats__link:active {
  background: rgba(255, 255, 255, 0.22);
}

.topbar-cats__link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.topbar__logo {
  font-size: clamp(0.78rem, 3.5vw, 0.95rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #0f172a;
  text-decoration: none;
  max-width: 100%;
}

.topbar__logo:hover {
  color: #3498db;
}

.topbar__search-block {
  flex: 1 1 20rem;
  min-width: 0;
  max-width: min(48rem, 100%);
}

.topbar__search {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.topbar__search-shell {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.65rem 0.32rem 0.85rem;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 2px solid #3498db;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(52, 152, 219, 0.1),
    0 4px 14px rgba(52, 152, 219, 0.16),
    0 2px 4px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar__search-shell:hover {
  border-color: #2e8ece;
}

.topbar__search-shell:focus-within {
  border-color: #2980b9;
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(52, 152, 219, 0.22),
    0 4px 14px rgba(52, 152, 219, 0.2);
}

.topbar__search-input {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  height: 2.25rem;
  padding: 0.15rem 0;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.25;
  color: #0f172a;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.topbar__search-input::-webkit-search-decoration,
.topbar__search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.topbar__search-input::placeholder {
  color: #475569;
  font-weight: 500;
}

.topbar__search-input:focus {
  outline: none;
}

.topbar__search-image-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.22rem;
  margin: 0 -0.05rem 0 0;
  color: #94a3b8;
  opacity: 0.55;
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.topbar__search-image-icon {
  display: block;
  flex-shrink: 0;
  width: 19px;
  height: 19px;
}

.topbar__search-image-link:hover {
  color: #64748b;
  opacity: 0.9;
  background: rgba(148, 163, 184, 0.12);
}

.topbar__search-image-link:focus-visible {
  outline: 2px solid rgba(52, 152, 219, 0.45);
  outline-offset: 2px;
  opacity: 1;
}

.topbar__search-submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 2.75rem;
  padding: 0.45rem 1.05rem;
  touch-action: manipulation;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  cursor: pointer;
  background: #3498db;
  border: 2px solid #2980b9;
  border-radius: 10px;
  box-shadow:
    0 2px 10px rgba(52, 152, 219, 0.4),
    0 1px 3px rgba(15, 23, 42, 0.08);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.topbar__search-submit-icon {
  display: block;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
}

.topbar__search-submit:hover {
  background: #2980b9;
  box-shadow:
    0 4px 16px rgba(52, 152, 219, 0.45),
    0 2px 4px rgba(15, 23, 42, 0.1);
}

.topbar__search-submit:active {
  transform: scale(0.99);
}

.topbar__search-submit:focus-visible {
  outline: 3px solid rgba(52, 152, 219, 0.55);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1.1rem;
  flex-wrap: wrap;
}

.topbar__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
}

.topbar__link:hover {
  color: #3498db;
}

.topbar__link:focus-visible {
  outline: 2px solid #3498db;
  outline-offset: 2px;
  border-radius: 2px;
}

.hero {
  position: relative;
  min-height: clamp(16rem, 42vh, 28rem);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 1.25rem max(var(--layout-pad-x), env(safe-area-inset-right)) 1.75rem
    max(var(--layout-pad-x), env(safe-area-inset-left));
  background-color: #c8d8e6;
  background-image: url("assets/hero.png");
  background-size: cover;
  background-position: 78% center;
  background-repeat: no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.55) 45%,
    rgba(255, 255, 255, 0.2) 78%,
    rgba(255, 255, 255, 0.05) 100%
  );
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: min(40rem, 100%);
}

.hero__brand {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1e293b;
}

.hero__titles {
  text-align: left;
}

.hero__title {
  margin: 0;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero__title--accent {
  display: block;
  font-size: clamp(1.45rem, 5.5vw, 3.5rem);
  color: #3498db;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero__title--sub {
  display: block;
  margin-top: 0.1rem;
  font-size: clamp(1.35rem, 5vw, 3.2rem);
  color: #0f172a;
}

.hero__lead {
  margin: 1rem 0 0;
  max-width: 36rem;
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  line-height: 1.55;
  font-weight: 500;
  color: #1e293b;
}

.main {
  padding: 1.5rem max(var(--layout-pad-x), env(safe-area-inset-right)) 4rem
    max(var(--layout-pad-x), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Full-width catalog under centered hero hint */
.main:has(.products-main) {
  align-items: stretch;
}

/* Home catalog: use more viewport width; avoid double horizontal padding (main + section) */
.main:has(.products-main--home) {
  padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
}

@supports (padding: max(0px)) {
  .main {
    padding-bottom: max(4rem, calc(env(safe-area-inset-bottom) + 3rem));
  }
}

.main__hint {
  margin: 0 auto 1.75rem;
  max-width: 34rem;
  text-align: center;
  font-size: clamp(0.85rem, 3.5vw, 0.95rem);
  line-height: 1.55;
  color: #111;
  padding: 0 0.25rem;
}

.main__hint-link {
  display: block;
  margin-top: 0.75rem;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.main__hint-link:hover {
  text-decoration: underline;
}

.main__hint-link + .main__hint-link {
  margin-top: 0.5rem;
}

.topbar-cats__loading,
.topbar-cats__fallback {
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

/* —— All products page —— */
.page-products .topbar {
  flex-wrap: nowrap;
}

.products-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem max(var(--layout-pad-x), env(safe-area-inset-right)) 4rem
    max(var(--layout-pad-x), env(safe-area-inset-left));
  scroll-margin-top: 5rem;
}

.products-main--home {
  max-width: min(1680px, 100%);
  margin-inline: auto;
  padding-top: 0.5rem;
  padding-bottom: 4rem;
  padding-inline: max(0.5rem, env(safe-area-inset-left)) max(0.5rem, env(safe-area-inset-right));
}

/* Home: image-only tiles (no title/price under thumbnail) */
.product-card--image-only .product-card__img {
  border-radius: 10px;
}

.products-toolbar {
  margin-bottom: 1rem;
}

.products-main__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.products-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.products-toolbar__note {
  margin: 0.65rem 0 0;
  max-width: 42rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #64748b;
}

.products-toolbar__note strong {
  color: #475569;
  font-weight: 600;
}

.products-filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.products-filter__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.products-filter__select {
  min-width: min(100%, 16rem);
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.products-status {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: #64748b;
  min-height: 1.25rem;
}

.product-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

/* Max 6 columns — larger thumbnails than 8-up */
@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.2rem;
  }
}

/* Homepage grid: a bit more air between image-only tiles */
.products-main--home .product-grid {
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .products-main--home .product-grid {
    gap: 1rem;
  }
}

@media (min-width: 900px) {
  .products-main--home .product-grid {
    gap: 1.35rem;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.product-card:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.product-card__img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  background: #f1f5f9;
}

.product-card__img--placeholder {
  min-height: 140px;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
}

.product-card__body {
  padding: 0.65rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.product-card__brand {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.product-card__title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  margin-top: auto;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2c7a94;
}

/* Scroll-to-load trigger (homepage; no Load more button) */
.catalog-sentinel {
  width: 100%;
  height: 4px;
  margin-top: 1rem;
  pointer-events: none;
  visibility: hidden;
}

.products-actions {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.products-load-more {
  padding: 0.65rem 1.75rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: #3498db;
  border: 2px solid #2980b9;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.products-load-more:hover:not(:disabled) {
  background: #2980b9;
}

.products-load-more:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.products-filter--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
}

.products-filter--inline input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #2c7a94;
}

.outfit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .outfit-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}

.outfit-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.outfit-card:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.outfit-card__img {
  aspect-ratio: 3/4;
  width: 100%;
  object-fit: cover;
  background: #f1f5f9;
}

.outfit-card__img--placeholder {
  min-height: 160px;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
}

.outfit-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  padding: 0.5rem 0.65rem 0.65rem;
  font-size: 0.75rem;
  color: #64748b;
}

.outfit-card__likes {
  font-weight: 600;
  color: #e11d48;
}

.outfit-card__style {
  text-transform: capitalize;
}

.fab-stack {
  position: fixed;
  right: max(0.5rem, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 10;
}

.fab {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  background: #f472a8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.fab--filter {
  background: radial-gradient(circle at 30% 30%, #fda4c9, #ec4899);
}

.fab--lang {
  background: radial-gradient(circle at 30% 30%, #fbcfe8, #f472b6);
}

.info-btn {
  position: fixed;
  left: max(0.75rem, env(safe-area-inset-left));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid #94a3b8;
  background: #fff;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
}

@media (max-width: 640px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0.6rem 0.75rem;
  }

  .topbar__logo {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .topbar__search-block {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
  }

  .topbar__nav {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  .topbar__search {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.4rem;
    width: 100%;
  }

  .topbar__search-shell {
    flex: 1 1 0%;
    min-width: 0;
    padding: 0.2rem 0.45rem 0.2rem 0.55rem;
    border-width: 1px;
    border-radius: 8px;
    box-shadow:
      0 0 0 1px rgba(52, 152, 219, 0.08),
      0 2px 8px rgba(52, 152, 219, 0.12);
  }

  .topbar__search-shell:focus-within {
    box-shadow:
      0 0 0 3px rgba(52, 152, 219, 0.2),
      0 2px 10px rgba(52, 152, 219, 0.18);
  }

  .topbar__search-input {
    height: 2.2rem;
    font-size: 16px;
    line-height: 1.2;
  }

  .topbar__search-image-icon {
    width: 16px;
    height: 16px;
  }

  .topbar__search-submit {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 0;
    height: 2.6rem;
    align-self: center;
    padding: 0.2rem 0.55rem;
    gap: 0.28rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-width: 1px;
    border-radius: 8px;
    box-shadow:
      0 1px 6px rgba(52, 152, 219, 0.35),
      0 1px 2px rgba(15, 23, 42, 0.06);
    white-space: nowrap;
  }

  .topbar__search-submit-icon {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: clamp(14rem, 36vh, 22rem);
    background-position: 82% center;
    background-size: cover;
  }

  .hero::before {
    background: linear-gradient(
      100deg,
      rgba(255, 255, 255, 0.94) 0%,
      rgba(255, 255, 255, 0.65) 50%,
      rgba(255, 255, 255, 0.25) 100%
    );
  }

  .fab-stack {
    top: auto;
    bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
    transform: none;
  }

  .topbar-cats__link {
    font-size: 0.78rem;
    padding: 0.55rem 0.65rem;
  }
}
