/* 《列車上的烏鴉》攻略：雲雀的另一本筆記。牛皮紙＋墨線，沿用遊戲的紙張與字型 */
@font-face { font-family: 'Nanxi Chuxia Song'; src: url(title.woff2) format('woff2'); font-display: swap; }   /* 攻略頁自己的字型子集：攻略文字改了，用 fontTools 從 assets/fonts/src/nanxi-chuxiasong.ttf 重新抽一次 */
@font-face { font-family: 'Lark Hand'; src: url(../assets/fonts/lark-hand.sub.woff2) format('woff2'); font-display: swap; }

:root {
  --paper: #d6bb8c; --light: #f3e6c8; --cream: #fbf1dc; --ink: #2b1d10; --ink2: #5a4630; --red: #7e2418;
  --line: rgba(74, 48, 22, .38); --chip: rgba(255, 246, 226, .45);
  --serif: 'Noto Serif TC', serif; --title: 'Cormorant Garamond', 'Nanxi Chuxia Song', 'Noto Serif TC', serif;   /* 英文、數字用比較瘦的 Cormorant，中文用南西初夏宋 */
  --cur: url(../assets/ui/cur_nib.svg) 2 2, default; --cur-pointer: url(../assets/ui/cur_nib_red.svg) 2 2, pointer;
}
* { box-sizing: border-box; }
html { cursor: var(--cur); scroll-behavior: smooth; scroll-padding-top: 64px; }
a, summary, button, label { cursor: var(--cur-pointer); }
body { margin: 0; color: var(--ink); font: 16px/1.85 var(--serif); background: #2a1d12 url(../assets/ui/kraft.webp) center / 420px; background-blend-mode: multiply; }

/* 頂端：標題＋目錄（手機上目錄可以左右滑） */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 8px max(16px, env(safe-area-inset-left)); background: rgba(34, 23, 13, .92); border-bottom: 1px solid rgba(240, 214, 170, .2); }
.top .brand { flex: none; font: 20px var(--title); color: var(--cream); letter-spacing: .12em; text-decoration: none; }
.top nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { flex: none; padding: 4px 10px; font-size: 14px; color: #e9d7b4; text-decoration: none; border-radius: 3px; letter-spacing: .06em; }
.top nav a:hover, .top nav a:focus-visible { color: var(--cream); background: rgba(240, 214, 170, .14); outline: none; }

/* 一頁一頁的紙 */
main { width: min(880px, calc(100% - 20px)); margin: 22px auto 60px; }
.sheet { position: relative; margin: 0 0 22px; padding: 26px clamp(18px, 4vw, 44px) 30px; border: 18px solid transparent; border-image: url(../assets/ui/paper.webp) 30 round;
  background: #efe2c4 url(../assets/ui/kraft.webp) center / 512px padding-box; background-blend-mode: soft-light; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.hero { text-align: center; padding-top: 34px; }
.hero .ru { font: 22px "Marck Script", cursive; color: #6b4b2a; }
.hero h1 { margin: 0 0 6px; font: 40px/1.3 var(--title); letter-spacing: .2em; }
.hero .sub { margin: 0 auto 14px; max-width: 32em; color: var(--ink2); }
.hero .warn { display: inline-block; padding: 6px 16px; font-size: 14px; color: var(--cream); background: var(--red); letter-spacing: .08em; }
h2 { margin: 0 0 14px; font: 28px/1.35 var(--title); letter-spacing: .14em; }
h2 small { display: block; font: 14px var(--serif); letter-spacing: .1em; color: var(--ink2); }
h3 { margin: 26px 0 8px; font-size: 19px; letter-spacing: .08em; border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
h3.sm { border: 0; padding: 0; margin: 18px 0 4px; font-size: 16px; letter-spacing: .06em; color: var(--red); }
p { margin: 0 0 10px; }
ul, ol { margin: 0 0 12px; padding-left: 1.4em; }
li { margin: 2px 0; }
b, strong { color: #1d120a; }
.note { font-size: 14px; color: var(--ink2); }
.ru-i { font-family: 'Marck Script', cursive; font-size: 1.05em; color: #6b4b2a; }
.hand { font-family: 'Lark Hand', var(--serif); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 15px; }
.tbl th, .tbl td { padding: 6px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl th { font-weight: 600; color: var(--ink2); letter-spacing: .06em; white-space: nowrap; }
.tbl td:first-child { white-space: nowrap; }
.wrap { overflow-x: auto; }

/* 摺起來的答案：一張貼著膠帶的小紙條 */
details { margin: 8px 0 12px; border: 1px solid var(--line); background: var(--chip); }
details > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 15px; letter-spacing: .06em; user-select: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ''; flex: none; width: 9px; height: 9px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin-right: 2px; }
details[open] > summary::before { transform: rotate(45deg); }
details > summary .tag { flex: none; padding: 0 8px; font-size: 12px; color: var(--cream); background: var(--red); letter-spacing: .1em; }
details > summary:hover { background: rgba(255, 246, 226, .5); }
details > summary:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
details > .in { padding: 4px 14px 10px; border-top: 1px dashed var(--line); }

/* 結局一覽 */
.ends { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.end { padding: 8px 12px; background: rgba(255, 246, 226, .5); border: 1px solid var(--line); }
.end.good b { color: #6e4f12; }
.end.bad b { color: var(--red); }
.end b { display: block; letter-spacing: .04em; }
.end span { font-size: 13px; color: var(--ink2); }

/* 卡片清單 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 8px 0; }
.card { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; padding: 8px; background: #f6ecd4; border: 1px solid var(--line); }
.card i { width: 56px; height: 56px; background: center / contain no-repeat; }
.card b { display: block; font-size: 15px; line-height: 1.5; }
.card .k { font-size: 11px; padding: 0 5px; margin-left: 4px; color: var(--cream); background: var(--ink2); vertical-align: 2px; letter-spacing: .08em; }
.card .k.decoy { background: #8b7a60; } .card .k.collect { background: var(--red); }
.card small { display: block; font-size: 13px; line-height: 1.6; color: var(--ink2); }
.card small.where { color: #3d2a16; margin-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chips span { padding: 1px 10px; font-size: 14px; background: rgba(255, 246, 226, .6); border: 1px solid var(--line); }

footer { text-align: center; padding: 10px 0 40px; color: #d9c6a0; font-size: 13px; letter-spacing: .08em; }
footer a { color: #f0d9b0; }
.back { display: inline-block; margin-top: 6px; padding: 6px 18px; color: var(--cream); background: var(--red); text-decoration: none; letter-spacing: .12em; }

@media (max-width: 600px) {
  body { font-size: 15px; }
  .top .brand { font-size: 17px; }
  main { width: calc(100% - 8px); margin-top: 10px; }
  .sheet { border-width: 12px; padding: 20px 14px 22px; }
  .hero h1 { font-size: 30px; }
  h2 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } details > summary::before { transition: none; } }

/* 章節開頭的場景圖 */
.banner { display: block; width: calc(100% + 2 * clamp(18px, 4vw, 44px)); max-width: none; margin: -26px calc(-1 * clamp(18px, 4vw, 44px)) 18px; aspect-ratio: 16 / 6; object-fit: cover; filter: sepia(.25) saturate(.85); mask: linear-gradient(#000 70%, transparent); -webkit-mask: linear-gradient(#000 70%, transparent); }

/* 登場人物 */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.person { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: start; }
.person img { width: 74px; height: 92px; object-fit: cover; background: #f6ecd4; padding: 4px 4px 10px; box-shadow: 0 2px 6px rgba(40, 24, 10, .3); transform: rotate(-2deg); }
.person:nth-child(even) img { transform: rotate(2deg); }
.person b { font-size: 17px; letter-spacing: .08em; }
.person small { display: block; font-size: 13px; color: var(--ink2); }
.person p { margin: 2px 0 0; font-size: 14px; line-height: 1.7; }

/* 劇情地圖（樣式在 route.css，從遊戲抽出來的） */
#route-map .rt-head h2 { display: none; }
#route-map .rt-wrap { height: 520px; }
#route-map .rt-head .panel-sub { font-size: 14px; margin: 0 0 6px; }

/* Q 版瓦西里 */
.chibi-stage { display: none; }
.chibi-stage.on { display: block; margin: -10px auto 0; width: 150px; height: 150px; }
.chibi-stage img { width: 100%; height: 100%; object-fit: contain; animation: bob 3.2s ease-in-out infinite; }
.chibi-pal { position: fixed; right: max(10px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); z-index: 4; width: 116px; height: 116px; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.chibi-pal img { width: 100%; height: 100%; object-fit: contain; }
.chibi-pal.hop img { animation: hop .38s ease-out; }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes hop { 40% { transform: translateY(-10px); } }
@media (max-width: 600px) { .chibi-pal { width: 84px; height: 84px; } .chibi-stage.on { width: 120px; height: 120px; } #route-map .rt-wrap { height: 440px; } .banner { width: calc(100% + 28px); margin: -20px -14px 14px; } }
@media (prefers-reduced-motion: reduce) { .chibi-stage img, .chibi-pal.hop img { animation: none; } }
@media (max-width: 600px) { .tbl td:first-child { white-space: normal; min-width: 4.5em; } }

/* ═════ 分頁版 ═════ */
.page[hidden] { display: none; }
main { padding-bottom: 170px; }
.top { justify-content: space-between; }
.top .crumb { flex: 1; font-size: 15px; color: #e9d7b4; letter-spacing: .12em; }
.menu-btn { flex: none; padding: 4px 14px; font: 15px var(--title); letter-spacing: .14em; color: var(--ink); background: #efe2c4 url(../assets/ui/kraft.webp) center / 256px; background-blend-mode: multiply; border: 0; transform: rotate(-2deg); }
.menu-btn:hover, .menu-btn:focus-visible { transform: rotate(0); outline: 2px solid #f0d9b0; outline-offset: 2px; }
.tag.soft { background: var(--ink2); }

/* 封面：每一頁一張有縮圖的小卡 */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 22px; text-align: left; }
.tile { display: block; color: var(--ink); text-decoration: none; background: #f6ecd4; border: 1px solid var(--line); padding: 5px 5px 7px; box-shadow: 0 2px 5px rgba(40, 24, 10, .2); transition: transform .15s; }
.tile:nth-child(odd) { transform: rotate(-1deg); } .tile:nth-child(even) { transform: rotate(1deg); }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); outline: none; box-shadow: 0 6px 12px rgba(40, 24, 10, .3); }
.tile i { display: block; aspect-ratio: 4 / 3; background: #d9c6a0 center / cover; filter: sepia(.2) saturate(.9); }
.tile span { display: block; margin-top: 5px; font: 16px var(--title); letter-spacing: .1em; text-align: center; }

/* 上一頁／下一頁 */
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pager a { color: var(--red); text-decoration: none; font-size: 15px; letter-spacing: .08em; }
.pager a:hover { text-decoration: underline; }

/* 頁面上的提示：瓦西里的小對話框（左邊一顆小頭像） */
.note { position: relative; margin: 10px 0 12px; padding: 8px 12px 8px 58px; min-height: 52px; background: #fbf3e0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.note::before { content: ''; position: absolute; left: 6px; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; background: #e9dcc0 url(img/chibi_idle.png) 50% 6% / 230% no-repeat; border: 1px solid var(--line); }

/* 瓦西里導覽：右下角的 Q 版＋對話框（目錄、提示都從這裡出） */
.guide-v { position: fixed; right: max(8px, env(safe-area-inset-right)); bottom: max(6px, env(safe-area-inset-bottom)); z-index: 6; display: flex; align-items: flex-end; gap: 4px; pointer-events: none; }
.v-btn { pointer-events: auto; flex: none; width: 150px; height: 150px; padding: 0; border: 0; background: none; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .4)); }
.v-btn img { width: 100%; height: 100%; object-fit: contain; }
.v-btn:focus-visible { outline: 2px dashed #f0d9b0; outline-offset: -6px; }
.guide-v.hop .v-btn img { animation: hop .38s ease-out; }
.guide-v.no-img .v-btn { width: auto; height: auto; padding: 8px 14px; font: 15px var(--title); color: var(--ink); background: #efe2c4; }
.guide-v.no-img .v-btn::after { content: '目錄'; }
.guide-v.no-img .v-btn img { display: none; }
.v-bubble { pointer-events: auto; position: relative; display: none; width: min(340px, calc(100vw - 180px)); margin-bottom: 80px; padding: 12px 14px 10px; background: #fbf3e0; color: var(--ink); border: 1.5px solid #3b2a1a; border-radius: 14px; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); font-size: 15px; line-height: 1.75; }
.v-bubble::after { content: ''; position: absolute; right: -10px; bottom: 26px; width: 16px; height: 16px; background: #fbf3e0; border-right: 1.5px solid #3b2a1a; border-top: 1.5px solid #3b2a1a; transform: rotate(45deg); }
.guide-v.talk .v-bubble { display: block; animation: pop .18s ease-out; }
.vb-text b { display: block; font-family: var(--title); font-size: 17px; letter-spacing: .08em; margin-bottom: 2px; }
.vb-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.vb-acts button, .vb-g button { padding: 3px 12px; font: 14px var(--serif); letter-spacing: .08em; color: var(--ink); background: #efe2c4; border: 1px solid var(--line); border-radius: 3px; }
.vb-acts button:first-child { color: var(--cream); background: var(--red); border-color: var(--red); }
.vb-acts .vb-close:first-child, .vb-acts button:only-child { color: var(--ink); background: #efe2c4; border-color: var(--line); }
.vb-menu { display: grid; gap: 6px; margin-top: 6px; max-height: min(52vh, 420px); overflow-y: auto; }
.vb-g { display: grid; grid-template-columns: 2.6em 1fr; gap: 6px; align-items: start; }
.vb-g > span { padding-top: 4px; font-size: 12px; color: var(--ink2); letter-spacing: .1em; }
.vb-g > div { display: flex; flex-wrap: wrap; gap: 5px; }
.vb-g button { font-family: var(--title); font-size: 15px; }
.vb-g button[aria-current] { color: var(--cream); background: var(--ink2); border-color: var(--ink2); }
.vb-acts button:hover, .vb-g button:hover, .vb-acts button:focus-visible, .vb-g button:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.guide-v.menu .v-bubble { width: min(380px, calc(100vw - 180px)); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
/* 劇情地圖：可以點的格子 */
#route-map .rt-n { cursor: var(--cur-pointer); }
#route-map .rt-n.pick { outline: 2.5px solid var(--red); outline-offset: 2px; }
.route-fold > .in { padding: 4px 6px 10px; }

@media (max-width: 600px) {
  main { padding-bottom: 150px; }
  .v-btn { width: 84px; height: 84px; }
  .guide-v { flex-direction: column; align-items: flex-end; }
  .v-bubble, .guide-v.menu .v-bubble { width: min(330px, calc(100vw - 20px)); margin: 0 0 -6px; }
  .v-bubble::after { right: 40px; bottom: -9px; transform: rotate(135deg); }
  .home-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .guide-v.talk .v-bubble, .guide-v.hop .v-btn img { animation: none; } }

/* 台詞清單 */
.lines { list-style: none; padding: 0; margin: 4px 0; }
.lines li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.lines q { quotes: '「' '」'; font-size: 15.5px; }
.lines small { display: block; font-size: 13px; color: var(--ink2); line-height: 1.6; }
.lines em { font-style: normal; margin-left: 6px; padding: 0 6px; font-size: 11.5px; color: var(--cream); background: #8b7a60; }
.who { display: inline-block; margin-right: 6px; padding: 0 6px; font-size: 11.5px; color: var(--cream); background: var(--ink2); vertical-align: 1px; }
.who.now { background: var(--red); }
/* 地點一覽 */
.tbl.spots td:first-child { white-space: normal; width: 52%; }
.tbl.spots small { display: block; font-size: 12.5px; color: var(--ink2); }
.chip { display: inline-block; margin: 0 4px 4px 0; padding: 0 7px; font-size: 13px; background: rgba(255, 246, 226, .7); border: 1px solid var(--line); }

/* ═════ 不用普通方框：全部換成遊戲裡的撕邊紙片、紙條 ═════ */
:root { --paper-card: url(../assets/ui/card_light.webp); --paper-tan: url(../assets/ui/card_tan.webp); --chipmask: url(../assets/ui/chip_mask.webp); --paper-c: #eee3c5; }
details, .card, .end, .tile, .note, .v-bubble {
  border: 10px solid transparent !important; border-image: var(--paper-card) 16 fill round !important; background: transparent !important;
  border-radius: 0 !important; box-shadow: none !important; filter: drop-shadow(0 3px 4px rgba(60, 35, 10, .25)); }
details:has(> summary .tag:not(.soft)) { border-image-source: var(--paper-tan) !important; }
details > summary { padding: 4px 6px; }
details > summary:hover { background: transparent; }
details > .in { border-top: 1px dashed var(--line); padding: 6px 6px 4px; }
details details { filter: none; }
.card { padding: 2px 2px !important; }
.end { padding: 2px 6px !important; }
.tile { padding: 0 !important; }
.tile i { border-radius: 0; }
/* 瓦西里的小提示：紙片＋左邊小頭像 */
.note { padding: 2px 6px 2px 50px !important; min-height: 46px; }
.note::before { left: -2px; width: 42px; height: 42px; margin-top: -21px; border: 0; box-shadow: 0 1px 3px rgba(40, 24, 10, .35); }
/* 對話框：紙片＋墨色手繪的小尾巴 */
.v-bubble { padding: 4px 8px 2px !important; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.v-bubble::after { right: -22px; bottom: 22px; width: 18px; height: 22px; border: 0; transform: none; background: none;
  clip-path: polygon(0 0, 100% 55%, 0 100%); background: var(--paper-c); }
/* 小按鈕：撕邊紙條（跟遊戲的「請作者喝杯茶」一樣） */
.vb-acts button, .vb-g button, .menu-btn, .tag, .who, .chip, .lines em, .pager a {
  border: 0 !important; border-radius: 0 !important;
  -webkit-mask: var(--chipmask) center / 100% 100% no-repeat; mask: var(--chipmask) center / 100% 100% no-repeat; }
.vb-acts button, .vb-g button { padding: 4px 14px; background: #e6d4ae url(../assets/ui/kraft.webp) center / 256px; background-blend-mode: multiply; }
.vb-acts button:first-child { background-color: var(--red); background-image: none; }
.vb-g button[aria-current] { background: var(--ink2); }
.vb-acts .vb-close:first-child, .vb-acts button:only-child { background: #e6d4ae url(../assets/ui/kraft.webp) center / 256px; background-blend-mode: multiply; }
.pager a { padding: 3px 14px; background: #e6d4ae url(../assets/ui/kraft.webp) center / 256px; background-blend-mode: multiply; color: var(--ink); }
.pager a:hover { text-decoration: none; filter: brightness(1.05); }
.tag, .who, .lines em { padding: 1px 9px; }
.chip { padding: 1px 9px; background: #e9dab8; }
/* 表格：不要外框，只留紙上手畫的虛線 */
.tbl th, .tbl td { border-bottom: 1px dashed var(--line); }
@media (max-width: 600px) { .v-bubble::after { right: 46px; bottom: -20px; width: 22px; height: 18px; clip-path: polygon(0 0, 100% 0, 60% 100%); } }

/* ═════ 瓦西里的動畫 ═════
   呼吸（身體上下微縮放）、整個人慢慢左右晃、站著時頭會自己歪一下、說話時點頭、換動作時彈一下、滑鼠指過去探頭 */
.v-rig { position: relative; display: block; width: 100%; height: 100%; transform-origin: 50% 96%; animation: v-sway 6.5s ease-in-out infinite; }
.v-rig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.v-body { transform-origin: 50% 96%; animation: v-breathe 3.4s ease-in-out infinite; }
.v-head { display: none; }
.guide-v.rig-head .v-body { clip-path: inset(43% 0 0 0); }
.guide-v.rig-head .v-head { display: block; clip-path: inset(0 0 56.4% 0); transform-origin: 50% 43%; animation: v-tilt 7.5s ease-in-out infinite, v-breathe-head 3.4s ease-in-out infinite; }
.guide-v.speaking .v-rig { animation: v-talk .5s ease-in-out infinite; }
.guide-v.hop .v-rig { animation: v-pop .42s cubic-bezier(.3, 1.6, .5, 1); }
.v-btn:hover .v-rig { animation: v-peek .6s ease-out forwards; }
@keyframes v-breathe { 50% { transform: scale(1.012, 1.022); } }
@keyframes v-breathe-head { 50% { translate: 0 -1.2%; } }
@keyframes v-sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1.2deg); } }
@keyframes v-tilt { 0%, 62%, 100% { rotate: 0deg; } 70%, 84% { rotate: -4deg; } }
@keyframes v-talk { 50% { transform: translateY(-2.5%) rotate(-.6deg); } }
@keyframes v-pop { 0% { transform: scale(.9, 1.08); } 55% { transform: scale(1.06, .95); } 100% { transform: none; } }
@keyframes v-peek { to { transform: rotate(-4deg) translateY(-3%); } }
/* 舊的單張圖跳動不用了 */
.guide-v.hop .v-btn img { animation: none; }
/* 系統設定「減少動態」時：留下很輕的呼吸、搖擺、歪頭（作者要他是動畫），拿掉彈跳和點頭 */
@media (prefers-reduced-motion: reduce) { .guide-v.speaking .v-rig, .guide-v.hop .v-rig { animation: v-sway 6.5s ease-in-out infinite !important; } .v-btn:hover .v-rig { animation: v-sway 6.5s ease-in-out infinite; } }
/* 對話框尾巴：墨線描邊的小三角（紙色跟頁面很像，要有線才看得到） */
.v-bubble::after { right: -24px; bottom: 20px; width: 24px; height: 26px; clip-path: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 26'%3E%3Cpath d='M0 3 C8 7 15 11 23 14 C15 16 8 19 0 23' fill='%23eee3c5' stroke='%233b2a1a' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.v-bubble { box-shadow: none; outline: 0; }
.v-bubble .vb-text { color: var(--ink); }
@media (max-width: 600px) { .v-bubble::after { right: 44px; bottom: -24px; width: 26px; height: 24px; transform: rotate(90deg); } }

/* ═════ 桌寵版瓦西里 ═════ */
.guide-v { left: var(--px, auto); right: auto !important; bottom: calc(var(--py, 0px) + max(6px, env(safe-area-inset-bottom))); display: block; width: 150px; flex-direction: initial; transition: opacity .3s; }
.guide-v.dropping { transition: bottom .4s cubic-bezier(.3, 1.5, .55, 1), opacity .3s; }
.guide-v.held .v-btn { cursor: grabbing; }
.guide-v.held .v-rig { animation: v-held .5s ease-in-out infinite; }
.guide-v.faded { opacity: .3; }
.v-btn { touch-action: none; cursor: var(--cur-pointer); }
.guide-v.face-left .v-btn { transform: scaleX(-1); }
.guide-v.walking .v-rig { animation: v-step .42s ease-in-out infinite; }
.guide-v.walking.no-walk .v-rig { animation: v-hopwalk .36s ease-in-out infinite; }
.guide-v.walking .v-head { display: none; } .guide-v.walking .v-body { clip-path: none !important; }
@keyframes v-step { 50% { transform: translateY(-2%); } }
@keyframes v-hopwalk { 50% { transform: translateY(-6%) rotate(2deg); } }
@keyframes v-held { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
/* 對話框掛在他旁邊，開在比較寬的那一邊 */
.v-bubble { position: absolute; bottom: 74px; right: calc(100% + 6px); width: var(--bw, 360px) !important; margin: 0; }
.guide-v.bubble-right .v-bubble { right: auto; left: calc(100% + 6px); }
.guide-v.bubble-right .v-bubble::after { right: auto; left: -24px; transform: scaleX(-1); }
.guide-v.menu .v-bubble { width: var(--bw, 420px) !important; }
/* 選單字放大，按鈕好按 */
.vb-text { font-size: 17px; }
.vb-g { grid-template-columns: 3em 1fr; }
.vb-g > span { font-size: 14px; padding-top: 7px; }
.vb-g button { font-size: 18px; padding: 6px 15px; min-height: 38px; }
.vb-acts button { font-size: 16px; padding: 6px 16px; min-height: 38px; }
.vb-menu { gap: 9px; max-height: min(60vh, 520px); }
@media (max-width: 600px) {
  .guide-v { width: 84px; }
  /* 手機：對話框改成畫面底部的大卡，尾巴指著他 */
  .v-bubble, .guide-v.bubble-right .v-bubble, .guide-v.menu .v-bubble { position: fixed; left: 10px; right: 10px; bottom: 98px; width: auto !important; }
  .v-bubble::after, .guide-v.bubble-right .v-bubble::after { left: var(--tailx, auto); right: auto; bottom: -24px; transform: rotate(90deg); }
  .vb-g button { font-size: 18px; padding: 8px 16px; min-height: 44px; }
  .vb-acts button { min-height: 44px; }
  .vb-text { font-size: 17px; }
  .vb-menu { max-height: 56vh; }
}
/* 走路：兩格疊在一起輪流顯示；走路時藏起平常的身體和頭 */
.v-walk { display: none; }
.guide-v.walking .v-walk.w1 { display: block; }
.guide-v.walking.f2 .v-walk.w1 { display: none; }
.guide-v.walking.f2 .v-walk.w2 { display: block; }
.guide-v.walking:not(.no-walk) .v-body, .guide-v.walking:not(.no-walk) .v-head { visibility: hidden; }
.v-rig img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
/* 減少動態的設定下也保留走路時的上下踏步（很小），不然看起來像在滑 */
@media (prefers-reduced-motion: reduce) { .guide-v.walking .v-rig { animation: v-step .42s ease-in-out infinite !important; } }
/* 往左走：用真的往左走的兩格（頭髮分線不會翻到另一邊）；沒有圖時才退回鏡像 */
.guide-v.face-left:not(.no-walkL) .v-btn { transform: none; }
.guide-v.walking.face-left:not(.no-walkL) .v-walk.w1, .guide-v.walking.face-left:not(.no-walkL) .v-walk.w2 { display: none; }
.guide-v.walking.face-left:not(.no-walkL) .v-walk.l1 { display: block; }
.guide-v.walking.face-left.f2:not(.no-walkL) .v-walk.l1 { display: none; }
.guide-v.walking.face-left.f2:not(.no-walkL) .v-walk.l2 { display: block; }
/* 被抓起來：換成懸空的那張（沒有圖時退回托腮），在空中輕輕晃 */
.v-heldimg { display: none; }
.guide-v.held:not(.no-held) .v-heldimg { display: block; }
.guide-v.held:not(.no-held) .v-body, .guide-v.held:not(.no-held) .v-head, .guide-v.held .v-walk { visibility: hidden; }
.guide-v.held .v-rig { transform-origin: 57% 39%; animation: v-dangle 1.1s ease-in-out infinite !important; }
@keyframes v-dangle { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
/* 抓他：指到他是張開的手，抓起來是握拳（跟遊戲一樣的墨線手） */
:root { --cur-grab: url(../assets/ui/cur_hand_open.svg) 13 16, grab; --cur-grabbing: url(../assets/ui/cur_hand_grab.svg) 15 18, grabbing; }
.v-btn, .guide-v .v-btn:hover { cursor: var(--cur-grab); }
html.pet-drag, html.pet-drag * { cursor: var(--cur-grabbing) !important; user-select: none; }

/* ═════ 介面加強 ═════ */
/* 鋼筆墨線圖示（跟遊戲同一組，線條略抖） */
.ink-ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; filter: url(#inkA); overflow: visible; vertical-align: -.12em; }
.ink-ic .f { fill: currentColor; stroke: none; }
h2 .h-ic { width: .9em; height: .9em; margin-right: .3em; color: var(--red); }
.tile .t-ic { width: 1em; height: 1em; margin-right: .3em; color: var(--red); }
.vb-g button .m-ic { width: .95em; height: .95em; margin-right: .3em; color: var(--red); }
.vb-g button[aria-current] .m-ic { color: var(--cream); }
/* 換頁：紙從旁邊滑進來 */
.page.turn-r { animation: page-r .42s cubic-bezier(.2, .8, .3, 1); }
.page.turn-l { animation: page-l .42s cubic-bezier(.2, .8, .3, 1); }
@keyframes page-r { from { opacity: 0; transform: translateX(26px) rotate(.6deg); } }
@keyframes page-l { from { opacity: 0; transform: translateX(-26px) rotate(-.6deg); } }
@media (prefers-reduced-motion: reduce) { .page.turn-r, .page.turn-l { animation: page-fade .3s ease; } @keyframes page-fade { from { opacity: 0; } } }
/* 已收集：打一個紅色小勾；只看還沒收集的 */
.got { position: relative; }
.card.got::after, .lines li.got::after, .end.got::after { content: '✓'; position: absolute; top: 2px; right: 6px; font: 700 16px var(--serif); color: var(--red); transform: rotate(-8deg); }
.lines li.got { padding-right: 24px; }
#ach-list tr.got td:first-child b::after { content: ' ✓'; color: var(--red); }
html.only-missing .got, .no-match { display: none !important; }
.sum-prog { margin-left: auto; padding-left: 10px; font-size: 13px; color: var(--ink2); letter-spacing: .05em; }
.sum-prog.full { color: var(--red); }
/* 封面的收集進度：墨線畫的進度條 */
.prog-box { margin: 18px auto 0; max-width: 520px; text-align: left; }
.prog-box h3 { border: 0; text-align: center; margin: 0 0 8px; }
.prog-box h3 small { display: block; font-size: 12px; font-weight: 400; color: var(--ink2); letter-spacing: .08em; }
.prog-box ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.prog-box li { display: grid; grid-template-columns: 6.5em 1fr 4.5em; align-items: center; gap: 10px; font-size: 14px; }
.prog-box i { height: 9px; border: 1.4px solid var(--ink2); border-radius: 6px 3px 7px 4px; background: linear-gradient(90deg, var(--red) calc(var(--p) * 100%), transparent 0); }
.prog-box b { font-weight: 600; text-align: right; }
/* 工具列：搜尋、只看還沒收集的 */
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.srch { flex: 1 1 240px; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-bottom: 1.6px solid var(--ink2); }
.srch input { flex: 1; min-width: 0; border: 0; background: none; font: 15px var(--serif); color: var(--ink); outline: none; padding: 4px 0; }
.srch .s-ic { color: var(--ink2); }
.only-btn { padding: 5px 14px; font: 14px var(--serif); letter-spacing: .06em; color: var(--ink); border: 0; background: #e6d4ae url(../assets/ui/kraft.webp) center / 256px; background-blend-mode: multiply;
  -webkit-mask: var(--chipmask) center / 100% 100% no-repeat; mask: var(--chipmask) center / 100% 100% no-repeat; }
.only-btn[aria-pressed="true"] { color: var(--cream); background: var(--red); }
/* 匯入存檔碼 */
.pb-tip { font-size: 14px; color: var(--ink2); margin: 4px 0 8px; text-align: left; }
.prog-box .imp { margin-top: 12px; text-align: left; }
.imp-code { width: 100%; padding: 8px 10px; font: 13px 'PT Mono', monospace; color: var(--ink); background: rgba(255, 250, 238, .7); border: 0; border-bottom: 1.6px solid var(--ink2); resize: vertical; }
.imp-code:focus { outline: 2px solid var(--red); outline-offset: 2px; }
.imp-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.imp-acts button, .imp-file { padding: 5px 16px; font: 14px var(--serif); letter-spacing: .08em; color: var(--ink); border: 0; background: #e6d4ae url(../assets/ui/kraft.webp) center / 256px; background-blend-mode: multiply;
  -webkit-mask: var(--chipmask) center / 100% 100% no-repeat; mask: var(--chipmask) center / 100% 100% no-repeat; cursor: var(--cur-pointer); }
.imp-acts .imp-go { color: var(--cream); background: var(--red); }
.imp-msg { min-height: 1.4em; margin: 6px 0 0; font-size: 14px; color: var(--red); }
/* 互相連結：紅墨底線，點了跳過去，目標閃一下 */
a.xref { color: var(--red); text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-thickness: 1.5px; cursor: var(--cur-pointer); }
a.xref:hover, a.xref:focus-visible { text-decoration-style: solid; outline: none; background: rgba(126, 36, 24, .08); }
.flash { animation: xflash 1.6s ease-out; }
@keyframes xflash { 0%, 30% { box-shadow: 0 0 0 3px rgba(126, 36, 24, .55); background-color: rgba(126, 36, 24, .1); } 100% { box-shadow: 0 0 0 3px rgba(126, 36, 24, 0); } }
#ach-list td:nth-child(2) { white-space: nowrap; }
/* 走過去指著：往上「站」到那一項旁邊，再回到地上 */
.guide-v.rising { transition: bottom .5s cubic-bezier(.3, 1.3, .5, 1), opacity .3s; }
/* 烏鴉小幫手 */
.crow { position: absolute; left: 0; top: 0; z-index: 7; pointer-events: none; will-change: transform; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.crow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: none; }
.crow.flying .c1 { display: block; } .crow.flying.f2 .c1 { display: none; } .crow.flying.f2 .c2 { display: block; }
.crow.perched .cp { display: block; animation: crow-peck 1.1s ease-in-out infinite; transform-origin: 50% 90%; }
.crow.face-left img { scale: -1 1; }
.crow.perched:not(.face-left) .cp { scale: -1 1; }
@keyframes crow-peck { 0%, 60%, 100% { rotate: 0deg; } 70% { rotate: 10deg; } 80% { rotate: 0deg; } 88% { rotate: 8deg; } }
@media (prefers-reduced-motion: reduce) { .crow.perched .cp { animation: none; } }
