/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-size: 48px 48px;
}

.hero-glow {
  position: absolute;
  inset: 0;
}

.hero-glow::before,
.hero-glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.hero-glow::before {
  top: -180px;
  left: 8%;
  width: 560px;
  height: 420px;
  background: var(--glow-1);
}

.hero-glow::after {
  top: -80px;
  right: 4%;
  width: 480px;
  height: 380px;
  background: var(--glow-2);
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 64px;
  padding-top: 92px;
  padding-bottom: 104px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  height: 32px;
  padding: 0 12px 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}

.hero-badge:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.hero-badge .icon {
  transition: transform 0.15s;
}

.hero-badge:hover .icon {
  transform: translateX(2px);
}

.hero-badge-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pulse {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero-title {
  margin-top: 26px;
  font-size: clamp(40px, 6.2vw, 68px);
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.gradient-text {
  background: linear-gradient(110deg, var(--accent) 0%, #0ea5e9 55%, #22c55e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 540px;
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.hero-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 13.5px;
}

.hero-topics li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-topics .icon {
  color: var(--tint);
  font-size: 16px;
}

/* ---------- 代码窗口 ---------- */

.hero-visual {
  position: relative;
}

.editor {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: perspective(1600px) rotateY(-7deg) rotateX(3deg);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-visual:hover .editor {
  transform: none;
}

.editor-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.editor-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}

.editor-dot:nth-child(2) { background: #febc2e; }
.editor-dot:nth-child(3) { background: #28c840; }

.editor-title {
  margin-left: 10px;
  color: var(--text-faint);
  font: 12px var(--font-mono);
}

.editor-body {
  margin: 0;
  padding: 18px 20px 22px 12px;
  overflow-x: auto;
  font: 13px/1.8 var(--font-mono);
  font-variant-ligatures: none;
  counter-reset: line;
}

.editor-body code {
  font: inherit;
}

.editor-body .line::before {
  content: counter(line);
  font-variant-numeric: tabular-nums;
  counter-increment: line;
  display: inline-block;
  width: 2ch;
  margin-right: 18px;
  color: var(--text-faint);
  text-align: right;
  opacity: 0.55;
}

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.float-card strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.float-card-stats {
  left: -28px;
  bottom: -24px;
}

.float-card-features {
  top: -20px;
  right: -16px;
}

.float-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 15px;
}

.float-icon-check {
  background: rgba(34, 197, 94, 0.14);
  color: var(--tint-terminal);
}

/* ---------- 统计条 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 56px;
}

.stats > .stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.stats > .stat + .stat {
  border-left: 0;
}

.stats > .stat:first-child {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.stats > .stat:last-child {
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.stat-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 19px;
}

.stat-value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------- 区块 ---------- */

.section {
  margin-top: 96px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -0.03em;
}

.section-desc {
  margin-top: 8px;
  color: var(--text-muted);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.15s;
}

.section-link:hover {
  color: var(--text);
}

/* ---------- 分类卡片 ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 140px;
  background: radial-gradient(ellipse at 15% 0%, color-mix(in srgb, var(--tint) 18%, transparent), transparent 70%);
  pointer-events: none;
}

.category-card:hover {
  border-color: color-mix(in srgb, var(--tint) 45%, var(--border));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-card > * {
  position: relative;
}

.category-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--tint) 24%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--tint) 12%, var(--surface));
  color: var(--tint);
  font-size: 23px;
}

.category-card h3 {
  margin-top: 8px;
  font-size: 18px;
}

.category-card p {
  color: var(--text-muted);
  font-size: 14px;
}

.category-latest {
  display: grid;
  gap: 8px;
  margin: 8px 0 6px;
  padding: 14px 0 0;
  border-top: 1px dashed var(--border);
  list-style: none;
}

.category-latest li {
  position: relative;
  overflow: hidden;
  padding-left: 14px;
  color: var(--text-muted);
  font-size: 13.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.category-latest li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tint);
  opacity: 0.75;
}

.category-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--tint);
  font-size: 13.5px;
  font-weight: 550;
}

.category-count .icon {
  transition: transform 0.15s;
}

.category-card:hover .category-count .icon {
  transform: translateX(3px);
}

/* ---------- 标签云 ---------- */

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    padding-top: 60px;
    padding-bottom: 80px;
  }

  .editor {
    transform: none;
  }

  .float-card-stats {
    left: 12px;
  }

  .float-card-features {
    right: 12px;
  }

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

  .stats > .stat + .stat {
    border-left: 1px solid var(--border);
  }

  .stats > .stat:nth-child(even) {
    border-left: 0;
  }

  .stats > .stat:nth-child(n + 3) {
    border-top: 0;
  }

  .stats > .stat:first-child { border-radius: var(--radius-lg) 0 0 0; }
  .stats > .stat:nth-child(2) { border-radius: 0 var(--radius-lg) 0 0; }
  .stats > .stat:nth-child(3) { border-radius: 0 0 0 var(--radius-lg); }
  .stats > .stat:last-child { border-radius: 0 0 var(--radius-lg) 0; }
}

@media (max-width: 640px) {
  .hero-inner {
    padding-top: 44px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .editor-body {
    font-size: 12px;
  }

  .float-card-features {
    display: none;
  }

  .stats {
    margin-top: 40px;
  }

  .stats > .stat {
    gap: 10px;
    padding: 16px 14px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .stat-value {
    font-size: 22px;
  }

  .section {
    margin-top: 72px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
