/* ==========================================================================
   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 · 找故事卡    （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 */
.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); }
}
/* 左上角语言切换（Wanfang 10-20 07:38）：和右上角声音 / 滑杆一样小声。字母顶在 36px（桌面）/ 约 24px（手机）之下，这个控件放在字母上方那条空带里：
   桌面 top 10px（高 20，离字母顶 6px）；手机 header 顶 padding 多留 14px 给它。当前语言 = --ink；另一种 = --ink-3；hover / focus 深一档；
   颜色都从墙的墨取（它在墙上），三种模式都 ≥ 4.5（--ink-3 白天 .68 / 夜里 .70） */
.lang-switch { position: absolute; z-index: 5; left: var(--pad-x); top: 10px; display: inline-flex; align-items: center; gap: 6px; height: 20px;
  font-family: var(--font-text); font-size: 13px; line-height: 1; letter-spacing: .04em; color: var(--ink-3); }
.lang-switch a { color: var(--ink-3); text-decoration: none; padding: 6px 2px; margin: -6px 0; border-radius: 3px; transition: color .15s; }
.lang-switch a[aria-current="true"] { color: var(--ink); font-weight: 500; }
.lang-switch a:hover, .lang-switch a:focus-visible { color: var(--ink); outline: none; }
.lang-switch a:focus-visible { outline: 1.5px solid rgb(var(--ink-rgb) / .55); outline-offset: 2px; }
.lang-switch .ls-dot { color: rgb(var(--ink-rgb) / .4); }
html[data-lang="en"] .lang-switch { font-family: var(--font-mono); letter-spacing: .06em; }
@media (max-width: 699.98px) {
  .lang-switch { top: 8px; }
  .lang-switch a { padding: 16px 4px; margin: -16px -2px; }   /* 点击区域 ≥ 44 高 */
  .lang-switch { transition: opacity .3s ease; }
  :root.plik-sent-on .lang-switch { opacity: 0; pointer-events: none; }   /* 手机拼句子那几秒和右上角控件一样让位 */
  html:not([data-lang-switch="off"]) .masthead { padding-top: 32px; }   /* 语言切换上线时：chrome.css 手机 18px → 给它让 14px（现在藏着，不让） */
}
/* 英文页：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; }

/* ---------------- 4 · 找故事 = 卡纸 tile（v3：R3 / R3b / R5 / R18 / R18b / R22 / R35 / R44 / R46）----------------
   图文双栏卡：左 = 物件框（搜索框「放大镜 + bus」在上、Yoto 卡在下 = 搜索结果，同宽；物件框 55 : 104，卡吃掉剩下的高度），
   右 = 标题 / 描述（文字从顶边起排，上对物件框顶）。两栏间距 = --card-inset；物件框高 = 内容区（顶对文字、底对卡底内距线），平板和桌面同一套。
   手机：上下排，物件框水平居中，文字左对齐。网格区域只在这里写（字条行 .lb 由 js/labels.js 放进 lb 区）。 */
#finder .finder-body { box-sizing: border-box; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--card-inset);
  grid-template-areas: "lb" "obj" "line" "desc"; grid-template-rows: auto; align-content: start; }
#finder .finder-line { grid-area: line; margin: 0; align-self: start; }
#finder .finder-desc { grid-area: desc; margin: 8px 0 0; align-self: start; }
#finder .card-actions { grid-area: act; margin: 0; padding: 0; }
#finder .yoto-obj { grid-area: obj; position: relative; display: flex; flex-direction: column; gap: 8px; width: 150px; margin: 0; text-decoration: none; }
/* Yoto 卡 = 白色圆角塑料卡（物件：白天夜里都是亮的实物） */
.yoto-card { position: relative; display: block; aspect-ratio: 55 / 85; 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; 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 .finder-body { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto 1fr; grid-template-areas: "lb lb" "obj line" "obj desc"; }
  #finder .yoto-obj { width: auto; height: 100%; aspect-ratio: 55 / 104; align-self: stretch; }
  #finder .yoto-card { flex: 1 1 0; min-height: 0; width: 100%; height: auto; aspect-ratio: auto; border-radius: 9px; padding: 5px; }
  #finder .yoto-card img { border-radius: 5px; }
}
@media (max-width: 699.98px) {
  #finder .yoto-obj { justify-self: center; gap: 12px; margin: 4px 0 16px; }   /* R35：图块居中，文字左对齐；R46：搜索框和卡间距 12 */
}
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; }
