/* ============================================================
   marscamp.com 首页
   —— 整页背景：火箭实验室实拍照
   —— 顶栏：透明浮层（无独立底色），logo 在左，导航紧跟 logo 右侧
   —— 内容（居中）：大标题 + 一句介绍 + 两门课的轮播卡片
   ============================================================ */

:root {
  --brand: #5571ae;          /* logo 蓝（取自官方 logo 实测色） */
  --brand-deep: #3d5488;
  --ink: #0b0d14;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --top: 76px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #fff;
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* ============================================================
   整页背景：实拍照片 + 从图片取色的渐变收尾
   ============================================================ */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #6d6e73;
  background-image: url("/img/home/bg-lab.webp");
  background-image: url("/img/home/bg-lab.webp"), url("/img/home/bg-lab.jpg");
  background-size: cover, cover;
  background-position: center top, center top;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

/* 老浏览器不支持 webp 时回退 jpg（上面的简写声明已处理，这里加滤镜） */
@supports (background: url("data:image/webp,test")) {
  .bg {
    background-image: url("/img/home/bg-lab.webp");
  }
}

/* 顶部与底部的压暗，保证白色文字可读 */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(9, 12, 22, .70) 0%, rgba(9, 12, 22, .42) 9%, rgba(9, 12, 22, .12) 22%, rgba(9, 12, 22, 0) 38%),
    linear-gradient(0deg, rgba(9, 12, 22, .78) 0%, rgba(9, 12, 22, .34) 24%, rgba(9, 12, 22, 0) 48%);
}

/* 中间的局部衬底：内容居中了，衬底也跟着挪到中间，
   让大标题和轮播卡片从背景里「浮」出来 */
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(78% 62% at 50% 46%, rgba(6, 9, 18, .72) 0%, rgba(6, 9, 18, .44) 42%, rgba(6, 9, 18, 0) 78%);
  pointer-events: none;
}

/* ============================================================
   顶栏：透明浮层，没有单独背景
   ============================================================ */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--top);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 30px;
  padding: 0 clamp(16px, 3.4vw, 46px);
  background: transparent;
}

/* 官方 logo 完整版（蓝字文字标 + 下面的渐变色条）。
   照片背景顶部是浅色天花板，蓝色 logo 直接压上去看不清，
   所以给一块白色底板 —— logo 本身仍是官方原样。 */
.topbar .brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 18px rgba(6, 10, 22, .28);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}

.topbar .brand:hover { opacity: .92; transform: translateY(-1px); }

.topbar .brand img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

/* 导航紧跟 logo 右侧（不再靠右对齐） */
.topnav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: 4px;
}

.topnav a {
  position: relative;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .94);
  padding: 6px 2px;
  text-shadow: 0 1px 10px rgba(6, 10, 22, .7);
  transition: color .18s var(--ease);
}

.topnav a:hover { color: #fff; }

.topnav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transform: translateX(-50%);
  transition: width .22s var(--ease);
}

.topnav a:hover::after,
.topnav a.is-current::after { width: 22px; }

@media (max-width: 860px) {
  .topnav { gap: 16px; }
  .topnav a { font-size: 13px; }
  .topbar .brand img { height: 34px; }
}

@media (max-width: 640px) {
  :root { --top: 62px; }
  .topnav { display: none; }
  .topbar .brand img { height: 30px; }
}

/* ============================================================
   Hero：内容居中
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: calc(var(--top) + 24px) 0 clamp(92px, 11vh, 120px);
  text-align: center;
}

.hero-inner {
  width: min(1000px, 100% - 40px);
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .8);
  text-shadow: 0 1px 12px rgba(6, 10, 22, .8);
}

.hero-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: rgba(255, 255, 255, .65);
}

.hero-title {
  margin: 18px 0 0;
  font-size: clamp(38px, 6.4vw, 74px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -.02em;
  text-shadow: 0 12px 46px rgba(6, 10, 22, .74), 0 2px 8px rgba(6, 10, 22, .55);
  transition: opacity .18s var(--ease);
}

.hero-sub {
  margin: 18px auto 0;
  max-width: 720px;
  font-size: clamp(14px, 1.45vw, 16.5px);
  line-height: 1.8;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 2px 16px rgba(6, 10, 22, .88);
  transition: opacity .18s var(--ease);
}

/* 大标题 / 小字介绍跟轮播切换时的淡出淡入 */
.hero-title.is-fading,
.hero-sub.is-fading { opacity: 0; }

/* ============================================================
   课程轮播：两门课，各自独立
   ============================================================ */
.carousel {
  position: relative;
  width: min(880px, 100%);
  height: clamp(330px, 52vh, 468px);
  margin: 30px auto 0;
}

.slide {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(11, 14, 22, .58);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 24px 70px rgba(4, 7, 14, .5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(14px) scale(.99);
  pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

.slide.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.slide-media {
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* AI 小程序那张是课程封面图（本身是深色底），等比完整显示、不裁切，
   底色跟着图走，避免深色图浮在白底上割裂 */
.slide--ai .slide-media {
  background: #0b0d14;
}

.slide--ai .slide-media img {
  object-fit: contain;
  padding: 14px 18px;
}

/* ============================================================
   火箭俱乐部那张卡：复刻演示站封面（不含底部控件）
   —— 参数照搬演示站 .slide-cover，只是按卡片尺寸缩放
   ============================================================ */
.slide--rocket .slide-media {
  position: relative;
  overflow: hidden;
  background: radial-gradient(110% 100% at 72% 18%, #12274e 0%, #050c1d 58%);
}

.slide--rocket .cover-bg { position: absolute; inset: 0; }
.slide--rocket .cover-stars { position: absolute; inset: 0; width: 100%; height: 100%; }

.slide--rocket .cover-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}
.slide--rocket .cover-glow.g1 {
  width: 400px; height: 400px; right: -100px; top: -120px;
  background: rgba(46, 111, 191, .22);
}
.slide--rocket .cover-glow.g2 {
  width: 320px; height: 320px; left: -110px; bottom: -130px;
  background: rgba(255, 122, 47, .08);
}

.slide--rocket .cover-main {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 26px 56px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 64%;
  /* Hero 区是居中排版，封面要跟演示站一致，左对齐 */
  text-align: left;
}

.slide--rocket .cover-logo {
  display: block;
  /* column flex 默认 align-items:stretch，会把图拉满整行 —— 必须显式收窄 */
  align-self: flex-start;
  height: 52px;
  width: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 20px rgba(2, 8, 22, .45));
}

.slide--rocket .cover-kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .2em;
  color: #ff7a2f;
  white-space: nowrap;
}

.slide--rocket .cover-title {
  margin: 12px 0 0;
  font-size: clamp(28px, 4.4vw, 52px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: .04em;
  color: #fff;
}
.slide--rocket .cover-title span { display: block; }

.slide--rocket .cover-divider {
  width: 62px;
  height: 3px;
  margin: 16px 0 12px;
  background: linear-gradient(90deg, rgba(255, 122, 47, .15), #ff7a2f);
}

.slide--rocket .cover-sub {
  margin: 0;
  font-size: 15px;
  letter-spacing: .1em;
  color: #9fb0c9;
}

.slide--rocket .cover-stats {
  margin-top: 18px;
  display: flex;
  gap: 30px;
}
.slide--rocket .cover-stats span {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  letter-spacing: .12em;
  color: #9fb0c9;
}
.slide--rocket .cover-stats em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: .3em;
  color: #ff7a2f;
}

.slide--rocket .cover-rocket {
  position: absolute;
  z-index: 1;
  right: 28px;
  bottom: -30px;
  height: 396px;
  width: auto;
  filter: drop-shadow(0 24px 46px rgba(2, 8, 22, .55));
}

@media (max-width: 720px) {
  .slide--rocket .cover-main { padding: 18px 26px 20px; max-width: 78%; }
  .slide--rocket .cover-logo { height: 40px; margin-bottom: 10px; }
  .slide--rocket .cover-stats { gap: 18px; }
  .slide--rocket .cover-rocket { right: 14px; height: 300px; }
}

/* AI 小程序那张改成矢量文字封面：
   原来的位图只有 882×319，在高分辨率屏上放大就糊；
   用 HTML/CSS 画，任何尺寸都是清晰的。 */
.slide-cover {
  background:
    radial-gradient(58% 76% at 10% 6%, rgba(34, 197, 94, .12) 0%, rgba(34, 197, 94, 0) 62%),
    linear-gradient(180deg, #0c1218 0%, #080c11 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5% 6%;
  text-align: left;
}

.cover-eyebrow {
  display: block;
  font-size: clamp(12px, 1.5vw, 16px);
  font-weight: 700;
  letter-spacing: .12em;
  color: #3ddc84;
  margin-bottom: .9em;
}

.cover-line {
  font-size: clamp(26px, 5.8vw, 68px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -.015em;
  color: #fff;
}

/* 「能扫码打」绿→青，「开」蓝，「的小程序」白 */
.cover-g1 {
  background: linear-gradient(90deg, #2ee06a 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cover-g2 { color: #38bdf8; }
.cover-g3 { color: #fff; }

@media (max-width: 640px) {
  .slide-cover { padding: 8% 6%; }
}

/* 「进入课程」按钮：放在轮播卡片和圆点之间，目标跟着当前轮播项走 */
.hero-cta {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

@media (max-width: 720px) {
  .carousel { height: clamp(330px, 52vh, 420px); }
}

/* ============================================================
   轮播圆点（居中）
   ============================================================ */
.hero-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.hero-dots .dot {
  width: 26px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .38);
  transition: background .22s var(--ease), width .22s var(--ease);
}

.hero-dots .dot.is-on {
  width: 44px;
  background: #fff;
}

.hero-dots .pause {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: rgba(255, 255, 255, .88);
  text-shadow: 0 1px 8px rgba(6, 10, 22, .8);
  transition: background .18s var(--ease);
}

.hero-dots .pause:hover { background: rgba(255, 255, 255, .16); }
.hero-dots .pause svg { width: 13px; height: 13px; }

/* ============================================================
   按钮（轮播卡片里的「进入课程」）
   ============================================================ */
.gbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 26px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-shadow: 0 1px 8px rgba(6, 10, 22, .5);
  transition: background .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}

.gbtn:hover {
  background: rgba(255, 255, 255, .26);
  border-color: rgba(255, 255, 255, .48);
  transform: translateY(-2px);
}

.gbtn--solid {
  background: #fff;
  color: var(--brand-deep);
  border-color: #fff;
  text-shadow: none;
}

.gbtn--solid:hover { background: #f2f5ff; }

.gbtn svg { width: 17px; height: 17px; }

@media (max-width: 640px) {
  .gbtn { height: 42px; padding: 0 18px; font-size: 13.5px; }
}

/* ============================================================
   页脚
   ============================================================ */
.foot {
  position: relative;
  z-index: 1;
  padding: 28px clamp(16px, 3.4vw, 46px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(9, 12, 22, .55);
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 12.5px;
  color: rgba(255, 255, 255, .58);
}

.foot a { color: rgba(255, 255, 255, .78); }
.foot a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
