/* 随手翻翻：轻巧入口、全屏照片；独立前缀避免影响既有阅读层。 */
nav.top .enc-entry { flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1.5px solid var(--line); border-radius: 10px; color: inherit; background: var(--card); box-shadow: 2px 2px 0 var(--shadow); transition: transform .15s, background .15s; }
nav.top .enc-entry:hover { background: var(--sun-soft); transform: translateY(-1px); }
.enc-entry svg { width: 21px; height: 21px; }
.enc-entry:focus-visible { outline: 2px solid var(--sun); outline-offset: 4px; }
body[data-page="next"] .enc-entry { background: #142430; color: #e8eef5; border-color: #385065; box-shadow: 2px 2px 0 #385065; }
body.encounters-open { overflow: hidden !important; }
.encounters { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; background: #0d1820; color: #e8eef2; isolation: isolate; color-scheme: dark; overscroll-behavior: contain; }
.encounters[open] { display: grid; grid-template-rows: 76px minmax(0, 1fr) auto; }
.encounters::backdrop { background: #09131a; }
.encounters button { font: inherit; cursor: pointer; }
.encounters button:disabled { cursor: default; opacity: .3; }
.encounters svg { display: block; width: 18px; height: 18px; flex: none; }
.encounters button:focus-visible, .enc-stage:focus-visible { outline: 2px solid #ffa567; outline-offset: 4px; }
.enc-ambient { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(80px) saturate(.55); opacity: .16; z-index: -2; pointer-events: none; }
.enc-tint { position: absolute; inset: 0; background: #09131a99; z-index: -1; pointer-events: none; }
.enc-header { display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 3vw, 52px); gap: 16px; z-index: 2; }
.enc-brand { display: flex; align-items: center; gap: 12px; font-size: 12px; white-space: nowrap; }
.enc-brand i { width: 7px; height: 7px; border-radius: 50%; background: #f98643; box-shadow: 0 0 14px #f9864325; }
.enc-brand span { font-size: 11px; color: #aab8c4; }
.enc-brand span:first-of-type { color: #536878; }
.enc-header-note { font-size: 11px; letter-spacing: .08em; color: #94a6b4; }
.enc-actions { display: flex; gap: 8px; }
.encounters .enc-icon { display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0; border: 1px solid #ffffff24; border-radius: 50%; color: #b2c2ce; background: #ffffff04; transition: background .15s, color .15s; }
.encounters .enc-icon:hover:not(:disabled) { background: #ffffff13; color: white; }
.enc-header .enc-icon { border-color: transparent; }
.enc-header .enc-icon[aria-pressed="true"] { color: #ffab76; background: #f9864318; }
.enc-stage { min-height: 0; min-width: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 12px clamp(28px, 7vw, 100px) 8px; touch-action: pan-y; overflow: hidden; outline-offset: -5px; }
.enc-stage > img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; box-shadow: 0 12px 80px #0003; user-select: none; -webkit-user-drag: none; }
.enc-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #b0c0cc; font-size: 12px; }
.enc-frame { position: absolute; left: clamp(24px, 3vw, 52px); bottom: 18px; color: #8093a2; font: 10px var(--mono); letter-spacing: .1em; }
.enc-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 30px; align-items: center; padding: 24px clamp(25px, 3vw, 52px) max(24px, env(safe-area-inset-bottom)); min-height: 144px; background: #0c172062; z-index: 1; }
.enc-copy { min-width: 0; max-width: 520px; }
.enc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; color: #9cb0be; font: 10px/1.7 var(--mono); }
.enc-meta span + span::before { content: '·'; margin-right: 10px; color: #688498; }
.enc-copy h2 { font-size: clamp(17px, 1.6vw, 23px); font-weight: 550; line-height: 1.5; margin: 7px 0 4px; letter-spacing: .01em; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.encounters .enc-text-button { display: flex; align-items: center; gap: 9px; padding: 2px 0; min-height: 34px; font-size: 11px; color: #9fb3c2; border: 0; background: transparent; }
.encounters .enc-text-button:hover { color: #e6eff5; }
.enc-text-button svg { width: 13px; height: 13px; }
.enc-navigation { justify-self: center; }
.enc-controls { display: flex; align-items: center; gap: 13px; }
.encounters .enc-next { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 25px; border: 1px solid #ffad7670; border-radius: 28px; background: #f27937; color: #fff9f5; font-size: 13px; font-weight: 600; transition: background .15s, transform .15s; }
.encounters .enc-next:hover:not(:disabled) { background: #fb8b4e; transform: translateY(-1px); }
.enc-like[aria-pressed="true"] { border-color: #f9864360; color: #ffa26a; background: #f9864312; }
.enc-like[aria-pressed="true"] svg { fill: #fa965b; stroke: #fa965b; }
.enc-help { font: 9px/1.7 var(--mono); color: #8ba3b4; text-align: center; margin: 12px 0 0; white-space: nowrap; }
.enc-history { justify-self: end; text-align: right; color: #9cb1c0; }
#encCount { display: block; font: 10px/1.8 var(--mono); }
.enc-history .enc-text-button { margin-left: auto; }
#encRound { display: block; font-size: 10px; color: #8aa1b1; }
.enc-panel { position: absolute; bottom: 157px; z-index: 4; border: 1px solid #ffffff24; border-radius: 13px; background: #14232df7; box-shadow: 0 15px 65px #0006; padding: 10px 18px 17px; max-width: calc(100% - 40px); max-height: 55%; overflow: auto; overscroll-behavior: contain; backdrop-filter: blur(15px); }
.enc-story { left: clamp(25px, 3vw, 52px); width: 380px; }
.enc-trail { right: clamp(25px, 3vw, 52px); width: 370px; }
.enc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #bfd0dc; font-size: 12px; }
.enc-panel-head .enc-icon { border: 0; }
.enc-story p { white-space: pre-line; font-size: 14px; line-height: 1.9; color: #d9e5ed; margin: 11px 0 17px; overflow-wrap: anywhere; }
#encSource { display: block; color: #9aafbf; font: 10px/1.8 var(--mono); }
.enc-thumbnails { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0 4px; }
.enc-thumbnails button { width: 70px; height: 64px; flex: none; padding: 3px; border: 1px solid transparent; border-radius: 6px; opacity: .7; background: transparent; }
.enc-thumbnails button[aria-current="true"] { border-color: #fa965b; opacity: 1; }
.enc-thumbnails button:hover { opacity: 1; }
.enc-thumbnails img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.enc-toast { position: absolute; bottom: 149px; left: 50%; transform: translateX(-50%); z-index: 6; color: #e1eaf0; background: #203240f5; border: 1px solid #ffffff15; padding: 10px 19px; font-size: 11px; border-radius: 25px; max-width: 90%; text-align: center; }
.enc-empty { grid-row: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.enc-empty h2 { font-size: 24px; line-height: 1.5; }
.enc-empty p { font-size: 13px; color: #a6bac8; }
.enc-only .enc-copy, .enc-only .enc-history { display: none; }
.enc-only .enc-footer { grid-template-columns: 1fr; min-height: 98px; padding-top: 13px; padding-bottom: max(15px, env(safe-area-inset-bottom)); }
.enc-only .enc-frame { visibility: hidden; }
.enc-only .enc-toast { bottom: 105px; }
.enc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 700px) {
  nav.top { gap: 7px; }
  nav.top ul { gap: 2px; }
  nav.top ul a { padding: 6px 7px; font-size: 12px; }
  nav.top .enc-entry { width: 36px; height: 36px; margin-left: 1px; }
  .encounters[open] { grid-template-rows: 64px minmax(0, 1fr) auto; }
  .enc-header { padding: 0 17px; gap: 8px; }
  .enc-brand { font-size: 12px; gap: 9px; }
  .enc-header-note { display: none; }
  .enc-actions { gap: 2px; }
  .enc-stage { padding: 8px 18px 6px; }
  .enc-footer { grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; min-height: 0; padding: 17px 23px max(18px, env(safe-area-inset-bottom)); }
  .enc-copy { grid-column: 1 / -1; max-width: none; }
  .enc-copy h2 { font-size: 19px; line-height: 1.4; margin: 6px 0 3px; }
  .enc-meta { font-size: 10px; }
  .enc-navigation { grid-column: 1 / -1; }
  .enc-controls { gap: 16px; }
  .enc-history { grid-column: 1 / -1; justify-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .enc-history .enc-text-button { min-height: 30px; font-size: 10px; }
  #encCount { font-size: 9px; }
  #encRound, .enc-help, .enc-frame { display: none; }
  .enc-panel { left: 18px; right: 18px; width: auto; max-width: none; bottom: 240px; max-height: calc(100dvh - 320px); padding: 8px 15px 13px; }
  .enc-story p { font-size: 13px; }
  .enc-toast { bottom: 250px; width: max-content; max-width: calc(100% - 40px); }
  .enc-only .enc-footer { display: flex; justify-content: center; min-height: 0; padding: 15px 22px max(20px, env(safe-area-inset-bottom)); }
  .enc-only .enc-toast { bottom: 90px; }
}
@media (max-width: 380px) {
  nav.top { gap: 6px; padding: 0 10px; }
  nav.top .brand { font-size: 16px; gap: 6px; }
  nav.top .brand .avatar { width: 24px; height: 24px; }
  nav.top ul a { padding: 6px 5px; font-size: 11px; }
  nav.top .enc-entry { width: 33px; height: 34px; }
  .enc-brand { gap: 7px; }
  .enc-footer { padding-left: 18px; padding-right: 18px; }
}
@media (max-height: 560px) {
  .encounters[open] { grid-template-rows: 54px minmax(0, 1fr) auto; }
  .enc-header-note, .enc-help, .enc-history, .enc-frame { display: none; }
  .enc-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 88px; padding: 10px 24px max(12px, env(safe-area-inset-bottom)); }
  .enc-copy h2 { font-size: 15px; -webkit-line-clamp: 1; }
  .enc-meta { font-size: 9px; }
  .enc-panel { bottom: 103px; max-height: calc(100dvh - 175px); }
  .enc-toast { bottom: 105px; }
  .enc-only .enc-footer { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .encounters *, .enc-entry { animation: none !important; transition: none !important; } }
