/* Scoped additions. The existing site owns the grid, cards, type and spacing. */
.album-card { cursor: pointer; }
.event-grid > a { display: block; color: inherit; text-decoration: none; }
.album-card:focus-visible, .album-dialog button:focus-visible, .album-button:focus-visible {
  outline: 3px solid #e60000; outline-offset: 5px;
}
.album-card .event-title-overlay, .album-card .video-title-overlay {
  overflow-wrap: anywhere; text-align: left;
}
.album-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.album-card.video-item .album-card-title { -webkit-line-clamp: 2; }
.album-play {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  color: #fff; font-size: 42px; text-shadow: 0 2px 12px #0008; pointer-events: none;
}
.album-status { display: flex; gap: 16px; align-items: center; padding: 24px 0; font-size: 16px; }
.album-status[hidden] { display: none; }
.album-button { color: inherit; border: 1px solid #aaa; background: transparent; padding: 8px 18px; border-radius: 6px; font: inherit; cursor: pointer; }
.album-button:disabled { opacity: .5; cursor: wait; }
.album-dialog {
  position: fixed; inset: 0; margin: 0; box-sizing: border-box; width: 100vw; max-width: none;
  height: 100dvh; max-height: none; padding: 0; border: 0; color: #fff; background: rgba(0,0,0,.94);
}
.album-dialog[open] { display: flex; flex-direction: column; }
.album-dialog::backdrop { background: rgba(0,0,0,.92); }
.album-dialog { background: #0a0a0a; font-family: 'Noto Sans CJK SC', system-ui, sans-serif; }
.album-dialog [hidden] { display: none !important; }
.album-dialog-header { position: relative; flex: 0 0 auto; padding: 22px 32px 0; border-bottom: 1px solid #ffffff20; background: #0a0a0af0; }
.album-title-line { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 48px 21px; }
.album-dialog-title { margin: 0; font-size: 20px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.album-total { color: #aaa; white-space: nowrap; font-size: 13px; }
.album-close, .album-picker-close { position: absolute; top: 14px; right: 24px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: none; color: #fff; font-size: 32px; line-height: 1; cursor: pointer; }
.album-close:hover, .album-picker-close:hover { background: #ffffff12; }
.album-view-context:empty { display: none; }
.album-dialog-content { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 18px 32px 32px; }
.album-gallery { width: 100%; max-width: 1376px; align-self: flex-start; }
.album-gallery-meta { display: flex; justify-content: space-between; gap: 20px; margin: 0 0 16px; color: #999; font-size: 12px; }
.album-gallery-meta > span:first-child { font-size: 14px; color: #ddd; }
.album-category-bar { display: flex; gap: 24px; max-width: 1376px; margin: auto; }
.album-tabs { display: flex; gap: 32px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.album-tabs::-webkit-scrollbar { display: none; }
.album-tab { position: relative; flex-shrink: 0; border: 0; background: transparent; padding: 15px 0 17px; white-space: nowrap; color: #a9a9a9; font: inherit; font-size: 15px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.album-tab small { margin-left: 8px; color: #888; font-size: 12px; }
.album-tab[aria-selected=true] { color: #fff; font-weight: 500; }
.album-tab[aria-selected=true]::after { content: ''; position: absolute; height: 3px; left: 0; right: 0; bottom: 0; border-radius: 2px; background: #e60000; }
.album-tab[aria-selected=true] small { color: #eee; }
.album-category-expand { flex-shrink: 0; border: 0; background: transparent; font: inherit; font-size: 13px; color: #ccc; display: flex; align-items: center; gap: 12px; padding: 0 0 0 16px; box-shadow: -12px 0 12px #0a0a0a; cursor: pointer; }
.album-category-expand span { font-size: 21px; }
.album-message { text-align: center; }
.album-photo-grid { align-self: flex-start; display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 12px; width: 100%; }
.album-photo { aspect-ratio: 4/3; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: #222; }
.album-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-photo.album-image-ready::after { content: '查看大图'; position: absolute; inset: auto 0 0; padding: 24px 10px 12px; background: linear-gradient(transparent,#000b); color: #fff; font: 12px/1.6 sans-serif; opacity: 0; pointer-events: none; }
html[lang="en"] .album-photo.album-image-ready::after { content: 'View photo'; }
.album-photo.album-image-ready:hover::after, .album-photo.album-image-ready:focus-visible::after { opacity: 1; }
.album-photo, .album-lightbox, .album-card .event-image-container, .album-card .video-image-container { position: relative; }
img.album-image-pending { opacity: 0; }
.album-image-pending ~ .album-play { visibility: hidden; }
.album-image-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; border-radius: inherit; pointer-events: none;
  background: #222; color: #ddd; font: 14px/1.6 sans-serif;
}
.album-image-loading::before {
  content: ''; width: 22px; height: 22px; border: 2px solid #ffffff30; border-top-color: #ddd;
  border-radius: 50%; animation: album-image-spin 1s linear infinite;
}
.album-lightbox .album-image-loading { background: transparent; }
@keyframes album-image-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .album-image-loading::before { animation: none; } }
.album-photo img.album-image-failed, .album-lightbox img.album-image-failed, .album-card img.album-image-failed, .event-grid img.album-image-failed { display: none; }
.album-image-error { position: absolute; inset: 0; display: grid; place-content: center; box-sizing: border-box; padding: 20px; color: #fff; background: #333; font: 14px/1.6 sans-serif; cursor: pointer; text-align: center; border-radius: 8px; }
.album-player { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; }
.album-viewer { background: #050505; }
.album-viewer .album-dialog-header { padding: 18px 96px 18px 32px; background: #050505; }
.album-viewer .album-title-line { display: block; padding: 3px 100px 0 0; }
.album-viewer .album-dialog-title { font-size: 16px; line-height: 1.6; font-weight: 400; }
.album-view-context { font-size: 12px; color: #aaa; }
.album-viewer .album-total { position: absolute; right: 96px; top: 50%; transform: translateY(-50%); }
.album-viewer .album-dialog-content { padding: 0; flex-direction: column; overflow: hidden; }
.album-lightbox { box-sizing: border-box; display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; width: 100%; padding: 20px 96px; }
.album-lightbox img { width: auto; height: auto; min-width: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.album-nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); height: 52px; width: 52px; padding: 0; border: 1px solid #ffffff20; border-radius: 50%; background: #ffffff08; color: #fff; font: 38px/1 system-ui; cursor: pointer; }
.album-nav:hover { background: #ffffff20; }
.album-prev { left: 24px; } .album-next { right: 24px; }
.album-viewer-footer { position: relative; flex-shrink: 0; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px 36px 24px; border-top: 1px solid #ffffff15; }
.album-photo-details { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.album-photo-details strong { font-weight: 400; font-size: 15px; }
.album-photo-details span { color: #999; font-size: 12px; }
.album-download { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 46px; padding: 0 21px; border: 1px solid #fff; border-radius: 7px; background: #fff; color: #151515; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.album-download:hover { background: #eee; }
.album-download:disabled { opacity: .7; cursor: wait; }
.album-download svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.album-download-message { position: absolute; bottom: calc(100% + 16px); left: 50%; transform: translateX(-50%); margin: 0; background: #fff; color: #222; padding: 12px 20px; border-radius: 7px; font-size: 13px; max-width: calc(100% - 32px); text-align: center; }
.album-category-dialog { box-sizing: border-box; width: 400px; max-width: calc(100% - 32px); max-height: 80dvh; overflow: auto; border: 1px solid #444; border-radius: 12px; background: #191919; color: #fff; padding: 20px; font: inherit; }
.album-category-dialog::backdrop { background: #0009; }
.album-category-dialog header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.album-category-dialog h2 { margin: 0; font-size: 18px; font-weight: 500; }
.album-picker-close { position: static; }
.album-category-option { display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 14px 12px; border: 0; border-top: 1px solid #ffffff10; background: none; color: inherit; font: inherit; width: 100%; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.album-category-option small { display: block; color: #999; font-size: 12px; margin-top: 3px; }
.album-category-option.selected { color: #ff6258; }
.album-category-option:focus-visible, .album-picker-close:focus-visible { outline: 2px solid #ff5047; outline-offset: 2px; }
/* The album gallery is a document page; only individual photos use a dialog. */
body.album-route { margin: 0; background: #0a0a0a; color: #fff; font-family: 'Noto Sans CJK SC', system-ui, sans-serif; }
.album-page { padding-top: var(--site-header-height); min-height: 100dvh; box-sizing: border-box; }
.album-page [hidden] { display: none !important; }
.album-back { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 44px; margin: 12px 32px 0; color: #bbb; text-decoration: none; font-size: 14px; }
.album-back:hover { color: #fff; }
.album-back:focus-visible, .album-page button:focus-visible { outline: 2px solid #ff5047; outline-offset: 3px; }
.album-page > .album-dialog-header { position: sticky; top: var(--site-header-height); z-index: 20; backdrop-filter: blur(8px); }
.album-page > .album-dialog-content { overflow: visible; min-height: 160px; }
.album-page .album-title-line { padding-right: 0; padding-left: 0; }
body:has(.album-dialog[open]) { overflow: hidden; }
@media (max-width: 768px) {
  .album-page { padding-top: 0; min-height: calc(100dvh - var(--site-header-height)); }
  .album-back { margin: 8px 16px 0; font-size: 13px; }
  .album-card.video-item .video-title-overlay { font-size: 11px; line-height: 1.35; padding: 20px 7px 7px; }
  .album-card .album-play { font-size: 24px; top: 35%; }
  .album-dialog-header { padding: 16px 16px 0; }
  .album-title-line { display: block; padding: 0 40px 12px 0; }
  .album-dialog-title { font-size: 16px; line-height: 1.55; }
  .album-total { display: block; font-size: 12px; margin-top: 5px; }
  .album-close { right: 7px; top: 8px; }
  .album-category-bar { gap: 8px; }
  .album-tabs { gap: 24px; }
  .album-tab { font-size: 14px; max-width: 180px; padding: 12px 0 14px; }
  .album-tab small { margin-left: 5px; }
  .album-category-expand { width: 36px; overflow: hidden; display: block; font-size: 0; padding: 0; box-shadow: -8px 0 10px #0a0a0a; }
  .album-category-expand span { font-size: 22px; }
  .album-dialog-content { padding: 12px 12px 24px; }
  .album-gallery-meta { margin-bottom: 12px; display: block; font-size: 11px; line-height: 1.8; }
  .album-gallery-meta > span:first-child { display: none; }
  .album-photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .album-photo { aspect-ratio: 1.15; border-radius: 7px; }
  .album-image-loading { font-size: 12px; gap: 8px; }
  .album-viewer .album-dialog-header { box-sizing: border-box; min-height: 78px; padding: 12px 60px 12px 16px; }
  .album-viewer .album-title-line { padding: 3px 0 0; }
  .album-viewer .album-dialog-title { font-size: 13px; }
  .album-view-context { font-size: 11px; }
  .album-viewer .album-total { top: auto; right: 14px; bottom: 12px; transform: none; }
  .album-viewer .album-close { height: 34px; }
  .album-lightbox { padding: 20px 8px; }
  .album-nav { width: 38px; height: 44px; font-size: 30px; border: 0; border-radius: 7px; background: #0008; }
  .album-prev { left: 8px; } .album-next { right: 8px; }
  .album-viewer-footer { padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); gap: 16px; align-items: stretch; flex-direction: column; }
  .album-photo-details { gap: 4px; } .album-photo-details strong { font-size: 14px; }
  .album-download { height: 46px; width: 100%; }
  .album-category-dialog { margin: auto 0 0; max-width: none; width: 100%; border-radius: 16px 16px 0 0; padding: 18px 16px 26px; }
}
