/* ═══════════════════════════════════════════════════
   home.css — 首页 (1:1 对齐 prototype)
   ═══════════════════════════════════════════════════ */

/* —— Hero —— */
.hero {
  position: relative;
  overflow: hidden;
  margin: 0;
  display: flex;
  align-items: center;
  min-height: 420px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(1400px 560px at 18% -8%, #d5e3ef 0%, transparent 58%),
    radial-gradient(1100px 520px at 88% 8%, #ffd4c8 0%, transparent 52%),
    radial-gradient(800px 400px at 70% 100%, #e4ebf2 0%, transparent 55%),
    linear-gradient(180deg, #f1f5f8 0%, var(--paper) 100%);
}

/* Hero 背景装饰 */
.hero-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-backdrop .grid-fade {
  position: absolute;
  inset: 0;
  opacity: .45;
  background-image:
    linear-gradient(rgba(17, 20, 24, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 20, 24, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 35%, #000 100%);
}
.hero-backdrop .sweep {
  position: absolute;
  inset: 0;
  opacity: .35;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent 0 22px,
      rgba(17, 20, 24, .03) 22px 23px
    );
}
.hero-backdrop .soft-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
}
.hero-backdrop .soft-orb.a {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  right: 8%;
  top: 12%;
  background: radial-gradient(circle, rgba(232, 78, 47, .14), transparent 68%);
  animation: drift 14s ease-in-out infinite alternate;
}
.hero-backdrop .soft-orb.b {
  width: 30vw;
  height: 30vw;
  max-width: 360px;
  max-height: 360px;
  right: 28%;
  bottom: 6%;
  background: radial-gradient(circle, rgba(80, 130, 170, .16), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate-reverse;
}

/* Hero 右侧 SVG 图形 */
.hero-graphic {
  position: absolute;
  right: max(2%, calc((100% - 1180px) / 2 - 40px));
  top: 50%;
  width: min(420px, 40vw);
  aspect-ratio: 1;
  transform: translateY(-50%);
  opacity: 0;
  animation: fade-in 1s var(--ease) .2s forwards;
}
.hero-graphic svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.hero-graphic .ring {
  fill: none;
  stroke: rgba(17, 20, 24, .1);
  stroke-width: 1.25;
}
.hero-graphic .spin {
  transform-origin: 200px 200px;
  animation: spin-slow 42s linear infinite;
}
.hero-graphic .spin.reverse {
  animation-duration: 56s;
  animation-direction: reverse;
}
.hero-graphic .tile {
  animation: tile-float 5.5s ease-in-out infinite;
}
.hero-graphic .tile:nth-of-type(1) { animation-delay: 0s; }
.hero-graphic .tile:nth-of-type(2) { animation-delay: .4s; }
.hero-graphic .tile:nth-of-type(3) { animation-delay: .8s; }
.hero-graphic .tile:nth-of-type(4) { animation-delay: 1.2s; }
.hero-graphic .tile:nth-of-type(5) { animation-delay: .2s; }
.hero-graphic .hub {
  filter: drop-shadow(0 10px 18px rgba(17, 20, 24, .12));
}

/* Hero 前景内容 */
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 28px;
  padding: 40px 0;
}
.hero-cta:empty {
  display: none;
}
.hero-brand {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 680px;
  opacity: 0;
  transform: translateY(28px);
  animation: rise .9s var(--ease) .08s forwards;
}
.hero-brand .wordmark {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 100px);
  font-weight: 900;
  letter-spacing: -.045em;
  line-height: .92;
  color: var(--ink);
}
.hero-brand .wordmark em {
  font-style: normal;
  color: var(--accent);
}
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}
.hero-lead {
  max-width: 400px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 400;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(20px);
  animation: rise .85s var(--ease) .28s forwards;
}

.catalog.is-loading {
  opacity: .72;
  pointer-events: none;
  transition: opacity .2s var(--ease);
}
.wall-empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* —— Catalog —— */
.catalog {
  padding: 56px 0 72px;
}
.catalog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(16px);
  animation: rise .7s var(--ease) .2s forwards;
}
.catalog-head .filter-count {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.65);
}
.filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.filter:hover { color: var(--ink); }
.filter.active {
  background: var(--ink);
  color: #fff;
}

/* —— Software Wall —— */
.wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.app-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  opacity: 0;
  transform: translateY(22px);
  animation: rise .55s var(--ease) var(--delay, 0ms) both;
  transition: transform .28s var(--ease), border-color .28s, box-shadow .28s;
}
.app-tile:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: 0 16px 36px rgba(17, 20, 24, .1);
}
.app-cover {
  position: relative;
  height: 148px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.7), transparent 55%),
    linear-gradient(145deg, var(--brand-soft) 0%, var(--brand-soft-2) 100%);
  overflow: hidden;
}
.app-cover::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% 20%;
  height: 80%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%);
  pointer-events: none;
}
.app-icon {
  position: relative;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--brand);
  color: #fff;
  box-shadow:
    0 12px 28px color-mix(in srgb, var(--brand) 35%, transparent),
    inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .35s var(--ease);
}
.app-tile:hover .app-icon { transform: scale(1.05) rotate(-2deg); }
.app-icon img { width: 46px; height: 46px; object-fit: contain; }
.icon-fallback {
  display: block;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  opacity: .92;
}
.app-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 16px 14px;
  min-height: 132px;
}
.app-body h3 {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}
.app-meta {
  color: #8a939e;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.open {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}
.open::after { content: " →"; }

/* —— Load More —— */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}
.load-more-wrap[hidden] {
  display: none;
}
.load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.7);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s, box-shadow .2s;
}
.load-more:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 6px 16px rgba(17, 20, 24, .06);
}
.load-more:disabled {
  cursor: wait;
  opacity: .7;
}

/* —— Page Footer —— */
.site-footer-lite {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 56px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.site-footer-lite .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.site-footer-lite .footer-links a:hover { color: var(--ink); }

/* —— 响应式 —— */
@media (max-width: 1100px) {
  .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { min-height: 360px; }
  .hero-inner { padding: 36px 0; }
  .hero-graphic { width: min(340px, 36vw); right: 1%; }
}

@media (max-width: 820px) {
  .hero-graphic { display: none; }
  .hero-backdrop .grid-fade {
    mask-image: linear-gradient(180deg, #000 20%, transparent 90%);
    opacity: .3;
  }
  .hero-backdrop .soft-orb.a {
    right: -18%; top: -8%; width: 70vw; height: 70vw;
  }
  .hero-backdrop .soft-orb.b {
    right: 8%; bottom: -20%; width: 55vw; height: 55vw;
  }
  .hero { min-height: 280px; }
  .hero-inner { gap: 20px; padding: 32px 0; }
  .hero-brand { gap: 12px; max-width: none; }
  .hero-brand .wordmark { font-size: clamp(40px, 12vw, 56px); }
  .hero-headline { font-size: 20px; }
  .hero-lead { max-width: none; font-size: 14px; line-height: 1.65; }
  .hero-cta { width: 100%; margin-top: 4px; gap: 10px; }
  .hero-cta .btn { flex: 1; min-width: 0; height: 44px; padding: 0 16px; font-size: 13px; }

  .catalog { padding: 28px 0 48px; }
  .catalog-head {
    flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 18px;
  }
  .catalog-head .filter-count { font-size: 12px; order: 2; }
  .filters {
    width: 100%; order: 1; justify-content: stretch; gap: 4px; border-radius: 9px;
  }
  .filter { flex: 1; height: 38px; padding: 0 10px; font-size: 13px; border-radius: 6px; }

  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .app-tile { border-radius: 12px; }
  .app-cover { height: 108px; }
  .app-icon { width: 58px; height: 58px; border-radius: 15px; }
  .app-icon img { width: 32px; height: 32px; }
  .icon-fallback { font-size: 11px; }
  .app-body { min-height: 0; padding: 12px 12px 11px; }
  .app-body h3 { font-size: 13px; line-height: 1.3; }
  .desc { margin-top: 4px; font-size: 11px; line-height: 1.45; -webkit-line-clamp: 2; }
  .card-bottom { padding-top: 10px; }
  .app-meta { font-size: 10px; }
  .open { font-size: 11px; }

  .load-more-wrap { margin-top: 24px; }
  .load-more { width: 100%; max-width: 280px; height: 42px; }

  .site-footer-lite {
    flex-direction: column; align-items: flex-start; gap: 12px;
    margin-top: 36px; padding: 22px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .site-footer-lite .footer-links { gap: 6px 16px; }
}

@media (max-width: 420px) {
  .hero-brand .wordmark { font-size: 38px; }
  .hero-headline { font-size: 18px; }
  .hero-cta { gap: 8px; }
  .hero-cta .btn { flex: 1; min-width: 0; padding: 0 12px; font-size: 12px; }
  .wall { gap: 8px; }
  .app-cover { height: 96px; }
  .app-icon { width: 52px; height: 52px; border-radius: 13px; }
  .app-icon img { width: 28px; height: 28px; }
  .app-body { padding: 10px; }
  .app-body h3 { font-size: 12px; }
  .desc { font-size: 10px; }
  .open { font-size: 10px; }
  .open::after { content: ""; }
}
