/* 首页视觉层 · 仅在 index.html 加载
   依赖 css/site.css 的品牌色变量，不新造颜色：藏青 INK / 局方蓝 BLUE / 肩章金 GOLD / 航迹 TRACK。
   所有"隐藏初始态"都以 body.js-anim 为前提——JS 不跑或被关掉时，页面直接是最终样子，不会留一片空白。 */

body.js-anim {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, .05, .36, 1);
}

/* ---------- 滚动进度 ---------- */

.progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  z-index: 60;
  pointer-events: none;
}

/* ---------- 颗粒质感 ---------- */

.grain::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 页头：压在实景首屏上 ---------- */

body.home .site-header {
  position: fixed;
  left: 0; right: 0;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  transition: background-color .4s var(--ease-out), border-color .4s, box-shadow .4s;
}
body.home .site-header .brand,
body.home .site-header .nav a { color: #fff; }
body.home .site-header .brand-sub { color: rgba(255, 255, 255, .62); }
body.home .site-header .nav a:hover { background: rgba(255, 255, 255, .1); }
body.home .site-header .nav a[aria-current="page"] { color: #ffd479; box-shadow: inset 0 -2px 0 #ffd479; }

body.home .site-header.is-solid {
  background: rgba(255, 255, 255, .97);
  border-bottom-color: var(--hair);
  box-shadow: 0 1px 0 rgba(26, 43, 69, .04), 0 10px 30px -22px rgba(26, 43, 69, .5);
  backdrop-filter: saturate(140%) blur(8px);
}
body.home .site-header.is-solid .brand,
body.home .site-header.is-solid .nav a { color: var(--ink); }
body.home .site-header.is-solid .brand-sub { color: var(--gray); }
body.home .site-header.is-solid .nav a:hover { background: var(--wash); }
body.home .site-header.is-solid .nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }

body.home { padding-top: 0; }

/* ---------- 首屏：满幅基地实景 ---------- */

body.home .hero2 {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: min(86vh, 780px);
  padding: calc(var(--topbar, 74px) + 96px) 0 0;
  background: var(--night);
  color: #fff;
}

/* 三层画面叠在一起，js 每 6.4 秒把 .is-on 换到下一张；上沿多留 18% 给视差余量 */
.hero2-media {
  position: absolute;
  inset: -18% 0 0;
  z-index: -2;
  will-change: transform;
}
.hero2-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.hero2-media img.is-on { opacity: 1; }
/* 正在显示的这张缓慢推近，切换时重新起头 */
body.js-anim .hero2-media img.is-on { animation: hero-drift 9s linear forwards; }
@keyframes hero-drift {
  from { transform: scale(1.012); }
  to { transform: scale(1.06); }
}

/* 压暗：左边给文字留位置，下沿与数字条接上 */
body.home .hero2::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 14, 24, .74) 0%, rgba(8, 14, 24, .46) 46%, rgba(8, 14, 24, .12) 100%),
    linear-gradient(180deg, rgba(8, 14, 24, .58) 0%, rgba(8, 14, 24, 0) 34%, rgba(13, 23, 40, .58) 100%);
}

body.home .hero2 .wrap { position: relative; z-index: 1; }
/* 首屏是纵向 flex：不给这两块显式宽度，.wrap 会被压成内容宽并跑到中间 */
.hero2-copy { width: 100%; padding-bottom: 46px; }

body.home .eyebrow {
  color: #ffd479;
  font-size: 12px;
  letter-spacing: 5px;
  margin-bottom: 22px;
}
body.home .eyebrow .eb-sep { color: rgba(255, 212, 121, .5); }

body.home .hero2 h1 {
  color: #fff;
  margin: 0 0 24px;
  max-width: 17em;
  font-size: clamp(32px, 5.4vw, 64px);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -.5px;
  text-wrap: balance;
}

/* 逐行遮罩揭示：每行套一层 .line > span */
.line { display: block; overflow: hidden; }
/* 窄屏允许在顿号处断行，但不许把地名劈开 */
body.home .hero2 h1 .nb { white-space: nowrap; }
body.js-anim .line > span {
  display: block;
  transform: translateY(105%);
  opacity: 0;
}
body.js-anim .hero2.is-in .line > span {
  transform: translateY(0);
  opacity: 1;
  transition: transform 1.05s var(--ease-out), opacity .7s ease-out;
}
body.js-anim .hero2.is-in .line:nth-child(2) > span { transition-delay: .12s; }

body.home .hero2-sub {
  margin: 0 0 20px;
  color: #fff;
  font-size: clamp(16px, 1.7vw, 22px);
  font-weight: 700;
  letter-spacing: 1.5px;
}
body.home .hero2-sub .slash { color: var(--star); padding: 0 2px; }

body.home .hero2 .lede {
  margin: 0;
  max-width: 40em;
  color: rgba(232, 238, 247, .88);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.95;
  text-indent: 2em;
  text-shadow: 0 1px 12px rgba(8, 14, 24, .5);
}

/* 按钮 */
body.home .cta {
  position: relative;
  margin-top: 0;
  padding: 16px 34px;
  background: #ffd479;
  color: #101d33;
  border-radius: 999px;
  font-weight: 800;
  overflow: hidden;
  transition: transform .35s var(--ease-out), box-shadow .35s, background-color .35s;
  box-shadow: 0 18px 40px -22px rgba(255, 212, 121, .8);
}
body.home .cta:hover { background: #fff; color: #101d33; box-shadow: 0 22px 50px -20px rgba(255, 255, 255, .55); }
body.home .cta::after {
  content: '→';
  display: inline-block;
  margin-left: 10px;
  transition: transform .35s var(--ease-out);
}
body.home .cta:hover::after { transform: translateX(6px); }

body.home .cta-ghost {
  margin-top: 0;
  padding: 16px 28px;
  border: 1px solid rgba(201, 212, 228, .46);
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  transition: border-color .35s, background-color .35s;
}
body.home .cta-ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; text-decoration: none; }

.hero2-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 38px 0 0; }

/* 数字条：压在画面底部的一层磨砂 */
.hero2-band {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px 0 26px;
  background: rgba(8, 14, 24, .34);
  border-top: 1px solid rgba(201, 212, 228, .22);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
}
body.home .hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 auto;
  list-style: none;
}
body.home .hero-facts li {
  padding: 0 26px 0 0;
  border-right: 1px solid rgba(201, 212, 228, .18);
}
body.home .hero-facts li:last-child { border-right: 0; }
body.home .hero-facts li + li { padding-left: 26px; }
body.home .hero-facts b {
  display: block;
  color: #fff;
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
body.home .hero-facts b .unit { font-size: .46em; font-weight: 700; letter-spacing: .5px; color: var(--star); }
body.home .hero-facts .t {
  display: block;
  margin-top: 9px;
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(201, 212, 228, .78);
}

/* ---------- 三种班型：只点名，不解释 ---------- */

body.home .tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 30px;
}
body.home .tile {
  margin: 0;
  padding: 0 0 26px;
  background: #fff;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
  text-align: center;
  transition: box-shadow .45s ease;
}
body.home .tile:hover { box-shadow: var(--sh-2); }
body.home .tile img {
  display: block;
  width: 100%;
  height: auto;
  /* 三张班型照都按 3:2 预裁过，这里按比例整幅显示，任何宽度都不再二次裁切人脸 */
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform .9s var(--ease-out);
}
body.home .tile:hover img { transform: scale(1.05); }
body.home .tile h3 {
  margin: 24px 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .6px;
  color: var(--blue);
}
body.home .tile-go {
  display: inline-block;
  padding: 8px 22px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 700;
  transition: background-color .35s ease, color .35s ease;
}
body.home .tile:hover .tile-go { background: var(--blue); color: #fff; }
/* 逐张错峰浮现 */
body.js-anim .tile {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease-out, transform .7s var(--ease-out), box-shadow .45s ease;
}
body.js-anim .tiles.is-in .tile { opacity: 1; transform: none; }
body.js-anim .tiles.is-in .tile:nth-child(2) { transition-delay: .09s; }
body.js-anim .tiles.is-in .tile:nth-child(3) { transition-delay: .18s; }

/* ---------- 考生必读：四张入口 ---------- */

body.home .quads {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}
body.home .quads a {
  display: block;
  padding: 30px 18px 24px;
  border: 1px solid rgba(201, 212, 228, .22);
  border-radius: var(--r);
  background: rgba(16, 29, 51, .5);
  color: #fff;
  text-align: center;
  transition: border-color .4s ease, background-color .4s ease, transform .4s var(--ease-out);
}
body.home .quads a:hover {
  border-color: var(--star);
  background: rgba(16, 29, 51, .82);
  transform: translateY(-4px);
  text-decoration: none;
}
body.home .quads svg {
  display: block;
  width: 42px; height: 42px;
  margin: 0 auto 16px;
  fill: none;
  stroke: var(--star);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.home .quads b {
  display: block;
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: .6px;
}
body.home .quads .go {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  letter-spacing: 1.6px;
  color: rgba(201, 212, 228, .72);
}
body.home .quads a:hover .go { color: var(--star); }
body.js-anim .quads li {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease-out, transform .7s var(--ease-out);
}
body.js-anim .quads.is-in li { opacity: 1; transform: none; }
body.js-anim .quads.is-in li:nth-child(2) { transition-delay: .07s; }
body.js-anim .quads.is-in li:nth-child(3) { transition-delay: .14s; }
body.js-anim .quads.is-in li:nth-child(4) { transition-delay: .21s; }

/* ---------- 两处基地：卡 + 实景墙 ---------- */

body.home .wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}
body.home .wall figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--r);
  background: #0b1220;
  box-shadow: var(--sh-1);
}
body.home .wall img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform .9s var(--ease-out);
}
body.home .wall figure:hover img { transform: scale(1.06); }
body.home .wall figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 26px 16px 13px;
  background: linear-gradient(180deg, rgba(8, 14, 24, 0), rgba(8, 14, 24, .78));
  color: rgba(232, 238, 247, .9);
  font-size: 13.5px;
  line-height: 1.6;
}
/* 逐格错峰浮现 */
body.js-anim .wall figure {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease-out, transform .8s var(--ease-out);
}
body.js-anim .wall.is-in figure { opacity: 1; transform: none; }
body.js-anim .wall.is-in figure:nth-child(2) { transition-delay: .06s; }
body.js-anim .wall.is-in figure:nth-child(3) { transition-delay: .12s; }
body.js-anim .wall.is-in figure:nth-child(4) { transition-delay: .18s; }
body.js-anim .wall.is-in figure:nth-child(5) { transition-delay: .24s; }
body.js-anim .wall.is-in figure:nth-child(6) { transition-delay: .3s; }

/* ---------- 报名与团体定制 ---------- */

body.home .ask .tel-line { margin-top: 24px; font-size: 19px; font-weight: 800; color: #fff; }
body.home .ask .tel-line a { color: #fff; }
body.home .ask .tel-line a:hover { color: var(--star); text-decoration: none; }
body.home .links { display: flex; flex-wrap: wrap; gap: 8px 30px; margin-top: 22px; }
body.home .links a { font-weight: 700; }
body.home .ask .links a { color: var(--star); }
/* 首页七颗钮全跳联系页，这两个内页靠这一行接住内链 */
body.home .ask .deep-links {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(201, 212, 228, .18);
  font-size: 14px;
  color: rgba(201, 212, 228, .72);
}
body.home .ask .deep-links a { color: #fff; font-weight: 700; }
body.home .ask .deep-links a:hover { color: var(--star); }

/* ---------- 入场动画：滚动触发 ---------- */

body.js-anim .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .8s ease-out, transform .95s var(--ease-out);
}
body.js-anim .reveal.is-in { opacity: 1; transform: none; }
/* 卡片自己做逐张错峰，外层就不再整体位移，避免两层动画打架 */
body.js-anim .tiles.reveal,
body.js-anim .quads.reveal,
body.js-anim .wall.reveal { transform: none; }

/* 标题下的细线随进入视口展开 */
body.js-anim .section-head .kicker::after {
  content: '';
  display: block;
  width: 0;
  height: 1px;
  margin-top: 10px;
  background: var(--gold);
  transition: width 1.1s var(--ease-out) .1s;
}
body.js-anim .section-head.is-in .kicker::after { width: 68px; }
body.js-anim .band .section-head .kicker::after { background: var(--star); }

/* ---------- 章节底纹 ---------- */

body.home section:nth-of-type(odd):not(.hero2):not(.band) {
  background: linear-gradient(180deg, #fff 0%, #fbfcfe 58%, #fff 100%);
}

/* ---------- 页脚 ---------- */

body.home .site-footer {
  background: #101d33;
  border-top: 0;
  color: rgba(201, 212, 228, .78);
}
body.home .site-footer h4 { color: #fff; }
body.home .site-footer a { color: rgba(201, 212, 228, .9); }
body.home .site-footer a:hover { color: #ffd479; }
body.home .site-footer .legal-line { border-top-color: rgba(201, 212, 228, .2); }
body.home .site-footer .legal-line a { color: #7fa8e8; }

/* ---------- 窄屏 ---------- */

@media (max-width: 980px) {
  body.home .hero2 { min-height: min(82vh, 720px); padding-top: calc(var(--topbar, 0px) + 84px); }
  .hero2-copy { padding-bottom: 36px; }
  body.home .tiles { gap: 14px; }
  body.home .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body.home .site-header { position: absolute; }
  body.home .site-header.is-solid { position: fixed; }
  body.home .hero2 { min-height: min(74vh, 660px); padding-top: calc(var(--topbar, 108px) + 34px); }
  /* 画面铺满整屏，左右渐变让右侧亮部把文字吃掉，窄屏改成上下压暗 */
  body.home .hero2::before {
    background:
      linear-gradient(180deg, rgba(8, 14, 24, .8) 0%, rgba(8, 14, 24, .34) 26%, rgba(8, 14, 24, .48) 62%, rgba(13, 23, 40, .82) 100%);
  }
  body.home .hero2 h1 { letter-spacing: -.2px; }
  body.home .hero2 .lede { font-size: 15.5px; }
  .hero2-actions { gap: 10px; margin-top: 28px; }
  body.home .cta, body.home .cta-ghost { flex: 1 1 auto; text-align: center; padding: 14px 16px; font-size: 15px; }
  .hero2-band { padding: 18px 0 20px; }
  body.home .hero-facts { gap: 10px 0; }
  body.home .hero-facts li { padding: 0 10px 0 0; }
  body.home .hero-facts li + li { padding-left: 10px; }
  body.home .hero-facts b { font-size: 23px; white-space: nowrap; }
  body.home .hero-facts .t { font-size: 11.5px; margin-top: 5px; }
  /* 三张班型照是合影，111px 宽的三列会把脸压成噪点，窄屏改成一列把照片放大 */
  body.home .tiles { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  body.home .tile { padding-bottom: 18px; }
  body.home .tile h3 { margin: 18px 0 4px; font-size: 17px; letter-spacing: .3px; }
  body.home .tile-go { font-size: 12.5px; padding: 7px 18px; }
  body.home .quads { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.home .quads a { padding: 22px 12px 18px; }
  body.home .quads svg { width: 32px; height: 32px; margin-bottom: 12px; }
  body.home .quads b { font-size: 15px; letter-spacing: .2px; }
  body.home .quads .go { margin-top: 10px; font-size: 11.5px; letter-spacing: 1px; }
  body.home .wall { gap: 10px; }
  body.home .wall figcaption { font-size: 12.5px; padding: 22px 12px 10px; }
  body.home .deep-links { font-size: 13px; }
  .grain::after { display: none; }
}

/* ---------- 关掉动效：一切回到最终态 ---------- */

@media (prefers-reduced-motion: reduce) {
  body.js-anim .reveal,
  body.js-anim .line > span,
  body.js-anim .tile,
  body.js-anim .quads li,
  body.js-anim .wall figure {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  body.js-anim .hero2-media img.is-on { animation: none !important; }
  body.home .card,
  body.home .cta,
  body.home .tile img { transition: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
