/**
 * Janus 介绍页（janus.html）的页面版式。
 *
 * 业务定位：介绍页按首页的语言重排：内页首屏 + 两栏交替的章节，论点旁边配动画。
 * 令牌、按钮、卡片、截图框都来自 mx.css / mx-doc.css，这里只写这一页特有的排布。
 *
 * 对齐约定（Owner：同列左右边、同行底边、同行控件高度一致）：
 *   - 两栏章节一律用 mx.css 的 .chapter-in（文 5 图 7，is-flip 镜像），各章节左右边与版心对齐；
 *   - 模式卡和三阶段定位放在同一行三列，靠 grid 拉伸保证同行底边一致；
 *   - 七个策略入口一行七列等宽等高，窄屏降为两列、一列。
 */

/* 首屏 ------------------------------------------------------------------- */
/* 文字栏和截图顶边对齐，不用垂直居中：英文版由 i18n.js 在首帧之后换字，导语变长时
   居中会把整栏往上推（实测 CLS 0.015）；顶对齐只有按钮和特性行往下挪。
   文字栏也不加上内边距：加了会比截图栏高，标题字体晚到时整行跟着变高（实测 CLS 0.0076） */
.jn-head-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.jn-head .lead { margin-top: 4px; }
/* 三个特性：等宽小字一行排开，竖线分隔，不做胶囊（导航和标签都不加边框胶囊） */
.jn-claims { display: flex; flex-wrap: wrap; gap: 10px 0; margin-top: 40px; font: 500 13px/1.4 var(--mono); color: var(--text-3); }
.jn-claims li + li { margin-left: 18px; padding-left: 18px; border-left: 1px solid var(--line-2); }
/* 两张真实界面截图并排、顶边对齐；压暗与悬停恢复由 mx-doc.css 统一处理。
   width:100% 不能省：margin-left:auto 让它在网格单元里按内容收缩，截图没载完时内容宽度接近 0，框先塌成一条窄条，
   图到了再撑开到 7fr 的整栏（英文版截图是 i18n 换 src 后才开始取，晚到最明显，1440 宽英文实测 CLS 0.218）。
   固定成整栏宽后载入前后尺寸一致，max-width 仍把它限制在 880px 内、靠右 */
.jn-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px); width: 100%; max-width: 880px; margin-left: auto; }
.jn-shots .shot { margin: 0; }
.jn-shots figcaption { font: 500 12px/1.4 var(--mono); }

/* 章节通用 --------------------------------------------------------------- */
.jn-body { max-width: 38em; margin-top: 22px; }
.jn-sec .chapter-copy h2 { margin-top: 16px; }
.jn-boot { aspect-ratio: 8 / 5; }
/* 「把控制权抢在 OS 接管之前」只在空格处折行，不把「接管」拆开；窄屏放开，避免长句撑出版心 */
@media (min-width: 961px) { .jn-keep { word-break: keep-all; } }

/* 三个阶段：编号 + 标题 + 原文，细线分隔，和右侧动画的 01/02/03 一一对应 */
.jn-phases { display: grid; border-top: 1px solid var(--line); }
.jn-phases li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 12px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.jn-no { font: 500 13px/32px var(--mono); color: var(--text-3); }
.jn-phases h3 { font-size: clamp(22px, 1.9vw, 28px); }
.jn-phases p { margin-top: 8px; color: var(--text-2); }
.jn-phase-viz { aspect-ratio: 2 / 1; }

/* 两种模式：动画在左、文字在右；下面一行三列：两张模式卡 + 三阶段定位 */
.jn-mode-viz { aspect-ratio: 16 / 10; }
.jn-mode-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: clamp(56px, 6vw, 88px); }
.jn-mode-row .card h3 { margin-bottom: 14px; }
/* 三阶段定位和两张模式卡同一套卡框，三行在卡内均分高度，卡的上下边和左右两张卡对齐 */
.jn-proof { display: grid; grid-template-rows: repeat(3, 1fr); padding-block: 8px; }
.jn-proof > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-content: center; gap: 12px; padding: 14px 0; }
.jn-proof > div + div { border-top: 1px solid var(--line); }
.jn-proof dt { font: 500 12px/28px var(--mono); color: var(--text-3); }
.jn-proof b { display: block; font: 500 20px/28px var(--display); color: var(--text); }
/* 11-11 第十三轮：说明小字窄屏（中文 360 宽）和英文 1024 宽末行只剩一个字 / 一个词，按行平衡折行 */
.jn-proof span { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.6; color: var(--text-2); text-wrap: balance; }

/* 入口卡去油：渐变底换成中性平底（同 mx.css .card），悬停与「下一项」只靠顶边 1px 暖金线和边线提亮。
   覆盖范围：七个入口一行排开；悬停时自己亮起，02 悬停时 03 一起标出（page-janus.js 加 is-next） */
.jn-scope-head { max-width: 760px; }
.jn-entries { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin-top: clamp(40px, 4vw, 64px); }
.jn-entries li { position: relative; padding: 20px 18px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .25s var(--ease), background-color .25s var(--ease); }
.jn-entries li::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
/* 入口名只在空格处折行（避免「影子表 / V」把 V 甩到下一行），标题统一占两行高，七张卡的说明从同一条线起 */
.jn-entries h3 { min-height: 2.9em; font: 500 17px/1.45 var(--display); color: var(--text); word-break: keep-all; text-wrap: balance; }
.jn-entries p { margin-top: 12px; font-size: 13.5px; line-height: 1.7; color: var(--text-3); transition: color .25s var(--ease); }
.jn-entries li:hover, .jn-entries li.is-next { border-color: var(--line-2); }
.jn-entries li:hover::before { transform: scaleX(1); }
.jn-entries li:hover p, .jn-entries li.is-next p { color: var(--text-2); }
.jn-entries li.is-next::before { transform: scaleX(1); opacity: .45; }

/* 收尾提示：一条横向的卡，左文右按钮，按钮和文字底边对齐 */
.jn-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 48px; padding: clamp(28px, 3vw, 44px); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.jn-cta-text { max-width: 44em; margin-top: 12px; font-size: 17px; color: var(--text-2); }

/* 窄屏 ------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .jn-entries { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .jn-head-in { grid-template-columns: minmax(0, 1fr); }
  .jn-shots { max-width: none; margin: 8px 0 0; }
  /* 窄屏统一先文后图：is-flip 的图在源码前面，靠 mx.css 的 .chapter-copy order 调；这里补上阶段列表 */
  .jn-mode-row { grid-template-columns: minmax(0, 1fr); }
  .jn-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jn-entries li:last-child { grid-column: 1 / -1; }
  .jn-cta { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .jn-phase-viz { aspect-ratio: 1 / 1; }
  .jn-mode-viz { aspect-ratio: 5 / 4; }
  .jn-entries { grid-template-columns: minmax(0, 1fr); }
  .jn-claims li + li { margin-left: 12px; padding-left: 12px; }
  .jn-proof > div { grid-template-columns: 64px minmax(0, 1fr); }
}
