/* The site's theme (fonts, colors, header) comes from zedongpeng.com/assets/css/site.css.
   Only the gallery's own layout and its few extra colors are here. */
:root { --card: #ffffff; --ink: var(--fg); --ink-2: #3d3d3a; --faint: #a3a29b; --pill: var(--wash); --clay: var(--accent); --radius: 8px; }

/* The gallery is wider than a reading column; the site header and footer line up with it. */
main { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.zp-top, .zp-foot { max-width: 1220px; }

/* ----------------------------------------------------------------- intro */

.intro { padding: 72px 0 8px; max-width: 680px; }
.intro h1 { margin: 12px 0 20px; }
.intro .lead { margin: 0; }

.prompt { margin: 32px 0 0; text-wrap: pretty; }
.prompt p { margin: 0; }
.prompt .tag, .count, .meta, .kicker { font: 14px/1.55 var(--sans); color: var(--muted); }
.prompt .tag { margin-bottom: 6px; }
.prompt [lang="zh"], .prompt .en { font: 17px/1.6 var(--serif); }
.prompt .en { margin-top: 4px; color: var(--muted); }

/* ----------------------------------------------------------------- board */

.board { padding: 56px 0 64px; }

.count { margin: 0 0 28px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 44px 20px;
}

.card {
  display: block;
  align-self: start;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.meta { display: block; margin-bottom: 10px; }

.shot {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  outline: 1px solid var(--line);
  outline-offset: -1px;
}

.card:hover .shot { outline-color: var(--muted); }
.card:focus-visible { outline: none; }
.card:focus-visible .shot { outline: 2px solid var(--clay); }

.shot img, .shot iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.shot img { object-fit: cover; }

/* Live frames render at the poster's 960x720 and are scaled to fit. */
.shot iframe, .frame iframe {
  width: 960px;
  height: 720px;
  transform-origin: 0 0;
  pointer-events: none;
}

.shot.empty {
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 13px;
  background:
    repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--line) 60%, transparent) 10px 11px),
    var(--card);
}

.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  font: 12px/1 var(--sans);
  color: var(--ink);
  background: var(--pill);
  border: 1px solid var(--line);
}

.label { padding: 14px 0 0; }
.label .primary { font-weight: 600; font-size: 17px; line-height: 1.3; }
.label .secondary { margin-top: 3px; font-size: 14px; color: var(--muted); line-height: 1.4; }

/* --------------------------------------------------------------- harness */

.routes { padding: 48px 0 16px; border-top: 1px solid var(--line); }
.routes h2 { margin: 0; }

.model { padding-top: 36px; }
.model h3 { margin: 0 0 14px; }

.grid.harness { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 24px 16px; }
.grid.harness .label { padding-top: 10px; }
.grid.harness .label .secondary { margin: 0; color: var(--ink-2); }

.method { margin-top: 56px; padding: 48px 0 0; border-top: 1px solid var(--line); }
.method h2 { margin: 0 0 18px; }
.method p:not(.fine) { margin: 0; max-width: 680px; font: 17px/1.6 var(--serif); }
.method .fine { margin-top: 24px; }

.fine { margin: 40px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 680px; }

/* ---------------------------------------------------------------- detail */

dialog {
  width: min(1180px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px -24px rgb(20 20 19 / 0.4);
  overflow: hidden;
}

dialog::backdrop { background: rgb(20 20 19 / 0.55); }

.sheet { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }

.stage { background: var(--bg); padding: 24px; display: grid; place-items: center; }

.frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  outline: 1px solid var(--line);
}

.frame .empty { position: absolute; inset: 0; display: grid; place-items: center; color: #999; font-size: 14px; }

aside { padding: 28px 26px 22px; overflow-y: auto; max-height: calc(100vh - 32px); }

.kicker { margin: 0 0 8px; padding-right: 40px; }

aside h2 { margin: 0 0 20px; }

aside dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

aside dt { color: var(--muted); }
aside dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
aside dd small { color: var(--faint); font-size: 12px; }
aside dd.none { color: var(--faint); }

.links { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; margin: 0; }
.links button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.links button:hover { text-decoration-thickness: 2px; }

.close, .step {
  position: absolute;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pill);
  color: var(--ink);
  cursor: pointer;
  font: 400 20px/1 var(--sans);
}

.close { top: 12px; right: 12px; }
.step { top: 50%; transform: translateY(-50%); font-size: 24px; }
.step.prev { left: 10px; }
.step.next { left: calc(100% - 320px - 46px); }
.close:hover, .step:hover { border-color: var(--muted); }

@media (max-width: 860px) {
  .sheet { grid-template-columns: 1fr; }
  .stage { padding: 12px; }
  aside { max-height: none; }
  .step { top: 34%; }
  .step.next { left: auto; right: 10px; }
  dialog { max-height: calc(100% - 16px); overflow-y: auto; }
}

@media (max-width: 520px) {
  .intro { padding-top: 48px; }
  .board { padding-top: 40px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .label .primary { font-size: 15px; }
  .label .secondary { font-size: 12.5px; }
}
