/* =========================================================
   音闻星口才 STAR TALKER · 官网样式
   设计基准：1440 × 4000（12 栏 / 边距 120 / 卡片间距 32）
   实现方式：html 根字号随视口线性缩放（1440 宽时 1rem = 16px），
            页面所有尺寸统一用 rem，因此在任何桌面宽度下比例完全一致。
   ========================================================= */

/* ---------- 设计令牌 ---------- */
:root {
  --brand: #E1390F;          /* 主色（设计稿） */
  --brand-deep: #C1121F;     /* 渐变末端 */
  --brand-ink: #1D1D1F;
  --ink: #1D1D1F;
  --ink-2: #6E6E73;
  --ink-3: #86868B;
  --ink-4: #C7C7CC;
  --line: #E8E8ED;
  --surface: #F5F5F7;
  --white: #FFFFFF;
  --field-line: #D2D2D7;
  --wrap: 90rem;             /* 1440 */
  --pad: 7.5rem;             /* 120 */
  --gutter: 2rem;            /* 32 */
  --header-h: 5.5rem;        /* 88 */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  /* 1440px 视口 → 16px；1260px 及以下锁 14px（＝设计稿 87.5%），避免平板档文字缩到 12px */
  font-size: clamp(14px, 1.1111vw, 16px);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.1875rem;   /* 19 */
  line-height: 1.15;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, p, blockquote { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: .9375rem 1.25rem;
}
.skip-link:focus { left: .5rem; top: .5rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- 通用排版 ---------- */
h1 { font-size: 5.3125rem; font-weight: 700; line-height: 1.15; }   /* 85 */
h2 { font-size: 3.3125rem; font-weight: 700; line-height: 1.15; }   /* 53 */
.sub { font-size: 1.5rem; color: var(--ink-2); line-height: 1.15; } /* 24 */
.eyebrow { font-size: 1.0625rem; color: var(--brand); letter-spacing: .0588em; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 3.25rem;                 /* 52 */
  padding: 0 2.1875rem;            /* 35 */
  border: 0; border-radius: 0;     /* 设计稿为直角 */
  font-size: 1.25rem;              /* 20 */
  line-height: 1;
  cursor: pointer;
  transition: background-color .22s var(--ease), color .22s var(--ease), opacity .22s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.btn-invert { background: #fff; color: var(--brand); font-weight: 600; }
.btn-invert:hover { background: var(--surface); }
.btn-block { width: 100%; }
.btn-sm { height: 2.5rem; padding: 0 2rem; font-size: 1.1875rem; }  /* 140×40 / 19 */

.btn-row { display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* ---------- 页头 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header.is-scrolled { box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .04); }

.header-inner {
  display: flex; align-items: center; gap: 4.5rem;
  height: var(--header-h);
}

.brand { display: flex; align-items: baseline; }
.brand-cn { font-size: 1.8125rem; font-weight: 600; }  /* 29 */
.brand-en {
  margin-left: 1.0625rem; font-size: .9375rem; color: var(--ink-3);
  letter-spacing: .1333em;
}

.nav { display: flex; gap: 1.625rem; font-size: 1.25rem; }
.nav a { padding: .5rem 0; border-bottom: 2px solid transparent; transition: color .2s var(--ease), border-color .2s var(--ease); }
.nav a:hover { color: var(--brand); }
.nav a.is-active { border-color: var(--brand); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 1rem; }

.nav-toggle {
  display: none; width: 2.75rem; height: 2.75rem; padding: 0;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: .375rem;
}
.nav-toggle span { display: block; width: 1.375rem; height: 2px; background: var(--ink); transition: transform .25s var(--ease), opacity .2s var(--ease); }
.site-header.nav-open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- 首屏 ---------- */
.hero { padding-top: 3.875rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--line); }
.hero-grid {
  display: grid;
  grid-template-columns: 35rem 35rem;   /* 560 + 80 + 560 */
  gap: 5rem;
  align-items: start;
}
.hero-copy { padding-top: 2.5rem; }
.hero-copy h1 { margin-top: .875rem; }        /* eyebrow → h1 = 15px */
.hero-copy .lede { margin-top: 3.125rem; font-size: 1.5rem; line-height: 1.5833; color: var(--ink-2); }
.hero-copy .btn-row { margin-top: 2.75rem; }

/* ---------- 媒体占位（放图即自动替换） ---------- */
.media {
  position: relative; overflow: hidden; background: var(--surface);
  margin: 0;
}
.media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .4s var(--ease);
}
.media.is-loaded img { opacity: 1; }
.media-ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: 1rem; text-align: center;
  font-size: 1.0625rem; color: var(--ink-4); line-height: 1.5;
}
.media-ph-sm { font-size: .9375rem; letter-spacing: .04em; }
.media.is-loaded .media-ph { display: none; }

.media-hero { aspect-ratio: 560 / 660; }
.media-teacher { aspect-ratio: 276 / 220; }
.media-map { aspect-ratio: 600 / 320; }
.media-strip { aspect-ratio: 1200 / 420; margin-top: 3.75rem; }

/* ---------- 数据条 ---------- */
.stats { border-bottom: 1px solid var(--line); }
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter);
  padding-top: 2.8125rem; padding-bottom: 1.25rem;
}
.stat-num { display: block; font-size: 3.3125rem; font-weight: 600; line-height: 1.15; }
.stat-label { display: block; margin-top: .125rem; font-size: 1.1875rem; color: var(--ink-2); }

/* ---------- 区块通用 ----------
   间距规则：每屏只声明 padding-top＝与上一屏的视觉间隙，避免两屏叠加
   （#about 90 / #courses 60 / #faculty 124 / #growth 108 / #campus 108 / 页脚前 120） */
.section { padding-top: 3.75rem; }
#about { padding-top: 5.625rem; }
#courses { padding-top: 3.75rem; }
#faculty { padding-top: 7.75rem; }
#growth { padding-top: 6.75rem; }
#campus { padding-top: 6.75rem; padding-bottom: 7.5rem; }
.section .sub { margin-top: 0; }

.grid { display: grid; gap: var(--gutter); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- 为什么选择（四张卡片） ---------- */
.card-row { margin-top: 3.75rem; }
.card { background: var(--surface); }
.card-why { padding: 2.75rem 2.25rem; min-height: 21.25rem; }
.card-num { display: block; font-size: 3.3125rem; font-weight: 600; color: var(--brand); line-height: 1.15; }
.card-why h3 { margin-top: 2.1875rem; font-size: 1.8125rem; font-weight: 600; }  /* 29 */
.card-why p { margin-top: .9rem; font-size: 1.1875rem; line-height: 1.7; color: var(--ink-2); }

/* ---------- 课程体系（分阶列表） ---------- */
.track-list { margin-top: 1.625rem; }
.track {
  display: grid;
  grid-template-columns: 13.75rem 18.75rem 1fr 2.25rem;  /* 220 / 300 / 剩余 / 36 */
  align-items: baseline;
  min-height: 7.5rem;                /* 设计稿行高 120 */
  padding-top: 1.75rem;              /* 设计稿文字顶距 28 */
  border-bottom: 1px solid var(--line);
}
.track-age { font-size: 1.6875rem; font-weight: 600; color: var(--brand); }
.track-name { font-size: 2rem; font-weight: 600; }
.track-desc { font-size: 1.3125rem; color: var(--ink-2); }
.track-arrow { justify-self: end; font-size: 2rem; color: var(--ink-4); }

/* ---------- 师资团队 ---------- */
.faculty-row { margin-top: 2.5rem; }
.teacher h3 { margin-top: 1.875rem; font-size: 1.5rem; font-weight: 600; }
.teacher p { margin-top: .25rem; font-size: 1.0625rem; color: var(--ink-3); }

/* ---------- 学员成长 ---------- */
.quote-row { margin-top: 3.75rem; }
.quote { background: var(--surface); padding: 2.25rem; }
.quote p { font-size: 1.25rem; line-height: 1.8; }
.quote footer { margin-top: 1.5rem; font-size: .9375rem; color: var(--ink-3); }
.quote footer span { display: block; margin-top: .25rem; color: var(--ink-4); }

/* ---------- 校区分布 ---------- */
.campus-grid {
  display: grid;
  grid-template-columns: 35rem 37.5rem;  /* 560 + 40 + 600 */
  gap: 2.5rem;
  margin-top: 3.75rem;
}
.campus-card { background: var(--surface); padding: 2.8125rem 2.25rem; }
.campus-card h3 { font-size: 2rem; font-weight: 600; }
.campus-meta { margin-top: 1.75rem; }
.campus-meta p { font-size: 1.3125rem; color: var(--ink-2); line-height: 1.9; }
.campus-meta a { border-bottom: 1px solid var(--ink-4); }

/* ---------- 体验课号召 ---------- */
.cta-band {
  background: linear-gradient(120deg, #E1390F 0%, #C1121F 100%);
  color: #fff;
  padding: 4.6875rem 0 2.0625rem;
}
.cta-band h2 { color: #fff; }
.cta-band p { margin-top: .375rem; font-size: 1.5rem; color: rgba(255, 255, 255, .9); }
.cta-band .btn { margin-top: 2.8125rem; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--surface); padding-top: 1.75rem; }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 18.75rem 18.75rem 18.75rem;
  gap: 0 var(--gutter);
}
.footer-brand { padding-top: .4375rem; }
.footer-brand .brand-en { margin-left: 1.0625rem; }
.footer-brand p { margin-top: 1.25rem; font-size: 1.1875rem; color: var(--ink-3); }
.footer-col h3 { font-size: 1.0625rem; font-weight: 600; }
.footer-col a, .footer-col span {
  display: block; margin-top: .5rem; font-size: 1.1875rem; color: var(--ink-2);
  transition: color .2s var(--ease);
}
.footer-col > :nth-child(2) { margin-top: .9rem; }
.footer-col a:hover { color: var(--brand); }

.footer-bottom {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: .75rem;
  padding: 1rem 0 1.25rem;
  border-top: 1px solid var(--line);
}
.footer-bottom small { font-size: 1rem; color: var(--ink-3); }
.footer-icp { text-align: right; }

/* ---------- 预约弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.25rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); animation: fade .25s var(--ease); }
.modal-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 30rem; max-height: 90vh; overflow-y: auto;
  background: #fff; padding: 2.5rem;
  animation: rise .3s var(--ease);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }

.modal-panel h2 { font-size: 2rem; font-weight: 700; }
.modal-sub { margin-top: .75rem; font-size: 1rem; line-height: 1.7; color: var(--ink-2); }
.modal-close {
  position: absolute; top: .5rem; right: .75rem;
  width: 2.5rem; height: 2.5rem; padding: 0;
  background: none; border: 0; font-size: 1.75rem; line-height: 1; color: var(--ink-3); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }

#bookForm { margin-top: 1.75rem; }
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .9375rem; color: var(--ink-2); }
.field > span i { color: var(--brand); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%; margin-top: .375rem; padding: .75rem .875rem;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid var(--field-line); border-radius: 0;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(225, 57, 15, .12);
}
.field.has-error input { border-color: var(--brand); }
.err { display: block; margin-top: .3125rem; font-size: .8125rem; font-style: normal; color: var(--brand); }
.form-note { margin-top: .875rem; font-size: .8125rem; line-height: 1.6; color: var(--ink-3); }
.form-result { margin-top: 1.25rem; padding: 1.25rem; background: var(--surface); font-size: 1rem; line-height: 1.75; }
.form-result strong { display: block; margin-bottom: .375rem; font-size: 1.125rem; }
.form-result code { font-size: .875rem; word-break: break-all; }

/* ---------- 进入视口动效 ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .modal-backdrop, .modal-panel { animation: none; }
}

/* 锚点跳转预留页头高度 */
[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* =========================================================
   响应式
   ========================================================= */

/* 平板（≤1100，含 iPad 横竖屏）：桌面版 5 项导航 + CTA 在这个宽度已经挤不下，
   从这里起切换为抽屉导航；同时按触屏标准把控件抬到 44px */
@media (max-width: 1100px) {
  /* 平板档：收窄页边距（原来沿用 7.5rem 配比，在 834/1024 上会白白浪费 ~40% 宽度） */
  :root { --pad: 5rem; --gutter: 1.75rem; }

  /* 触屏标准：可点元素最小 44px（用 px，不随根字号缩水） */
  .btn, .btn-sm { min-height: 44px; }

  /* 页头 */
  .header-inner { gap: .75rem; }
  .brand { white-space: nowrap; padding: .5rem 0; min-height: 44px; }
  .header-actions { gap: .5rem; }
  .nav-toggle { display: flex; width: 44px; height: 44px; padding: 0; }
  .nav {
    position: fixed; left: 0; right: 0; top: var(--header-h);
    display: none; flex-direction: column; gap: 0;
    padding: .5rem 1.375rem 1.5rem;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 1.5rem 2.5rem rgba(0, 0, 0, .12);
  }
  .site-header.nav-open .nav { display: flex; }
  .nav a { padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: 1.0625rem; }
  .nav a.is-active { border-color: var(--line); color: var(--brand); }

  /* 页脚链接同样给足触控高度 */
  .footer-col a, .footer-col span {
    display: flex; align-items: center; min-height: 44px;
    margin-top: 0; padding: 0;
  }
  .footer-col > :nth-child(2) { margin-top: .25rem; }

  /* 版面：两栏 → 单栏 */
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .media-hero { aspect-ratio: 16 / 11; }
  .hero-copy { padding-top: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .campus-grid { grid-template-columns: 1fr; }
  .media-map { aspect-ratio: 16 / 9; }
  .card-why { min-height: 0; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; }
  .footer-brand { grid-column: 1 / -1; }
}

/* 竖屏平板 / 大手机：课程列表改堆叠式 */
@media (max-width: 900px) {
  :root { --pad: 4rem; --gutter: 1.5rem; }

  .track { grid-template-columns: 1fr 2.25rem; gap: .5rem 1rem; min-height: 0; padding: 1.75rem 0; align-items: start; }
  .track-age { grid-column: 1 / 2; }
  .track-name { grid-column: 1 / 2; }
  .track-desc { grid-column: 1 / 2; }
  .track-arrow { grid-row: 1 / 4; grid-column: 2 / 3; align-self: center; }
  .grid-3 { grid-template-columns: 1fr; }
  .media-strip { aspect-ratio: 16 / 9; }
  .cta-band { padding: 3.5rem 0 3rem; }
}

/* 手机：根字号回到 16px，并整体收紧留白 */
@media (max-width: 820px) {
  html { font-size: 16px; }
  :root { --pad: 1.375rem; --gutter: 1rem; --header-h: 4rem; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.875rem; }
  .sub, .hero-copy .lede { font-size: 1.0625rem; }
  .hero-copy .lede { line-height: 1.7; }
  .eyebrow { font-size: .9375rem; }
  body { font-size: 1rem; }
  .brand-cn { font-size: 1.25rem; }
  .brand-en { margin-left: .5rem; font-size: .75rem; letter-spacing: .1em; }
  .btn { height: 2.875rem; padding: 0 1.5rem; font-size: 1rem; }
  .btn-sm { height: 2.75rem; padding: 0 1.125rem; font-size: .9375rem; }  /* 44px：触控最小高度 */
  .btn-row { gap: .625rem; width: 100%; }
  .btn-row .btn { flex: 1 1 0; min-width: 0; }   /* 两个按钮等宽，不再一大一小 */

  .hero { padding-top: 1.75rem; padding-bottom: 1.75rem; }
  .media-hero { aspect-ratio: 4 / 3; }
  .hero-copy h1 { margin-top: .625rem; }
  .hero-copy .lede { margin-top: 1.5rem; }
  .hero-copy .btn-row { margin-top: 1.75rem; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; padding-top: 2rem; padding-bottom: 1.75rem; }
  .stat-num { font-size: 2rem; }
  .stat-label { font-size: .9375rem; }

  .section { padding-top: 2.75rem; }
  #about, #courses { padding-top: 3rem; }
  #faculty, #growth { padding-top: 3.5rem; }
  #campus { padding-top: 3.5rem; padding-bottom: 3.25rem; }
  .grid-4 { grid-template-columns: 1fr; gap: 1rem; }
  .faculty-row { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
  .card-row, .faculty-row, .quote-row, .campus-grid, .track-list { margin-top: 2rem; }
  .card-why { padding: 1.75rem 1.5rem; }
  .card-num { font-size: 2.5rem; }
  .card-why h3 { margin-top: 1.25rem; font-size: 1.375rem; }
  .card-why p { font-size: 1rem; }
  .teacher h3 { margin-top: .875rem; font-size: 1.0625rem; }
  .teacher p { margin-top: .375rem; font-size: .8125rem; }
  .quote { padding: 1.5rem; }
  .quote p { font-size: 1.0625rem; }
  .campus-card { padding: 1.75rem 1.5rem; }
  .campus-card h3 { font-size: 1.3125rem; }
  .campus-meta p { font-size: 1rem; }
  .media-strip { margin-top: 2.5rem; }
  .track-age { font-size: 1.125rem; }
  .track-name { font-size: 1.375rem; }
  .track-desc { font-size: .9375rem; line-height: 1.6; }
  .track-arrow { font-size: 1.375rem; }
  .cta-band h2 { font-size: 1.75rem; }
  .cta-band p { font-size: 1rem; }
  .cta-band .btn { margin-top: 1.75rem; }

  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem 1rem; }
  .footer-col a, .footer-col span { font-size: 1.0625rem; }
  .footer-bottom { flex-direction: column; gap: .5rem; margin-top: 1.5rem; }
  .footer-icp { text-align: left; }
  .modal-panel { padding: 1.75rem 1.375rem; }
  .modal-sub { font-size: .9375rem; }
  .modal-close { width: 2.75rem; height: 2.75rem; top: .25rem; right: .25rem; }
}
