:root {
  color-scheme: light;
  --paper: #e4e5e0;
  --ink: #191917;
  --dim: #65675f;
  --line: rgba(25, 25, 23, 0.18);
  --stage: #0d0c0a;
  --focus: #d6b16f;
  font: 13px/1.45 "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--paper); }
body { margin: 0; overflow: hidden; background: var(--paper); color: var(--ink); }
button, a { color: inherit; font: inherit; }
button { cursor: pointer; }
::selection { background: var(--ink); color: var(--paper); }

.topbar {
  height: 84px;
  padding: 0 30px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-bottom: 1px solid rgba(25, 25, 23, 0.08);
}
.about {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  transition: background-color 160ms ease, color 160ms ease;
}
.about:hover { background: var(--ink); color: var(--paper); }
.about svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

main { padding: 18px 24px; }
.scene-shell {
  position: relative;
  height: calc(100dvh - 120px);
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: var(--stage);
  box-shadow: 0 24px 55px rgba(41, 35, 27, 0.22);
}
.scene-shell::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28); pointer-events: none; }
#scene { width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
#scene.is-pointer { cursor: pointer; }
#scene.is-dragging { cursor: grabbing; }
#scene:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.scene-note {
  position: absolute;
  left: 18px;
  bottom: 15px;
  margin: 0;
  color: rgba(244, 238, 225, 0.54);
  font-size: 11px;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.scene-index {
  position: absolute;
  right: 18px;
  bottom: 15px;
  display: flex;
  gap: 14px;
  color: rgba(244, 238, 225, 0.54);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #f2ede4;
  place-items: center;
  overflow: hidden;
}
.lightbox[open] { display: grid; }
.lightbox::backdrop { background: radial-gradient(60% 55% at 50% 46%, rgba(255, 243, 220, 0.18), rgba(7, 6, 5, 0.95) 70%); }
.lightbox figure {
  margin: 0;
  padding: clamp(14px, 4.5vmin, 44px) clamp(14px, 4.5vmin, 44px) clamp(10px, 2.6vmin, 24px);
  border-radius: clamp(8px, 1.6vmin, 16px);
  background: linear-gradient(#1c1a17, #11100e);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  animation: lift 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.photo-frame { position: relative; }
.lightbox img {
  display: block;
  width: min(80vw, 1100px, 64vh * var(--aspect, 1.5));
  max-height: 64vh;
  aspect-ratio: var(--aspect, 1.5);
  object-fit: contain;
  border-radius: 2px;
  background: #080706;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.photo-frame > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #191917;
  font-size: clamp(34px, 7vmin, 80px);
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}
.lightbox figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 12px; color: rgba(242, 237, 228, 0.64); }
.lightbox strong { color: #f2ede4; font-weight: 500; }
.lightbox button {
  position: absolute;
  isolation: isolate;
  overflow: hidden;
  width: auto;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid rgba(228, 229, 224, 0.42);
  border-radius: 6px;
  background: rgba(13, 12, 10, 0.9);
  color: #f2ede4;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: border-color 180ms ease, color 180ms ease, transform 140ms ease;
}
.lightbox button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox .prev::before { transform-origin: right; }
.lightbox button:hover { border-color: var(--paper); color: var(--ink); }
.lightbox button:hover::before { transform: scaleX(1); }
.lightbox button:active { transform: translateY(1px); }
.lightbox button:focus-visible { outline: 1px solid rgba(242, 237, 228, 0.82); outline-offset: 3px; }
.about:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.lightbox button span, .lightbox button svg { position: relative; z-index: 1; }
.lightbox button svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox .prev:hover svg { transform: translateX(-4px); }
.lightbox .next:hover svg { transform: translateX(4px); }
.lightbox .close:hover svg { transform: rotate(90deg); }
.lightbox .close { top: 22px; right: 22px; }
.lightbox .close svg { width: 15px; }
.lightbox .prev, .lightbox .next { top: calc(50% - 23px); min-width: 116px; }
.lightbox .prev { left: 22px; }
.lightbox .next { right: 22px; }

.help {
  position: fixed;
  z-index: 4;
  top: 72px;
  right: 30px;
  width: min(350px, calc(100vw - 40px));
  padding: 26px 50px 26px 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 22px 60px rgba(35, 30, 23, 0.18);
}
.help p { margin: 0; color: #514d45; line-height: 1.8; }
.help button { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 23px; }
@keyframes lift { from { transform: var(--from, scale(0.9)); opacity: 0.3; } }

@media (max-width: 760px) {
  .topbar { height: 68px; padding: 0 16px; }
  main { padding: 10px 8px 8px; }
  .scene-shell { height: calc(100dvh - 86px); min-height: 0; border-radius: 14px; }
  .scene-note { left: 12px; bottom: 10px; }
  .scene-index { right: 12px; bottom: 10px; }
  .lightbox button { height: 42px; gap: 9px; padding: 0 12px; }
  .lightbox .close { top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }
  .lightbox .prev, .lightbox .next {
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: min(124px, calc(50vw - 24px));
    min-width: 0;
  }
  .lightbox .prev { left: max(12px, env(safe-area-inset-left)); }
  .lightbox .next { right: max(12px, env(safe-area-inset-right)); }
  .help { top: 62px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .about, .lightbox button, .lightbox button::before, .lightbox button svg, .lightbox figure { transition: none; animation: none; }
}
