/* =========================================================
   EXIF viewer — consolidated stylesheet
   Sections: base · background · empty view · workspace ·
   tags · overlays · responsive
   ========================================================= */


/* =========================================================
   base.css
   ========================================================= */

/* =========================================================
   EXIF viewer — tokens, page shell & shared UI
   ========================================================= */

:root {
    --bg: #0a0c10;
    --text: #e9edf3;
    --muted: #8b94a3;
    --line: rgba(255, 255, 255, .09);
    --line-soft: rgba(255, 255, 255, .055);
    --accent: #6ea8fe;
    --accent-2: #9d7bff;
    --good: #3ddc97;
    --danger: #ff7b8a;
    --radius: 16px;
    --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-gutter: stable;
}
html::-webkit-scrollbar { width: 4px; height: 4px; }
html::-webkit-scrollbar-track { background-color: #1b1f22; }
html::-webkit-scrollbar-thumb { background: #4e4e4e; border-radius: 2px; }
html::-webkit-scrollbar-thumb:hover { background: #6a6a6a; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
    background:
        radial-gradient(1100px 700px at 10% -12%, rgba(110, 168, 254, .16), transparent 60%),
        radial-gradient(900px 620px at 105% 8%, rgba(157, 123, 255, .14), transparent 55%),
        radial-gradient(900px 560px at 50% 118%, rgba(61, 220, 151, .07), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

/* Soft drifting light behind the empty state (hidden under the photo backdrop). */
body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -2;
    width: 56vmax;
    height: 56vmax;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(72px);
    opacity: .55;
}
body::before {
    top: -24vmax;
    left: -14vmax;
    background: radial-gradient(circle, rgba(110, 168, 254, .3), rgba(110, 168, 254, 0) 66%);
    animation: aurora-a 19s ease-in-out infinite alternate;
}
body::after {
    right: -18vmax;
    bottom: -28vmax;
    background: radial-gradient(circle, rgba(157, 123, 255, .26), rgba(157, 123, 255, 0) 66%);
    animation: aurora-b 24s ease-in-out infinite alternate;
}
@keyframes aurora-a {
    to { transform: translate3d(9vmax, 7vmax, 0) scale(1.1); }
}
@keyframes aurora-b {
    to { transform: translate3d(-8vmax, -6vmax, 0) scale(1.14); }
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.glass {
    background-color: rgba(16, 19, 25, 0);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .04));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .07);
    transition: background-color .55s ease;
}
body.has-photo-bg .glass { background-color: rgba(14, 17, 23, .62); }

@keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes panel-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
@keyframes title-sheen {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes ring-pulse {
    0% { transform: scale(.9); opacity: .55; }
    70%, 100% { transform: scale(1.2); opacity: 0; }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
    transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .2s ease;
}
.btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); }
.btn:active { transform: translateY(1px); }
.btn.primary {
    border-color: rgba(110, 168, 254, .5);
    background: linear-gradient(135deg, rgba(110, 168, 254, .26), rgba(157, 123, 255, .22));
    box-shadow: 0 6px 20px rgba(110, 168, 254, .14);
}
.btn.primary:hover {
    background: linear-gradient(135deg, rgba(110, 168, 254, .38), rgba(157, 123, 255, .32));
    box-shadow: 0 8px 28px rgba(110, 168, 254, .28);
}
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn.small { height: 28px; padding: 0 10px; gap: 5px; border-radius: 8px; font-size: 12px; }
.btn.small svg { width: 13px; height: 13px; }
.btn.icon-only { width: 28px; padding: 0; justify-content: center; }

/* =========================================================
   background.css
   ========================================================= */

/* =========================================================
   EXIF viewer — selected photo backdrop & corner exit icon
   ========================================================= */

.photo-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg);
    opacity: 0;
    transition: opacity .55s ease;
}
.photo-bg.show { opacity: 1; }
.photo-bg-layer {
    position: absolute;
    inset: -10vmax;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(1.04);
    filter: blur(26px) saturate(1.02) brightness(.8);
    transition: opacity .7s ease;
}
.photo-bg-layer.visible { opacity: 1; }
.photo-bg-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 90% at 50% 12%, rgba(10, 12, 16, .04), rgba(10, 12, 16, .38) 82%),
        linear-gradient(180deg, rgba(10, 12, 16, .14), rgba(10, 12, 16, .46)),
        linear-gradient(135deg, rgba(110, 168, 254, .1), rgba(157, 123, 255, .08) 55%, transparent);
}

/* ---------- corner icon — identical to worldforge.html ---------- */
.gallery_icon {
    display: block;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 53.3333px;
    height: 53.3333px;
    cursor: pointer;
    border-radius: 100%;
    text-indent: 4rem;
    overflow: hidden;
    white-space: nowrap;
    background-size: 20px 20px;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 9998;
}
.gallery_icon::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 100%;
    background-color: var(--background-color, rgba(255, 255, 255, 0));
    transition: background-color .2s ease-in-out;
}
.gallery_icon:hover::before { background-color: rgba(255, 255, 255, .15); }
.gallery_icon:active::before { background-color: rgba(255, 255, 255, .3); }

.exif-exit {
    position: fixed;
    top: 16px;
    left: auto;
    /* The page keeps a stable scrollbar gutter; subtract it so the circle sits
       the same distance from the window edge as it does in worldforge.html. */
    right: calc(16px - (100vw - 100%));
    background-image: url('../../images/exit-w.png');
}

/* worldforge scales this geometry from a 16pt root font. The EXIF page keeps
   the browser default root size, so the same breakpoints are expressed in px. */
@media screen and (max-width: 1680px) {
    .gallery_icon { top: 12px; right: 12px; width: 40px; height: 40px; }
    .exif-exit { top: 12px; right: calc(12px - (100vw - 100%)); }
}
@media screen and (max-width: 736px) {
    .gallery_icon { top: 12.8333px; right: 12.8333px; width: 33px; height: 33px; background-size: 14px 14px; }
    .exif-exit { top: 12.8333px; right: calc(12.8333px - (100vw - 100%)); }
}
@media screen and (max-width: 360px) {
    .gallery_icon { top: 11.6667px; right: 11.6667px; width: 30px; height: 30px; }
    .exif-exit { top: 11.6667px; right: calc(11.6667px - (100vw - 100%)); }
}

/* =========================================================
   empty.css
   ========================================================= */

/* =========================================================
   EXIF viewer — intro, dropzone, privacy pill & film showcase
   ========================================================= */

/* ---------- intro (shown only before photos are added) ---------- */
.intro {
    max-width: 760px;
    margin: 0 auto 28px;
    text-align: center;
    animation: rise-in .65s cubic-bezier(.2, .75, .25, 1) both;
}

.intro h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: .02em;
    background: linear-gradient(105deg, #ffffff 8%, #bcd4ff 38%, #ded0ff 62%, #ffffff 92%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: title-sheen 10s ease-in-out infinite;
}
.intro p { margin: 8px auto 0; max-width: 660px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.intro .intro-stats { margin-top: 12px; font-variant-numeric: tabular-nums; }
.intro-stats span { color: var(--accent); font-weight: 600; }

/* ---------- empty state ---------- */
.empty-view {
    --lift: 10vh;
    position: relative;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: max(900px, 100vh);
    margin: 0 auto;
    padding: 74px 0 calc(var(--lift) * 2);
    overflow: hidden;
}
.empty-inner { position: relative; z-index: 2; width: 100%; max-width: 940px; margin: 0 auto; padding: 0 24px; pointer-events: none; }
.empty-inner .intro, .empty-inner .privacy, .empty-inner .dropzone, .empty-inner .batch-import { pointer-events: auto; }

.dropzone {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 42px 28px;
    text-align: center;
    border: 1.5px dashed rgba(255, 255, 255, .26);
    border-radius: 26px;
    background:
        radial-gradient(520px 280px at 50% 0%, rgba(110, 168, 254, .16), transparent 72%),
        linear-gradient(160deg, rgba(22, 28, 39, .46), rgba(9, 12, 18, .28));
    -webkit-backdrop-filter: blur(8px) saturate(1.22);
    backdrop-filter: blur(8px) saturate(1.22);
    cursor: pointer;
    outline: none;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .06),
        0 0 70px rgba(110, 168, 254, .06);
    animation: fade-in .6s .06s ease both;
    transition: border-color .22s ease, background .22s ease, transform .22s ease, box-shadow .22s ease;
}
.dropzone:hover, .dropzone:focus-visible {
    border-color: rgba(110, 168, 254, .68);
    background:
        radial-gradient(540px 300px at 50% 0%, rgba(110, 168, 254, .22), transparent 72%),
        linear-gradient(160deg, rgba(28, 35, 48, .5), rgba(11, 15, 22, .32));
    -webkit-backdrop-filter: blur(7px) saturate(1.3);
    backdrop-filter: blur(7px) saturate(1.3);
    transform: translateY(-3px);
    box-shadow: 0 32px 84px rgba(0, 0, 0, .34), 0 0 0 4px rgba(110, 168, 254, .06),
        0 0 64px rgba(110, 168, 254, .15), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.dropzone .drop-icon {
    position: relative;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(110, 168, 254, .2), rgba(157, 123, 255, .18));
    border: 1px solid rgba(110, 168, 254, .35);
    box-shadow: 0 10px 30px rgba(110, 168, 254, .18);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}
.dropzone:hover .drop-icon {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 14px 38px rgba(110, 168, 254, .28);
}
.dropzone .drop-icon::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(110, 168, 254, .28);
    animation: ring-pulse 3.2s ease-out infinite;
    pointer-events: none;
}
.dropzone .drop-icon svg { width: 30px; height: 30px; color: var(--accent); }
.dropzone h2 { text-shadow: 0 0 26px rgba(110, 168, 254, .18); }
.dropzone h2 { margin: 0; font-size: 21px; font-weight: 600; }
.dropzone p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.dropzone .link { color: var(--accent); border-bottom: 1px solid rgba(110, 168, 254, .5); padding-bottom: 1px; }
.formats { margin-top: 18px; font-size: 11px; letter-spacing: .16em; color: rgba(139, 148, 163, .8); text-transform: uppercase; }
.batch-import { margin-top: 14px; text-align: center; }
.privacy {
    width: max-content;
    max-width: calc(100% - 32px);
    margin: 18px auto 0;
    padding: 6px 14px;
    border-radius: 999px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: rgba(10, 13, 18, .42);
    border: 1px solid rgba(255, 255, 255, .05);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: fade-in .6s .18s ease both;
}
.privacy svg { width: 13px; height: 13px; color: var(--good); }
.privacy-short { display: none; }

/* ---------- film showcase ---------- */
.showcase { position: absolute; top: 74px; right: 0; bottom: 0; left: 0; z-index: 0; margin: 0; pointer-events: none; }

.film-stage {
    position: absolute;
    inset: 0;
    height: auto;
    overflow: hidden;
    animation: fade-in 1s .14s ease both;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.film-strip {
    position: absolute;
    left: 50%;
    width: max-content;
    padding: 17px 0;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: linear-gradient(180deg, #0b0d12, #07090d);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
    transform-origin: center;
    will-change: transform;
    pointer-events: auto;
    transition: filter .45s ease, opacity .45s ease;
}
.film-strip::before,
.film-strip::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 9px;
    z-index: 2;
    background-image: radial-gradient(circle at 8px 50%, rgba(255, 255, 255, .42) 0 2.6px, transparent 3px);
    background-size: 22px 100%;
    background-repeat: repeat-x;
    opacity: .55;
    pointer-events: none;
}
.film-strip::before { top: 3px; }
.film-strip::after { bottom: 3px; opacity: .42; }

.film-track {
    display: flex;
    width: max-content;
    animation: film-scroll var(--dur, 70s) linear infinite;
    will-change: transform;
}
.film-track.reverse { animation-direction: reverse; }
.film-group { display: flex; gap: 6px; padding-right: 6px; }

.film-strip:hover .film-track { animation-play-state: paused; }

.film-frame {
    position: relative;
    flex: none;
    width: 188px;
    height: 122px;
    margin: 0;
    overflow: hidden;
    border-radius: 3px;
    background: #12151c;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.film-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.2, .75, .25, 1), filter .3s ease;
}
.film-frame:hover img { transform: scale(1.06); filter: brightness(1.08) saturate(1.05); }

.film-back {
    top: calc(50% - var(--lift) - 135px);
    --dur: 104s;
    z-index: 1;
    opacity: .76;
    transform: translate(-50%, -50%) rotate(6.5deg) scale(.86);
    filter: blur(2.6px) brightness(.6) saturate(.75);
}
.film-mid {
    top: calc(50% - var(--lift) + 20px);
    --dur: 86s;
    z-index: 2;
    opacity: .88;
    transform: translate(-50%, -50%) rotate(-4.2deg) scale(.97);
    filter: blur(1.1px) brightness(.8) saturate(.85);
}
.film-front {
    top: calc(50% - var(--lift) + 330px);
    --dur: 70s;
    z-index: 3;
    transform: translate(-50%, -50%) rotate(2.6deg) scale(1.06);
    box-shadow: 0 36px 110px rgba(0, 0, 0, .7);
}
.film-back:hover { opacity: .95; filter: blur(1.3px) brightness(.74) saturate(.85); }
.film-mid:hover { opacity: 1; filter: blur(.25px) brightness(.9) saturate(.95); }

@keyframes film-scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

/* =========================================================
   workspace.css
   ========================================================= */

/* =========================================================
   EXIF viewer — workspace, sidebar, photo card & summary
   ========================================================= */

.workspace {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 74px 22px 22px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 74px;
    max-height: calc(100vh - 96px);
    display: flex;
    flex-direction: column;
    animation: fade-in .45s ease both;
}

.sidebar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 9px 10px 9px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
    letter-spacing: .14em;
    color: var(--muted);
    text-transform: uppercase;
    flex: none;
}
.sidebar-head .count { letter-spacing: 0; font-family: var(--mono); }
.sidebar-head-label { white-space: nowrap; }
.sidebar-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.sidebar-actions .btn { letter-spacing: 0; text-transform: none; }

.file-list {
    /* Reach past the card's left border, like the color-grade page, so the
       scrollbar hangs in the page margin instead of over the thumbnails. JS
       replaces the fallback with the measured gutter. */
    width: calc(100% + var(--rail-extra, 12px));
    min-width: 0;
    margin-left: calc(-1 * var(--rail-extra, 12px));
    padding: 8px 8px 8px 10px;
    /* The vertical scrollbar follows the inline direction, so RTL moves it to
       the left edge. Cards get their own direction back below. */
    direction: rtl;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .16) transparent;
}
.file-list::-webkit-scrollbar { width: 8px; height: 8px; }
.file-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 2px solid transparent;
    background-clip: padding-box;
}
.file-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .26); background-clip: padding-box; }

.file-item {
    direction: ltr;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 9px;
    margin-bottom: 3px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .2s ease, transform .15s ease;
}
.file-item:hover { background: rgba(255, 255, 255, .05); transform: translateX(2px); }
.file-item.active {
    background: rgba(110, 168, 254, .13);
    border-color: rgba(110, 168, 254, .38);
    box-shadow: 0 6px 20px rgba(40, 80, 160, .12);
}

.file-thumb {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 9px;
    overflow: hidden;
    background: #12151c;
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 9px;
    color: var(--muted);
    letter-spacing: .04em;
}
.file-thumb .thumb-ext {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}
.file-thumb img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }

.file-meta { min-width: 0; }
.file-name { font-size: 13px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub {
    margin-top: 3px;
    font-size: 11px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
}
.file-sub .dot { opacity: .5; }
.file-sub .err { color: var(--danger); }

.spinner {
    width: 10px;
    height: 10px;
    border: 1.5px solid rgba(255, 255, 255, .2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- detail ---------- */
.detail { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 320px;
    padding: 40px;
    color: var(--muted);
    font-size: 14px;
}
.loading-card .spinner { width: 26px; height: 26px; border-width: 2px; }

.photo-card {
    display: grid;
    grid-template-columns: minmax(240px, 38%) minmax(0, 1fr);
    gap: 20px;
    padding: 16px;
    animation: rise-in .5s cubic-bezier(.2, .75, .25, 1) both;
}

.preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    max-height: 380px;
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(45deg, #0e1116 25%, #131820 25%, #131820 50%, #0e1116 50%, #0e1116 75%, #131820 75%);
    background-size: 20px 20px;
    border: 1px solid var(--line);
}
.preview a { display: flex; align-items: center; justify-content: center; max-width: 100%; max-height: 380px; }
.preview img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    display: block;
    transition: transform .5s cubic-bezier(.2, .75, .25, 1), filter .5s ease;
}
.preview a:hover img { transform: scale(1.025); filter: brightness(1.05); }
.preview-fallback[hidden] { display: none; }
.preview-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 30px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}
.preview-fallback .ext {
    font-family: var(--mono);
    font-size: 22px;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .55);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 18px;
}

.photo-info { min-width: 0; display: flex; flex-direction: column; gap: 13px; }
.photo-title { display: flex; align-items: flex-start; gap: 10px; }
.photo-title h2 { flex: 1; margin: 0; font-size: 18px; font-weight: 600; letter-spacing: .015em; line-height: 1.35; overflow-wrap: anywhere; }

.icon-btn {
    flex: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, .04);
    background-image: url('../../images/close-w.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    opacity: .85;
    transition: opacity .2s ease, background-color .2s ease;
}
.icon-btn:hover { opacity: 1; background-color: rgba(255, 255, 255, .15); }
.icon-btn:active { background-color: rgba(255, 255, 255, .3); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips span {
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: var(--muted);
    font-family: var(--mono);
}

.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; align-content: start; }
.summary-card {
    padding: 10px 12px;
    border-radius: 11px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, .028);
    min-width: 0;
    transition: border-color .2s ease, background-color .2s ease;
}
.summary-card:not(.shutter-card):hover {
    border-color: rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .04);
}
.summary-card .lab { font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.summary-card .val { margin-top: 3px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.summary-card .val.mono { font-size: 12.5px; }

.summary-card.shutter-card {
    position: relative;
    overflow: hidden;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-color: rgba(110, 168, 254, .42);
    background:
        radial-gradient(420px 120px at 100% 0%, rgba(157, 123, 255, .18), transparent 70%),
        linear-gradient(135deg, rgba(110, 168, 254, .16), rgba(110, 168, 254, .04));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 28px rgba(40, 80, 160, .18);
    transition: border-color .25s ease, box-shadow .25s ease;
}
.shutter-card:not(.is-missing):hover {
    border-color: rgba(110, 168, 254, .62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 12px 38px rgba(40, 80, 160, .28);
}
.shutter-card .lab { color: #a9c5ff; letter-spacing: .18em; }
.shutter-card .shutter-src {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--muted);
    overflow-wrap: anywhere;
}
.shutter-card .shutter-value {
    flex: none;
    font-family: var(--mono);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: #dce9ff;
    text-shadow: 0 0 22px rgba(110, 168, 254, .45);
    font-variant-numeric: tabular-nums;
}
.shutter-card .shutter-value .num {
    background: linear-gradient(180deg, #ffffff 10%, #a9c8ff 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 16px rgba(110, 168, 254, .32));
}
.shutter-card .shutter-value .unit {
    margin-left: 3px;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
    text-shadow: none;
}
.shutter-card.is-missing {
    border-color: var(--line-soft);
    background: rgba(255, 255, 255, .022);
    box-shadow: none;
}
.shutter-card.is-missing .lab { color: var(--muted); }
.shutter-card.is-missing .shutter-value {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    text-shadow: none;
}
.shutter-card.is-missing .shutter-src { max-width: 300px; }
.map-links { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.map-links a { font-size: 11px; text-decoration: none; opacity: .9; }
.map-links a:hover { text-decoration: underline; }

/* =========================================================
   tags.css
   ========================================================= */

/* =========================================================
   EXIF viewer — toolbar, segment tabs & tag table
   ========================================================= */

/* ---------- toolbar ---------- */
.tag-toolbar {
    position: sticky;
    top: 72px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px;
    animation: fade-in .4s ease both;
}
.search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, .24);
}
.search:focus-within { border-color: rgba(110, 168, 254, .55); }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 13px; }
.search input::placeholder { color: rgba(139, 148, 163, .75); }
.search input:disabled { cursor: default; }

/* ---------- segments ---------- */
.seg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 11px;
}
.seg-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 5px 8px 5px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .11);
    background-color: rgba(255, 255, 255, .055);
    color: #dfe6f1;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .015em;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease,
        box-shadow .16s ease, transform .16s ease;
}
.seg-tab:hover {
    background-color: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .2);
    transform: translateY(-1px);
}
.seg-tab:active { transform: translateY(1px); }
.seg-tab:focus-visible {
    outline: 2px solid rgba(110, 168, 254, .75);
    outline-offset: 2px;
}
.seg-tab.active {
    background-color: rgba(255, 255, 255, .9);
    border-color: rgba(255, 255, 255, .9);
    color: #111722;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .3), 0 0 0 3px rgba(255, 255, 255, .05);
    transform: translateY(-1px);
}
.seg-tab.active:active { transform: translateY(1px); }
.seg-tab[disabled] { cursor: default; }
.seg-tab[disabled]:hover, .seg-tab[disabled]:active { transform: none; }

/* Loading placeholders: keep the tab row visible while metadata is parsed. */
.seg-tabs.is-loading .seg-tab { opacity: .68; }
.seg-tabs.is-loading .seg-tab.active { opacity: .9; }
.seg-tabs.is-loading .seg-tab-count { animation: loading-pulse 1.2s ease-in-out infinite; }
.loading-panel .loading-card { min-height: 240px; }

@keyframes loading-pulse {
    0%, 100% { opacity: .35; }
    50% { opacity: 1; }
}
.seg-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .1);
    background-color: rgba(0, 0, 0, .18);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 400;
    line-height: 1;
    color: rgba(223, 230, 241, .66);
}
.seg-tab.active .seg-tab-count {
    border-color: rgba(17, 23, 34, .14);
    background-color: rgba(17, 23, 34, .09);
    color: rgba(17, 23, 34, .7);
}
.seg-panel {
    overflow: hidden;
    animation: panel-in .32s cubic-bezier(.2, .75, .25, 1) both;
}
#segments.is-filtering .seg-panel { animation: none; }
.tag-table > .tag-row:first-child { border-top: 0; }

.tag-row {
    display: grid;
    grid-template-columns: minmax(170px, 32%) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 10px 16px;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
}
.tag-row:nth-child(even) { background: rgba(255, 255, 255, .017); }
.tag-row:hover { background: rgba(255, 255, 255, .038); }

.tag-key { min-width: 0; }
.tag-key .zh { display: block; line-height: 1.35; color: #dfe6f1; }
.tag-key .en { display: block; margin-top: 2px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); overflow-wrap: anywhere; }
.tag-key .en.only { margin-top: 0; font-size: 12px; color: #dfe6f1; }

.tag-val {
    min-width: 0;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.55;
    color: #c8d3e3;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.tag-val .v-null { color: var(--muted); font-style: italic; }
.tag-val .v-date { color: #9ecbff; }
.tag-val .v-enum { color: #b9e6d1; font-family: "Source Sans Pro", sans-serif; font-size: 13px; }
.tag-val .v-bin { color: #c9b8ff; }
.tag-val .v-str { white-space: pre-wrap; }

.tag-val .expandable {
    display: block;
    max-height: 4.7em;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
}
.tag-val .expandable.open { max-height: none; cursor: zoom-out; }
.tag-val .expandable::after {
    content: "… 点击展开";
    position: absolute;
    right: 0;
    bottom: 0;
    padding-left: 28px;
    font-family: "Source Sans Pro", sans-serif;
    font-size: 10.5px;
    color: var(--accent);
    background: linear-gradient(90deg, transparent, #141820 35%);
}
.tag-val .expandable.open::after { display: none; }

.raw-panel pre {
    margin: 0;
    padding: 16px;
    max-height: 520px;
    overflow: auto;
    background: rgba(0, 0, 0, .24);
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.55;
    color: #b8c4d5;
    white-space: pre;
}
.raw-panel pre::-webkit-scrollbar { width: 8px; height: 8px; }
.raw-panel pre::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 2px solid transparent;
    background-clip: padding-box;
}
.raw-panel pre::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .26); background-clip: padding-box; }

.empty-exif, .no-result, .error-box {
    padding: 34px 24px;
    border-radius: var(--radius);
    border: 1px dashed rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .022);
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
}
.error-box { border-color: rgba(255, 123, 138, .35); color: #ffc3c9; background: rgba(255, 123, 138, .07); }
.empty-exif strong, .error-box strong { display: block; margin-bottom: 6px; color: var(--text); font-size: 15px; font-weight: 600; }

.footnote { text-align: center; font-size: 11px; color: rgba(139, 148, 163, .7); padding: 2px 0 8px; }
.footnote a { text-decoration: none; }
.footnote a:hover { text-decoration: underline; }

/* =========================================================
   overlays.css
   ========================================================= */

/* =========================================================
   EXIF viewer — drag overlay & toast
   ========================================================= */

.drag-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 14, .8);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    pointer-events: none;
}
.drag-overlay.show { display: flex; }
.drag-overlay div {
    padding: 46px 68px;
    border: 2px dashed rgba(110, 168, 254, .7);
    border-radius: 24px;
    background: rgba(110, 168, 254, .09);
    font-size: 19px;
    letter-spacing: .04em;
    box-shadow: 0 0 80px rgba(110, 168, 254, .18);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    z-index: 300;
    transform: translate(-50%, 20px);
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(24, 28, 36, .94);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    max-width: min(90vw, 560px);
    text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   responsive.css
   ========================================================= */

/* =========================================================
   EXIF viewer — responsive & reduced-motion adjustments
   ========================================================= */

@media (max-width: 980px) {
    .workspace { grid-template-columns: 1fr; padding: 70px 14px 14px; gap: 14px; }
    .sidebar { position: static; max-height: none; /* Clip the horizontal rail to the card. */ overflow: hidden; }
    /* The rail moves under the card again so the horizontal filmstrip scrolls
       inside it instead of past the rounded corners. */
    .file-list { display: flex; gap: 6px; width: auto; margin-left: 0; direction: ltr; scrollbar-gutter: auto; overflow-x: auto; overflow-y: hidden; padding: 8px; }
    .file-item { flex: 0 0 236px; margin-bottom: 0; }
    .photo-card { grid-template-columns: 1fr; gap: 14px; }
    .preview, .preview a, .preview img { max-height: 320px; }
    .summary-grid { margin-top: 4px; }
    .tag-toolbar { top: 72px; }
    .film-frame { width: 162px; height: 108px; }
}

@media (max-width: 720px) {
    .intro { margin-bottom: 22px; }
    .intro h1 { font-size: 22px; line-height: 1.3; }
    .intro p { font-size: 12.5px; }
    .sidebar-head { padding: 8px 8px 8px 13px; }
    .sidebar-head-label { font-size: 10px; letter-spacing: .1em; }
    .empty-view { min-height: max(790px, 100vh); margin: 0 auto; padding: 70px 0 calc(var(--lift) * 2); }
    .showcase { top: 70px; }
    .empty-inner { padding: 0 14px; }
    .privacy { font-size: 11.5px; white-space: nowrap; }
    .privacy-full { display: none; }
    .privacy-short { display: inline; }
    .film-strip { padding: 13px 0; border-radius: 6px; }
    .film-strip::before, .film-strip::after { height: 8px; background-size: 19px 100%; }
    .film-frame { width: 132px; height: 90px; }
    .film-back { top: calc(50% - var(--lift) - 100px); transform: translate(-50%, -50%) rotate(7deg) scale(.85); filter: blur(2px) brightness(.58) saturate(.75); }
    .film-mid { top: calc(50% - var(--lift) + 30px); transform: translate(-50%, -50%) rotate(-4.5deg) scale(.94); filter: blur(.8px) brightness(.78) saturate(.85); }
    .film-front { top: calc(50% - var(--lift) + 290px); transform: translate(-50%, -50%) rotate(2.4deg) scale(1.01); }
    .dropzone { min-height: 300px; padding: 30px 18px; }
    .dropzone h2 { font-size: 18px; }
    .formats { letter-spacing: .1em; font-size: 10px; }
    .photo-card { padding: 12px; }
    .summary-grid { grid-template-columns: 1fr; }
    .shutter-card { flex-direction: column; align-items: flex-start; gap: 9px; }
    .shutter-card .shutter-value { font-size: 28px; }
    .tag-row { grid-template-columns: 1fr; gap: 4px; padding: 10px 13px; }
    .tag-key .zh { font-size: 12px; color: var(--muted); }
    .tag-key .en { font-size: 10px; }
    .tag-toolbar { flex-wrap: wrap; top: 60px; }
    .search { flex-basis: 100%; }
    .tag-toolbar .btn { flex: 1; justify-content: center; }
    .seg-tabs { gap: 6px; }
    .seg-tab { min-height: 31px; padding: 5px 7px 5px 11px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .film-track { animation: none !important; }
}
