/* 月光相簿独立样式，不改动最终秘密信件所用的 .letter-dialog。 */
.album-cover {
  position: relative; width: min(100%, 310px); aspect-ratio: 4 / 5; justify-self: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 35px 24px; border: 1px solid #b38c584f; border-radius: 3px 8px 8px 3px;
  background: linear-gradient(90deg, #07060e, #312139 6%, #191220 9%, transparent 12%),
    radial-gradient(ellipse at 65% 20%, #62506c35, transparent 65%), #18111f;
  box-shadow: 5px 5px 0 #ba9a6a26, 9px 9px 0 #17121e, 0 25px 60px #0007;
  transform: rotate(4deg); transition: transform .6s, box-shadow .6s;
}
.album-cover:hover { transform: rotate(0) translateY(-5px); box-shadow: 5px 5px 0 #ba9a6a36, 9px 9px 0 #17121e, 0 30px 70px #b4883c13; }
.album-cover-border { position: absolute; inset: 16px 16px 16px 26px; border: 1px solid #bd986740; pointer-events: none; }
.album-cover-moon { width: 70px; height: 70px; margin: 0 0 32px; border-radius: 50%; box-shadow: inset -15px -7px 0 -2px #dac9ad; filter: drop-shadow(0 0 18px #d3c1dd33); transform: rotate(-28deg); }
.album-cover-title { color: #e4c9a2; font-size: 27px; letter-spacing: .2em; padding-left: .2em; }
.album-cover-dedication { margin-top: 18px; color: #a18b9c; font-size: 11px; letter-spacing: .2em; }
.album-cover-foot { margin-top: 48px; color: #a58c6e; font-size: 10px; letter-spacing: .1em; }
.album-cover-foot span { padding-left: 10px; }
.album-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100vh; height: 100svh; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; isolation: isolate; background: #090711; }
.album-dialog[open] { display: flex; flex-direction: column; }
.album-dialog::before { inset: 14px; border-color: #d9b77f1c; z-index: 3; }
.album-dialog .close-dialog { position: absolute; z-index: 12; top: max(22px, env(safe-area-inset-top)); right: max(24px, env(safe-area-inset-right)); width: 38px; height: 38px; }
.album-ambience { position: absolute; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 17% 33%, #2e2248, transparent 53%), radial-gradient(ellipse at 84% 69%, #241b38, transparent 48%), linear-gradient(155deg, #0c0a19, #110c20 55%, #08070e); }
.album-nebula { position: absolute; inset: -12%; opacity: .75; pointer-events: none; animation-play-state: paused; }
.album-nebula-far { background: radial-gradient(ellipse at 24% 30%, #806b9d5c, #5c4b8040 20%, transparent 49%), radial-gradient(ellipse at 76% 65%, #8a647d40, #594b7b25 24%, transparent 50%); animation: album-nebula-far 42s ease-in-out infinite alternate; animation-play-state: paused; }
.album-nebula-near { background: radial-gradient(ellipse at 65% 24%, #aa88ad36, transparent 37%), radial-gradient(ellipse at 43% 76%, #566a9a38, transparent 42%), radial-gradient(ellipse at 82% 52%, #bc966c1f, transparent 32%); animation: album-nebula-near 32s ease-in-out infinite alternate; animation-play-state: paused; }
.album-dialog[open]:not(.is-viewing) .album-nebula { animation-play-state: running; }
.album-night-moon { position: absolute; top: 8%; right: 12%; width: clamp(85px, 10vw, 150px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e0d5ce19, #8c7d9d05 62%, transparent 72%); opacity: .3; }
.album-night-fog { position: absolute; width: 120%; left: -10%; bottom: -13%; height: 30%; background: radial-gradient(ellipse at 30% 50%, #b6a5c411, transparent 50%), radial-gradient(ellipse at 70% 70%, #ad98bd09, transparent 50%); animation: album-fog 24s ease-in-out infinite alternate; }
#album-stars, #album-gold-dust { position: absolute; inset: 0; }
#album-stars { display: block; width: 100%; height: 100%; pointer-events: none; }
#album-gold-dust i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #ffe0a2; box-shadow: 0 0 10px #eeb66e; opacity: 0; animation: album-gold 1.5s ease-out var(--delay) both; }
.album-header { flex: 0 0 auto; text-align: center; padding: 28px 65px 8px; }
.album-eyebrow { margin: 0 0 18px; font-size: 10px; letter-spacing: .25em; color: #ad906d; }
.album-header h2 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 36px); letter-spacing: .16em; }
.album-header > p:last-child { color: #a99aaf; font-size: 12px; line-height: 1.9; margin: 0; letter-spacing: .05em; }
.album-empty { min-height: 300px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: radial-gradient(ellipse, #8e72991c, transparent 65%); padding: 32px 0 20px; }
.album-empty-moon { font: 60px Georgia, serif; color: #cfb68d; text-shadow: 0 0 35px #dfc0ef55; }
.album-empty p { margin: 22px 0 12px; color: #d1c0c9; font-size: 17px; letter-spacing: .1em; }
.album-empty > span:not(.album-empty-moon):not(.album-empty-line) { font-size: 12px; line-height: 2; color: #99899f; }
.album-empty-line { width: 70px; height: 1px; margin-top: 35px; background: linear-gradient(90deg, transparent, #c9a371, transparent); }
.album-gallery { display: flex; flex: 1; min-height: 0; flex-direction: column; padding: 0 28px max(22px, env(safe-area-inset-bottom)); }
.album-constellation { position: relative; width: min(100%, 1600px); margin: 0 auto; flex: 1; min-height: 0; isolation: isolate; }
.album-grid { position: absolute; inset: 0; z-index: 2; }
/* 主体、体积光、光丝、星尘分开绘制。装饰层始终不拦截照片点击。 */
.album-sculpture { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 1; transition: opacity 1.6s ease; }
.album-sculpture-vector { position: absolute; overflow: visible; z-index: 1; }
/* 外围星轨独立成层，局限在相簿场景内；遮罩为爱心主体保留安全带。 */
.album-orbital-space { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1.6s ease; }
.album-orbital-vector { display: block; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.album-dialog[data-shape="heart"] .album-orbital-space { opacity: 1; }
.album-space-star.is-twinkling { animation: album-space-twinkle var(--space-star-duration, 9s) ease-in-out var(--space-star-delay, 0s) infinite alternate; animation-play-state: paused; }
.album-dialog[data-shape="heart"] .album-sculpture.is-running .album-space-star.is-twinkling { animation-play-state: running; }
.album-dialog.is-viewing .album-orbital-space { opacity: 0; }
.album-sculpture-form { opacity: 0; transform-origin: 500px 500px; transform: scale(.975); transition: opacity 1.6s ease, transform 1.6s cubic-bezier(.22,.65,.23,1); }
.album-sculpture-form.is-current { opacity: 1; transform: scale(1); }
.album-sculpture-depth { fill: #21172d40; }
.album-form-heart .album-sculpture-depth { fill-opacity: .45; }
.album-form-heart > path:nth-of-type(2) { opacity: .47; }
.album-form-heart > path:nth-of-type(3) { opacity: .75; }
.album-form-heart > g[clip-path] > path[fill="#fff"] { opacity: .55; }
.album-form-heart .album-sculpture-filament { opacity: .36; }
.album-heart-aura { opacity: .75; }
.album-heart-outline { opacity: .48; }
.album-sculpture.is-running .is-current .album-heart-aura { animation: album-rim-breathe 11s ease-in-out infinite alternate; }
.album-sculpture-filament { opacity: .46; stroke-linecap: round; animation: album-light-flow 38s linear infinite; animation-play-state: paused; }
.album-sculpture-breath { animation: album-volume-breath 9s ease-in-out infinite alternate; animation-play-state: paused; }
.album-sculpture.is-running .is-current .album-sculpture-filament,
.album-sculpture.is-running .is-current .album-sculpture-breath { animation-play-state: running; }
.album-sculpture-dust { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: .9; transition: opacity 1.6s ease; }
.album-dialog[data-phase="preparing"] .album-sculpture,
.album-dialog[data-phase="preparing"] .album-sculpture-dust,
.album-dialog[data-phase="closed"] .album-sculpture,
.album-dialog[data-phase="closed"] .album-sculpture-dust { opacity: 0; transition: none; }
.album-dialog[data-phase="emerging"] .album-sculpture { opacity: .18; }
.album-dialog[data-phase="emerging"] .album-sculpture-dust { opacity: .3; }
.album-card { position: absolute; left: 0; top: 0; width: 100px; height: 125px; display: block; padding: 0; border: 0; background: transparent; opacity: 1; transform: translate3d(var(--photo-x, 0px), var(--photo-y, 0px), 0) translate(-50%, -50%) scale(var(--photo-scale, .08)); transform-origin: center; transition: transform 1.6s cubic-bezier(.22,.61,.22,1) var(--photo-delay, 0ms), opacity 1.1s ease var(--photo-delay, 0ms), filter 1.1s ease var(--photo-delay, 0ms); }
.album-card::before { content: ''; position: absolute; inset: -3px; }
.album-dialog[data-phase="preparing"] .album-card, .album-dialog[data-phase="closed"] .album-card { opacity: 0; filter: blur(8px); transition: none; pointer-events: none; }
.album-dialog[data-phase="emerging"] .album-card { transition-duration: 1.2s, 1.1s, 1.1s; }
.album-dialog[open] .album-card { will-change: transform; }
.album-dialog[data-phase="settled"] .album-card { will-change: auto; }
.album-dialog[data-phase="settled"] .album-card { transition: none; }
.album-dialog[data-flow="running"] .album-card { will-change: transform; }
.album-photo-frame { position: relative; display: flex; width: 100%; height: 100%; padding: 2px; overflow: hidden; align-items: center; justify-content: center; border: 1px solid #d1b58b9e; border-top-color: #f0ddbdd4; border-radius: 3px; background: linear-gradient(140deg, #ebd9bb24, #31203950 45%, #d6b18712); box-shadow: 0 6px 16px #06030d82, 0 1px 6px #ad98ba1a, inset 0 1px 0 #fff0db2e; transform: rotate(var(--photo-tilt, 0deg)); filter: brightness(var(--photo-light, 1)); transition: filter .4s, border-color .4s; }
.album-photo-frame::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(125deg, #fff4df0b, transparent 35%, transparent 78%, #e3c79709); pointer-events: none; }
.album-card:hover .album-photo-frame, .album-card:focus-visible .album-photo-frame { filter: brightness(1.08); border-color: #f1debd; }
/* 缩略图按统一 4:5 相框等比裁切；放大原图继续由 .album-stage img 完整展示。 */
.album-photo-frame img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover; object-position: 50% 38%; user-select: none; border-radius: 1px; }
.album-card:focus-visible { outline: 2px solid #e7d2b9; outline-offset: 5px; border-radius: 3px; }
.album-card-info { display: none; }
.album-photo-unavailable { padding: 18px; font-size: 12px; color: #ad98ad; text-align: center; line-height: 1.8; }
.album-orbit-controls { position: relative; display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; padding-top: 8px; text-align: center; }
#album-scene-status { min-height: 18px; margin: 0 0 12px; color: #b8a2bd; font-size: 11px; letter-spacing: .12em; line-height: 1.8; }
.album-shape-button { min-height: 44px; display: inline-flex; align-items: center; gap: 13px; padding: 10px 27px; border: 1px solid #b68e5b7d; background: linear-gradient(110deg, #bd873520, #a789bb0d); color: #e9c897; font-size: 12px; letter-spacing: .16em; transition: background .3s; }
.album-shape-button > span:first-child { font-size: 19px; }
.album-shape-button:hover { background: #c2944a26; }
.album-shape-button:disabled { opacity: .5; }
.album-count { margin: 12px 0 0; color: #948398; font-size: 10px; letter-spacing: .1em; }
.album-viewer { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; padding: 25px max(28px, calc((100vw - 1200px) / 2)) max(24px, env(safe-area-inset-bottom)); background: #09070ff7; backdrop-filter: blur(10px); }
.album-dialog.is-viewing .album-night-fog, .album-dialog.is-viewing .album-photo-frame { animation-play-state: paused; }
.album-viewer-toolbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin: 22px 0 16px; color: #bfa483; font: 12px Georgia, var(--serif); }
.album-viewer-toolbar { padding-right: 70px; margin-top: 0; min-height: 38px; flex-shrink: 0; }
.album-text-button { padding: 8px 0; border: 0; background: transparent; color: #cfb58e; font-size: 12px; }
.album-stage { position: relative; display: flex; flex: 1; min-height: 0; align-items: center; justify-content: center; overflow: hidden; background: #08070d; border: 1px solid #bd956651; box-shadow: 0 0 45px #c6a3e00b; touch-action: pan-y pinch-zoom; }
.album-stage img { width: 100%; height: 100%; object-fit: contain; user-select: none; animation: album-photo-in .45s ease both; }
.album-stage > p { padding: 24px; color: #b7a0b8; font-size: 13px; text-align: center; line-height: 1.8; }
.album-caption { margin: 18px 0 0; text-align: center; color: #cab9c3; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.album-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.album-navigation button { min-height: 44px; padding: 10px 16px; border: 1px solid #bd956651; background: #a5793e0e; color: #dfbf8d; font-size: 12px; transition: background .25s; }
.album-navigation button:hover { background: #a5793e25; }
.album-navigation button:disabled { opacity: .3; cursor: default; }
.album-swipe-note { font-size: 10px; color: #908096; letter-spacing: .1em; }
@keyframes album-photo-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes album-fog { to { transform: translateX(9%); } }
@keyframes album-nebula-far { from { opacity: .72; transform: translate3d(-1%, 0, 0); } to { opacity: .94; transform: translate3d(1%, -1%, 0); } }
@keyframes album-nebula-near { from { opacity: .58; transform: translate3d(1%, 0, 0); } to { opacity: .82; transform: translate3d(-1%, 1%, 0); } }
@keyframes album-rim-breathe { from { opacity: .53; } to { opacity: .86; } }
@keyframes album-light-flow { to { stroke-dashoffset: -1000; } }
@keyframes album-volume-breath { from { opacity: .4; } to { opacity: 1; } }
@keyframes album-space-twinkle { from { opacity: .2; } to { opacity: .58; } }
@keyframes album-gold { 0% { opacity: 0; transform: translate(0, 0) scale(.2); } 15% { opacity: .85; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }
@media (max-width: 760px) {
  .album-cover { width: min(70vw, 270px); margin-top: 24px; }
}
@media (max-width: 520px) {
  .album-dialog .close-dialog { width: 34px; height: 34px; top: max(18px, env(safe-area-inset-top)); right: 18px; }
  .album-dialog::before { inset: 9px; }
  .album-header { padding: 26px 52px 4px; }
  .album-eyebrow { margin-bottom: 13px; font-size: 9px; }
  .album-header > p:last-child { font-size: 11px; }
  .album-gallery { padding: 0 14px max(20px, env(safe-area-inset-bottom)); }
  .album-night-moon { right: -20px; top: 9%; }
  #album-scene-status { margin-bottom: 9px; font-size: 10px; letter-spacing: .04em; }
  .album-count { font-size: 9px; margin-top: 10px; }
  .album-viewer { padding: 18px 14px max(20px, env(safe-area-inset-bottom)); }
  .album-viewer-toolbar { padding-right: 48px; }
  .album-swipe-note { display: none; }
  .album-empty { flex: 1; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .album-cover, .album-dialog *, .album-dialog *::before, .album-dialog *::after { animation: none !important; transition: none !important; }
}
@media (max-height: 640px) {
  .album-header { padding-top: 16px; }
  .album-eyebrow, .album-header > p:last-child { display: none; }
  .album-header h2 { font-size: 25px; margin-bottom: 3px; }
  .album-orbit-controls { flex-direction: row; justify-content: center; gap: 14px; }
  #album-scene-status, .album-count { display: none; }
  .album-gallery { padding-bottom: 16px; }
}
