:root {
  color: #000;
  background: #fff;
  color-scheme: light;
  font-family: system-ui, sans-serif;
  --blue: #2952e3;
  --ui-font: system-ui, sans-serif;
  --brand-font: var(--ui-font);
  --hero-glass-alpha: .9;
  --hero-glass-shadow-alpha: .05;
  --hero-glass-shadow-radius: 34.254;
  --hero-glass-blur-radius: 31.399;
}

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

@supports (corner-shape: superellipse(1.6)) {
  *, *::before, *::after { corner-shape: superellipse(1.6); }

  /* 保留导航、胶囊按钮和标签的原有圆弧。 */
  .header :is(.nav-inner, .nav-links, .nav-actions, .language-picker summary),
  .button,
  .prompt-submit,
  .course-plan-add,
  .course-plan-speak,
  .course-result-continue,
  .lesson-choice > span:first-child,
  .lesson-playback-controls > span,
  .lesson-speak-button,
  .lesson-role-speak,
  .lesson-drill-audio-row > span,
  .lesson-demo-recording,
  .lesson-drill-record-capsule,
  .lesson-drill-continue,
  .review-switch button,
  .review-start,
  .reviews-pill,
  .games-picker button,
  .feedback-dialogue > p,
  .feedback-card-tags li,
  .tutor-tags li,
  .tutor-tags li::before { corner-shape: round; }

  /* 圆形头像、图标和进度指示沿用它们的圆形轮廓。 */
  .course-phone-avatar,
  .course-typing i,
  .course-composer-mic,
  .course-composer-send,
  .course-update-card li i,
  .course-plan-chat-button,
  .course-rating-hard .course-rating-art,
  .feedback-avatar,
  .feedback-v2-avatar,
  .review-cell-avatar,
  .lesson-ui-progress,
  .lesson-ui-progress::before,
  .lesson-ui-nav-button,
  .lesson-drill-avatar,
  .lesson-keyboard-button,
  .lesson-arrow,
  .lesson-dot::after,
  .lesson-demo-wave i,
  .lesson-progress,
  .lesson-progress span,
  .lesson-drill-record-close,
  .lesson-drill-record-send,
  .lesson-phone-close,
  .course-step::before,
  .course-step::after,
  .course-caret,
  .prompt-input-caret,
  .plan-card-go,
  .games-dots button,
  .dialog-close { corner-shape: round; }

  /* 屏幕裁切和底板需要贴合手机外框素材。 */
  #first-lesson .lesson-screen,
  #first-lesson .lesson-phone::before { corner-shape: round; }
}

body { margin: 0; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; }

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

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.hero {
  position: relative;
  overflow: clip;
  isolation: isolate;
}

.hero-grid {
  --grid-ink: rgb(27 29 34 / 61%);
  position: absolute;
  inset: auto 0 0;
  height: clamp(52px, 7.35vw, 145px);
  container-type: size;
  pointer-events: none;
  opacity: .6;
  box-shadow: inset 0 1px rgb(27 29 34 / 80%);
  background: linear-gradient(
    to bottom,
    transparent 10%,
    var(--grid-ink) 10% calc(10% + 1px), transparent calc(10% + 1px) 23%,
    var(--grid-ink) 23% calc(23% + 1px), transparent calc(23% + 1px) 42%,
    var(--grid-ink) 42% calc(42% + 1px), transparent calc(42% + 1px) 69%,
    var(--grid-ink) 69% calc(69% + 1px), transparent calc(69% + 1px)
  );
  mask-image: linear-gradient(#000 24%, rgb(0 0 0 / 82%) 52%, rgb(0 0 0 / 38%) 80%, transparent);
}

.hero-grid i {
  /* The lower endpoints spread out from the same vanishing point. */
  --ray-run: calc(var(--line) * 13.45cqw);
  position: absolute;
  top: 0;
  left: calc(50% + var(--line) * 9.55% - .5px);
  width: 1px;
  height: hypot(100cqh, var(--ray-run));
  background: var(--grid-ink);
  transform-origin: center top;
  transform: rotate(atan2(calc(-1 * var(--ray-run)), 100cqh));
}

.scene {
  --hero-nav-clearance: 88px;
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-rows: minmax(var(--hero-nav-clearance), 1fr) auto minmax(24px, 1fr);
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1920px;
  margin-inline: auto;
}

.scene > * { --u: max(.74px, calc(.7px + 100cqw / 6400), calc(100cqw / 1920)); }

.sky {
  position: absolute;
  top: calc(-566.9 * var(--u));
  left: 50%;
  display: grid;
  width: calc(2406.8 * var(--u));
  translate: -50% 0;
  pointer-events: none;
}

.sky img {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 680ms ease-in-out;
}

.sky .is-current { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .sky { animation: hero-glow-in 1.65s cubic-bezier(.2, .65, .35, 1); }
}

@keyframes hero-glow-in {
  from { opacity: .28; scale: .12 1; }
  to { opacity: 1; scale: 1; }
}

.header {
  --u: clamp(.74px, calc(.7px + 100vw / 6400), 1px);
  position: absolute;
  z-index: 20;
  inset: 0 0 auto;
  height: calc(129 * var(--u));
  pointer-events: none;
}

.header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  -webkit-backdrop-filter: blur(calc(14.3 * var(--u)));
  backdrop-filter: blur(calc(14.3 * var(--u)));
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / .99), transparent);
}

.nav-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: min(75%, 1440px);
  margin-inline: auto;
  padding-top: calc(29 * var(--u));
  font-family: var(--ui-font);
}

.nav-inner a { pointer-events: auto; }
.brand { justify-self: start; }
.brand img {
  width: calc(118.474 * var(--u));
  height: auto;
  aspect-ratio: 118.474 / 37.2987;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: calc(37 * var(--u));
  white-space: nowrap;
  font-family: var(--brand-font);
  /* 和右边的语言、下载按钮同一字号，一起跟着全站缩放规则走 */
  font-size: max(14px, calc(16 * var(--u)));
  font-weight: 500;
  color: rgb(0 0 0 / 60%);
  line-height: calc(25.6 * var(--u));
}

.nav-links a:hover { color: var(--blue); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(10 * var(--u, 1px));
  min-height: calc(52 * var(--u, 1px));
  padding-inline: calc(26 * var(--u, 1px));
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  font: 700 calc(16 * var(--u, 1px)) / 1.6 var(--ui-font);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.button img { width: calc(22 * var(--u, 1px)); height: auto; }
.button-outline { border-color: #b9c2d3; color: #121a2e; }
.button-outline:hover { background: #f1f5ff; border-color: var(--blue); }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover { background: #2145c8; }

.button-dark {
  justify-self: end;
  min-height: calc(44 * var(--u));
  padding-inline: calc(28 * var(--u));
  background: #000;
  color: #fff;
  font-family: var(--brand-font);
}

@media (hover: hover) and (pointer: fine) {
  .button-dark:hover { background: #252525; }
}
.nav-inner .button-dark {
  min-width: calc(165 * var(--u));
  min-height: calc(54 * var(--u));
}

.copy {
  position: relative;
  z-index: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, calc(754 * var(--u)));
  margin-inline: auto;
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  /* .prompt 本身不做动画，直接动输入框（示例卡片有自己的出场）：输入框的毛玻璃才能和输入框同时出现 */
  .copy > :is(.headline, .description, .actions),
  .copy > .prompt .prompt-entry {
    animation: hero-copy-in var(--copy-duration, .55s) cubic-bezier(.2, .68, .22, 1)
      var(--copy-delay, 0s) backwards;
  }

  .copy > .headline { --copy-duration: .6s; }
  .copy > .description { --copy-delay: .1s; }
  .copy > .prompt .prompt-entry { --copy-duration: .6s; --copy-delay: .16s; }
  .copy > .actions { --copy-delay: .32s; }
  .copy > :focus-within { opacity: 1 !important; transform: none !important; }

  @keyframes hero-copy-in {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to { opacity: 1; transform: none; }
  }
}

.headline {
  width: 9em;
  max-width: 100%;
  font-family: var(--brand-font);
  font-size: calc(64 * var(--u));
  font-weight: 600;
  line-height: calc(70 * var(--u));
  letter-spacing: calc(-1.5938 * var(--u));
}

.headline-line { display: block; white-space: nowrap; }

.gallery-trigger {
  position: relative;
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  vertical-align: top;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.gallery-label { display: block; }

.gallery-character {
  position: relative;
  display: inline-block;
  vertical-align: top;
}

.gallery-glyph {
  display: block;
  transform-origin: 50% 60%;
  pointer-events: none;
}

.gallery-sticker {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 1.28em;
  height: 1.28em;
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(.25);
  transform-origin: 50% 60%;
  filter: drop-shadow(0 .12em .12em rgb(27 38 58 / 16%));
  pointer-events: none;
  user-select: none;
}

.gallery-trigger:disabled { cursor: default; }

.headline-topics {
  position: relative;
  display: inline-grid;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  letter-spacing: inherit;
  text-align: start;
  vertical-align: baseline;
}

.headline-topics:enabled { cursor: pointer; }

.headline-topic {
  position: absolute;
  inset: 0 auto auto 0;
  background-image: var(--topic-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  visibility: hidden;
}

/* 换词直接切换，不做位移和淡入淡出（存在感最轻） */
.headline-topic[aria-hidden="false"] {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.topic-travel { --topic-gradient: linear-gradient(91.03deg, #36a7f5, #5f43ff); }
.topic-interview { --topic-gradient: linear-gradient(113.83deg, #a528fd 4.98%, #5c16f3 102.92%); }
.topic-meeting { --topic-gradient: linear-gradient(113.83deg, #ff74e3 47.29%, #ea00bb 102.92%); }
.topic-exam { --topic-gradient: linear-gradient(113.83deg, #ff9934 4.98%, #fb731b 47.29%, #f64b00 102.92%); }

@media (forced-colors: active) {
  .headline-topic { color: ButtonText; }
}

.description {
  width: min(100%, calc(600 * var(--u)));
  margin-top: calc(21 * var(--u));
  color: rgb(0 0 0 / 50%);
  font: 400 calc(20 * var(--u)) / calc(31.5 * var(--u)) var(--brand-font);
}

.actions {
  display: flex;
  justify-content: center;
  gap: calc(12 * var(--u));
  margin-top: calc(33 * var(--u));
}

.actions .button { font-family: var(--brand-font); }
.actions .button-outline { border-color: transparent; }
.actions .button-primary { background: #000; }
.actions .button-primary:hover { background: #252525; }

.prompt {
  width: 100%;
  margin-top: calc(40 * var(--u));
}

.prompt-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(8 * var(--u));
  min-height: calc(156 * var(--u));
  padding: calc(20 * var(--u)) calc(18.7 * var(--u));
  border: 1px solid #ebebeb;
  border-radius: calc(27.4 * var(--u));
  background: rgb(255 255 255 / var(--hero-glass-alpha));
  box-shadow: 0 0 calc(var(--hero-glass-shadow-radius) * var(--u)) rgb(0 0 0 / var(--hero-glass-shadow-alpha));
  -webkit-backdrop-filter: blur(calc(var(--hero-glass-blur-radius) * var(--u)));
  backdrop-filter: blur(calc(var(--hero-glass-blur-radius) * var(--u)));
}

.prompt-line {
  padding-block: calc(5.7 * var(--u));
  text-align: start;
  font-family: var(--brand-font);
  font-size: calc(19.41 * var(--u));
  font-weight: 500;
  line-height: calc(28.545 * var(--u));
  letter-spacing: calc(-.0835 * var(--u));
}

.prompt-caret {
  display: inline-block;
  width: clamp(2px, .14em, 3px);
  height: 1.08em;
  margin-left: calc(2 * var(--u));
  vertical-align: -.15em;
}

@media (prefers-reduced-motion: no-preference) {
  .prompt-line:not(.is-typing) .prompt-caret { animation: prompt-caret-blink 1.1s step-end infinite; }
  /* 闪烁用 visibility，不用 opacity：opacity 动画会让光标单独成为合成层，盖在它上面的输入框文字区也被迫单独成层，
     在磨砂玻璃（backdrop-filter）里显出一条亮一截的色带；光标一开始闪、一停闪，色带就出现、消失，看起来输入框背景在闪 */
  @keyframes prompt-caret-blink { 50% { visibility: hidden; } }
}

.prompt-submit {
  display: grid;
  place-items: center;
  align-self: end;
  width: max(32px, calc(41.104 * var(--u)));
  aspect-ratio: 1;
  border-radius: 50%;
  background: #000;
}

.prompt-submit:hover { background: #252525; }
.prompt-submit img { width: max(20px, calc(26.0586 * var(--u))); height: auto; }

/* 下载气泡（参考「点开会显示二维码的下载按钮」）：Midoo 图标、名称、简介和关闭按钮；
   二维码在圆角框里，出场时小圆点从中心往外冒出来，中间的图标最后弹出；下面是 iOS / Android 两个按钮。
   内容由 script.js 生成。 */
.download-qr {
  position: fixed;
  z-index: 21;
  width: 300px;
  padding: 20px;
  border: 1px solid rgb(17 24 39 / 6%);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 20px 50px rgb(16 24 42 / 18%), 0 2px 8px rgb(16 24 42 / 6%);
  color: #10182a;
  font-family: var(--ui-font, system-ui, sans-serif);
  text-align: center;
}
.download-qr .qr-top { display: flex; align-items: center; gap: 12px; text-align: left; }
.download-qr .qr-app-icon { width: 48px; height: 48px; border-radius: 13px; box-shadow: 0 6px 14px rgb(41 82 227 / 25%); }
.download-qr .qr-app { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.download-qr .qr-app strong { font-size: 18px; font-weight: 700; line-height: 1.25; }
.download-qr .qr-app span { overflow: hidden; color: rgb(16 24 42 / 55%); font-size: 13px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.download-qr .qr-frame {
  position: relative;
  width: 196px;
  margin: 16px auto 0;
  padding: 10px;
  border: 1px solid #e6e8ec;
  border-radius: 22px;
  aspect-ratio: 1;
}
.download-qr .qr-frame .qr-fallback { display: block; width: 100%; height: auto; }
.download-qr .qr-frame.is-drawn .qr-fallback { display: none; }
.download-qr .qr-art { display: block; width: 100%; height: 100%; color: #111; fill: #111; }
.download-qr .qr-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--qr-hole, 22%);
  height: auto;
  border-radius: 24%;
  box-shadow: 0 0 0 3px #fff;
  translate: -50% -50%;
}
.download-qr .qr-frame:not(.is-drawn) .qr-logo { display: none; }
.download-qr .qr-title { margin: 14px 0 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.download-qr .qr-sub { margin: 2px 0 0; color: rgb(16 24 42 / 55%); font-size: 13px; line-height: 1.5; }
.download-qr .qr-stores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
/* iOS / Android：点一下切换上面的二维码；选中的那个是白底深色描边 */
.download-qr .qr-stores button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 1px solid #e3e5ea;
  border-radius: 15px;
  appearance: none;
  background: #f5f6f8;
  color: rgb(16 24 42 / 55%);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.download-qr .qr-stores button:hover { background: #eceef2; color: #10182a; }
.download-qr .qr-stores button[aria-pressed="true"] {
  border-color: #10182a;
  background: #fff;
  box-shadow: inset 0 0 0 .5px #10182a;
  color: #10182a;
  cursor: default;
}
.download-qr .qr-stores svg { width: 16px; height: 16px; }
.download-qr :is(a, button):focus-visible { outline: 2px solid var(--blue, #2952e3); outline-offset: 2px; }

/* 小三角：指向按钮 */
.download-qr::after {
  position: absolute;
  top: 100%;
  left: var(--qr-tip, 50%);
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 3px;
  background: #fff;
  content: "";
}
.download-qr[data-below]::after { top: 0; box-shadow: -1px -1px 0 rgb(17 24 39 / 6%); }

/* 二维码出场：定位框先出现，小圆点从中心往外一圈圈冒出来，最后中间的图标弹出 */
@media (prefers-reduced-motion: no-preference) {
  .download-qr .qr-frame.is-playing .qr-finder { transform-box: fill-box; transform-origin: center; animation: qr-finder-in .42s cubic-bezier(.2, .9, .3, 1.25) both; }
  .download-qr .qr-frame.is-playing .qr-dot { transform-box: fill-box; transform-origin: center; animation: qr-dot-in .36s cubic-bezier(.2, .9, .3, 1.4) var(--d, 0s) both; }
  .download-qr .qr-frame.is-playing .qr-logo { animation: qr-logo-in .5s cubic-bezier(.2, .9, .3, 1.5) .5s both; }
  .download-qr .qr-frame.is-playing ~ :is(.qr-title, .qr-sub, .qr-stores) { animation: qr-text-in .4s ease both; }
  .download-qr .qr-frame.is-playing ~ .qr-sub { animation-delay: .05s; }
  .download-qr .qr-frame.is-playing ~ .qr-stores { animation-delay: .1s; }
  @keyframes qr-finder-in { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
  @keyframes qr-dot-in { from { opacity: 0; scale: 0; } to { opacity: 1; scale: 1; } }
  @keyframes qr-logo-in { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }
  @keyframes qr-text-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
}

@media (prefers-reduced-motion: no-preference) {
  .download-qr:not([hidden]) { animation: download-qr-in 180ms ease-out; }
  @keyframes download-qr-in {
    from { opacity: 0; scale: .96; }
    to { opacity: 1; scale: 1; }
  }
}

.download-dialog {
  width: min(365px, calc(100% - 32px));
  padding: 30px 24px 24px;
  border: 1px solid #dae1f2;
  border-radius: 24px;
  color: #121a2e;
  text-align: center;
  box-shadow: 0 16px 64px rgb(17 30 67 / 18%);
}

.download-dialog::backdrop { background: rgb(14 24 49 / 30%); }
.download-dialog h2 { margin-bottom: 20px; font-size: 25px; }

.dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover { background: #f1f5ff; }
.store-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

@media (max-width: 880px) {
  .scene { --hero-nav-clearance: 72px; }
  .scene > * { --u: clamp(.56px, .165vw, .74px); }

  .sky {
    top: -200px;
    width: max(880px, 125%);
  }

  .header {
    --u: clamp(.56px, .165vw, .74px);
    height: 72px;
  }

  .nav-inner {
    width: min(calc(100% - 24px), 630px);
    min-height: 52px;
    padding-top: 8px;
  }

  .brand img { width: clamp(66px, 19vw, 91px); }

  .nav-links {
    gap: clamp(10px, 3.5vw, 22px);
    font-size: 13px;
    line-height: 1.5;
  }

  .nav-links a { padding-block: 12px; }
  .nav-inner .button-dark { min-width: 0; min-height: 36px; padding-inline: 12px; font-size: 12px; }

  .copy {
    width: min(100%, 590px);
    padding-inline: 15px;
  }

  .headline {
    width: 10em;
    font-size: min(clamp(29px, 8.9vw, 39.22px), calc((100cqw - 32px) / 8.5));
    line-height: 1.13;
    letter-spacing: -.044em;
  }

  .description {
    width: min(100%, 375px);
    margin-top: 10px;
    font-size: clamp(12px, 3.24vw, 15px);
    line-height: 1.65;
    text-wrap: balance;
  }

  .prompt { margin-top: clamp(16px, 4.5vw, 28px); }
  .prompt-entry { min-height: 96px; padding: 8px 10px; border-radius: max(15px, calc(27.4 * var(--u))); }
  .prompt-line { font-size: max(12px, calc(19.41 * var(--u))); line-height: 1.5; }
  .prompt-submit { width: 36px; }

  .actions { gap: 6px; margin-top: 12px; }
  .actions .button { min-height: 44px; padding-inline: clamp(12px, 4vw, 22px); font-size: 13px; }
  .actions .button img { width: 16px; }

}

@media (prefers-reduced-motion: reduce) {
  .button, .sky img, .headline-topic, .headline-topic[aria-hidden="false"] { transition: none; }
}

/* 整个网页的文字都不能被选中（防止误选、拖拽高亮）；输入框里的文字仍然可以选中和编辑 */
html {
  -webkit-user-select: none;
  user-select: none;
}
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
