/* ========================================
   宠光科技首页 - A 方案立体产品轮播
   ======================================== */

.home-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-height) + 48px) 0 38px;
  background: linear-gradient(180deg, var(--color-cream) 0%, #FFF5E6 52%, var(--color-cream-light) 100%);
}

.home-hero::before {
  content: '';
  position: absolute;
  top: 110px;
  right: -130px;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 179, 71, 0.14) 0%, transparent 68%);
  pointer-events: none;
}

.home-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 20px;
}

.home-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  color: #AC482B;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.home-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.home-hero h1 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: clamp(1.5rem, 4.6vw, 3.2rem);
  white-space: nowrap;
  font-weight: 800;
  line-height: 1.26;
  letter-spacing: -0.04em;
}

.home-hero h1 em {
  color: #AC482B;
  font-style: normal;
}

.home-filters button:focus-visible,
.home-product-card:focus-visible,
.home-show-all:focus-visible {
  outline: 2px solid #AC482B;
  outline-offset: 3px;
}

/* ---------- 3D product orbit ---------- */
.home-orbit {
  position: relative;
  min-width: 0;
}

.home-orbit-viewport {
  position: relative;
  height: 460px;
  isolation: isolate;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.home-orbit-viewport[data-dragging="true"] {
  cursor: grabbing;
}

.home-orbit-viewport::before {
  content: '';
  position: absolute;
  inset: 44px 22px 32px;
  background: radial-gradient(ellipse at center, rgba(239, 221, 186, 0.62) 0%, transparent 68%);
  pointer-events: none;
}

.home-orbit-ring {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 23px;
  height: 63px;
  border: 1px solid rgba(160, 138, 108, 0.22);
  border-radius: 50%;
  transform: rotate(-7deg);
  pointer-events: none;
}

.home-orbit-ring::after {
  content: '';
  position: absolute;
  inset: 10px 15%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(160, 138, 108, 0.22) 0%, transparent 72%);
  filter: blur(5px);
}

.home-orbit-track {
  position: absolute;
  inset: 0;
  perspective: 900px;
  transform-style: preserve-3d;
  pointer-events: none;
}

.home-orbit-card {
  position: absolute;
  top: 48%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 252px;
  height: 336px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-card-bg);
  box-shadow: 0 18px 34px -21px rgba(93, 78, 55, 0.4);
  backface-visibility: hidden;
  transform-origin: center;
  will-change: transform, opacity;
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  -webkit-user-drag: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-orbit-card:hover {
  border-color: rgba(172, 72, 43, 0.35);
  box-shadow: 0 20px 38px -21px rgba(93, 78, 55, 0.45);
}

.home-orbit-card:focus-visible {
  outline: 2px solid #AC482B;
  outline-offset: 3px;
}

.home-orbit-viewport[data-dragging="true"] .home-orbit-card {
  cursor: grabbing;
}

.home-orbit-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  color: var(--color-text-light);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.home-orbit-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 147px;
  flex-shrink: 0;
  margin: 16px 0 14px;
  border-radius: 18px;
  overflow: hidden;
}

.home-orbit-icon::before {
  content: '';
  position: absolute;
  width: 104px;
  height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  transform: scale(1.35);
}

.home-orbit-icon img {
  position: relative;
  width: 98px;
  height: 98px;
  border-radius: 22px;
  object-fit: cover;
}

.home-orbit-card[data-category="学习成长"] .home-orbit-icon { background: #E6EDD7; }
.home-orbit-card[data-category="生活整理"] .home-orbit-icon { background: #E6E1F3; }
.home-orbit-card[data-category="效率工具"] .home-orbit-icon { background: #F3E5D4; }
.home-orbit-card[data-category="轻松一刻"] .home-orbit-icon { background: #DBEAED; }

.home-orbit-card h2 {
  margin: 0 0 8px;
  color: var(--color-text-primary);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.home-orbit-card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}


/* ---------- Platform strip ---------- */
.home-platform-strip {
  border-block: 1px solid var(--color-border);
  background: rgba(255, 253, 247, 0.5);
}

.home-platform-strip .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-block: 14px;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

.home-platform-strip b {
  color: var(--color-text-primary);
  font-weight: 600;
}

/* ---------- Catalog ---------- */
.home-catalog {
  padding: 56px 0 60px;
}

/* 联系模块：收紧与上方产品目录的间距 */
#contact {
  padding-top: 32px;
}

.home-catalog-head {
  margin-bottom: 22px;
}

.home-catalog-head h2 {
  margin: 0 0 8px;
  color: var(--color-text-primary);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.home-catalog-head p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.75;
}

.home-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.home-filters button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.home-filters button:hover {
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

.home-filters button[aria-pressed="true"] {
  border-color: #333C2F;
  background: #333C2F;
  color: #FFFDF6;
}
.home-filter-divider {
  width: 1px;
  align-self: stretch;
  margin: 6px 4px;
  background: var(--color-border);
}

.home-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-product-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 198px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-card-bg);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.home-product-card:hover {
  color: var(--color-text-primary);
  transform: translateY(-4px);
  border-color: rgba(172, 72, 43, 0.3);
  box-shadow: 0 12px 26px rgba(93, 78, 55, 0.1);
}

.home-product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-product-head img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  object-fit: cover;
}

.home-product-cat {
  color: var(--color-text-light);
  font-size: 0.7rem;
  white-space: nowrap;
}

.home-product-card h3 {
  margin: 1px 0 0;
  color: var(--color-text-primary);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
}

.home-product-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 4.2em;
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  line-height: 1.75;
}

.home-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.home-platform-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-cream);
  color: var(--color-text-secondary);
  font-size: 0.7rem;
  line-height: 1.6;
}

.home-show-all {
  display: block;
  min-height: 42px;
  margin: 22px auto 0;
  padding: 9px 20px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.home-show-all:hover {
  border-color: #AC482B;
  color: #AC482B;
}

.home-show-all[hidden] {
  display: none !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .home-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .home-hero {
    padding-top: calc(var(--nav-height) + 34px);
  }

  .home-hero-grid {
    grid-template-columns: 1fr;
    gap: 26px;
    min-height: 0;
  }

  .home-orbit {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  /* 产品下拉在移动端会展开成完整列表，给菜单一个可滚动高度 */
  .navbar-nav {
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .home-hero {
    padding-bottom: 28px;
  }

  .home-orbit-viewport {
    height: 325px;
  }

  .home-orbit-card {
    width: 182px;
    height: 250px;
    padding: 15px;
    border-radius: 22px;
  }

  .home-orbit-card header {
    font-size: 0.7rem;
  }

  .home-orbit-card h2 {
    font-size: 1.05rem;
  }

  .home-orbit-card p {
    font-size: 0.78rem;
  }

  .home-orbit-icon {
    height: 104px;
    margin: 11px 0 10px;
  }

  .home-orbit-icon::before {
    width: 80px;
    height: 80px;
  }

  .home-orbit-icon img {
    width: 68px;
    height: 68px;
  }

  .home-catalog {
    padding: 44px 0 48px;
  }

  .home-catalog-head h2 {
    font-size: 1.5rem;
  }

  .home-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .home-orbit-viewport {
    height: 315px;
    margin-inline: -4%;
  }

  .home-orbit-card {
    width: 166px;
    height: 237px;
    padding: 13px;
    border-radius: 19px;
  }

  .home-orbit-card header {
    font-size: 0.68rem;
  }

  .home-orbit-card h2 {
    font-size: 0.92rem;
  }

  .home-orbit-card p {
    font-size: 0.75rem;
  }

  .home-orbit-icon {
    height: 96px;
    margin: 10px 0;
  }

  .home-orbit-icon::before {
    width: 72px;
    height: 72px;
  }

  .home-orbit-icon img {
    width: 64px;
    height: 64px;
  }

  .home-product-grid {
    grid-template-columns: 1fr;
  }

  .home-product-card {
    min-height: 0;
  }

  .home-product-desc {
    min-height: 0;
  }

  .home-filters button {
    padding: 8px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-product-card,
  .home-show-all {
    transition: none;
  }
}
