/* 首页落地页（与 /source 列表区分） */

.cs-home-hero {
  position: relative;
  overflow: hidden;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 45%, var(--gradient-end) 100%);
  color: var(--text-white);
  padding: clamp(3rem, 8vw, 5.5rem) 0;
  margin-bottom: 0;
}

.cs-home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 80% 70%, rgba(56, 189, 248, 0.18) 0%, transparent 45%);
  pointer-events: none;
}

.cs-home-hero__grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.cs-home-hero .container {
  position: relative;
  z-index: 1;
}

.cs-home-hero__eyebrow {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.75rem;
}

.cs-home-hero__title {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  max-width: 22ch;
}

.cs-home-hero__slogans {
  margin: 0 0 1rem;
  padding: 0;
  gap: 0.5rem 0.65rem !important;
}

.cs-home-hero__slogan {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.96);
  letter-spacing: 0.02em;
}

.cs-home-hero__sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  max-width: 38rem;
  margin-bottom: 1.75rem;
}

.cs-home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.cs-home-hero .btn-light {
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.cs-home-hero .btn-outline-light {
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  border-width: 2px;
  color: rgba(255, 255, 255, 0.95);
}

.cs-home-hero .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Hero 打字机光标 */
.cs-tw-cursor {
  display: inline-block;
  width: 2px;
  height: 0.92em;
  margin-left: 2px;
  vertical-align: -0.08em;
  background: rgba(255, 255, 255, 0.92);
  animation: cs-tw-blink 0.85s step-end infinite;
}

@keyframes cs-tw-blink {
  50% {
    opacity: 0;
  }
}

.cs-home-hero__preview {
  display: none;
}

@media (min-width: 992px) {
  .cs-home-hero {
    padding-bottom: clamp(4rem, 10vw, 7rem);
  }

  .cs-home-hero__preview {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    overflow: visible;
  }
}

/* Hero 右侧：彩色标签横向无限滚动（参考 518pan 等 marquee 展示） */
.cs-home-hero__preview-stack {
  position: relative;
  width: 100%;
  max-width: min(340px, 100%);
  margin-left: auto;
  overflow: visible;
}

.cs-home-hero__float-cloud {
  position: absolute;
  z-index: 2;
  /* 扩大可视区：容纳 translateY / scale 后的完整标签；左右仅轻淡入淡出，避免长文案被「切掉」观感 */
  inset: -52% -20% -44% -20%;
  pointer-events: none;
  overflow: hidden;
  box-sizing: border-box;
  padding: 1.35rem 0.5rem;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 97%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 97%, transparent 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.cs-home-float-marquee {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  height: 100%;
  min-height: 10.5rem;
  padding: 0.5rem 0 0.85rem;
}

/* 子项 translateY 不参与行高计算，不能用 overflow:hidden 否则会裁掉上下突出部分 */
.cs-home-float-track {
  overflow: visible;
  width: 100%;
  min-height: 2.15rem;
}

.cs-home-float-track__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: max-content;
  gap: 1.05rem;
  will-change: transform;
  animation: cs-home-marquee-x 38s linear infinite;
}

@keyframes cs-home-marquee-x {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.cs-home-float-tag {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.22rem;
  padding: 0.3rem 0.52rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  transform: translateY(var(--cs-float-y, 0px)) scale(var(--cs-float-scale, 1));
  opacity: var(--cs-float-op, 1);
  z-index: var(--cs-float-z, 1);
}

.cs-home-float-tag .bx {
  font-size: 1.08em;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

/* 语言 / 数据库：贴近品牌色 */
.cs-home-float-tag--php {
  color: #fff;
  background: linear-gradient(140deg, rgba(119, 123, 180, 0.96), rgba(86, 90, 138, 0.94));
  box-shadow: 0 5px 18px rgba(86, 90, 138, 0.48);
}

.cs-home-float-tag--java {
  color: #fff;
  background: linear-gradient(140deg, #f29111, #c56a00);
  box-shadow: 0 5px 18px rgba(197, 106, 0, 0.42);
}

.cs-home-float-tag--go {
  color: #fff;
  background: linear-gradient(140deg, #00add8, #007f9c);
  box-shadow: 0 5px 18px rgba(0, 127, 156, 0.42);
}

.cs-home-float-tag--js {
  color: #2b2b2b;
  background: linear-gradient(140deg, #f7df1e, #e6ca12);
  border-color: rgba(43, 43, 43, 0.18);
  text-shadow: none;
  box-shadow: 0 5px 18px rgba(230, 202, 18, 0.45);
}

.cs-home-float-tag--js .bx {
  color: #323330;
  filter: none;
}

.cs-home-float-tag--html {
  color: #fff;
  background: linear-gradient(140deg, #e44d26, #b83616);
  box-shadow: 0 5px 18px rgba(184, 54, 22, 0.42);
}

.cs-home-float-tag--python {
  color: #fff;
  background: linear-gradient(140deg, #3776ab, #295880);
  box-shadow: 0 5px 18px rgba(41, 88, 128, 0.42);
}

.cs-home-float-tag--mysql {
  color: #fff;
  background: linear-gradient(140deg, #00758f, #00546b);
  box-shadow: 0 5px 18px rgba(0, 84, 107, 0.42);
}

.cs-home-float-tag--redis {
  color: #fff;
  background: linear-gradient(140deg, #dc382d, #a82a22);
  box-shadow: 0 5px 18px rgba(168, 42, 34, 0.42);
}

.cs-home-float-tag--mongo {
  color: #fff;
  background: linear-gradient(140deg, #47a248, #2f7d32);
  box-shadow: 0 5px 18px rgba(47, 125, 50, 0.42);
}

.cs-home-float-tag--pg {
  color: #fff;
  background: linear-gradient(140deg, #336791, #244a63);
  box-shadow: 0 5px 18px rgba(51, 103, 145, 0.42);
}

/* 常见业务系统 / 功能模块（命名参考企业信息化常用分类：CMS、OA、ERP、CRM 等） */
.cs-home-float-tag--sys-mall {
  color: #fff;
  background: linear-gradient(140deg, #f97316, #ea580c);
  box-shadow: 0 5px 18px rgba(234, 88, 12, 0.38);
}

.cs-home-float-tag--sys-crm {
  color: #fff;
  background: linear-gradient(140deg, #3b82f6, #1d4ed8);
  box-shadow: 0 5px 18px rgba(29, 78, 216, 0.38);
}

.cs-home-float-tag--sys-cms {
  color: #fff;
  background: linear-gradient(140deg, #8b5cf6, #6d28d9);
  box-shadow: 0 5px 18px rgba(109, 40, 217, 0.38);
}

.cs-home-float-tag--mod-pay {
  color: #fff;
  background: linear-gradient(140deg, #10b981, #047857);
  box-shadow: 0 5px 18px rgba(4, 120, 87, 0.38);
}

.cs-home-float-tag--mod-user {
  color: #fff;
  background: linear-gradient(140deg, #6366f1, #4338ca);
  box-shadow: 0 5px 18px rgba(67, 56, 202, 0.38);
}

.cs-home-float-tag--mod-order {
  color: #fff;
  background: linear-gradient(140deg, #ec4899, #be185d);
  box-shadow: 0 5px 18px rgba(190, 24, 93, 0.38);
}

/* Hero 右侧「代码窗口」缓慢漂浮（参考网盘类落地页常见动效） */
@keyframes cs-home-hero-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  20% {
    transform: translate3d(5px, -12px, 0) rotate(0.35deg);
  }
  40% {
    transform: translate3d(-4px, 6px, 0) rotate(-0.3deg);
  }
  60% {
    transform: translate3d(6px, 8px, 0) rotate(0.25deg);
  }
  80% {
    transform: translate3d(-5px, -6px, 0) rotate(-0.2deg);
  }
}

@keyframes cs-home-hero-float-glow {
  0%,
  100% {
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.25),
      0 0 0 1px rgba(125, 211, 252, 0.12);
  }
  50% {
    box-shadow:
      0 24px 56px rgba(0, 0, 0, 0.28),
      0 0 28px rgba(56, 189, 248, 0.18),
      0 0 0 1px rgba(125, 211, 252, 0.22);
  }
}

.cs-home-preview-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  max-width: 100%;
}

.cs-home-preview-card--float {
  position: relative;
  z-index: 1;
  transform: translate3d(0, 0, 0);
  animation:
    cs-home-hero-float 8s ease-in-out infinite,
    cs-home-hero-float-glow 8s ease-in-out infinite;
  transform-origin: 50% 45%;
}

@media (prefers-reduced-motion: reduce) {
  .cs-home-preview-card--float {
    animation: none;
  }

  .cs-home-float-track__inner {
    animation: none !important;
  }
}

.cs-home-preview-card__bar {
  display: flex;
  gap: 6px;
  margin-bottom: 1rem;
}

.cs-home-preview-card__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.cs-home-preview-card__dot:nth-child(1) {
  background: #f87171;
}

.cs-home-preview-card__dot:nth-child(2) {
  background: #fbbf24;
}

.cs-home-preview-card__dot:nth-child(3) {
  background: #4ade80;
}

.cs-home-preview-card__line {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  margin-bottom: 0.5rem;
}

.cs-home-preview-card__line--short {
  width: 62%;
}

/* Hero 下方：网站推荐 + 最近更新（单卡片上浮，承接原统计条位置） */
.cs-home-feed {
  margin-top: -2rem;
  position: relative;
  z-index: 2;
  padding-bottom: 0.35rem;
}

.cs-home-feed__inner {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--surface-border);
  padding: 1.15rem 1.15rem 1.35rem;
}

@media (min-width: 768px) {
  .cs-home-feed__inner {
    padding: 1.45rem 1.65rem 1.65rem;
    border-radius: var(--radius-xl);
  }
}

.cs-home-feed .cs-home-section {
  padding: 0.85rem 0;
}

.cs-home-feed .cs-home-section:first-child {
  padding-top: 0.15rem;
}

.cs-home-feed .cs-home-section:last-child {
  padding-bottom: 0.15rem;
}

.cs-home-feed .cs-home-section + .cs-home-section {
  border-top: 1px solid var(--surface-border);
  margin-top: 0.35rem;
  padding-top: 1.15rem;
}

@media (max-width: 767.98px) {
  .cs-home-feed__inner {
    padding: 1rem 0.85rem 1.15rem;
  }

  .cs-home-feed .cs-home-section {
    padding: 0.65rem 0;
  }

  .cs-home-feed .cs-home-section + .cs-home-section {
    margin-top: 0.2rem;
    padding-top: 0.95rem;
  }
}

/* 主内容区：「为何选择我们」等 */
.cs-home-main {
  padding-top: 0.85rem;
  padding-bottom: 1.75rem;
}

.cs-home-section {
  padding: 1.35rem 0;
}

.cs-home-main > .cs-home-section:first-child {
  padding-top: 0.65rem;
}

/* 「为何选择我们」外框：与上方推荐/更新主卡片同为白底面板风格 */
.cs-home-section--muted {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  margin-left: 0;
  margin-right: 0;
  padding: 1.35rem 1.15rem 1.5rem;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-card);
}

@media (min-width: 576px) {
  .cs-home-section--muted {
    padding: 1.5rem 1.5rem 1.65rem;
    border-radius: var(--radius-xl);
  }
}

@media (min-width: 768px) {
  .cs-home-section--muted {
    padding: 1.65rem 1.75rem 1.85rem;
  }
}

.cs-home-section__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.cs-home-section__sub {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  max-width: 36rem;
  margin-bottom: 1.75rem;
}

.cs-home-section__sub--tight {
  margin-bottom: 1rem;
}

/* 编辑推荐在首块：无顶部分割线 */
.cs-home-featured {
  padding-top: 0.65rem;
  margin-top: 0;
}

.cs-home-main > .cs-home-latest {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
}

.cs-home-main > .cs-home-section--muted {
  margin-top: 1rem;
}

/* 内层三卡：略浅底与外层白面板区分层次，风格仍与整站卡片一致 */
.cs-home-value-card {
  height: 100%;
  padding: 1.1rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.cs-home-value-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.cs-home-value-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 111, 217, 0.1);
  color: var(--primary-color);
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
}

.cs-home-value-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.cs-home-value-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0;
}

.cs-home-featured .vstack.gap-3 {
  gap: 1rem !important;
}

/* 编辑推荐：精简横向卡片（对比源码库列表的长卡片） */
.cs-home-featured-grid {
  --bs-gutter-x: 0.75rem;
  --bs-gutter-y: 0.75rem;
}

@media (min-width: 768px) {
  .cs-home-featured-grid {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
  }
}

.cs-home-featured-card {
  background: var(--bg-primary);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: var(--shadow-xs);
}

.cs-home-featured-card:hover {
  border-color: rgba(var(--bs-primary-rgb), 0.28);
  box-shadow: var(--shadow-card);
}

.cs-home-featured-card:hover .cs-home-featured-card__title {
  color: var(--primary-color);
}

.cs-home-featured-card__thumb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--surface-border);
}

.cs-home-featured-card__thumb--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-home-featured-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.75rem;
}

.cs-home-featured-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-primary);
  transition: color 0.15s ease;
}

.cs-home-featured-card__meta {
  line-height: 1.45;
}

.cs-home-featured-card__kind {
  color: var(--text-secondary);
  font-weight: 500;
}

.cs-home-featured-card__sep {
  margin: 0 0.15rem;
  opacity: 0.65;
}

.cs-home-featured-card__dl {
  white-space: nowrap;
}

.cs-home-featured-card__dl .bx {
  vertical-align: -0.1em;
  margin-right: 0.15rem;
  opacity: 0.85;
}

.cs-home-featured-card .badge {
  font-size: 0.65rem;
  font-weight: 600;
}
