.contact,
.bay {
  position: relative;
  isolation: isolate;
}
.contact::before,
.bay .rail::after {
  position: absolute;
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s ease;
}
.contact::before {
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle 320px at var(--light-x, 60%) var(--light-y, 20%), #91b5ff90, transparent);
}
.contact.light-active::before {
  opacity: .75;
}
.bay .rail {
  inset: 0;
  height: auto;
  background: none;
}
.bay .rail::before {
  position: absolute;
  content: "";
  inset: 1.1rem .3rem auto;
  height: .42rem;
  border-radius: .75rem;
  background: linear-gradient(#4b66ab,#223478);
}
.bay .rail::after {
  inset: 0;
  background: radial-gradient(circle 195px at var(--light-x, 50%) var(--light-y, 50%), #fff6fcab, transparent);
}
.bay.light-active .rail::after {
  opacity: 1;
}
.prizes {
  position: relative;
  z-index: 1;
}
.work-panel {
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  overflow: clip;
  background: var(--paper);
}
.work-panel > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: clamp(.9rem, 3.5vw, 2.2rem);
  color: var(--ink);
  background: #fffefa;
  transition: background .2s ease;
}
.work-panel > summary::-webkit-details-marker {
  display: none;
}
.work-panel > summary:hover {
  background: #eef3ff;
}
.work-panel > summary:focus-visible {
  outline-offset: -4px;
}
.work-panel-heading {
  min-width: 0;
}
.work-panel-heading h2 {
  font-size: clamp(1.75rem, 4.6vw, 3.5rem);
}
.work-panel-action {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding-inline: .8rem;
  border-radius: 3rem;
  background: #dfe9ff;
  color: #1c44a6;
  font-weight: 850;
  font-size: .9rem;
}
.work-panel-action::after {
  content: "展开 ＋";
}
.work-panel[open] .work-panel-action::after {
  content: "收起 −";
}
.work-panel-body {
  padding: 0 clamp(.7rem, 3.5vw, 2.2rem) clamp(1rem, 3.5vw, 2.2rem);
}
.work-panel[open] > .work-panel-body {
  animation: panel-in .38s ease both;
}
@keyframes panel-in {
  from { opacity: .62; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.projects > section:has(.work-panel) {
  padding: clamp(.5rem, 1.5vw, 1rem) 0;
  border: 0;
}
.projects > #feed:has(.work-panel) {
  padding-top: clamp(1.2rem, 3vw, 2rem);
}
.projects > #personal:has(.work-panel) {
  padding-bottom: clamp(2rem, 6vw, 4rem);
}
.result .work-panel {
  border: 0;
}
.result .work-panel > summary {
  pointer-events: none;
  background: transparent;
  padding-inline: 0;
}
.result .work-panel-action {
  display: none;
}
.result .work-panel-body {
  padding-inline: 0;
}
.motion-arrive {
  animation: arrive .62s cubic-bezier(.2,.65,.35,1) both;
}
@keyframes arrive {
  from { opacity: .4; transform: translateY(23px); }
  to { opacity: 1; transform: translateY(0); }
}
#tvc .gallery figure a {
  display: block;
  overflow: hidden;
  border-radius: .65rem;
}
.frame-stack {
  max-width: 42rem;
  margin: 1.1rem auto .4rem;
}
.stack-page {
  position: relative;
  isolation: isolate;
  perspective: 1100px;
  margin: 0 .4rem;
}
.stack-page::before,
.stack-page::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border: 1px solid #d4dbef;
  border-radius: .8rem;
  transform: translate(3px, 9px) rotate(1deg);
  background: #faebf6;
}
.stack-page::after {
  transform: translate(-3px, 5px) rotate(-1.4deg);
  background: #e9f0ff;
}
.stack-page figure {
  margin: 0;
  border: 1px solid #d4dbef;
  border-radius: .8rem;
  overflow: hidden;
  padding: .6rem;
  background: #fff;
  transform-origin: left center;
}
.stack-page figcaption {
  padding-top: .3rem;
  font-size: .86rem;
  color: var(--muted);
}
.stack-page img {
  height: clamp(220px, 46vw, 440px);
  object-fit: contain;
  border-radius: .3rem;
}
.stack-page .turn-in {
  animation: turn-in .48s cubic-bezier(.2,.68,.28,1) both;
}
@keyframes turn-in {
  from { transform: rotateY(-42deg) translateX(-5px); opacity: .4; }
  to { transform: rotateY(0); opacity: 1; }
}
.stack-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .7rem;
  margin-top: 1.2rem;
}
.stack-controls button {
  border: 1px solid #bacaf2;
  background: #e9f0ff;
  border-radius: 40px;
  padding: .42rem .84rem;
  color: #2147a6;
  font-size: .86rem;
  font-weight: 750;
  min-height: 44px;
}
.stack-controls button:hover {
  background: #d8e5ff;
}
.stack-controls output {
  color: #455271;
  min-width: 6ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
@media (hover: hover) and (pointer: fine) {
  :is(.feed-card, .reference-card, .buy-tier, .gallery figure) {
    transition: translate .25s ease, box-shadow .25s ease;
  }
  :is(.feed-card, .reference-card, .buy-tier, .gallery figure):is(:hover, :focus-within) {
    translate: 0 -5px;
    box-shadow: 0 12px 23px #263e7c1b;
  }
  #tvc .gallery figure img {
    transform: translateY(var(--image-offset, 0)) scale(1.06);
  }
}
@media (max-width: 750px) {
  #tvc .gallery figure img {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .motion-arrive,
  .stack-page .turn-in,
  .work-panel[open] > .work-panel-body {
    animation: none;
  }
  .contact::before,
  .bay .rail::after {
    display: none;
  }
  :is(.feed-card, .reference-card, .buy-tier, .gallery figure):is(:hover, :focus-within) {
    translate: none;
  }
  #tvc .gallery figure img {
    transform: none;
  }
}
