:root {
  color-scheme: light;
  --paper: #f7f5f1;
  --ink: #282723;
  --muted: #726e66;
  --accent: #a79063;
  --gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button, a { touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.album { max-width: 1000px; margin: 0 auto; padding: 0 12px max(28px, env(safe-area-inset-bottom)); }
.album-header { padding: max(30px, env(safe-area-inset-top)) 4px 23px; }
.album-date { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--muted); font-size: 11px; letter-spacing: 1.3px; }
.album-date span { width: 3px; height: 3px; background: var(--accent); border-radius: 50%; }
.album-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h1 { margin: 0; font-family: "Songti SC", "Noto Serif CJK SC", "STSong", serif; font-size: 27px; font-weight: 500; line-height: 1.35; letter-spacing: 1px; }
.photo-count { flex-shrink: 0; margin: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gallery { position: relative; width: 100%; }
.photo { position: absolute; display: block; width: calc((100% - var(--gap)) / 2); overflow: hidden; border-radius: 5px; color: var(--muted); background: #e9e6df; cursor: zoom-in; }
.photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo:active { opacity: .82; }
.photo-failed { position: absolute; inset: 0; display: grid; place-content: center; padding: 12px; text-align: center; font-size: 12px; line-height: 1.8; }
.album-end { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 30px 0 0; font-size: 11px; letter-spacing: .7px; color: var(--muted); }
.album-end::before, .album-end::after { content: ""; width: 25px; height: 1px; background: #d9d3c8; }
.notice { padding: 30px 0; text-align: center; font-size: 14px; color: var(--muted); }

.viewer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; color: #fff; background: #080808; overflow: hidden; overscroll-behavior: contain; }
.viewer[open] { display: flex; flex-direction: column; }
.viewer:not([open]) { display: none; }
.viewer::backdrop { background: #080808; }
.viewer-toolbar { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; flex-shrink: 0; min-height: 60px; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left)); }
.viewer-count { margin: 0; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: 2px; color: #e0e0e0; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 50%; color: #fff; background: transparent; cursor: pointer; }
.icon-button:active { background: #343434; }
.icon-button:disabled { opacity: .24; cursor: default; }
.icon-button svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.viewer-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y pinch-zoom; }
.viewer-track { display: flex; width: 300%; height: 100%; transform: translate3d(-33.3333333333%, 0, 0); }
.viewer-slide { position: relative; display: flex; align-items: center; justify-content: center; flex: 0 0 33.3333333333%; min-width: 0; height: 100%; }
.viewer-slide img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; -webkit-user-drag: none; }
.viewer-slide.is-loading::after { content: ""; position: absolute; width: 24px; height: 24px; border: 1.5px solid #555; border-top-color: #ddd; border-radius: 50%; animation: spin .8s linear infinite; pointer-events: none; }
.viewer-slide.is-error { flex-direction: column; gap: 14px; }
.viewer-error { margin: 0; font-size: 14px; color: #c6c6c6; }
.retry-button { min-width: 88px; min-height: 44px; border: 1px solid #666; border-radius: 22px; padding: 8px 20px; color: #fff; background: transparent; cursor: pointer; }
.viewer-arrow { position: absolute; top: calc(50% - 22px); z-index: 1; background: #0008; }
.viewer-prev { left: max(8px, env(safe-area-inset-left)); }
.viewer-next { right: max(8px, env(safe-area-inset-right)); }
.viewer-hint { flex-shrink: 0; margin: 0; padding: 18px 16px max(22px, env(safe-area-inset-bottom)); text-align: center; font-size: 11px; letter-spacing: 1px; color: #a3a3a3; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 640px) {
  :root { --gap: 12px; }
  .album { padding-inline: 24px; }
  .album-header { padding-top: 46px; padding-bottom: 30px; }
  h1 { font-size: 34px; }
  .album-date { margin-bottom: 14px; }
  .photo { border-radius: 6px; }
}
@media (hover: hover) {
  .photo { transition: opacity .18s ease; }
  .photo:hover { opacity: .9; }
  .icon-button:not(:disabled):hover { background: #343434; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
