:root {
    --canvas: #f1f0ec;
    --ink: #171717;
    --muted: #77756f;
    --line: rgba(23, 23, 23, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--canvas);
}

body {
    min-width: 320px;
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.site-header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    min-height: 76px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(241, 240, 236, 0.92);
    backdrop-filter: blur(18px);
}

.category-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 5px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 220ms ease, border-color 220ms ease, color 220ms ease;
}

.category-link span {
    color: #a09e97;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.7rem;
}

.category-link:hover,
.category-link.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.category-link:hover span,
.category-link.is-active span {
    color: rgba(255, 255, 255, 0.64);
}

.search-box {
    display: flex;
    flex: 0 0 240px;
    align-items: center;
    border-bottom: 1px solid var(--ink);
}

.search-box input {
    width: 100%;
    min-width: 0;
    padding: 9px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.94rem;
}

.search-box input::placeholder {
    color: #9a9891;
}

.search-box button {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}

.case-wall {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    width: 100%;
    background: var(--line);
}

.case-card {
    min-width: 0;
    background: var(--canvas);
}

.case-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.case-media {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    aspect-ratio: 16 / 10;
    background: #d4d2cc;
}

.case-media::before {
    position: absolute;
    z-index: 4;
    inset: 0;
    border: 1px solid rgba(23, 23, 23, 0.1);
    content: "";
    pointer-events: none;
}

.case-image,
.case-frame,
.case-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.case-image {
    display: block;
    object-fit: cover;
    background: #d9d7d1;
    transition: transform 650ms cubic-bezier(0.2, 0.75, 0.25, 1), filter 360ms ease;
}

.case-frame {
    width: 400%;
    height: 400%;
    border: 0;
    transform: scale(0.25);
    transform-origin: top left;
    background: #fff;
    pointer-events: none;
}

.case-click-catcher {
    position: absolute;
    z-index: 2;
    inset: 0;
}

.case-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.46), transparent 44%), #bcbab3;
    color: rgba(23, 23, 23, 0.46);
    font-size: clamp(1.2rem, 2vw, 2.2rem);
    font-weight: 650;
    letter-spacing: -0.05em;
}

.case-shade {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(180deg, transparent 43%, rgba(10, 10, 10, 0.75) 100%);
    pointer-events: none;
}

.case-meta {
    position: absolute;
    z-index: 3;
    right: clamp(12px, 1.6vw, 22px);
    bottom: clamp(11px, 1.5vw, 20px);
    left: clamp(12px, 1.6vw, 22px);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    pointer-events: none;
}

.case-number {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.68);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.case-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.86rem, 1.1vw, 1rem);
    font-weight: 560;
    letter-spacing: -0.015em;
}

.case-arrow {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 220ms ease, color 220ms ease;
}

.case-link:hover .case-image,
.case-link:focus-visible .case-image {
    filter: saturate(1.06) contrast(1.03);
    transform: scale(1.025);
}

.case-link:hover .case-arrow,
.case-link:focus-visible .case-arrow {
    color: #fff;
    transform: translate(3px, -4px);
}

.case-link:focus-visible {
    position: relative;
    z-index: 5;
    outline: 3px solid rgba(23, 23, 23, 0.54);
    outline-offset: -3px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 112px;
    padding: 24px 20px 92px;
}

.page-button,
.page-ellipsis {
    display: inline-grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    color: var(--muted);
    font-size: 0.88rem;
    text-decoration: none;
}

.page-button {
    border: 1px solid transparent;
    border-radius: 50%;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.page-button:hover,
.page-button.is-current {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.page-arrow {
    border-color: var(--line);
    font-size: 1.35rem;
}

.empty-state {
    min-height: 260px;
    padding-top: 120px;
    color: var(--muted);
    text-align: center;
    font-size: 0.95rem;
}

.contact-float {
    position: fixed;
    z-index: 20;
    right: 22px;
    bottom: 22px;
    display: grid;
    gap: 4px;
    min-width: 212px;
    padding: 13px 16px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    background: rgba(20, 20, 20, 0.93);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.78rem;
    line-height: 1.45;
    backdrop-filter: blur(16px);
}

.contact-float strong {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1100px) {
    .case-wall {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .site-header {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 12px 14px 14px;
    }

    .category-nav {
        width: 100%;
    }

    .search-box {
        flex-basis: auto;
        width: 100%;
    }

    .case-wall {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-float {
        right: 14px;
        bottom: 14px;
    }
}

@media (max-width: 480px) {
    .case-wall {
        grid-template-columns: 1fr;
    }

    .case-media {
        aspect-ratio: 16 / 10;
    }

    .pagination {
        padding-bottom: 104px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .case-image,
    .case-arrow,
    .page-button,
    .category-link {
        transition: none;
    }
}
