/* 补充设计稿未覆盖的手机端细节，以及设计稿在手机上的问题。
   运行时把设计稿样式插在本文件之后，所以这里的选择器都带 html body 前缀。 */

/* 手机和平板：只扩大点击区域、提高菜单可读性，不改变元素位置 */
@media (max-width: 1099px) {
  html body .gnav-lang {
    margin-block: -13px;
    margin-right: -4px;
    padding: 13px 10px;
  }

  /* 菜单嵌套在带 backdrop-filter 的 .gnav 内，自身的模糊不生效，半透明时下层文字会透出 */
  html body .sheet {
    background: #fafafc;
  }
}

/* 手机横屏：舞台不能高于屏幕，并压缩内容让关键信息留在一屏内 */
@media (orientation: landscape) and (max-height: 500px) {
  html body .ovt-stage,
  html body .osh-stage {
    min-height: 0;
  }

  html body .ovt-copy {
    width: min(460px, 46%);
  }

  html body .ovt-copy .eyebrow {
    margin-bottom: 6px;
  }

  html body .ovt .ovt-h1,
  html body .ovt .ovt-h {
    font-size: 26px;
  }

  html body .ovt-sub {
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
  }

  html body .ovt-go {
    margin-top: 8px;
  }

  /* 画布按自身高度绘制，压低后圆台同比缩小，步骤说明才能留在屏幕内。
     设计稿用 #sevenPin 按屏幕高度收紧，这里同样带上 #sevenPin，否则会被它覆盖 */
  html body .sv-pad {
    height: clamp(100px, 34vh, 150px);
  }

  html body #sevenPin .sv-detail {
    margin-top: 10px;
  }

  html body .sv-n {
    font-size: 12px;
  }

  html body #sevenPin .sv-detail h3 {
    font-size: 30px;
    margin-top: 2px;
  }

  html body #sevenPin .sv-detail #sdS {
    font-size: 14px;
    line-height: 1.5;
    margin-top: 4px;
    min-height: 0;
  }

  html body #sevenPin .sv-tag {
    font-size: 12px;
    margin-top: 6px;
  }
}

/* 以下修正的是设计稿在手机上的问题 */

/* 手机横屏：页面顶部时舞台上方多一条 45px 的栏，切换按钮跟着上移，保证完整露出 */
@media (orientation: landscape) and (max-height: 500px) {
  html body .ovt-fx {
    top: calc(100vh - 149px);
    top: calc(100svh - 149px);
  }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 833px) {
  html body .ovt-copy {
    top: 12px;
  }
}

/* 固定布局的表格里「同学 A」列宽度会算成 0，这里显式平分。
   桌面端这张卡片不显示，宽屏但高度不足时才会用到，所以不限宽度 */
html body .sp-cmp thead th.ca,
html body .sp-cmp thead th.cb {
  width: calc((100% - var(--sp-th, 5.6em)) / 2);
}

@media (max-width: 833px) {
  /* 首屏滚动距离比设计稿（6.4 屏）缩短约 3 成；拼成 WISEE 的停留按比例一起缩短 */
  html body .ovt {
    height: 460vh;
  }

  /* 矮屏上舞台不能高于可视区域，否则图形偏低，会被切换控件压住 */
  html body .ovt-stage {
    min-height: 0;
  }

  /* 全班学情第一、二步时，下方的图表还没出现，圆点下移到空白中间 */
  html body .ec1-dots,
  html body .ec1-lab {
    transition: opacity .45s var(--ease) .3s, transform .7s var(--ease);
  }

  html body .edm[data-step="0"] .ec1-dots,
  html body .edm[data-step="0"] .ec1-lab {
    transform: translateY(100px);
  }

  html body .edm[data-step="1"] .ec1-dots,
  html body .edm[data-step="1"] .ec1-lab {
    transform: translateY(60px);
  }
}

/* 手机和平板，包括手机横屏 */
@media (max-width: 833px), (orientation: landscape) and (max-height: 500px) {
  /* 中文只在标点后换行，放不下时才在词中断开 */
  html body h1,
  html body h2,
  html body h3,
  html body .ovt-h,
  html body .mp-lab b {
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  /* 点击区域扩大到 44px，元素的外观和位置不变 */
  html body .chev,
  html body .lnav-title,
  html body .gnav .logo,
  html body .btn.sm,
  html body .copy,
  html body .osh-prev,
  html body .osh-next,
  html body .mini-seg button,
  html body .dm-steps button {
    position: relative;
  }

  html body .chev::before,
  html body .lnav-title::before,
  html body .gnav .logo::before,
  html body .btn.sm::before,
  html body .copy::before,
  html body .mini-seg button::before,
  html body .dm-steps button::before {
    content: "";
    position: absolute;
    inset: -10px 0;
  }

  html body .osh-prev::before,
  html body .osh-next::before {
    content: "";
    position: absolute;
    inset: -2px;
  }

  html body .ovt-fx::before {
    content: "";
    position: absolute;
    inset: -8px -4px;
  }

  html body .osh-ctl .ap-replay::before {
    content: "";
    position: absolute;
    inset: -6px 0;
  }

  html body .scn-item::after {
    content: "";
    position: absolute;
    inset: -2px 0;
  }

  html body .seg button {
    min-height: 44px;
  }

  html body .foot-cols a {
    margin-block: 0;
    padding-block: 13px;
  }

  html body .foot-base a {
    position: relative;
  }

  html body .foot-base a::before {
    content: "";
    position: absolute;
    inset: -12px 0;
  }

  /* 步骤标签换行时不留单个字 */
  html body .dm-steps button {
    text-wrap: balance;
  }

  /* 产品示意图里的文字不小于 10px */
  html body .flow-steps,
  html body .flow-steps i,
  html body .pd-doc .pdf,
  html body .pd-cover small,
  html body .pd-cover span,
  html body .pd-cal-h span,
  html body .pd-cal-w span,
  html body .pd-d,
  html body .pd-d.ex em,
  html body .pd-cal-k,
  html body .pd-task small {
    font-size: max(10px, .9em);
    letter-spacing: 0;
  }

  html body .pd-toc-h,
  html body .pd-toc-r li,
  html body .pd-go,
  html body .pd-task b {
    font-size: max(10px, 1em);
  }

  html body .flow-steps {
    font-size: max(11px, 2.9cqw);
  }

  html body .ec2-path li {
    font-size: 12px;
  }

  /* 「考试」标签放大后会盖住上一行的日期，改放到 19 号下方 */
  html body .pd-d.ex em {
    top: calc(100% + .25em);
    bottom: auto;
  }

  html body .pd-cal-k {
    margin-top: 2.4em;
  }
}

@media (max-width: 480px) {
  /* 标题最长的一行约 10 个字，字号随屏宽缩放才不会把标点挤到下一行 */
  html body .headline,
  html body #highlights .headline,
  html body .glowtext,
  html body .cta-title {
    font-size: clamp(26px, 8.2vw, 34px);
  }

  /* 步骤按钮放不下序号，序号去掉后标签放大到 12px */
  html body .dm-steps button {
    font-size: 12px;
  }

  html body .dm-steps button i {
    display: none;
  }
}

/* 雷达图按比例缩小后标签只有约 7px，这里放大（英文页的脚本还会把标签拆成两行） */
@media (max-width: 480px) {
  html body .radar text {
    font-size: 23px;
  }
}

@media (max-width: 374px) {
  html body .radar text {
    font-size: 27px;
  }
}

/* 学习场景：没有书堆舞台时（手机、平板、矮屏）不显示「学习中心」窗口，只留场景列表。
   桌面的书堆舞台里设计稿本来就隐藏了这个窗口 */
html body .kx:not(.kx-on) .scn-win {
  display: none;
}

html body .kx:not(.kx-on) .scn {
  display: block;
}

html body .kx:not(.kx-on) .scn-list {
  max-width: none;
}

/* 团队：设计稿只在桌面做轨道动画。手机上名称绕标题转动，正文放在轨道下方，不压文字 */
@media (max-width: 833px) {
  html body .orbit.is-orbit-m .orb-core {
    position: static;
    padding-top: var(--orb-h, 300px);
  }

  html body .orbit.is-orbit-m .team-h {
    position: absolute;
    top: calc(var(--orb-h, 300px) / 2 - .7em);
    left: 0;
    right: 0;
    z-index: 2;
    margin: 0;
    font-size: clamp(19px, 5.6vw, 30px);
    line-height: 1.4;
  }

  html body .orbit.is-orbit-m .orb-ring {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--orb-h, 300px);
    overflow: visible;
    pointer-events: none;
  }

  html body .orbit.is-orbit-m .orb-ring ellipse {
    fill: none;
  }

  html body .orbit.is-orbit-m .orb-ring .r1 {
    stroke: url(#orbG);
    stroke-width: 1.4;
  }

  html body .orbit.is-orbit-m .orb-ring .r2 {
    stroke: url(#orbG2);
    stroke-width: 1;
    stroke-dasharray: 2 7;
  }

  html body .orbit.is-orbit-m .orb-ring .r3 {
    stroke: url(#orbG2);
    stroke-width: .8;
    opacity: .7;
  }

  html body .orbit.is-orbit-m .orb-items {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: block;
    height: var(--orb-h, 300px);
    max-width: none;
    margin: 0;
    padding: 0;
  }

  html body .orbit.is-orbit-m .orb-items li {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform, opacity;
  }

  html body .orbit.is-orbit-m .orb-items li span {
    padding: .42em .85em;
    font-size: 13px;
    letter-spacing: 0;
  }

  html body .orbit.is-orbit-m .orb-items li.front span::before {
    background: #1f3a68;
  }
}

@media (max-width: 374px) {
  html body .orbit.is-orbit-m .orb-items li span {
    padding: .36em .7em;
    font-size: 12px;
  }
}

/* 七步圆台的宽度受屏宽限制，压低画布去掉上下空白 */
@media (max-width: 599px) {
  html body .sv-pad {
    height: clamp(110px, 34vw, 170px);
  }
}

/* 小屏：收窄对比表首列和卡片内边距，让两列学生内容不至于过窄 */
@media (max-width: 374px) {
  html body .scn-body {
    padding-inline: 14px;
  }

  html body .sp-cmp {
    --sp-th: 4.6em;
  }

  html body .sp-cmp th:first-child {
    width: 4.6em;
  }

  html body .sp-cmp thead th + th {
    padding-right: 8px;
  }
}

/* 深度思考窗口：窄屏时状态标签（答对了 / 深度思考中）固定在右上角，左侧小标题给它留出位置，英文较长时也不会被压住 */
@media (max-width: 560px) {
  html body #deep .dt-h {
    position: relative;
  }

  html body #deep .dt-tag {
    position: absolute;
    top: 0;
    right: 0;
  }

  html body #deep .dt-h small {
    padding-right: 118px;
  }
}
