/* Shared paper, ink and controls. Existing selected H/artwork remains unchanged. */
:root{--reading-ink:#4d3529;--reading-muted:#716454;--reading-paper:#fbf8ef;--reading-green:#486c51;--reading-line:#e6dcc8}
body{color:var(--reading-ink);background-color:var(--reading-paper);font-family:-apple-system,BlinkMacSystemFont,"PingFang TC","Noto Sans TC",sans-serif}
button,input,select,textarea{font:inherit}button,a,input{touch-action:manipulation}button,a{ -webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #557d5f;outline-offset:3px}
.reading-skip{position:absolute;left:-10000px}.reading-skip:focus{left:16px;top:12px;z-index:2000;background:#fff;padding:12px}
.viewer-image-status{position:absolute;top:34%;left:50%;transform:translate(-50%,-50%);z-index:7;max-width:min(310px,80%);padding:16px 22px;background:#fff9e9f5;color:#4d3529;border:1px solid #e6dcc8;border-radius:20px;text-align:center;box-shadow:0 4px 20px #4d352918}
.viewer-image-status[hidden]{display:none!important}.viewer-image-status p{margin:0 0 8px}.viewer-image-status button{min-height:44px;border:1px solid #d9bc70;border-radius:12px;padding:8px 14px;background:#ffe28b;color:#4d3529}
#photoModal .modal-image{background:#f1ecdf}#photoModal .modal-image[style*="visibility: hidden"]{pointer-events:none}
.moment-photo-container,.album-photo-wrapper{background:#f1ecdf}.photo-preview-pending{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;color:#716454;font-size:13px;background:linear-gradient(110deg,#f3eedf,#faf7ed,#f3eedf);background-size:200% 100%;animation:reading-shimmer 1.8s ease infinite}.photo-preview-pending[hidden]{display:none}
@keyframes reading-shimmer{to{background-position:-200% 0}}
.current-user-badge{position:static!important;align-self:flex-end;margin:12px 0;box-shadow:none!important;border:1px solid var(--reading-line);z-index:auto!important}
.settings-version-footer{color:var(--reading-muted)}.transfer-item,.transfer-card,.memory-card,.card{border-color:var(--reading-line)}
.reading-recovery-note{background:#edf3e8;border:1px solid #d5e0cc;border-radius:16px;padding:14px 18px;margin:16px 0;color:#48634b}.reading-recovery-note a{font-weight:650;color:#35563f}
.reading-help-details{margin-top:18px;font-size:13px;color:#716454}.reading-help-details summary{cursor:pointer;min-height:44px;display:flex;align-items:center}.reading-help-details a{color:#486c51}
body.account-refined{min-height:100svh;background:radial-gradient(ellipse at 8% 2%,#e4f0de 0,transparent 40%),radial-gradient(ellipse at 95% 30%,#fff0c2 0,transparent 40%),#fbf8ef}
.account-refined .account-shell{max-width:1120px;padding:24px 30px 40px}.account-refined .account-header{border:0;align-items:center;justify-content:space-between;flex-direction:row;margin-bottom:10px;padding:0}.reading-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:#4d3529;font-weight:750;font-size:20px}.reading-brand img{width:40px;height:40px;border-radius:12px}.reading-brand small{display:block;font-size:11px;font-weight:400;color:#716454}.reading-top-actions{display:flex;gap:14px;align-items:center}.reading-top-actions a{min-height:44px;display:flex;align-items:center;color:#486c51;font-size:14px}.reading-login-layout{display:grid;grid-template-columns:1fr 440px;align-items:center;gap:55px;min-height:650px}.reading-welcome{text-align:center}.reading-welcome h1{font-size:42px;line-height:1.35;margin:16px 0}.reading-welcome p{color:#716454}.reading-welcome img{width:100%;max-width:420px;height:300px;object-fit:contain}.reading-welcome small{color:#716454}.account-refined #account-auth{max-width:none;width:100%;margin:18px 0;padding:30px 30px 36px;border:1px solid #e6dcc8;border-radius:28px;background:#fffef9 url('../assets/storybook-garden-v1.png') center bottom/100% auto no-repeat;box-shadow:0 10px 32px #6b4c1710;background-size:100% 24px}.account-refined #account-auth h2{font-size:28px;text-align:center;margin:0 0 6px}.account-refined #account-auth>p:first-of-type{text-align:center;font-size:13px;color:#716454;margin:0 0 20px}.account-refined .account-welcome-art{display:none}.account-refined #account-form label{font-size:14px;font-weight:650}.account-refined #account-form small{font-weight:400;color:#716454}.account-refined #account-form input:not([type=checkbox]){min-height:52px;background:white;border:1px solid #ded8cb;border-radius:14px;color:#4d3529;font-size:16px}.account-refined #account-submit{min-height:54px;background:#ffe28b;border:1px solid #e5c36c;border-radius:15px;font-weight:750;font-size:16px}.account-refined #account-toggle{min-height:48px;color:#486c51;background:#fffef9;border:1px solid #e6dcc8;border-radius:14px}.reading-after-login{text-align:center;font-size:12px;color:#716454;margin:10px 0}.reading-password-wrap{position:relative;display:block}.reading-password-wrap input{padding-right:55px}.reading-show-password{position:absolute;right:5px;top:4px;min-height:44px;min-width:48px;padding:5px;border:0;background:transparent;color:#486c51;font-size:13px}.account-refined #forgot-password{margin:12px 0}.account-refined #forgot-password>summary{min-height:44px;cursor:pointer;display:flex;align-items:center;color:#486c51}.account-refined:not(.is-authenticated) #deletion-status-panel:not(:target):not([open]){display:none}.account-refined.is-authenticated .reading-login-layout{display:block;min-height:0}.account-refined.is-authenticated .reading-welcome{display:none}.reading-account-title{margin-top:24px}.account-refined:not(.is-authenticated) .reading-account-title{display:none}.account-refined .account-story-welcome{display:none}.account-refined .reading-album-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin:20px 0}.account-refined .reading-album-grid button{min-height:86px;text-align:left;border:1px solid #ded8cb;background:#fffdf5;border-radius:18px;padding:16px 20px;color:#4d3529}.account-refined .reading-album-grid button:after{content:'翻開相簿 →';display:block;font-size:13px;margin-top:8px;color:#486c51}.account-refined #account-home>.home-heading{margin-top:22px}.account-refined .card>summary{min-height:44px;cursor:pointer}.account-refined footer{color:#716454}.account-refined footer a{display:inline-flex;min-height:44px;align-items:center}
@media(max-width:760px){.account-refined .account-shell{padding:18px 18px 30px}.reading-brand{font-size:18px}.reading-brand img{width:36px;height:36px}.reading-top-actions{gap:8px}.reading-top-actions a{font-size:12px}.reading-login-layout{display:block;min-height:0;max-width:460px;margin:auto}.reading-welcome{height:144px;overflow:hidden}.reading-welcome h1,.reading-welcome p,.reading-welcome small{display:none}.reading-welcome img{height:144px;width:230px}.account-refined #account-auth{padding:24px 22px 32px;margin:0}.account-refined #account-auth h2{font-size:25px}.viewer-image-status{top:32%;font-size:13px}.current-user-badge{align-self:center}.account-refined .reading-album-grid{grid-template-columns:1fr!important}}
@media(prefers-reduced-motion:reduce){.photo-preview-pending{animation:none}*{scroll-behavior:auto!important}}

.account-refined #account-form #account-submit{color:#4d3529;background:#ffe28b}.account-refined #account-form .reading-show-password{background:transparent;color:#486c51;box-shadow:none;border:0;min-width:48px;font-size:13px;padding:5px}.account-refined #account-form input::placeholder{color:#756957}

@media(max-width:760px){.storybook-page .header-right .header-btn{display:flex;flex-direction:column;justify-content:center;gap:2px;min-height:54px;padding:6px 8px}.storybook-page .header-right .btn-label{white-space:nowrap;font-size:12px}}

/* Keep the same photo space while the next image is downloading/decoding. */
.storybook-page .photo-modal:not(.viewer-immersive) #modalImage{height:min(64dvh,640px);min-height:min(64dvh,640px);object-fit:contain}
@media(max-width:768px){.storybook-page .photo-modal:not(.viewer-immersive) #modalImage{height:28dvh;min-height:28dvh}}
@media(max-width:360px){.storybook-page .photo-modal:not(.viewer-immersive) #modalImage{height:21dvh;min-height:21dvh}}

.account-refined #reading-account-shell{max-width:1120px;color:var(--reading-ink)}
.account-refined #reading-account-shell .account-header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;border:0}
@media(max-width:1000px){.reading-login-layout{display:block;max-width:460px;min-height:0;margin:auto}.reading-welcome{height:144px;overflow:hidden}.reading-welcome h1,.reading-welcome p,.reading-welcome small{display:none}.reading-welcome img{height:144px;width:230px}}

@media(min-width:1001px){.reading-welcome img{display:block;margin:12px auto}.reading-welcome small{display:block;margin-top:12px}}

/* Tag editing is a fixed action row; photo details alone may scroll. */
html body.app-ui.app-ui #photoModal .modal-info > .modal-tags-edit{flex:0 0 auto;margin:0;padding:6px 0 0;border-top:1px solid var(--app-line)}
html body.app-ui.app-ui #photoModal .modal-tags-edit .tags-edit-row{display:flex;flex-direction:row;align-items:center;gap:4px;min-width:0;padding:3px;border:1px solid var(--app-line);border-radius:12px;background:var(--app-paper,#fff)}
html body.app-ui.app-ui #photoModal .tags-edit-row:focus-within{border-color:var(--app-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--app-accent) 18%,transparent)}
html body.app-ui.app-ui #photoModal .tags-edit-row #editTagsInput{flex:1 1 0;width:0;min-width:0;min-height:44px;margin:0;padding:8px;border:0;border-radius:8px;background:transparent;font:inherit;line-height:1.25;box-shadow:none}
html body.app-ui.app-ui #photoModal .tags-edit-row .save-tags-btn{flex:0 0 auto;width:auto;min-width:64px;min-height:44px;margin:0;padding:8px 10px;border-radius:9px;white-space:nowrap;font:inherit;font-weight:700;line-height:1.25}
@media(max-width:768px) and (max-height:500px){
 html body.app-ui.app-ui #photoModal:not(.viewer-immersive):has(.tags-edit-row:focus-within) #modalImage{height:8dvh;max-height:8dvh;min-height:0}
}
