#mat.image-mat {
  container-type: size;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
#mat #open-album {
  position: relative;
  grid-area: 1 / 1;
  display: block;
  width: min(100cqw, calc(100cqh / var(--photo-ratio, 1)));
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: pan-y pinch-zoom;
}
#mat #open-album:not(:disabled) { cursor: zoom-in; }
#mat #open-album:hover, #mat #open-album:active { opacity: 1; transform: none; }
#mat #open-album img { display: block; width: 100%; height: auto; pointer-events: auto; }
#mat #open-album::after {
  content: "展开整套"; position: absolute; right: 8px; bottom: 8px; padding: 4px 9px;
  color: white; background: rgb(25 22 18 / .68); border-radius: 15px;
  font: 500 12px/1.5 var(--type-ui, sans-serif); opacity: 0; pointer-events: none;
}
#mat #open-album:not(:disabled):is(:hover,:focus-visible)::after { opacity: 1; }
@media (hover: none) { #mat #open-album:not(:disabled)::after { opacity: 1; } }

html:has(#studio-album[open]), body:has(#studio-album[open]) { overflow: hidden; }
#studio-album {
  --album-paper: #faf9f6;
  --album-ink: #211f1c;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--album-paper);
  color: var(--album-ink);
  overflow: hidden;
  font-family: var(--type-ui, -apple-system, "PingFang SC", sans-serif);
}
#studio-album, #studio-album * { box-sizing: border-box; }
#studio-album::backdrop { background: var(--album-paper); }
#studio-album[open] { display: flex; flex-direction: column; animation: none; }
#studio-album [hidden] { display: none !important; }
#studio-album button { font: inherit; color: inherit; cursor: pointer; }
#studio-album button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
#studio-album .album-bar, #studio-album .album-steps {
  display: flex; align-items: center; gap: 16px; flex: none;
}
#studio-album .album-bar {
  z-index: 2;
  padding: max(10px, env(safe-area-inset-top)) clamp(14px, 3vw, 48px) 10px;
  min-height: 62px;
  background: var(--album-paper);
  border-bottom: 1px solid #dedbd6;
}
#studio-album .album-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: 16px;
}
#studio-album .album-count { color: #635f59; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#studio-album .album-action {
  flex: none; min-height: 40px; padding: 6px 14px; border: 1px solid #c9c5be;
  background: transparent; border-radius: 24px; font-size: 14px; white-space: nowrap;
}
#studio-album .album-action:disabled { opacity: .4; cursor: default; }
#studio-album .album-back { margin-left: auto; }
#studio-album .album-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
#studio-album .studio-album-grid {
  --album-gap: clamp(8px, 1vw, 17px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100%; gap: var(--album-gap);
  padding: clamp(14px, 2vw, 32px); padding-bottom: max(clamp(14px, 2vw, 32px), env(safe-area-inset-bottom));
}
#studio-album .album-row {
  display: grid; flex: none; gap: var(--album-gap); max-width: 100%;
  grid-template-rows: minmax(0, 1fr);
}
#studio-album .album-tile {
  display: grid; grid-template: minmax(0, 1fr) / minmax(0,1fr); place-items: center;
  padding: 0; width: 100%; height: 100%; min-height: 0; min-width: 0;
  border: 0; border-radius: 0; background: transparent; overflow: visible; cursor: zoom-in;
}
#studio-album .album-tile:hover, #studio-album .album-tile:active { opacity: 1; transform: none; }
#studio-album .album-tile img, #studio-album .studio-album-large {
  width: 100%; height: 100%; display: block; min-height: 0; min-width: 0; object-fit: contain;
}
#studio-album .album-single { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 16px; }
#studio-album .album-mat { flex: 1; min-height: 0; position: relative; display: grid; grid-template: minmax(0,1fr) / minmax(0,1fr); }
#studio-album .album-mat > * { grid-area: 1 / 1; }
#studio-album .album-status { place-self: center; text-align: center; margin: 0; color: #635f59; font-size: 14px; }
#studio-album .album-steps { justify-content: center; padding: 12px 0 max(2px, env(safe-area-inset-bottom)); }
#studio-album .album-flight { position: fixed; z-index: 1; object-fit: contain; pointer-events: none; max-width: none; }
@media (max-width: 700px) {
  #studio-album .album-bar { min-height: 54px; gap: 8px; }
  #studio-album .studio-album-grid { padding-inline: 12px; }
  #studio-album .album-single { padding: 10px; }
}
