* { box-sizing: border-box; }
body { margin: 0; background: #f3f5f7; color: #182533; font: 1rem/1.6 system-ui,"Microsoft JhengHei",sans-serif; }
button,input { font: inherit; }
button { cursor: pointer; }
a:focus-visible,button:focus-visible { outline: 2px solid #124b75; outline-offset: 3px; }
[hidden] { display: none !important; }
.album-list { max-width: 42rem; width: 100%; margin: auto; padding: 16px; }
.album-card { margin-bottom: 16px; padding: 16px; border: 1px solid #e0e5e9; border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.album-card h2 { margin: 0 0 12px; font-size: 1.125rem; line-height: 1.5; }
.album-card h2 a { color: #111; text-decoration: none; }
.album-card-body { display: flex; align-items: flex-start; gap: 12px; }
.album-card-photo { flex: 0 0 38%; min-width: 0; display: block; aspect-ratio: 4/3; background: #edf1f5; border-radius: 8px; overflow: hidden; }
.album-card-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.album-card-info { flex: 1; min-width: 0; }
.album-meta { margin: 0 0 6px; color: #4a5865; font-size: .8rem; overflow-wrap: anywhere; }
.album-excerpt { margin: 0; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.album-tools { display: flex; align-items: center; flex-wrap: nowrap; gap: 24px; margin-top: 12px; }
.album-tools button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 44px; width: 21px; padding: 0; border: 0; background: transparent; color: #4a5865; }
.album-tools svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.album-category { margin-left: auto; color: #111; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.album-pages { display: flex; justify-content: space-between; gap: 16px; }
.album-pages a,.album-back { display: inline-flex; align-items: center; min-height: 44px; padding: 8px; color: #17486d; text-decoration: none; }
.album-summary { margin-top: 0; color: #4a5865; font-size: .85rem; }
.album-detail-wrap { max-width: 50rem; width: 100%; margin: auto; }
.album-detail-content { max-width: 42rem; margin: auto; padding: 16px; overflow-wrap: anywhere; }
.album-detail-content h1 { margin: 0 0 8px; font-size: 1.4rem; color: #111; line-height: 1.5; }
.album-gallery { position: relative; width: 100%; aspect-ratio: 4/3; background: #151c25; overflow: hidden; }
.album-gallery-viewport { position: relative; width: 100%; height: 100%; overflow: hidden; touch-action: pan-y; }
.album-photo-track { display: flex; width: 100%; height: 100%; transform: translateX(-100%); will-change: transform; }
.album-slide { flex: 0 0 100%; width: 100%; height: 100%; min-width: 0; }
.album-slide img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.album-arrow { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 44px; border: 0; border-radius: 6px; background: #0006; color: #fff; font-size: 28px; }
.album-arrow:disabled { opacity: .3; cursor: default; }
.album-arrow.prev { left: 8px; }
.album-arrow.next { right: 8px; }
.album-photo-counter { position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 3px 8px; border-radius: 6px; background: #0009; color: #fff; font-size: .85rem; pointer-events: none; }
.album-gallery-empty { display: grid; place-items: center; height: 100%; color: #fff; }
.album-description { display: block; width: 100%; min-width: 0; border: 0; height: 120px; background: #fff; }
.album-extra-links { display: flex; gap: 16px; margin: 12px 0; }
.album-extra-links a { color: #17486d; }
.album-comment-preview { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; margin: 12px 0 24px; padding: 14px; border: 0; border-radius: 12px; background: #e9edf1; color: #182533; text-align: left; font: inherit; cursor: pointer; }
.album-comment-preview small { display: block; color: #4a5865; }
.album-panel { position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; max-height: 70vh; overflow-y: auto; padding: 12px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: #fff; box-shadow: 0 -6px 24px #0002; transform: translateY(100%); transition: transform .25s ease; }
.album-panel.is-open { transform: translateY(0); }
.album-panel header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.album-panel h2 { margin: 0; font-size: 1.125rem; }
.album-panel header button { width: 44px; height: 44px; border: 0; background: transparent; font: inherit; font-size: 24px; }
.album-panel-backdrop { position: fixed; z-index: 79; inset: 0; background: #0005; }
.album-status { position: fixed; z-index: 90; left: 16px; right: 16px; bottom: calc(66px + env(safe-area-inset-bottom)); margin: 0; padding: 8px 12px; border-radius: 8px; background: #fff; box-shadow: 0 2px 16px #0002; color: #4a5865; font-size: .85rem; }
.album-status:empty { display: none; }
.album-fullscreen { position: fixed; z-index: 100; inset: 0; display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh; background: #111; color: #fff; }
.album-fullscreen header { display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto; min-height: 56px; padding: env(safe-area-inset-top) 12px 0; }
.album-fullscreen header button { width: 44px; height: 44px; border: 0; background: transparent; color: #fff; font: inherit; font-size: 28px; }
.album-fullscreen .album-gallery { flex: 1; min-height: 0; aspect-ratio: auto; padding-bottom: env(safe-area-inset-bottom); }
body.album-fullscreen-open { overflow: hidden; }
@media(prefers-reduced-motion:reduce) { .album-panel { transition: none; } }

.mobile-header {
    background: #fff;
    border-bottom: 1px solid #e0e5e9;
}

.mobile-header-inner {
    position: relative;
    max-width: 42rem;
    margin: 0 auto;
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mobile-header h1 {
    margin: 0;
    font-size: 1.25rem;
}

.mobile-menu-toggle {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #e0e5e9;
    border-radius: .5rem;
    background: #fff;
    color: #111;
    font: 1.5rem/1 system-ui, sans-serif;
    cursor: pointer;
}

.mobile-menu-toggle:focus-visible {
    outline: 2px solid #124b75;
    outline-offset: 3px;
}

.mobile-menu {
    position: absolute;
    z-index: 1;
    top: 100%;
    right: 1rem;
    width: min(16rem, calc(100% - 2rem));
    overflow: hidden;
    border: 1px solid #e0e5e9;
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 .25rem 1rem rgb(0 0 0 / 15%);
}

.mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: .5rem 1rem;
    color: #111;
    text-decoration: none;
}

.mobile-menu a + a { border-top: 1px solid #e0e5e9; }

.mobile-menu a:hover,
.mobile-menu a:focus-visible {
    background: #f3f5f7;
    outline-offset: -2px;
}

/* Bottom navigation is scoped to the article list. */
body.mobile-list-page { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.list-toolbar {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(58px + env(safe-area-inset-bottom));
    padding: 0 16px env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid #e0e5e9;
}
.list-toolbar-group { display: flex; align-items: center; gap: 24px; }
.list-toolbar button, .list-toolbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #4a5865;
    cursor: pointer;
}
.list-toolbar svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.list-toolbar [aria-expanded="true"] { color: #1764c0; }
.list-panel {
    position: fixed;
    z-index: 31;
    left: 0;
    right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px 16px;
    border-top: 1px solid #e0e5e9;
    background: #fff;
    box-shadow: 0 -4px 16px rgb(0 0 0 / 8%);
}
.list-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.list-panel-close { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: #4a5865; font: inherit; font-size: 24px; cursor: pointer; }
.list-search-form { display: flex; align-items: center; gap: 8px; }
.list-search-form input { flex: 1; min-width: 0; width: 100%; min-height: 44px; padding: 8px; border: 1px solid #a6b1bc; border-radius: 5px; font: inherit; }
.list-search-form button { flex: 0 0 auto; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 5px; background: #17486d; color: white; font: inherit; cursor: pointer; }
.list-category-links a { display: flex; align-items: center; min-height: 48px; padding: 8px 0; color: #182533; text-decoration: none; overflow-wrap: anywhere; }
.list-category-links a + a { border-top: 1px solid #e0e5e9; }

body.album-panel-open { overflow: hidden; }
.album-panel { overscroll-behavior: contain; }
.album-panel-backdrop { touch-action: none; }

.album-gallery-empty { position: absolute; inset: 0; }

.album-gallery-empty { background: #edf1f5 url('album-default.svg') center/contain no-repeat; color: #182533; align-items: end; padding: 24px; }

/* Album interactions: preserve the gallery DOM and its current position. */
.album-tools button { width: auto; gap: 5px; cursor: pointer; }
.album-tools svg { flex: 0 0 21px; }
.album-tools .is-liked { color: #1877d2; }
.album-tools .is-liked svg { fill: #dcecff; }
.album-action-count { font: 12px/1.2 system-ui,sans-serif; }
.album-tools button:disabled { opacity: .6; }
.album-category { flex-shrink: 0; }
.album-panel { display: flex; flex-direction: column; max-height: min(85dvh,780px); }
.album-panel[hidden] { display: none; }
.album-panel header { flex: 0 0 auto; }
.album-comments-list { flex: 1 1 auto; min-height: 80px; overflow-y: auto; overscroll-behavior: contain; }
.album-comments-list article { padding: 12px 0; border-bottom: 1px solid #e0e5e9; overflow-wrap: anywhere; }
.album-comments-list time { display: block; color: #667788; font-size: 12px; }
.album-comments-list p,.album-comment-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.album-comment-form { flex: 0 0 auto; padding-top: 12px; border-top: 1px solid #e0e5e9; }
.album-comment-form label { display: block; font-size: 14px; }
.album-comment-form input,.album-comment-form textarea { display: block; box-sizing: border-box; width: 100%; min-width: 0; padding: 8px; margin: 4px 0 8px; border: 1px solid #a6b1bc; border-radius: 5px; font: inherit; }
.album-comment-form p { margin: 6px 0; font-size: 13px; }
.album-comment-form button,#album-comments-more,.album-admin button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 5px; background: #17486d; color: white; font: inherit; cursor: pointer; }
.album-comment-form .album-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.album-admin { background: #f3f5f7; color: #182533; font: 16px/1.6 system-ui,sans-serif; }
.album-admin main { max-width: 900px; margin: auto; padding: 16px; }
.album-admin nav,.album-admin form { display: flex; flex-wrap: wrap; gap: 12px; }
.album-admin article { padding: 16px; margin: 16px 0; border-radius: 12px; background: white; overflow-wrap: anywhere; }
.album-admin h2 { font-size: 18px; }

@media(max-height: 500px) { .album-panel { overflow-y: auto; } .album-comments-list { min-height: 60px; flex: 0 0 auto; max-height: 30dvh; } }
