/* BP Shell v3 — home layout rewrite */

.page-home .bp-hero,
.page-home .home-hero,
.page-home .search-section.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 300px;
  padding: 78px 20px 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  background:
    radial-gradient(60vmax 40vmax at 15% -10%, rgba(255,255,255,.28), transparent 55%),
    radial-gradient(50vmax 36vmax at 90% 110%, rgba(54,207,201,.35), transparent 50%),
    linear-gradient(-45deg, #0f6fd8, #1677ff, #1890ff, #36cfc9, #40a9ff, #096dd9) !important;
  background-size: auto, auto, 320% 320% !important;
  animation: bpHomeBg 14s ease infinite;
}

@keyframes bpHomeBg {
  0% { background-position: 0 0, 0 0, 0% 50%; }
  50% { background-position: 0 0, 0 0, 100% 50%; }
  100% { background-position: 0 0, 0 0, 0% 50%; }
}

.page-home .bp-hero__inner,
.page-home .home-hero-inner,
.page-home .search-content.home-hero-inner {
  position: relative;
  z-index: 2;
  width: min(740px, 100%);
  text-align: center;
  color: #fff;
}

.page-home .home-hero-domain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  font-size: 12px;
  letter-spacing: .04em;
}

.page-home .home-hero-title,
.page-home .search-slogan {
  font-size: clamp(32px, 5.5vw, 48px);
  font-weight: 860;
  letter-spacing: .02em;
  margin: 0 0 10px;
  color: #fff;
  text-shadow: 0 8px 28px rgba(0,0,0,.18);
}

.page-home .search-subtitle {
  color: rgba(255,255,255,.9);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 auto 22px;
  max-width: 42ch;
}

.page-home .home-hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.page-home .home-hero-search .search-input,
.page-home .search-box .search-input {
  width: 100%;
  height: 52px;
  border-radius: 999px;
  border: 0;
  padding: 0 56px 0 20px;
  font-size: 15px;
  box-shadow: 0 14px 36px rgba(0,0,0,.16);
}

.page-home .home-hero-search .search-btn,
.page-home .search-box .search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--bp-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.page-home .home-hero-cta {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.page-home .home-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.page-home .home-cta-primary {
  background: #ff7a45;
  color: #fff;
  box-shadow: 0 10px 22px rgba(255,122,69,.35);
}

.page-home .home-cta-ghost {
  background: rgba(255,255,255,.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
}

/* Explore strip */
.page-home .bp-explore,
.page-home .home-explore {
  max-width: 1480px;
  margin: -18px auto 0;
  padding: 0 16px 8px;
  position: relative;
  z-index: 3;
}

.page-home .bp-explore__row,
.page-home .home-quick-links,
.page-home .search-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 4px;
  scrollbar-width: none;
}

.page-home .bp-explore__row::-webkit-scrollbar,
.page-home .home-quick-links::-webkit-scrollbar,
.page-home .search-tags::-webkit-scrollbar { display: none; }

.page-home .home-quick-links a,
.page-home .search-tag {
  flex: 0 0 auto;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--bp-line);
  padding: 9px 14px;
  color: var(--bp-ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(24,144,255,.08);
  backdrop-filter: blur(8px);
}

.page-home .home-quick-links a:hover,
.page-home .search-tag:hover {
  color: var(--bp-blue);
  border-color: rgba(24,144,255,.3);
}

/* Stage */
.page-home .bp-stage,
.page-home .content-wrapper {
  display: grid !important;
  grid-template-columns: var(--bp-rail-w) minmax(0, 1fr);
  gap: 18px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px 16px 48px;
  background: transparent !important;
  align-items: start;
}

.page-home .bp-stage:has(.bp-rail:hover),
.page-home .bp-stage:has(.bp-rail.expanded),
.page-home .content-wrapper:has(#pcSidebar:hover),
.page-home .content-wrapper:has(#pcSidebar.expanded) {
  grid-template-columns: var(--bp-rail-w-open) minmax(0, 1fr);
}

.page-home .bp-stream,
.page-home .main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.page-home .category-card,
.page-home .featured-sites-card,
.page-home .sidebar-card,
.page-home .hot-articles-card,
.page-home .home-featured-card {
  border-radius: 20px !important;
  border: 1px solid var(--bp-line) !important;
  box-shadow: var(--bp-shadow-soft) !important;
  background: #fff !important;
  padding: 18px !important;
}

.page-home .category-header {
  border-bottom: 0 !important;
  margin-bottom: 12px;
}

.page-home .category-title {
  font-size: 17px !important;
  font-weight: 800 !important;
}

.page-home .category-title::before {
  width: 4px !important;
  height: 16px !important;
  border-radius: 4px !important;
  background: linear-gradient(180deg, #40a9ff, #1890ff) !important;
}

.page-home .sites-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 10px !important;
}

.page-home .site-card {
  border-radius: 14px !important;
  border: 1px solid transparent !important;
  background: linear-gradient(180deg, #f7fbff, #fff) !important;
  padding: 12px !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease !important;
}

.page-home .site-card:hover {
  transform: translateY(-2px);
  border-color: rgba(24,144,255,.22) !important;
  box-shadow: var(--bp-shadow) !important;
}

/* 手机端：精选/分类站点一行 2 个（需压过 body.bp-shell .sites-grid） */
@media (max-width: 768px) {
  body.page-home.bp-shell .sites-grid,
  body.page-home.bp-shell #homeFeaturedGrid,
  body.page-home.bp-shell .top-sites-grid,
  body.page-home.bp-shell [id^="sites-grid-"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .page-home .home-featured-card,
  .page-home .category-card {
    padding: 14px 12px !important;
  }

  .page-home .site-card:not(.site-card-style2) {
    padding: 8px 9px !important;
    border-radius: 12px !important;
    min-height: 0 !important;
    gap: 8px !important;
  }

  .page-home .site-card:not(.site-card-style2) .site-icon,
  .page-home .site-card:not(.site-card-style2) .site-icon-frame {
    width: 36px !important;
    height: 36px !important;
    border-radius: 9px !important;
  }

  .page-home .site-card:not(.site-card-style2) .site-name {
    font-size: 12.5px !important;
    margin-bottom: 2px !important;
  }

  .page-home .site-card:not(.site-card-style2) .site-desc {
    font-size: 11px !important;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

.page-home .right-sidebar,
.page-home .home-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---- sidebar-top-card：信标面板 ---- */
.page-home .sidebar-top-card.bp-beacon {
  position: relative;
  overflow: hidden;
  border-radius: 22px 22px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), #fff 42%),
    radial-gradient(120% 80% at 100% 0%, rgba(24, 144, 255, 0.08), transparent 55%);
  border: 1px solid rgba(24, 144, 255, 0.14);
  box-shadow:
    0 14px 34px rgba(15, 111, 216, 0.1),
    0 2px 8px rgba(31, 45, 61, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.page-home .sidebar-top-card.bp-beacon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #40a9ff, #1890ff 45%, #0f6fd8 78%, #36cfc9);
  z-index: 3;
}

.page-home .bp-beacon .sidebar-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 10px 0;
  padding: 18px 16px;
  border-radius: 16px;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(145deg, #0b4f9c 0%, #0f6fd8 42%, #1890ff 72%, #36cfc9 130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.page-home .bp-beacon .sidebar-banner::before,
.page-home .bp-beacon .sidebar-banner::after {
  display: none; /* 关掉旧漂浮圆，改用 mesh/shine */
}

.page-home .bp-beacon .banner-mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.35), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.18), transparent 22%),
    repeating-linear-gradient(
      -18deg,
      transparent 0 10px,
      rgba(255, 255, 255, 0.045) 10px 11px
    );
}

.page-home .bp-beacon .banner-shine {
  position: absolute;
  top: -40%;
  left: -35%;
  width: 42%;
  height: 180%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 42%,
    rgba(255, 255, 255, 0.34) 50%,
    rgba(255, 255, 255, 0.08) 58%,
    transparent 100%
  );
  transform: skewX(-18deg);
  animation: bpBeaconShine 5.8s ease-in-out infinite;
}

@keyframes bpBeaconShine {
  0%, 55% { transform: translateX(0) skewX(-18deg); opacity: 0; }
  62% { opacity: 1; }
  78% { transform: translateX(380%) skewX(-18deg); opacity: 0.55; }
  100% { transform: translateX(380%) skewX(-18deg); opacity: 0; }
}

.page-home .bp-beacon .banner-logo {
  position: relative;
  z-index: 2;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.28),
    0 8px 18px rgba(0, 40, 100, 0.22);
  overflow: visible;
}

.page-home .bp-beacon .banner-orbit {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.7);
  animation: bpBeaconOrbit 14s linear infinite;
  pointer-events: none;
}

@keyframes bpBeaconOrbit {
  to { transform: rotate(360deg); }
}

.page-home .bp-beacon .banner-logo img,
.page-home .bp-beacon .banner-logo svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.page-home .bp-beacon .banner-text {
  position: relative;
  z-index: 2;
  min-width: 0;
  flex: 1;
}

.page-home .bp-beacon .banner-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
}

.page-home .bp-beacon .banner-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #95de64;
  box-shadow: 0 0 0 0 rgba(149, 222, 100, 0.7);
  animation: bpBeaconPulse 1.8s ease-out infinite;
}

@keyframes bpBeaconPulse {
  0% { box-shadow: 0 0 0 0 rgba(149, 222, 100, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(149, 222, 100, 0); }
  100% { box-shadow: 0 0 0 0 rgba(149, 222, 100, 0); }
}

.page-home .bp-beacon .banner-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 30, 80, 0.25);
}

.page-home .bp-beacon .banner-desc {
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-home .bp-beacon .sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 10px 12px;
}

.page-home .bp-beacon .sidebar-stat-item {
  position: relative;
  text-align: left;
  padding: 12px 12px 11px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fbff, #fff);
  border: 1px solid rgba(24, 144, 255, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.page-home .bp-beacon .sidebar-stat-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--bp-blue);
}

.page-home .bp-beacon .sidebar-stat-item[data-tone="blue"]::before { background: #1890ff; }
.page-home .bp-beacon .sidebar-stat-item[data-tone="teal"]::before { background: #13c2c2; }
.page-home .bp-beacon .sidebar-stat-item[data-tone="coral"]::before { background: #ff7a45; }
.page-home .bp-beacon .sidebar-stat-item[data-tone="amber"]::before { background: #faad14; }

.page-home .bp-beacon .sidebar-stat-item:hover {
  transform: translateY(-2px);
  border-color: rgba(24, 144, 255, 0.22);
  box-shadow: 0 8px 18px rgba(24, 144, 255, 0.1);
}

.page-home .bp-beacon .stat-num {
  margin: 0 0 2px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.page-home .bp-beacon .sidebar-stat-item[data-tone="blue"] .stat-num { color: #0f6fd8; }
.page-home .bp-beacon .sidebar-stat-item[data-tone="teal"] .stat-num { color: #08979c; }
.page-home .bp-beacon .sidebar-stat-item[data-tone="coral"] .stat-num { color: #d4380d; }
.page-home .bp-beacon .sidebar-stat-item[data-tone="amber"] .stat-num { color: #d48806; }

.page-home .bp-beacon .stat-text {
  font-size: 11px;
  color: var(--bp-muted);
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .page-home .bp-beacon .banner-shine,
  .page-home .bp-beacon .banner-orbit,
  .page-home .bp-beacon .banner-pulse {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  .page-home .bp-hero,
  .page-home .home-hero { min-height: 250px; padding-top: 68px; }
  .page-home .bp-stage,
  .page-home .content-wrapper {
    grid-template-columns: 1fr !important;
    padding-left: 12px;
    padding-right: 12px;
  }
}
