.gallery-page{background:var(--bg);display:block;min-height:100dvh}
.gallery-page::after{display:none}
.gallery-page .gallery-grid{max-width:none;width:auto;margin:0;padding:8px;columns:4;column-gap:8px;min-height:calc(100vh - 44px)}
.gallery-page .gallery-item{
  appearance:none;width:100%;display:block;position:relative;break-inside:avoid;
  margin:0 0 8px;padding:0;border:0;border-radius:4px;overflow:hidden;
  background:#e4e8ee;cursor:zoom-in;text-align:left;transform:translateZ(0)
}
.gallery-page .gallery-item img{
  width:100%;height:auto;display:block;border-radius:4px;
  filter:saturate(.86) contrast(1.02);
  transition:transform .5s cubic-bezier(.22,.61,.36,1),filter .5s cubic-bezier(.22,.61,.36,1),opacity .25s ease
}
.gallery-page .gallery-item[data-stage="tiny"] img{image-rendering:auto;filter:blur(1.2px) saturate(.78);transform:scale(1.015)}
.gallery-page .gallery-item[data-stage="thumb"] img{filter:saturate(.83) contrast(1.01)}
.gallery-page .gallery-item[data-stage="hd"] img{filter:saturate(.9) contrast(1.03)}
.gallery-page .gallery-item:hover img{transform:scale(1.035);filter:saturate(.98) contrast(1.06)}
.gallery-page .gallery-item:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.gallery-page .gallery-item::after{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(to bottom,transparent 55%,rgba(0,0,0,.34));
  opacity:0;transition:opacity .28s cubic-bezier(.22,.61,.36,1)
}
.gallery-page .gallery-item:hover::after,.gallery-page .gallery-item:focus-visible::after{opacity:1}
.gallery-page .caption{
  position:absolute;left:10px;right:10px;bottom:9px;z-index:2;color:#fff;
  font-size:.6rem;line-height:1.4;letter-spacing:.01em;text-shadow:0 1px 10px rgba(0,0,0,.45);
  opacity:0;transform:translateY(4px);transition:.28s cubic-bezier(.22,.61,.36,1)
}
.gallery-page .gallery-item:hover .caption,.gallery-page .gallery-item:focus-visible .caption{opacity:1;transform:translateY(0)}
.gallery-sentinel{height:1px;width:100%;pointer-events:none}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

.gallery-page .ga-nav{
  position:sticky;top:0;left:auto;right:auto;z-index:20;display:flex;opacity:1;
  min-height:44px;padding:9px 18px;overflow:hidden;background:#1a1a24;
  justify-content:space-between;align-items:center
}
.gallery-page .ga-nav::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(ellipse at 50% 50%,rgba(212,200,184,.025),transparent 70%);
  animation:gaNavGlow 5s ease-in-out infinite
}
.ga-home{position:relative;z-index:1;min-width:72px}
.gallery-page .ga-nav a,.gallery-page .ga-nav button{
  font-family:'SF Mono','Cascadia Code','Consolas','Liberation Mono',monospace;
  font-size:.68rem;color:rgba(255,255,255,.38);text-decoration:none
}
.gallery-page .ga-nav a{animation:gaBreathe 4s ease-in-out infinite}
.gallery-page .ga-nav a:hover,.gallery-page .ga-nav button:hover{color:rgba(255,255,255,.8)}
.ga-signature{
  flex:1;min-width:0;text-align:center;padding:0 12px;
  font-family:'STKaiti','KaiTi','Noto Serif SC','Songti SC',serif;
  font-size:clamp(.65rem,.9rem,1.8vw);line-height:1.3;letter-spacing:.06em;
  color:#d4c8b8;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  text-shadow:0 0 16px rgba(212,200,184,.2),0 0 40px rgba(212,200,184,.08);
  animation:signatureBreath 5s ease-in-out infinite
}
.ga-share-wrap{
  appearance:none;position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;
  width:72px;min-height:26px;padding:0;border:0;background:none;cursor:pointer;
  transition:color .2s,transform .25s ease
}
.ga-share-wrap.is-copied{color:#72b58e!important;transform:scale(.96)}
.ga-share-wrap svg{stroke:currentColor}
.ga-orb{
  position:absolute;top:50%;left:50%;width:2px;height:2px;border-radius:50%;
  background:rgba(255,255,255,.8);box-shadow:0 0 6px 2px rgba(255,255,255,.4);
  animation:poOrbit 60s linear infinite
}
.ga-orb2{width:3px;height:3px;animation-duration:3600s}
.ga-orb3{width:5px;height:5px;animation-duration:43200s;background:rgba(255,255,255,.9)}

.gallery-page .gallery-detail{
  position:fixed;inset:0;z-index:100;display:none;flex-direction:column;
  background:#090a0d;opacity:0;transition:opacity .25s ease
}
.gallery-page .gallery-detail.on{display:flex;opacity:1}
.gallery-page .gd-nav{
  position:absolute;inset:0 0 auto 0;z-index:10;display:flex;justify-content:space-between;
  padding:12px 16px;pointer-events:none;transition:opacity .3s
}
.gd-back-btn{
  appearance:none;display:inline-flex;align-items:center;justify-content:center;
  width:36px;height:36px;border:0;border-radius:50%;background:rgba(255,255,255,.04);
  color:rgba(255,255,255,.42);font-size:1.15rem;cursor:pointer;pointer-events:auto;
  transition:color .2s,background .2s
}
.gd-back-btn:hover{color:#fff;background:rgba(255,255,255,.1)}
.gd-stage{flex:1;display:flex;align-items:center;justify-content:center;padding:56px 16px 70px;overflow:hidden}
.gd-view{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%}
.gd-view img{max-width:100%;max-height:calc(100vh - 150px);object-fit:contain;cursor:pointer;transition:opacity .25s ease}
.gd-view img.loading{opacity:.42}.gd-view img.loaded{opacity:1}
.gd-loading{
  position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;
  border:2px solid rgba(255,255,255,.15);border-top-color:#d4c8b8;border-radius:50%;
  animation:gdSpin .65s linear infinite;pointer-events:none;opacity:0;transition:opacity .2s
}
.gd-loading.on{opacity:1}
.gallery-page .gd-bottom{
  position:absolute;inset:auto 0 0 0;display:grid;grid-template-columns:42px minmax(0,1fr) 42px;
  align-items:center;gap:6px;padding:10px 16px 16px;
  background:linear-gradient(transparent,rgba(0,0,0,.65));transition:opacity .3s
}
.gd-random-btn{
  appearance:none;display:inline-flex;align-items:center;justify-content:center;
  width:36px;height:36px;border:0;background:rgba(255,255,255,.04);border-radius:50%;
  color:rgba(255,255,255,.42);cursor:pointer;transition:color .2s,background .2s,transform .45s cubic-bezier(.22,.61,.36,1)
}
.gd-random-btn:hover{color:#fff;background:rgba(255,255,255,.1)}
.gd-caption{grid-column:2;min-width:0;padding:0 8px;color:rgba(255,255,255,.58);font-size:.7rem;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gd-random-btn{grid-column:3;position:relative}
.gd-random-btn svg{position:absolute;inset:7px;width:22px;height:22px;animation:randomGlow 2s ease-in-out infinite}
.gd-random-btn svg path{fill:rgba(212,200,184,.08);stroke:rgba(212,200,184,.35);stroke-width:.8}
.gd-random-btn span{position:relative;z-index:1;font-size:.72rem}
.gd-random-btn.is-spinning{transform:rotate(360deg) scale(.86);color:#d4c8b8;background:rgba(212,200,184,.12)}
.gallery-detail.focus .gd-nav,.gallery-detail.focus .gd-bottom{opacity:0;pointer-events:none}

@media(max-width:900px){.gallery-page .gallery-grid{columns:3}}
@media(max-width:640px){
  .gallery-page .gallery-grid{columns:2;padding:6px;column-gap:6px}
  .gallery-page .gallery-item{margin-bottom:6px}
  .gallery-page .ga-nav{padding:7px 10px;min-height:46px;overflow:visible}
  .ga-home,.ga-share-wrap{width:62px;min-width:62px}
  .ga-signature{
    padding:0 6px;font-size:.62rem;line-height:1.2;white-space:normal;text-overflow:clip;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical
  }
  .gd-stage{padding:50px 8px 68px}
  .gd-view img{max-height:calc(100dvh - 130px)}
  .gallery-page .gd-bottom{grid-template-columns:40px minmax(0,1fr) 40px;padding:8px 8px 12px}
  .gd-caption{font-size:.62rem;padding:0 4px}
}
@media(max-width:380px){
  .ga-home,.ga-share-wrap{width:54px;min-width:54px}
  .gallery-page .ga-nav a,.gallery-page .ga-nav button{font-size:.58rem}
  .ga-signature{font-size:.56rem;letter-spacing:.02em}
}
@media(prefers-reduced-motion:reduce){
  .ga-orb,.ga-signature,.gallery-page .ga-nav::after,.gd-random-btn svg{animation:none!important}
}

@keyframes gdSpin{to{transform:rotate(360deg)}}
@keyframes randomGlow{0%,100%{opacity:.35;transform:scale(.86)}50%{opacity:.9;transform:scale(1.1)}}
@keyframes signatureBreath{0%,100%{opacity:.72}50%{opacity:.92}}
@keyframes gaNavGlow{0%,100%{opacity:.35}50%{opacity:.9}}
@keyframes gaBreathe{0%,100%{color:rgba(255,255,255,.35)}50%{color:rgba(255,255,255,.65)}}
@keyframes poOrbit{
  0%{transform:translate(-50%,-50%) rotate(0deg) translateX(16px) rotate(0deg)}
  100%{transform:translate(-50%,-50%) rotate(360deg) translateX(16px) rotate(-360deg)}
}
