/* ==========================================================================
   mvp.css（homepage-v4 · 2026-10-19 晚 · MVP 合并）
   取代 spike 12 的 spike12.css / r3.css / r5.css 里「还在用」的规则，以及 spike 14 r6-grid.css 里不属于网格的部分。
   只写默认态（lay=r3 · one=on · pr=2 · tf=2 · holo=h4 · map=M★ · ix=I1 · layout=C）—— 作废变体不带过来。
   在 content-wiring.css / story-sticker.css 之后、grid.css / me-card.css / tub.css / pen-card.css 之前加载。

     0 · 主题 token：物件表面 + 其上的字 **成对**（白天 / 夕阳 / 夜里）—— 浅色物件（白框、Yoto 卡、字条）上永远是深墨，
         暗纸卡（html.paper-dark）上是浅墨；按钮 / 输入框 / 占位字 / 下划线都从这几对里取，不从墙的墨取
     1 · 三档字号：--t-s 13 小标签 / 链接 · --t-m 15 段落 · --t-l 24 卡里那一句
     2 · 卡片家族：纸卡（魔法笔 / 找故事 / 来信）同一种纸、圆角 2、几乎贴墙；眉题藏、名字当小标签；背面绝对定位不撑卡高；一卡一件事
     3 · header：PLIK 缩到 60% + 右边「霹雳啪啦实验室」40px + tagline，整块底 = 字母底（js/mvp.js）；英文页 PLIK + Lab
     4 · 找故事卡（IA 5a：上下排）    （5 · 来信卡：v3 随「保持联系」卡退役）    6 · 暂不上线的区块（hidden）    7 · 开发面板 / 读数
   ========================================================================== */

/* ---------------- 0 · 主题 token（成对）---------------- */
:root {
  /* 深墨：所有「浅色物件表面」（拍立得白框、Yoto 卡、“bus” 字条、白天的纸卡）上的字 */
  --obj-ink-rgb: 30 36 48;
  --obj-ink: rgb(var(--obj-ink-rgb));
  --obj-ink-2: rgb(var(--obj-ink-rgb) / .80);
  --obj-ink-3: rgb(var(--obj-ink-rgb) / var(--ink-3-a));
  /* 实心按钮（.btn.cta）：底 / 字是派生 token --cta-bg / --cta-fg，定义在 tokens.css（v3 · R39）；各表面只设 --surface-bg */
  /* 输入框：字 / 占位 / 底线 / 聚焦线（占位 ≥ 4.5 : 1 对比） */
  --field-ink: var(--ink);
  --field-ph: var(--ink-3);
  --field-line: rgb(var(--ink-rgb) / .5);
  --field-focus: var(--ink);
  /* 浅色物件（字条、Yoto 卡）的表面 */
  --chip-bg: #FFFFFF;
  --chip-ink: var(--obj-ink);
  --chip-edge: rgb(var(--obj-ink-rgb) / .14);
}
/* 暗纸卡（夜里）：卡上的字 / 按钮 / 输入框全部换成「暗纸 + 浅墨」这一对。mobile-skin.css §5 只写了 .m-paper 的几类元素，这里补齐成 token */
:root.paper-dark[data-theme="night"] .m-paper,
:root.paper-dark[data-theme="night"] .m-slide {
  --surface-bg: var(--dk-paper);
  --field-ink: rgb(var(--dk-ink-rgb));
  --field-ph: rgb(var(--dk-ink-rgb) / var(--ink-3-a));
  --field-line: rgb(var(--dk-ink-rgb) / .5);
  --field-focus: rgb(var(--dk-ink-rgb));
}
/* 夜里亮纸（?paper=light）：纸卡的墨是深的（ds-material.css），按钮字用纸色 */
:root.ds[data-theme="night"]:not(.paper-dark) .m-paper,
:root.ds[data-theme="night"]:not(.paper-dark) .m-slide { --surface-bg: var(--ds-paper); }

/* 全站统一：实心按钮、输入框只读上面这几对 token（cards.css / narrative.css / mobile-skin.css 里写死的 #1E2430 / #FBFBF8 / rgb(30 36 48 …) 在这里被盖掉） */
.narrative-grid .btn.cta, .narrative-grid .m-paper .btn.cta, :root.paper-dark[data-theme="night"] .narrative-card .btn.cta {
  background: var(--cta-bg); color: var(--cta-fg); border: 0; }
.narrative-grid .btn.cta:hover, :root.paper-dark[data-theme="night"] .narrative-card .btn.cta:hover { color: var(--cta-fg); background: var(--cta-bg); filter: brightness(1.06); }
.narrative-grid .btn.cta:active { filter: brightness(.96); }
.narrative-grid .btn.cta:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.narrative-grid .news-form input, .narrative-grid .m-paper .news-form input {
  color: var(--field-ink); border-bottom: 1px solid var(--field-line); caret-color: var(--field-ink); background: transparent; }
.narrative-grid .news-form input::placeholder { color: var(--field-ph); opacity: 1; }
.narrative-grid .news-form input:focus-visible { outline: 0; border-bottom: 1.5px solid var(--field-focus); }
.narrative-grid .news-form input:-webkit-autofill { -webkit-text-fill-color: var(--field-ink); box-shadow: 0 0 0 40px transparent inset; transition: background-color 9999s; }
/* 文字链接（.btn）：字 = 卡的次墨，下划线 = 墨 35%（原来的 --hair-2 14% 在暗纸上看不见） */
.narrative-grid .btn:not(.cta) { color: var(--ink-2); text-decoration-color: rgb(var(--ink-rgb) / .45); }
.narrative-grid .btn:not(.cta):hover { color: var(--ink); text-decoration-color: currentColor; }
:root.paper-dark[data-theme="night"] .m-paper .btn:not(.cta) { color: rgb(var(--dk-ink-rgb) / .88); text-decoration-color: rgb(var(--dk-ink-rgb) / .5); }
/* 页尾链接的下划线同样提到看得见 */
.wallfoot .wf-links a { text-decoration-color: rgb(var(--ink-rgb) / .45); }

/* ---------------- 1 · 三档字号 ---------------- */
/* --t-s / --t-m / --t-l 定义在 tokens.css（v3） */
/* 卡片名 = 小标签 .plik-label（v3 · R30，样式在 css/ui.css，HTML 由 js/ui.js 填），这里只清掉标题元素的默认外边距 */
.narrative-grid .card-name { margin: 0; }
.narrative-grid :is(.narrative-title, .finder-line) {
  margin: 0; font-family: var(--font-text); font-size: var(--t-l); font-weight: 400; line-height: 1.42; letter-spacing: .01em;
  color: var(--ink); text-wrap: balance; }   /* [v3 · R17] 不再 keep-all：断行规则统一在 tokens.css，标题按词断见 js/ui.js PLIKUI.phrase */
/* 2026-10-31 · 英文卡片标题（英文版方案 §3 P4）：同样的意思英文要占中文 1.6–2.3 倍宽；22 / 1.32，pretty（balance 会把三行排得都很短）。
   中文照旧 balance（10-27 去掉 pretty 是 iOS 中文的问题，英文没有） */
html[data-lang="en"] .narrative-grid :is(.narrative-title, .finder-line) { font-size: 22px; line-height: 1.32; letter-spacing: 0; text-wrap: pretty; }
.narrative-grid :is(.story, .tile-text, .card-deck, .story p) { font-size: var(--t-m); line-height: 1.75; }
.narrative-grid .btn { font-size: var(--t-s); font-weight: 400; }
.narrative-grid .btn.cta { font-size: var(--t-s); font-weight: 400; padding: 9px 18px; letter-spacing: .02em; }
.narrative-grid .face.back .narrative-title { font-weight: 400; font-size: var(--t-l); margin-bottom: 12px; }
.narrative-grid .story p:first-child { font-weight: 400; }
.narrative-grid input { font-size: var(--t-m); }
.narrative-grid .flip-btn .fb-t { font-size: var(--t-s); }
.narrative-grid .flip-btn { color: var(--ink-3); text-shadow: none; }

/* ---------------- 2 · 卡片家族 ---------------- */
/* 卡都摆正；几乎贴墙（纸卡 / 拍立得：离墙 0.15、浓度 × 0.5、没有漫射影）——材质的差别交给表面 */
.narrative-grid > .narrative-card { --tilt: 0 !important; --z-rest: .15 !important; --boost: .5; margin: 0 !important; }
.narrative-grid > :is(.m-paper, .m-polaroid) > .sh > .sh-amb { display: none; }
/* 纸卡：圆角 = --card-r（v3 · R32）、内距 = --card-inset、链接贴底 */
.narrative-grid > .m-paper { --edge-w0: .5px; --edge-c: rgb(30 36 48 / .08); }
:root.paper-dark[data-theme="night"] .narrative-grid > .m-paper { --edge-c: rgb(var(--dk-ink-rgb) / .10); }
.narrative-grid > .narrative-card .face-body { padding: var(--card-inset); }   /* v3 · R2：所有卡同一个内距（tokens.css） */
.narrative-grid > .narrative-card .card-actions { margin-top: auto; padding-top: 14px; }
/* 眉题（.cap）藏掉：名字（.card-name）当小标签。背面的 .cap 各卡自己放回来 */
.narrative-grid .face.front > .face-body > .cap, .narrative-grid .card-heading > .cap { display: none; }
/* 一卡一件事：正文在故事页，卡面只留一句（DOM 留着给读屏） */
.narrative-grid .front .one-thing { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* 卡高只按正面定：双面卡的背面绝对定位铺满 .flip，放不下就卡内滚动 */
.narrative-grid > .flip-tile .face.back { position: absolute; inset: 0; }
.narrative-grid > .flip-tile .face.back .face-body { position: absolute; inset: 0; overflow-y: auto; }
/* 单面卡不翻：peek.js 只接 .flip-tile，这里只要保证不显示 ↻ */
.narrative-grid > .narrative-card:not(.flip-tile) .corner-turn { display: none !important; }
/* 桌面右上角 ↻：content-wiring 给眉题留了 148px 右边距，这里的小标签不需要那么多 */

/* ---------------- 3 · header ----------------
   --hs = PLIK 相对 v4 原来的比例（舞台 svg 470px 宽；字母左 14.8、顶 23、底 38.7，都 × --hs）。
   字母左边 = 第一栏左边线；字母顶 = 36px（和右上角的声音 / 滑杆同一条带）；header 底 = 字母底。
   右边：中文名 + tagline 在第二栏左边线，整块的字面底 = 字母底（js/mvp.js alignHdr 量完补差值 --say-dy） */
:root { --hs: .6; --t-fs: 40px; --g-fs: 15px; }
.mh-body { display: none !important; }
.mh-title { letter-spacing: .03em; }
.mh-tag { margin: 0; font-family: var(--font-text); font-weight: 400; color: var(--ink-2); letter-spacing: .01em; }
@media (min-width: 700px) {
  .masthead { padding-top: calc(36px - 23px * var(--hs)); }
  .mh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--grid-gap, 30px); align-items: start; }
  .mh-brand { grid-column: 1; grid-row: 1; margin-bottom: calc(-38.7px * var(--hs)); --plik-mark-w: calc(470px * var(--hs)); }
  .mh-brand .plik-hd__mark { width: calc(470px * var(--hs)) !important; max-width: none !important; margin-left: calc(-14.8px * var(--hs)) !important; }
  .mh-title { font-size: var(--t-fs); line-height: 1.12; }
  .mh-tag { margin-top: 6px; font-size: var(--g-fs); line-height: 1.6; }
  .mh-say { grid-column: 2 / -1; grid-row: 1; align-self: end; margin: 0 0 calc(var(--g-fs) * -.4) !important; translate: 0 var(--say-dy, 0px); }
}
@media (min-width: 1024px) { .mh-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 699.98px) {
  .mh-say { margin-top: 2px; }
  .mh-title { font-size: 20px; }
  .mh-tag { margin-top: 2px; font-size: 14px; line-height: 1.6; color: var(--ink); }
}
/* 语言切换「中 | EN」：样式在 css/ui.css（.ui-lang，和光线、声音同一套胶囊），首页由 js/topbar.js 搬进右上一组 .mh-switch。
   10-20 左上角小字版的旧样式（圆角 3px、高 20、手机 header 多留 14px）2026-10-31 删掉：它让首页胶囊的选中态变成方块。 */
/* 英文页：PLIK 旁边的「Lab」（js/mvp.js 按字母的实际位置摆） */
.mh-lab { position: absolute; z-index: 3; left: 0; top: 0; opacity: 0; font-family: var(--font-brand-en); font-weight: 600; line-height: 1; letter-spacing: -.01em;
  color: var(--ink); pointer-events: none; white-space: nowrap; }
.mh-lab.is-placed { opacity: 1; }
html:not([data-lang="en"]) .mh-lab { display: none; }
/* 2026-10-31 · 手机上英文页的「Lab」会顶到右上的语言胶囊（英文版方案 §3 P8）：手机只留 PLIK + 中文名，和中文页一样 */
@media (max-width: 699.98px) { html[data-lang="en"] .mh-lab { display: none; } }

/* ---------------- 4 · 找故事 = 卡纸 tile（v3：R3 / R5 / R18 / R22 / R44；IA 5a 2026-10-26）----------------
   一栏宽的高卡，所有宽度都上下排：字条行（↗ 在右上角）→ 标题 → 物块。首页卡片不放描述（IA 5a）。
   物块 = 一组：搜索框占卡内全宽（左右各留卡内距），Yoto 卡在卡里左右居中、按原图比例 470 : 726 显示（不裁）；
   间距：标题 → 这一组 32，组内 搜索框 → Yoto 卡 16（16 < 32，看得出是一组）。
   ≥ 700：物块吃掉标题下面剩下的高度（尺寸容器），Yoto 卡宽 = min(容器宽 − 32, (容器高 − 搜索框 32 − 16) × 470 / 726)，底边落在卡内距线上。
   < 700：Yoto 卡宽 min(240, 70%)。网格区域只在这里写（字条行 .lb 由 js/labels.js 放进 lb 区）。 */
#finder .finder-body { box-sizing: border-box; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "lb" "line" "obj"; align-content: start; }
#finder .finder-line { grid-area: line; margin: 0; align-self: start; }
#finder .yoto-obj { grid-area: obj; position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; margin: 32px 0 0; text-decoration: none; }
/* Yoto 卡 = 白色圆角塑料卡（物件：白天夜里都是亮的实物） */
.yoto-card { position: relative; display: block; flex: none; aspect-ratio: 470 / 726; border-radius: 6px; padding: 3px; background: var(--chip-bg);
  box-shadow: 0 0 0 .5px rgb(var(--obj-ink-rgb) / .16), inset 0 1px 0 rgb(255 255 255 / 1), inset 0 -1px 1px rgb(var(--obj-ink-rgb) / .06), 0 1px 1.2px rgb(var(--sh-rgb) / .22), 0 5px 12px -6px rgb(var(--sh-rgb) / .22);
  transition: translate .35s cubic-bezier(.2, .8, .3, 1), box-shadow .35s; }
.yoto-card img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; border-radius: 3.5px; box-shadow: 0 0 0 .5px rgb(var(--obj-ink-rgb) / .08); }
.yoto-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(125deg, rgb(255 255 255 / 0) 30%, rgb(255 255 255 / .28) 42%, rgb(255 255 255 / 0) 52%); mix-blend-mode: screen; }
.yoto-obj:hover .yoto-card { translate: 0 -2px; box-shadow: 0 0 0 .5px rgb(var(--obj-ink-rgb) / .16), inset 0 1px 0 #fff, inset 0 -1px 1px rgb(var(--obj-ink-rgb) / .06), 0 2px 2px rgb(var(--sh-rgb) / .18), 0 10px 18px -8px rgb(var(--sh-rgb) / .26); }
:root[data-theme="night"] .yoto-card { background: #E9E6E0; }
:root[data-theme="night"] .yoto-card img { filter: brightness(.86); }
/* 搜索框 =「bus」是家长搜的词（不是对话气泡）：放大镜（PLIKUI.icons.search，js/labels.js 插）+ 词；白色浅物件 → 字永远是深墨 */
.yoto-say { display: flex; align-items: center; gap: 6px; box-sizing: border-box; align-self: stretch; width: 100%; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--chip-bg);
  font: 400 var(--t-m)/1.2 var(--font-text); color: var(--chip-ink); letter-spacing: .02em; white-space: nowrap;
  box-shadow: 0 0 0 .5px var(--chip-edge), 0 1px 2px rgb(var(--sh-rgb) / .14); }
.yoto-say .ic { flex: none; color: rgb(var(--obj-ink-rgb) / var(--ink-3-a)); }
:root[data-theme="night"] .yoto-say { --chip-bg: #F1EDE6; }
@media (min-width: 700px) {
  #finder .yoto-obj { min-height: 0; align-self: stretch; container-type: size; }
  #finder .yoto-card { width: min(100cqw - 32px, (100cqh - 48px) * 470 / 726); border-radius: 9px; padding: 5px; }
  #finder .yoto-card img { border-radius: 5px; }
}
@media (max-width: 699.98px) {
  #finder .yoto-card { width: min(240px, 70%); }
}
html[data-lang="en"] #finder .finder-line { font-size: 20px; }

/* ---------------- 6 · 暂不上线（MVP 10-19）：hidden 属性 + 这里兜底（别的样式表里有 display: grid / flex 会盖过 [hidden]） ---------------- */
[data-mvp="off"] { display: none !important; }

/* ---------------- 7 · 开发：?debug=map 的读数（js/me-card.js） ---------------- */
.me-dbg { position: fixed; right: 12px; bottom: 12px; z-index: 99999; max-width: calc(100vw - 24px); padding: 8px 12px; border-radius: 8px;
  background: rgb(20 22 28 / .86); color: #F3EEE4; font: 13px/1.5 var(--font-mono, ui-monospace, monospace); pointer-events: none; }
