/* 作品与图注同属一个版心。手机依次看照片、题签和短注，横屏并排。 */
:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #1b1b19;
  --quiet: #60605a;
  --rule: #deddd8;
  --gutter: clamp(20px, 4.5vw, 76px);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--type-reading);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, figure { margin: 0; }
a, button { font: inherit; color: inherit; touch-action: manipulation; }
a { text-decoration: none; }
button { padding: 0; background: transparent; border: 0; cursor: pointer; }
button:disabled { color: #888781; cursor: default; }
button, .back { transition: opacity .15s, transform .15s; }
button:not(:disabled):active, .back:active { transform: scale(.98); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
@media (hover: hover) {
  button:not(:disabled):hover, .back:hover { opacity: .7; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.viewer { margin: auto; max-width: 1600px; padding: 0 var(--gutter) calc(var(--dock-height) + 24px); }
.mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid var(--rule);
}
.back, .list-open, .switch-theme, .pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  font: 500 14px/1.4 var(--type-ui);
}
.icon { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.back { margin-left: -4px; }
.spread { margin: auto; max-width: 1220px; }
.plate, .caption { min-width: 0; }
.figure {
  --photo-ratio: 1.4;
  height: min(calc((100vw - 2 * var(--gutter)) * var(--photo-ratio)), max(190px, calc(100svh - var(--dock-height) - 220px)));
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.image-mat { width: 100%; height: 100%; display: grid; place-items: center; }
.image-mat img { width: 100%; height: 100%; min-width: 0; min-height: 0; display: block; object-fit: contain; pointer-events: none; }
.image-note { grid-area: 1 / 1; color: var(--quiet); }
.image-note:empty, .desc:empty { display: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; }
.pager button { gap: 4px; min-width: 64px; color: var(--quiet); font-size: 13px; }
.pager button:disabled { opacity: .55; }
.counter { min-width: 56px; text-align: center; color: var(--quiet); font: 500 13px/1.35 var(--type-figures); font-variant-numeric: tabular-nums; letter-spacing: .035em; white-space: nowrap; }
.desc { font: 475 13px/1.55 var(--type-ui); letter-spacing: .04em; color: var(--quiet); }
.heading h1 { margin: .2em 0 0 -.045em; font: 760 clamp(36px, 5.4vw, 74px)/1.14 var(--type-ui); letter-spacing: -.048em; text-wrap: balance; overflow-wrap: anywhere; }
.story-section { max-width: 27em; }
.story-section p { font: 400 clamp(15px, 1.2vw, 17px)/1.85 var(--type-reading); color: #4b4b46; text-wrap: pretty; }
.story-section p + p { margin-top: .8em; }
.location-note { margin-top: 14px; border-top: 1px solid var(--rule); }
.location-note summary { cursor: pointer; padding: 11px 0; font: 500 14px/1.55 var(--type-ui); }
.location-note p { font-size: 14px; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--rule); }
.switch-theme { gap: 11px; }
.dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: 78svh;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
}
.dialog::backdrop { background: rgb(20 20 18 / .46); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 18px; border-bottom: 1px solid var(--rule); }
.dialog-head h2 { font: 660 clamp(20px, 3vw, 26px)/1.35 var(--type-ui); letter-spacing: -.035em; }
.close { width: 44px; height: 44px; flex: none; font: 380 28px/1 var(--type-ui); }
.theme-list { max-height: 62svh; overflow-y: auto; padding: 0 18px 8px; }
.theme-list button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 55px; padding: 6px 0; font: 500 16px/1.4 var(--type-ui); }
.theme-list button + button { border-top: 1px solid var(--rule); }
.theme-list button[aria-current] { font-weight: 700; }
.theme-list img { width: 44px; height: 44px; object-fit: contain; }
.now { margin-left: auto; font: 450 12px/1.4 var(--type-ui); color: var(--quiet); white-space: nowrap; }
.empty { margin: 18vh auto; padding: 24px; text-align: center; }
.empty a { margin-top: 12px; text-decoration: underline; }
.global-dock { background: #fff; border-color: var(--rule); }
.global-dock a { color: var(--quiet); }
.global-dock a[aria-current] { color: var(--ink); }

@media (max-width: 799px) and (orientation: portrait), (max-width: 619px) {
  .mast { min-height: 48px; }
  .spread { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "picture picture" "title paging" "themes themes" "note note"; padding-top: 15px; }
  .plate, .caption { display: contents; }
  .figure { grid-area: picture; }
  .heading { grid-area: title; margin-block: 13px 10px; }
  .heading h1 { font-size: clamp(30px, 8.3vw, 46px); }
  .pager { grid-area: paging; align-self: end; margin-bottom: 4px; gap: 0; }
  .pager button { min-width: 40px; font-size: 18px; }
  .counter { min-width: 49px; }
  .page-label { display: none; }
  .foot { grid-area: themes; }
  .story-section { grid-area: note; margin: 18px 0 0; padding: 0 0 8px; }
}
@media (min-width: 800px), (orientation: landscape) and (min-width: 620px) {
  .spread {
    min-height: calc(100svh - var(--dock-height) - 85px);
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(220px, 1fr);
    align-items: center;
    column-gap: clamp(28px, 5vw, 88px);
    padding-block: clamp(22px, 4vh, 52px);
  }
  .figure { height: clamp(190px, calc(100svh - var(--dock-height) - 210px), 790px); }
  .caption { max-width: 430px; }
  .pager { margin-top: 7px; }
  .story-section { margin-top: clamp(18px, 2.7vw, 38px); }
  .foot { margin-top: clamp(20px, 3.4vw, 46px); }
}
@media (orientation: landscape) and (max-height: 550px) {
  .mast { min-height: 44px; }
  .spread { padding-block: 10px; align-items: start; }
  .figure { height: max(160px, calc(100svh - var(--dock-height) - 118px)); }
  .heading h1 { font-size: 30px; }
  .caption { display: flex; flex-direction: column; }
  .caption .foot { order: 1; }
  .caption .story-section { order: 2; }
  .story-section, .foot { margin-top: 12px; }
  .story-section p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.heading .theme-hook {margin:10px 0 0;color:#42392e;font:540 clamp(16px,1.4vw,21px)/1.55 var(--type-reading);text-wrap:pretty}
