.page-switch { position: fixed; z-index: 80; top: calc(34px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; padding: 3px; border: 1px solid var(--line, #eadfe3); border-radius: 999px; background: var(--paper, #ffffff); box-shadow: 0 4px 18px rgb(55 29 41 / .07); isolation: isolate; }
.page-switch-liquid { position: absolute; z-index: -1; left: 7px; top: 7px; bottom: 7px; width: calc((100% - 6px) / 2 - 8px); border-radius: 999px; background: var(--accent, #e8bac8); pointer-events: none; transform: translateX(0); }
.page-switch[data-active="gallery"] .page-switch-liquid { transform: translateX(calc(100% + 8px)); }
.page-switch a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 86px; min-height: 34px; padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--muted, #665b61); transition: color .2s; }
.page-switch strong { font-family: sans-serif; font-size: 12px; line-height: 16px; font-weight: 650; }
.page-switch small { font-family: sans-serif; font-size: 8px; line-height: 10px; letter-spacing: .1em; }
.page-switch[data-active="avatars"] a:first-of-type, .page-switch[data-active="gallery"] a:last-of-type { color: #251a20; }
.page-switch a:hover { color: var(--accent-dark, #94546c); }
.page-switch a:focus-visible { outline: 2px solid var(--accent-dark, #94546c); outline-offset: 2px; }
.page-switch[data-active="gallery"].is-flowing .page-switch-liquid { animation: liquid-right 380ms cubic-bezier(.22,.75,.22,1) both; }
.page-switch[data-active="avatars"].is-flowing .page-switch-liquid { animation: liquid-left 380ms cubic-bezier(.22,.75,.22,1) both; }
@keyframes liquid-right { 0% { transform: translateX(0) scale(1); } 38% { transform: translateX(calc(38% + 3px)) scale(1.3,.76); border-radius: 48% 60% 60% 48%; } 72% { transform: translateX(calc(105% + 8px)) scale(.92,1.08); } 100% { transform: translateX(calc(100% + 8px)) scale(1); border-radius: 999px; } }
@keyframes liquid-left { 0% { transform: translateX(calc(100% + 8px)) scale(1); } 38% { transform: translateX(calc(62% + 5px)) scale(1.3,.76); border-radius: 60% 48% 48% 60%; } 72% { transform: translateX(-5%) scale(.92,1.08); } 100% { transform: translateX(0) scale(1); border-radius: 999px; } }
html[data-color-mode="dark"] .page-switch { background: var(--paper, #151316); border-color: var(--line, #3c3037); }
html[data-color-mode="dark"] .page-switch-liquid { background: var(--accent, #a88492); }
html[data-color-mode="dark"] .page-switch a { color: var(--muted, #c0adb5); }
html[data-color-mode="dark"] .page-switch[data-active="avatars"] a:first-of-type, html[data-color-mode="dark"] .page-switch[data-active="gallery"] a:last-of-type { color: #151316; }
html[data-color-mode="dark"] .page-switch a:focus-visible { outline-color: var(--accent-dark, #cfabb9); }
.page-circle-mask { position: fixed; inset: 0; z-index: 20000; pointer-events: auto; background: var(--accent-soft, #f8e9ef); }
html[data-color-mode="dark"] .page-circle-mask { background: var(--accent-soft, #292027); }
@media (max-width: 900px) { .page-switch { top: calc(106px + env(safe-area-inset-top)); } .home-page .home-showcase { margin-top: 76px; } }
@media (prefers-reduced-motion: reduce) { .page-switch a { transition: none; } html:not([data-motion="on"]) .page-switch.is-flowing .page-switch-liquid { animation: none; } }
html.page-switch-arriving::after { content: ""; position: fixed; inset: 0; z-index: 20000; background: var(--accent-soft, #f8e9ef); }
html[data-color-mode="dark"].page-switch-arriving::after { background: var(--accent-soft, #292027); }

.motion-toggle { position:fixed; top:calc(34px + env(safe-area-inset-top)); right:24px; z-index:81; border:1px solid var(--line,#eadfe3); border-radius:4px; padding:9px 12px; background:var(--paper,var(--gallery-ground,#fff)); color:var(--muted,var(--gallery-ink,#665b61)); font:12px system-ui; cursor:pointer; white-space:nowrap; }
.header-actions .motion-toggle { position:static; transform:none; flex-shrink:0; }
.motion-toggle:focus-visible { outline:2px solid var(--accent,#e8bac8); outline-offset:2px; }
html[data-motion="off"] .page-switch.is-flowing .page-switch-liquid { animation:none; }
@media(max-width:600px) { .header-actions { gap:8px; flex-wrap:wrap; justify-content:flex-end; } .header-actions .motion-toggle { padding:7px 8px; font-size:11px; } body:has(.gallery-stage) .motion-toggle { right:12px; top:calc(90px + env(safe-area-inset-top)); } }

@media(max-width:760px) {
 html .page-switch { top:calc(14px + env(safe-area-inset-top)); z-index:120; }
 .page-switch a { min-width:64px; min-height:30px; padding:3px 8px; }
 .page-switch strong { font-size:12px; }
 .home-page .home-showcase { margin-top:20px; }
}
@media(max-width:760px) {
  /* Local-preview notice only: do not cover the fixed navigation. */
  body > div[style*="z-index:2147483647"][style*="pointer-events:none"] { top:auto !important; bottom:calc(4px + env(safe-area-inset-bottom)); font-size:8px !important; padding:1px 5px !important; max-width:60vw !important; }
}

/* Navigation uses persistent views, with no fullscreen masks or per-frame painting. */
#gallery-view {position:fixed;inset:0;z-index:100;isolation:isolate;background:var(--paper,#fff)}
#gallery-view[hidden], #view-nav[hidden], #app[hidden] {display:none!important}
#view-nav .page-switch {top:calc(34px + env(safe-area-inset-top));left:50vw;z-index:150}
#view-nav .page-switch-liquid {transition:transform 300ms cubic-bezier(.22,.8,.25,1)}
#view-nav .page-switch[aria-busy="true"]::after {content:'加载中';position:absolute;top:calc(100% + 6px);left:0;right:0;text-align:center;font:11px system-ui;color:var(--ink)}
@media(max-width:760px){#view-nav .page-switch {top:calc(14px + env(safe-area-inset-top))}}
@media(prefers-reduced-motion:reduce){#view-nav .page-switch-liquid {transition:none}}
.gallery-loading {position:fixed;inset:0;display:grid;place-content:center;background:var(--surface,#fff);color:var(--text,#222);margin:0}
.pagination {flex-wrap:wrap;gap:12px}
.collection [data-pagination] {grid-column:1/-1;min-width:0}
.page-buttons {display:flex;align-items:center;justify-content:center;gap:4px}
.page-buttons button {display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;font-family:inherit;font-size:16px;font-weight:600;line-height:1;cursor:pointer}
.page-buttons .page-number[aria-current="page"] {background:var(--ink);color:var(--wash);font-weight:750}
.page-buttons button:not(:disabled):hover {background:color-mix(in srgb,currentColor 10%,transparent)}
.page-buttons button:focus-visible {outline:2px solid currentColor;outline-offset:2px}
.page-buttons button:disabled {opacity:.35;cursor:default}
.page-arrow svg {width:20px;height:20px}
.category-tabs, .page-numbers {position:relative;isolation:isolate;display:inline-flex;align-items:center;flex-wrap:nowrap;gap:4px;padding:4px;border:1px solid var(--line);border-radius:999px;background:color-mix(in srgb,var(--ink) 5%,transparent)}
.collection .category-tabs {width:max-content;max-width:100%;min-width:0;overflow-x:auto;scrollbar-width:thin;justify-self:start}
html .category-tabs button {position:relative;z-index:1;flex-shrink:0;white-space:nowrap;border-radius:999px;background:transparent;color:var(--ink);padding:10px 18px}
html .category-tabs button.active, html[data-color-mode="dark"] .category-tabs button.active {background:transparent;color:var(--wash)}
html .category-tabs button:hover:not(.active) {background:color-mix(in srgb,var(--ink) 8%,transparent)}
.page-numbers .page-number {position:relative;z-index:1}
.page-numbers .page-number[aria-current="page"]:hover {background:var(--ink)}
.capsule-thumb {position:absolute;left:0;z-index:0;display:block;border-radius:999px;background:var(--ink);pointer-events:none;transform-origin:left center}
html .site-footer .footer-inner > .footer-controls {display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto;color:var(--ink);line-height:1}
html .site-footer {bottom:calc(var(--viewport-bottom-inset,0px) + var(--footer-edge-gap,0px))}
.footer-color-mode {display:grid;place-items:center;width:42px;height:42px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink);cursor:pointer}
.footer-color-mode .mode-icon {width:21px;height:21px}
.footer-color-mode:hover {background:var(--accent-soft)}
.footer-color-mode:focus-visible, .category-tabs button:focus-visible {outline:2px solid var(--ink);outline-offset:2px}
.model-card .card-title-row {padding-bottom:10px}
html .favorite.selected .icon, html .detail-favorite.selected .icon, html .favorites-filter.active .icon {fill:currentColor}
html .favorite.selected {color:#b52f5d}
html[data-color-mode="dark"] .favorite.selected {color:#ff9cbe}
#toast {bottom:calc(var(--footer-height, 48px) + env(safe-area-inset-bottom) + var(--viewport-bottom-inset,0px) + var(--footer-edge-gap,0px) + 14px);border:1px solid rgb(255 255 255 / .18);border-radius:999px;background:rgb(35 32 37 / .78);color:#fff;padding:12px 24px;box-shadow:0 6px 20px rgb(0 0 0 / .12);transition:none;transform:translate(-50%,0)}
@media(max-width:760px){:root {--footer-edge-gap:8px}}
@media(max-width:600px) {
  .page-buttons {gap:2px}
  .page-buttons button {width:28px;height:36px;font-size:14px}
  .page-buttons .page-number {height:28px}
  .page-numbers {gap:2px;padding:3px}
  html .category-tabs button {padding:9px 14px}
}
@media(prefers-reduced-motion:reduce){#gallery-view {animation:none}}
html[data-motion="off"] #gallery-view {animation:none}
