:root {
    --color-bg: #fff;
    --color-bg-hover: #f5f5f5;
    --color-text: #111;
    --color-text-secondary: #767676;
    --color-red: #e60023;
    --color-border: rgba(17, 17, 17, 0.08);
    --color-border-strong: rgba(17, 17, 17, 0.12);
    --nav-height: 64px;
    --filter-top: var(--nav-height);
    --filter-height: 64px;
    --content-top-gap: 28px;
    --main-content-top: 156px;
    --radius: 16px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

h1,
h2,
h3,
h4 {
    font-family: inherit;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    min-height: var(--nav-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-logo {
    width: 32px;
    height: 32px;
    background: var(--color-red);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50%;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-links::-webkit-scrollbar,
.filter-container::-webkit-scrollbar,
.lightbox-img-wrapper::-webkit-scrollbar {
    display: none;
}

.nav-links a {
    padding: 0.55rem 0.85rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 24px;
    white-space: nowrap;
    transition: background 0.18s ease, transform 0.18s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--color-bg-hover);
}

.filter-container {
    position: fixed;
    top: var(--filter-top);
    left: 0;
    right: 0;
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    min-height: var(--filter-height);
    background: rgba(255, 255, 255, 0.9);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overscroll-behavior-x: contain;
}

.filter-btn {
    flex-shrink: 0;
    padding: 0.38rem 0.75rem;
    background: var(--color-bg-hover);
    border: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-height: 30px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.filter-btn:hover {
    background: #efefef;
}

.filter-btn.active {
    background: var(--color-text);
    color: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 4px 10px rgba(0, 0, 0, 0.06);
}

.filter-btn:active {
    transform: scale(0.98);
}

.main-content {
    padding: var(--main-content-top) 1.5rem 3rem;
}

.main-content.is-switching .masonry {
    opacity: 0.38;
    transform: translateY(4px);
}

.masonry {
    display: grid;
    grid-template-columns: repeat(var(--masonry-columns, 2), minmax(0, 1fr));
    gap: 0.85rem;
    align-items: start;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.masonry.detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.masonry-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.pin-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transform: translateZ(0);
    background: transparent;
    border: none;
    padding: 0;
    content-visibility: auto;
    contain-intrinsic-size: 320px;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.pin-card.white-card {
    background: #fff;
    border: 1px solid rgba(17, 17, 17, 0.06);
    padding: 4px;
}

.pin-card-frame {
    position: relative;
    width: 100%;
    min-height: 180px;
    border-radius: 14px;
    overflow: hidden;
    background: #f4f4f4;
    aspect-ratio: var(--card-ratio, 4 / 5);
    transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.pin-card-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0) 35%, rgba(17,17,17,0.06) 100%);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.pin-card-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, #f2f2f2 8%, #fafafa 18%, #f2f2f2 33%);
    background-size: 200% 100%;
    animation: card-shimmer 1.25s linear infinite;
}

.pin-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    background: #fff;
    object-fit: initial;
    max-height: none;
    filter: saturate(0.96);
}

.pin-image {
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: scale(1.015);
}

.pin-card.is-ready .pin-card-frame {
    min-height: 0;
    aspect-ratio: auto;
    background: transparent;
}

.pin-card.is-ready .pin-image {
    opacity: 1;
    transform: scale(1);
}

.pin-card.is-ready .pin-card-skeleton {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.pin-card img.loaded {
    filter: saturate(1);
}

.pin-card:hover {
    transform: translateY(-6px);
}

.pin-card:hover .pin-card-frame {
    box-shadow: 0 20px 44px rgba(17, 17, 17, 0.14);
}

.pin-card:hover .pin-card-frame::after {
    opacity: 1;
}

.pin-card:hover img {
    transform: scale(1.045);
    filter: saturate(1.04) contrast(1.01);
}

.pin-card.white-card:hover .pin-card-frame {
    box-shadow: 0 16px 34px rgba(17, 17, 17, 0.11);
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.42;
    transition: opacity 0.22s ease, background 0.22s ease, transform 0.22s ease;
    border-radius: 999px;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    opacity: 0.92;
    background: rgba(255, 255, 255, 0.08);
}

.lightbox-close:hover {
    transform: scale(1.04);
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-nav:hover {
    transform: translateY(-50%) scale(1.04);
}

.lightbox-nav.prev {
    left: 0.5rem;
}

.lightbox-nav.next {
    right: 0.5rem;
}

.lightbox-meta {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.78rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.lightbox-counter {
    font-weight: 700;
}

.lightbox-hint {
    color: rgba(255, 255, 255, 0.72);
}

.lightbox-img-wrapper {
    width: 90vw;
    height: 85vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: contain;
}

.lightbox-img-wrapper img {
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    cursor: grab;
    transition: transform 0.08s linear, opacity 0.18s ease, filter 0.18s ease;
    opacity: 1;
    filter: blur(0);
    will-change: transform;
    touch-action: none;
}

.lightbox-img-wrapper img:active {
    cursor: grabbing;
}

.lightbox-img-wrapper img.is-loading {
    opacity: 0.28;
    filter: blur(6px);
}

.lightbox-img-wrapper img.is-preview {
    opacity: 0.9;
    filter: blur(1.5px) saturate(0.94);
}

.zoom-slider-container {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    opacity: 0.35;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.zoom-slider-container:hover {
    opacity: 0.82;
}

.zoom-slider-container span {
    color: #fff;
    font-size: 0.8rem;
}

#zoom-slider {
    width: 150px;
    cursor: pointer;
}

.load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 124px;
    margin: 0.75rem auto 0;
    padding: 0.78rem 1.25rem;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.load-more:hover {
    transform: translateY(-1px);
    border-color: var(--color-border-strong);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

@keyframes card-shimmer {
    to {
        background-position-x: -200%;
    }
}

.home-hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at top, #ffffff 0%, #fafafa 55%, #f6f6f6 100%);
}

.home-hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #111;
}

.home-hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.home-cta {
    padding: 1rem 2rem;
    background: #e60023;
    color: #fff;
    text-decoration: none;
    border-radius: 24px;
    font-weight: 600;
}

.site-footer {
    width: 100%;
    padding: 1.4rem 1rem 1.8rem;
    text-align: center;
    background: #fff;
    border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.site-footer--soft {
    background: #f6f6f6;
}

.site-footer__meta {
    margin: 0;
    color: #767676;
    font-size: 0.82rem;
    line-height: 1.75;
}

.site-footer__record {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.4rem;
    color: #767676;
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.18s ease, transform 0.18s ease;
}

.site-footer__record:hover {
    color: #111;
    transform: translateY(-1px);
}

@media (max-width: 767px) {
    :root {
        --nav-height: 56px;
        --filter-top: var(--nav-height);
        --filter-height: 56px;
        --main-content-top: 144px;
    }

    .nav {
        gap: 0.75rem;
        padding: 0.6rem 0.9rem;
    }

    .nav-logo {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .nav-links a {
        padding: 0.6rem 0.85rem;
        font-size: 0.95rem;
    }

    .filter-container {
        padding: 0.55rem 0.9rem;
        gap: 0.4rem;
    }

    .filter-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.92rem;
        min-height: 34px;
    }

    .main-content {
        padding: var(--main-content-top) 0.9rem 2rem;
    }

    .masonry {
        gap: 0.75rem;
    }

    .masonry.detail-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 1.6rem;
    }

    .zoom-slider-container {
        bottom: 1rem;
        width: calc(100vw - 2rem);
        justify-content: center;
    }

    .lightbox-meta {
        top: 0.75rem;
        gap: 0.5rem;
        padding: 0.38rem 0.7rem;
        font-size: 0.72rem;
    }

    #zoom-slider {
        width: min(42vw, 160px);
    }

    .home-hero {
        padding: 2rem 1rem;
    }

    .home-hero h1 {
        font-size: clamp(2.6rem, 13vw, 4rem);
    }

    .home-hero p {
        font-size: 1.1rem;
    }

    .home-cta {
        padding: 0.9rem 1.5rem;
    }

    .site-footer {
        padding: 1.15rem 0.9rem 1.45rem;
    }

    .site-footer__meta,
    .site-footer__record {
        font-size: 0.76rem;
    }
}
