/* 方圆市（/city/）。11-03 替掉三维法学城，同天改成活地图首屏。头像、事件里的人那几样讲页也用，写在 style.css 末尾 */
/* 首屏就是地图：铺满整宽。底图是 SVG（配色在 citymap.css），地名、地方、小钉是叠在上面的 HTML（city.js 按屏幕坐标摆，字一直一样大） */
.fy-hero { position: relative; }
.fy-map { --lb-ink: #2b2622; --lb-ink2: #6e665c; --lb-civic: #34506b; --lb-water: #4f8394; --lb-sea: #7aa0ac; --lb-dist: #3a332d; --lb-street: #8f8371; --lb-st: #4b3c2b;
  --halo: #efe7d6; --dot-folk: #b0573c; --dot-civic: #4e6b88; --dot-ring: #fffdf8; --pin: #b0573c; --pin-ink: #fffdf8;
  position: relative; margin: 0; height: clamp(540px, calc(100svh - 64px), 1000px); overflow: hidden; background: #e2dacb;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; outline: none; }
.fy-map:focus-visible { box-shadow: inset 0 0 0 3px var(--accent-fill); }
.fy-map.drag { cursor: grabbing; }
.fy-stage, .fy-over { position: absolute; inset: 0; }
.fy-art { display: block; width: 100%; height: 100%; }
.fy-over { pointer-events: none; overflow: hidden; }
.fy-over > * { position: absolute; left: 0; top: 0; will-change: transform; }
.fy-map::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: var(--rule); pointer-events: none; }

/* 地名 */
.fy-lb { white-space: nowrap; font-size: 13.5px; line-height: 1.25; color: var(--lb-ink); transform-origin: 50% 50%; transition: opacity .25s, color .2s, background-color .2s;
  text-shadow: 0 0 2px var(--halo), 0 0 2px var(--halo), 0 0 3px var(--halo), 0 0 6px var(--halo); }
.fy-lb.off { opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s; }
.k-district { font-family: var(--serif); font-weight: 800; font-size: 21px; letter-spacing: .55em; padding-left: .55em; color: var(--lb-dist); }
.k-district.big { font-size: 25px; }
.k-sub { font-size: 12.5px; color: var(--lb-ink2); letter-spacing: .3em; padding-left: .3em; }
.k-sea { font-family: var(--serif); font-size: 46px; font-weight: 600; color: var(--lb-sea); letter-spacing: .2em; text-shadow: none; }
.k-water { font-family: var(--serif); font-size: 14.5px; font-weight: 600; color: var(--lb-water); letter-spacing: .35em; text-shadow: none; }
.k-exit { font-size: 12.5px; color: var(--lb-ink2); letter-spacing: .08em; }
.k-street { font-size: 11.5px; color: var(--lb-street); letter-spacing: .25em; }
.k-strata { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--lb-st); text-shadow: none; }
.k-strata-h { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--lb-st); text-shadow: none; }
.k-place { font-weight: 600; padding: 1px 6px; margin: -1px -6px; border-radius: 6px; }
.k-place.civic { color: var(--lb-civic); }
.k-place.quiet { font-weight: 500; font-size: 12.5px; color: var(--lb-ink2); }
.k-place.hover, .k-place.on { background: var(--card); color: var(--accent); text-shadow: none; box-shadow: 0 1px 2px rgba(27, 34, 56, .12), 0 4px 12px rgba(27, 34, 56, .1); }

/* 地方：点是门口；点开的那个一圈圈往外扩 */
.fy-pt { width: 34px; height: 34px; margin: -17px 0 0 -17px; padding: 0; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.fy-pt i { width: 12px; height: 12px; border-radius: 50%; background: var(--dot-folk); box-shadow: 0 0 0 2.5px var(--dot-ring), 0 1px 4px 2px rgba(60, 40, 20, .2); transition: transform .2s; }
.fy-pt.civic i { background: var(--dot-civic); }
.fy-pt:hover i, .fy-pt:focus-visible i { transform: scale(1.3); }
.fy-pt:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: -4px; }
.fy-pt.on i { transform: scale(1.35); }
.fy-pt.on::before, .fy-map.filtered .fy-pt.hot::before { content: ""; position: absolute; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--dot-folk); animation: fy-ring 1.8s ease-out infinite; }
.fy-pt.civic.on::before, .fy-map.filtered .fy-pt.civic.hot::before { border-color: var(--dot-civic); }
@keyframes fy-ring { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.fy-pt.obs { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
.fy-pt.obs i { opacity: 0; }
.fy-pt-s { width: 8px; height: 8px; margin: -4px 0 0 -4px; pointer-events: none; }
.fy-pt-s i { width: 8px; height: 8px; box-shadow: 0 0 0 2px var(--dot-ring); }
.fy-pt-s.off { opacity: 0; }
/* 小钉：一件讲过的事，从门口伸出去一根线 */
.fy-pin { width: 0; height: 0; padding: 0; border: 0; background: none; pointer-events: none; }
.fy-pin::before { content: ""; position: absolute; left: 0; top: -.75px; width: calc(var(--len) - 10px); height: 1.5px; background: var(--pin); opacity: .65; transform-origin: 0 50%; transform: rotate(var(--ang)); }
.fy-pin i { position: absolute; left: var(--dx); top: var(--dy); width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--pin); box-shadow: 0 0 0 2px var(--dot-ring), 0 2px 6px rgba(60, 40, 20, .25); pointer-events: auto; cursor: pointer; transition: transform .18s; }
.fy-pin i::after { content: ""; position: absolute; left: 8.5px; top: 6.5px; border-left: 7px solid var(--pin-ink); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
.fy-pin:hover i, .fy-pin.on i, .fy-pin:focus-visible i { transform: scale(1.22); }
.fy-pin:focus-visible { outline: none; } .fy-pin:focus-visible i { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.fy-map.filtered .fy-pt[data-spot]:not(.hot), .fy-map.filtered .fy-pin:not(.hot), .fy-map.filtered .fy-lb[data-for]:not(.hot) { opacity: .22; }
/* 放大了，住在那儿的人露出来 */
.fy-folk { display: flex; align-items: center; padding: 2px; transition: opacity .25s; }
.fy-folk .fy-face { width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--dot-ring); background: var(--card); }
.fy-folk .fy-face + .fy-face { margin-left: -6px; }
.fy-folk .fy-mono { font-size: 11px; }
.fy-folk b { margin-left: 4px; font-size: 11.5px; color: var(--lb-ink2); text-shadow: 0 0 3px var(--halo); }
.fy-folk.off { opacity: 0; visibility: hidden; }
.fy-folk.peek { opacity: 1; visibility: visible; }
.fy-map.far .fy-pin, .fy-map.far .fy-folk { visibility: hidden; }

/* 标题叠在左上角，放大或拖开了淡掉 */
.fy-title { position: absolute; z-index: 2; top: clamp(18px, 4vh, 40px); left: max(16px, calc((100% - 1180px) / 2)); pointer-events: none; transition: opacity .35s, transform .35s; }
.fy-map.away .fy-title { opacity: 0; transform: translateY(-6px); }
.fy-title .eyebrow { margin: 0 0 2px; color: var(--lb-ink2); letter-spacing: .5em; font-family: var(--serif); font-weight: 600; font-size: 14px; }
.fy-title h1 { margin: 0; font-size: clamp(46px, 6.4vw, 84px); font-weight: 900; letter-spacing: .1em; line-height: 1.05; color: var(--lb-ink);
  text-shadow: 0 0 1px var(--halo), 0 0 12px var(--halo), 0 0 24px var(--halo); }

/* 右下角的按钮、? 里的用法 */
.fy-ctl { position: absolute; z-index: 3; right: max(16px, calc((100% - 1180px) / 2)); bottom: 18px; display: flex; flex-direction: column; border-radius: 8px; background: color-mix(in srgb, var(--card) 88%, transparent); box-shadow: 0 1px 2px rgba(27, 34, 56, .1), 0 8px 24px rgba(27, 34, 56, .12); backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3); overflow: hidden; transition: right .35s; }
.fy-ctl button { width: 40px; height: 40px; border: 0; background: none; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.fy-ctl button + button { border-top: 1px solid var(--rule); }
.fy-ctl button:hover, .fy-ctl button[aria-expanded="true"] { color: var(--ink); background: var(--paper-2); }
.fy-ctl button:disabled { color: var(--ink-3); opacity: .35; cursor: default; background: none; }
.fy-ctl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fy-help { position: absolute; z-index: 4; right: calc(max(16px, calc((100% - 1180px) / 2)) + 52px); bottom: 18px; width: min(320px, calc(100% - 100px)); padding: 14px 16px; border-radius: 8px; background: var(--card); box-shadow: var(--shadow); font-size: 14px; line-height: 1.7; color: var(--ink-2); cursor: auto; }
.fy-help p { margin: 0; } .fy-help p + p { margin-top: 6px; }

/* 地点卡：桌面在地图右边，手机在底下 */
.fy-pop { position: absolute; z-index: 4; top: 18px; right: max(16px, calc((100% - 1180px) / 2)); max-height: calc(100% - 36px); width: 356px; overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; padding: 22px 22px 0; border-radius: 8px; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 2px rgba(27, 34, 56, .1), 0 18px 48px rgba(27, 34, 56, .18); color: var(--ink); cursor: auto; user-select: text; -webkit-user-select: text; animation: fy-card .32s cubic-bezier(.2, .8, .2, 1); scrollbar-width: thin; }
.fy-pop[hidden] { display: none; }
@keyframes fy-card { from { opacity: 0; transform: translateX(18px); } }
.fy-map.carded .fy-ctl { right: calc(max(16px, calc((100% - 1180px) / 2)) + 372px); }
.fy-pop-k { margin: 0 0 6px; font-size: 12px; letter-spacing: .3em; font-weight: 600; color: var(--dot-folk); }
.fy-pop-k.civic { color: var(--dot-civic); }
.fy-pop h3 { margin: 0 34px 8px 0; font-size: 25px; letter-spacing: .04em; }
.fy-pop-note { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.fy-pop h4 { font-size: 12px; letter-spacing: .22em; color: var(--ink-3); margin: 22px 0 10px; font-weight: 600; }
.fy-pop .fy-whos { gap: 10px 14px; }
.fy-pop-ev { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fy-pop-ev a { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; padding: 6px; margin: -6px; border-radius: 5px; text-decoration: none; color: var(--ink); }
.fy-pop-ev a:hover, .fy-pop-ev li.on a { background: var(--paper-2); }
.fy-pop-ev img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--paper-2); }
.fy-pop-ev span { display: flex; flex-direction: column; font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.fy-pop-ev b { font-size: 15px; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.fy-pop-nav { position: sticky; bottom: 0; margin: auto -22px 0; padding: 14px 22px 16px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(transparent, color-mix(in srgb, var(--card) 96%, transparent) 30%); font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fy-pop-nav button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper-2); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.fy-pop-nav button:hover { color: var(--ink); background: color-mix(in srgb, var(--paper-2) 70%, var(--rule)); }
.fy-pop-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fy-pop > :nth-last-child(2) { margin-bottom: 8px; }
.fy-tip { position: absolute; z-index: 5; width: 216px; padding: 8px 8px 10px; border-radius: 5px; background: var(--card); box-shadow: 0 2px 6px rgba(27, 34, 56, .1), 0 14px 36px rgba(27, 34, 56, .2); pointer-events: none; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); animation: fy-fade .16s ease-out; }
.fy-tip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; background: var(--paper-2); display: block; margin-bottom: 7px; }
.fy-tip b { display: block; color: var(--ink); font-size: 15px; font-family: var(--serif); }
.fy-tip span { display: block; padding: 0 2px; }
@keyframes fy-fade { from { opacity: 0; transform: translateY(4px); } }
.fy-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--ink-3); }
.fy-x:hover { background: var(--paper-2); color: var(--ink); }
.fy-x svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

/* 深色：叠层的字和点 */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fy-map { --lb-ink: #ece6da; --lb-ink2: #a7a39b; --lb-civic: #a3bedb; --lb-water: #7fb2c4; --lb-sea: #4e7189; --lb-dist: #e4ded1; --lb-street: #8a90a8; --lb-st: #dccbab;
  --halo: #1b2236; --dot-folk: #e68a68; --dot-civic: #86a5c6; --dot-ring: #1b2236; --pin: #e68a68; --pin-ink: #1b2236; background: #0f1322; } }
:root[data-theme="dark"] .fy-map { --lb-ink: #ece6da; --lb-ink2: #a7a39b; --lb-civic: #a3bedb; --lb-water: #7fb2c4; --lb-sea: #4e7189; --lb-dist: #e4ded1; --lb-street: #8a90a8; --lb-st: #dccbab;
  --halo: #1b2236; --dot-folk: #e68a68; --dot-civic: #86a5c6; --dot-ring: #1b2236; --pin: #e68a68; --pin-ink: #1b2236; background: #0f1322; }

.fy-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 48px; flex-wrap: wrap; padding: 28px 0 4px; }
.fy-intro .lead { max-width: 36em; margin: 0; color: var(--ink-2); font-size: calc(17px * var(--fs)); }
.fy-stats { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; color: var(--ink-3); font-size: 15px; }
.fy-stats b { font-family: var(--serif); font-size: 30px; color: var(--ink); margin-right: 4px; font-weight: 700; }
@media (max-width: 720px) {
  .fy-map { height: min(74svh, 640px); }
  .fy-title .eyebrow { font-size: 12px; }
  .fy-title h1 { font-size: 40px; }
  .fy-ctl { bottom: 12px; right: 12px; }
  .fy-map.carded .fy-ctl { right: 12px; }
  .fy-help { right: 64px; bottom: 12px; }
  .fy-intro { padding-top: 20px; }
  .fy-intro .lead { font-size: calc(16px * var(--fs)); }
  .k-district { font-size: 18px; } .k-district.big { font-size: 21px; } .k-sea { font-size: 36px; }
  .fy-pop { position: fixed; z-index: 30; top: auto; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; max-height: 58vh; animation-name: fy-sheet; }
  @keyframes fy-sheet { from { opacity: 0; transform: translateY(30px); } }
}

/* 人 */
.fy-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fy-chips button { border: 0; background: var(--paper-2); color: var(--ink-2); border-radius: 3px; padding: 4px 12px; font-size: 13.5px; cursor: pointer; line-height: 1.6; }
.fy-chips button:hover { color: var(--ink); }
.fy-chips button.on { background: var(--ink); color: var(--paper); }
.fy-group { margin: 0 0 40px; }
.fy-group h3 { font-size: 20px; margin: 0 0 4px; }
.fy-lead { margin: 0 0 14px; color: var(--ink-3); font-size: 15px; }
.fy-group h3 + .fy-cards { margin-top: 14px; }
.fy-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.fy-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 8px; background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s, opacity .3s; scroll-margin-top: 96px; }
.fy-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(27, 34, 56, .08), 0 14px 32px rgba(27, 34, 56, .12); }
.fy-card.on { box-shadow: 0 0 0 2px var(--accent-fill), var(--shadow); }
.fy-card-t { min-width: 0; display: flex; flex-direction: column; }
.fy-card-t strong { font-size: 17px; line-height: 1.4; }
.fy-full { margin-left: .45em; font-size: .78em; font-weight: 400; color: var(--ink-3); letter-spacing: .02em; }
.fy-card-t span { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fy-face-wrap { flex: none; }
.fy-dim { opacity: .22; }
.fy-fam, .fy-kin, .fy-under { transition: opacity .3s; }
.fy-fam { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin: 14px 2px 0; font-size: 14px; color: var(--ink-3); }
.fy-fam b { color: var(--ink-2); font-weight: 600; margin-right: 6px; }
.fy-fam-h { font-size: 12px; letter-spacing: .2em; color: var(--accent); font-weight: 600; }

/* 出过的事 */
.fy-evs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 16px; align-items: start; }
.fy-ev { background: var(--card); border-radius: 8px; box-shadow: var(--shadow); padding: 20px 22px; scroll-margin-top: 96px; transition: opacity .3s, box-shadow .3s; }
.fy-ev.hl { box-shadow: 0 0 0 2px var(--accent-fill), var(--shadow); }
.fy-ev header { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.fy-ev h3 { margin: 0; font-size: 20px; }
.fy-ev header span { font-size: 13.5px; color: var(--ink-3); }
.fy-ev .fy-whos { margin: 14px 0 16px; }
.fy-guest { align-items: flex-start; }
.fy-guest > span { display: flex; flex-direction: column; line-height: 1.45; }
.fy-guest em { font-style: normal; font-size: 12.5px; color: var(--ink-3); max-width: 15em; }
.fy-eps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
.fy-eps .fy-ep { width: auto; }
@media (max-width: 720px) { .fy-eps { display: flex; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; } .fy-eps .fy-ep { width: 176px; } }
.fy-ep { flex: none; width: 176px; text-decoration: none; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.fy-ep img { border-radius: 4px; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 6px; background: var(--paper-2); }
.fy-ep:hover { color: var(--ink); }
.fy-ep:hover img { box-shadow: 0 0 0 2px var(--accent-fill); }

/* 地底下：一张剖面，一层一个朝代，越往下越早（土色照地图的地底下）。兄弟俩站在竖井边，穿那一朝的衣冠 */
.fy-dig { --s0: #e6d8be; --s1: #decdaf; --s2: #d5c19f; --s3: #cbb48f; --s4: #c0a680; --s5: #b39772; --st-ink: #4b3c2b; --st-ink2: rgba(75, 60, 43, .62); --st-line: rgba(94, 75, 55, .45);
  --house: #e6dac6; --house-edge: #cdbda3; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); background: var(--s5); }
.fy-surface { display: block; width: 100%; height: 64px; background: linear-gradient(var(--paper-2), var(--paper-2)); }
.fy-surface .house { fill: var(--house); stroke: var(--house-edge); stroke-width: 1.2; }
.fy-surface .roof { fill: var(--house-edge); }
.fy-surface .ground { stroke: #8e7658; stroke-width: 3; }
.fy-surface .hatch { fill: none; stroke: #6e5a44; stroke-width: 2.2; stroke-linecap: round; }
.fy-strata { list-style: none; margin: 0; padding: 0; }
.fy-st { position: relative; display: grid; grid-template-columns: 172px 200px minmax(0, 1fr) 64px; align-items: center; gap: 0 20px; min-height: 128px; padding: 14px 28px 14px 28px; color: var(--st-ink);
  background-color: var(--soil); background-image: radial-gradient(circle, rgba(143, 118, 88, .2) 1.6px, transparent 2.2px), radial-gradient(circle, rgba(143, 118, 88, .14) 1.2px, transparent 1.8px);
  background-size: 137px 61px, 89px 47px; background-position: calc(var(--i) * 31px) calc(var(--i) * 17px), calc(var(--i) * 53px + 20px) 9px; }
.fy-st::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 14px; background: var(--soil); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 20' preserveAspectRatio='none'%3E%3Cpath d='M0,11 C40,3 80,4 120,10 C160,17 200,18 240,11 L240,20 L0,20 Z'/%3E%3C/svg%3E") calc(var(--i) * 71px) 0 / 240px 14px repeat-x; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 20' preserveAspectRatio='none'%3E%3Cpath d='M0,11 C40,3 80,4 120,10 C160,17 200,18 240,11 L240,20 L0,20 Z'/%3E%3C/svg%3E") calc(var(--i) * 71px) 0 / 240px 14px repeat-x; }
.fy-st:first-child::before { display: none; }
.fy-st:nth-child(1) { --soil: var(--s0); } .fy-st:nth-child(2) { --soil: var(--s1); } .fy-st:nth-child(3) { --soil: var(--s2); }
.fy-st:nth-child(4) { --soil: var(--s3); } .fy-st:nth-child(5) { --soil: var(--s4); } .fy-st:nth-child(6) { --soil: var(--s5); }
.fy-st-name { font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.fy-st-bros { position: relative; align-self: stretch; display: flex; align-items: flex-end; justify-content: center; margin: -14px 0; }
.fy-st-bros::before { content: ""; position: absolute; left: 50%; top: -12px; bottom: -2px; border-left: 2px dashed var(--st-line); }
.fy-st:first-child .fy-st-bros::before { top: -16px; }
.fy-st-bros img { position: relative; width: 104px; height: 104px; margin-bottom: 4px; }
.fy-st-bros img + img { margin-left: -18px; }
.fy-st-ep { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; color: var(--st-ink); font-weight: 600; font-size: 15.5px; line-height: 1.5; }
.fy-st-ep img { width: 148px; flex: none; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; box-shadow: 0 2px 10px rgba(60, 45, 30, .22); }
a.fy-st-ep:hover span { text-decoration: underline; text-underline-offset: 3px; }
.fy-st-wip { justify-content: space-between; padding: 12px 16px; border: 1.5px dashed var(--st-line); border-radius: 5px; color: var(--st-ink2); font-weight: 500; }
.fy-st-wip em { flex: none; font-style: normal; font-size: 12.5px; letter-spacing: .1em; padding: 1px 10px; border-radius: 3px; border: 1px solid var(--st-line); }
.fy-st-art { width: 52px; height: 52px; justify-self: end; opacity: .85; fill: none; stroke: #5e4b37; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transform: rotate(calc((var(--i) - 2.5) * 3deg)); }
.fy-st-art .thin { stroke-width: 1.5; }
.fy-st-art .glow { fill: #e8c26a; stroke: none; opacity: .6; }
.fy-st-art .seal { fill: #b0573c; stroke: none; opacity: .8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fy-dig { --s0: #272a36; --s1: #2b2c35; --s2: #302f35; --s3: #353134; --s4: #3a3332; --s5: #40362f; --st-ink: #e6d6b8; --st-ink2: rgba(230, 214, 184, .6); --st-line: rgba(205, 183, 151, .4); --house: #323a52; --house-edge: #4a5372; }
  :root:not([data-theme="light"]) .fy-st-art { stroke: #cdb797; } :root:not([data-theme="light"]) .fy-surface .ground { stroke: #6c5c4a; } }
:root[data-theme="dark"] .fy-dig { --s0: #272a36; --s1: #2b2c35; --s2: #302f35; --s3: #353134; --s4: #3a3332; --s5: #40362f; --st-ink: #e6d6b8; --st-ink2: rgba(230, 214, 184, .6); --st-line: rgba(205, 183, 151, .4); --house: #323a52; --house-edge: #4a5372; }
:root[data-theme="dark"] .fy-st-art { stroke: #cdb797; } :root[data-theme="dark"] .fy-surface .ground { stroke: #6c5c4a; }
@media (max-width: 720px) {
  .fy-dig { margin-inline: -16px; border-radius: 0; }
  .fy-surface .hatch { display: none; }
  .fy-st { grid-template-columns: 104px minmax(0, 1fr); grid-template-areas: "bros name" "bros ep"; gap: 6px 14px; padding: 14px 16px 14px 8px; min-height: 0; }
  .fy-st-name { grid-area: name; font-size: 17px; align-self: end; }
  .fy-st-bros { grid-area: bros; }
  .fy-st-bros img { width: 64px; height: 64px; }
  .fy-st-bros img + img { margin-left: -14px; }
  .fy-st-ep { grid-area: ep; align-self: start; font-size: 14px; }
  .fy-st-ep img { width: 104px; }
  .fy-st-wip { padding: 8px 12px; }
  .fy-st-art { position: absolute; right: 12px; top: 10px; width: 34px; height: 34px; opacity: .5; }
}

/* 人物抽屉 */
.fy-drawer { position: fixed; z-index: 40; top: 76px; right: 16px; bottom: 16px; width: min(420px, calc(100% - 32px)); background: var(--card); border-radius: 8px; box-shadow: 0 2px 6px rgba(27, 34, 56, .1), 0 24px 64px rgba(27, 34, 56, .22); overflow: auto; overscroll-behavior: contain; animation: fy-in .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes fy-in { from { opacity: 0; transform: translateX(24px); } }
.fy-drawer-in { padding: 28px 26px 30px; position: relative; }
.fy-d-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; text-decoration: none; color: inherit; }
.fy-d-head:hover h2 { color: var(--accent); }
.fy-d-more { display: inline-flex; align-items: center; gap: 2px; margin-top: 26px; padding: 8px 14px 8px 16px; border-radius: 3px; background: var(--paper-2); color: var(--ink); text-decoration: none; font-size: 14.5px; }
.fy-d-more:hover { background: color-mix(in srgb, var(--paper-2) 70%, var(--rule)); }
.fy-d-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fy-d-head h2 { margin: 0; font-size: 28px; }
.fy-d-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.fy-drawer h4 { font-size: 12px; letter-spacing: .22em; color: var(--accent); margin: 22px 0 8px; font-weight: 600; }
.fy-drawer .fy-job { margin: 0; font-size: 16px; }
.fy-drawer .fy-q { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.fy-drawer .fy-q b { color: var(--ink-3); font-weight: 500; margin-right: 8px; font-size: 13px; }
.fy-rec { list-style: none; margin: 0; padding: 0; }
.fy-rec li { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.65; }
.fy-rec li:first-child { border-top: 0; padding-top: 2px; }
.fy-rec .o { display: block; color: var(--ink-3); font-size: 14px; }
.fy-rec .o::before { content: "→ "; }
.fy-rec a { font-size: 13.5px; }
.fy-tag { display: inline-block; font-size: 11.5px; padding: 0 7px; border-radius: 3px; background: color-mix(in srgb, var(--accent-fill) 22%, transparent); color: var(--accent); margin-left: 6px; vertical-align: 2px; letter-spacing: .05em; }
.fy-d-eps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fy-d-eps .fy-ep { width: auto; }
@media (max-width: 720px) {
  .fy-drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 82vh; border-radius: 18px 18px 0 0; animation-name: fy-up; padding-bottom: env(safe-area-inset-bottom); }
  @keyframes fy-up { from { opacity: 0; transform: translateY(40px); } }
}
@media (prefers-reduced-motion: reduce) { .fy-drawer, .fy-card, .fy-pt, .fy-pt *, .fy-pin *, .fy-tip, .fy-pop, .fy-lb { animation: none !important; transition: none !important; } }

/* 悬停换一张挥手的：两张叠着，鼠标放上去换 */
.fy-swap { position: relative; display: block; flex: none; }
.fy-swap .fy-alt { position: absolute; inset: 0; opacity: 0; transition: opacity .18s; }
.fy-swap > img:first-child { transition: opacity .18s; }
:is(a, .fy-pimg):hover .fy-swap .fy-alt { opacity: 1; }
:is(a, .fy-pimg):hover .fy-swap > img:first-child { opacity: 0; }
@media (hover: none) { .fy-swap .fy-alt { display: none; } }

/* 人物页 /city/p/<人>/：一张图鉴 */
.fy-person { padding: 28px 0 24px; }
.fy-person .crumbs { margin-bottom: 18px; }
.fy-phead { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 24px 56px; align-items: center; padding-bottom: 40px; border-bottom: 1px solid var(--rule); }
.fy-pimg { position: relative; aspect-ratio: 1; border-radius: 28px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 18%, color-mix(in srgb, var(--tint) 16%, var(--card)), color-mix(in srgb, var(--tint) 30%, var(--paper-2)) 80%); }
.fy-pimg::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 22%, transparent); pointer-events: none; }
.fy-big { width: 100%; height: 100%; }
.fy-big img { width: 100%; height: 100%; display: block; }
.fy-big.fy-mono { display: grid; place-items: center; font-size: 140px; }
.fy-pmeta .eyebrow { margin-bottom: 6px; }
.fy-pmeta h1 { margin: 0 0 22px; font-size: clamp(40px, 5vw, 60px); letter-spacing: .08em; }
.fy-facts { margin: 0 0 18px; display: grid; gap: 8px; }
.fy-facts div { display: grid; grid-template-columns: 4.5em 1fr; gap: 12px; }
.fy-facts dt { color: var(--ink-3); font-size: 14px; padding-top: 3px; }
.fy-facts dd { margin: 0; color: var(--ink); }
.fy-pq { margin: 10px 0 0; padding: 12px 16px; border-radius: 5px; background: var(--paper-2); color: var(--ink-2); display: grid; grid-template-columns: 4.5em 1fr; gap: 12px; }
.fy-pq span { color: color-mix(in srgb, var(--tint) 60%, var(--ink)); font-size: 14px; padding-top: 2px; font-weight: 600; }
.fy-psec { padding-top: 36px; }
.fy-psec h2 { font-size: 24px; margin: 0 0 16px; }
.fy-prec { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; max-width: 760px; }
.fy-prec::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--tint) 45%, var(--rule)); }
.fy-prec li { position: relative; padding: 6px 0 14px; }
.fy-prec li::before { content: ""; position: absolute; left: -22px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 3px var(--tint); }
.fy-prec p { margin: 0; }
.fy-prec .o { color: var(--ink-3); font-size: 15px; }
.fy-prec .o::before { content: "→ "; }
.fy-prec a { font-size: 14px; }
.fy-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px 16px; }
.fy-pgrid .fy-ep { width: auto; font-size: 14.5px; }
.fy-pnear { display: flex; flex-wrap: wrap; gap: 14px 26px; }
.fy-pnear .fy-who > span { display: flex; flex-direction: column; line-height: 1.4; }
.fy-pnear .fy-who b { color: var(--ink); font-weight: 600; }
.fy-pnear .fy-who > span:last-child { font-size: 13px; color: var(--ink-3); }
.fy-pnear .fy-face { width: 56px; height: 56px; }
.fy-pdyn { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.fy-pdyn li { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 12px; border-radius: 8px; background: var(--paper-2); font-family: var(--serif); font-size: 14px; color: var(--ink-2); text-align: center; }
.fy-pdyn img { width: 100%; max-width: 140px; aspect-ratio: 1; }
@media (max-width: 720px) { .fy-pdyn { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .fy-person { padding-top: 16px; }
  .fy-phead { grid-template-columns: 1fr; gap: 18px; padding-bottom: 28px; }
  .fy-pimg { max-width: 260px; width: 100%; margin-inline: auto; border-radius: 22px; }
  .fy-facts div, .fy-pq { grid-template-columns: 3.4em 1fr; gap: 10px; }
  .fy-pmeta h1 { margin-bottom: 16px; }
}

/* 关系图：沈家族谱、林记面馆一圈、借条（tools/lawobs/kin.py 画） */
.fy-kin { --kin-bg: var(--card); margin: 22px 0 0; padding: 22px 12px 14px; border-radius: 8px; background: var(--kin-bg); box-shadow: var(--shadow); }
.fy-kin-in { overflow-x: auto; scrollbar-width: none; }
.fy-kin-in::-webkit-scrollbar { display: none; }
.fy-kin svg { display: block; width: 100%; max-width: 820px; height: auto; margin-inline: auto; font-family: var(--sans); overflow: visible; }
.fy-kin-ring svg, .fy-kin-iou svg { max-width: 680px; }
.fy-kin a { cursor: pointer; }
.k-line { fill: none; stroke: color-mix(in srgb, var(--ink-3) 55%, transparent); stroke-width: 1.6; stroke-linejoin: round; }
.k-soft { stroke-dasharray: 5 5; }
path.k-folk { stroke: color-mix(in srgb, #b0573c 65%, transparent); }
path.k-civic { stroke: color-mix(in srgb, #4e6b88 70%, transparent); }
.k-arrow { stroke-width: 2; }
.k-head { fill: color-mix(in srgb, var(--ink-3) 70%, transparent); }
.k-bg { fill: var(--paper-2); }
.k-ring { fill: none; stroke: var(--kin-bg); stroke-width: 3; }
.k-node.me .k-ring { stroke: var(--accent-fill); stroke-width: 3; }
.k-mono { font-family: var(--serif); font-weight: 700; font-size: 21px; fill: var(--ink-2); text-anchor: middle; }
/* 名字和关系字描一圈底色：连线贴过去也压不住字（11-03 奶奶那条线穿过名字） */
.k-name, .k-tag { paint-order: stroke; stroke: var(--kin-bg); stroke-width: 5px; stroke-linejoin: round; }
.k-name { font-size: 15px; font-weight: 600; fill: var(--ink); text-anchor: middle; }
.k-node.me .k-name { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.k-tag { font-size: 12.5px; fill: var(--ink-3); text-anchor: middle; letter-spacing: .05em; }
.k-rel { font-size: 12.5px; fill: var(--ink-3); }
.k-on { paint-order: stroke; stroke: var(--kin-bg); stroke-width: 6px; stroke-linejoin: round; font-size: 13px; }
.k-on.k-folk { fill: #9c4b33; } .k-on.k-civic { fill: #3f5d7c; }
a:hover .k-ring, a:focus-visible .k-ring { stroke: var(--accent-fill); }
a:hover .k-name { fill: var(--accent); }
.k-paper { fill: #fbf6e9; stroke: #d9c9a6; stroke-width: 1.2; filter: drop-shadow(0 3px 6px rgba(27, 34, 56, .12)); }
.k-paper-h { font-family: var(--serif); font-size: 17px; font-weight: 700; fill: #3a2f25; text-anchor: middle; letter-spacing: .3em; }
.k-paper-n { font-family: var(--serif); font-size: 22px; font-weight: 700; fill: #9c3a2a; text-anchor: middle; }
.k-paper-l { stroke: #c9b78f; stroke-width: 1; }
.k-step rect { fill: var(--paper-2); }
.k-step text { font-size: 13.5px; fill: var(--ink-2); text-anchor: middle; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .k-on.k-folk { fill: #e68a68; } :root:not([data-theme="light"]) .k-on.k-civic { fill: #9db7d3; }
  :root:not([data-theme="light"]) path.k-folk { stroke: color-mix(in srgb, #e68a68 60%, transparent); } :root:not([data-theme="light"]) path.k-civic { stroke: color-mix(in srgb, #86a5c6 70%, transparent); }
}
:root[data-theme="dark"] .k-on.k-folk { fill: #e68a68; } :root[data-theme="dark"] .k-on.k-civic { fill: #9db7d3; }
:root[data-theme="dark"] path.k-folk { stroke: color-mix(in srgb, #e68a68 60%, transparent); } :root[data-theme="dark"] path.k-civic { stroke: color-mix(in srgb, #86a5c6 70%, transparent); }
@media (max-width: 720px) {
  .fy-kin { --kin-bg: var(--paper-2); margin-inline: -16px; border-radius: 0; box-shadow: none; padding: 18px 16px 12px; }
  .k-bg { fill: var(--card); }
}

/* 手机：按课的那排横着滑，统计数字一行放下（写在最后，盖过上面的默认） */
@media (max-width: 720px) {
  .fy-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; width: calc(100% + 32px); }
  .fy-chips::-webkit-scrollbar { display: none; }
  .fy-chips button { flex: none; }
  .fy-stats { gap: 4px 18px; font-size: 13.5px; }
  .fy-stats b { font-size: 25px; }
}

/* 地底下还没发的几层压矮一点（只有一行讲名），能看的那层照常高 */
.fy-st.wip { min-height: 92px; padding-top: 8px; padding-bottom: 8px; }
.fy-st.wip .fy-st-bros img { width: 80px; height: 80px; }
.fy-st.wip .fy-st-art { width: 42px; height: 42px; }
@media (max-width: 720px) { .fy-st.wip .fy-st-bros img { width: 52px; height: 52px; } }

/* 页内四段的入口、按课筛之后的计数 */
.fy-toc { display: flex; flex-wrap: wrap; gap: 6px 22px; width: 100%; margin: 4px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15px; }
.fy-toc a { color: var(--ink-2); text-decoration: none; }
.fy-toc a:hover { color: var(--accent); }
.fy-count { margin: -10px 0 24px; font-size: 14.5px; color: var(--ink-2); }
.fy-count:empty { display: none; }
.fy-count b { font-family: var(--serif); color: var(--ink); }
.fy-card, .fy-ev { scroll-margin-top: 96px; }
section[id] { scroll-margin-top: 72px; }

/* 手机上两指就能缩放，加减两个按钮去掉，少压地名 */
@media (hover: none) and (pointer: coarse) {
  .fy-ctl [data-z="in"], .fy-ctl [data-z="out"] { display: none; }
  .fy-ctl [data-z="home"] { border-top: 0; }
  .fy-ctl button { width: 36px; height: 36px; }
}

/* 地点的颜色：机关蓝、街坊赤陶、出城灰、地底下土色 */
.fy-pt { --c: var(--dot-folk); } .fy-pt.civic { --c: var(--dot-civic); } .fy-pt.exit { --c: var(--lb-ink2); } .fy-pt.under { --c: #8e7658; }
.fy-pt i { background: var(--c); }
.k-district[data-dist] { pointer-events: auto; cursor: pointer; border-radius: 4px; transition: color .2s, background-color .2s; }
.k-district[data-dist]:hover, .k-district[data-dist]:focus-visible { color: var(--accent); background: color-mix(in srgb, var(--card) 70%, transparent); text-shadow: none; outline: none; }

/* 地点索引：按区列出全部地方 */
.fy-index { position: absolute; z-index: 4; top: 18px; left: max(16px, calc((100% - 1180px) / 2)); max-height: calc(100% - 36px); width: 300px; overflow: auto; overscroll-behavior: contain; padding: 20px 18px 14px;
  border-radius: 8px; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 2px rgba(27, 34, 56, .1), 0 18px 48px rgba(27, 34, 56, .18); cursor: auto; animation: fy-idx .28s cubic-bezier(.2, .8, .2, 1); scrollbar-width: thin; }
@keyframes fy-idx { from { opacity: 0; transform: translateX(-14px); } }
.fy-index[hidden] { display: none; }
.fy-index h3 { margin: 0 0 4px 4px; font-size: 22px; letter-spacing: .1em; }
.fy-index section + section { border-top: 1px solid var(--rule); }
.fy-index h4, .fy-pop-pl { margin: 0; }
.fy-index h4 { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 4px 4px; font-size: 13px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.fy-index h4 button { border: 0; background: none; padding: 0; font: inherit; font-family: var(--serif); font-size: 16px; font-weight: 700; letter-spacing: .15em; color: var(--ink); cursor: pointer; }
.fy-index h4 button:hover { color: var(--accent); }
.fy-index ul, .fy-pop-pl { list-style: none; padding: 0; margin: 0 0 6px; }
.fy-index li button, .fy-pop-pl li button { width: 100%; display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 5px; background: none; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.fy-index li button:hover, .fy-pop-pl li button:hover { background: var(--paper-2); }
.fy-index li b, .fy-pop-pl li b { font-weight: 500; font-size: 14.5px; }
.fy-index li span, .fy-pop-pl li span { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fy-sd { display: block; width: 10px; height: 10px; margin-left: 1px; border-radius: 50%; background: var(--dot-folk, #b0573c); }
.fy-sd.civic { background: #4e6b88; } .fy-sd.exit { background: var(--ink-3); } .fy-sd.under { background: #8e7658; }
.fy-map.indexed .fy-title { opacity: 0; }

.fy-pop-k.exit, .fy-pop-k.under { color: var(--ink-3); }

@media (max-width: 720px) {
  .fy-index { position: fixed; z-index: 30; top: auto; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; max-height: 62vh; animation-name: fy-sheet; }
}
