/* Carousell HK 首页视觉样式复刻（仅外观，非官方资源） */

:root {
  --bg-page: #000000;
  --bg-elevated: #2b2b2c;
  --bg-input: #414244;
  --bg-banner: #1a1a1b;
  --text-primary: #f0f1f1;
  --text-secondary: #c5c5c6;
  --text-muted: #8a8a8c;
  --brand-red: #cc1e2b;
  --brand-red-hover: #b31a26;
  --accent-teal: #00bfa2;
  --accent-teal-dim: rgba(0, 143, 121, 0.2);
  --border-subtle: #575859;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 20px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Droid Sans",
    "Helvetica Neue", sans-serif;
  --shadow-fab: 0 4px 16px rgba(204, 30, 43, 0.45);
  --content-max: 1216px;
  --header-z: 100;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.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;
}

/* 顶部 App 提示条 */
.app-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 10px 16px;
  background: var(--bg-banner);
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid #1f1f20;
}

.app-banner__link {
  color: var(--accent-teal);
  font-weight: 500;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--header-z);
  background: var(--bg-page);
  padding: 12px 16px 16px;
}

.site-header__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  max-width: var(--content-max);
  margin: 0 auto 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo__wordmark {
  display: none;
  height: 22px;
  width: auto;
}

@media (min-width: 768px) {
  .logo__wordmark {
    display: block;
  }
}

.main-nav {
  display: none;
  flex: 1;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.main-nav a,
.main-nav__more {
  padding: 0 12px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.15s;
}

.main-nav a:hover,
.main-nav__more:hover {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-actions__link {
  font-size: 14px;
  color: var(--text-secondary);
}

.header-actions__link:hover {
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.15s;
}

.btn--sell {
  padding: 8px 16px;
  font-size: 16px;
  background: var(--brand-red);
  color: #fff;
}

.btn--sell:hover {
  background: var(--brand-red-hover);
}

.search-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.search-form:focus-within {
  outline: 1px solid var(--border-subtle);
}

.search-form__icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
}

.search-form input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
}

.search-form input::placeholder {
  color: var(--text-muted);
}

.location-field {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  min-width: 140px;
}

.location-field input {
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
  outline: none;
}

/* Main */
.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px 96px;
}

/* Hero carousel */
.hero-carousel {
  margin: 8px 0 24px;
  overflow: hidden;
}

.hero-carousel__track {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding-bottom: 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.hero-carousel__track::-webkit-scrollbar {
  display: none;
}

.promo-card {
  flex: 0 0 78%;
  min-height: 120px;
  border-radius: var(--radius-md);
  scroll-snap-align: center;
  position: relative;
  overflow: hidden;
  display: block;
  background: var(--bg-elevated);
}

.promo-card--banner {
  flex: 0 0 85%;
}

.promo-card--banner img {
  width: 100%;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
}

/* Sections */
.section {
  margin-bottom: 32px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section__title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.section__link {
  color: var(--accent-teal);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.section__link:hover {
  text-decoration: underline;
}

/* Categories */
.category-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.category-card {
  flex: 0 0 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  color: var(--text-secondary);
}

.category-card__icon {
  width: 104px;
  height: 104px;
  border-radius: var(--radius-md);
  background: #2b2b2c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}

.category-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.category-card:hover .category-card__icon {
  transform: scale(1.02);
  transition: transform 0.15s;
}

/* Chips */
.chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
  padding-bottom: 4px;
}

.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--text-secondary);
  color: #fff;
  font-size: 13.33px;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}

.chip:hover {
  border-color: var(--text-primary);
}

.chip--active {
  border-color: var(--accent-teal);
  background: var(--accent-teal-dim);
}

/* Listing cards - horizontal scroll */
.listing-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.listing-card {
  flex: 0 0 200px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.listing-card__seller {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  min-height: 28px;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-input);
  flex-shrink: 0;
  object-fit: cover;
}

.seller-name {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
}

.seller-time {
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.listing-card__media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
}

.listing-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.badge--buyer {
  background: rgba(0, 191, 162, 0.9);
  color: #000;
}

.listing-card__body {
  flex: 1;
}

.listing-card__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.listing-card__price {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.listing-card__condition {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.listing-card__like {
  align-self: flex-start;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.listing-card__like:hover {
  color: var(--brand-red);
}

/* Deals grid */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 16px;
}

.listing-card--grid {
  flex: none;
  width: 100%;
}

/* Footer */
.site-footer {
  padding: 32px 0 24px;
  text-align: center;
  border-top: 1px solid #1f1f20;
  color: var(--text-secondary);
}

.site-footer__note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* FAB 出售 */
.fab-sell {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: var(--brand-red);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-fab);
  transition: transform 0.15s, background 0.15s;
}

.fab-sell:hover {
  background: var(--brand-red-hover);
  transform: translateY(-1px);
}

.fab-sell__icon {
  font-size: 20px;
  line-height: 1;
}

/* —— Desktop —— */
@media (min-width: 768px) {
  .app-banner {
    padding: 10px 24px;
    justify-content: center;
  }

  .site-header {
    padding: 12px 24px 16px;
  }

  .main-nav {
    display: flex;
  }

  .search-row {
    flex-direction: row;
    align-items: stretch;
  }

  .search-form {
    flex: 1;
  }

  .location-field {
    display: flex;
  }

  .page {
    padding: 0 24px 80px;
  }

  .hero-carousel__track {
    justify-content: center;
  }

  .promo-card {
    flex: 0 0 52%;
    min-height: 200px;
  }

  .promo-card--side {
    flex: 0 0 18%;
  }

  .category-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    overflow: visible;
    gap: 12px;
  }

  .category-card {
    flex: none;
    width: auto;
  }

  .category-card__icon {
    width: 100%;
    max-width: 128px;
    height: auto;
    aspect-ratio: 1;
  }

  .hero-carousel__track {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 12px;
    overflow: visible;
  }

  .promo-card--banner {
    flex: none;
    min-height: 200px;
  }

  .promo-card--extra {
    display: none;
  }

  .promo-card--center {
    grid-column: auto;
  }

  .app-banner {
    display: none;
  }

  .listing-scroll .listing-card {
    flex: 0 0 240px;
  }

  .listing-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .header-actions .btn--sell {
    display: inline-flex;
  }

  .fab-sell {
    display: none;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .main-nav a:nth-child(n + 5) {
    display: none;
  }

  .listing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .header-actions .btn--sell {
    display: none;
  }

  .section__title {
    font-size: 20px;
  }
}

/* —— 人机验证浮层（透明背景，不遮灰全屏） —— */
.captcha-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.captcha-overlay .captcha-modal {
  pointer-events: auto;
}

.captcha-overlay--hide {
  opacity: 0;
  pointer-events: none;
}

.captcha-modal {
  width: min(100%, 380px);
  min-height: 140px;
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #111;
}

.captcha-opening {
  display: flex;
  justify-content: center;
  width: 100%;
}

.captcha-ring {
  width: 31px;
  height: 31px;
  border: 4px solid #dedede;
  border-top-color: #353535;
  border-right-color: #353535;
  border-radius: 50%;
  animation: captcha-spin 0.85s linear infinite;
}

.captcha-ring.paused {
  animation-play-state: paused;
}

@keyframes captcha-spin {
  to {
    transform: rotate(360deg);
  }
}

.captcha-challenge {
  display: none;
  width: 100%;
}

.captcha-challenge.visible {
  display: block;
}

.captcha-challenge-box {
  display: grid;
  grid-template-columns: 1fr 91px;
  width: 300px;
  max-width: 100%;
  height: 66px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #fafafa;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.captcha-challenge-main {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  gap: 11px;
}

.captcha-human-check {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin: 0;
  appearance: none;
  border: 2px solid #555;
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
}

.captcha-human-check:checked {
  background: #fff;
}

.captcha-human-check:focus-visible {
  outline: 2px solid #7aa7d8;
  outline-offset: 2px;
}

.captcha-inline-ring {
  display: none;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 3px solid #dedede;
  border-top-color: #353535;
  border-right-color: #353535;
  border-radius: 50%;
  animation: captcha-spin 0.85s linear infinite;
}

.captcha-challenge.verifying .captcha-human-check {
  display: none;
}

.captcha-challenge.verifying .captcha-inline-ring {
  display: block;
}

.captcha-state-label {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  color: #1a1a1a;
  cursor: pointer;
}

.captcha-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 3px;
  color: #000;
  font-family: Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1.2px;
  border-left: 1px solid #e8e8e8;
  background: #f5f5f5;
}

.captcha-cloud {
  position: relative;
  width: 31px;
  height: 8px;
  margin-bottom: 4px;
  border-radius: 8px 8px 3px 3px;
  background: #f48120;
}

.captcha-cloud::before,
.captcha-cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: #f48120;
}

.captcha-cloud::before {
  left: 4px;
  width: 12px;
  height: 12px;
}

.captcha-cloud::after {
  right: 3px;
  width: 17px;
  height: 17px;
}

.captcha-brand-links {
  margin-top: 3px;
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0;
  color: #555;
}

.captcha-brand-links a {
  color: #555;
  text-decoration: none;
}

@media (max-width: 400px) {
  .captcha-modal {
    padding: 36px 20px;
  }

  .captcha-challenge-box {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .captcha-ring,
  .captcha-inline-ring {
    animation-duration: 1.5s;
  }
}