/* Flutter's GlobalWindowShell retains desktop navigation around AlbumPreviewPage. */
html:has(.thread-shell-album [data-album-preview]){overflow:hidden;scrollbar-gutter:auto}
.thread-shell:has([data-album-preview]){position:fixed;inset:0;z-index:40;background:var(--g-bg);isolation:isolate;--thread-top:0px;--album-canvas-height:calc(100dvh - 28px)}
.thread-shell-album .design-shell-album{align-items:stretch;width:100%;max-width:none;height:100%;min-height:0;margin:0;padding:12px var(--outer-gap) 16px}
.design-shell-album .design-left-wrap{position:relative;top:auto;height:100%;min-height:0}
.thread-shell-album .album-preview-main{position:relative;width:100%;height:100%;min-height:0;padding:0;border-radius:16px;overflow:hidden;color:#fff;background:#000}
@media(max-width:767px){
 .thread-shell:has([data-album-preview]){--album-canvas-height:100dvh}
 .thread-shell-album .design-shell-album{display:flex;gap:0;padding:0}
 .thread-shell-album .album-preview-main{border-radius:0}
}
.album-preview-notice{position:absolute;top:calc(72px + env(safe-area-inset-top,0px));left:50%;z-index:5;width:max-content;max-width:calc(100% - 32px);transform:translateX(-50%);padding:10px 16px;border-radius:12px;background:#000b;color:#fff;font-size:13px;text-align:center}
.album-preview-layout{display:flex;width:100%;height:100%;overflow:hidden}
.thread-shell-album .album-preview-viewer{position:relative;flex:1;min-width:0;height:100%;margin:0;overflow:hidden;background:#000}
.album-preview-viewer .album-preview-stage{position:absolute;inset:0;display:block;width:100%;height:100%;min-height:0;max-height:none;margin:0;border-radius:0;aspect-ratio:auto;background:#000;touch-action:none;outline-offset:-3px}
.album-preview-stage .thread-album-slide{position:absolute;inset:0;width:100%;height:100%;cursor:grab;overflow:hidden;user-select:none;touch-action:none}
.album-preview-stage .thread-album-slide[hidden]{display:none}
.album-preview-stage .thread-album-slide>img{display:block;width:100%;height:100%;max-height:none;object-fit:contain;transform-origin:center;user-select:none;will-change:transform}
.album-preview-stage[data-zoomed=true]{cursor:grab}
.album-preview-stage[data-dragging=true] .thread-album-slide{cursor:grabbing}
.album-preview-stage .thread-album-error,.album-preview-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#000;color:#ffffff61;font-size:13px}
.album-preview-stage .thread-album-error[hidden]{display:none}
.album-preview-stage .thread-album-error>.material-symbols-outlined,.album-preview-empty>.material-symbols-outlined{font-size:48px}
.album-preview-empty a{color:#fff;border:1px solid #fff6;border-radius:20px;padding:10px 20px}
.album-preview-stage .thread-album-slide[data-image-loading=true]::after{content:'';position:absolute;left:calc(50% - 15px);top:calc(50% - 15px);width:30px;height:30px;border:3px solid #ffffff24;border-top-color:#ffffff61;border-radius:50%;animation:album-preview-loading .9s linear infinite}
@keyframes album-preview-loading{to{transform:rotate(360deg)}}
[data-album-overlay]{opacity:1;transition:opacity .15s ease-in-out}
[data-overlay-visible=false] [data-album-overlay]{opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s ease-in-out,visibility 0s .15s}
.album-preview-topbar{position:absolute;top:calc(env(safe-area-inset-top,0px) + 8px);left:0;right:8px;z-index:4;display:flex;align-items:center;justify-content:space-between;min-height:48px;pointer-events:none}
.album-preview-topbar>*{pointer-events:auto}
.album-preview-icon{display:grid;place-items:center;width:48px;height:48px;flex:none;border:0;border-radius:50%;background:transparent;color:#fff;cursor:pointer;list-style:none}
.album-preview-icon>.design-icon{font-size:26px}
.album-preview-topbar>a>.design-icon{font-size:28px}
.album-preview-icon:disabled{opacity:.4;cursor:default}
.album-preview-icon:hover{background:#ffffff14}
.album-preview-icon:focus-visible,.album-preview-action:focus-visible,.album-preview-avatar:focus-visible{outline:2px solid #fff;outline-offset:2px}
.album-preview-counter{flex:none;margin:0 auto;padding:4px 12px;border-radius:14px;background:#00000061;color:#fff;font-family:Roboto,var(--design-font-family);font-size:13px;line-height:19px;pointer-events:none}
.album-preview-top-actions{display:flex;align-items:center;gap:0}
.album-preview-top-actions>.album-preview-icon:first-child>.design-icon{font-size:22px}
.album-preview-avatar{display:grid;place-items:center;width:32px;height:48px;flex:none;color:#fff}
.album-preview-avatar>img,.album-preview-avatar>span{display:grid;place-items:center;width:32px;height:32px;object-fit:cover;border-radius:50%;background:#ffffff3d;font-size:14px}
.album-preview-more{margin:0;position:relative;color:var(--g-text)}
.album-preview-info{position:absolute;left:0;right:0;bottom:0;z-index:2;padding:30px 70px calc(16px + env(safe-area-inset-bottom,0px)) 16px;background:linear-gradient(to top,#000000bf,#0000004d,transparent);pointer-events:none}
.album-preview-info a{pointer-events:auto}
.album-preview-author{display:flex;align-items:center;gap:10px;min-width:0;color:#fff}
.album-preview-author strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;line-height:20px}
.album-preview-author time{flex:none;font-size:11px;line-height:16px;color:#ffffff99}
.album-preview-caption{margin-top:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:#fff;font-size:14px;font-weight:500;line-height:20px}
.album-preview-caption .rich-text-content,.album-preview-caption .content-line,.album-preview-caption p{display:contents;color:inherit;font:inherit;letter-spacing:normal;margin:0;padding:0;white-space:pre-wrap}
.album-preview-caption .content-topic{color:var(--g-primary)}
.album-preview-meta{display:flex;align-items:center;gap:8px;margin:6px 0 8px;font-size:10px;line-height:14px;color:#ffffff8a}
.album-preview-meta>a{padding:1px 6px;border-radius:3px;background:#ffffff26;color:#ffffffb3}
.album-preview-meta>span{display:flex;align-items:center;gap:2px}
.album-preview-meta .design-offer-icon{font-size:12px}
.thread-shell-album .design-offer-icon{font-family:OfferTuniao!important}
.album-preview-caption .content-document{display:contents}
.album-preview-caption .content-mention{font-size:inherit;font-weight:inherit;color:var(--g-primary)}
/* The 44px hit area extends 4px beyond each 36px circle. Keep the visible
   circles 15px from the edge, as in Flutter, without shrinking touch targets. */
.album-preview-actions{position:absolute;right:11px;bottom:calc(100px + env(safe-area-inset-bottom,0px));z-index:3;display:flex;flex-direction:column;gap:16px}
.album-preview-action{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:2px;min-width:44px;min-height:57px;padding:0;border:0;background:transparent;color:#fff;cursor:pointer}
.album-preview-action>.design-offer-icon{display:grid;place-items:center;width:36px;height:36px;flex:none;border-radius:50%;background:#0000004d;backdrop-filter:blur(8px);font-size:23px;line-height:1}
.album-preview-action>span{font-size:13px;line-height:19px;color:#ffffffb3}
.album-preview-action[data-thread-action=like][aria-pressed=true]>.design-offer-icon{color:#ff5252}
.album-preview-action[data-thread-action=favorite][aria-pressed=true]>.design-offer-icon{color:#ffc107}
.album-preview-action:active>.design-offer-icon{background:#ffffff30}
/* A browser's short landscape viewport has less vertical room than the
   standard Flutter layout. Move the stack down before reducing its gaps;
   the 36px circles, 23px icons and 44px hit areas keep their original size. */
@media(max-height:440px){
 .album-preview-actions{bottom:clamp(calc(16px + env(safe-area-inset-bottom,0px)),calc(var(--album-canvas-height) - env(safe-area-inset-top,0px) - 340px),calc(100px + env(safe-area-inset-bottom,0px)));gap:clamp(4px,calc((var(--album-canvas-height) - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 308px)/3),16px)}
}
.album-preview-step{position:absolute;top:50%;z-index:3;display:grid;place-items:center;width:44px;height:44px;transform:translateY(-50%);border:0;border-radius:50%;background:#0006;color:#fff;opacity:0;transition:opacity .15s;cursor:pointer}
.album-preview-step-prev{left:12px}.album-preview-step-next{right:12px}
.album-preview-step:disabled{visibility:hidden}
@media(hover:hover){.album-preview-viewer:hover .album-preview-step:not(:disabled),.album-preview-step:focus-visible{opacity:1}}
[data-overlay-visible=false] .album-preview-step{opacity:0;pointer-events:none}
.thread-shell.thread-shell-album .album-preview-discussion{position:fixed;inset:auto 0 0;z-index:60;display:none;width:100%;height:var(--album-sheet-height,84dvh);max-height:96dvh;margin:0;padding:0;overflow:hidden;border:0;border-radius:22px 22px 0 0;background:var(--g-surface);color:var(--g-text);overscroll-behavior:contain}
.thread-shell.thread-shell-album .album-preview-discussion[data-open=true]{display:block}
.album-preview-discussion .thread-comments{height:100%;overflow-y:auto;overscroll-behavior:contain;border:0;border-radius:inherit;padding:0 16px calc(86px + env(safe-area-inset-bottom,0px));background:var(--g-surface);scrollbar-width:thin}
.album-preview-discussion .thread-comments-toolbar{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:14px;min-height:82px;padding:24px 0 8px;border:0;border-radius:0;background:var(--g-surface);touch-action:pan-y}
.album-comments-handle{position:absolute;top:10px;left:calc(50% - 19px);width:38px;height:4px;border-radius:99px;background:#d8d8d8;touch-action:none;cursor:ns-resize}
.album-comments-handle::before{content:'';position:absolute;inset:-10px -24px}
.album-preview-discussion .thread-comments-toolbar h2{display:flex;gap:4px;flex:none;font-size:17px;font-weight:700;line-height:26px;color:var(--g-text)}
.album-preview-discussion .thread-comments-toolbar h2 span{font:inherit}
.album-preview-discussion .thread-sort{display:flex;gap:8px;padding:0;border-radius:0;background:transparent}
.album-preview-discussion .thread-sort a{min-width:48px;height:30px;padding:6px 12px;border-radius:99px;background:#f2f3f5;color:#666;font-size:12px;font-weight:600;line-height:18px}
.album-preview-discussion .thread-sort a[aria-current=true]{background:#111;color:#fff;box-shadow:none}
.album-preview-discussion .album-comments-close{position:static;display:grid;place-items:center;width:44px;min-width:44px;height:44px;margin-left:auto;color:var(--g-text)}
.album-comments-bottom{position:absolute;inset:auto 0 0;z-index:4;padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px));background:var(--g-surface);box-shadow:0 -4px 16px #0000000f}
.album-preview-discussion .thread-discussion-write{position:static;display:flex;align-items:center;gap:8px;width:100%;height:44px;padding:0 14px;border:0;border-radius:24px;background:#f4f5f7;color:#757575;font-size:14px;text-align:left}
.album-preview-discussion .thread-discussion-write .design-offer-icon{font-size:18px}
.album-preview-discussion .thread-empty{min-height:240px}
.thread-shell-album .thread-panel-backdrop{backdrop-filter:none;background:#0006}
html[data-theme=dark] .album-preview-discussion :is(.thread-sort a:not([aria-current=true]),.thread-discussion-write){background:#333;color:#bbb}
html[data-theme=dark] .album-preview-discussion .thread-sort a[aria-current=true]{background:#eee;color:#111}
@media(min-width:1024px) and (orientation:landscape){
 .thread-shell.thread-shell-album .album-preview-discussion{position:relative;inset:auto;z-index:2;display:block;flex:none;width:0;height:100%;max-height:none;visibility:hidden;border-radius:18px 0 0 18px;transition:width .26s cubic-bezier(.215,.61,.355,1),visibility 0s .26s;--album-panel-width:420px}
 .thread-shell.thread-shell-album .album-preview-discussion[data-open=true]{width:var(--album-panel-width);visibility:visible;transition:width .26s cubic-bezier(.215,.61,.355,1)}
 .album-preview-discussion .thread-comments,.album-preview-discussion .album-comments-bottom{width:var(--album-panel-width)}
 .album-preview-discussion .thread-comments-toolbar{min-height:66px;padding:14px 0 8px}
 .album-comments-handle{display:none}
}
@media(min-width:1280px) and (orientation:landscape){.thread-shell.thread-shell-album .album-preview-discussion{--album-panel-width:460px}}
@media(max-width:359px){.album-preview-discussion .thread-comments-toolbar{gap:8px}.album-preview-discussion .thread-comments-toolbar h2{font-size:16px}.album-preview-discussion .thread-sort{gap:6px}}
.thread-media-dialog.album-overview{position:fixed;inset:auto 0 0;width:100%;max-width:none;height:82dvh;max-height:82dvh;margin:0;padding:0}
.album-overview::before{content:'';display:block;width:32px;height:4px;margin:10px auto 0;border-radius:99px;background:#0000001f}
.album-overview .thread-media-dialog-header{gap:12px;padding:14px 10px 10px 16px;border:0}
.album-overview .thread-media-dialog-header h2{flex:1;font-size:16px;font-weight:700}
.album-overview-total{font-size:12px;color:var(--g-muted)}
.album-overview .thread-media-grid{display:flex;align-items:flex-start;gap:10px;padding:0 16px 16px;max-height:calc(82dvh - 82px);overflow-y:auto}
.album-overview-column{flex:1;min-width:0}
.album-overview .thread-media-grid button{position:relative;display:block;width:100%;height:auto;aspect-ratio:auto;break-inside:avoid;margin:0 0 10px;border:2px solid transparent;border-radius:14px;background:var(--g-surface-2);overflow:hidden}
.album-overview .thread-media-grid button[aria-current=true]{border-color:var(--g-primary)}
.album-overview .thread-media-grid img{display:block;width:100%;height:auto;min-height:48px;border-radius:12px;object-fit:cover}
.album-overview .thread-media-grid .thread-media-number{inset:auto 8px 8px auto;padding:3px 8px;border-radius:99px;background:#0009;color:#fff;font-size:11px;font-weight:600}
@media(min-width:768px){.thread-media-dialog.album-overview{inset:auto auto 0 50%;width:min(720px,100vw);transform:translateX(-50%)}}
@media(prefers-reduced-motion:reduce){[data-album-overlay],.album-preview-step,.thread-shell.thread-shell-album .album-preview-discussion{transition:none}.album-preview-stage .thread-album-slide[data-image-loading=true]::after{animation:none}}
.album-actions-sheet{position:fixed;inset:auto 0 0;width:100%;max-width:none;max-height:96dvh;margin:0;padding:0 0 calc(24px + env(safe-area-inset-bottom,0px));overflow:auto}
.album-actions-handle{width:30px;height:5px;margin:10px auto;border-radius:10px;background:#c9c9c9}
.album-actions-sheet .thread-more-panel{position:static;width:100%;max-height:none;min-width:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
.album-actions-sheet .thread-more-panel>:is(a,button),.album-actions-sheet .thread-more-panel>form>button,.album-actions-cancel{display:flex;align-items:center;gap:15px;width:100%;height:50px;min-height:50px;margin:5px 0;padding:0 20px;border:0;border-radius:10px;background:var(--g-surface);color:var(--g-text);font-size:15px;font-weight:700;text-align:left;cursor:pointer}
.thread-shell .album-actions-sheet .material-symbols-outlined{font-size:24px}
.album-actions-sheet .thread-more-panel .thread-danger{color:var(--g-danger-text,#c73535)}
.album-actions-divider{height:1px;margin:10px 0;background:var(--g-border)}
.album-actions-cancel:hover{background:var(--g-surface-2)}
html[data-theme=dark] .album-actions-handle{background:#ffffff22}
.thread-media-dialog.album-download{position:fixed;inset:auto 0 0;width:100%;max-width:none;max-height:94dvh;margin:0;padding:12px 16px calc(16px + env(safe-area-inset-bottom,0px))}
.album-download[open]{display:flex;flex-direction:column}
.album-download::before{content:'';flex:none;display:block;width:32px;height:4px;margin:0 auto 14px;border-radius:99px;background:#0000001f}
.album-download .thread-media-dialog-header{flex:none;gap:8px;min-height:42px;padding:0;border:0}
.album-download .thread-media-dialog-header h2{flex:1;font-size:16px;font-weight:700}
.album-download .thread-media-dialog-header .thread-button{border:0;padding:8px;color:var(--g-primary);background:transparent;font-size:14px}
.album-download-count{flex:none;margin:0 0 12px;font-size:12px;color:var(--g-muted)}
.album-download .thread-media-grid{flex:0 1 auto;min-height:0;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-height:50dvh;padding:0}
.album-download .thread-media-grid label{border:0;border-radius:12px}
.album-download .thread-media-grid label::after{content:'';position:absolute;inset:0;border:2px solid transparent;border-radius:12px;pointer-events:none;transition:background .12s,border-color .12s}
.album-download .thread-media-grid label:has(:checked)::after{border-color:var(--g-primary);background:color-mix(in srgb,var(--g-primary) 25%,transparent)}
.album-download .thread-media-grid label:has(:focus-visible){outline:2px solid var(--g-primary);outline-offset:-2px}
.album-download .thread-media-grid input{opacity:0;inset:0;width:100%;height:100%;cursor:pointer}
.album-download .album-download-check{position:absolute;top:6px;right:6px;z-index:1;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#0007;color:transparent;font-size:14px;pointer-events:none}
.album-download input:not(:checked)+.album-download-check::before{content:'';width:12px;height:12px;border:1.5px solid #fff;border-radius:50%}
.album-download input:checked+.album-download-check{background:var(--g-primary);color:#fff}
.album-download .thread-media-grid .thread-media-number{inset:auto 6px 6px auto;padding:2px 6px;border-radius:99px;font-size:11px;font-weight:600}
.album-download .thread-media-dialog-footer{flex:none;flex-direction:column;align-items:stretch;gap:8px;padding:12px 0 0;border:0}
.album-download .thread-media-dialog-footer p{order:3;font-size:12px}
.album-download .thread-media-dialog-footer .thread-button{width:100%;min-height:40px;border:0;border-radius:99px;background:transparent;color:var(--g-primary);font-size:14px}
.album-download .thread-media-dialog-footer .album-download-save{background:var(--g-primary);color:#fff}
.album-download .thread-media-dialog-footer .album-download-save:disabled{background:var(--g-surface-2);color:var(--g-muted);cursor:default;opacity:1}
html[data-theme=dark] :is(.album-download,.album-overview)::before{background:#ffffff3d}
@media(prefers-reduced-motion:reduce){.album-download .thread-media-grid label::after{transition:none}}
