/* Home hero section */
.home-hero {
  padding: 48px 0 40px;
  text-align: center;
}
.home-hero .hero-left h1 {
  font-size: 48px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.home-hero .hero-left h1 span {
  color: var(--rp-c-brand);
}
.home-hero .hero-left p {
  font-size: 20px;
  color: var(--rp-c-text-2);
  margin: 0 0 28px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-brand {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 8px;
  background: var(--rp-c-brand);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-brand:hover {
  opacity: 0.85;
}
.btn-alt {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 8px;
  border: 1px solid var(--rp-c-brand);
  color: var(--rp-c-brand);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-alt:hover {
  background: var(--rp-c-brand-light);
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 8px 0 24px;
}
.feature-card {
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--rp-c-divider);
  background: var(--rp-c-bg-soft);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.feature-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 10px;
}
.feature-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.feature-card p {
  font-size: 14px;
  color: var(--rp-c-text-2);
  margin: 0;
  line-height: 1.6;
}

/* Video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 16px;
}
.video-card {
  border: 1px solid var(--rp-c-divider);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--rp-c-bg-soft);
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.video-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #667eea;
}
.video-info {
  padding: 16px;
}
.video-info h4 {
  margin: 0 0 6px 0;
  font-size: 16px;
}
.video-info p {
  margin: 0;
  font-size: 13px;
  color: var(--rp-c-text-2);
}

/* Promo card — contact & contest */
.xd-promo {
  margin: 36px 0 12px;
  padding: 22px 26px;
  border-radius: 12px;
  border: 2px solid var(--rp-c-brand);
  background: var(--rp-c-bg-soft);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.xd-promo-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--rp-c-brand);
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}
.xd-promo-list {
  margin: 0 0 14px;
  padding-left: 22px;
  line-height: 1.9;
  font-size: 15px;
}
.xd-promo-list strong {
  font-size: 16px;
  color: var(--rp-c-brand);
}
.xd-promo-badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--rp-c-brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

/* 无限滚动填充式翻页 */
/* 追加/插入的整页章节：极短淡入，让内容「长出来」而不是硬切 */
.sp-page {
  animation: sp-page-in 0.28s ease both;
}
@keyframes sp-page-in {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp-page {
    animation: none;
  }
}
/* 章节之间的分隔提示（标题，弱化处理，不喧宾夺主） */
.sp-page-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px 0 28px;
  color: var(--rp-c-text-3);
  font-size: 13px;
  letter-spacing: 0.4px;
}
/* 本章结束标记：让用户明确看到本章底部 */
.sp-page-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 40px 0 24px;
  color: var(--rp-c-text-3);
  font-size: 13px;
  letter-spacing: 0.4px;
}
.sp-page-end::before,
.sp-page-end::after {
  content: '';
  height: 1px;
  flex: 1 1 auto;
  max-width: 120px;
  background: var(--rp-c-divider);
}
.sp-page-divider::before,
.sp-page-divider::after {
  content: '';
  height: 1px;
  flex: 1 1 auto;
  max-width: 120px;
  background: var(--rp-c-divider);
}
.sp-page-divider span {
  white-space: nowrap;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--rp-c-bg-soft);
  color: var(--rp-c-brand);
  font-weight: 600;
}
/* 加载中提示（仅在拉取章节时出现，平时隐藏） */
.sp-loader {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--rp-c-divider);
  background: var(--rp-c-bg-soft);
  color: var(--rp-c-text-2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  font-size: 13px;
  pointer-events: none;
  opacity: 0.96;
}
.sp-loader--bottom {
  bottom: 22px;
}
.sp-loader--top {
  top: 72px;
}

/* 翻页时正文极短淡入，把位置跳变藏在过渡里，手感更平滑 */
.xd-entering .rp-doc,
.xd-entering .rp-home {
  animation: xd-page-fade 0.22s ease both;
}
@keyframes xd-page-fade {
  from {
    opacity: 0.18;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .xd-entering .rp-doc,
  .xd-entering .rp-home {
    animation: none;
  }
}

/* 消除滚动到页面边缘的橡皮筋回弹，避免连续滚到底部翻页时页面抖动 */
html,
body {
  overscroll-behavior-y: none;
}
