/* 源项目首页样式（从 gohiding-portal tokens 抽取，供首页模块使用） */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f6f8;
  --bg-panel: #ffffff;
  --bg-panel-hover: #ffffff;
  --bg-dark: #111111;
  --bg-dark-soft: #1a1a1a;

  --accent-red: #d93751;
  --accent-red-dark: #b22d41;
  --accent-black: #111111;
  --accent-cyan: #d93751;
  --accent-blue: #333333;

  --text-primary: #1a1a1a;
  --text-secondary: #5a6570;
  --text-muted: #8a939c;
  --text-on-dark: #f5f5f5;

  --border-subtle: rgba(17, 17, 17, 0.08);
  --border-glow: rgba(217, 55, 81, 0.35);

  --gradient-hero: linear-gradient(165deg, #111111 0%, #1c1c1c 55%, #2a0a0a 100%);
  --gradient-cta: linear-gradient(90deg, #d93751 0%, #b22d41 100%);
  --gradient-cyan: linear-gradient(90deg, #d93751 0%, #111111 100%);
  --shadow-glow: 0 8px 28px rgba(17, 17, 17, 0.08);
  --shadow-card: 0 4px 20px rgba(17, 17, 17, 0.06);

  --font-cn: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Rajdhani', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --content-w: 1200px;
  --radius: 2px;
  --transition: 200ms ease;
}

.source-home .container {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Crawlable hero copy backup (JS carousel does not remove this) */
.hero-seo {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.source-home .section {
  padding: 88px 0;
  position: relative;
}

.source-home .section-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 12px;
}

.source-home .section-title {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 16px;
  color: var(--accent-black);
}

.source-home .section-desc {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 640px;
  line-height: 1.75;
}

/* 对齐 https://www.bwda.net/ .more 按钮样式与动效 */
.source-home .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: auto;
  min-height: 0;
  line-height: 45px;
  padding: 0 30px;
  border: none;
  border-radius: 50px;
  font-size: 12px;
  font-weight: normal;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 0 10px rgba(111, 111, 111, 0);
  transition: all 0.3s;
}

.source-home .btn:hover {
  padding: 0 50px;
  box-shadow: 0 0 20px rgba(111, 111, 111, 0.5);
}

.source-home .btn-primary {
  background-image: linear-gradient(160deg, #f43a58 10%, #bf3a85 80%);
  color: #fff;
}

.source-home .btn-primary:hover {
  background-image: linear-gradient(160deg, #f43a58 10%, #ec193b 80%);
  color: #fff;
  filter: none;
}

.source-home .btn-ghost,
.source-home .btn-outline-cyan {
  background-image: linear-gradient(160deg, #fff 10%, #edf3f9 80%);
  color: #0f345b;
  border: none;
}

.source-home .btn-ghost:hover,
.source-home .btn-outline-cyan:hover {
  background-image: linear-gradient(160deg, #f43a58 10%, #ec193b 80%);
  color: #fff;
}

@media (max-width: 960px) {
  .source-home .btn {
    padding: 0 15px;
    line-height: 28px;
  }

  .source-home .btn:hover {
    padding: 0 28px;
  }
}

.source-home .card-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}

.source-home .card-panel:hover {
  border-color: rgba(217, 55, 81, 0.28);
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.1);
}

.source-home .tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: max-content;
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--accent-red);
  border: 1px solid rgba(217, 55, 81, 0.25);
  background: rgba(217, 55, 81, 0.05);
  border-radius: var(--radius);
}

/* 滚动飞入 */
.fly-in,
.fly-in-item {
  opacity: 0;
  will-change: opacity, transform;
  animation: none;
}

.fly-in[data-fly-dir='up'],
.fly-in-item[data-fly-dir='up'] {
  transform: translate3d(0, 72px, 0) scale(0.96);
}

.fly-in-item[data-fly-dir='left'] {
  transform: translate3d(-64px, 40px, 0) scale(0.96);
}

.fly-in-item[data-fly-dir='right'] {
  transform: translate3d(64px, 40px, 0) scale(0.96);
}

.fly-in.is-in,
.fly-in-item.is-in {
  animation-duration: 0.85s;
  animation-delay: var(--fly-delay, 0ms);
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: both;
}

.fly-in[data-fly-dir='up'].is-in,
.fly-in-item[data-fly-dir='up'].is-in {
  animation-name: fly-in-up;
}

.fly-in-item[data-fly-dir='left'].is-in {
  animation-name: fly-in-left;
}

.fly-in-item[data-fly-dir='right'].is-in {
  animation-name: fly-in-right;
}

@keyframes fly-in-up {
  from {
    opacity: 0;
    transform: translate3d(0, 72px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes fly-in-left {
  from {
    opacity: 0;
    transform: translate3d(-64px, 40px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes fly-in-right {
  from {
    opacity: 0;
    transform: translate3d(64px, 40px, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.lazy-img {
  position: relative;
  opacity: 0;
  background: linear-gradient(90deg, #eceef1 0%, #f7f8fa 45%, #eceef1 90%);
  background-size: 200% 100%;
  transition: opacity 0.55s ease;
}

.lazy-img.is-inview:not(.is-loaded) {
  animation: lazy-shimmer 1.2s ease-in-out infinite;
}

.lazy-img.is-loaded {
  opacity: 1;
  background: none;
  animation: none;
}

@keyframes lazy-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (max-width: 768px) {
  .source-home .section {
    padding: 56px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fly-in,
  .fly-in-item,
  .lazy-img {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
