/* ══════════════════════════════════════════════════════════════
   贾维斯概念：声波解剖（sound.css）
   ──────────────────────────────────────────────────────────────
   这个站不用直线：分节的分割线是波形，随滚动起伏；
   首屏是一整幅满幅的声波，**六个峰就是六个章节**（点峰跳转、当前峰高亮）；
   下载入口由声波汇聚成按钮。
   波形 = 声音的形状，页面 = 被剖开的声波（概念能被内容解释）。

   2026-11-16 的改动（结构性，不是装饰）：
     ① .spec 不再是一条 208px 的装饰条：满幅（版心左缘 → 视口右缘）、
        高 44vh，文字浮在它上面（z-index：canvas 0 / 章节 0 / 正文 1）
     ② 峰 = 章节。峰的横坐标是写死的数组（wave.js 的 PEAKS），不随帧变
     ③ 波形本身换成正弦叠加 + 慢包络，鼠标只改其中**一个频率分量**
   ──────────────────────────────────────────────────────────────
   性能：DPR ≤ 2、柱数 ≤ 120、单个 rAF 调度器、滚出视口即停（IO）。
   ══════════════════════════════════════════════════════════════ */

/* 首屏的纵向预算：波形占 44vh，标题压进波形下半部（--h1-pull 是压进去多少）
   注意：这里不能用 .jvs-head 的 margin-top 来表达「压进去」——
   .hero 的 padding-top 是 0 时，首个子元素的 margin-top 会和父元素折叠，
   整个 .hero 被推下去（实测 .spec 的 y 变成 198，波形整块掉出首屏）。
   用 padding-top 就不会折叠。 */
.p-jvs {
  --band-h: clamp(240px, 44vh, 460px);
  --chap-h: 58px;
  --h1-pull: clamp(130px, 22vh, 210px);
  --pull: calc(var(--band-h) - var(--h1-pull));
}

/* ══════════ ① 满幅声波（同时是章节导航）══════════ */
.p-jvs .hero {
  position: relative;
  padding-top: var(--pull);
}

/* 选择器要带 .p-jvs 和 .hero：app.css 里 `.hero > *:not(.glow):not(.beam)` 给了
   子元素 position:relative + z-index:1（特异性 0,3,0），不压过它的话
   这里的 absolute 会被吃掉 —— 实测首屏标题被顶到 594px 之外，波形底下空一大块。 */
.p-jvs .hero > .spec {
  position: absolute;
  top: 0;
  /* 满幅：从栏墙（左栏右缘）一直铺到视口右缘。
     .spec 的 100% = .hero 的宽 = main 内容宽 = --colw × 视口 − gutter，
     所以 (100% + gutter) / --colw 正好是视口宽，再减 --rail 就是这一段的宽。
     全用百分比推，不用 100vw —— 100vw 含滚动条宽度，
     在带经典滚动条的桌面浏览器上会多出 15px，直接撑出横向溢出。

     2026-11-17 修：除数原来写死 0.618034（那是 --colw 还是 61.8% 时的版心比），
     --colw 收到 72% 之后这条公式把 .spec 撑到 1677.6px ——
     1440 视口下横向溢出 237.6px，被 html 的 overflow-x: clip 藏住了，
     代价是**第六个峰（更新）落在视口外**：左栏 6 个、首屏章节行只数得出 5 个。
     ⚠ --colw 若再改，这里的 0.72 必须跟着改（calc 不能拿百分比当除数）。 */
  left: calc(-1 * var(--gutter));
  width: calc((100% + var(--gutter)) / 0.72 - var(--rail));
  height: var(--band-h);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;      /* 只有 .chapters 接事件 */
}
.spec canvas {
  display: block;
  width: 100%;
  height: 100%;
  /* .spec 本身不接事件（否则整块会挡住文字选择），但画布要接 pointermove，
     光标扫过时频率分量才跟着走 */
  pointer-events: auto;
}

/* 六个章节：波形顶上的频率刻度。默认只有编号可读，
   标签在宽屏也给出来 —— 它和左栏是同一套链接，但这里带上下文。 */
.chapters {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--chap-h);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  pointer-events: auto;
}
.chapters a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding-bottom: var(--sp-2);
  font-size: var(--t-1);
  line-height: 1;
  letter-spacing: .04em;
  color: var(--ink-3);
  transition: color .2s ease;
}
.chapters a .ch-n { font-size: 10px; color: var(--ink-3); transition: color .2s ease; }
.chapters a::after {              /* 当前章节：脚下一小截金线 */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: var(--hair);
  background: var(--gold);
  transform: translateX(-50%);
  transition: width .3s cubic-bezier(.22, 1, .36, 1);
}
.chapters a:hover { color: var(--ink); }
.chapters a:hover .ch-n { color: var(--gold); }
.chapters a[aria-current="true"] { color: var(--ink); }
.chapters a[aria-current="true"] .ch-n { color: var(--gold); }
.chapters a[aria-current="true"]::after { width: 26px; }

/* 没 JS 时也留一条中线，别让首屏空一块 */
html:not(.js) .spec::after,
.no-canvas.spec::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: var(--hair);
  background: var(--line);
}
/* 说明行放在波形带子里的右下角：那里柱子的下瓣只到中线下 60px 左右，
   band-h-26 这一条是空的（实测波形在下瓣末端约 mid+58，而这里在 mid+135）。
   不能放到带子外面 —— 首屏标题下面是 lede-sub，两者会叠在同一行（实测：
   caption 的 y 落在 lede-sub 的第一行里，量对比度时被当成「文字底下的底色」）。 */
.p-jvs .spec-cap {
  position: absolute;
  right: var(--sp-4);
  bottom: var(--sp-3);
  font-size: var(--t-1);
  letter-spacing: var(--ls-3);
  color: var(--ink-3);
  pointer-events: none;
  opacity: .85;
}

/* 标题压进波形下半部：文字浮在波形之上（canvas 是 z-index 0，正文是 1） */
.p-jvs .jvs-head {
  position: relative;
  z-index: 1;
  margin-top: 0;
}
.p-jvs .jvs-head .lede-big {
  font-size: var(--t-6);
  line-height: 1.02;
  letter-spacing: -.02em;
}

/* ══════════ 首屏主张：换成手写的字 ══════════
   这一页的主题是「声音」：整屏上半是波形，下半是正文。标题用印刷黑体时，
   它读起来像「产品说明」；换成手写行草之后，它读起来像「有人在那儿说了一句话」——
   正好对上标题本身的意思（喊一声，就可以说话了）。这是这一站唯一的破例：
   全站正文、表格、读数都还是 Noto Sans，字形一律不手写。

   母字：AaBZLSXKT（作者标注 Non-Commercial Use，本站是个人非商用站；
   若日后上商业内容要换字或买授权）。子集只取这 11 字，3 KB。
   行草笔画细，同字号下比黑体「轻」一档：所以字号 ×1.08、字距归零，
   让它撑住这一屏；行距 1.06 —— 草书的字面不规则，行距再紧就打架。 */
@font-face {
  font-family: "JVS Kai";
  src: url("fonts/jvs-kai.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.p-jvs .jvs-head .lede-big {
  font-family: "JVS Kai", "STKaiti", "KaiTi", serif;
  font-weight: 400;
  font-size: calc(var(--t-6) * 1.08);
  line-height: 1.06;
  letter-spacing: 0;
}

/* ══════════ 首屏不再有图标：波形自己就是主体 ══════════
   2026-11-17：原来这里压着 108×108 的麦克风图标（青色 #2EC4B6 的圆角方块）。删掉的理由：
   · 那是应用商店的图标语言（圆角方砖 + 居中白色符号），和「把一条声波切开来看」没关系；
   · 它是全页唯一的异色，波形一色、图标另一色，页面因此有两个主角；
   · 图标居中压在波形正中，读者第一眼会当成「播放键」，而它不可点；
   · 它把标题从版心左缘推开 108px + 间距 —— 全页只有这一行标题不在那条左缘上，
     下面的说明、数据、每个分节都在，只有它不在，这是版式上的不一致。
   所以「标记」从首屏撤掉：首屏只有波形 + 手写的那句话，波形就是主体。
   页面上唯一保留「峰」这个记号的地方是页尾（.close-peak），那里没有波形与它抢。

   记号本身（纯 CSS，三根柱 + 峰顶横刻）与 canvas 画峰的方式一致（wave.js 的 vbar +
   峰顶 fillRect），1em = 标记高度，柱宽/间距全按 em 算，改字号即等比缩放。 */
.p-jvs .jvs-peak {
  display: inline-flex;
  align-items: flex-end;      /* 三根柱共用一条基线 —— 波形是从轴往上长的 */
  justify-content: center;
  gap: .09em;
  height: 1.16em;
  padding-top: .16em;         /* 给峰顶那截横刻留位置，不撑破行盒 */
  font-size: 44px;
  color: var(--gold);
  flex: 0 0 auto;
}
.p-jvs .jvs-peak i {
  display: block;
  width: .14em;
  min-width: 3px;
  background: currentColor;
  border-radius: .03em;
}
.p-jvs .jvs-peak i:nth-child(1) { height: .46em; }
.p-jvs .jvs-peak i:nth-child(2) { height: 1em; position: relative; }
.p-jvs .jvs-peak i:nth-child(3) { height: .60em; }
.p-jvs .jvs-peak i:nth-child(2)::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -.11em;
  width: .42em;
  height: max(2px, .03em);
  transform: translateX(-50%);
  background: currentColor;
  border-radius: .01em;
}

/* ══════════ ② 分节之间的波形 ══════════
   贾维斯页没有直线分割：每个分节的顶上是 44–64px 的波形带，
   相位随滚动位置走，所以滚下去的时候线是「起伏」的。 */
.p-jvs .sec {
  border-top: 0;
  padding-top: 0;
}
.band {
  position: relative;
  height: clamp(44px, 5.4vw, 64px);
  /* 越过内衬，从栏墙起笔 —— 波是从墙里出来的 */
  margin-left: calc(-1 * var(--gutter));
  width: calc(100% + var(--gutter));
  margin-bottom: var(--sp-4);
}
.band canvas {
  display: block;
  width: 100%;
  height: 100%;
}
/* 没有 JS：退回一条实实在在的分隔线，页面不会失去分节 */
html:not(.js) .band,
.band.no-canvas {
  border-top: var(--hair) solid var(--line);
}

/* ══════════ ③ 下载：声波汇聚成按钮 ══════════ */
.sink {
  position: relative;
  height: clamp(88px, 10.5vw, 128px);
  margin: 0 0 var(--sp-2);
  overflow: hidden;
}
.sink canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.sink + .contact-row .btn { position: relative; }
.sink.lit + .contact-row .btn {
  box-shadow:
    0 0 0 var(--hair) color-mix(in srgb, var(--gold) 60%, transparent),
    0 10px 34px color-mix(in srgb, var(--gold) 26%, transparent);
}
html:not(.js) .sink { display: none; }

/* ══════════ ④ 首屏入口：带一段电平的小图示 ══════════ */
.jump-a { gap: var(--sp-3); }
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  flex: 0 0 auto;
}
.eq i {
  display: block;
  width: 2px;
  background: var(--gold);
  border-radius: 1px;
}
.eq i:nth-child(1) { height: 40%; }
.eq i:nth-child(2) { height: 100%; }
.eq i:nth-child(3) { height: 65%; }
.eq i:nth-child(4) { height: 85%; }
@media (prefers-reduced-motion: no-preference) {
  .jump-a:hover .eq i,
  .jump-a:focus-visible .eq i {
    animation: eqPulse .78s ease-in-out infinite alternate;
  }
  .jump-a:hover .eq i:nth-child(2) { animation-delay: .12s; }
  .jump-a:hover .eq i:nth-child(3) { animation-delay: .24s; }
  .jump-a:hover .eq i:nth-child(4) { animation-delay: .36s; }
}
@keyframes eqPulse {
  from { transform: scaleY(.45); }
  to   { transform: scaleY(1.15); }
}

/* ══════════ ⑤ 64px 栏里的状态徽标 ══════════
   压成 64px 之后 rail-meta（状态 / 形态）放不下，只留最关键的「内测中」。 */
.rail-badge { display: none; }
@media (min-width: 901px) {
  .rail-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: var(--sp-2);
    font-size: 10px;
    letter-spacing: .02em;
    color: var(--live);
    white-space: nowrap;
  }
  .rail-badge .dot { width: 5px; height: 5px; }
}

/* ══════════ ⑥ 窄屏：波形回到流里，标题不再压上去 ══════════
   选择器必须和上面 `.p-jvs .hero > .spec` 一样重，否则这几条会被吃掉 ——
   实测：390 下 .spec 还是 absolute，首屏标题压在章节行上面，波峰全部点不到。 */
@media (max-width: 900px) {
  .p-jvs .hero { padding-top: var(--pad-hero); }
  .p-jvs .hero > .spec {
    position: relative;
    left: calc(-1 * var(--rail-pad));
    width: calc(100% + var(--rail-pad) * 2);
    max-width: none;
    margin-bottom: var(--sp-5);
  }
  .p-jvs .jvs-head { margin-top: 0; }
  .p-jvs .spec-cap { display: none; }
}
@media (max-width: 560px) {
  /* 6 列 × 65px 放不下「能做什么」，窄屏只留编号（顶栏里仍是全标签） */
  .chapters a .ch-t { display: none; }
  .chapters a .ch-n { font-size: 11px; }
  .p-jvs { --band-h: clamp(200px, 34vh, 320px); }
}

/* ══════════ ⑦ 打印：波形不印，分隔线回来 ══════════ */
@media print {
  .spec, .band, .sink, .eq, .chapters, .spec-cap, .rail-badge, .jvs-peak { display: none !important; }
  .p-jvs .hero { padding-top: 0 !important; }
  .p-jvs .jvs-head { margin-top: 0 !important; }
  .p-jvs .sec {
    border-top: var(--hair) solid var(--print-rule) !important;
    padding-top: 10pt !important;
  }
}
