/* Gallery UI copied from the current Li Shixiong source; no global page styles. */
.gallery-preview-loading { min-width: 150px; min-height: 120px; display: grid; place-items: center; border-radius: 18px; color: var(--weak); font-size: 12px; background: rgba(255, 255, 255, 0.04); border: 1px dashed rgba(255, 255, 255, 0.1); }
.gallery-entry { position: relative; flex: 0 0 auto; min-width: 68px; min-height: 36px; padding: 0px 9px 0px 11px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: rgba(239, 242, 255, 0.88); background: linear-gradient(135deg, rgba(134, 87, 255, 0.11), rgba(69, 113, 255, 0.043)), rgba(255, 255, 255, 0.035); border: 1px solid rgba(177, 146, 255, 0.18); box-shadow: rgba(255, 255, 255, 0.06) 0px 1px 0px inset, rgba(0, 0, 0, 0.12) 0px 6px 16px; backdrop-filter: blur(12px); touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform 0.18s, color 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s; }
.gallery-entry span { color: inherit; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.gallery-entry i { margin-top: -1px; color: rgba(197, 178, 255, 0.88); font-size: 17px; font-style: normal; font-weight: 500; line-height: 1; }
.gallery-entry:hover { color: rgb(255, 255, 255); border-color: rgba(191, 166, 255, 0.36); background-color: rgba(255, 255, 255, 0.067); box-shadow: rgba(255, 255, 255, 0.08) 0px 1px 0px inset, rgba(0, 0, 0, 0.14) 0px 7px 18px; }
.gallery-entry:focus-visible { outline: rgba(177, 146, 255, 0.62) solid 2px; outline-offset: 2px; }
.gallery-entry:active { transform: scale(0.97); }
.gallery-space-content { min-height: 100%; padding-bottom: 118px; }
.gallery-space-back { min-height: 44px; height: 44px; display: inline-flex; align-items: center; gap: 5px; touch-action: manipulation; }
.gallery-space-back > span:first-child { margin-top: -2px; font-size: 23px; line-height: 1; }
.gallery-space-head { position: relative; margin: 4px 0px 22px; padding: 22px 18px 19px; border-radius: 26px; overflow: hidden; background: radial-gradient(circle at 90% 0%, rgba(24, 215, 255, 0.12), transparent 31%), radial-gradient(circle at 12% 0%, rgba(122, 60, 255, 0.23), transparent 43%), linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.024)); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: rgba(0, 0, 0, 0.24) 0px 22px 54px; }
.gallery-space-head::after { content: ""; position: absolute; width: 126px; height: 126px; right: -56px; bottom: -76px; border-radius: 50%; border: 1px solid rgba(177, 92, 255, 0.18); box-shadow: rgba(47, 125, 255, 0.12) 0px 0px 42px; pointer-events: none; }
.gallery-space-heading { position: relative; z-index: 1; margin-top: 7px; display: grid; grid-template-columns: minmax(0px, 1fr) auto; gap: 14px; align-items: end; }
.gallery-space-heading h1 { margin: 0px; font-size: 29px; letter-spacing: -0.02em; }
.gallery-space-heading p { max-width: 255px; margin-top: 9px; }
.gallery-published-stat { min-width: 58px; padding: 9px 7px 8px; border-radius: 18px; text-align: center; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.09); }
.gallery-published-stat strong { display: block; font-size: 24px; line-height: 1; background-image: ; background-position-x: ; background-position-y: ; background-size: ; background-repeat: ; background-attachment: ; background-origin: ; background-color: ; background-clip: text; -webkit-text-fill-color: transparent; }
.gallery-published-stat span { display: block; margin-top: 5px; color: var(--weak); font-size: 9px; letter-spacing: 0px; white-space: nowrap; }
.gallery-masonry { column-count: 2; column-gap: 10px; }
.gallery-card { position: relative; width: 100%; margin: 0px 0px 10px; display: inline-block; break-inside: avoid; overflow: hidden; vertical-align: top; border-radius: 18px; color: var(--text); background: radial-gradient(circle at 15% 0%, rgba(122, 60, 255, 0.1), transparent 35%), rgba(255, 255, 255, 0.047); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: rgba(0, 0, 0, 0.22) 0px 14px 30px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform 0.18s, border-color 0.18s; }
.gallery-card:hover { border-color: rgba(153, 124, 255, 0.32); }
.gallery-card:active { transform: scale(0.985); }
.gallery-card img { width: 100%; height: auto; display: block; object-fit: contain; background: rgb(9, 11, 25); }
.gallery-card figcaption,  .gallery-card .gallery-card__title { display: block; padding: 10px 11px 11px; color: rgba(255, 255, 255, 0.92); font-size: 13px; font-weight: 800; line-height: 1.42; overflow-wrap: anywhere; }
.gallery-card figcaption b { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gallery-empty { padding: 34px 18px; border-radius: 22px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.65; background: rgba(255, 255, 255, 0.04); border: 1px dashed rgba(255, 255, 255, 0.12); }
.gallery-manager-content { padding-bottom: 118px; }
.gallery-manager-head { margin-bottom: 17px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.gallery-manager-head > div { min-width: 0px; }
.gallery-manager-head h1 { font-size: 27px; }
.gallery-manager-head p { max-width: 230px; }
.gallery-upload-trigger { flex: 0 0 auto; min-width: 108px; min-height: 44px; padding: 0px 14px; font-size: 13px; white-space: nowrap; }
.gallery-admin-filters { position: sticky; z-index: 5; top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0px 0px 15px; padding: 6px; border-radius: 20px; background: rgba(10, 14, 35, 0.86); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: rgba(0, 0, 0, 0.2) 0px 12px 30px; backdrop-filter: blur(18px); }
.gallery-admin-filters button { min-height: 42px; padding: 0px 10px; border-radius: 15px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 850; touch-action: manipulation; }
.gallery-admin-filters button span { min-width: 22px; height: 22px; margin-left: 5px; padding: 0px 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.78); background: rgba(255, 255, 255, 0.08); font-size: 10px; }
.gallery-admin-filters button.active { color: rgb(255, 255, 255); background: linear-gradient(135deg, rgba(122, 60, 255, 0.58), rgba(47, 125, 255, 0.48)); box-shadow: rgba(72, 70, 220, 0.22) 0px 8px 22px; }
.gallery-admin-filters button.active span { background: rgba(255, 255, 255, 0.16); }
.gallery-manager-list { display: grid; gap: 12px; }
.gallery-admin-card { position: relative; min-height: 118px; padding: 12px; display: grid; grid-template-columns: 98px minmax(0px, 1fr); gap: 13px; align-items: center; border-radius: 22px; overflow: hidden; background: radial-gradient(circle at 100% 0%, rgba(47, 125, 255, 0.09), transparent 34%), linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: rgba(0, 0, 0, 0.2) 0px 16px 34px; }
.gallery-admin-card > img,  .gallery-admin-card__thumb { width: 98px; height: 94px; border-radius: 15px; display: block; object-fit: cover; background: rgb(10, 13, 27); border: 1px solid rgba(255, 255, 255, 0.09); }
.gallery-admin-card__thumb img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.gallery-admin-card__body { min-width: 0px; }
.gallery-admin-card h3 { margin: 0px; font-size: 15px; line-height: 1.42; overflow-wrap: anywhere; }
.gallery-admin-card p { margin: 5px 0px 0px; color: var(--weak); font-size: 11px; line-height: 1.4; }
.gallery-admin-status { min-height: 24px; margin-top: 8px; padding: 0px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; color: rgb(170, 255, 213); background: rgba(76, 255, 189, 0.08); border: 1px solid rgba(76, 255, 189, 0.16); font-size: 10px; font-weight: 850; }
.gallery-admin-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: rgb(76, 255, 189); box-shadow: rgba(76, 255, 189, 0.7) 0px 0px 9px; }
.gallery-admin-status.is-unpublished { color: rgba(255, 255, 255, 0.58); background: rgba(255, 255, 255, 0.055); border-color: rgba(255, 255, 255, 0.1); }
.gallery-admin-status.is-unpublished::before { background: rgba(255, 255, 255, 0.36); box-shadow: none; }
.gallery-admin-actions { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.gallery-admin-actions button { min-height: 34px; padding: 0px 10px; border-radius: 999px; color: rgba(255, 255, 255, 0.82); background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); font-size: 11px; font-weight: 850; touch-action: manipulation; }
.gallery-admin-actions button:hover { border-color: rgba(153, 124, 255, 0.34); }
.gallery-admin-actions button:active { transform: scale(0.97); }
.gallery-admin-actions .is-danger { color: rgb(255, 171, 193); border-color: rgba(255, 80, 120, 0.18); background: rgba(255, 80, 120, 0.07); }
.gallery-admin-order { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; padding-top: 11px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.gallery-admin-order label { display: flex; align-items: center; gap: 6px; margin-right: auto; color: var(--muted); font-size: 12px; }
.gallery-admin-order select,  .gallery-admin-order button { min-height: 44px; min-width: 44px; border: 1px solid rgba(169, 150, 244, 0.23); border-radius: 10px; color: rgb(227, 221, 255); background: rgb(27, 27, 53); font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; font-size: 12px; padding: 0px 9px; }
.gallery-admin-order select { max-width: 95px; cursor: pointer; }
.gallery-admin-order option { background: rgb(23, 24, 43); }
.gallery-admin-order button { cursor: pointer; }
.gallery-admin-order button:disabled { opacity: 0.38; cursor: default; }
.gallery-admin-order select:focus-visible,  .gallery-admin-order button:focus-visible { outline: rgb(153, 218, 250) solid 2px; outline-offset: 2px; }
.gallery-admin-actions button:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 359px) {
.gallery-admin-order { flex-wrap: wrap; }
.gallery-admin-order label { flex: 1 0 100%; }
}
.gallery-admin-empty { padding: 34px 18px; border-radius: 22px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.65; background: rgba(255, 255, 255, 0.04); border: 1px dashed rgba(255, 255, 255, 0.12); }
.gallery-upload-sheet { max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; }
.gallery-upload-form { position: relative; z-index: 1; padding: 2px 2px 4px; }
.gallery-upload-form h2 { margin: 8px 40px 7px 0px; font-size: 23px; }
.gallery-upload-form > p { margin: 0px 40px 16px 0px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.gallery-upload-dropzone { position: relative; min-height: 148px; padding: 22px 16px; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden; text-align: center; cursor: pointer; background: radial-gradient(circle at 50% 0%, rgba(122, 60, 255, 0.2), transparent 48%), rgba(255, 255, 255, 0.04); border: 1px dashed rgba(177, 146, 255, 0.38); touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: border-color 0.18s, background 0.18s; }
.gallery-upload-dropzone:hover { border-color: rgba(177, 146, 255, 0.65); background-color: rgba(255, 255, 255, 0.06); }
.gallery-upload-dropzone:active { background-color: rgba(122, 60, 255, 0.09); }
.gallery-upload-dropzone input { position: absolute; inset: 0px; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.gallery-upload-dropzone > span { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: rgb(255, 255, 255); background: linear-gradient(135deg, rgba(122, 60, 255, 0.86), rgba(47, 125, 255, 0.82)); box-shadow: rgba(122, 60, 255, 0.3) 0px 0px 25px; font-size: 26px; font-weight: 300; }
.gallery-upload-dropzone strong { margin-top: 3px; font-size: 14px; }
.gallery-upload-dropzone small { color: var(--weak); font-size: 10px; }
.gallery-upload-preview { margin-top: 12px; border-radius: 18px; overflow: hidden; background: rgba(255, 255, 255, 0.04); }
.gallery-upload-preview:empty { display: none; }
.gallery-upload-preview img { width: 100%; max-height: 260px; display: block; object-fit: contain; background: rgb(7, 9, 22); }
.gallery-upload-preview .gallery-upload-preview__meta { padding: 9px 11px; color: var(--weak); font-size: 10px; line-height: 1.4; }
.gallery-upload-fields { margin: 14px 0px; display: grid; gap: 11px; }
.gallery-upload-fields label { display: grid; gap: 7px; }
.gallery-upload-fields label > span { color: rgba(255, 255, 255, 0.8); font-size: 12px; font-weight: 800; }
.gallery-upload-fields label em { margin-left: 4px; color: var(--weak); font-size: 10px; font-style: normal; font-weight: 500; }
.gallery-upload-fields input { width: 100%; min-height: 48px; padding: 0px 13px; border-radius: 15px; color: rgb(255, 255, 255); background: rgba(255, 255, 255, 0.067); border: 1px solid rgba(255, 255, 255, 0.11); transition: border-color 0.18s, box-shadow 0.18s; }
.gallery-upload-fields input::placeholder { color: rgba(255, 255, 255, 0.3); }
.gallery-upload-fields input:focus { border-color: rgba(153, 124, 255, 0.55); box-shadow: rgba(122, 60, 255, 0.1) 0px 0px 0px 3px; }
.gallery-upload-save { min-height: 48px; margin-top: 2px; }
@media (max-width: 374px) {
.gallery-entry { min-width: 64px; min-height: 34px; padding: 0px 8px 0px 10px; }
.gallery-space-head { padding: 19px 15px 17px; }
.gallery-space-heading { gap: 9px; }
.gallery-space-heading h1 { font-size: 26px; }
.gallery-manager-head { align-items: stretch; flex-direction: column; }
.gallery-manager-head p { max-width: none; }
.gallery-upload-trigger { width: 100%; }
.gallery-admin-card { grid-template-columns: 88px minmax(0px, 1fr); gap: 11px; }
.gallery-admin-card > img,  .gallery-admin-card__thumb { width: 88px; height: 88px; }
}
#gallerySpace .gallery-space-content { padding-top: calc(8px + env(safe-area-inset-top)); }
#gallerySpace .gallery-space-head { margin: 0px; padding: 10px 14px 14px; }
.gallery-space-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding-right: 44px; margin-bottom: 7px; }
#gallerySpace .gallery-space-back { min-height: 36px; height: auto; margin: 0px; padding: 0px 3px; border: 0px; border-radius: 8px; background: transparent; flex-shrink: 0; }
#gallerySpace .gallery-space-back > span { font-size: 13px; font-weight: 500; letter-spacing: 0px; color: rgb(201, 197, 221); }
#gallerySpace .gallery-space-back > span:first-child { font-size: 23px; }
#gallerySpace .gallery-space-eyebrow { font-size: 9px; letter-spacing: 0.08em; white-space: nowrap; }
#gallerySpace .gallery-space-heading { margin-top: 0px; }
#gallerySpace .gallery-space-heading > div:first-child { min-width: 0px; }
#gallerySpace .gallery-space-heading p { max-width: none; margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gallerySpace .gallery-series-tabs { margin: 8px 0px; padding-top: 2px; padding-bottom: 2px; scrollbar-width: none; }
#gallerySpace .gallery-series-tabs::-webkit-scrollbar { display: none; }
.gallery-series-tabs { display: flex; gap: 9px; overflow-x: auto; margin: 18px 0px; padding: 3px 1px 8px; scrollbar-width: thin; scrollbar-color: rgb(97, 85, 162) transparent; }
.gallery-series-tabs button { flex: 0 0 auto; min-width: 72px; max-width: 260px; min-height: 42px; padding: 9px 16px; border: 1px solid rgba(172, 158, 240, 0.28); border-radius: 12px; background: rgba(31, 31, 63, 0.7); color: rgb(196, 192, 216); font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; font-size: 15px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-series-tabs button.active { color: rgb(255, 255, 255); border-color: rgb(158, 132, 255); background: linear-gradient(120deg, rgba(111, 60, 236, 0.7), rgba(48, 92, 189, 0.65)); box-shadow: rgba(153, 112, 255, 0.15) 0px 0px 16px inset; }
.gallery-series-tabs button:focus-visible { outline: rgb(169, 145, 255) solid 2px; outline-offset: 1px; }
.gallery-series-manager { padding: 18px 14px; margin: 16px 0px 20px; }
.gallery-series-heading { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.gallery-series-heading h2 { font-size: 21px; margin: 0px; }
.gallery-series-heading p,  .gallery-series-help { margin: 8px 0px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.gallery-series-toggle { display: flex; gap: 6px; align-items: center; flex-shrink: 0; font-size: 13px; }
.gallery-series-toggle input { width: 19px; height: 19px; accent-color: rgb(133, 90, 255); }
.gallery-series-row { margin: 12px 0px; padding: 12px; border: 1px solid rgba(173, 160, 230, 0.18); border-radius: 14px; background: rgba(8, 10, 29, 0.32); }
.gallery-series-row input,  .gallery-series-add input,  .gallery-series-assignment select,  #galleryUploadSeries { width: 100%; min-width: 0px; min-height: 42px; border: 1px solid rgba(168, 151, 232, 0.27); border-radius: 10px; padding: 9px 10px; color: rgb(242, 239, 255); background: rgb(17, 20, 43); font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; font-size: 16px; }
.gallery-series-row-actions { display: flex; gap: 7px; margin-top: 8px; }
.gallery-series-manager button { min-height: 40px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(172, 149, 255, 0.3); background: rgba(96, 64, 190, 0.25); color: rgb(238, 232, 255); font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; font-size: 13px; }
.gallery-series-manager button:disabled { opacity: 0.4; }
.gallery-series-add { display: flex; gap: 8px; margin-top: 14px; }
.gallery-series-add input { flex: 1 1 0%; }
.gallery-series-add button { flex: 0 0 auto; }
.gallery-series-status { margin: 6px 0px 0px; min-height: 19px; font-size: 13px; color: rgb(181, 179, 245); }
.gallery-series-assignment { display: grid; gap: 6px; margin: 12px 0px; color: rgb(185, 181, 208); font-size: 12px; }
.gallery-series-assignment select { font-size: 14px; }
.gallery-admin-card__body { min-width: 0px; }
@media (max-width: 380px) {
.gallery-series-heading { align-items: flex-start; flex-direction: column; }
.gallery-series-row { padding: 10px; }
.gallery-series-row-actions { gap: 5px; }
}
/* Keep the existing home album composition. */
.album-tools { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; }
.album-tools .album-hint { margin:0; }
.album-tools .gallery-entry { min-height:36px; height:auto; margin:0; }
#galleryManager .gallery-manager-content { padding-bottom:calc(28px + env(safe-area-inset-bottom)); }
.gallery-storage-note { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.65; }
